DPDK patches and discussions
 help / color / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: Chas Williams <chas3@att.com>
Cc: <dev@dpdk.org>, Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Subject: [dpdk-dev] [PATCH 3/7] net/bonding: check code of allmulticast mode switch
Date: Mon, 9 Sep 2019 13:13:05 +0100
Message-ID: <1568031190-16510-4-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1568031190-16510-1-git-send-email-arybchenko@solarflare.com>

From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>

rte_eth_allmulticast_enable()/rte_eth_allmulticast_disable() return
value was changed from void to int, so this patch modify usage
of these functions across net/bonding
according to new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 13 +++++++--
 drivers/net/bonding/rte_eth_bond_pmd.c    | 33 +++++++++++++++++++----
 2 files changed, 39 insertions(+), 7 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index 7189a84585..e64fb6e41d 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -915,7 +915,12 @@ bond_mode_8023ad_register_lacp_mac(uint16_t slave_id)
 {
 	int ret;
 
-	rte_eth_allmulticast_enable(slave_id);
+	ret = rte_eth_allmulticast_enable(slave_id);
+	if (ret != 0) {
+		RTE_BOND_LOG(ERR,
+			"failed to enable allmulti mode for port %u: %s",
+			slave_id, rte_strerror(-ret));
+	}
 	if (rte_eth_allmulticast_get(slave_id)) {
 		RTE_BOND_LOG(DEBUG, "forced allmulti for port %u",
 			     slave_id);
@@ -949,7 +954,11 @@ bond_mode_8023ad_unregister_lacp_mac(uint16_t slave_id)
 	switch (bond_mode_8023ad_ports[slave_id].forced_rx_flags) {
 	case BOND_8023AD_FORCED_ALLMULTI:
 		RTE_BOND_LOG(DEBUG, "unset allmulti for port %u", slave_id);
-		rte_eth_allmulticast_disable(slave_id);
+		ret = rte_eth_allmulticast_disable(slave_id);
+		if (ret != 0)
+			RTE_BOND_LOG(ERR,
+				"failed to disable allmulti mode for port %u: %s",
+				slave_id, rte_strerror(-ret));
 		break;
 
 	case BOND_8023AD_FORCED_PROMISC:
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index f9b7b595df..f2ef4c3341 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2601,6 +2601,8 @@ bond_ethdev_allmulticast_enable(struct rte_eth_dev *eth_dev)
 {
 	struct bond_dev_private *internals = eth_dev->data->dev_private;
 	int i;
+	int ret;
+	uint16_t port_id;
 
 	switch (internals->mode) {
 	/* allmulti mode is propagated to all slaves */
@@ -2609,9 +2611,13 @@ bond_ethdev_allmulticast_enable(struct rte_eth_dev *eth_dev)
 	case BONDING_MODE_BROADCAST:
 	case BONDING_MODE_8023AD:
 		for (i = 0; i < internals->slave_count; i++) {
-			uint16_t port_id = internals->slaves[i].port_id;
+			port_id = internals->slaves[i].port_id;
 
-			rte_eth_allmulticast_enable(port_id);
+			ret = rte_eth_allmulticast_enable(port_id);
+			if (ret != 0)
+				RTE_BOND_LOG(ERR,
+					"Failed to enable allmulti mode for port %u: %s",
+					port_id, rte_strerror(-ret));
 		}
 		break;
 	/* allmulti mode is propagated only to primary slave */
@@ -2622,7 +2628,12 @@ bond_ethdev_allmulticast_enable(struct rte_eth_dev *eth_dev)
 		/* Do not touch allmulti when there cannot be primary ports */
 		if (internals->slave_count == 0)
 			break;
-		rte_eth_allmulticast_enable(internals->current_primary_port);
+		port_id = internals->current_primary_port;
+		ret = rte_eth_allmulticast_enable(port_id);
+		if (ret != 0)
+			RTE_BOND_LOG(ERR,
+				"Failed to enable allmulti mode for port %u: %s",
+				port_id, rte_strerror(-ret));
 	}
 }
 
@@ -2631,6 +2642,8 @@ bond_ethdev_allmulticast_disable(struct rte_eth_dev *eth_dev)
 {
 	struct bond_dev_private *internals = eth_dev->data->dev_private;
 	int i;
+	int ret;
+	uint16_t port_id;
 
 	switch (internals->mode) {
 	/* allmulti mode is propagated to all slaves */
@@ -2645,7 +2658,12 @@ bond_ethdev_allmulticast_disable(struct rte_eth_dev *eth_dev)
 			    bond_mode_8023ad_ports[port_id].forced_rx_flags ==
 					BOND_8023AD_FORCED_ALLMULTI)
 				continue;
-			rte_eth_allmulticast_disable(port_id);
+
+			ret = rte_eth_allmulticast_disable(port_id);
+			if (ret != 0)
+				RTE_BOND_LOG(ERR,
+					"Failed to disable allmulti mode for port %u: %s",
+					port_id, rte_strerror(-ret));
 		}
 		break;
 	/* allmulti mode is propagated only to primary slave */
@@ -2656,7 +2674,12 @@ bond_ethdev_allmulticast_disable(struct rte_eth_dev *eth_dev)
 		/* Do not touch allmulti when there cannot be primary ports */
 		if (internals->slave_count == 0)
 			break;
-		rte_eth_allmulticast_disable(internals->current_primary_port);
+		port_id = internals->current_primary_port;
+		ret = rte_eth_allmulticast_disable(port_id);
+		if (ret != 0)
+			RTE_BOND_LOG(ERR,
+				"Failed to disable allmulti mode for port %u: %s",
+				port_id, rte_strerror(-ret));
 	}
 }
 
-- 
2.17.1


  parent reply index

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-09 12:13 [dpdk-dev] [PATCH 0/7] ethdev: change allmulticast controls to return status Andrew Rybchenko
2019-09-09 12:13 ` [dpdk-dev] [PATCH 1/7] ethdev: change allmulticast mode controllers to return errors Andrew Rybchenko
2019-09-09 12:13 ` [dpdk-dev] [PATCH 2/7] net/failsafe: check code of allmulticast mode switch Andrew Rybchenko
2019-09-09 12:56   ` Gaëtan Rivet
2019-09-13 21:04     ` Andrew Rybchenko
2019-09-09 12:13 ` Andrew Rybchenko [this message]
2019-09-09 12:13 ` [dpdk-dev] [PATCH 4/7] ethdev: change allmulticast callbacks to return status Andrew Rybchenko
2019-09-16  7:03   ` Hyong Youb Kim (hyonkim)
2019-09-16  7:29     ` Andrew Rybchenko
2019-09-24  8:27   ` Ferruh Yigit
2019-09-24 12:14     ` Andrew Rybchenko
2019-09-09 12:13 ` [dpdk-dev] [PATCH 5/7] ethdev: do nothing if all-multicast mode is applied again Andrew Rybchenko
2019-09-24  8:36   ` Ferruh Yigit
2019-09-24  8:54     ` Andrew Rybchenko
2019-09-24 11:03       ` Ferruh Yigit
2019-09-24 11:50         ` Andrew Rybchenko
2019-09-09 12:13 ` [dpdk-dev] [PATCH 6/7] app/testpmd: check code of allmulticast mode switch Andrew Rybchenko
2019-09-09 12:13 ` [dpdk-dev] [PATCH 7/7] examples/ipv4_multicast: check allmulticast enable status Andrew Rybchenko

Reply instructions:

You may reply publically 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=1568031190-16510-4-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=Ivan.Ilchenko@oktetlabs.ru \
    --cc=chas3@att.com \
    --cc=dev@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

Archives are clonable:
	git clone --mirror http://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/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


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