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 ED06DA0C43; Thu, 23 Sep 2021 07:58:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7B5F041225; Thu, 23 Sep 2021 07:58:17 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id CAFC8410DC for ; Thu, 23 Sep 2021 07:58:15 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10115"; a="246217568" X-IronPort-AV: E=Sophos;i="5.85,316,1624345200"; d="scan'208";a="246217568" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2021 22:58:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,316,1624345200"; d="scan'208";a="550671549" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by FMSMGA003.fm.intel.com with ESMTP; 22 Sep 2021 22:58:13 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) 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.12; Wed, 22 Sep 2021 22:58:13 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) 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; Wed, 22 Sep 2021 22:58:12 -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.2242.12 via Frontend Transport; Wed, 22 Sep 2021 22:58:12 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.172) 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.2242.12; Wed, 22 Sep 2021 22:58:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PAM0mpjko04fF8Q5YDfhxSoYaMZeWu3ZZ8PNQc/wxj5pPa34sz+3XlgQSewdMdSd6SRvf3X+/zVbPFY2/iR1bmg1aCB+l6/6Z+xgy39iqV2lvtAko+UQiwyMKKS0Xqo37HpNw36jbz63Oro42XFa1LXZttNE+kheT1r5MfMOfMgb7cOC6sxXasHSU6GlAKFiwPlAZ4cIA3eky/+c51jBREcTvBr745E7bIpMU4gsHui5Dlap7VFNHySibRdnVGbXBQxyDpo3hOJu5AfsA1ohJiPvCjt9Hzsgm3mR6yLHx4/AOOkvmxbU9Zb9R0OYskbcbvdpYOL3ts9LcDLViDPV0A== 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=dArmDNopBw2Gz/nmZpPJdDj2Nvh43K/l0LpKIxyRCwc=; b=PBzNSJ5lSlOwQTKES7qLnbSo4Ix0iWH98FPntc7QtEoziOWU3vfQ5vCzimtSKtgbU51gJ9G+64UNWTIf+JSeYDEbDiwRX1qRVhuy+enYaGiPU/jUgpV3jO0tJA3tMLpXbD5I9WQ1Zi2Y2UZ/yZMAZomMym37KG1AokxvC3sZgBM2cFxYDLLo5aHSUyUGrB/ypC7/eryFPQyy5td28QPPyHzJR1ZuIS4iZkNhed5C4iDj0+2/KaPOXAZJI4f71nNKdG1kpNnKzuD/cTe9r4GfI8fuPbLaSrF7KySfH1Xncy9RDZFLD0thJNyl15SUQdjfS9VNtTBvAhMhWOUZ8xw14A== 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=dArmDNopBw2Gz/nmZpPJdDj2Nvh43K/l0LpKIxyRCwc=; b=yVlDBvt7pp9zBA+uXE+rBEB+WEs/iGYhHqtqzeC0zZ6KUe+vuaNac/i+LglZAZvL6V3xwi1ZCjpwN58LUdFM6F467+ZL7jRKAaQf/ym/3gDJBmANyhW2W5FJFiw9iXfVut2nMWC4jivh0sPo/Tv/liS0YFyKYl3jPDTQuvtzckc= Received: from BN8PR11MB3795.namprd11.prod.outlook.com (2603:10b6:408:82::31) by BN9PR11MB5548.namprd11.prod.outlook.com (2603:10b6:408:105::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Thu, 23 Sep 2021 05:58:04 +0000 Received: from BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::a437:5cee:7df:1fa7]) by BN8PR11MB3795.namprd11.prod.outlook.com ([fe80::a437:5cee:7df:1fa7%3]) with mapi id 15.20.4544.014; Thu, 23 Sep 2021 05:58:04 +0000 From: "Wang, Haiyue" To: "Ananyev, Konstantin" , "dev@dpdk.org" CC: "Li, Xiaoyun" , "anoobj@marvell.com" , "jerinj@marvell.com" , "ndabilpuram@marvell.com" , "adwivedi@marvell.com" , "shepard.siegel@atomicrules.com" , "ed.czeck@atomicrules.com" , "john.miller@atomicrules.com" , "irusskikh@marvell.com" , "ajit.khaparde@broadcom.com" , "somnath.kotur@broadcom.com" , "rahul.lakkireddy@chelsio.com" , "hemant.agrawal@nxp.com" , "sachin.saxena@oss.nxp.com" , "Daley, John" , "hyonkim@cisco.com" , "Zhang, Qi Z" , "Wang, Xiao W" , "humin29@huawei.com" , "yisen.zhuang@huawei.com" , "oulijun@huawei.com" , "Xing, Beilei" , "Wu, Jingjing" , "Yang, Qiming" , "matan@nvidia.com" , "viacheslavo@nvidia.com" , "sthemmin@microsoft.com" , "longli@microsoft.com" , "heinrich.kuhn@corigine.com" , "kirankumark@marvell.com" , "andrew.rybchenko@oktetlabs.ru" , "mczekaj@marvell.com" , "jiawenwu@trustnetic.com" , "jianwang@trustnetic.com" , "maxime.coquelin@redhat.com" , "Xia, Chenbo" , "thomas@monjalon.net" , "Yigit, Ferruh" , "mdr@ashroe.eu" , "Jayatheerthan, Jay" Thread-Topic: [RFC v2 3/5] ethdev: copy ethdev 'burst' API into separate structure Thread-Index: AQHXr7vJ7yDC/NCZDUW54Pzndif0fquxHuhw Date: Thu, 23 Sep 2021 05:58:04 +0000 Message-ID: References: <20210820162834.12544-1-konstantin.ananyev@intel.com> <20210922140953.19388-1-konstantin.ananyev@intel.com> <20210922140953.19388-4-konstantin.ananyev@intel.com> In-Reply-To: <20210922140953.19388-4-konstantin.ananyev@intel.com> 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.200.16 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: 643a5d8d-8d06-498b-7295-08d97e571bf9 x-ms-traffictypediagnostic: BN9PR11MB5548: 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:2331; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: yxOefibL8dW6/DcCfrhqa8Fr0hmdukog7OfBwiMa8CpW1dR1Ooo3hR6Fe+w7akRUR5VZ5swMmi2z3jEWcaKGZekJzPo/kHKSBnQoyqmG9xkOHhB8KuaGlvYI3EMBW2CH6xp0rxk7w4dlsEiYbyu8I36B/6V7/Ged9tHYbi7AB/3eIXQfv883q66hp7vKYIhKBRvhZiRkI0iUS0hbHw6lr7Vf/5XEv7yMjTt5JH8QJDhRwkFwE4z32UjnxpiH3wluWZYmpaUtonWKxBw/AZZe/xb4ewTArihr0b3wb2pkHTtVxYVgNliPeKSkEJkA9OGLnwsj726EkPA6gBYCFTKTeelh/CUFS+fOMnkWiUDYrpUZfMI31VL0g4PJzKqfH0IPtx4FDR4vYJTKtAbtcnEM15HyKMvdTNc96gzfQCgrgXSKCaYzcuEtGcKiw9TgF9EakjiHX8MQLukhMXNzQzdVoS0sJjSyRwBiIOehpQKkK/YmSd+T6wC/Od3UrVpgVkE+wG1UPf1Lg3L+FxUguU+47N3eeoe8XwmNrd3VsL9MvNMBHlCcQbvFUJlsRV59qn1PupJgMR74n79plc57j8aelxP9DeDExZloNztEJEs+/n10LmAeln0E3RlhIb2yAje06qN+Yiv3aN5TIQE3C73ZZAecY2GYwZuWmwNhEYo3nE2sEaAkbgt0zL6J1Q36c/pzHDeY262I50BkFlj+/J9xOg== 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)(122000001)(86362001)(83380400001)(66476007)(64756008)(66556008)(508600001)(7416002)(45080400002)(66446008)(8676002)(52536014)(38100700002)(66946007)(76116006)(38070700005)(7406005)(316002)(6506007)(33656002)(186003)(110136005)(5660300002)(8936002)(54906003)(55016002)(2906002)(4326008)(53546011)(107886003)(71200400001)(7696005)(9686003)(26005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Kk9+Wb45LIuOSWeFf4CVeraOoLClvpNAk3vJyZs7IpHHZmSD3/qqN7Oi5jVO?= =?us-ascii?Q?25d65EmJA8H+j7yl/P/vFdpy1qA5y+gsHn7uTA5MU/e5g3oO4c0uq30PLENN?= =?us-ascii?Q?j2kiT7y8/VQs6Yf/b6+gYnYLRrk/1QeboF9oA1WDKu03tvLPZmUfd4o8+GlD?= =?us-ascii?Q?5XydODi5Je/whR9ncStTO8S4qhp1DZWRRWLNVxUcLpVi1hcV/UfDOJ7r79E6?= =?us-ascii?Q?3EMD5hioO1aI8SmBhU2SrZsTFVn8TWVn78G17zjSGb3TOYnPyGp2g65AJ5Ij?= =?us-ascii?Q?9Bj5WJhelAmO1l9t2UEvk7y4Ona/uKU+5AWd9bzQyr6i6jh75H9DQ5VPtwZo?= =?us-ascii?Q?hkJWElMHjD9RMOMv+LtLV/ZULJOaztEqHwwQ9iSpiZrJDTQ04k1Mt0wZ+kIc?= =?us-ascii?Q?JVoZZq3+wYlWhAAlp50z3S60Jtl7cK12CZ/0NzYspViAPiRRVTAW8QrqVvns?= =?us-ascii?Q?ExhBXabzQ9IyWBiUWqcDmK6vS5YrSZSXjAhS4DrXozTAMd+0B2Czc8z3duPs?= =?us-ascii?Q?c2aPgsH+UOzmyUJo/k4u9eLlhede/eL54VDmoRNxF+PSaGE1Gj06254fKpCd?= =?us-ascii?Q?OOpfQjRjkJdptmg7N6G7Y+P/8Jml8K6CTmDs/uHbaSrucYZpXGeFQD+o2qom?= =?us-ascii?Q?eJWIIotoVMDmugOt08SQjkWu0ZaurrjYyU8HFCX2Qx8aRCpaAoWEPdCfKn0I?= =?us-ascii?Q?yEQTvTn6slubSHMNuWuLj+jZGGMf6BZ0czlIRksBQWiMCdpo0gb6rMUzHDuQ?= =?us-ascii?Q?e1VglR0VNdY4uQjR8+iSFrPUhWw/62hMvBpmHKCDa0E9o+nsWqh0j3XMiHEw?= =?us-ascii?Q?WBg6Lt9jRdhozVq05It8nMk/zPmnHEEJ3w2BzuGGrECudHY2RZYlXtCi93Ev?= =?us-ascii?Q?xj7XdzWxAwEURJE4VP3MtTMoiLELcNBI5dc2VcnlrDx+RN2CP97041J36j7p?= =?us-ascii?Q?rdP0DqhdAm+BJoLXdslsqwDw4aUpOpzkk/ldbNXyHfXau4Zwp/EQ7Dy7VXO2?= =?us-ascii?Q?lVeUYiQtECZE8gQp+Vr1NtSQy/7ZQSEYWCgoYEb3vMFmgq06zd9P4agFVYjf?= =?us-ascii?Q?zai29SL4gzaU1eZrHRouRUsCy7JEV+APUIr7bjijz/RWSWaRP80xNr0p1+ao?= =?us-ascii?Q?qMqjtqugjbUKT8WalktvK9nCFRvfrOa0BMOUtvrV9tYd/fx7Zop3bij0/L/p?= =?us-ascii?Q?ga5MSw/WY/8E3QClVFGWOO34HpM1ib9eyRuqIKXGR3Dcbrw5d8X5ka1QW6SQ?= =?us-ascii?Q?QJCXiXobmJT69jlqKNin5ereAxkbE+nyFPDQgvU2XcgtnDETyxbERVEcidHi?= =?us-ascii?Q?wI4Fz3GlFTAK8ZWv6igGc9Tn?= 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: 643a5d8d-8d06-498b-7295-08d97e571bf9 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Sep 2021 05:58:04.3874 (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: v9V/i+px2I2CUVN5e9dRgYL5co+WQUzLbXFx9ncakJbNaP03C8jYZJldLj4JoLnZw7ZfuOKw9OfGaw1p5XSq/Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5548 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [RFC v2 3/5] ethdev: copy ethdev 'burst' API into separate structure 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: Ananyev, Konstantin > Sent: Wednesday, September 22, 2021 22:10 > To: dev@dpdk.org > Cc: Li, Xiaoyun ; anoobj@marvell.com; jerinj@marvel= l.com; > ndabilpuram@marvell.com; adwivedi@marvell.com; shepard.siegel@atomicrules= .com; > ed.czeck@atomicrules.com; john.miller@atomicrules.com; irusskikh@marvell.= com; > ajit.khaparde@broadcom.com; somnath.kotur@broadcom.com; rahul.lakkireddy@= chelsio.com; > hemant.agrawal@nxp.com; sachin.saxena@oss.nxp.com; Wang, Haiyue ; Daley, John > ; hyonkim@cisco.com; Zhang, Qi Z ; Wang, Xiao W > ; humin29@huawei.com; yisen.zhuang@huawei.com; oul= ijun@huawei.com; Xing, Beilei > ; Wu, Jingjing ; Yang, Qimi= ng ; > matan@nvidia.com; viacheslavo@nvidia.com; sthemmin@microsoft.com; longli@= microsoft.com; > heinrich.kuhn@corigine.com; kirankumark@marvell.com; andrew.rybchenko@okt= etlabs.ru; > mczekaj@marvell.com; jiawenwu@trustnetic.com; jianwang@trustnetic.com; ma= xime.coquelin@redhat.com; Xia, > Chenbo ; thomas@monjalon.net; Yigit, Ferruh ; > mdr@ashroe.eu; Jayatheerthan, Jay ; Ananyev,= Konstantin > > Subject: [RFC v2 3/5] ethdev: copy ethdev 'burst' API into separate struc= ture >=20 > Copy public function pointers (rx_pkt_burst(), etc.) and related > pointers to internal data from rte_eth_dev structure into a separate flat > array. We can keep it public to still use inline functions for 'fast' cal= ls > (like rte_eth_rx_burst(), etc.) to avoid/minimize slowdown. > The intention is to make rte_eth_dev and related structures internal. > That should allow future possible changes to core eth_dev strcutures > to be transaprent to the user and help to avoid ABI/API breakages. >=20 > Signed-off-by: Konstantin Ananyev > --- > lib/ethdev/ethdev_private.c | 53 ++++++++++++++++++++++++++++++++++++ > lib/ethdev/ethdev_private.h | 7 +++++ > lib/ethdev/rte_ethdev.c | 17 ++++++++++++ > lib/ethdev/rte_ethdev_core.h | 45 ++++++++++++++++++++++++++++++ > 4 files changed, 122 insertions(+) >=20 > diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c > index 012cf73ca2..a1683da77b 100644 > --- a/lib/ethdev/ethdev_private.c > +++ b/lib/ethdev/ethdev_private.c > @@ -174,3 +174,56 @@ rte_eth_devargs_parse_representor_ports(char *str, v= oid *data) > RTE_LOG(ERR, EAL, "wrong representor format: %s\n", str); > return str =3D=3D NULL ? -1 : 0; > } > + > +static uint16_t > +dummy_eth_rx_burst(__rte_unused void *rxq, > + __rte_unused struct rte_mbuf **rx_pkts, > + __rte_unused uint16_t nb_pkts) > +{ > + RTE_ETHDEV_LOG(ERR, "rx_pkt_burst for unconfigured port\n"); > + rte_errno =3D ENOTSUP; > + return 0; > +} > + > +static uint16_t > +dummy_eth_tx_burst(__rte_unused void *txq, > + __rte_unused struct rte_mbuf **tx_pkts, > + __rte_unused uint16_t nb_pkts) > +{ > + RTE_ETHDEV_LOG(ERR, "tx_pkt_burst for unconfigured port\n"); > + rte_errno =3D ENOTSUP; > + return 0; > +} > + > +void > +eth_dev_burst_api_reset(struct rte_eth_burst_api *rba) > +{ > + static void *dummy_data[RTE_MAX_QUEUES_PER_PORT]; > + static const struct rte_eth_burst_api dummy_api =3D { > + .rx_pkt_burst =3D dummy_eth_rx_burst, > + .tx_pkt_burst =3D dummy_eth_tx_burst, > + .rxq =3D {.data =3D dummy_data, .clbk =3D dummy_data,}, > + .txq =3D {.data =3D dummy_data, .clbk =3D dummy_data,}, > + }; > + > + *rba =3D dummy_api; > +} > + > +void > +eth_dev_burst_api_setup(struct rte_eth_burst_api *rba, > + const struct rte_eth_dev *dev) > +{ > + rba->rx_pkt_burst =3D dev->rx_pkt_burst; > + rba->tx_pkt_burst =3D dev->tx_pkt_burst; > + rba->tx_pkt_prepare =3D dev->tx_pkt_prepare; > + rba->rx_queue_count =3D dev->rx_queue_count; > + rba->rx_descriptor_status =3D dev->rx_descriptor_status; > + rba->tx_descriptor_status =3D dev->tx_descriptor_status; > + > + rba->rxq.data =3D dev->data->rx_queues; > + rba->rxq.clbk =3D (void **)(uintptr_t)dev->post_rx_burst_cbs; > + > + rba->txq.data =3D dev->data->tx_queues; > + rba->txq.clbk =3D (void **)(uintptr_t)dev->pre_tx_burst_cbs; > +} > + > diff --git a/lib/ethdev/ethdev_private.h b/lib/ethdev/ethdev_private.h > index 9bb0879538..54921f4860 100644 > --- a/lib/ethdev/ethdev_private.h > +++ b/lib/ethdev/ethdev_private.h > @@ -30,6 +30,13 @@ eth_find_device(const struct rte_eth_dev *_start, rte_= eth_cmp_t cmp, > /* Parse devargs value for representor parameter. */ > int rte_eth_devargs_parse_representor_ports(char *str, void *data); >=20 > +/* reset eth 'burst' API to dummy values */ > +void eth_dev_burst_api_reset(struct rte_eth_burst_api *rba); > + > +/* setup eth 'burst' API to ethdev values */ > +void eth_dev_burst_api_setup(struct rte_eth_burst_api *rba, > + const struct rte_eth_dev *dev); > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index 424bc260fa..5904bb7bae 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -44,6 +44,9 @@ > static const char *MZ_RTE_ETH_DEV_DATA =3D "rte_eth_dev_data"; > struct rte_eth_dev rte_eth_devices[RTE_MAX_ETHPORTS]; >=20 > +/* public 'fast/burst' API */ > +struct rte_eth_burst_api rte_eth_burst_api[RTE_MAX_ETHPORTS]; > + > /* spinlock for eth device callbacks */ > static rte_spinlock_t eth_dev_cb_lock =3D RTE_SPINLOCK_INITIALIZER; >=20 > @@ -1788,6 +1791,9 @@ rte_eth_dev_start(uint16_t port_id) > (*dev->dev_ops->link_update)(dev, 0); > } >=20 > + /* expose selection of PMD rx/tx function */ > + eth_dev_burst_api_setup(rte_eth_burst_api + port_id, dev); > + > rte_ethdev_trace_start(port_id); > return 0; > } > @@ -1810,6 +1816,9 @@ rte_eth_dev_stop(uint16_t port_id) > return 0; > } >=20 > + /* point rx/tx functions to dummy ones */ > + eth_dev_burst_api_reset(rte_eth_burst_api + port_id); > + > dev->data->dev_started =3D 0; > ret =3D (*dev->dev_ops->dev_stop)(dev); > rte_ethdev_trace_stop(port_id, ret); > @@ -4568,6 +4577,14 @@ rte_eth_mirror_rule_reset(uint16_t port_id, uint8_= t rule_id) > return eth_err(port_id, (*dev->dev_ops->mirror_rule_reset)(dev, rule_id= )); > } >=20 > +RTE_INIT(eth_dev_init_burst_api) > +{ > + uint32_t i; > + > + for (i =3D 0; i !=3D RTE_DIM(rte_eth_burst_api); i++) > + eth_dev_burst_api_reset(rte_eth_burst_api + i); > +} > + > RTE_INIT(eth_dev_init_cb_lists) > { > uint16_t i; > diff --git a/lib/ethdev/rte_ethdev_core.h b/lib/ethdev/rte_ethdev_core.h > index 00f27c643a..da6de5de43 100644 > --- a/lib/ethdev/rte_ethdev_core.h > +++ b/lib/ethdev/rte_ethdev_core.h > @@ -53,6 +53,51 @@ typedef int (*eth_rx_descriptor_status_t)(void *rxq, u= int16_t offset); > typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset); > /**< @internal Check the status of a Tx descriptor */ >=20 > +/** > + * @internal > + * Structure used to hold opaque pointernals to internal ethdev RX/TXi > + * queues data. > + * The main purpose to expose these pointers at all - allow compiler > + * to fetch this data for 'fast' ethdev inline functions in advance. > + */ > +struct rte_ethdev_qdata { > + void **data; > + /**< points to array of internal queue data pointers */ > + void **clbk; > + /**< points to array of queue callback data pointers */ > +}; > + > +/** > + * @internal > + * 'fast' ethdev funcions and related data are hold in a flat array. > + * one entry per ethdev. > + */ > +struct rte_eth_burst_api { 'ops' is better ? Like "struct rte_eth_burst_ops". ;-) > + > + /** first 64B line */ > + eth_rx_burst_t rx_pkt_burst; > + /**< PMD receive function. */ > + eth_tx_burst_t tx_pkt_burst; > + /**< PMD transmit function. */ > + eth_tx_prep_t tx_pkt_prepare; > + /**< PMD transmit prepare function. */ > + eth_rx_queue_count_t rx_queue_count; > + /**< Get the number of used RX descriptors. */ > + eth_rx_descriptor_status_t rx_descriptor_status; > + /**< Check the status of a Rx descriptor. */ > + eth_tx_descriptor_status_t tx_descriptor_status; > + /**< Check the status of a Tx descriptor. */ > + uintptr_t reserved[2]; > + How about 32 bit system ? Does it need something like : __rte_cache_aligned for rxq to make sure 64B line? > + /** second 64B line */ > + struct rte_ethdev_qdata rxq; > + struct rte_ethdev_qdata txq; > + uintptr_t reserved2[4]; > + > +} __rte_cache_aligned; > + > +extern struct rte_eth_burst_api rte_eth_burst_api[RTE_MAX_ETHPORTS]; > + >=20 > /** > * @internal > -- > 2.26.3