DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bnxt: don't fail rte_pmd_bnxt_set_all_queues_drop_en if no VF's
@ 2020-11-25 17:49 Stephen Hemminger
  0 siblings, 0 replies; only message in thread
From: Stephen Hemminger @ 2020-11-25 17:49 UTC (permalink / raw)
  To: ajit.khaparde, somnath.kotur; +Cc: dev, stable, Stephen Hemminger, olivier.matz

The function should return success if called with no active VF's.
It is OK to call this function if the desired outcome is to change
the flag for PF's even if there are no VF's.

Original code may have worked by accidental uninitialized variable;
then this bug was introduced by change to fix compilation warning.

Fixes: 4a671fdea9f4 ("net/bnxt: fix compilation with -Og")
Cc: olivier.matz@6wind.com
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
 drivers/net/bnxt/rte_pmd_bnxt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c
index d67db46c65eb..6a236ff4803b 100644
--- a/drivers/net/bnxt/rte_pmd_bnxt.c
+++ b/drivers/net/bnxt/rte_pmd_bnxt.c
@@ -85,7 +85,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on)
 	struct rte_eth_dev *eth_dev;
 	struct bnxt *bp;
 	uint32_t i;
-	int rc = -EINVAL;
+	int rc;
@@ -118,6 +118,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on)
 	/* Stall all active VFs */
+	rc = 0;
 	for (i = 0; i < bp->pf->active_vfs; i++) {
 		rc = bnxt_hwrm_func_vf_vnic_query_and_config(bp, i,
 				rte_pmd_bnxt_set_all_queues_drop_en_cb, &on,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-25 17:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 17:49 [dpdk-dev] [PATCH] net/bnxt: don't fail rte_pmd_bnxt_set_all_queues_drop_en if no VF's Stephen Hemminger

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 \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git