DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: Rasesh Mody <rmody@marvell.com>
Cc: dpdk-dev <dev@dpdk.org>, Jerin Jacob <jerinj@marvell.com>,
	 Ferruh Yigit <ferruh.yigit@intel.com>,
	 GR-Everest-DPDK-Dev <GR-Everest-DPDK-Dev@marvell.com>,
	Igor Russkikh <irusskikh@marvell.com>,
	 Thomas Monjalon <thomas@monjalon.net>,
	Andrew Rybchenko <arybchenko@solarflare.com>
Subject: Re: [dpdk-dev] [PATCH 2/2] net/qede: restore Tx queue setup
Date: Tue, 5 May 2020 12:14:14 +0530	[thread overview]
Message-ID: <CALBAE1NnRgAQSXoCTNRzTj=3RVF-9NRZzEi1DO1Xqjcrmx4Q9Q@mail.gmail.com> (raw)
In-Reply-To: <20200505030943.1091-2-rmody@marvell.com>

On Tue, May 5, 2020 at 8:39 AM Rasesh Mody <rmody@marvell.com> wrote:
>
> Some applications do not explicitly restore Tx queues setup during
> port re-configuration. This patch adds changes to check for
> released Tx queues and restore the setup if application doesn't
> explicitly does that.

+ethdev maintainers.

I think, Ideally, the fix should be in common code if we need to
support such applications.

This would avoid the following case
- The application works only on a specific PMD.
- every PMD duplicating such restoration code.


>
> Signed-off-by: Rasesh Mody <rmody@marvell.com>
> Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
> ---
>  drivers/net/qede/qede_ethdev.h |  3 +++
>  drivers/net/qede/qede_rxtx.c   | 25 ++++++++++++++++++++++++-
>  2 files changed, 27 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
> index b988a73f2..2e8e5febc 100644
> --- a/drivers/net/qede/qede_ethdev.h
> +++ b/drivers/net/qede/qede_ethdev.h
> @@ -235,6 +235,9 @@ struct qede_dev {
>         bool enable_lro;
>         uint8_t num_rx_queues;
>         uint8_t num_tx_queues;
> +       uint16_t num_rx_desc;
> +       uint16_t num_tx_desc;
> +       const struct rte_eth_txconf *tx_conf;
>         SLIST_HEAD(vlan_list_head, qede_vlan_entry)vlan_list_head;
>         uint16_t configured_vlans;
>         bool accept_any_vlan;
> diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
> index b81788ca4..1b212a4fb 100644
> --- a/drivers/net/qede/qede_rxtx.c
> +++ b/drivers/net/qede/qede_rxtx.c
> @@ -151,6 +151,7 @@ qede_alloc_rx_queue_mem(struct rte_eth_dev *dev,
>         rxq->qdev = qdev;
>         rxq->mb_pool = mp;
>         rxq->nb_rx_desc = nb_desc;
> +       qdev->num_rx_desc = rxq->nb_rx_desc;
>         rxq->queue_id = queue_idx;
>         rxq->port_id = dev->data->port_id;
>
> @@ -405,6 +406,7 @@ qede_alloc_tx_queue_mem(struct rte_eth_dev *dev,
>         }
>
>         txq->nb_tx_desc = nb_desc;
> +       qdev->num_tx_desc = txq->nb_tx_desc;
>         txq->qdev = qdev;
>         txq->port_id = dev->data->port_id;
>
> @@ -443,6 +445,7 @@ qede_alloc_tx_queue_mem(struct rte_eth_dev *dev,
>
>         txq->nb_tx_avail = txq->nb_tx_desc;
>
> +       qdev->tx_conf = tx_conf;
>         txq->tx_free_thresh =
>             tx_conf->tx_free_thresh ? tx_conf->tx_free_thresh :
>             (txq->nb_tx_desc - QEDE_DEFAULT_TX_FREE_THRESH);
> @@ -593,7 +596,7 @@ qede_alloc_mem_sb(struct qede_dev *qdev, struct ecore_sb_info *sb_info,
>
>  int qede_alloc_fp_resc(struct qede_dev *qdev)
>  {
> -       struct ecore_dev *edev = &qdev->edev;
> +       struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
>         struct qede_fastpath *fp;
>         uint32_t num_sbs;
>         uint16_t sb_idx;
> @@ -1005,9 +1008,29 @@ static int qede_tx_queue_stop(struct rte_eth_dev *eth_dev, uint16_t tx_queue_id)
>  int qede_start_queues(struct rte_eth_dev *eth_dev)
>  {
>         struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev);
> +       struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
> +       struct qede_tx_queue *txq;
> +       struct qede_fastpath *fp;
>         uint8_t id;
>         int rc = -1;
>
> +       /* Restore setup of Tx queues */
> +       for (id = 0; id < qdev->num_tx_queues; id++) {
> +               fp = &qdev->fp_array[id];
> +               txq = fp->txq;
> +
> +               if (!txq) {
> +                       rc = qede_tx_queue_setup(eth_dev, id, qdev->num_tx_desc,
> +                                                eth_dev->data->numa_node,
> +                                                qdev->tx_conf);
> +                       if (rc != ECORE_SUCCESS) {
> +                               DP_ERR(edev, "TX queue %u not setup rc=%d\n",
> +                                      id, rc);
> +                               return -1;
> +                       }
> +               }
> +       }
> +
>         for (id = 0; id < qdev->num_rx_queues; id++) {
>                 rc = qede_rx_queue_start(eth_dev, id);
>                 if (rc != ECORE_SUCCESS)
> --
> 2.18.0
>

  reply	other threads:[~2020-05-05  6:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05  3:09 [dpdk-dev] [PATCH 1/2] net/qede: fix assignment of Rx/Tx handlers Rasesh Mody
2020-05-05  3:09 ` [dpdk-dev] [PATCH 2/2] net/qede: restore Tx queue setup Rasesh Mody
2020-05-05  6:44   ` Jerin Jacob [this message]
2020-05-05  8:59     ` Ferruh Yigit
2020-05-05  9:15       ` Thomas Monjalon
2020-05-06  2:43         ` [dpdk-dev] [EXT] " Rasesh Mody
2020-05-10  7:04           ` Jerin Jacob
2020-05-14  4:10             ` Rasesh Mody
2020-05-14  7:56               ` Jerin Jacob
2020-05-14 14:32           ` Ferruh Yigit
2020-05-14 22:43             ` Rasesh Mody
2020-05-15 10:39               ` Ferruh Yigit
2020-05-05  9:01 ` [dpdk-dev] [PATCH 1/2] net/qede: fix assignment of Rx/Tx handlers Ferruh Yigit
2020-05-06  2:34   ` [dpdk-dev] [EXT] " Rasesh Mody
2020-05-14  4:09 ` [dpdk-dev] [PATCH v2 " Rasesh Mody
2020-05-14  4:09 ` [dpdk-dev] [PATCH v2 2/2] examples/kni: fix MTU change to setup Tx queue Rasesh Mody
2020-05-14 15:33   ` Ferruh Yigit
2020-05-15 11:29   ` Ferruh Yigit
2020-05-19 16:31     ` Thomas Monjalon
2020-05-15  6:34 ` [dpdk-dev] [PATCH v3 1/2] net/qede: fix assignment of Rx/Tx handlers Rasesh Mody
2020-05-15 12:26   ` Jerin Jacob
2020-05-15  6:34 ` [dpdk-dev] [PATCH v3 2/2] net/qede: fix port reconfiguration Rasesh Mody

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='CALBAE1NnRgAQSXoCTNRzTj=3RVF-9NRZzEi1DO1Xqjcrmx4Q9Q@mail.gmail.com' \
    --to=jerinjacobk@gmail.com \
    --cc=GR-Everest-DPDK-Dev@marvell.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=irusskikh@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=rmody@marvell.com \
    --cc=thomas@monjalon.net \
    /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).