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 C20FFA00C2; Thu, 10 Feb 2022 08:38:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A691B4013F; Thu, 10 Feb 2022 08:38:57 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 7356A40041 for ; Thu, 10 Feb 2022 08:38:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644478735; x=1676014735; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=iBspUwB7+tsFJ0ftM7YwDUpx5iSJyxqwKSM/nR+Kn9M=; b=hUMq1qM/u/itig4SYV43VJS92j49LlNki1GcT842ykvrKcGBdL6gpsk6 rp4BoMnl7yELBKWeMzf4NKLmSeZly+/mJgc6BXOU7+bxqDImSnu1rpbLy cExl2M+/oUKkL9XZgC+QOaDB18gAlvCYx5jOawCnMnyKXUSWVjnI1m2py mMeVk/AJj9WwPM3JNxPjrftdtLd5rync00d5DU20aP/IOsG9V0gip65Qz DfrCtVeFLHDCuOom0WiUPphcvjpo9G79L6SyeVUdHHi+FDEm6hV20g/Wp 7IV38IkZhq6mxS/kvWDO4ddISLJBBV/kbpfgdYuQrvX/CqlJ21DSQBqxX Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="232995619" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="232995619" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2022 23:38:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="482650478" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga003.jf.intel.com with ESMTP; 09 Feb 2022 23:38:54 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 9 Feb 2022 23:38:53 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) 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.2308.20; Wed, 9 Feb 2022 23:38:53 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Wed, 9 Feb 2022 23:38:53 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.169) 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.2308.20; Wed, 9 Feb 2022 23:38:53 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ILIR7eXFeWKZWbUX4x7sgZdZnhQ9p6lp3ZbA2vBt7aLWFcqQNGVrKXlK99+VSh81fFJhdnga/NlBfiI/8jT+0V+Z3XpuXTHnfPtxrGMcA2IGRnBCoAopME0KAPDhfiddWNw7HIDF447KX8k7VEu//bDbUCxzQWiNMk/6A2tNbCYF3MBCHDL7wR599i6vnInnTMjY8U4L+Mx7/C6kjWAnmsAs+pGnoltsHcbt4PjszJnuPYmJU7HLqWW/33N/FEX5kUjgNtTnhmHBi2oXdZj/MxYf7OvUd5lH/5FxYBigWDjAZbLKtYnKLzyKfqS5UU0uL+FDwqAwKAOI8WkvkOqPrQ== 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=YLUXSg/wlDbfryslZtT9fd8HOp62IVDdiBz2fepg5qc=; b=GvoC033Ew0YLG6lfXW+/eQH/TsHjexyGWKpMhWH+q7QYYVpKcJkvRCiqLH3xvQuIlIf7pkxyoxrXuguZ6fb2Sx6fobVpXddRWe4TgnqwN7pVZh2g8X+V9IGvLUxcUiioqPt3zmrOtpoSIyKJon0mOTtg9vNB7g74zResteUf6Ao0pXUz7UqvvjMrfIuqcvnJmpLnkB86Z3VEIFQ5NDZp6V+0R5yLJSS0zaBjEY15zk1qeKUAh9bVZZI5u4ZmRppd8CAiPzH150AygI7D5XOi+s4+N7hGp2XdiEcfX+ogHD7GEcD2ymLK72POqoEZqFD2l0rerhcrqTlI8mO2zgHybw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from PH0PR11MB4791.namprd11.prod.outlook.com (2603:10b6:510:43::10) by DM6PR11MB3020.namprd11.prod.outlook.com (2603:10b6:5:69::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.18; Thu, 10 Feb 2022 07:38:50 +0000 Received: from PH0PR11MB4791.namprd11.prod.outlook.com ([fe80::b58f:bb46:9881:3771]) by PH0PR11MB4791.namprd11.prod.outlook.com ([fe80::b58f:bb46:9881:3771%4]) with mapi id 15.20.4975.012; Thu, 10 Feb 2022 07:38:50 +0000 From: "Loftus, Ciara" To: "Yigit, Ferruh" , Shepard Siegel , Ed Czeck , "John Miller" , Rasesh Mody , Shahed Shaikh , Ajit Khaparde , Somnath Kotur , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Hemant Agrawal , "Sachin Saxena" , "Daley, John" , Hyong Youb Kim , "Min Hu (Connor)" , Yisen Zhuang , Lijun Ou , Matan Azrad , Viacheslav Ovsiienko , Gagandeep Singh , "Devendra Singh Rawat" , Thomas Monjalon , Andrew Rybchenko CC: "dev@dpdk.org" Subject: RE: [PATCH] ethdev: introduce generic dummy packet burst function Thread-Topic: [PATCH] ethdev: introduce generic dummy packet burst function Thread-Index: AQHYHSRfAee3chWaiE6rtePEWJ7EjKyMZrhA Date: Thu, 10 Feb 2022 07:38:50 +0000 Message-ID: References: <20220208194437.426143-1-ferruh.yigit@intel.com> In-Reply-To: <20220208194437.426143-1-ferruh.yigit@intel.com> Accept-Language: en-GB, 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: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9b00933a-1987-4b86-3b38-08d9ec68619d x-ms-traffictypediagnostic: DM6PR11MB3020:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2512; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: arh1qzeZdqykrozAjmU/hZGoxc5sd1gUgci0tb8XS+Jic1AVCEBjwbnvkmlJl8u8lgXykfMDtUSjRNVRs1HWKurv+oP2yQeDz8g8MhLPbsHteEPpAB8RgHEa90QI1cr7p5wuV0xDtC7YTgkp9Qw4qC9LSnEkDQDVRdP5zfmHpIiJSXkJ7wHz28StyP05Q/Sfi5514OqQY+6CmAG0EbcnKrqUkWnxUMRTTAenJ364+Ae7VuTWL2eIJfscMtAVoUsO5lnAZ+z4ZjlyUnGVUa0Z6Bw0jkwZrN39JDpnzVRmmOwnW5PU+V8pi8jlDRedetwtQCFlmstG+dRR1LR9Z2qEhO36zzTLjKxrRZvxAWyYRLQBV1ivGQB5OVdiItbfExu92bAMmxRIdHMxUGe9KvwwBG0dogr7LUHiayg0RvqozU4kHY/CfuMI6ZrmqcEbCdazMz2kqydY9lknr6b/fF4cAHHqG2/5jFqGLV5XjnoUlEe23V3AlNwyvGUlwgrmmMz2GyANeKItkrkejLWaiG3yuQ5GnbT1ATgVq7PUtxBzlFKTETcxKjm8InBZl2ozm426xqqxXrX2QMjsO9tG8+Vk2GnesCVoyE2wVMK4udOTBv9Cji+XVQh7cEcxtntJzURtaI2RDle9GXz9kCSPEMLFS6cK+aHKZDGQ6bhxkTUZvGG4zrVLeSt4bKNaP0YeBx8HNB1XGdHE+kk3f8tmMPocaEEDZm/EtZU4r6PrLhNzqeq1QdmlPmcWy3YCKH6TuMDE x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB4791.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(83380400001)(7696005)(186003)(26005)(82960400001)(66946007)(76116006)(66446008)(64756008)(66556008)(6506007)(66476007)(921005)(38100700002)(122000001)(508600001)(7416002)(5660300002)(71200400001)(52536014)(30864003)(9686003)(2906002)(110136005)(55016003)(8676002)(316002)(4326008)(8936002)(33656002)(38070700005)(86362001)(41533002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Ew6+gSVHVPOp1q+1361XsG//vGsF/PEJMxoKnj0xipyTqFNzGzS6rq741OQJ?= =?us-ascii?Q?OWm4d2coSu/TPIHEfmwZ+mDuboenLM7ZApFfuXas1h2vB4FbBS+g59tTya5w?= =?us-ascii?Q?rzCYn4WtzbwXyP4tjXbmei86F07cbCjNAn+wWUd2LFzGrUhz+EgMghMtRVBs?= =?us-ascii?Q?UTnVGVEapfxdcTXi6r7odehjNM60/3Qvg4I8b7wQkeiHdI6fijbMjjrZWkUz?= =?us-ascii?Q?M20AaZPsn0LsH0rVpWvTvRX3G1RxFFawMmnIg7Ktf1++Ak+VEBC+U314Fpde?= =?us-ascii?Q?xWPeYdmIosHDFNmQAh2nW8VO0bSVxXsRKbV4YhqVGfYYTpaLOizEqHglu18X?= =?us-ascii?Q?xnnOMxCS5xm29bhP0hBNjWWiN2nHpTGwsM3NrTrY7bL8iQa3aQpqBAELXdt7?= =?us-ascii?Q?YYlzx/7/XONpiIkWfbEpcINvfnFmkwZ8HSX0gDj9dyFA7N39A1O+8liZT6m/?= =?us-ascii?Q?QfkNhRtIj2ugg/6tFg8KcTFdPlNLSkxvGeylOlohnNwFqjav1vG8UbCLsoW4?= =?us-ascii?Q?obxncs6ct6vy/I0LWzaDcLkxS22d73piRrYjLrAX90fFMrotMKUgolXwEKN1?= =?us-ascii?Q?mDlpCDl3hKJPU27F4ORe+D4VShliJGXwazBgRQPYmAfKzsX8ueOExaiJQ2Rl?= =?us-ascii?Q?y9ccMd4T4MNLn37DiT/99YacjeBnmw368BGdsdjggUgEUxotCGxZPiS1Z7Ue?= =?us-ascii?Q?/2VmVD/7ABz4fs5JSx/23+0ORjU08anUyg0iCNxtjEBB/yNx1BO2y3zAhGyr?= =?us-ascii?Q?BCb7jblA/2Ps9f/ZGp2u3w/k82eOICC7OsjcK41UgZf7Gl8CYWxkbdY+WIng?= =?us-ascii?Q?j3cErp8gM61PFjsLLimplIQlSY7+gWcCLeTg7bjpXiLOHQMpAJX4Y7nToi4L?= =?us-ascii?Q?WvWjBqtthVkS2kvTrjfS+RGqARN8C2vIOMnc7iVOHrwjMqlIxeh3Lijvsl/o?= =?us-ascii?Q?3xgGA045zx3qRdUYk6Itqqpo+ISaIFML9B89DJa/xRNLDzERZF9yhHKvr3jM?= =?us-ascii?Q?uhBsMmsKWBgtbj+RtYg+HuiqZSm5LhFqQwV+gUZhReh8C+vL36K26XBpT2pk?= =?us-ascii?Q?I5d/syK42GQ4HPLGfiZDBy0+pp0rTqcOeiKHLzVY46Z+nq6qTEiREg15jERq?= =?us-ascii?Q?M4tEotX/aiXmYOW4sT0re1Ex3ZRhgwRGRcFGhcKsxVVQpZA6CGOwRmQX/bOV?= =?us-ascii?Q?QqAMrwIHOHhUfhrdcmszG83boE0LeyfshnynyFZ2+ZVrP3Im3256wDSQ5WNP?= =?us-ascii?Q?HLvqQ7VyZbEEFmmagtmGzyfjLi18KB+4vUtXmmPO620jv/pKEs7HMoUmz5fR?= =?us-ascii?Q?1vg6wZ03DRXAeUS4sxlB5B/8mpboN8W4Z3HiUagYGQ6axmN0dG/w1owXxJ0t?= =?us-ascii?Q?a7Sz3DwWkx+jkod+xqEwIQso/QKty/+WsHLLiJxsenUn1EGFo2qu88/hu0Ih?= =?us-ascii?Q?ulvta3hPuuFCXtugMwlcsKaE7ZxoFoPgHYY4BYJYJyoQXXcu77WGw6KuaF8i?= =?us-ascii?Q?JXno6qbtgAHgX5FJ2XZT2Fmqok9CFIy4vwCgAq4TthLTX03h9wf+M8QXUj1g?= =?us-ascii?Q?k5rX2+xdCdGT58ka/ABzjnoLHk7MdPVNSvY5MZS+NmjBSiibXHtl5kb3Y4ZI?= =?us-ascii?Q?4A=3D=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: PH0PR11MB4791.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b00933a-1987-4b86-3b38-08d9ec68619d X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Feb 2022 07:38:50.7146 (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: r9qUw7gZZs8dtBotdOd8QscSGVtOmFss6fjTxwuaU/kCBwp/m9yxbjpd4TWq/MKutZQqeTRR/sOHT855RRpbWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3020 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 > Subject: [PATCH] ethdev: introduce generic dummy packet burst function >=20 > Multiple PMDs have dummy/noop Rx/Tx packet burst functions. >=20 > These dummy functions are very simple, introduce a common function in > the ethdev and update drivers to use it instead of each driver having > its own functions. >=20 > Signed-off-by: Ferruh Yigit > --- > Cc: Ciara Loftus > --- [snip] > diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c > index 3f3c4a7c7214..910b76a92c42 100644 > --- a/drivers/net/mlx4/mlx4.c > +++ b/drivers/net/mlx4/mlx4.c > @@ -350,8 +350,8 @@ mlx4_dev_stop(struct rte_eth_dev *dev) > return 0; > DEBUG("%p: detaching flows from all RX queues", (void *)dev); > priv->started =3D 0; > - dev->tx_pkt_burst =3D mlx4_tx_burst_removed; > - dev->rx_pkt_burst =3D mlx4_rx_burst_removed; > + dev->tx_pkt_burst =3D rte_eth_pkt_burst_dummy; > + dev->rx_pkt_burst =3D rte_eth_pkt_burst_dummy; > rte_wmb(); > /* Disable datapath on secondary process. */ > mlx4_mp_req_stop_rxtx(dev); > @@ -383,8 +383,8 @@ mlx4_dev_close(struct rte_eth_dev *dev) > DEBUG("%p: closing device \"%s\"", > (void *)dev, > ((priv->ctx !=3D NULL) ? priv->ctx->device->name : "")); > - dev->rx_pkt_burst =3D mlx4_rx_burst_removed; > - dev->tx_pkt_burst =3D mlx4_tx_burst_removed; > + dev->rx_pkt_burst =3D rte_eth_pkt_burst_dummy; > + dev->tx_pkt_burst =3D rte_eth_pkt_burst_dummy; > rte_wmb(); > /* Disable datapath on secondary process. */ > mlx4_mp_req_stop_rxtx(dev); > diff --git a/drivers/net/mlx4/mlx4_mp.c b/drivers/net/mlx4/mlx4_mp.c > index 8fcfb5490ee9..1da64910aadd 100644 > --- a/drivers/net/mlx4/mlx4_mp.c > +++ b/drivers/net/mlx4/mlx4_mp.c > @@ -150,8 +150,8 @@ mp_secondary_handle(const struct rte_mp_msg > *mp_msg, const void *peer) > break; > case MLX4_MP_REQ_STOP_RXTX: > INFO("port %u stopping datapath", dev->data->port_id); > - dev->tx_pkt_burst =3D mlx4_tx_burst_removed; > - dev->rx_pkt_burst =3D mlx4_rx_burst_removed; > + dev->tx_pkt_burst =3D rte_eth_pkt_burst_dummy; > + dev->rx_pkt_burst =3D rte_eth_pkt_burst_dummy; > rte_mb(); > mp_init_msg(dev, &mp_res, param->type); > res->result =3D 0; > diff --git a/drivers/net/mlx4/mlx4_rxtx.c b/drivers/net/mlx4/mlx4_rxtx.c > index ed9e41fcdea9..059e432a63fc 100644 > --- a/drivers/net/mlx4/mlx4_rxtx.c > +++ b/drivers/net/mlx4/mlx4_rxtx.c > @@ -1338,55 +1338,3 @@ mlx4_rx_burst(void *dpdk_rxq, struct rte_mbuf > **pkts, uint16_t pkts_n) > rxq->stats.ipackets +=3D i; > return i; > } > - > -/** > - * Dummy DPDK callback for Tx. > - * > - * This function is used to temporarily replace the real callback during > - * unsafe control operations on the queue, or in case of error. > - * > - * @param dpdk_txq > - * Generic pointer to Tx queue structure. > - * @param[in] pkts > - * Packets to transmit. > - * @param pkts_n > - * Number of packets in array. > - * > - * @return > - * Number of packets successfully transmitted (<=3D pkts_n). > - */ > -uint16_t > -mlx4_tx_burst_removed(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t > pkts_n) > -{ > - (void)dpdk_txq; > - (void)pkts; > - (void)pkts_n; > - rte_mb(); The mlx4 and mlx5 PMDs lose a call to rte_mb() when switching over to the n= ew dummy functions. Maybe the maintainer can comment on whether that's an i= ssue or not? Other than that LGTM. Ciara > - return 0; > -} > - > -/** > - * Dummy DPDK callback for Rx. > - * > - * This function is used to temporarily replace the real callback during > - * unsafe control operations on the queue, or in case of error. > - * > - * @param dpdk_rxq > - * Generic pointer to Rx queue structure. > - * @param[out] pkts > - * Array to store received packets. > - * @param pkts_n > - * Maximum number of packets in array. > - * > - * @return > - * Number of packets successfully received (<=3D pkts_n). > - */ > -uint16_t > -mlx4_rx_burst_removed(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t > pkts_n) > -{ > - (void)dpdk_rxq; > - (void)pkts; > - (void)pkts_n; > - rte_mb(); > - return 0; > -} > diff --git a/drivers/net/mlx4/mlx4_rxtx.h b/drivers/net/mlx4/mlx4_rxtx.h > index 83e9534cd0a7..70f3cd868058 100644 > --- a/drivers/net/mlx4/mlx4_rxtx.h > +++ b/drivers/net/mlx4/mlx4_rxtx.h > @@ -149,10 +149,6 @@ uint16_t mlx4_tx_burst(void *dpdk_txq, struct > rte_mbuf **pkts, > uint16_t pkts_n); > uint16_t mlx4_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, > uint16_t pkts_n); > -uint16_t mlx4_tx_burst_removed(void *dpdk_txq, struct rte_mbuf **pkts, > - uint16_t pkts_n); > -uint16_t mlx4_rx_burst_removed(void *dpdk_rxq, struct rte_mbuf **pkts, > - uint16_t pkts_n); >=20 > /* mlx4_txq.c */ >=20 > diff --git a/drivers/net/mlx5/linux/mlx5_mp_os.c > b/drivers/net/mlx5/linux/mlx5_mp_os.c > index c448a3e9eb87..e607089e0e20 100644 > --- a/drivers/net/mlx5/linux/mlx5_mp_os.c > +++ b/drivers/net/mlx5/linux/mlx5_mp_os.c > @@ -192,8 +192,8 @@ struct rte_mp_msg mp_res; > break; > case MLX5_MP_REQ_STOP_RXTX: > DRV_LOG(INFO, "port %u stopping datapath", dev->data- > >port_id); > - dev->rx_pkt_burst =3D removed_rx_burst; > - dev->tx_pkt_burst =3D removed_tx_burst; > + dev->rx_pkt_burst =3D rte_eth_pkt_burst_dummy; > + dev->tx_pkt_burst =3D rte_eth_pkt_burst_dummy; > rte_mb(); > mp_init_msg(&priv->mp_id, &mp_res, param->type); > res->result =3D 0; > diff --git a/drivers/net/mlx5/linux/mlx5_os.c > b/drivers/net/mlx5/linux/mlx5_os.c > index aecdc5a68abb..bbe05bb837e0 100644 > --- a/drivers/net/mlx5/linux/mlx5_os.c > +++ b/drivers/net/mlx5/linux/mlx5_os.c > @@ -1623,8 +1623,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, > DRV_LOG(DEBUG, "port %u MTU is %u", eth_dev->data->port_id, > priv->mtu); > /* Initialize burst functions to prevent crashes before link-up. */ > - eth_dev->rx_pkt_burst =3D removed_rx_burst; > - eth_dev->tx_pkt_burst =3D removed_tx_burst; > + eth_dev->rx_pkt_burst =3D rte_eth_pkt_burst_dummy; > + eth_dev->tx_pkt_burst =3D rte_eth_pkt_burst_dummy; > eth_dev->dev_ops =3D &mlx5_dev_ops; > eth_dev->rx_descriptor_status =3D mlx5_rx_descriptor_status; > eth_dev->tx_descriptor_status =3D mlx5_tx_descriptor_status; > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c > index 67eda41a60a5..5571e9067787 100644 > --- a/drivers/net/mlx5/mlx5.c > +++ b/drivers/net/mlx5/mlx5.c > @@ -1559,8 +1559,8 @@ mlx5_dev_close(struct rte_eth_dev *dev) > mlx5_action_handle_flush(dev); > mlx5_flow_meter_flush(dev, NULL); > /* Prevent crashes when queues are still in use. */ > - dev->rx_pkt_burst =3D removed_rx_burst; > - dev->tx_pkt_burst =3D removed_tx_burst; > + dev->rx_pkt_burst =3D rte_eth_pkt_burst_dummy; > + dev->tx_pkt_burst =3D rte_eth_pkt_burst_dummy; > rte_wmb(); > /* Disable datapath on secondary process. */ > mlx5_mp_os_req_stop_rxtx(dev); > diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c > index f388fcc31395..11ea935d72f0 100644 > --- a/drivers/net/mlx5/mlx5_rx.c > +++ b/drivers/net/mlx5/mlx5_rx.c > @@ -252,7 +252,7 @@ mlx5_rx_queue_count(void *rx_queue) > dev =3D &rte_eth_devices[rxq->port_id]; >=20 > if (dev->rx_pkt_burst =3D=3D NULL || > - dev->rx_pkt_burst =3D=3D removed_rx_burst) { > + dev->rx_pkt_burst =3D=3D rte_eth_pkt_burst_dummy) { > rte_errno =3D ENOTSUP; > return -rte_errno; > } > @@ -1153,31 +1153,6 @@ mlx5_rx_burst_mprq(void *dpdk_rxq, struct > rte_mbuf **pkts, uint16_t pkts_n) > return i; > } >=20 > -/** > - * Dummy DPDK callback for RX. > - * > - * This function is used to temporarily replace the real callback during > - * unsafe control operations on the queue, or in case of error. > - * > - * @param dpdk_rxq > - * Generic pointer to RX queue structure. > - * @param[out] pkts > - * Array to store received packets. > - * @param pkts_n > - * Maximum number of packets in array. > - * > - * @return > - * Number of packets successfully received (<=3D pkts_n). > - */ > -uint16_t > -removed_rx_burst(void *dpdk_rxq __rte_unused, > - struct rte_mbuf **pkts __rte_unused, > - uint16_t pkts_n __rte_unused) > -{ > - rte_mb(); > - return 0; > -} > - > /* > * Vectorized Rx routines are not compiled in when required vector > instructions > * are not supported on a target architecture. > diff --git a/drivers/net/mlx5/mlx5_rx.h b/drivers/net/mlx5/mlx5_rx.h > index cb5d51340db7..7e417819f7e8 100644 > --- a/drivers/net/mlx5/mlx5_rx.h > +++ b/drivers/net/mlx5/mlx5_rx.h > @@ -275,8 +275,6 @@ __rte_noinline int mlx5_rx_err_handle(struct > mlx5_rxq_data *rxq, uint8_t vec); > void mlx5_mprq_buf_free(struct mlx5_mprq_buf *buf); > uint16_t mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts, > uint16_t pkts_n); > -uint16_t removed_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, > - uint16_t pkts_n); > int mlx5_rx_descriptor_status(void *rx_queue, uint16_t offset); > uint32_t mlx5_rx_queue_count(void *rx_queue); > void mlx5_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, > diff --git a/drivers/net/mlx5/mlx5_trigger.c > b/drivers/net/mlx5/mlx5_trigger.c > index 74c9c0a4fff8..3a59237b1a7a 100644 > --- a/drivers/net/mlx5/mlx5_trigger.c > +++ b/drivers/net/mlx5/mlx5_trigger.c > @@ -1244,8 +1244,8 @@ mlx5_dev_stop(struct rte_eth_dev *dev) >=20 > dev->data->dev_started =3D 0; > /* Prevent crashes when queues are still in use. */ > - dev->rx_pkt_burst =3D removed_rx_burst; > - dev->tx_pkt_burst =3D removed_tx_burst; > + dev->rx_pkt_burst =3D rte_eth_pkt_burst_dummy; > + dev->tx_pkt_burst =3D rte_eth_pkt_burst_dummy; > rte_wmb(); > /* Disable datapath on secondary process. */ > mlx5_mp_os_req_stop_rxtx(dev); > diff --git a/drivers/net/mlx5/mlx5_tx.c b/drivers/net/mlx5/mlx5_tx.c > index fd2cf2096753..8453b2701a9f 100644 > --- a/drivers/net/mlx5/mlx5_tx.c > +++ b/drivers/net/mlx5/mlx5_tx.c > @@ -135,31 +135,6 @@ mlx5_tx_error_cqe_handle(struct mlx5_txq_data > *__rte_restrict txq, > return 0; > } >=20 > -/** > - * Dummy DPDK callback for TX. > - * > - * This function is used to temporarily replace the real callback during > - * unsafe control operations on the queue, or in case of error. > - * > - * @param dpdk_txq > - * Generic pointer to TX queue structure. > - * @param[in] pkts > - * Packets to transmit. > - * @param pkts_n > - * Number of packets in array. > - * > - * @return > - * Number of packets successfully transmitted (<=3D pkts_n). > - */ > -uint16_t > -removed_tx_burst(void *dpdk_txq __rte_unused, > - struct rte_mbuf **pkts __rte_unused, > - uint16_t pkts_n __rte_unused) > -{ > - rte_mb(); > - return 0; > -} > - > /** > * Update completion queue consuming index via doorbell > * and flush the completed data buffers. > diff --git a/drivers/net/mlx5/mlx5_tx.h b/drivers/net/mlx5/mlx5_tx.h > index 099e72935a3a..31eb0a1ce28e 100644 > --- a/drivers/net/mlx5/mlx5_tx.h > +++ b/drivers/net/mlx5/mlx5_tx.h > @@ -221,8 +221,6 @@ void mlx5_txq_dynf_timestamp_set(struct > rte_eth_dev *dev); >=20 > /* mlx5_tx.c */ >=20 > -uint16_t removed_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, > - uint16_t pkts_n); > void mlx5_tx_handle_completion(struct mlx5_txq_data *__rte_restrict txq, > unsigned int olx __rte_unused); > int mlx5_tx_descriptor_status(void *tx_queue, uint16_t offset); > diff --git a/drivers/net/mlx5/windows/mlx5_os.c > b/drivers/net/mlx5/windows/mlx5_os.c > index ac0af0ff7d43..7f3532426f1f 100644 > --- a/drivers/net/mlx5/windows/mlx5_os.c > +++ b/drivers/net/mlx5/windows/mlx5_os.c > @@ -574,8 +574,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, > DRV_LOG(DEBUG, "port %u MTU is %u.", eth_dev->data->port_id, > priv->mtu); > /* Initialize burst functions to prevent crashes before link-up. */ > - eth_dev->rx_pkt_burst =3D removed_rx_burst; > - eth_dev->tx_pkt_burst =3D removed_tx_burst; > + eth_dev->rx_pkt_burst =3D rte_eth_pkt_burst_dummy; > + eth_dev->tx_pkt_burst =3D rte_eth_pkt_burst_dummy; > eth_dev->dev_ops =3D &mlx5_dev_ops; > eth_dev->rx_descriptor_status =3D mlx5_rx_descriptor_status; > eth_dev->tx_descriptor_status =3D mlx5_tx_descriptor_status; > diff --git a/drivers/net/pfe/pfe_ethdev.c b/drivers/net/pfe/pfe_ethdev.c > index edf32aa70da6..c2991ab1ccaa 100644 > --- a/drivers/net/pfe/pfe_ethdev.c > +++ b/drivers/net/pfe/pfe_ethdev.c > @@ -235,22 +235,6 @@ pfe_xmit_pkts(void *tx_queue, struct rte_mbuf > **tx_pkts, uint16_t nb_pkts) > return nb_pkts; > } >=20 > -static uint16_t > -pfe_dummy_xmit_pkts(__rte_unused void *tx_queue, > - __rte_unused struct rte_mbuf **tx_pkts, > - __rte_unused uint16_t nb_pkts) > -{ > - return 0; > -} > - > -static uint16_t > -pfe_dummy_recv_pkts(__rte_unused void *rxq, > - __rte_unused struct rte_mbuf **rx_pkts, > - __rte_unused uint16_t nb_pkts) > -{ > - return 0; > -} > - > static int > pfe_eth_open(struct rte_eth_dev *dev) > { > @@ -383,8 +367,8 @@ pfe_eth_stop(struct rte_eth_dev *dev/*, int > wake*/) > gemac_disable(priv->EMAC_baseaddr); > gpi_disable(priv->GPI_baseaddr); >=20 > - dev->rx_pkt_burst =3D &pfe_dummy_recv_pkts; > - dev->tx_pkt_burst =3D &pfe_dummy_xmit_pkts; > + dev->rx_pkt_burst =3D rte_eth_pkt_burst_dummy; > + dev->tx_pkt_burst =3D rte_eth_pkt_burst_dummy; >=20 > return 0; > } > diff --git a/drivers/net/qede/qede_ethdev.c > b/drivers/net/qede/qede_ethdev.c > index a1122a297e6b..ea6b71f09355 100644 > --- a/drivers/net/qede/qede_ethdev.c > +++ b/drivers/net/qede/qede_ethdev.c > @@ -322,8 +322,8 @@ qede_assign_rxtx_handlers(struct rte_eth_dev *dev, > bool is_dummy) > bool use_tx_offload =3D false; >=20 > if (is_dummy) { > - dev->rx_pkt_burst =3D qede_rxtx_pkts_dummy; > - dev->tx_pkt_burst =3D qede_rxtx_pkts_dummy; > + dev->rx_pkt_burst =3D rte_eth_pkt_burst_dummy; > + dev->tx_pkt_burst =3D rte_eth_pkt_burst_dummy; > return; > } >=20 > diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c > index 7088c57b501d..85784f4a82a6 100644 > --- a/drivers/net/qede/qede_rxtx.c > +++ b/drivers/net/qede/qede_rxtx.c > @@ -2734,15 +2734,6 @@ qede_xmit_pkts_cmt(void *p_fp_cmt, struct > rte_mbuf **tx_pkts, uint16_t nb_pkts) > return eng0_pkts + eng1_pkts; > } >=20 > -uint16_t > -qede_rxtx_pkts_dummy(__rte_unused void *p_rxq, > - __rte_unused struct rte_mbuf **pkts, > - __rte_unused uint16_t nb_pkts) > -{ > - return 0; > -} > - > - > /* this function does a fake walk through over completion queue > * to calculate number of BDs used by HW. > * At the end, it restores the state of completion queue. > diff --git a/drivers/net/qede/qede_rxtx.h b/drivers/net/qede/qede_rxtx.h > index 11ed1d9b9c50..013a4a07c716 100644 > --- a/drivers/net/qede/qede_rxtx.h > +++ b/drivers/net/qede/qede_rxtx.h > @@ -272,9 +272,6 @@ uint16_t qede_recv_pkts_cmt(void *p_rxq, struct > rte_mbuf **rx_pkts, > uint16_t > qede_recv_pkts_regular(void *p_rxq, struct rte_mbuf **rx_pkts, > uint16_t nb_pkts); > -uint16_t qede_rxtx_pkts_dummy(void *p_rxq, > - struct rte_mbuf **pkts, > - uint16_t nb_pkts); >=20 > int qede_start_queues(struct rte_eth_dev *eth_dev); >=20 > diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h > index 8f0ac0adf0ae..075f97a4b37a 100644 > --- a/lib/ethdev/ethdev_driver.h > +++ b/lib/ethdev/ethdev_driver.h > @@ -1432,6 +1432,25 @@ rte_eth_linkstatus_get(const struct rte_eth_dev > *dev, > *dst =3D __atomic_load_n(src, __ATOMIC_SEQ_CST); > } >=20 > +/** > + * @internal > + * Dummy DPDK callback for Rx/Tx packet burst. > + * > + * @param queue > + * Pointer to Rx/Tx queue > + * @param pkts > + * Packet array > + * @param nb_pkts > + * Number of packets in packet array > + */ > +static inline uint16_t > +rte_eth_pkt_burst_dummy(void *queue __rte_unused, > + struct rte_mbuf **pkts __rte_unused, > + uint16_t nb_pkts __rte_unused) > +{ > + return 0; > +} > + > /** > * Allocate an unique switch domain identifier. > * > -- > 2.34.1