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 ABD55A0679 for ; Mon, 29 Apr 2019 18:45:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 581B67CDA; Mon, 29 Apr 2019 18:45:49 +0200 (CEST) Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) by dpdk.org (Postfix) with ESMTP id 5DC227CCA for ; Mon, 29 Apr 2019 18:45:47 +0200 (CEST) Received: by mail-qt1-f193.google.com with SMTP id g4so12667673qtq.10 for ; Mon, 29 Apr 2019 09:45:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=FIdEVZdRmtHH3n5eKS4+GBCy5Fz3cMTnPoDwxBtQ+bw=; b=Hnm7kCvzkHAme9Pc9+9zkY/e+xFYTpnotoHgywzBMlTnr6waLM1uJsBNQfja9sAxBQ vt3Wa9H1ttROnZ6OzwtIY+lSZA5MYQZ3rzTejpRb6ICChncEZMeqA/nGUuZ9SoYt5aue JeY1GZ45nxA3GH6jGVOWoxtnthxZFw72QAQXXjfoG1qpd1R8BIyXewtLVH5wWLo3oT2J FCNoA9iQIFZMkWWV2FvuVyPXjqPKg8Xo9MrkP7bpByJxvyEb+ft41dxyYGqsJeX7kKZU f+1Miu15GEczwljx1Jp/DNt8pLISSAix22jcwQgRqlNhryYu+cGT7wSwR0AGSAjiqjp9 fcIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=FIdEVZdRmtHH3n5eKS4+GBCy5Fz3cMTnPoDwxBtQ+bw=; b=BTheI29yDBKTnXKuCmVGnNsxUXkQDfyK+lNNtdQgoI1OlFPpGlgkPzUCJhT3dFZnJJ 5/YAHQrDpvWtWdY06YIKRZZG6FgzyD3OZxIHGlo3R+hPaQof49a+zgodo4rforw+9Wjx D3SK3/EMV5sro+FdMt9S5aLBcrWxO97E9yZFB5H6AWN2dBODL0P94Flcnac2pIA+QO0p qRaWocyUUB4f4wX5jSlHM+ronMDg5A0W8z37w0OawoEMD7fymMHc0A9aiYLSmYQXFY+v icB2pKIzt1TsbFx3zVXcBBnVoq+4vWLxpGhTZWpcXiwClt5BTv8kqXOUk57AVEYhQdK+ aeSw== X-Gm-Message-State: APjAAAVVOXlJ6Ri0N9SMrhaXf4g5LYnCpqm1dVfgZENN4uTKDxP3Gpis EhlFL/RyQcO6/RgqIxzhZi4= X-Google-Smtp-Source: APXvYqweggO3XaD27VMN8I9qliA2fs8VKY54vrfGRtQE4HLTTztW/j/YqN7TrdKCEEMAd7zSHGLHkA== X-Received: by 2002:a0c:b05b:: with SMTP id l27mr15550625qvc.162.1556556346712; Mon, 29 Apr 2019 09:45:46 -0700 (PDT) Received: from [192.168.1.10] (pool-96-255-82-34.washdc.fios.verizon.net. [96.255.82.34]) by smtp.gmail.com with ESMTPSA id t124sm15883482qkh.29.2019.04.29.09.45.45 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 29 Apr 2019 09:45:45 -0700 (PDT) To: Ferruh Yigit , kkanas@marvell.com, dev@dpdk.org Cc: declan.doherty@intel.com, Chas Williams References: <20190426223029.23677-1-kkanas@marvell.com> <124dad47-edb3-843c-e83d-359d408f050c@intel.com> From: Chas Williams <3chas3@gmail.com> Message-ID: Date: Mon, 29 Apr 2019 12:45:44 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <124dad47-edb3-843c-e83d-359d408f050c@intel.com> Content-Type: text/plain; charset="UTF-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/bonding: fix test bonding MAC assignment 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" Message-ID: <20190429164544.xvqSHkbd-Y9a9qgMoBpTE7TzxkErYj3xg3vn-ToIS2E@z> Seems fine. Acked-by: Chas Williams On 4/29/19 10:56 AM, Ferruh Yigit wrote: > On 4/26/2019 11:30 PM, kkanas@marvell.com wrote: >> From: Krzysztof Kanas >> >> 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") >> Cc: declan.doherty@intel.com >> >> Signed-off-by: Krzysztof Kanas > > cc'ed maintainer, Chas. > >> --- >> app/test/test_link_bonding.c | 53 +++++++++++++++++++++--------------- >> 1 file changed, 31 insertions(+), 22 deletions(-) >> >> diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c >> index 0fe1d78eb0f5..c00ec6c445bd 100644 >> --- a/app/test/test_link_bonding.c >> +++ b/app/test/test_link_bonding.c >> @@ -201,6 +201,7 @@ 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; >> static pthread_cond_t cvar = PTHREAD_COND_INITIALIZER; >> @@ -873,10 +874,11 @@ test_set_explicit_bonded_mac(void) >> 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; >> >> @@ -887,42 +889,49 @@ 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) { >> >> - slave_mac_addr.addr_bytes[ETHER_ADDR_LEN-1] = i + 100; >> + for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT; i++) { >> + char pmd_name[RTE_ETH_NAME_MAX_LEN]; >> >> - snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, "eth_slave_%d", i); >> + slave_mac_addr.addr_bytes[ETHER_ADDR_LEN-1] = i + 100; >> >> - slave_port_ids[i] = virtual_ethdev_create(pmd_name, >> - &slave_mac_addr, rte_socket_id(), 1); >> + snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, >> + "eth_slave_%d", i); >> >> - TEST_ASSERT(slave_port_ids[i] >= 0, >> - "Failed to create slave ethdev %s", pmd_name); >> + slave_port_ids[i] = virtual_ethdev_create(pmd_name, >> + &slave_mac_addr, rte_socket_id(), 1); >> >> - TEST_ASSERT_SUCCESS(configure_ethdev(slave_port_ids[i], 1, 0), >> - "Failed to configure virtual 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); >> + } >> >> + mac_slaves_initialized = 1; >> + } >> /* >> - * 2. Add slave ethdevs to bonded device >> - */ >> + * 2. Add slave ethdevs to bonded device >> + */ >> for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT; i++) { >> TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(bonded_port_id, >> slave_port_ids[i]), >> "Failed to add slave (%d) to bonded port (%d).", >> slave_port_ids[i], bonded_port_id); >> } >> - >> slave_count = rte_eth_bond_slaves_get(bonded_port_id, slaves, >> RTE_MAX_ETHPORTS); >> TEST_ASSERT_EQUAL(BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT, slave_count, >> >