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 480A5424BD; Mon, 30 Jan 2023 08:51:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3743140EE5; Mon, 30 Jan 2023 08:51:56 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 319CA40C35 for ; Mon, 30 Jan 2023 08:51:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675065114; x=1706601114; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=D/WbHwbcaAxDlqquvfNDqtYkcLWR8qrW03037sK8iLs=; b=OfJZgSCzeC7Y6Q1s+60XrNH5VKDfG6maNUwGQBhMhdvt2gZ+T1xxpTMr xp2Ln8MzOt7aOnPlvJoDm4HnlnPBAbU5/Pbdsdj1SgFZhbUiybanrD/oN se05y0H1plarv8lXjxb67XvJ1FtPNt+WqGMi4FGLRKMEoomRVXiobrEkA 9BlH5Aa9EOTa+GBsch7rUNW4XkvBWKQjXyrqtuSqalfOP0bpJ1YATIvft pi8vdAPM8Nudf23RF7ORS/O1cUlcruuIQ17wuE7ngOCWiQqncHmyltU9n uTX8384CMZ5HmzMYggr2dRLtjBpQt5frNCrK8dp6NTjvMgKW9TTMMFgU+ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10605"; a="413717923" X-IronPort-AV: E=Sophos;i="5.97,257,1669104000"; d="scan'208";a="413717923" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2023 23:51:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10605"; a="752723138" X-IronPort-AV: E=Sophos;i="5.97,257,1669104000"; d="scan'208";a="752723138" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by FMSMGA003.fm.intel.com with ESMTP; 29 Jan 2023 23:51:53 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Sun, 29 Jan 2023 23:51:52 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Sun, 29 Jan 2023 23:51:52 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Sun, 29 Jan 2023 23:51:52 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.45) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Sun, 29 Jan 2023 23:51:51 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ie/TxtDobCquDUGLJjDPD2wlcjP/IobdEfEDa7xLJGpuYQOkqM90FoWCb/6WWbStAOyP7fGaxZO6rr8jfQTwhdS4/jez8ovXoV795PhmGamGG99G5OiJg6EOyPywPnYRZbAyXkyvqNrXocRkez1QcHGtKP7PeVD65IEdweGjZ63jAxXPAYpVGJP51zWiU7voF2y3R8H4eJftzKWSimE+JwnnRcJVsW3tUeGVzejNzEH8KnArOASMGcvxD8CvRmkPubGA4Nt4czhgilRkXpJEdWR/GwMGARA/F3+BkA9NOft1iu0TwSizK+KWk0zgrPfyeiKkIPpFcMaTgU3Qqh1PyQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PNeSGtc6VvlmEN0BIuGFdAzddCUVxah/FEaoHRe5Q/U=; b=AYN8bPzvuyyLwcQ67C5lT+/Wf9ocTrcZUAaEM/7gntgN9UBc148oqiD/KIXR3mQh9MrsFi4nWfa8vOrLdIB8B/c3tlGDEMoNxi/3RIl49MX9CVPZHul0VBEZ1AIywQ/2cPVnhDVNmnEWoBE0bef7XtNGMHUOaE3IfV2PkQsji0JlvC9Exccwpj7rR7qmcxc6srcE08na9KyhvecDXkhVugz5n6OMAW3mSgC76JyrOVaQgF8QSIMluELenJLz2e0JHbVtE/KzkOA+DgzIQf0xnE1ccpbV05hg8JbISVLa01oTHXy0AOJ7GFhc3MNuRIzFs0Ab+6HIs1Eo1IerftFeYA== 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 Received: from SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by SJ0PR11MB4990.namprd11.prod.outlook.com (2603:10b6:a03:2d8::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Mon, 30 Jan 2023 07:51:48 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::c8f8:a3e1:5b23:a9c3]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::c8f8:a3e1:5b23:a9c3%5]) with mapi id 15.20.6043.033; Mon, 30 Jan 2023 07:51:48 +0000 From: "Xia, Chenbo" To: "Coquelin, Maxime" , "dev@dpdk.org" , "david.marchand@redhat.com" , "eperezma@redhat.com" Subject: RE: [PATCH v1 04/21] net/virtio: remove port ID info from Rx queue Thread-Topic: [PATCH v1 04/21] net/virtio: remove port ID info from Rx queue Thread-Index: AQHZBNRnzqxkzmSxWEaebOq8M4btr6629bTw Date: Mon, 30 Jan 2023 07:51:47 +0000 Message-ID: References: <20221130155639.150553-1-maxime.coquelin@redhat.com> <20221130155639.150553-5-maxime.coquelin@redhat.com> In-Reply-To: <20221130155639.150553-5-maxime.coquelin@redhat.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN6PR11MB3504:EE_|SJ0PR11MB4990:EE_ x-ms-office365-filtering-correlation-id: 09618057-5208-46d0-a018-08db0296d71c x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: kyrG9q7F5RIquMS4I4uytdEtru9VIIAzMyIQOS5EL4JRfNGNtawGcYSlUqTExgIwKXRkLRMBTqIOHqZmMAoG46258sjDrbuIKHdOIqbMagi44kADR4EjNtL55nhVWCzlCqqT/pPYPWl2wtq3JpaTqcSM6BS8yRdSckFtuzU7HMc3mUn3s63a2T02UVqZB/6Qny7pEfcWWp4ocM7UhtoqQ6VaT6frBKAne1eEKc5r82TehQWFMcBVU+CFwuxrjqRvxvqs4GXAatJra5EdBtU73ZQ9J3FLJGmPYnnKrzB7s9in62WhTZ74SbbOcpgkvlS3YLWoWTV5gtFmBQu6a+wZc1nKhaecJL9Hpl1d9sGVY64+a6ZHDB50aFqH6jbY2N0L4vvNtbNnwa/mBdjVCFxVFQk2DTnt7w9AI0x5KHwVChv4nkn8iRMX8LMkODPBjyveFedSSmjC3tctp52Jci7pDQjVf4j8LJR1NE6N6eeab8A06cUhBm/o6mqk4ZBdVxO4wIeAvuuVW4xUwwKqOIDRZeNBfk+Rzg4ybqJZ91QNloGaPLabwsaM0EB/ZnisNBFx7B9Z3BletysHJxQXGiD34JMvcXBmOARZANUR8R335+Jfb0n3oEurljmJ2hTKTpaBVwGFeyZw36eaemrquZYuOb2h00R0dPM0BMAtGjyEGZo9I6kynLKBrS0IcYm/xRThvrWBloK1O+RWe8MF6LcM+w== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(136003)(39860400002)(376002)(366004)(396003)(346002)(451199018)(110136005)(316002)(66946007)(66476007)(8676002)(66556008)(66446008)(76116006)(64756008)(8936002)(52536014)(5660300002)(122000001)(38100700002)(86362001)(38070700005)(33656002)(82960400001)(41300700001)(53546011)(71200400001)(9686003)(26005)(6506007)(186003)(55016003)(2906002)(478600001)(7696005)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xBJhU6/NloXRYggBSUqgC9kl6oC9Ybre+194kyR+7vz5tu1/uM5J16kbzKBt?= =?us-ascii?Q?tPsS1qEKC45DEFn1aj1wPET3XZNTI6GCD7D+DhtAdDV+PsSB3LUr9HgxKbpl?= =?us-ascii?Q?W23wFwsOQRE2dqnmyKmfUOeBzseHCB/QUy9pJB+u/CQvB3C7cg9qJkRJV6ax?= =?us-ascii?Q?Kya61MrIxC0WeVN2jrGwIJ5sZhjV/Dtf1vbi6coQB4t+N6l7YVuTE13lfyCW?= =?us-ascii?Q?UHPkvy0YPJN6Hpn7b26bLh86tiIbb+1tDMWPEy79XbO9HlRFO7EPHmzeoHEN?= =?us-ascii?Q?fY9apombvV4DxzSx8FCwREJR3Pog0w0QZ2Mi0Xwyi7ME7ETLwE7ogTaGx2fr?= =?us-ascii?Q?juPG3JAgiYM/ErlsYhv+zfp9vcqy42kPjbj3ODOMrDJ9abMDG9ZP8ZBPXyna?= =?us-ascii?Q?8mgbl3nWl0sujiU/I8gMo2yzB7CKVJMFNYn2JrloQA98nWU1JST9wqlkM6wl?= =?us-ascii?Q?RnoVGFSghWMVRAbLby+uCJcTr00eydob0RukfQOMp1uquiqRt+8OHcDrJaY+?= =?us-ascii?Q?coI0tLjHapY63nnvPPzkePFThs3dYMl49j/TpMU7l2MHWDUi3cxEiktt49BW?= =?us-ascii?Q?Yl+Vb+gs93ZdF05OUBrVC0B1XG1jUgF9qCFaeaKHPpxME/bfe7zki9X22UrF?= =?us-ascii?Q?MNrBhFdULzxMw9+YbZsQRihCwv5X3c6A+Q8fhRHFyzQlMogTTOrZR7IRWndd?= =?us-ascii?Q?V0AJq4EP26FhyREsNDLe6dhimq3OrswO/eGmSFG1WRrH6NIJiWsUY7moTx9q?= =?us-ascii?Q?XZGhve6X9RCOkjLCLgVcYcuQkIIT8m3Ol0PkjTA6b5Fll0X++5qOHvUG7lZ7?= =?us-ascii?Q?WKdtBfOZyFOsakyTmhQD5f4wfCCW6C4PcD5HlEeZ04Tka0jeegGjya2fP0kE?= =?us-ascii?Q?zVmo7JcAZgkomYWonr+f8C0PsdbfXTA+gEet/hlVe632Jajh8kPyKZe8Zx1E?= =?us-ascii?Q?SMwoVXW6xxHEGYjQPhcmw34Nz8mq1FwPqg0eOzrK+IqMJxgOCNYuSMDX/tOT?= =?us-ascii?Q?rW0Ep4Jg/KgQGaB5gXh4wDWQHRYiUEoay4w9X0rvrlJvDTd4jgTHuEIyusf9?= =?us-ascii?Q?aE86FTtvt9d6LLSnh+BJ2C1suObZLoiFbTmIPpb9in369mQlLbCrw/qpAJm6?= =?us-ascii?Q?/GNlCHGcTBLEU0xRoO0A08HC8g19n4W2Tchg1wnjUQWJXp32noKSx6qIucxf?= =?us-ascii?Q?jZw2KztfCRR/PK49cA3CJpVocPR0o9E/2J5IE83QDdTcK7Q8GrSnRBmBmaYj?= =?us-ascii?Q?LItcRXkG5RcXdRQ93CMuP/wRBWXmkgysrnRaujkDtCUvrnnSarOZYeMqjCWY?= =?us-ascii?Q?fRriZyKVUey52vaQKbVuuUem9mQqPTbrR7Xcs80H4aWWcA8S7hXX/glVin1E?= =?us-ascii?Q?Qyu+KTByDJBwEHLRpGXo9UNAF2zKDH4/PhKiGc3OICHOOJgcUTgNOvKSqBMz?= =?us-ascii?Q?/v3RR3tM+3SkAsXkYlfeTQn6qLQl3TDC2G3/LNxP4O8D+qY3nnfUv1lGAlE9?= =?us-ascii?Q?U26uN7dZ1mTJomzp1a8nX2j3Ofc1SnGXc4Fr6OweN6azjRvXm0gWOLFx1Tck?= =?us-ascii?Q?3LeRhDpkQJpBGSDmNGjCUtnxViAIe6MvH5qfrYpE?= 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: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09618057-5208-46d0-a018-08db0296d71c X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2023 07:51:47.9915 (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: JONw9PFbv2dRLc5SGzcw4PyOI8hb/OkZESjYKlhYuVgzyKr6WYv29/LrfHLKgZZfFBk3bPLD/TK+pcqmkCzrmg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4990 X-OriginatorOrg: intel.com 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 > -----Original Message----- > From: Maxime Coquelin > Sent: Wednesday, November 30, 2022 11:56 PM > To: dev@dpdk.org; Xia, Chenbo ; > david.marchand@redhat.com; eperezma@redhat.com > Cc: Maxime Coquelin > Subject: [PATCH v1 04/21] net/virtio: remove port ID info from Rx queue >=20 > The port ID information is duplicated in several places. > This patch removes it from the virtnet_rx struct as it can > be found in virtio_hw struct. >=20 > Signed-off-by: Maxime Coquelin > --- > drivers/net/virtio/virtio_ethdev.c | 1 - > drivers/net/virtio/virtio_rxtx.c | 25 ++++++++++--------------- > drivers/net/virtio/virtio_rxtx.h | 1 - > drivers/net/virtio/virtio_rxtx_packed.c | 3 +-- > drivers/net/virtio/virtio_rxtx_simple.c | 3 ++- > drivers/net/virtio/virtio_rxtx_simple.h | 5 +++-- > 6 files changed, 16 insertions(+), 22 deletions(-) >=20 > diff --git a/drivers/net/virtio/virtio_ethdev.c > b/drivers/net/virtio/virtio_ethdev.c > index cead5f0884..1c68e5a283 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -462,7 +462,6 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t > queue_idx) >=20 > vq->sw_ring =3D sw_ring; > rxvq =3D &vq->rxq; > - rxvq->port_id =3D dev->data->port_id; > rxvq->mz =3D mz; > rxvq->fake_mbuf =3D fake_mbuf; > } else if (queue_type =3D=3D VTNET_TQ) { > diff --git a/drivers/net/virtio/virtio_rxtx.c > b/drivers/net/virtio/virtio_rxtx.c > index bd95e8ceb5..45c04aa3f8 100644 > --- a/drivers/net/virtio/virtio_rxtx.c > +++ b/drivers/net/virtio/virtio_rxtx.c > @@ -1024,7 +1024,7 @@ virtio_recv_pkts(void *rx_queue, struct rte_mbuf > **rx_pkts, uint16_t nb_pkts) > continue; > } >=20 > - rxm->port =3D rxvq->port_id; > + rxm->port =3D hw->port_id; > rxm->data_off =3D RTE_PKTMBUF_HEADROOM; > rxm->ol_flags =3D 0; > rxm->vlan_tci =3D 0; > @@ -1066,8 +1066,7 @@ virtio_recv_pkts(void *rx_queue, struct rte_mbuf > **rx_pkts, uint16_t nb_pkts) > } > nb_enqueued +=3D free_cnt; > } else { > - struct rte_eth_dev *dev =3D > - &rte_eth_devices[rxvq->port_id]; > + struct rte_eth_dev *dev =3D &rte_eth_devices[hw->port_id]; > dev->data->rx_mbuf_alloc_failed +=3D free_cnt; > } > } > @@ -1127,7 +1126,7 @@ virtio_recv_pkts_packed(void *rx_queue, struct > rte_mbuf **rx_pkts, > continue; > } >=20 > - rxm->port =3D rxvq->port_id; > + rxm->port =3D hw->port_id; > rxm->data_off =3D RTE_PKTMBUF_HEADROOM; > rxm->ol_flags =3D 0; > rxm->vlan_tci =3D 0; > @@ -1169,8 +1168,7 @@ virtio_recv_pkts_packed(void *rx_queue, struct > rte_mbuf **rx_pkts, > } > nb_enqueued +=3D free_cnt; > } else { > - struct rte_eth_dev *dev =3D > - &rte_eth_devices[rxvq->port_id]; > + struct rte_eth_dev *dev =3D &rte_eth_devices[hw->port_id]; > dev->data->rx_mbuf_alloc_failed +=3D free_cnt; > } > } > @@ -1258,7 +1256,7 @@ virtio_recv_pkts_inorder(void *rx_queue, > rxm->pkt_len =3D (uint32_t)(len[i] - hdr_size); > rxm->data_len =3D (uint16_t)(len[i] - hdr_size); >=20 > - rxm->port =3D rxvq->port_id; > + rxm->port =3D hw->port_id; >=20 > rx_pkts[nb_rx] =3D rxm; > prev =3D rxm; > @@ -1352,8 +1350,7 @@ virtio_recv_pkts_inorder(void *rx_queue, > } > nb_enqueued +=3D free_cnt; > } else { > - struct rte_eth_dev *dev =3D > - &rte_eth_devices[rxvq->port_id]; > + struct rte_eth_dev *dev =3D &rte_eth_devices[hw->port_id]; > dev->data->rx_mbuf_alloc_failed +=3D free_cnt; > } > } > @@ -1437,7 +1434,7 @@ virtio_recv_mergeable_pkts(void *rx_queue, > rxm->pkt_len =3D (uint32_t)(len[i] - hdr_size); > rxm->data_len =3D (uint16_t)(len[i] - hdr_size); >=20 > - rxm->port =3D rxvq->port_id; > + rxm->port =3D hw->port_id; >=20 > rx_pkts[nb_rx] =3D rxm; > prev =3D rxm; > @@ -1530,8 +1527,7 @@ virtio_recv_mergeable_pkts(void *rx_queue, > } > nb_enqueued +=3D free_cnt; > } else { > - struct rte_eth_dev *dev =3D > - &rte_eth_devices[rxvq->port_id]; > + struct rte_eth_dev *dev =3D &rte_eth_devices[hw->port_id]; > dev->data->rx_mbuf_alloc_failed +=3D free_cnt; > } > } > @@ -1610,7 +1606,7 @@ virtio_recv_mergeable_pkts_packed(void *rx_queue, > rxm->pkt_len =3D (uint32_t)(len[i] - hdr_size); > rxm->data_len =3D (uint16_t)(len[i] - hdr_size); >=20 > - rxm->port =3D rxvq->port_id; > + rxm->port =3D hw->port_id; > rx_pkts[nb_rx] =3D rxm; > prev =3D rxm; >=20 > @@ -1699,8 +1695,7 @@ virtio_recv_mergeable_pkts_packed(void *rx_queue, > } > nb_enqueued +=3D free_cnt; > } else { > - struct rte_eth_dev *dev =3D > - &rte_eth_devices[rxvq->port_id]; > + struct rte_eth_dev *dev =3D &rte_eth_devices[hw->port_id]; > dev->data->rx_mbuf_alloc_failed +=3D free_cnt; > } > } > diff --git a/drivers/net/virtio/virtio_rxtx.h > b/drivers/net/virtio/virtio_rxtx.h > index 226c722d64..97de9eb0a3 100644 > --- a/drivers/net/virtio/virtio_rxtx.h > +++ b/drivers/net/virtio/virtio_rxtx.h > @@ -24,7 +24,6 @@ struct virtnet_rx { > struct rte_mempool *mpool; /**< mempool for mbuf allocation */ >=20 > uint16_t queue_id; /**< DPDK queue index. */ > - uint16_t port_id; /**< Device port identifier. */ >=20 > /* Statistics */ > struct virtnet_stats stats; > diff --git a/drivers/net/virtio/virtio_rxtx_packed.c > b/drivers/net/virtio/virtio_rxtx_packed.c > index 45cf39df22..5f7d4903bc 100644 > --- a/drivers/net/virtio/virtio_rxtx_packed.c > +++ b/drivers/net/virtio/virtio_rxtx_packed.c > @@ -124,8 +124,7 @@ virtio_recv_pkts_packed_vec(void *rx_queue, > free_cnt); > nb_enqueued +=3D free_cnt; > } else { > - struct rte_eth_dev *dev =3D > - &rte_eth_devices[rxvq->port_id]; > + struct rte_eth_dev *dev =3D &rte_eth_devices[hw->port_id]; > dev->data->rx_mbuf_alloc_failed +=3D free_cnt; > } > } > diff --git a/drivers/net/virtio/virtio_rxtx_simple.c > b/drivers/net/virtio/virtio_rxtx_simple.c > index f248869a8f..438256970d 100644 > --- a/drivers/net/virtio/virtio_rxtx_simple.c > +++ b/drivers/net/virtio/virtio_rxtx_simple.c > @@ -30,12 +30,13 @@ > int __rte_cold > virtio_rxq_vec_setup(struct virtnet_rx *rxq) > { > + struct virtqueue *vq =3D virtnet_rxq_to_vq(rxq); > uintptr_t p; > struct rte_mbuf mb_def =3D { .buf_addr =3D 0 }; /* zeroed mbuf */ >=20 > mb_def.nb_segs =3D 1; > mb_def.data_off =3D RTE_PKTMBUF_HEADROOM; > - mb_def.port =3D rxq->port_id; > + mb_def.port =3D vq->hw->port_id; > rte_mbuf_refcnt_set(&mb_def, 1); >=20 > /* prevent compiler reordering: rearm_data covers previous fields */ > diff --git a/drivers/net/virtio/virtio_rxtx_simple.h > b/drivers/net/virtio/virtio_rxtx_simple.h > index d8f96e0434..8e235f4dbc 100644 > --- a/drivers/net/virtio/virtio_rxtx_simple.h > +++ b/drivers/net/virtio/virtio_rxtx_simple.h > @@ -32,8 +32,9 @@ virtio_rxq_rearm_vec(struct virtnet_rx *rxvq) > ret =3D rte_mempool_get_bulk(rxvq->mpool, (void **)sw_ring, > RTE_VIRTIO_VPMD_RX_REARM_THRESH); > if (unlikely(ret)) { > - rte_eth_devices[rxvq->port_id].data->rx_mbuf_alloc_failed +=3D > - RTE_VIRTIO_VPMD_RX_REARM_THRESH; > + struct rte_eth_dev *dev =3D &rte_eth_devices[vq->hw->port_id]; > + > + dev->data->rx_mbuf_alloc_failed +=3D > RTE_VIRTIO_VPMD_RX_REARM_THRESH; > return; > } >=20 > -- > 2.38.1 Reviewed-by: Chenbo Xia