From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A529C4740A for ; Mon, 9 Sep 2019 12:01:04 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 2C6892086D for ; Mon, 9 Sep 2019 12:01:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C6892086D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=solarflare.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 480151ED5E; Mon, 9 Sep 2019 13:59:37 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 1ADA11EC89 for ; Mon, 9 Sep 2019 13:59:13 +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-us4.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id D3899800079; Mon, 9 Sep 2019 11:59:11 +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; Mon, 9 Sep 2019 04:59:04 -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; Mon, 9 Sep 2019 04:59:04 -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 x89Bx3qA027776; Mon, 9 Sep 2019 12:59:03 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id B5D661613D1; Mon, 9 Sep 2019 12:59:03 +0100 (BST) From: Andrew Rybchenko To: Chas Williams CC: , Ivan Ilchenko Date: Mon, 9 Sep 2019 12:58:49 +0100 Message-ID: <1568030331-16526-13-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1568030331-16526-1-git-send-email-arybchenko@solarflare.com> References: <1567699852-31693-1-git-send-email-arybchenko@solarflare.com> <1568030331-16526-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24898.005 X-TM-AS-Result: No-1.313600-4.000000-10 X-TMASE-MatchedRID: Wn2D/DSOcBHbS0m47m6fSn84FZpy/6JVAPiR4btCEeaYkF7ZtFfCU0kx APClfhN0YHB0GcKFMltFdYu4cV7ttyHhSBQfglfsA9lly13c/gHYuVu0X/rOkMwh6K2EqJIn5sL 6YgE8QF8p0ZJ5Yq0pe9xj9GFWJ4cRhK/XSkr3BlTylEfNwb6iLfX71s7cIJuTJmE4A+qD79lZru EoKvBZSVhWGQmcjfw3aTyuzdOrGrRovGFNoIkoj0f49ONH0RaSNV9S7O+u3KYLIq08JORQQtAOO SAF0cTNVMlZj3RhDo/E+eyncEK+S+VHGbcDbAq6FEUknJ/kEl7dB/CxWTRRu+rAZ8KTspSz89Yr +Xao83Oixpmft0sFgodxIgvwpgM5hswClhCDN5zaopqdHu1R1CemnqcohH1Dx3qV+wTj4U9agZu WbAO84QRcjx1caEChD1y8R38S3l1URzkirO0Q1F5h9KQWrq4BvuMTr7CQJJ5+3BndfXUhXQ== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--1.313600-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24898.005 X-MDID: 1568030352-Xeq-7HgQKfrG Subject: [dpdk-dev] [PATCH v2 12/13] test/bonding: check code of promiscuous 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" From: Ivan Ilchenko rte_eth_promiscuous_enable()/rte_eth_promiscuous_disable() return value was changed from void to int, so this patch modify usage of these functions across test/bonding according to new return type. Signed-off-by: Ivan Ilchenko Signed-off-by: Andrew Rybchenko --- app/test/test_link_bonding.c | 55 ++++++++++++++++++++++++------ app/test/test_link_bonding_mode4.c | 16 +++++++-- 2 files changed, 58 insertions(+), 13 deletions(-) diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c index 938fafca3a..cbbbc98a16 100644 --- a/app/test/test_link_bonding.c +++ b/app/test/test_link_bonding.c @@ -1760,13 +1760,17 @@ static int test_roundrobin_verify_promiscuous_enable_disable(void) { int i, promiscuous_en; + int ret; /* Initialize bonded device with 4 slaves in round robin mode */ TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( BONDING_MODE_ROUND_ROBIN, 0, 4, 1), "Failed to initialize bonded device with slaves"); - rte_eth_promiscuous_enable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_enable(test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(ret, + "Failed to enable promiscuous mode for port %d: %s", + test_params->bonded_port_id, rte_strerror(-ret)); promiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id); TEST_ASSERT_EQUAL(promiscuous_en, 1, @@ -1781,7 +1785,10 @@ test_roundrobin_verify_promiscuous_enable_disable(void) test_params->slave_port_ids[i]); } - rte_eth_promiscuous_disable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_disable(test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(ret, + "Failed to disable promiscuous mode for port %d: %s", + test_params->bonded_port_id, rte_strerror(-ret)); promiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id); TEST_ASSERT_EQUAL(promiscuous_en, 0, @@ -2200,6 +2207,7 @@ static int test_activebackup_verify_promiscuous_enable_disable(void) { int i, primary_port, promiscuous_en; + int ret; /* Initialize bonded device with 4 slaves in round robin mode */ TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( @@ -2211,7 +2219,10 @@ test_activebackup_verify_promiscuous_enable_disable(void) "failed to get primary slave for bonded port (%d)", test_params->bonded_port_id); - rte_eth_promiscuous_enable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_enable(test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(ret, + "Failed to enable promiscuous mode for port %d: %s", + test_params->bonded_port_id, rte_strerror(-ret)); TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 1, "Port (%d) promiscuous mode not enabled", @@ -2232,7 +2243,10 @@ test_activebackup_verify_promiscuous_enable_disable(void) } - rte_eth_promiscuous_disable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_disable(test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(ret, + "Failed to disable promiscuous mode for port %d: %s", + test_params->bonded_port_id, rte_strerror(-ret)); TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 0, "Port (%d) promiscuous mode not disabled\n", @@ -3110,13 +3124,17 @@ static int test_balance_verify_promiscuous_enable_disable(void) { int i; + int ret; /* Initialize bonded device with 4 slaves in round robin mode */ TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( BONDING_MODE_BALANCE, 0, 4, 1), "Failed to initialise bonded device"); - rte_eth_promiscuous_enable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_enable(test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(ret, + "Failed to enable promiscuous mode for port %d: %s", + test_params->bonded_port_id, rte_strerror(-ret)); TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 1, "Port (%d) promiscuous mode not enabled", @@ -3129,7 +3147,10 @@ test_balance_verify_promiscuous_enable_disable(void) test_params->slave_port_ids[i]); } - rte_eth_promiscuous_disable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_disable(test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(ret, + "Failed to disable promiscuous mode for port %d: %s", + test_params->bonded_port_id, rte_strerror(-ret)); TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 0, "Port (%d) promiscuous mode not disabled", @@ -3696,13 +3717,17 @@ static int test_broadcast_verify_promiscuous_enable_disable(void) { int i; + int ret; /* Initialize bonded device with 4 slaves in round robin mode */ TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( BONDING_MODE_BROADCAST, 0, 4, 1), "Failed to initialise bonded device"); - rte_eth_promiscuous_enable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_enable(test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(ret, + "Failed to enable promiscuous mode for port %d: %s", + test_params->bonded_port_id, rte_strerror(-ret)); TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 1, @@ -3716,7 +3741,10 @@ test_broadcast_verify_promiscuous_enable_disable(void) test_params->slave_port_ids[i]); } - rte_eth_promiscuous_disable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_disable(test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(ret, + "Failed to disable promiscuous mode for port %d: %s", + test_params->bonded_port_id, rte_strerror(-ret)); TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 0, "Port (%d) promiscuous mode not disabled", @@ -4174,6 +4202,7 @@ static int test_tlb_verify_promiscuous_enable_disable(void) { int i, primary_port, promiscuous_en; + int ret; /* Initialize bonded device with 4 slaves in transmit load balancing mode */ TEST_ASSERT_SUCCESS( initialize_bonded_device_with_slaves( @@ -4185,7 +4214,10 @@ test_tlb_verify_promiscuous_enable_disable(void) "failed to get primary slave for bonded port (%d)", test_params->bonded_port_id); - rte_eth_promiscuous_enable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_enable(test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(ret, + "Failed to enable promiscuous mode for port %d: %s", + test_params->bonded_port_id, rte_strerror(-ret)); promiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id); TEST_ASSERT_EQUAL(promiscuous_en, (int)1, @@ -4206,7 +4238,10 @@ test_tlb_verify_promiscuous_enable_disable(void) } - rte_eth_promiscuous_disable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_disable(test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(ret, + "Failed to disable promiscuous mode for port %d: %s\n", + test_params->bonded_port_id, rte_strerror(-ret)); promiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id); TEST_ASSERT_EQUAL(promiscuous_en, (int)0, diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c index bbb4e9cce1..70b95d0405 100644 --- a/app/test/test_link_bonding_mode4.c +++ b/app/test/test_link_bonding_mode4.c @@ -312,6 +312,7 @@ static int initialize_bonded_device_with_slaves(uint16_t slave_count, uint8_t external_sm) { uint8_t i; + int ret; RTE_VERIFY(test_params.bonded_port_id != INVALID_PORT_ID); @@ -323,7 +324,10 @@ initialize_bonded_device_with_slaves(uint16_t slave_count, uint8_t external_sm) /* Reset mode 4 configuration */ rte_eth_bond_8023ad_setup(test_params.bonded_port_id, NULL); - rte_eth_promiscuous_disable(test_params.bonded_port_id); + ret = rte_eth_promiscuous_disable(test_params.bonded_port_id); + TEST_ASSERT_SUCCESS(ret, + "Failed disable promiscuous mode for port %d: %s", + test_params.bonded_port_id, rte_strerror(-ret)); if (external_sm) { struct rte_eth_bond_8023ad_conf conf; @@ -824,7 +828,10 @@ test_mode4_rx(void) /* First try with promiscuous mode enabled. * Add 2 packets to each slave. First with bonding MAC address, second with * different. Check if we received all of them. */ - rte_eth_promiscuous_enable(test_params.bonded_port_id); + retval = rte_eth_promiscuous_enable(test_params.bonded_port_id); + TEST_ASSERT_SUCCESS(retval, + "Failed to enable promiscuous mode for port %d: %s", + test_params.bonded_port_id, rte_strerror(-retval)); expected_pkts_cnt = 0; FOR_EACH_SLAVE(i, slave) { @@ -869,7 +876,10 @@ test_mode4_rx(void) /* Now, disable promiscuous mode. When promiscuous mode is disabled we * expect to receive only packets that are directed to bonding port. */ - rte_eth_promiscuous_disable(test_params.bonded_port_id); + retval = rte_eth_promiscuous_disable(test_params.bonded_port_id); + TEST_ASSERT_SUCCESS(retval, + "Failed to disable promiscuous mode for port %d: %s", + test_params.bonded_port_id, rte_strerror(-retval)); expected_pkts_cnt = 0; FOR_EACH_SLAVE(i, slave) { -- 2.17.1