DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Xueming Li <xuemingl@nvidia.com>, <dev@dpdk.org>,
	Martin Spinler <spinler@cesnet.cz>,
	"Min Hu (Connor)" <humin29@huawei.com>,
	Yisen Zhuang <yisen.zhuang@huawei.com>,
	Lijun Ou <oulijun@huawei.com>
Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	"Singh, Aman Deep" <aman.deep.singh@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	"Igor Russkikh" <irusskikh@marvell.com>,
	Steven Webster <steven.webster@windriver.com>,
	Matt Peters <matt.peters@windriver.com>,
	Somalapuram Amaranath <asomalap@amd.com>,
	Rasesh Mody <rmody@marvell.com>,
	Shahed Shaikh <shshaikh@marvell.com>,
	Ajit Khaparde <ajit.khaparde@broadcom.com>,
	Somnath Kotur <somnath.kotur@broadcom.com>,
	Chas Williams <chas3@att.com>,
	"Min Hu (Connor)" <humin29@huawei.com>,
	Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>,
	Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>,
	Hemant Agrawal <hemant.agrawal@nxp.com>,
	Sachin Saxena <sachin.saxena@oss.nxp.com>,
	Haiyue Wang <haiyue.wang@intel.com>,
	"Marcin Wojtas" <mw@semihalf.com>,
	Michal Krawczyk <mk@semihalf.com>,
	Shai Brandes <shaibran@amazon.com>,
	Evgeny Schemeilin <evgenys@amazon.com>,
	Igor Chauskin <igorch@amazon.com>,
	Gagandeep Singh <g.singh@nxp.com>,
	John Daley <johndale@cisco.com>,
	Hyong Youb Kim <hyonkim@cisco.com>, Gaetan Rivet <grive@u256.net>,
	Qi Zhang <qi.z.zhang@intel.com>,
	Xiao Wang <xiao.w.wang@intel.com>,
	Ziyang Xuan <xuanziyang2@huawei.com>,
	Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>,
	Guoyang Zhou <zhouguoyang@huawei.com>,
	"Yisen Zhuang" <yisen.zhuang@huawei.com>,
	Lijun Ou <oulijun@huawei.com>,
	Beilei Xing <beilei.xing@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Qiming Yang <qiming.yang@intel.com>,
	Andrew Boyer <aboyer@pensando.io>,
	Shijith Thotton <sthotton@marvell.com>,
	Srisivasubramanian Srinivasan <srinivasan@marvell.com>,
	Jakub Grajciar <jgrajcia@cisco.com>,
	Matan Azrad <matan@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	Zyta Szpak <zr@semihalf.com>, Liron Himi <lironh@marvell.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	Long Li <longli@microsoft.com>,
	Heinrich Kuhn <heinrich.kuhn@corigine.com>,
	Jiawen Wu <jiawenwu@trustnetic.com>,
	"Tetsuya Mukawa" <mtetsuyah@gmail.com>,
	Harman Kalra <hkalra@marvell.com>,
	Jerin Jacob <jerinj@marvell.com>,
	Nalla Pradeep <pnalla@marvell.com>,
	"Radha Mohan Chintakuntla" <radhac@marvell.com>,
	Veerasenareddy Burru <vburru@marvell.com>,
	Devendra Singh Rawat <dsinghrawat@marvell.com>,
	"Keith Wiles" <keith.wiles@intel.com>,
	Maciej Czekaj <mczekaj@marvell.com>,
	Jian Wang <jianwang@trustnetic.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	 Chenbo Xia <chenbo.xia@intel.com>,
	Yong Wang <yongwang@vmware.com>
Subject: Re: [dpdk-dev] [PATCH v5 2/2] ethdev: change queue release callback
Date: Tue, 21 Sep 2021 19:13:42 +0100	[thread overview]
Message-ID: <5dbc3817-924b-9bdd-5176-f971ed63c493@intel.com> (raw)
In-Reply-To: <20210918123525.135129-3-xuemingl@nvidia.com>

On 9/18/2021 1:35 PM, Xueming Li wrote:
> Currently, most ethdev callback API use queue ID as parameter, but Rx
> and Tx queue release callback use queue object which is used by Rx and
> Tx burst data plane callback.
> 
> To align with other eth device queue configuration callbacks:
> - queue release callbacks are changed to use queue ID
> - all drivers are adapted
> 
> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

<...>

> -void bnxt_rx_queue_release_op(void *rx_queue)
> +void bnxt_rx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx)
>  {
> -	struct bnxt_rx_queue *rxq = (struct bnxt_rx_queue *)rx_queue;
> +	struct bnxt_rx_queue *rxq = dev->data->rx_queues[queue_idx];
>  
>  	if (rxq) {
>  		if (is_bnxt_in_error(rxq->bp))
> @@ -273,6 +273,7 @@ void bnxt_rx_queue_release_op(void *rx_queue)
>  		rxq->mz = NULL;
>  
>  		rte_free(rxq);
> +		dev->data->rx_queues[queue_idx] = NULL;

Similar question as did a few more times (I started to review from bottom), if
this change is related to this set and if it should be fixed first before this
patch.

<...>

> -void bnxt_tx_queue_release_op(void *tx_queue)
> +void bnxt_tx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx)
>  {
> -	struct bnxt_tx_queue *txq = (struct bnxt_tx_queue *)tx_queue;
> +	struct bnxt_tx_queue *txq = dev->data->tx_queues[queue_idx];
>  
>  	if (txq) {
>  		if (is_bnxt_in_error(txq->bp))
> @@ -83,6 +83,7 @@ void bnxt_tx_queue_release_op(void *tx_queue)
>  
>  		rte_free(txq->free);
>  		rte_free(txq);
> +		dev->data->tx_queues[queue_idx] = NULL;

ditto.

>  	}
>  }
>  
> @@ -115,7 +116,7 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev,
>  	if (eth_dev->data->tx_queues) {
>  		txq = eth_dev->data->tx_queues[queue_idx];
>  		if (txq) {
> -			bnxt_tx_queue_release_op(txq);
> +			bnxt_tx_queue_release_op(eth_dev, queue_idx);
>  			txq = NULL;

For the 'txq = NULL', can the intetion be
"eth_dev->data->tx_queues[queue_idx] = NULL", since above
'bnxt_tx_queue_release_op()' adds this assignment. Otherwise it looks unnecessary.

<...>

> @@ -2421,7 +2421,6 @@ static struct eth_dev_ops dpaa2_ethdev_ops = {
>  	.rx_queue_setup    = dpaa2_dev_rx_queue_setup,
>  	.rx_queue_release  = dpaa2_dev_rx_queue_release,
>  	.tx_queue_setup    = dpaa2_dev_tx_queue_setup,
> -	.tx_queue_release  = dpaa2_dev_tx_queue_release,

This should be removed in previous patch.

<...>

> @@ -1536,7 +1536,8 @@ hns3_fake_rx_queue_config(struct hns3_hw *hw, uint16_t nb_queues)
>  		/* re-configure */
>  		rxq = hw->fkq_data.rx_queues;
>  		for (i = nb_queues; i < old_nb_queues; i++)
> -			hns3_dev_rx_queue_release(rxq[i]);
> +			hns3_dev_rx_queue_release
> +				(&rte_eth_devices[hw->data->port_id], i);

I think this should be done without driver accesing the global 'rte_eth_devices'
array. This may require more help from driver maintainer, and perhaps wrapper
functions can be used for the driver for now and maintainer can update it later,
if agreed with the driver maintainer.

<...>

>  void
> -i40e_dev_rx_queue_release(void *rxq)
> +i40e_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
> +{
> +	i40e_rx_queue_release(dev->data->rx_queues[qid]);
> +}
> +
> +void
> +i40e_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
> +{
> +	i40e_tx_queue_release(dev->data->tx_queues[qid]);
> +}
> +

Is there any specific reason to not update driver but add wrappers for it?

<...>

> +void
> +ice_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
> +{
> +	ice_rx_queue_release(dev->data->rx_queues[qid]);
> +}
> +
> +void
> +ice_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
> +{
> +	ice_tx_queue_release(dev->data->tx_queues[qid]);
> +}
> +

Is there any specific reason to not update driver but add wrappers for it?

<...>

> diff --git a/drivers/net/nfb/nfb_rx.c b/drivers/net/nfb/nfb_rx.c
> index d6d4ba9663..3ebb332ae4 100644
> --- a/drivers/net/nfb/nfb_rx.c
> +++ b/drivers/net/nfb/nfb_rx.c
> @@ -176,9 +176,10 @@ nfb_eth_rx_queue_init(struct nfb_device *nfb,
>  }
>  
>  void
> -nfb_eth_rx_queue_release(void *q)
> +nfb_eth_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
>  {
> -	struct ndp_rx_queue *rxq = (struct ndp_rx_queue *)q;
> +	struct ndp_rx_queue *rxq = dev->data->rx_queues[qid];
> +
>  	if (rxq->queue != NULL) {
>  		ndp_close_rx_queue(rxq->queue);
>  		rte_free(rxq);

Unrealted with this patch, but this code follows as below, why setting
'rxq->queue = NULL' after 'rxq' is freed? This needs to be fixed separately (


      1         if (rxq->queue != NULL) {
      2                 ndp_close_rx_queue(rxq->queue);
      3                 rte_free(rxq);
      4                 rxq->queue = NULL;
      5         }

Same for 'nfb_eth_tx_queue_release()'

<...>

> @@ -556,7 +558,8 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev,
>  
>  	if (tz == NULL) {
>  		PMD_DRV_LOG(ERR, "Error allocating rx dma");
> -		nfp_net_rx_queue_release(rxq);
> +		nfp_net_rx_queue_release(dev, queue_idx);
> +		dev->data->rx_queues[queue_idx] = NULL;

Althoug I agree on NULL assignment, not sure if it is related for this patch. It
seems this assignment was missing and this patch is fixing it, independent from
API change.

I did similar comment for other drivers, as a generic comment, what about fixing
them in a separate patch first, and do the API convertion later?

<...>

> @@ -248,16 +248,18 @@ otx_ep_rx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t q_no,
>   * Release the receive queue/ringbuffer. Called by
>   * the upper layers.
>   *
> - * @param rxq
> - *    Opaque pointer to the receive queue to release
> + * @param dev
> + *    Pointer to the structure rte_eth_dev
> + * @param q_no
> + *    Queue number
>   *

For rest of the drivers, comments updated as following, I suggest keeping
consistent wording on all drivers:

@param dev
  Pointer to Ethernet device structure.
@param q_no
  Receive queue index.

<...>

>  
> +static void
> +qede_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
> +{
> +	qede_rx_queue_release(dev->data->rx_queues[qid]);
> +}
> +
> +static void
> +qede_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)
> +{
> +	qede_tx_queue_release(dev->data->tx_queues[qid]);
> +}
> +

Technically this wrapping can be done for all drivers, I can see it simplifies
the implementation for this patch but not sure if it is best for the driver.

And since in other drivers implemenation is changed instead of this wrapper, is
there a specific reason to not update the implementation for 'qede'?

<...>

> @@ -872,6 +871,7 @@ nicvf_dev_tx_queue_release(void *sq)
>  			txq->txbuffs = NULL;
>  		}
>  		rte_free(txq);
> +		dev->data->tx_queues[qid] = NULL;

This may be required but seems not related to changing release API parameters
('eth_dev_txq_release()' already sets txq[id] to NULL).

And if this change is required, same can be required for
'nicvf_dev_rx_queue_release()', what about dropping this change from set and
make a separate patch for it if required?

  reply	other threads:[~2021-09-21 18:14 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27  3:41 [dpdk-dev] [RFC] " Xueming Li
2021-07-28  7:40 ` Andrew Rybchenko
2021-08-09 14:39   ` Singh, Aman Deep
2021-08-09 15:31     ` Ferruh Yigit
2021-08-10  8:03       ` Xueming(Steven) Li
2021-08-10  8:54         ` Ferruh Yigit
2021-08-10  9:07           ` Xueming(Steven) Li
2021-08-11 11:57             ` Ferruh Yigit
2021-08-11 12:13               ` Xueming(Steven) Li
2021-08-12 14:29                 ` Xueming(Steven) Li
2021-09-26 11:25               ` Xueming(Steven) Li
2021-08-11 13:45 ` [dpdk-dev] [PATCH v1] " Xueming Li
2021-09-15 13:02 ` [dpdk-dev] [PATCH v2] " Xueming Li
2021-09-15 13:36   ` Xueming(Steven) Li
2021-09-16  8:09   ` Thomas Monjalon
2021-09-16 15:43     ` Xueming(Steven) Li
2021-09-16 15:50       ` Thomas Monjalon
2021-09-17  9:40         ` Xueming(Steven) Li
2021-09-17  9:39 ` [dpdk-dev] [PATCH v3 0/2] " Xueming Li
2021-09-17  9:39   ` [dpdk-dev] [PATCH v3 1/2] ethdev: queue release callback optional Xueming Li
2021-09-17 11:29     ` Andrew Rybchenko
2021-09-17 11:53       ` Andrew Rybchenko
2021-09-17 14:33         ` Xueming(Steven) Li
2021-09-17  9:39   ` [dpdk-dev] [PATCH v3 2/2] ethdev: change queue release callback Xueming Li
2021-09-17 11:49     ` Andrew Rybchenko
2021-09-17 14:31       ` Xueming(Steven) Li
2021-09-17 14:28 ` [dpdk-dev] [PATCH v4 0/2] " Xueming Li
2021-09-17 14:28   ` [dpdk-dev] [PATCH v4 1/2] ethdev: make queue release callback optional Xueming Li
2021-09-18  6:44     ` Andrew Rybchenko
2021-10-05 22:00       ` Thomas Monjalon
2021-09-17 14:28   ` [dpdk-dev] [PATCH v4 2/2] ethdev: change queue release callback Xueming Li
2021-09-18  6:50     ` Andrew Rybchenko
2021-09-18 12:39       ` Xueming(Steven) Li
2021-09-18 12:35 ` [dpdk-dev] [PATCH v5 0/2] " Xueming Li
2021-09-18 12:35   ` [dpdk-dev] [PATCH v5 1/2] ethdev: make queue release callback optional Xueming Li
2021-09-21 16:23     ` Ferruh Yigit
2021-09-18 12:35   ` [dpdk-dev] [PATCH v5 2/2] ethdev: change queue release callback Xueming Li
2021-09-21 18:13     ` Ferruh Yigit [this message]
2021-09-22  9:35       ` Xueming(Steven) Li
2021-09-22 10:57         ` Ferruh Yigit
2021-09-22 12:54           ` Xueming(Steven) Li
2021-09-29 13:57             ` Xueming(Steven) Li
2021-10-05 16:38               ` Ferruh Yigit
2021-10-06  7:55                 ` Xueming(Steven) Li
2021-10-06  8:04                   ` Ferruh Yigit
2021-10-06 11:19                     ` Xueming(Steven) Li
     [not found]           ` <2d2e9329b076c022418efd7b38ff280cf3ed1af4.camel@nvidia.com>
     [not found]             ` <56f7537a-bfc0-e4b8-72e8-c382ef0e2dbd@huawei.com>
     [not found]               ` <8e2c2f96265dc17af0564befb3918f1a8ea5154a.camel@nvidia.com>
2021-09-29 14:04                 ` [dpdk-dev] Fwd: " Xueming(Steven) Li
2021-09-30 15:17 ` [dpdk-dev] [PATCH v6 0/2] " Xueming Li
2021-09-30 15:17   ` [dpdk-dev] [PATCH v6 1/2] ethdev: make queue release callback optional Xueming Li
2021-10-05 22:04     ` Thomas Monjalon
2021-09-30 15:17   ` [dpdk-dev] [PATCH v6 2/2] ethdev: change queue release callback Xueming Li
2021-10-03  7:38     ` Matan Azrad
2021-10-03 21:00       ` Ajit Khaparde
2021-10-06 10:21     ` Somnath Kotur
2021-10-06 11:18 ` [dpdk-dev] [PATCH v7 0/2] " Xueming Li
2021-10-06 11:18   ` [dpdk-dev] [PATCH v7 1/2] ethdev: make queue release callback optional Xueming Li
2021-10-06 15:38     ` Hemant Agrawal
2021-10-08  8:16     ` Xu, Rosen
2021-10-06 11:18   ` [dpdk-dev] [PATCH v7 2/2] ethdev: change queue release callback Xueming Li
2021-10-06 17:20     ` Ferruh Yigit
2021-10-11  8:28     ` Thomas Monjalon
2021-10-11 13:11       ` Ferruh Yigit
2021-10-06 17:25   ` [dpdk-dev] [PATCH v7 0/2] " 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=5dbc3817-924b-9bdd-5176-f971ed63c493@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=aboyer@pensando.io \
    --cc=ajit.khaparde@broadcom.com \
    --cc=aman.deep.singh@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=asomalap@amd.com \
    --cc=beilei.xing@intel.com \
    --cc=chas3@att.com \
    --cc=chenbo.xia@intel.com \
    --cc=cloud.wangxiaoyun@huawei.com \
    --cc=dev@dpdk.org \
    --cc=dsinghrawat@marvell.com \
    --cc=evgenys@amazon.com \
    --cc=g.singh@nxp.com \
    --cc=grive@u256.net \
    --cc=haiyue.wang@intel.com \
    --cc=heinrich.kuhn@corigine.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=hkalra@marvell.com \
    --cc=humin29@huawei.com \
    --cc=hyonkim@cisco.com \
    --cc=igorch@amazon.com \
    --cc=irusskikh@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=jgrajcia@cisco.com \
    --cc=jianwang@trustnetic.com \
    --cc=jiawenwu@trustnetic.com \
    --cc=jingjing.wu@intel.com \
    --cc=johndale@cisco.com \
    --cc=keith.wiles@intel.com \
    --cc=kirankumark@marvell.com \
    --cc=lironh@marvell.com \
    --cc=longli@microsoft.com \
    --cc=matan@nvidia.com \
    --cc=matt.peters@windriver.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mczekaj@marvell.com \
    --cc=mk@semihalf.com \
    --cc=mtetsuyah@gmail.com \
    --cc=mw@semihalf.com \
    --cc=ndabilpuram@marvell.com \
    --cc=oulijun@huawei.com \
    --cc=pnalla@marvell.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=radhac@marvell.com \
    --cc=rahul.lakkireddy@chelsio.com \
    --cc=rmody@marvell.com \
    --cc=sachin.saxena@oss.nxp.com \
    --cc=shaibran@amazon.com \
    --cc=shshaikh@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=spinler@cesnet.cz \
    --cc=srinivasan@marvell.com \
    --cc=steven.webster@windriver.com \
    --cc=sthemmin@microsoft.com \
    --cc=sthotton@marvell.com \
    --cc=thomas@monjalon.net \
    --cc=vburru@marvell.com \
    --cc=viacheslavo@nvidia.com \
    --cc=xiao.w.wang@intel.com \
    --cc=xuanziyang2@huawei.com \
    --cc=xuemingl@nvidia.com \
    --cc=yisen.zhuang@huawei.com \
    --cc=yongwang@vmware.com \
    --cc=zhouguoyang@huawei.com \
    --cc=zr@semihalf.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).