DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hyong Youb Kim <hyonkim@cisco.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>,
	Declan Doherty <declan.doherty@intel.com>,
	Chas Williams <chas3@att.com>
Cc: dev@dpdk.org, Hyong Youb Kim <hyonkim@cisco.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 1/2] net/bonding: do not set promisc on non-existent primary port
Date: Thu, 10 Jan 2019 02:22:34 -0800	[thread overview]
Message-ID: <20190110102235.1238-2-hyonkim@cisco.com> (raw)
In-Reply-To: <20190110102235.1238-1-hyonkim@cisco.com>

For active-backup, tlb, and alb mode,
bond_ethdev_promiscuous_{enable,disable} tries to set promisc mode on
the primary port, even when there are no slaves. It is harmless, as
rte_eth_promiscuous_{enable,disable} does nothing if the port number
is invalid. But, it does print a warning message. Here is an example
from testpmd.

testpmd> create bonded device 5 0
Created new bonded device net_bonding_testpmd_0 on (port 4).
Invalid port_id=33
testpmd> set promisc 4 off
Invalid port_id=33

33 in this case is RTE_MAX_ETHPORTS + 1, the invalid primary port
number used within the bonding driver. This warning message is
harmless but can be confusing to the user. So do not try to set
promisc on a primary port when we know it does not exist (i.e. no
slaves).

Fixes: 2efb58cbab6e ("bond: new link bonding library")
Cc: stable@dpdk.org

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 44deaf119..daf2440cd 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2593,6 +2593,9 @@ bond_ethdev_promiscuous_enable(struct rte_eth_dev *eth_dev)
 	case BONDING_MODE_TLB:
 	case BONDING_MODE_ALB:
 	default:
+		/* Do not touch promisc when there cannot be primary ports */
+		if (internals->slave_count == 0)
+			break;
 		rte_eth_promiscuous_enable(internals->current_primary_port);
 	}
 }
@@ -2621,6 +2624,9 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev)
 	case BONDING_MODE_TLB:
 	case BONDING_MODE_ALB:
 	default:
+		/* Do not touch promisc when there cannot be primary ports */
+		if (internals->slave_count == 0)
+			break;
 		rte_eth_promiscuous_disable(internals->current_primary_port);
 	}
 }
-- 
2.16.2

  reply	other threads:[~2019-01-10 10:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10 10:22 [dpdk-dev] [PATCH 0/2] net/bonding: a couple minor fixes Hyong Youb Kim
2019-01-10 10:22 ` Hyong Youb Kim [this message]
2019-02-09 13:16   ` [dpdk-dev] [PATCH 1/2] net/bonding: do not set promisc on non-existent primary port Chas Williams
2019-02-21 14:38     ` Ferruh Yigit
2019-01-10 10:22 ` [dpdk-dev] [PATCH 2/2] net/bonding: avoid the next active slave going out of bound Hyong Youb Kim
2019-02-09 13:17   ` Chas Williams
     [not found]     ` <7AE31235A30B41498D1C31348DC858BD5B5329AB@IRSMSX103.ger.corp.intel.com>
2019-02-18 15:25       ` Ferruh Yigit
2019-02-20 16:28         ` [dpdk-dev] [dpdk-stable] " 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=20190110102235.1238-2-hyonkim@cisco.com \
    --to=hyonkim@cisco.com \
    --cc=chas3@att.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.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
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).