From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 87BA7A00E6 for ; Mon, 5 Aug 2019 10:01:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D7C6D1B9FA; Mon, 5 Aug 2019 10:01:15 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 223181B9D9; Mon, 5 Aug 2019 10:01:14 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7580QWu019447; Mon, 5 Aug 2019 01:01:13 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=pfpt0818; bh=Q9scFTtdPs8QcOxjD2ZqKQeaM2/cL+EBta4hDWw0o8E=; b=jwdgKaHxg1MVYj+3j87s0CnbMUFLPUj74OqgC6NaU02yZLIkrCD0cESK2kCZcUOZubPs U2Fr3ecaPXiwSCG3glbt/wl/cMnrQFHTMDMIfG7bPnh6TbpguoedjnqWneQi7G3pqqfO sh1zE/cSmMYSupGr/oDRMTvbFlK7wRiENzaFlfiCsR/v04vnMzA+ZUWrdA4y4SvWGd9a g09bhtQWKXB9XcoD9hflwe5E7z8gCnbABz36S9g5ACopprSovZOIXK/Lt5EMqiUG+xDX ugmpM3t7h58dUEcpUA6aHlsJaa1+5qzjo6DypHbJQ1hhIhDV2jpt1bF3ZU6XAb31+Chv mQ== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2u59skndxw-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 05 Aug 2019 01:01:13 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 5 Aug 2019 01:01:11 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Mon, 5 Aug 2019 01:01:11 -0700 Received: from dc7-eodlnx01.marvell.com (dc7-eodlnx01.marvell.com [10.28.113.51]) by maili.marvell.com (Postfix) with ESMTP id 460823F7041; Mon, 5 Aug 2019 01:01:09 -0700 (PDT) From: To: Jerin Jacob , Maciej Czekaj , Anatoly Burakov CC: , , Amit Gupta Date: Mon, 5 Aug 2019 13:30:44 +0530 Message-ID: <1564992051-11150-1-git-send-email-agupta3@marvell.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-05_03:2019-07-31,2019-08-05 signatures=0 Subject: [dpdk-dev] [PATCH] net/thunderx: fix nicvf cleanup on detaching PCI dev X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Amit Gupta There was a bug while doing PCI detach because of that app gets seg fault as eth_dev is released without stopping/cleaning up mapped nicvf. Fixed this bug by adding nicvf cleanup stupport on PCI detach. Fixes: fdf91e0f2fac ("drivers/net: do not use ethdev driver") Signed-off-by: Amit Gupta --- drivers/net/thunderx/nicvf_ethdev.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index ec57692..56769ef 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -2083,6 +2083,16 @@ static void nicvf_vf_stop(struct rte_eth_dev *dev, struct nicvf *nic, return ret; } static int +nicvf_eth_dev_uninit(struct rte_eth_dev *dev) +{ + PMD_INIT_FUNC_TRACE(); + + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + nicvf_dev_close(dev); + + return 0; +} +static int nicvf_eth_dev_init(struct rte_eth_dev *eth_dev) { int ret; @@ -2256,7 +2266,7 @@ static int nicvf_eth_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, static int nicvf_eth_pci_remove(struct rte_pci_device *pci_dev) { - return rte_eth_dev_pci_generic_remove(pci_dev, NULL); + return rte_eth_dev_pci_generic_remove(pci_dev, nicvf_eth_dev_uninit); } static struct rte_pci_driver rte_nicvf_pmd = { -- 1.8.3.1