From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id 67AE623D for ; Mon, 30 Jul 2018 18:17:16 +0200 (CEST) Received: from 1.general.paelzer.uk.vpn ([10.172.196.172] helo=lap.fritz.box) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1fkAp8-00009D-NK; Mon, 30 Jul 2018 16:15:06 +0000 From: Christian Ehrhardt To: Pablo de Lara Cc: Anatoly Burakov , Remy Horton , dpdk stable Date: Mon, 30 Jul 2018 18:11:23 +0200 Message-Id: <20180730161342.16566-38-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180730161342.16566-1-christian.ehrhardt@canonical.com> References: <20180730161342.16566-1-christian.ehrhardt@canonical.com> Subject: [dpdk-stable] patch 'net/ixgbe: fix crash on detach' has been queued to stable release 18.05.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2018 16:17:16 -0000 Hi, FYI, your patch has been queued to stable release 18.05.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/01/18. So please shout if anyone has objections. Thanks. Christian Ehrhardt --- >>From f31a63a1e7437dc68b4c3be3f96942799c749f45 Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Thu, 31 May 2018 10:53:07 +0100 Subject: [PATCH] net/ixgbe: fix crash on detach [ upstream commit beaa005850a27f6e83f30296c1d0893d1ff49925 ] When detaching a port bound to ixgbe PMD, if the port does not have any VFs, *vfinfo is not set and there is a NULL dereference attempt, when calling rte_eth_switch_domain_free(), which expects VFs to be used, causing a segmentation fault. Steps to reproduce: ./testpmd -- -i testpmd> port stop all testpmd> port close all testpmd> port detach 0 Bugzilla ID: 57 Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports") Reported-by: Anatoly Burakov Signed-off-by: Pablo de Lara Tested-by: Anatoly Burakov Acked-by: Remy Horton --- drivers/net/ixgbe/ixgbe_pf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c index 4d199c802..c381acf44 100644 --- a/drivers/net/ixgbe/ixgbe_pf.c +++ b/drivers/net/ixgbe/ixgbe_pf.c @@ -135,14 +135,14 @@ void ixgbe_pf_host_uninit(struct rte_eth_dev *eth_dev) RTE_ETH_DEV_SRIOV(eth_dev).def_vmdq_idx = 0; RTE_ETH_DEV_SRIOV(eth_dev).def_pool_q_idx = 0; - ret = rte_eth_switch_domain_free((*vfinfo)->switch_domain_id); - if (ret) - PMD_INIT_LOG(WARNING, "failed to free switch domain: %d", ret); - vf_num = dev_num_vf(eth_dev); if (vf_num == 0) return; + ret = rte_eth_switch_domain_free((*vfinfo)->switch_domain_id); + if (ret) + PMD_INIT_LOG(WARNING, "failed to free switch domain: %d", ret); + rte_free(*vfinfo); *vfinfo = NULL; } -- 2.17.1