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 29426A04C0; Mon, 28 Sep 2020 02:50:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 06BAA1C226; Mon, 28 Sep 2020 02:50:19 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id EF7151C21C for ; Mon, 28 Sep 2020 02:50:15 +0200 (CEST) IronPort-SDR: u17burYXZ2CXsvHCz74FU6rVWllBhV+pwggeoiEkYE11pnuQWEYwyqTFkgzK/adB2r92gdbqXc 5A4dmzJXObaw== X-IronPort-AV: E=McAfee;i="6000,8403,9757"; a="223515391" X-IronPort-AV: E=Sophos;i="5.77,312,1596524400"; d="scan'208";a="223515391" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2020 17:50:15 -0700 IronPort-SDR: caqkUGJpeS2bykrpd2P8MlYfoxTgIFnCvzd8nXXqLRw3axYBxP5ScMMFSKeW5kDUjGFMRan2db up0Pg0yEr6vA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,312,1596524400"; d="scan'208";a="350542301" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga007.jf.intel.com with ESMTP; 27 Sep 2020 17:50:14 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 27 Sep 2020 17:50:14 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 27 Sep 2020 17:50:13 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Sun, 27 Sep 2020 17:50:13 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.36.56) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Sun, 27 Sep 2020 17:50:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KuSYe8fgojf6oDhZd1U0IZjN74RF4erxC37VzgDeLP3zMjSP8rnijzhKu9KkpDSy1gyoi4G94QwQG9aX28g4KirjdfJiKWA/3fne74+CKea7Ub/cZlPUMhWYYPQctqi+rvJ08tDPXfV2XNHGm/QeZcvFxEDbeRk7QE0UWBR1rQ+TBUu5gwIXbA58Ox7v4ZDKFYBaL5Y37OxGq8YMxmtl6Ciwab6zRwFzQeaQfJD3pw7g2JscY9W/54ZMo0MPP7qxE0oI2ay+/1os3kOhebZoafAqv2HvBP7hwTZGFcAuTA4zLiG3k16+pBOZ9Lhro7Jabwvk0ja9udzu7WAUv/2hhg== 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:X-MS-Exchange-SenderADCheck; bh=ttcm5AwwBNXiqqVvI3bnqaX/PmAgzKQtzBVM0GyRq8Q=; b=KuiaNpJXsJqu3jC6BA2qfszSEOFYWhhnZfn5bRdysAZ3iYpJmQHeVzhS147U3sYBc0yKM80NkwaV5Jk9z+XGgmmduLYJkaacJ6B8hg4M7FgAB0nBBORMvDy9Hbi589nFPzsIKY4wpTIkuOv/7XOIcSkw6TF5Yxa7SFC0a0VSclS1/2vsRYgJcGQvr9k9W5Wb7LRtodLdOA1is2K0bh/Vcy6AsXwOXYiS6Vab+Rydum8bh5mx597k2z5D1tIXgixABrB20uFW+awQnghfFmoXOghuBFU7Y5B8R4awdbau2zAeOObbnEheSLFO17ylSjk8QgnPqGWvUi1d64C0hRHlcg== 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=ttcm5AwwBNXiqqVvI3bnqaX/PmAgzKQtzBVM0GyRq8Q=; b=l56OtL12L6VQPyhmQKyiTSLJRT3umFvM3MogI8YlSTcTsoHixoML2GJ/Wyh96LAsnh/L7UVQBrMrtBK6iK7ZpDPPKcwcV+nEMz7/GfunoEDwKRmCso8nC8T6lzpA9it1jAB+3xECwFIOSkAOSlNbBxrt6wPP7viMBAIyzSiCYl8= Received: from BYAPR11MB2901.namprd11.prod.outlook.com (2603:10b6:a03:91::23) by BYAPR11MB3815.namprd11.prod.outlook.com (2603:10b6:a03:fa::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.22; Mon, 28 Sep 2020 00:50:09 +0000 Received: from BYAPR11MB2901.namprd11.prod.outlook.com ([fe80::515:a970:3fec:fb73]) by BYAPR11MB2901.namprd11.prod.outlook.com ([fe80::515:a970:3fec:fb73%6]) with mapi id 15.20.3391.027; Mon, 28 Sep 2020 00:50:09 +0000 From: "Xu, Rosen" To: Thomas Monjalon , "dev@dpdk.org" CC: "Yigit, Ferruh" , "arybchenko@solarflare.com" , "Loftus, Ciara" , "Zhang, Qi Z" , Shepard Siegel , Ed Czeck , "John Miller" , Steven Webster , Matt Peters , "Ajit Khaparde" , Somnath Kotur , Rahul Lakkireddy , Hemant Agrawal , Sachin Saxena , "Guo, Jia" , "Wang, Haiyue" , Marcin Wojtas , Michal Krawczyk , Guy Tzalik , "Evgeny Schemeilin" , Igor Chauskin , Gagandeep Singh , John Daley , "Hyong Youb Kim" , "Wang, Xiao W" , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou , "Xing, Beilei" , "Wu, Jingjing" , "Yang, Qiming" , Alfredo Cardigliano , Shijith Thotton , Srisivasubramanian Srinivasan , Matan Azrad , Shahaf Shuler , Zyta Szpak , Liron Himi , Stephen Hemminger , "K. Y. Srinivasan" , "Haiyang Zhang" , Long Li , "Martin Spinler" , Heinrich Kuhn , Harman Kalra , Akhil Goyal , "Jerin Jacob" , Maciej Czekaj , "Maxime Coquelin" , "Xia, Chenbo" , "Wang, Zhihong" , Yong Wang , "Burakov, Anatoly" Thread-Topic: [PATCH v2 19/25] drivers/net: check process type in close operation Thread-Index: AQHWlSgeY4QTRnd4ykGu9OvoaKzWsal9N4sA Date: Mon, 28 Sep 2020 00:50:08 +0000 Message-ID: References: <20200913220711.3768597-1-thomas@monjalon.net> <20200927234249.3198780-1-thomas@monjalon.net> <20200927234249.3198780-20-thomas@monjalon.net> In-Reply-To: <20200927234249.3198780-20-thomas@monjalon.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.5.1.3 dlp-reaction: no-action x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzY2OTQ2MGUtYzA1MC00MmJjLTk4MjMtNDU1ZjJjODA5NDhkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMnZKVGpnMFZmRDhXNHRzSE9tejNOdkJBS1hPa0JsWEVXejNwdTcrdjhXK1A0dzhpNitBRVJsK2tHTGQ3UVh5ZCJ9 x-ctpclassification: CTP_NT authentication-results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.223] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fda5f581-96fe-48eb-445e-08d863487311 x-ms-traffictypediagnostic: BYAPR11MB3815: 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:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tCL9Y3bmfaPQk+S0Gxe2y5qMV1ApUhUpZm1Wz5AZUUBQe2ceX5Y3UjYuUSP/jrNwsHA+Uow32ETAvz9idjk4xaZSFgZGq+tuyGY3u0G9S8oOEZnLGZ/ZscPx+DiAWA5MXJ/theBUvuRUeDn0NjH8aCd+D4E18RnKSbUmMqNMwRy9qLiEW6vup+oAeTZ8aDMcHlUDDh5P6PWdEzC9eMExCVMV7nbiFwnQoxw6QRp98gm5CRFsCGHdBPVlvHrVF0PMFPAC8kh6f/h3f0i2tSI7StoCZwXYiGx2FlYQnerZiFnSYHa5kEbNQI4HqvjeYQsJSHE/WhWPkLyss26nEYdbihPTRd2QbGSK0EKFi+qUj3ipjAtSeXGeaUibZqeMQGMj x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB2901.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(396003)(366004)(376002)(136003)(346002)(7406005)(52536014)(33656002)(9686003)(8676002)(26005)(107886003)(2906002)(83380400001)(54906003)(76116006)(66946007)(66476007)(66556008)(86362001)(478600001)(66446008)(55016002)(64756008)(71200400001)(7416002)(186003)(7696005)(8936002)(6506007)(110136005)(53546011)(4326008)(316002)(5660300002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: CLMPCQBJmV4yTASQpbHRL/7RIZDrnPva4/+Ec0zySE4gTk9FOVEEHLXQTqEeAAzWZr1v8qLXxAsWJKBcKg5zE+dXwu9KAX+38LPT5EafOrglMPAKM9+DRMLPgpFK/ffOqWFkZcYKgiCxZGSi70/HLgoscnhw34zSxM3drqzrII7WeIASlY0PPBxdaP5gttRxaR+hfB2SADYkSPE9wuEJuTxLTdbGoteLl1SCNkomIYg2JBG/bV6lI84lbh5inO30J3NYJU3p53UO9E6BAuL8D0VBdY7lSaxH6ykZk3BRz1LnZ63zX1pr/+XHNfaOWebA8mfTIY11s9z9Ti519qGQyD1ypBhI7720kMZdLJ3Hxq1tIKG298B+N4UQNWU+ExWH5IFK3tFsASlHDjCsoeMOsmn8j6eQLosYxmcAWBtibIFmHz8JbWs/m68BnBvlTcCpIFbl84CuGqJxd0hGAGON5hr7UqwxP4oIQ76XYi/ZPjXI9e9zqMBGSaciY9sN90y4SaVKvcfmLArhOMdWdMNd0uKuSHIRKLZ0NVKkHwR9naeH6O6a9PORENfBUyZ7whSOLvLTiGYp4BalFoee/D8AS7eDnSCoC/C4wH4im5qTAO5+o0HAukI9sd8OAfa2DhIj3tFa4UtRRRRMF9HrQ/jWXw== 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: BYAPR11MB2901.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fda5f581-96fe-48eb-445e-08d863487311 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Sep 2020 00:50:08.6724 (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: 1HBUjUr2ZK4vWARjiW6hVvZ00MZsj8UgxFOt9z5cxPzk9xEUGzV91nc29IHUitR8Fs35Y6URiZ6Q58OhL76mrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3815 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 19/25] drivers/net: check process type in close operation 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" Hi, > -----Original Message----- > From: Thomas Monjalon > Sent: Monday, September 28, 2020 7:43 > To: dev@dpdk.org > Cc: Yigit, Ferruh ; arybchenko@solarflare.com; > Loftus, Ciara ; Zhang, Qi Z ; > Shepard Siegel ; Ed Czeck > ; John Miller ; > Steven Webster ; Matt Peters > ; Ajit Khaparde > ; Somnath Kotur > ; Rahul Lakkireddy > ; Hemant Agrawal > ; Sachin Saxena ; > Guo, Jia ; Wang, Haiyue ; > Marcin Wojtas ; Michal Krawczyk ; > Guy Tzalik ; Evgeny Schemeilin > ; Igor Chauskin ; > Gagandeep Singh ; John Daley ; > Hyong Youb Kim ; Wang, Xiao W > ; Ziyang Xuan ; > Xiaoyun Wang ; Guoyang Zhou > ; Xing, Beilei ; Wu, > Jingjing ; Yang, Qiming ; > Alfredo Cardigliano ; Xu, Rosen > ; Shijith Thotton ; > Srisivasubramanian Srinivasan ; Matan Azrad > ; Shahaf Shuler ; Zyta Szpak > ; Liron Himi ; Stephen Hemminger > ; K. Y. Srinivasan ; > Haiyang Zhang ; Long Li ; > Martin Spinler ; Heinrich Kuhn > ; Harman Kalra ; > Akhil Goyal ; Jerin Jacob ; > Maciej Czekaj ; Maxime Coquelin > ; Xia, Chenbo ; > Wang, Zhihong ; Yong Wang > ; Burakov, Anatoly > Subject: [PATCH v2 19/25] drivers/net: check process type in close operat= ion >=20 > The secondary processes are not allowed to release shared resources. > Only process-private ressources should be freed in a secondary process. > Most of the time, there is no process-private ressource, so the close > operation is just forbidden in a secondary process. >=20 > After adding proper check in the port close functions, some redundant > checks in the device remove functions are dropped. >=20 > Signed-off-by: Thomas Monjalon > --- > drivers/net/af_xdp/rte_eth_af_xdp.c | 3 +++ > drivers/net/ark/ark_ethdev.c | 3 +++ > drivers/net/avp/avp_ethdev.c | 3 +++ > drivers/net/bnxt/bnxt_ethdev.c | 3 +++ > drivers/net/bnxt/bnxt_reps.c | 3 +++ > drivers/net/cxgbe/cxgbe_ethdev.c | 3 +++ > drivers/net/dpaa/dpaa_ethdev.c | 3 +++ > drivers/net/dpaa2/dpaa2_ethdev.c | 3 +++ > drivers/net/e1000/em_ethdev.c | 3 +++ > drivers/net/e1000/igb_ethdev.c | 6 +++++ > drivers/net/ena/ena_ethdev.c | 3 +++ > drivers/net/enetc/enetc_ethdev.c | 3 +++ > drivers/net/enic/enic_ethdev.c | 3 +++ > drivers/net/fm10k/fm10k_ethdev.c | 9 ++----- > drivers/net/hinic/hinic_pmd_ethdev.c | 3 +++ > drivers/net/i40e/i40e_ethdev.c | 2 ++ > drivers/net/i40e/i40e_ethdev_vf.c | 3 +++ > drivers/net/iavf/iavf_ethdev.c | 3 +++ > drivers/net/ice/ice_ethdev.c | 3 +++ > drivers/net/igc/igc_ethdev.c | 6 ++--- > drivers/net/ionic/ionic_ethdev.c | 2 ++ > drivers/net/ipn3ke/ipn3ke_representor.c | 3 +++ > drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++++ > drivers/net/kni/rte_eth_kni.c | 3 +++ > drivers/net/liquidio/lio_ethdev.c | 3 +++ > drivers/net/mlx4/mlx4.c | 2 ++ > drivers/net/mvneta/mvneta_ethdev.c | 3 +++ > drivers/net/mvpp2/mrvl_ethdev.c | 3 +++ > drivers/net/netvsc/hn_ethdev.c | 2 ++ > drivers/net/nfb/nfb_ethdev.c | 3 +++ > drivers/net/nfp/nfp_net.c | 3 +++ > drivers/net/octeontx/octeontx_ethdev.c | 2 ++ > drivers/net/pfe/pfe_ethdev.c | 3 +++ > drivers/net/sfc/sfc_ethdev.c | 32 ++++++++++++------------- > drivers/net/szedata2/rte_eth_szedata2.c | 3 +++ > drivers/net/thunderx/nicvf_ethdev.c | 7 +++--- > drivers/net/vhost/rte_eth_vhost.c | 7 +++--- > drivers/net/virtio/virtio_ethdev.c | 2 ++ > drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 ++ > 39 files changed, 125 insertions(+), 35 deletions(-) >=20 > diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c > b/drivers/net/ipn3ke/ipn3ke_representor.c > index d49abbf758..b9fb4d4e46 100644 > --- a/drivers/net/ipn3ke/ipn3ke_representor.c > +++ b/drivers/net/ipn3ke/ipn3ke_representor.c > @@ -214,6 +214,9 @@ ipn3ke_rpst_dev_close(struct rte_eth_dev *dev) > struct ipn3ke_hw *hw =3D IPN3KE_DEV_PRIVATE_TO_HW(dev); > struct ipn3ke_rpst *rpst =3D IPN3KE_DEV_PRIVATE_TO_RPST(dev); >=20 > + if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) > + return 0; > + > if (hw->retimer.mac_type =3D=3D > IFPGA_RAWDEV_RETIMER_MAC_TYPE_10GE_XFI) { > /* Disable the TX path */ > ipn3ke_xmac_tx_disable(hw, rpst->port_id, 0); diff --git > 2.28.0 For net/ipn3ke Reviewed-by: Rosen Xu