From: Ajit Khaparde <ajitkhaparde@gmail.com> To: dev@dpdk.org Cc: Samik Gupta <samik.gupta@broadcom.com>, stable@dpdk.org, Lance Richardson <lance.richardson@broadcom.com>, Somnath Kotur <somnath.kotur@broadcom.com> Subject: [dpdk-dev] [PATCH v2 02/17] net/bnxt: fix VNIC config on Rx queue stop Date: Wed, 9 Dec 2020 11:22:18 -0800 Message-ID: <20201209192233.6518-3-ajit.khaparde@broadcom.com> (raw) In-Reply-To: <20201209192233.6518-1-ajit.khaparde@broadcom.com> From: Samik Gupta <samik.gupta@broadcom.com> This commit reconfigures a vnic's default ring if the current default ring is stopped by the application. It picks the lowest numbered ring that is currently active to be the new default, and issues the hwrm_vnic_cfg command to update the configuration. Applies to adapters that are not Thor-based. Fixes: 9b63c6fd70e3 ("net/bnxt: support Rx/Tx queue start/stop") Cc: stable@dpdk.org Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Reviewed-by: Lance Richardson <lance.richardson@broadcom.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com> Signed-off-by: Samik Gupta <samik.gupta@broadcom.com> --- drivers/net/bnxt/bnxt_rxq.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c index e0ec34216..61196eba9 100644 --- a/drivers/net/bnxt/bnxt_rxq.c +++ b/drivers/net/bnxt/bnxt_rxq.c @@ -557,12 +557,12 @@ int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id) rc = bnxt_vnic_rss_configure(bp, vnic); } - if (BNXT_CHIP_THOR(bp)) { - /* Compute current number of active receive queues. */ - for (i = vnic->start_grp_id; i < vnic->end_grp_id; i++) - if (bp->rx_queues[i]->rx_started) - active_queue_cnt++; + /* Compute current number of active receive queues. */ + for (i = vnic->start_grp_id; i < vnic->end_grp_id; i++) + if (bp->rx_queues[i]->rx_started) + active_queue_cnt++; + if (BNXT_CHIP_THOR(bp)) { /* * For Thor, we need to ensure that the VNIC default receive * ring corresponds to an active receive queue. When no queue @@ -582,6 +582,22 @@ int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id) /* Reconfigure default receive ring. */ bnxt_hwrm_vnic_cfg(bp, vnic); } + } else if (active_queue_cnt) { + /* + * If the queue being stopped is the current default queue and + * there are other active queues, pick one of them as the + * default and reconfigure the vnic. + */ + if (vnic->dflt_ring_grp == bp->grp_info[rx_queue_id].fw_grp_id) { + for (i = vnic->start_grp_id; i < vnic->end_grp_id; i++) { + if (bp->rx_queues[i]->rx_started) { + vnic->dflt_ring_grp = + bp->grp_info[i].fw_grp_id; + bnxt_hwrm_vnic_cfg(bp, vnic); + break; + } + } + } } if (rc == 0) -- 2.21.1 (Apple Git-122.3)
next prev parent reply other threads:[~2020-12-09 19:23 UTC|newest] Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-09 19:22 [dpdk-dev] [PATCH v2 00/17] fixes and refactoring changes for bnxt Ajit Khaparde 2020-12-09 19:22 ` [dpdk-dev] [PATCH v2 01/17] net/bnxt: fix RX rings in RSS redirection table Ajit Khaparde 2020-12-09 19:22 ` Ajit Khaparde [this message] 2020-12-09 19:22 ` [dpdk-dev] [PATCH v2 03/17] net/bnxt: remove unused field Ajit Khaparde 2020-12-09 19:22 ` [dpdk-dev] [PATCH v2 04/17] net/bnxt: release hwrm lock in the error case Ajit Khaparde 2020-12-09 19:22 ` [dpdk-dev] [PATCH v2 05/17] net/bnxt: remove references to Thor Ajit Khaparde 2020-12-09 19:22 ` [dpdk-dev] [PATCH v2 06/17] net/bnxt: fix to return error when fw command fails Ajit Khaparde 2020-12-09 19:22 ` [dpdk-dev] [PATCH v2 07/17] net/bnxt: fix cleanup on mutex init failure Ajit Khaparde 2020-12-09 19:22 ` [dpdk-dev] [PATCH v2 08/17] net/bnxt: fix format specifier for unsigned int Ajit Khaparde 2020-12-09 19:22 ` [dpdk-dev] [PATCH v2 09/17] net/bnxt: fix max rings computation Ajit Khaparde 2020-12-09 19:22 ` [dpdk-dev] [PATCH v2 10/17] net/bnxt: support for 236 queues in NS3 Ajit Khaparde 2020-12-09 19:22 ` [dpdk-dev] [PATCH v2 11/17] net/bnxt: use the right function to free mbuf Ajit Khaparde 2020-12-09 19:22 ` [dpdk-dev] [PATCH v2 12/17] net/bnxt: remove function declaration Ajit Khaparde 2020-12-09 19:22 ` [dpdk-dev] [PATCH v2 13/17] net/bnxt: fix vnic RSS configure function Ajit Khaparde 2020-12-09 19:22 ` [dpdk-dev] [PATCH v2 14/17] net/bnxt: fix PF resource query Ajit Khaparde 2020-12-09 19:22 ` [dpdk-dev] [PATCH v2 15/17] net/bnxt: changes to indentation and coding style Ajit Khaparde 2020-12-09 19:22 ` [dpdk-dev] [PATCH v2 16/17] net/bnxt: add missing comments Ajit Khaparde 2020-12-09 19:22 ` [dpdk-dev] [PATCH v2 17/17] net/bnxt: modify ring index logic Ajit Khaparde 2020-12-09 20:49 ` Lance Richardson 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 00/17] fixes and refactoring changes for bnxt Ajit Khaparde 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 01/17] net/bnxt: fix RX rings in RSS redirection table Ajit Khaparde 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 02/17] net/bnxt: fix VNIC config on Rx queue stop Ajit Khaparde 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 03/17] net/bnxt: remove unused field Ajit Khaparde 2020-12-10 15:23 ` Lance Richardson 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 04/17] net/bnxt: release hwrm lock in the error case Ajit Khaparde 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 05/17] net/bnxt: remove references to Thor Ajit Khaparde 2020-12-10 15:28 ` Lance Richardson 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 06/17] net/bnxt: fix to return error when fw command fails Ajit Khaparde 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 07/17] net/bnxt: fix cleanup on mutex init failure Ajit Khaparde 2020-12-10 15:42 ` Lance Richardson 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 08/17] net/bnxt: fix format specifier for unsigned int Ajit Khaparde 2020-12-10 15:54 ` Lance Richardson 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 09/17] net/bnxt: fix max rings computation Ajit Khaparde 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 10/17] net/bnxt: support for 236 queues in NS3 Ajit Khaparde 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 11/17] net/bnxt: use the right function to free mbuf Ajit Khaparde 2020-12-10 15:56 ` Lance Richardson 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 12/17] net/bnxt: remove function declaration Ajit Khaparde 2020-12-10 15:57 ` Lance Richardson 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 13/17] net/bnxt: fix vnic RSS configure function Ajit Khaparde 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 14/17] net/bnxt: fix PF resource query Ajit Khaparde 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 15/17] net/bnxt: changes to indentation and coding style Ajit Khaparde 2020-12-10 15:59 ` Lance Richardson 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 16/17] net/bnxt: add missing comments Ajit Khaparde 2020-12-10 16:02 ` Lance Richardson 2020-12-09 23:53 ` [dpdk-dev] [PATCH v3 17/17] net/bnxt: modify ring index logic Ajit Khaparde 2020-12-10 14:23 ` Lance Richardson 2020-12-11 2:42 ` [dpdk-dev] [PATCH v3 00/17] fixes and refactoring changes for bnxt Ajit Khaparde
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=20201209192233.6518-3-ajit.khaparde@broadcom.com \ --to=ajitkhaparde@gmail.com \ --cc=dev@dpdk.org \ --cc=lance.richardson@broadcom.com \ --cc=samik.gupta@broadcom.com \ --cc=somnath.kotur@broadcom.com \ --cc=stable@dpdk.org \ /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
DPDK patches and discussions This inbox may be cloned and mirrored by anyone: git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \ dev@dpdk.org public-inbox-index dev Example config snippet for mirrors. Newsgroup available over NNTP: nntp://inbox.dpdk.org/inbox.dpdk.dev AGPL code for this site: git clone https://public-inbox.org/public-inbox.git