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 41AB2A034F; Mon, 7 Jun 2021 21:16:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B3A2410F1; Mon, 7 Jun 2021 21:16:42 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id B7EFC4003C; Fri, 4 Jun 2021 08:51:39 +0200 (CEST) IronPort-SDR: fvsqOyKKIAK4S4lud8IVjHUrWMp+ucdbqhKPDWToYqFEGSnuGk1uq2arJ1IKono9e2E0lOL2zk 0XQ3Rad/r/9w== X-IronPort-AV: E=McAfee;i="6200,9189,10004"; a="204262731" X-IronPort-AV: E=Sophos;i="5.83,247,1616482800"; d="scan'208";a="204262731" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2021 23:51:37 -0700 IronPort-SDR: Qv4IeVfh870SDPup3/vv17IxVv1bT4dRRvBExfiLtTLnqDVXITWtubGSgabcTbKK4AmxQrg6Ss /aC41aC6RArw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,247,1616482800"; d="scan'208";a="439117426" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga007.jf.intel.com with ESMTP; 03 Jun 2021 23:51:37 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Thu, 3 Jun 2021 23:51:37 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Thu, 3 Jun 2021 23:51:36 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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.2242.4 via Frontend Transport; Thu, 3 Jun 2021 23:51:36 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.175) 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.4; Thu, 3 Jun 2021 23:51:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KSNFFZcTKceoG9KauoN87G5w4SFdYT/MoAMEINh3rQ+nsTM5buvTDm6u7oLQG9bmaaPCBayLQSM+WfOgFVTEvcymAr1xQbK++amQMaSWWitqShek+A1PqL/vt0zDPto2fHI17Co9fWvk9iPaNiF/XJ1IMxjgSjFTov8hoFZdV3V2xK7zivYtyjQmHitasoj8LnAaqpYpGoBiYldG2FfL/10l8rMxlcKxnipmsMzvyLQvENUr/n3ted3b0LvXXawcpCrUOCw9LOYxcTSzH7nbLl9fUTlAv47tnUjO9RJ2sMCOZt2npBg7AUxhz419KyjZ9JvAnnQvt5Fg4OkHhAV1Mw== 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=3IEJI9o16eKbEa1E2Wz8Yhp6s/YNF5xX55uuLiUxSv0=; b=BxueXxaKe/m1UwJ1+8X328Cn2dBYy58ab6LttjRX4HWCUJuHk4dEsZBAkFm+e/iYdXA0mqQ/gkP/vynOif92SCtnfBp4S8i4Ty4iTEKAmCfqJk6/xNTcBgJbVfJQs/muBiR83NFEjNUdXi//JwAp6YCv/XN8/aowtA0tHAUnTLVpD9fBq9qTf8zL5/ZcxuaL6la1QmU4lSEFcpIMfsXn/x8ykbH/wEKrHoUWKzyWUu4AmXpRNw86C1f4teYAAg+gGhvCp8ITszG45mluwYVnK367So/jcY4/gEAKwwLbBg5Nd34cM48y2X+GPZk8QJA+WslnVtnoasIhj7+RPT5R8g== 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=3IEJI9o16eKbEa1E2Wz8Yhp6s/YNF5xX55uuLiUxSv0=; b=iyTOIvnKIJVdqxN7Dk4XQw1wblr/QlGljGSlHOGQLKxaEnXM9v6Qrmcg6a7+dEzVsGvK5Us5L4BGReWLNcQK6Om64HwDH0fdcxHdM7BopPzkgbQSVAbQ9EbvFvqU4C4FL13+/r2N/AL6MQBbKFR+sqIvAMh4v30gXnJOmZ5HtuI= Received: from SA2PR11MB4793.namprd11.prod.outlook.com (2603:10b6:806:fa::8) by SA2PR11MB5179.namprd11.prod.outlook.com (2603:10b6:806:112::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.24; Fri, 4 Jun 2021 06:51:32 +0000 Received: from SA2PR11MB4793.namprd11.prod.outlook.com ([fe80::819f:f4ca:f9b9:97bd]) by SA2PR11MB4793.namprd11.prod.outlook.com ([fe80::819f:f4ca:f9b9:97bd%3]) with mapi id 15.20.4195.024; Fri, 4 Jun 2021 06:51:32 +0000 From: "Wang, Yixue" To: "Zhang, Qi Z" , "Yang, Qiming" CC: "Zhang, Liheng" , "Dong, Yao" , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH v2] net/ice: fix data path corrupt on secondary process Thread-Index: AQHXUfW8g+uMnLWHJkimy6fqbW5zXKsDd6aw Date: Fri, 4 Jun 2021 06:51:32 +0000 Message-ID: References: <20210526055923.1024336-1-qi.z.zhang@intel.com> <20210526061256.1024478-1-qi.z.zhang@intel.com> In-Reply-To: <20210526061256.1024478-1-qi.z.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.0.76 dlp-reaction: no-action authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [222.20.95.85] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ff519601-19bb-46c2-0fae-08d927253009 x-ms-traffictypediagnostic: SA2PR11MB5179: 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:5236; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ye0MtNNUfaT2xOqVPP7jVc/RYkchB4dmQ/A8xIpi6tZqdiJzElpQKmTYv3y9+FJIBJ2111XOh8FGVIjIfNWzhaq2OmloLipOt5nQuO6dAybW6oo4oS3p/9/w5gLqEFoE/d7GTGflYJZIwhntSwy1sCOdy3nYulEvh8PZ4zkhwEiFXggG35pyNCA+fyWCAl7AjoFVIDJFSrXeBPRcK34e5xYH6lI87bmbb9AIGA5Voe5je/lZ1UUf9T/Ktp549pusj3RA7uXLuscrc/qi6jSeDIK3d7IotI8Ot5SzdkvL/41Z3hgViuvPhpyde5zjak5x5zT+6N1b4VOusGflqAwouiM23yCuuF51MEf8WrH3AplZFlpGwNYGztyzq0f9jLOirTF0Cr8+sYwappVpZjTzLOZh7OUOYklJ7FX/Nt5GdGtkzUIKEN9gAtxPBZd1ILXRrRVWdBtsLHSIHLqxGKYG+wiQQNBApq3FSs8Vp/9AD7stQkys67CHw7tsPAcjjCHUMhZO/B71BpRaBASwBJuXtIiEGYvF9U+n74J3aiZWiuZYb4iDrQK/R542KSMbHqCEve1Rp4+idOQ4PuyzyRON+mRMBoOsByuYFDQpKC5JZvI= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR11MB4793.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(376002)(346002)(396003)(136003)(366004)(39860400002)(8676002)(6506007)(7696005)(450100002)(2906002)(30864003)(53546011)(71200400001)(33656002)(5660300002)(122000001)(186003)(316002)(4326008)(66946007)(66446008)(110136005)(86362001)(66476007)(66556008)(9686003)(8936002)(55016002)(76116006)(83380400001)(54906003)(52536014)(64756008)(6636002)(26005)(478600001)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?3mDsgpm6UqTYmu1gxkfwaw0R8Z+1pD/9I3e2SuVUFf1ffVBxLWUO5WwANb0o?= =?us-ascii?Q?1v4q1MdcfDZ+R4Pmv2OqYnCJ1x26siZbXhub0WNPx483kARFqeveUFqJEZ7i?= =?us-ascii?Q?AuYcUqtu9p7XxjOLZ+4nj5Tk3kyxE/y3KY/yamU1ZF8u76pGqVtBFK9mQdyi?= =?us-ascii?Q?o7jLxrX/aPt6FQ4XcQkcw7LZv+8m1qvtoKz13EXBCHfwioiwdnh4q6rNy+x/?= =?us-ascii?Q?HjXMOp0ChbWQRaxXDxDYWFdZWVM24ku94JQJVETDdq6ed7pE8E+I6cMSDtOl?= =?us-ascii?Q?Do5fmrvs9YQsXvR/1DdT+jhlVeGENuUEJfXzei/7CyPSwiuvIm/ORxhpDi78?= =?us-ascii?Q?Bz8xuo3uNhQIxCMeUNovsOnVcPz3Zg2j4eoLzQZE/ib916kYoCTCmRuMkBuW?= =?us-ascii?Q?IHVKUR046Flq6KEc0t4Iemi5wrEAdGdlgo3sEufk8gg5C3fNzNv1dd0s8QEV?= =?us-ascii?Q?VfYQRVivl/O3AsOpuXOhroaIKPq6jQzqHccjeUX5e56IfSll20T3NdRtenRx?= =?us-ascii?Q?mV966/7q9Absx5FRjN4FXLlgMEqoXl1JRqXGPoT0xYiOWn8KKzjVJFt0R/pW?= =?us-ascii?Q?q/MyD4QOdl8+Y4G1WsNZxF3OZNyPqp9jYhGrtQnE8BSfIqC0vxEwKSHJnbO6?= =?us-ascii?Q?SJIP7n9weBPc6oqmi6LKv5/WI6VSePw5lSXWjszlwgEbZD8ZSVtczuIYhzi8?= =?us-ascii?Q?oRMmqFlYkXJq3ek3y6oogdfCK5grkMPWRxh1Wu8+VKUVgx7lEVT1PdWpHaxJ?= =?us-ascii?Q?Y0EWALDi0ib2KkeEDuyaUN41l7q8STD+WSIYVV+OpBODVB1ifKZB+E3FoMNP?= =?us-ascii?Q?GbEbqZBzXJU3bKJ53/9ooxu6fD42uyJBJQ3tRogKpdtNclp0nJvilMMXuSU3?= =?us-ascii?Q?46nyCyfj7M5HtpFFrn2yi/xFqKTgKRmQe1qc62QoeYy1aMipNSv2ELi67a3K?= =?us-ascii?Q?SH8t3mB3WGVg1BBMlOqdMBq4vkS431gzeDFwozNGG4gyus2elZH4d7ZrVP/n?= =?us-ascii?Q?FjX5h4qhGxe/Y2fXsNjpg2isH1G5M8FvH0Ess/DJqrXK5XFczYnzfg1TH//O?= =?us-ascii?Q?OhcJ0iJKSSnsCMKL2xEdaEd2+EariyZJSoAsuK/CfqEagq867mKqVO13vliz?= =?us-ascii?Q?OtBe0HURFClAsi0bUZ8ahMKZgw1UldBPmVk4whTsIl8PD4WqzR/SGaB7RXiI?= =?us-ascii?Q?AGxeeKEQP8Jl7UJqEnMF/McVAN6FWoaBI7lYskxXQuwrrwjP+z3tbQ/1BhoD?= =?us-ascii?Q?VrFsBXyNBIe+0CT502f8dXp9zqta+X8BTfJYNFV3G7y/gs3IRM8B6H0CruI9?= =?us-ascii?Q?TZM=3D?= 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: SA2PR11MB4793.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff519601-19bb-46c2-0fae-08d927253009 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jun 2021 06:51:32.1295 (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: ucjRm0KYY55sQfET8Py9CgUqUX3QMpGUy+aYDA83jPE2ep2AwziG64X5AHFwvIsoWUBHw7LTYhYzMYbYffCGXw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB5179 X-OriginatorOrg: intel.com X-Mailman-Approved-At: Mon, 07 Jun 2021 21:16:40 +0200 Subject: Re: [dpdk-dev] [PATCH v2] net/ice: fix data path corrupt on secondary process 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" Hi Qi, Patch v2 has been tested. Best Regards, Yixue. > -----Original Message----- > From: Zhang, Qi Z > Sent: Wednesday, May 26, 2021 14:13 > To: Yang, Qiming > Cc: Zhang, Liheng ; Wang, Yixue > ; Dong, Yao ; dev@dpdk.org; > Zhang, Qi Z ; stable@dpdk.org > Subject: [PATCH v2] net/ice: fix data path corrupt on secondary process >=20 > The rte_eth_devices array is not in share memory, it should not be refere= nced by > ice_adapter which is shared by primary and secondary. > Any process set ice_adapter->eth_dev will corrupt another process' > context. >=20 > The patch removed the field "eth_dev" from ice_adapter. > Now, when the data paths try to access the rte_eth_dev_data instance, the= y > should replace adapter->eth_dev->data with adapter->pf.dev_data. >=20 > Fixes: f9cf4f864150 ("net/ice: support device initialization") > Cc: stable@dpdk.org >=20 > Reported-by: Yixue Wang > Signed-off-by: Qi Zhang > Tested-by: Yixue Wang > --- >=20 > v2: > - fix some wrong spell. >=20 > drivers/net/ice/ice_dcf_parent.c | 1 - > drivers/net/ice/ice_ethdev.c | 13 ++++++------- > drivers/net/ice/ice_ethdev.h | 3 --- > drivers/net/ice/ice_fdir_filter.c | 6 +++--- > drivers/net/ice/ice_rxtx.c | 24 +++++++++--------------- > drivers/net/ice/ice_rxtx.h | 4 ++-- > drivers/net/ice/ice_rxtx_vec_avx2.c | 2 +- > drivers/net/ice/ice_rxtx_vec_avx512.c | 2 +- > drivers/net/ice/ice_rxtx_vec_common.h | 2 +- > drivers/net/ice/ice_rxtx_vec_sse.c | 2 +- > drivers/net/ice/ice_switch_filter.c | 6 +++--- > 11 files changed, 27 insertions(+), 38 deletions(-) >=20 > diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_p= arent.c > index 1d7aa8bc87..19420a0f58 100644 > --- a/drivers/net/ice/ice_dcf_parent.c > +++ b/drivers/net/ice/ice_dcf_parent.c > @@ -408,7 +408,6 @@ ice_dcf_init_parent_adapter(struct rte_eth_dev > *eth_dev) > const struct rte_ether_addr *mac; > int err; >=20 > - parent_adapter->eth_dev =3D eth_dev; > parent_adapter->pf.adapter =3D parent_adapter; > parent_adapter->pf.dev_data =3D eth_dev->data; > /* create a dummy main_vsi */ > diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c = index > 5fd5f99b6f..6398e310aa 100644 > --- a/drivers/net/ice/ice_ethdev.c > +++ b/drivers/net/ice/ice_ethdev.c > @@ -2055,7 +2055,6 @@ ice_dev_init(struct rte_eth_dev *dev) > intr_handle =3D &pci_dev->intr_handle; >=20 > pf->adapter =3D ICE_DEV_PRIVATE_TO_ADAPTER(dev->data- > >dev_private); > - pf->adapter->eth_dev =3D dev; > pf->dev_data =3D dev->data; > hw->back =3D pf->adapter; > hw->hw_addr =3D (uint8_t *)pci_dev->mem_resource[0].addr; @@ - > 2218,7 +2217,7 @@ ice_release_vsi(struct ice_vsi *vsi) void > ice_vsi_disable_queues_intr(struct ice_vsi *vsi) { > - struct rte_eth_dev *dev =3D vsi->adapter->eth_dev; > + struct rte_eth_dev *dev =3D > +&rte_eth_devices[vsi->adapter->pf.dev_data->port_id]; > struct rte_pci_device *pci_dev =3D ICE_DEV_TO_PCI(dev); > struct rte_intr_handle *intr_handle =3D &pci_dev->intr_handle; > struct ice_hw *hw =3D ICE_VSI_TO_HW(vsi); @@ -2994,7 +2993,7 @@ > static int ice_init_rss(struct ice_pf *pf) { > struct ice_hw *hw =3D ICE_PF_TO_HW(pf); > struct ice_vsi *vsi =3D pf->main_vsi; > - struct rte_eth_dev *dev =3D pf->adapter->eth_dev; > + struct rte_eth_dev_data *dev_data =3D pf->dev_data; > struct ice_aq_get_set_rss_lut_params lut_params; > struct rte_eth_rss_conf *rss_conf; > struct ice_aqc_get_set_rss_keys key; > @@ -3003,8 +3002,8 @@ static int ice_init_rss(struct ice_pf *pf) > bool is_safe_mode =3D pf->adapter->is_safe_mode; > uint32_t reg; >=20 > - rss_conf =3D &dev->data->dev_conf.rx_adv_conf.rss_conf; > - nb_q =3D dev->data->nb_rx_queues; > + rss_conf =3D &dev_data->dev_conf.rx_adv_conf.rss_conf; > + nb_q =3D dev_data->nb_rx_queues; > vsi->rss_key_size =3D ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE; > vsi->rss_lut_size =3D pf->hash_lut_size; >=20 > @@ -3138,7 +3137,7 @@ __vsi_queues_bind_intr(struct ice_vsi *vsi, uint16_= t > msix_vect, void ice_vsi_queues_bind_intr(struct ice_vsi *vsi) { > - struct rte_eth_dev *dev =3D vsi->adapter->eth_dev; > + struct rte_eth_dev *dev =3D > +&rte_eth_devices[vsi->adapter->pf.dev_data->port_id]; > struct rte_pci_device *pci_dev =3D ICE_DEV_TO_PCI(dev); > struct rte_intr_handle *intr_handle =3D &pci_dev->intr_handle; > struct ice_hw *hw =3D ICE_VSI_TO_HW(vsi); @@ -3191,7 +3190,7 @@ > ice_vsi_queues_bind_intr(struct ice_vsi *vsi) void > ice_vsi_enable_queues_intr(struct ice_vsi *vsi) { > - struct rte_eth_dev *dev =3D vsi->adapter->eth_dev; > + struct rte_eth_dev *dev =3D > +&rte_eth_devices[vsi->adapter->pf.dev_data->port_id]; > struct rte_pci_device *pci_dev =3D ICE_DEV_TO_PCI(dev); > struct rte_intr_handle *intr_handle =3D &pci_dev->intr_handle; > struct ice_hw *hw =3D ICE_VSI_TO_HW(vsi); diff --git > a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h index > aebfd1b0b7..7f3c26fb6f 100644 > --- a/drivers/net/ice/ice_ethdev.h > +++ b/drivers/net/ice/ice_ethdev.h > @@ -475,7 +475,6 @@ struct ice_devargs { struct ice_adapter { > /* Common for both PF and VF */ > struct ice_hw hw; > - struct rte_eth_dev *eth_dev; > struct ice_pf pf; > bool rx_bulk_alloc_allowed; > bool rx_vec_allowed; > @@ -526,8 +525,6 @@ struct ice_vsi_vlan_pvid_info { > (&(((struct ice_vsi *)vsi)->adapter->hw)) #define ICE_VSI_TO_PF(vsi) \ > (&(((struct ice_vsi *)vsi)->adapter->pf)) -#define > ICE_VSI_TO_ETH_DEV(vsi) \ > - (((struct ice_vsi *)vsi)->adapter->eth_dev) >=20 > /* ICE_PF_TO */ > #define ICE_PF_TO_HW(pf) \ > diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir= _filter.c > index 092c704503..5e07eb24ae 100644 > --- a/drivers/net/ice/ice_fdir_filter.c > +++ b/drivers/net/ice/ice_fdir_filter.c > @@ -354,7 +354,7 @@ ice_fdir_counter_free(__rte_unused struct ice_pf *pf, > static int ice_fdir_init_filter_list(struct ice_pf *pf) { > - struct rte_eth_dev *dev =3D pf->adapter->eth_dev; > + struct rte_eth_dev *dev =3D &rte_eth_devices[pf->dev_data->port_id]; > struct ice_fdir_info *fdir_info =3D &pf->fdir; > char fdir_hash_name[RTE_HASH_NAMESIZE]; > int ret; > @@ -416,7 +416,7 @@ ice_fdir_release_filter_list(struct ice_pf *pf) stat= ic int > ice_fdir_setup(struct ice_pf *pf) { > - struct rte_eth_dev *eth_dev =3D pf->adapter->eth_dev; > + struct rte_eth_dev *eth_dev =3D &rte_eth_devices[pf->dev_data- > >port_id]; > struct ice_hw *hw =3D ICE_PF_TO_HW(pf); > const struct rte_memzone *mz =3D NULL; > char z_name[RTE_MEMZONE_NAMESIZE]; > @@ -604,7 +604,7 @@ ice_fdir_prof_rm_all(struct ice_pf *pf) static void > ice_fdir_teardown(struct ice_pf *pf) { > - struct rte_eth_dev *eth_dev =3D pf->adapter->eth_dev; > + struct rte_eth_dev *eth_dev =3D &rte_eth_devices[pf->dev_data- > >port_id]; > struct ice_hw *hw =3D ICE_PF_TO_HW(pf); > struct ice_vsi *vsi; > int err; > diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c inde= x > f4f6f48d78..fc9bb5a3e7 100644 > --- a/drivers/net/ice/ice_rxtx.c > +++ b/drivers/net/ice/ice_rxtx.c > @@ -255,11 +255,11 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq) > struct ice_vsi *vsi =3D rxq->vsi; > struct ice_hw *hw =3D ICE_VSI_TO_HW(vsi); > struct ice_pf *pf =3D ICE_VSI_TO_PF(vsi); > - struct rte_eth_dev *dev =3D ICE_VSI_TO_ETH_DEV(rxq->vsi); > + struct rte_eth_dev_data *dev_data =3D rxq->vsi->adapter->pf.dev_data; > struct ice_rlan_ctx rx_ctx; > enum ice_status err; > uint16_t buf_size, len; > - struct rte_eth_rxmode *rxmode =3D &dev->data->dev_conf.rxmode; > + struct rte_eth_rxmode *rxmode =3D &dev_data->dev_conf.rxmode; > uint32_t rxdid =3D ICE_RXDID_COMMS_OVS; > uint32_t regval; >=20 > @@ -270,7 +270,7 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq) > rxq->rx_buf_len =3D RTE_ALIGN(buf_size, (1 << ICE_RLAN_CTX_DBUF_S)); > len =3D ICE_SUPPORT_CHAIN_NUM * rxq->rx_buf_len; > rxq->max_pkt_len =3D RTE_MIN(len, > - dev->data- > >dev_conf.rxmode.max_rx_pkt_len); > + dev_data- > >dev_conf.rxmode.max_rx_pkt_len); >=20 > if (rxmode->offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { > if (rxq->max_pkt_len <=3D ICE_ETH_MAX_LEN || @@ -366,7 > +366,7 @@ ice_program_hw_rx_queue(struct ice_rx_queue *rxq) >=20 > /* Check if scattered RX needs to be used. */ > if (rxq->max_pkt_len > buf_size) > - dev->data->scattered_rx =3D 1; > + dev_data->scattered_rx =3D 1; >=20 > rxq->qrx_tail =3D hw->hw_addr + QRX_TAIL(rxq->reg_idx); >=20 > @@ -1675,7 +1675,6 @@ rx_recv_pkts(void *rx_queue, struct rte_mbuf > **rx_pkts, uint16_t nb_pkts) { > struct ice_rx_queue *rxq =3D (struct ice_rx_queue *)rx_queue; > uint16_t nb_rx =3D 0; > - struct rte_eth_dev *dev; >=20 > if (!nb_pkts) > return 0; > @@ -1692,8 +1691,7 @@ rx_recv_pkts(void *rx_queue, struct rte_mbuf > **rx_pkts, uint16_t nb_pkts) > if (ice_rx_alloc_bufs(rxq) !=3D 0) { > uint16_t i, j; >=20 > - dev =3D ICE_VSI_TO_ETH_DEV(rxq->vsi); > - dev->data->rx_mbuf_alloc_failed +=3D > + rxq->vsi->adapter->pf.dev_data->rx_mbuf_alloc_failed > +=3D > rxq->rx_free_thresh; > PMD_RX_LOG(DEBUG, "Rx mbuf alloc failed for " > "port_id=3D%u, queue_id=3D%u", > @@ -1766,7 +1764,6 @@ ice_recv_scattered_pkts(void *rx_queue, > uint64_t dma_addr; > uint64_t pkt_flags; > uint32_t *ptype_tbl =3D rxq->vsi->adapter->ptype_tbl; > - struct rte_eth_dev *dev; >=20 > while (nb_rx < nb_pkts) { > rxdp =3D &rx_ring[rx_id]; > @@ -1779,8 +1776,7 @@ ice_recv_scattered_pkts(void *rx_queue, > /* allocate mbuf */ > nmb =3D rte_mbuf_raw_alloc(rxq->mp); > if (unlikely(!nmb)) { > - dev =3D ICE_VSI_TO_ETH_DEV(rxq->vsi); > - dev->data->rx_mbuf_alloc_failed++; > + rxq->vsi->adapter->pf.dev_data- > >rx_mbuf_alloc_failed++; > break; > } > rxd =3D *rxdp; /* copy descriptor in ring to temp variable*/ @@ - > 2104,7 +2100,7 @@ ice_fdir_setup_tx_resources(struct ice_pf *pf) > return -EINVAL; > } >=20 > - dev =3D pf->adapter->eth_dev; > + dev =3D &rte_eth_devices[pf->adapter->pf.dev_data->port_id]; >=20 > /* Allocate the TX queue data structure. */ > txq =3D rte_zmalloc_socket("ice fdir tx queue", @@ -2162,7 +2158,7 @@ > ice_fdir_setup_rx_resources(struct ice_pf *pf) > return -EINVAL; > } >=20 > - dev =3D pf->adapter->eth_dev; > + dev =3D &rte_eth_devices[pf->adapter->pf.dev_data->port_id]; >=20 > /* Allocate the RX queue data structure. */ > rxq =3D rte_zmalloc_socket("ice fdir rx queue", @@ -2231,7 +2227,6 @@ > ice_recv_pkts(void *rx_queue, > uint64_t dma_addr; > uint64_t pkt_flags; > uint32_t *ptype_tbl =3D rxq->vsi->adapter->ptype_tbl; > - struct rte_eth_dev *dev; >=20 > while (nb_rx < nb_pkts) { > rxdp =3D &rx_ring[rx_id]; > @@ -2244,8 +2239,7 @@ ice_recv_pkts(void *rx_queue, > /* allocate mbuf */ > nmb =3D rte_mbuf_raw_alloc(rxq->mp); > if (unlikely(!nmb)) { > - dev =3D ICE_VSI_TO_ETH_DEV(rxq->vsi); > - dev->data->rx_mbuf_alloc_failed++; > + rxq->vsi->adapter->pf.dev_data- > >rx_mbuf_alloc_failed++; > break; > } > rxd =3D *rxdp; /* copy descriptor in ring to temp variable*/ diff -- > git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h index > b29387ca0f..86b6f3dcc0 100644 > --- a/drivers/net/ice/ice_rxtx.h > +++ b/drivers/net/ice/ice_rxtx.h > @@ -277,8 +277,8 @@ int ice_get_monitor_addr(void *rx_queue, struct > rte_power_monitor_cond *pmc); >=20 > #define FDIR_PARSING_ENABLE_PER_QUEUE(ad, on) do { \ > int i; \ > - for (i =3D 0; i < (ad)->eth_dev->data->nb_rx_queues; i++) { \ > - struct ice_rx_queue *rxq =3D (ad)->eth_dev->data->rx_queues[i]; > \ > + for (i =3D 0; i < (ad)->pf.dev_data->nb_rx_queues; i++) { \ > + struct ice_rx_queue *rxq =3D (ad)->pf.dev_data->rx_queues[i]; \ > if (!rxq) \ > continue; \ > rxq->fdir_enabled =3D on; \ > diff --git a/drivers/net/ice/ice_rxtx_vec_avx2.c > b/drivers/net/ice/ice_rxtx_vec_avx2.c > index 8d4bd6df1b..165bc1bb9d 100644 > --- a/drivers/net/ice/ice_rxtx_vec_avx2.c > +++ b/drivers/net/ice/ice_rxtx_vec_avx2.c > @@ -466,7 +466,7 @@ _ice_recv_raw_pkts_vec_avx2(struct ice_rx_queue *rxq, > struct rte_mbuf **rx_pkts, > * needs to load 2nd 16B of each desc for RSS hash parsing, > * will cause performance drop to get into this context. > */ > - if (rxq->vsi->adapter->eth_dev->data- > >dev_conf.rxmode.offloads & > + if (rxq->vsi->adapter->pf.dev_data->dev_conf.rxmode.offloads > & > DEV_RX_OFFLOAD_RSS_HASH) { > /* load bottom half of every 32B desc */ > const __m128i raw_desc_bh7 =3D > diff --git a/drivers/net/ice/ice_rxtx_vec_avx512.c > b/drivers/net/ice/ice_rxtx_vec_avx512.c > index ad6c69da9b..5bba9887d2 100644 > --- a/drivers/net/ice/ice_rxtx_vec_avx512.c > +++ b/drivers/net/ice/ice_rxtx_vec_avx512.c > @@ -583,7 +583,7 @@ _ice_recv_raw_pkts_vec_avx512(struct ice_rx_queue > *rxq, > * needs to load 2nd 16B of each desc for RSS hash > parsing, > * will cause performance drop to get into this context. > */ > - if (rxq->vsi->adapter->eth_dev->data- > >dev_conf.rxmode.offloads & > + if (rxq->vsi->adapter->pf.dev_data- > >dev_conf.rxmode.offloads & > DEV_RX_OFFLOAD_RSS_HASH) { > /* load bottom half of every 32B desc */ > const __m128i raw_desc_bh7 =3D > diff --git a/drivers/net/ice/ice_rxtx_vec_common.h > b/drivers/net/ice/ice_rxtx_vec_common.h > index 6e8d7a6fc5..2d8ef7dc8a 100644 > --- a/drivers/net/ice/ice_rxtx_vec_common.h > +++ b/drivers/net/ice/ice_rxtx_vec_common.h > @@ -195,7 +195,7 @@ _ice_tx_queue_release_mbufs_vec(struct ice_tx_queue > *txq) > i =3D txq->tx_next_dd - txq->tx_rs_thresh + 1; >=20 > #ifdef CC_AVX512_SUPPORT > - struct rte_eth_dev *dev =3D txq->vsi->adapter->eth_dev; > + struct rte_eth_dev *dev =3D > +&rte_eth_devices[txq->vsi->adapter->pf.dev_data->port_id]; >=20 > if (dev->tx_pkt_burst =3D=3D ice_xmit_pkts_vec_avx512 || > dev->tx_pkt_burst =3D=3D ice_xmit_pkts_vec_avx512_offload) { diff -= -git > a/drivers/net/ice/ice_rxtx_vec_sse.c b/drivers/net/ice/ice_rxtx_vec_sse.c > index 6029cc2d99..673e44a243 100644 > --- a/drivers/net/ice/ice_rxtx_vec_sse.c > +++ b/drivers/net/ice/ice_rxtx_vec_sse.c > @@ -478,7 +478,7 @@ _ice_recv_raw_pkts_vec(struct ice_rx_queue *rxq, > struct rte_mbuf **rx_pkts, > * needs to load 2nd 16B of each desc for RSS hash parsing, > * will cause performance drop to get into this context. > */ > - if (rxq->vsi->adapter->eth_dev->data- > >dev_conf.rxmode.offloads & > + if (rxq->vsi->adapter->pf.dev_data->dev_conf.rxmode.offloads > & > DEV_RX_OFFLOAD_RSS_HASH) { > /* load bottom half of every 32B desc */ > const __m128i raw_desc_bh3 =3D > diff --git a/drivers/net/ice/ice_switch_filter.c > b/drivers/net/ice/ice_switch_filter.c > index 4a64db5385..eeed386c63 100644 > --- a/drivers/net/ice/ice_switch_filter.c > +++ b/drivers/net/ice/ice_switch_filter.c > @@ -1585,7 +1585,7 @@ ice_switch_parse_action(struct ice_pf *pf, > struct ice_adv_rule_info *rule_info) > { > struct ice_vsi *vsi =3D pf->main_vsi; > - struct rte_eth_dev *dev =3D pf->adapter->eth_dev; > + struct rte_eth_dev_data *dev_data =3D pf->adapter->pf.dev_data; > const struct rte_flow_action_queue *act_q; > const struct rte_flow_action_rss *act_qgrop; > uint16_t base_queue, i; > @@ -1616,7 +1616,7 @@ ice_switch_parse_action(struct ice_pf *pf, > goto error; > if ((act_qgrop->queue[0] + > act_qgrop->queue_num) > > - dev->data->nb_rx_queues) > + dev_data->nb_rx_queues) > goto error1; > for (i =3D 0; i < act_qgrop->queue_num - 1; i++) > if (act_qgrop->queue[i + 1] !=3D > @@ -1627,7 +1627,7 @@ ice_switch_parse_action(struct ice_pf *pf, > break; > case RTE_FLOW_ACTION_TYPE_QUEUE: > act_q =3D action->conf; > - if (act_q->index >=3D dev->data->nb_rx_queues) > + if (act_q->index >=3D dev_data->nb_rx_queues) > goto error; > rule_info->sw_act.fltr_act =3D > ICE_FWD_TO_Q; > -- > 2.26.2