From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 8F672A0096 for ; Wed, 8 May 2019 18:03:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 87AAFDE3; Wed, 8 May 2019 18:03:17 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id BC11DDE3 for ; Wed, 8 May 2019 18:03:16 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2EB398831D; Wed, 8 May 2019 16:03:16 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-210.ams2.redhat.com [10.36.117.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3077160C82; Wed, 8 May 2019 16:03:14 +0000 (UTC) From: Kevin Traynor To: Krzysztof Kanas Cc: Chas Williams , dpdk stable Date: Wed, 8 May 2019 17:02:23 +0100 Message-Id: <20190508160233.2648-26-ktraynor@redhat.com> In-Reply-To: <20190508160233.2648-1-ktraynor@redhat.com> References: <20190508160233.2648-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 08 May 2019 16:03:16 +0000 (UTC) Subject: [dpdk-stable] patch 'test/bonding: fix MAC assignment for re-run' has been queued to LTS release 18.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/14/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/f628e496a12bb4526b46868732c59263cae010e3 Thanks. Kevin Traynor --- >From f628e496a12bb4526b46868732c59263cae010e3 Mon Sep 17 00:00:00 2001 From: Krzysztof Kanas Date: Sat, 27 Apr 2019 00:30:29 +0200 Subject: [PATCH] test/bonding: fix MAC assignment for re-run [ upstream commit 6e48cf0369c1906109918b3b7975b23648cf5ad4 ] Fix test_set_bonded_port_initialization_mac_assignment so that it works after 're run' test_link_bonding. Fixes: f2ef6f21ee2e ("bond: fix mac assignment to slaves") Signed-off-by: Krzysztof Kanas Acked-by: Chas Williams --- test/test/test_link_bonding.c | 45 +++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/test/test/test_link_bonding.c b/test/test/test_link_bonding.c index 0fe1d78eb..0438e76cc 100644 --- a/test/test/test_link_bonding.c +++ b/test/test/test_link_bonding.c @@ -202,4 +202,5 @@ configure_ethdev(uint16_t port_id, uint8_t start, uint8_t en_isr) static int slaves_initialized; +static int mac_slaves_initialized; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; @@ -874,8 +875,9 @@ static int test_set_bonded_port_initialization_mac_assignment(void) { - int i, slave_count, bonded_port_id; + int i, slave_count; uint16_t slaves[RTE_MAX_ETHPORTS]; - int slave_port_ids[BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT]; + static int bonded_port_id = -1; + static int slave_port_ids[BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT]; struct ether_addr slave_mac_addr, bonded_mac_addr, read_mac_addr; @@ -888,27 +890,34 @@ test_set_bonded_port_initialization_mac_assignment(void) * 1. a - Create / configure bonded / slave ethdevs */ - bonded_port_id = rte_eth_bond_create("net_bonding_mac_ass_test", - BONDING_MODE_ACTIVE_BACKUP, rte_socket_id()); - TEST_ASSERT(bonded_port_id > 0, "failed to create bonded device"); + if (bonded_port_id == -1) { + bonded_port_id = rte_eth_bond_create("net_bonding_mac_ass_test", + BONDING_MODE_ACTIVE_BACKUP, rte_socket_id()); + TEST_ASSERT(bonded_port_id > 0, "failed to create bonded device"); - TEST_ASSERT_SUCCESS(configure_ethdev(bonded_port_id, 0, 0), - "Failed to configure bonded ethdev"); + TEST_ASSERT_SUCCESS(configure_ethdev(bonded_port_id, 0, 0), + "Failed to configure bonded ethdev"); + } - for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT; i++) { - char pmd_name[RTE_ETH_NAME_MAX_LEN]; + if (!mac_slaves_initialized) { + for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT; i++) { + char pmd_name[RTE_ETH_NAME_MAX_LEN]; - slave_mac_addr.addr_bytes[ETHER_ADDR_LEN-1] = i + 100; + slave_mac_addr.addr_bytes[ETHER_ADDR_LEN-1] = i + 100; - snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, "eth_slave_%d", i); + snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, + "eth_slave_%d", i); - slave_port_ids[i] = virtual_ethdev_create(pmd_name, - &slave_mac_addr, rte_socket_id(), 1); + slave_port_ids[i] = virtual_ethdev_create(pmd_name, + &slave_mac_addr, rte_socket_id(), 1); - TEST_ASSERT(slave_port_ids[i] >= 0, - "Failed to create slave ethdev %s", pmd_name); + TEST_ASSERT(slave_port_ids[i] >= 0, + "Failed to create slave ethdev %s", + pmd_name); - TEST_ASSERT_SUCCESS(configure_ethdev(slave_port_ids[i], 1, 0), - "Failed to configure virtual ethdev %s", - pmd_name); + TEST_ASSERT_SUCCESS(configure_ethdev(slave_port_ids[i], 1, 0), + "Failed to configure virtual ethdev %s", + pmd_name); + } + mac_slaves_initialized = 1; } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-05-08 16:33:58.791437701 +0100 +++ 0026-test-bonding-fix-MAC-assignment-for-re-run.patch 2019-05-08 16:33:57.429577619 +0100 @@ -1 +1 @@ -From 6e48cf0369c1906109918b3b7975b23648cf5ad4 Mon Sep 17 00:00:00 2001 +From f628e496a12bb4526b46868732c59263cae010e3 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 6e48cf0369c1906109918b3b7975b23648cf5ad4 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -15 +16 @@ - app/test/test_link_bonding.c | 45 +++++++++++++++++++++--------------- + test/test/test_link_bonding.c | 45 +++++++++++++++++++++-------------- @@ -18 +19 @@ -diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c +diff --git a/test/test/test_link_bonding.c b/test/test/test_link_bonding.c @@ -20,2 +21,2 @@ ---- a/app/test/test_link_bonding.c -+++ b/app/test/test_link_bonding.c +--- a/test/test/test_link_bonding.c ++++ b/test/test/test_link_bonding.c