From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B2C63A0C4D; Fri, 3 Sep 2021 06:38:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3BD354013F; Fri, 3 Sep 2021 06:38:03 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 06FED40041; Fri, 3 Sep 2021 06:38:00 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10095"; a="206543840" X-IronPort-AV: E=Sophos;i="5.85,264,1624345200"; d="scan'208";a="206543840" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2021 21:37:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,264,1624345200"; d="scan'208";a="521509092" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga004.fm.intel.com with ESMTP; 02 Sep 2021 21:37:34 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 2 Sep 2021 21:37:34 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 2 Sep 2021 21:37:33 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 2 Sep 2021 21:37:33 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Thu, 2 Sep 2021 21:37:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ON6Rf3B+VgIp6tOkrbTNsBbL5Cm16zheLxhP/Hb7e2HMHsbumOZ1Mq0MGoGgRN1YOdEyWwETH7cvNVRd9GEObymsO4ZaLwjAe2CuqglR/G2OznUFf/Uf8mVT5sS73jErXNWHSsXedOMM7JW3JKFj4u9QDgSkCTVx5pSZcpg2+WZPHwRFL3e5TXLO/7+fcjNd3caJMy/76blbBruBAWUntTnnYpd46KA58m6/OuYZWedJMF/FzhVsEMstBkK2y4MdlX7vLlutQlMuPL59dKjUTem9TRoWQN1FScPc7Z+O+k47SCVdy30x2G/QG4HiaR/E47Pe/eXjeMzDwccrQ08OpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=rxyfU/xnh0+/U3PD/RQQoqBiyrhiyS36w0IPIL8TFx4=; b=Ns8oC880okELvbtHpTcRzlQI36w5dXI43jvbPbbsSpMpdbOhZRTNOLPWeZE861ghh0SJCiujNDiSscXBXuH8faXlsjbb5DgujYqdplERzl3upqsci/nVKji+yMm0IgW7NRTEGuQnVDwgFG0DtWgRkbjAWHmtrF3EkWxxYYXNukuHSMnf7/IZ2UTEi0DbIWnqfzaQ3aUoTRgkWMFuudrTu/mxzbJMYhHqUjIbiwLCvjWL6whOsCcWhD4c7id0Ol1fs7vgAQ4yuapQt6sPyHeNOTbdwLbnVXx7/GtHh1shxMO3m4YCeAml6la2FCVHanTRQ2Kt4jBLWm7g8yQrJ5FBiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rxyfU/xnh0+/U3PD/RQQoqBiyrhiyS36w0IPIL8TFx4=; b=hKhOHsLTxXpR5DS+q3PHF0VlrO5gcM+q7HpK+mQ0SaOKUtK/aATd8AYjLZ5DH7Jx1BIsJmrkG3/OkPrrEeLE9uWJXYAfpa4fQkTaiIWB/C2sbHKxsMe8K6oPL52+K0yXwv3HaOhOLmuE3l0dWdhIO4gBNScjyoBKYSLGGpIV6LA= Received: from BN8PR11MB3795.namprd11.prod.outlook.com (2603:10b6:408:82::31) by BN8PR11MB3556.namprd11.prod.outlook.com (2603:10b6:408:8d::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19; Fri, 3 Sep 2021 04:37:29 +0000 Received: from BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::dcf0:d9f6:8024:1879]) by BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::dcf0:d9f6:8024:1879%6]) with mapi id 15.20.4478.022; Fri, 3 Sep 2021 04:37:29 +0000 From: "Wang, Haiyue" To: "Yu, DapengX" , "Yang, Qiming" , "Zhang, Qi Z" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/ice: fix representor port segmentation fault Thread-Index: AQHXn99H5IzVJQXrw0W3tG7TQUYLWKuQ0miQgADP4gCAABhtIA== Date: Fri, 3 Sep 2021 04:37:28 +0000 Message-ID: References: <20210902094408.1294361-1-dapengx.yu@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.0.76 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c4e98e47-4e46-4d54-8809-08d96e948983 x-ms-traffictypediagnostic: BN8PR11MB3556: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:172; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3mwo1WXWeeStQt38EYwIaXvi1p7h3zURAnDtuZjujbpYcRM0n678YWXN5CsquYTmSFrvq0HFvXbiF3aMi7xXdbOlCuo8uHryyvzlRWCGvSH60ZTzd+FRoylK0OAN39NxazoBVsUZFOSr/KZcN9tcQV8bcMA/ZMTywve20fnJwj5hb9UBHdumObNkY7bo3Flgf3GrOr3/5YIaaXLQshK8r1q6IcftMbqvD1IXtrbD0Xrv7PtcEfRALClA12BNvIlrwdwoL6Ow/hn2DjrYGUqwPeH6V9Yq/tpT/T3yMv+IZlEuob/ev//mRzSkrKgEWCrXz2rRegWschDQ65rcKCDmRl+HVNhpFjkZkAByTwBWSOmWIyJ3IGRAEgUWFRErWTiogjqR+wvIIFMuPFhxFbI6EGbpAp/Y7UnExxHS8jkkqYjiyf98/dkAaY2qCCqlHRRq0dUglFPMFZ+Xqpb8LoK9NdM/zOp1MoElgW4inlfsqgybf6BXJabC2w2jpOCFQXNsaXwlqhGPSQfKytLo/nCZFTR0MqOECTz8QRYJBJMfu45plNI5xm10Y8C5m338Cxia6qu2SOwI3lt7IK1mFpwHSOPk7iujIWyq2TBanOXxoMM05EggsqcwPQ2SRwLwopy4wCrff9mNshHDkOHt6xMBOsN0XAG+Rfz3GieR6LANEkA6CfFS2uxr8Gk2GMll0KB70bb3RNbBMV642VjKdaxQSw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN8PR11MB3795.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(54906003)(33656002)(9686003)(7696005)(110136005)(2906002)(55016002)(316002)(38070700005)(508600001)(66556008)(64756008)(66446008)(6636002)(66476007)(83380400001)(450100002)(8936002)(86362001)(4326008)(8676002)(66946007)(186003)(26005)(71200400001)(5660300002)(38100700002)(6506007)(53546011)(52536014)(122000001)(76116006); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?N2EmffHLr7/btDvrBhyokmBMovQ8n5xuo7rrmmvt7T+Wc8NMfwFQlUV+ByDy?= =?us-ascii?Q?sG/fZewxmJf7rm/TAhyLSaVFq7FzQVi+GeRbwtNl2iyNl2DzTZz80HK5q99l?= =?us-ascii?Q?VGwTtcVRm2ebZDZ2s/txySMTNXWEFuAzLzdKL2zL1/JodIEp0EIO0RbXNeqX?= =?us-ascii?Q?HpG9R5XPJDkuJ4AvSDM3j7y6V+lLn10AbifvCeCAqyvAhXynhzc/V45brKh6?= =?us-ascii?Q?NcQpQTEBIsfgPEeuyF9JJqpDAw3xAH2ZUVIy+pzmQ6oVbfrdZ02tkss8+uRn?= =?us-ascii?Q?0guhM2Xtug4CQ9JMNHpGxEcl611OqJ+oz6EyJkn8uF6z9dtgGMDKjGBDZ6Ou?= =?us-ascii?Q?d66mI8w/USeErD+/T+UZ1MHT6JHTKPs9MVADH6SW6vI+NLn6peEhedsoMhRX?= =?us-ascii?Q?zeSCOciZb2vYhc5ppcrF48A7HEmR1Wfw3p9hKrGDPiPNEtbeKqk3c984fx7J?= =?us-ascii?Q?Aaf0Dn0GtP+zJCvG34wGbA9uhUzlNJaPOZF/7FfFbMOiE9n2noEVQiqUYO7v?= =?us-ascii?Q?DwJyeRSZ5wxDghzk6IVKI0FjL8m6hfV0AigmnsfwqgjWJpDUq15GgixvHGW7?= =?us-ascii?Q?JEHnk1xR7JjrQCX6h6usxrEqgM3pzpQ8AbriDQTDku8tMck/7S7vzRxCGqFv?= =?us-ascii?Q?XtMzAoB8qRRAU7HoEj6RDwgkaRjDfrfDEQzP3/EuErfLk2YywhKtFvzvpc6b?= =?us-ascii?Q?je+kozgH5qxtHDSIMbDZ+8foZ5iyxrIbZm11p0rl0C5sxUt0vilCoLmbvlLR?= =?us-ascii?Q?xojr/3MZziVGkLPXkC8EjMUjkUPM6mScJNq1CTsbBIDsWrUq+fd1yil+C1wi?= =?us-ascii?Q?Q/cPvviYed0Yq9jmX51rVLHmbvX4EAqreBdv/dVb1CcIzjk7OFuA0yyUhhHi?= =?us-ascii?Q?RT/zgXDfGRmh6i0kIZuuUdIMizs7feB56GyrhdQCZ57qiEZd5I+Ir9HY3Jng?= =?us-ascii?Q?ejA9CJgoFH6u0SL3E8cYi2SXDc5Qgvit26j7S7WZZl6vB5UtobZEtxKT2rRb?= =?us-ascii?Q?muydoFs26DSE6rvzJ4u2GBc090HHLY1LDA6ZIUhguseGVKnH+xni55AcQXVJ?= =?us-ascii?Q?t0FFgRXIUO8YnRf+mIcPr2VZsnTTtP0OnacxRs20DXSwyGYnQ6OuAs4msFcK?= =?us-ascii?Q?X0tM2kV/aQ7GGoV5TT/2JCdVnJ1qNNh0Z0gPIbVukAriqL+k9e0xpveEvklG?= =?us-ascii?Q?FZcI4qiuKpd0weaU9lvnrNhtXhSVfj6HSjuXsbjxyiSHyPHJ/aA0zb8CLi1q?= =?us-ascii?Q?qn5WhE0ExY9dQriQApAUeylKcynkGvtZokUGZ2UDzHx4xDSKcwhqytfBbNW/?= =?us-ascii?Q?n7ZufVZqBens4QtAT3MCuEYd?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN8PR11MB3795.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4e98e47-4e46-4d54-8809-08d96e948983 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Sep 2021 04:37:28.9740 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: a8eTqLTmO389D2B3UmXPXD72UBIYlJZ1jVkrx2G3pYBNzCvgJrJxDo3/GnrgLMIUEDScFUnZ3khqSfSx01tlCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR11MB3556 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] net/ice: fix representor port segmentation fault X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" > -----Original Message----- > From: Yu, DapengX > Sent: Friday, September 3, 2021 11:09 > To: Wang, Haiyue ; Yang, Qiming ; Zhang, Qi Z > > Cc: dev@dpdk.org; stable@dpdk.org > Subject: RE: [PATCH] net/ice: fix representor port segmentation fault >=20 >=20 >=20 > > -----Original Message----- > > From: Wang, Haiyue > > Sent: Thursday, September 2, 2021 10:45 PM > > To: Yu, DapengX ; Yang, Qiming > > ; Zhang, Qi Z > > Cc: dev@dpdk.org; stable@dpdk.org > > Subject: RE: [PATCH] net/ice: fix representor port segmentation fault > > > > > -----Original Message----- > > > From: Yu, DapengX > > > Sent: Thursday, September 2, 2021 17:44 > > > To: Yang, Qiming ; Zhang, Qi Z > > > > > > Cc: dev@dpdk.org; Wang, Haiyue ; Yu, DapengX > > > ; stable@dpdk.org > > > Subject: [PATCH] net/ice: fix representor port segmentation fault > > > > > > From: Dapeng Yu > > > > > > If DCF representor port is closed after DCF port is closed, there wil= l > > > be segmentation fault because representor accesses the released > > > resource of DCF port. > > > > > > This patch makes DCF representor port is always closed before DCF por= t > > > is closed. > > > > > > Fixes: 5674465a32c8 ("net/ice: add DCF VLAN handling") > > > Cc: stable@dpdk.org > > > > > > Signed-off-by: Dapeng Yu > > > --- > > > drivers/net/ice/ice_dcf_ethdev.c | 1 + > > > drivers/net/ice/ice_dcf_ethdev.h | 1 + > > > drivers/net/ice/ice_dcf_vf_representor.c | 26 > > > ++++++++++++++++++++---- > > > 3 files changed, 24 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/net/ice/ice_dcf_ethdev.c > > > b/drivers/net/ice/ice_dcf_ethdev.c > > > index cab7c4da87..b837f69fd4 100644 > > > --- a/drivers/net/ice/ice_dcf_ethdev.c > > > +++ b/drivers/net/ice/ice_dcf_ethdev.c > > > @@ -874,6 +874,7 @@ ice_dcf_dev_close(struct rte_eth_dev *dev) > > > if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) > > > return 0; > > > > > > + ice_dcf_vf_repr_close_all(adapter); > > > ice_dcf_free_repr_info(adapter); > > > ice_dcf_uninit_parent_adapter(dev); > > > ice_dcf_uninit_hw(dev, &adapter->real_hw); diff --git > > > a/drivers/net/ice/ice_dcf_ethdev.h b/drivers/net/ice/ice_dcf_ethdev.h > > > index 8510e37119..9e8d3ef0c5 100644 > > > --- a/drivers/net/ice/ice_dcf_ethdev.h > > > +++ b/drivers/net/ice/ice_dcf_ethdev.h > > > @@ -64,5 +64,6 @@ int ice_dcf_vf_repr_init(struct rte_eth_dev > > > *vf_rep_eth_dev, void *init_param); int ice_dcf_vf_repr_uninit(struc= t > > > rte_eth_dev *vf_rep_eth_dev); int ice_dcf_vf_repr_init_vlan(struct > > > rte_eth_dev *vf_rep_eth_dev); void ice_dcf_vf_repr_stop_all(struct > > > ice_dcf_adapter *dcf_adapter); > > > +void ice_dcf_vf_repr_close_all(struct ice_dcf_adapter *dcf_adapter); > > > > > > #endif /* _ICE_DCF_ETHDEV_H_ */ > > > diff --git a/drivers/net/ice/ice_dcf_vf_representor.c > > > b/drivers/net/ice/ice_dcf_vf_representor.c > > > index 970461f3e9..121dea7483 100644 > > > --- a/drivers/net/ice/ice_dcf_vf_representor.c > > > +++ b/drivers/net/ice/ice_dcf_vf_representor.c > > > @@ -46,6 +46,7 @@ static int > > > ice_dcf_vf_repr_dev_stop(struct rte_eth_dev *dev) { > > > dev->data->dev_link.link_status =3D ETH_LINK_DOWN; > > > + dev->data->dev_started =3D 0; > > > > > > return 0; > > > } > > > @@ -53,6 +54,7 @@ ice_dcf_vf_repr_dev_stop(struct rte_eth_dev *dev) > > > static int ice_dcf_vf_repr_dev_close(struct rte_eth_dev *dev) { > > > + (void)ice_dcf_vf_repr_dev_stop(dev); > > > > Do we truly need the "(void)" ? >=20 > Here use (void) to make discarding of return value explicit. No need so paranoid ;-) > There will be no compiler(clang, icc, and gcc) warning even if remove (vo= id) > So it is fine without that. Then code is clean. > > > -- > > > 2.27.0