patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Xiao Wang <xiao.w.wang@intel.com>
To: tiwei.bie@intel.com, maxime.coquelin@redhat.com
Cc: alejandro.lucero@netronome.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 v4 05/10] net/ifc: store only registered device instance
Date: Sat, 15 Dec 2018 05:16:07 +0800	[thread overview]
Message-ID: <20181214211612.167681-6-xiao.w.wang@intel.com> (raw)
In-Reply-To: <20181214211612.167681-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

       reply	other threads:[~2018-12-14 21:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20181213100910.13087-2-xiao.w.wang@intel.com>
     [not found] ` <20181214211612.167681-1-xiao.w.wang@intel.com>
2018-12-14 21:16   ` Xiao Wang [this message]
2018-12-16  9:12     ` Maxime Coquelin

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=20181214211612.167681-6-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).