DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bernard Iremonger <bernard.iremonger@intel.com>
To: dev@dpdk.org, wenzhuo.lu@intel.com, jingjing.wu@intel.com,
	helin.zhang@intel.com
Cc: Bernard Iremonger <bernard.iremonger@intel.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2 1/2] net/i40e: fix segmentation fault in close
Date: Mon,  9 Jan 2017 16:29:25 +0000	[thread overview]
Message-ID: <1483979366-16914-2-git-send-email-bernard.iremonger@intel.com> (raw)
In-Reply-To: <1483979366-16914-1-git-send-email-bernard.iremonger@intel.com>

Change the order of releasing the vsi's.
Release the vmdq vsi's first, then release the main vsi.

Fixes: 4861cde46116 ("i40e: new poll mode driver")

CC: stable@dpdk.org

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 46def56..3c233e3 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2066,18 +2066,17 @@ i40e_dev_close(struct rte_eth_dev *dev)
 	/* shutdown and destroy the HMC */
 	i40e_shutdown_lan_hmc(hw);
 
-	/* release all the existing VSIs and VEBs */
-	i40e_fdir_teardown(pf);
-	i40e_vsi_release(pf->main_vsi);
-
 	for (i = 0; i < pf->nb_cfg_vmdq_vsi; i++) {
 		i40e_vsi_release(pf->vmdq[i].vsi);
 		pf->vmdq[i].vsi = NULL;
 	}
-
 	rte_free(pf->vmdq);
 	pf->vmdq = NULL;
 
+	/* release all the existing VSIs and VEBs */
+	i40e_fdir_teardown(pf);
+	i40e_vsi_release(pf->main_vsi);
+
 	/* shutdown the adminq */
 	i40e_aq_queue_shutdown(hw, true);
 	i40e_shutdown_adminq(hw);
@@ -4335,6 +4334,9 @@ i40e_vsi_release(struct i40e_vsi *vsi)
 	if (!vsi)
 		return I40E_SUCCESS;
 
+	if (!vsi->adapter)
+		return I40E_ERR_BAD_PTR;
+
 	user_param = vsi->user_param;
 
 	pf = I40E_VSI_TO_PF(vsi);
-- 
2.10.1

  reply	other threads:[~2017-01-09 16:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09 16:29 [dpdk-dev] [PATCH v2 0/2] net/i40e: fix segmentation fault Bernard Iremonger
2017-01-09 16:29 ` Bernard Iremonger [this message]
2017-01-09 16:29 ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: add command to configure VMDq Bernard Iremonger
2017-01-12 13:58 ` [dpdk-dev] [PATCH v3 0/2] net/i40e: fix segmentation fault Bernard Iremonger
2017-01-17 16:39   ` [dpdk-dev] [PATCH v4 " Bernard Iremonger
2017-01-25 14:36     ` [dpdk-dev] [PATCH v5 0/3] " Bernard Iremonger
2017-01-27 10:49       ` [dpdk-dev] [PATCH v6 0/2] app/testpmd: enable VMDq in testpmd Bernard Iremonger
2017-01-27 10:49       ` [dpdk-dev] [PATCH v6 1/2] app/testpmd: add command to configure VMDq Bernard Iremonger
2017-01-27 10:50       ` [dpdk-dev] [PATCH v6 2/2] app/testpmd: fix port stop Bernard Iremonger
2017-02-03  8:21         ` Wu, Jingjing
2017-02-03 10:37           ` Iremonger, Bernard
2017-02-12  4:34             ` Wu, Jingjing
2017-03-10 13:17               ` Thomas Monjalon
2017-03-10 16:56                 ` Wu, Jingjing
2017-03-10 16:59                   ` Iremonger, Bernard
2017-01-25 14:36     ` [dpdk-dev] [PATCH v5 1/3] net/i40e: fix segmentation fault in close Bernard Iremonger
2017-01-25 14:36     ` [dpdk-dev] [PATCH v5 2/3] app/testpmd: add command to configure VMDq Bernard Iremonger
2017-01-25 14:36     ` [dpdk-dev] [PATCH v5 3/3] app/testpmd: fix port stop Bernard Iremonger
2017-01-17 16:39   ` [dpdk-dev] [PATCH v4 1/2] net/i40e: fix segmentation fault in close Bernard Iremonger
2017-01-20 13:15     ` Wu, Jingjing
2017-01-17 16:39   ` [dpdk-dev] [PATCH v4 2/2] app/testpmd: add command to configure VMDq Bernard Iremonger
2017-01-20 13:33     ` Wu, Jingjing
2017-01-20 15:22       ` Iremonger, Bernard
2017-01-12 13:58 ` [dpdk-dev] [PATCH v3 1/2] net/i40e: fix segmentation fault in close Bernard Iremonger
2017-01-17 14:34   ` Wu, Jingjing
2017-01-17 16:30     ` Iremonger, Bernard
2017-01-12 13:58 ` [dpdk-dev] [PATCH v3 2/2] app/testpmd: add command to configure VMDq Bernard Iremonger

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=1483979366-16914-2-git-send-email-bernard.iremonger@intel.com \
    --to=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@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).