From: Xiao Wang <xiao.w.wang@intel.com>
To: alejandro.lucero@netronome.com, tiwei.bie@intel.com
Cc: maxime.coquelin@redhat.com, dev@dpdk.org, zhihong.wang@intel.com,
xiaolong.ye@intel.com, Xiao Wang <xiao.w.wang@intel.com>,
stable@dpdk.org
Subject: [dpdk-stable] [PATCH v2 4/9] net/ifc: store only registered device instance
Date: Thu, 13 Dec 2018 09:10:09 +0800 [thread overview]
Message-ID: <20181213011014.110089-5-xiao.w.wang@intel.com> (raw)
In-Reply-To: <20181213011014.110089-1-xiao.w.wang@intel.com>
If driver fails to register ifc VF device into vhost lib, then this
device should not be stored.
Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver")
cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
---
drivers/net/ifc/ifcvf_vdpa.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c
index aacd5f9bf..6fcd50b73 100644
--- a/drivers/net/ifc/ifcvf_vdpa.c
+++ b/drivers/net/ifc/ifcvf_vdpa.c
@@ -781,10 +781,6 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
internal->dev_addr.type = PCI_ADDR;
list->internal = internal;
- pthread_mutex_lock(&internal_list_lock);
- TAILQ_INSERT_TAIL(&internal_list, list, next);
- pthread_mutex_unlock(&internal_list_lock);
-
internal->did = rte_vdpa_register_device(&internal->dev_addr,
&ifcvf_ops);
if (internal->did < 0) {
@@ -792,6 +788,10 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
goto error;
}
+ pthread_mutex_lock(&internal_list_lock);
+ TAILQ_INSERT_TAIL(&internal_list, list, next);
+ pthread_mutex_unlock(&internal_list_lock);
+
rte_atomic32_set(&internal->started, 1);
update_datapath(internal);
--
2.15.1
parent reply other threads:[~2018-12-13 1:23 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20181213011014.110089-1-xiao.w.wang@intel.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181213011014.110089-5-xiao.w.wang@intel.com \
--to=xiao.w.wang@intel.com \
--cc=alejandro.lucero@netronome.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.org \
--cc=tiwei.bie@intel.com \
--cc=xiaolong.ye@intel.com \
--cc=zhihong.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).