From patchwork Tue Sep 24 12:56:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Rybchenko X-Patchwork-Id: 59668 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 582BC1BE0C; Tue, 24 Sep 2019 14:56:49 +0200 (CEST) Received: from dispatchb-us1.ppe-hosted.com (dispatchb-us1.ppe-hosted.com [148.163.129.53]) by dpdk.org (Postfix) with ESMTP id 1ABE02C23 for ; Tue, 24 Sep 2019 14:56:32 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us2.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id CB45A1C009C; Tue, 24 Sep 2019 12:56:27 +0000 (UTC) Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 24 Sep 2019 05:56:25 -0700 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Tue, 24 Sep 2019 05:56:24 -0700 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id x8OCuNTx029780; Tue, 24 Sep 2019 13:56:23 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id DA3FA1613D2; Tue, 24 Sep 2019 13:56:23 +0100 (BST) From: Andrew Rybchenko To: Wenzhuo Lu , Jingjing Wu , Bernard Iremonger CC: , Ivan Ilchenko Date: Tue, 24 Sep 2019 13:56:12 +0100 Message-ID: <1569329773-10185-7-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1569329773-10185-1-git-send-email-arybchenko@solarflare.com> References: <1568031190-16510-1-git-send-email-arybchenko@solarflare.co MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24930.005 X-TM-AS-Result: No-3.093800-4.000000-10 X-TMASE-MatchedRID: vdeff2Q33gV+fiIYUw6NwSAI8aJmq0jw8boZEVitthj5+tteD5RzhSXD Fxgit6TpPVa/URzklI/QROVRawRx6qrpbcAnxpVuPwKTD1v8YV5MkOX0UoduuVVkJxysad/IRlS qJpn6jydO8RWiWFWZmSQLkBm/aHTAlwV2iaAfSWcURSScn+QSXt0H8LFZNFG76sBnwpOylLOqu6 F/u9HDozErp5Y+I8mz5E/1ctM3KfJ4ywDbo09Ll3ZuFpbKcUdN556/0p43VSWPW6dbf2ad/Qdrq 30rACaSRaIIEbpe1B4PXLxHfxLeXVRHOSKs7RDUXmH0pBaurgG+4xOvsJAknn7cGd19dSFd X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--3.093800-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24930.005 X-MDID: 1569329788-aHE_3YFv_PPu Subject: [dpdk-dev] [PATCH v2 6/7] app/testpmd: check code of allmulticast mode switch X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" m> <1569329773-10185-1-git-send-email-arybchenko@solarflare.com> From: Ivan Ilchenko 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 Signed-off-by: Andrew Rybchenko --- 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) {