From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Shepard Siegel <shepard.siegel@atomicrules.com>,
Ed Czeck <ed.czeck@atomicrules.com>,
John Miller <john.miller@atomicrules.com>,
"Rasesh Mody" <rmody@marvell.com>,
Shahed Shaikh <shshaikh@marvell.com>,
Ajit Khaparde <ajit.khaparde@broadcom.com>,
Somnath Kotur <somnath.kotur@broadcom.com>,
Nithin Dabilpuram <ndabilpuram@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Sunil Kumar Kori <skori@marvell.com>,
Satha Rao <skoteshwar@marvell.com>,
Hemant Agrawal <hemant.agrawal@nxp.com>,
"Sachin Saxena" <sachin.saxena@oss.nxp.com>,
John Daley <johndale@cisco.com>,
"Hyong Youb Kim" <hyonkim@cisco.com>,
"Min Hu (Connor)" <humin29@huawei.com>,
"Yisen Zhuang" <yisen.zhuang@huawei.com>,
Lijun Ou <oulijun@huawei.com>, Matan Azrad <matan@nvidia.com>,
Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
"Gagandeep Singh" <g.singh@nxp.com>,
Devendra Singh Rawat <dsinghrawat@marvell.com>,
Thomas Monjalon <thomas@monjalon.net>,
Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Cc: <dev@dpdk.org>, Ciara Loftus <ciara.loftus@intel.com>
Subject: Re: [PATCH] ethdev: introduce generic dummy packet burst function
Date: Thu, 10 Feb 2022 13:58:43 +0000 [thread overview]
Message-ID: <65625d88-ec45-80d8-0228-f9605ade18bd@intel.com> (raw)
In-Reply-To: <20220208194437.426143-1-ferruh.yigit@intel.com>
On 2/8/2022 7:44 PM, Ferruh Yigit wrote:
> 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 = removed_rx_burst;
> - eth_dev->tx_pkt_burst = removed_tx_burst;
> + eth_dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
> + eth_dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;
> eth_dev->dev_ops = &mlx5_dev_ops;
> eth_dev->rx_descriptor_status = mlx5_rx_descriptor_status;
> eth_dev->tx_descriptor_status = 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 = removed_rx_burst;
> - dev->tx_pkt_burst = removed_tx_burst;
> + dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
> + dev->tx_pkt_burst = 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 = &rte_eth_devices[rxq->port_id];
>
> if (dev->rx_pkt_burst == NULL ||
> - dev->rx_pkt_burst == removed_rx_burst) {
> + dev->rx_pkt_burst == rte_eth_pkt_burst_dummy) {
> rte_errno = ENOTSUP;
> return -rte_errno;
> }
Thinking twice I am not sure if above change works.
Since function is in the header file, and the .c file that assign
the 'dev->rx_pkt_burst' and the .c file that check function pointer
are different, these two different instance of same function may
have different addresses and above check may fail when it should match.
I guess solution is move the function to a .c file and export it
internally.
I was thinking to add ethdev_driver.c file, perhaps this can be
a motivation to start that file.
Thomas, Andrew, what do you think about ethdev_driver.c file?
next prev parent reply other threads:[~2022-02-10 13:59 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-08 19:44 Ferruh Yigit
2022-02-10 7:38 ` Loftus, Ciara
2022-02-10 8:59 ` Ferruh Yigit
2022-02-10 11:04 ` Morten Brørup
2022-02-10 11:39 ` Andrew Rybchenko
2022-02-10 11:47 ` Morten Brørup
2022-02-10 11:51 ` Andrew Rybchenko
2022-02-10 14:52 ` Slava Ovsiienko
2022-02-10 13:58 ` Ferruh Yigit [this message]
2022-02-10 16:30 ` Stephen Hemminger
2022-02-10 18:40 ` Thomas Monjalon
2022-02-11 9:49 ` [PATCH v2] " Ferruh Yigit
2022-02-11 17:14 ` [PATCH v3 1/2] " Ferruh Yigit
2022-02-11 17:14 ` [PATCH v3 2/2] ethdev: move driver interface functions to its own file Ferruh Yigit
2022-02-11 18:09 ` Thomas Monjalon
2022-02-11 18:39 ` Ferruh Yigit
2022-02-11 18:03 ` [PATCH v3 1/2] ethdev: introduce generic dummy packet burst function Thomas Monjalon
2022-02-11 18:38 ` [PATCH v4 " Ferruh Yigit
2022-02-11 18:38 ` [PATCH v4 2/2] ethdev: move driver interface functions to its own file Ferruh Yigit
2022-02-11 18:55 ` Thomas Monjalon
2022-02-11 19:01 ` Ferruh Yigit
2022-02-11 19:11 ` [PATCH v5 1/2] ethdev: introduce generic dummy packet burst function Ferruh Yigit
2022-02-11 19:11 ` [PATCH v5 2/2] ethdev: move driver interface functions to its own file Ferruh Yigit
2022-02-11 20:18 ` [PATCH v5 1/2] ethdev: introduce generic dummy packet burst function Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=65625d88-ec45-80d8-0228-f9605ade18bd@intel.com \
--to=ferruh.yigit@intel.com \
--cc=ajit.khaparde@broadcom.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=ciara.loftus@intel.com \
--cc=dev@dpdk.org \
--cc=dsinghrawat@marvell.com \
--cc=ed.czeck@atomicrules.com \
--cc=g.singh@nxp.com \
--cc=hemant.agrawal@nxp.com \
--cc=humin29@huawei.com \
--cc=hyonkim@cisco.com \
--cc=john.miller@atomicrules.com \
--cc=johndale@cisco.com \
--cc=kirankumark@marvell.com \
--cc=matan@nvidia.com \
--cc=ndabilpuram@marvell.com \
--cc=oulijun@huawei.com \
--cc=rmody@marvell.com \
--cc=sachin.saxena@oss.nxp.com \
--cc=shepard.siegel@atomicrules.com \
--cc=shshaikh@marvell.com \
--cc=skori@marvell.com \
--cc=skoteshwar@marvell.com \
--cc=somnath.kotur@broadcom.com \
--cc=thomas@monjalon.net \
--cc=viacheslavo@nvidia.com \
--cc=yisen.zhuang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).