DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Bernard Iremonger <bernard.iremonger@intel.com>
Cc: <dev@dpdk.org>, Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Subject: [dpdk-dev] [PATCH v2 6/7] app/testpmd: check code of allmulticast mode switch
Date: Tue, 24 Sep 2019 13:56:12 +0100	[thread overview]
Message-ID: <1569329773-10185-7-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1569329773-10185-1-git-send-email-arybchenko@solarflare.com>

m>
 <1569329773-10185-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 app/test-pmd
according to new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/test-pmd/cmdline.c | 10 ++--------
 app/test-pmd/testpmd.h |  1 +
 app/test-pmd/util.c    | 16 ++++++++++++++++
 3 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 6b9444f42..dd4e6e602 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -6603,17 +6603,11 @@ static void cmd_set_allmulti_mode_parsed(void *parsed_result,
 	/* all ports */
 	if (allports) {
 		RTE_ETH_FOREACH_DEV(i) {
-			if (enable)
-				rte_eth_allmulticast_enable(i);
-			else
-				rte_eth_allmulticast_disable(i);
+			eth_set_allmulticast_mode(i, enable);
 		}
 	}
 	else {
-		if (enable)
-			rte_eth_allmulticast_enable(res->port_num);
-		else
-			rte_eth_allmulticast_disable(res->port_num);
+		eth_set_allmulticast_mode(res->port_num, enable);
 	}
 }
 
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 9446d279f..c039e2961 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -825,6 +825,7 @@ void setup_gso(const char *mode, portid_t port_id);
 int eth_dev_info_get_print_err(uint16_t port_id,
 			struct rte_eth_dev_info *dev_info);
 void eth_set_promisc_mode(uint16_t port_id, int enable);
+void eth_set_allmulticast_mode(uint16_t port, int enable);
 int eth_link_get_nowait_print_err(uint16_t port_id, struct rte_eth_link *link);
 
 
diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
index 19d36777a..ae29ee7a0 100644
--- a/app/test-pmd/util.c
+++ b/app/test-pmd/util.c
@@ -262,6 +262,22 @@ eth_set_promisc_mode(uint16_t port, int enable)
 			port, rte_strerror(-ret));
 }
 
+void
+eth_set_allmulticast_mode(uint16_t port, int enable)
+{
+	int ret;
+
+	if (enable)
+		ret = rte_eth_allmulticast_enable(port);
+	else
+		ret = rte_eth_allmulticast_disable(port);
+
+	if (ret != 0)
+		printf("Error during %s all-multicast mode for port %u: %s\n",
+			enable ? "enabling" : "disabling",
+			port, rte_strerror(-ret));
+}
+
 int
 eth_link_get_nowait_print_err(uint16_t port_id, struct rte_eth_link *link)
 {
-- 
2.17.1


  parent reply	other threads:[~2019-09-24 12:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-24 12:56 [dpdk-dev] [PATCH v2 0/7] ethdev: change allmulticast controls to return status Andrew Rybchenko
2019-09-24 12:56 ` [dpdk-dev] [PATCH v2 1/7] ethdev: change allmulticast mode API to return errors Andrew Rybchenko
2019-09-24 12:56 ` [dpdk-dev] [PATCH v2 2/7] net/failsafe: check code of allmulticast mode switch Andrew Rybchenko
2019-09-24 12:56 ` [dpdk-dev] [PATCH v2 3/7] net/bonding: " Andrew Rybchenko
2019-09-24 12:56 ` [dpdk-dev] [PATCH v2 4/7] ethdev: change allmulticast callbacks to return status Andrew Rybchenko
2019-09-26  2:00   ` Yang, Qiming
2019-09-26  7:41     ` Ferruh Yigit
2019-09-24 12:56 ` [dpdk-dev] [PATCH v2 5/7] ethdev: do nothing if all-multicast mode is applied again Andrew Rybchenko
2019-09-24 12:56 ` Andrew Rybchenko [this message]
2019-09-24 12:56 ` [dpdk-dev] [PATCH v2 7/7] examples/ipv4_multicast: check allmulticast enable status Andrew Rybchenko
2019-09-24 16:41 ` [dpdk-dev] [PATCH v2 0/7] ethdev: change allmulticast controls to return status 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=1569329773-10185-7-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=Ivan.Ilchenko@oktetlabs.ru \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=wenzhuo.lu@intel.com \
    /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).