From patchwork Wed May 24 07:12:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 127278 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7A29842B89; Wed, 24 May 2023 09:12:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 644A042D32; Wed, 24 May 2023 09:12:44 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2113.outbound.protection.outlook.com [40.107.243.113]) by mails.dpdk.org (Postfix) with ESMTP id AE3CF42D0D for ; Wed, 24 May 2023 09:12:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lHYZcDT0xD78aNm4eaFd5Neel3SVym29VbdynjvqHmKYB8zsewVRJrsb4JwMidrfLgvGxLlNfUpU42pcGTYvZFfnb/6U4oneLsRThTrrRQ3eu8gjxDJdKuxIsm1gQzNkNEf9Z4Acbek53emKSj3LpyCfKSLSjtr8+dpFDfShD266fkm4vvpGFsegjOolXwrlyFQS9OFjhOmI7zU6MKcGtVLal+fJild7uLPeHBI1LhtI6XbnbAcK2gIgjHHCRlOXvBjVY4nvdJzqgTb0b9cLJb5qwjexioucbkqhgEdmLDE2+QwfzA72/b746IRRDCLBCx4jwMU40ltuBdI0YNlAlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=P1HnAI2CEWMzi6FAKlrYYSUUhjLvmGQvOP5sg8qw/sc=; b=OOdIG8a3wtsglTl1E4n6rrGSLzYFm58MuKCLdjlK4FyaB67bWEp0b+TOd9xN7U8OJRCsi3LlkiMCU1ZYac1vG0v5PhLJtnnTl5ucl5NUPUjhKtdcC3CLB67Emg6w2hEyWM1HXJwWPf+VszbEOF+n1jzStgrnfKrvsCwlXve8bljKtDx/M6JjFOgmKPRxgRqug31gngg2ay0Wla9rTJLw2y0ki3bxCwRCLiLy4fw6aIIMku7ljuzA8jLimOYvHeSBbSf5C6uvvQ68SkOcqpU/Z00tK6m+pR4luTSOwBfnmvsoE5PPZvJt2tuAmiW2O97HTDbeeYotAleVNgfyOEtg+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P1HnAI2CEWMzi6FAKlrYYSUUhjLvmGQvOP5sg8qw/sc=; b=of19SL2CDARgzrozJvg4jpun8AsPhnqgeVjZ9Y3mHKJdB+hKDelpnuHgsiixg1jamuqiJHHEukpA3YwZOAYh2abwh15DNHbZXLOX6MO0PzdFS/IiN71DuFK0eJXsKSFJloKyIw/oomO2MoUPFrL0C1IEmouQH2ZCzgqkhQA1jXE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by SN7PR13MB6279.namprd13.prod.outlook.com (2603:10b6:806:2e8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Wed, 24 May 2023 07:12:31 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::ac2e:52b6:82ec:4994]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::ac2e:52b6:82ec:4994%3]) with mapi id 15.20.6411.028; Wed, 24 May 2023 07:12:30 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Long Wu Subject: [PATCH] net/bonding: rename bonded to bonding Date: Wed, 24 May 2023 15:12:04 +0800 Message-Id: <20230524071204.2484248-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 X-ClientProxiedBy: SI2PR01CA0045.apcprd01.prod.exchangelabs.com (2603:1096:4:193::19) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SN7PR13MB6279:EE_ X-MS-Office365-Filtering-Correlation-Id: 2e48c1c8-e48f-4a19-3dbb-08db5c263b6b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9EVrjRZSaW2WcJAPOp4kDhtdTUvC38gfxz9s5aE7+5FQ05KbSFVYS9OXVOp5hTmhAuifeefrAEw+F/TnT8FX2mzm6XmBY+L4JWDgqdlrXGGH5gSUxgFeKL8dq0KbgAV/znng/doJIe43RiCBRQ8KpphYQYphsmIUdj+AnCK7qowEt9pjKzDlE5BqltWlWNLYwz4cunn9jNFc5gtiOXrcHycZtYkDJvEAIZXf0su5ka3bai6fXsyXJzF+v9xkFUDUrNXZgRkSR0BvDnMKfNReeQZ2ksTwfsKr+uwVTeHPwhfceZeSmknoOgZrqjsZTKmQL5uyFG8HfjUm9oEvZkwLRBRa9lIWpuAjuesARpSRE5iBYPQv9ET+izjzYu8ri74TQNoX3PqlVsYEN7GnD1SM+6jDr2xNhaq1u+goq78HGVL5uibBa8xl1MrsGRKxIIssOIHonKiW+G5JxVGGKE0kAfoVnY3kJuFJ+YmV7cfXfMnSYJIMTFV+KdSNhj5fIjR1mu6i6hIxVmrP0uytRE48GzDsIfRpZxx+NcUFTXLLPb8Q9v7YJHmdQHQJxxXF3gf7fTdJRDisVXHIXgZ1XImVMvz8u8I97G8qWfuuPn9zWfITnSzMglKSCw4KR/PiTMXJ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(39840400004)(376002)(396003)(346002)(366004)(136003)(451199021)(107886003)(186003)(6512007)(6506007)(26005)(1076003)(2616005)(83380400001)(6666004)(36756003)(52116002)(6486002)(30864003)(2906002)(316002)(8676002)(5660300002)(44832011)(478600001)(4326008)(66946007)(66476007)(38100700002)(86362001)(38350700002)(6916009)(66556008)(41300700001)(8936002)(559001)(579004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5JE8CI4SS94m8LqZUxKRECz3S17fpLCZ3LDCBAHBNfUPVEmtG9Ma/lrIi1VmBWkD7DDLJdNTeyNsww3/KDYelH3JmL04d2Jc0f6pc/wtm5t7APBwXSErtkqHSKFY90K4oyz1fWChzoBDuJ5ZCtlrwjVF0jg0RBEjWOINbozVrTBGUhpt3y9gN9V4SNDRsAQJjIAFyvT04Gks6ZN9IgFleRvdzdkJ/hRUO3pe4V4TO/ifYUCBvuDoCo03mc4Ft3hUp0hXqTGct5X8lAsaR/wT9te7IEpefh2YvKkjCnrFcSbZZkbPH5zZycxq2BLHVxK03kaWWZcGi24RPxXGHVSSZYr1NdOhoGKjLz/4USFb4udMLthwIr204DUxgQXYMk6dDz85/UHyeghWZdwxr2JDuGIzIG5TobEgmgtsUCpgiZs5TlezhMCYoUOAuebXkxe15+Z+nY1p5lx9pBsjTwPRzeFFSv7FtnTIVWx05DzK94tMUs2oSgJTEyBpYnFTWNUqkVbOyiMDwkUs2S6d7mE30UwW6QP3nQQndNvfzeaIZi49kIQrkzJo1uypUWAoF43IfnjELsObFC8NBMUwL7wMXsXCDYveVdqTkOlKalg5Zyyv4T4uO64Ff6862HeUKTNcoX1JqABveyqGWFLk5hMjMvXQnHxZ+P6dkw6ixmYD/asTNSO1zuDDafjACfx7Fnyme++BTlZpt66IVX4ELEmgNQGUwIOr7PoeJvxpkb9nhkbVx/gF8r56MDIU2JcGEIZlFUuEOKD7kRHFcv95EACXzn0LdsRd/bNuqbfcvylksleaW8aXdXmZxV9OQaIqx8DgDF+09vK21D9UJ1EESl4Pu6Eir2q0KZMz4qPYUQUWDtBrLKg66NRPE70Igwz6oZr53U9giYRkZd5CAefJmRmA6PWvzEm6wtvgu2+o/OZTdSugvUJONVvQY0QzY43SfddYItbp4smftiWHTtngk0DGIobY8FoItHT1CQ60ahCN6KXsHf0ETWmtS6cdHXqkd/9cyQH+MLWakYW/mdwLpgsjUCOlCSUsF+g4OaWa290aGY0TbwpjA+q+FOx3e3dEtS8qcF3LbI07bWHjYNDavGWwUb0kG56HWdmwX1kHzNQ7jOixwWrce64SZIHuIxgOM7tMIh7p6vDeJ43LqADvPaJCpR5cSozNxnuLF8MBPzX4Z8698Eo5mPqLyp+XU3a0Ys5fQj0keBwZyUR+n98Cc62iGYNJqQSr81zy8s8Zsw0HgNNaOby0HjjHFCjsM5ojtptbDr+qTUFmhgtZBqtRsZpb0zZzsuYSwybpW88+Ta8StcVh7GuS1k9W6lRV3fW7Yh9ti/HLM4zVpstsope229iM3sBypCi6oV1dvt5kS5Y0ezFOlXnyfQchdS7jQw7AdH5UNJDeykj4tJo/XAsDruJGNdtT/5E8Jk+FDOTrYC9kJJ3hQXehoLJQSgTPfwgfbMOKr4ebUGBcpE62DdfRPkPBiUKhbHvjB9dyDfdqhXAFyS2m2h5UU+wjb9sOm4tJ9kFNI2OIX8yba9kH9UDP3FvH910gf0zUWE7kLMahb1Nw5LvBX5LbCc2XpZu2PDJBiboLEqcZbQ5wXpqdv+iG019TLw== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e48c1c8-e48f-4a19-3dbb-08db5c263b6b X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2023 07:12:30.6294 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UEEWC4TSx1NVMK/dSuHZTjjrQo/56ca5VPuvqaAHzO/VMAfoGpx5FBhWx47/A7CZ3GHBMqRxazESNlK5Xn+T9I/LGMte1gCK/1hoDQTbx9U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR13MB6279 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Long Wu DPDK bonding PMD mixing use 'bonded' and 'bonding' currently, this patch replaces the usage of the word 'bonded' with more appropriate word 'bonding' in bonding PMD and ethdev library as well as in their docs. Also the test app and testpmd were modified to use the new wording. In addition to grammar requirements, we should still use bonded, and in other cases, we should use bonding. Signed-off-by: Long Wu Acked-by: Stephen Hemminger --- Depends-on: patch-1531512 ("[v4] net/bonding: replace master/slave to") --- app/test-pmd/testpmd.c | 18 +- app/test/test_link_bonding.c | 1954 +++++++++-------- app/test/test_link_bonding_mode4.c | 234 +- app/test/test_link_bonding_rssconf.c | 32 +- app/test/virtual_pmd.c | 8 +- doc/guides/prog_guide/img/bond-mode-0.svg | 4 +- doc/guides/prog_guide/img/bond-mode-1.svg | 4 +- doc/guides/prog_guide/img/bond-mode-2.svg | 4 +- doc/guides/prog_guide/img/bond-mode-3.svg | 4 +- doc/guides/prog_guide/img/bond-mode-4.svg | 4 +- doc/guides/prog_guide/img/bond-mode-5.svg | 4 +- doc/guides/prog_guide/img/bond-overview.svg | 4 +- .../link_bonding_poll_mode_drv_lib.rst | 92 +- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 +- drivers/net/bonding/bonding_testpmd.c | 88 +- drivers/net/bonding/eth_bond_8023ad_private.h | 28 +- drivers/net/bonding/eth_bond_private.h | 24 +- drivers/net/bonding/rte_eth_bond.h | 128 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 18 +- drivers/net/bonding/rte_eth_bond_8023ad.h | 6 +- drivers/net/bonding/rte_eth_bond_alb.h | 2 +- drivers/net/bonding/rte_eth_bond_api.c | 262 +-- drivers/net/bonding/rte_eth_bond_pmd.c | 246 +-- lib/ethdev/rte_ethdev.h | 5 +- 24 files changed, 1593 insertions(+), 1584 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index d8fd87105a..d2b747a669 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -632,7 +632,7 @@ eth_dev_start_mp(uint16_t port_id) struct rte_port *port = &ports[port_id]; /* - * Starting a bonded port also starts all members under the bonded + * Starting a bonding port also starts all members under the bonding * device. So if this port is bond device, we need to modify the * port status of these members. */ @@ -656,7 +656,7 @@ eth_dev_stop_mp(uint16_t port_id) struct rte_port *port = &ports[port_id]; /* - * Stopping a bonded port also stops all members under the bonded + * Stopping a bonding port also stops all members under the bonding * device. So if this port is bond device, we need to modify the * port status of these members. */ @@ -3030,7 +3030,7 @@ start_port(portid_t pid) if (port_is_bonding_member(pi)) { fprintf(stderr, - "Please remove port %d from bonded device.\n", + "Please remove port %d from bonding device.\n", pi); continue; } @@ -3352,7 +3352,7 @@ stop_port(portid_t pid) if (port_is_bonding_member(pi)) { fprintf(stderr, - "Please remove port %d from bonded device.\n", + "Please remove port %d from bonding device.\n", pi); continue; } @@ -3490,7 +3490,7 @@ close_port(portid_t pid) if (port_is_bonding_member(pi)) { fprintf(stderr, - "Please remove port %d from bonded device.\n", + "Please remove port %d from bonding device.\n", pi); continue; } @@ -3510,7 +3510,7 @@ close_port(portid_t pid) #endif rte_eth_dev_close(pi); /* - * If this port is bonded device, all members under the + * If this port is bonding device, all members under the * device need to be removed or closed. */ if (port->bond_flag == 1 && num_members > 0) @@ -3557,7 +3557,7 @@ reset_port(portid_t pid) if (port_is_bonding_member(pi)) { fprintf(stderr, - "Please remove port %d from bonded device.\n", + "Please remove port %d from bonding device.\n", pi); continue; } @@ -4230,11 +4230,11 @@ uint8_t port_is_bonding_member(portid_t member_pid) if (ret != 0) { TESTPMD_LOG(ERR, "Failed to get device info for port id %d," - "cannot determine if the port is a bonded member", + "cannot determine if the port is a bonding member", member_pid); return 0; } - if ((*dev_info.dev_flags & RTE_ETH_DEV_BONDED_MEMBER) || (port->member_flag == 1)) + if ((*dev_info.dev_flags & RTE_ETH_DEV_BONDING_MEMBER) || (port->member_flag == 1)) return 1; return 0; } diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c index 82daf037f1..9214b2b00d 100644 --- a/app/test/test_link_bonding.c +++ b/app/test/test_link_bonding.c @@ -52,7 +52,7 @@ #define MAX_PKT_BURST (512) #define DEF_PKT_BURST (16) -#define BONDED_DEV_NAME ("net_bonding_ut") +#define BONDING_DEV_NAME ("net_bonding_ut") #define INVALID_SOCKET_ID (-1) #define INVALID_PORT_ID (-1) @@ -60,12 +60,12 @@ uint8_t member_mac[] = {0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 }; -uint8_t bonded_mac[] = {0xAA, 0xFF, 0xAA, 0xFF, 0xAA, 0xFF }; +uint8_t bonding_mac[] = {0xAA, 0xFF, 0xAA, 0xFF, 0xAA, 0xFF }; struct link_bonding_unittest_params { - int16_t bonded_port_id; + int16_t bonding_port_id; int16_t member_port_ids[TEST_MAX_NUMBER_OF_PORTS]; - uint16_t bonded_member_count; + uint16_t bonding_member_count; uint8_t bonding_mode; uint16_t nb_rx_q; @@ -74,7 +74,7 @@ struct link_bonding_unittest_params { struct rte_mempool *mbuf_pool; struct rte_ether_addr *default_member_mac; - struct rte_ether_addr *default_bonded_mac; + struct rte_ether_addr *default_bonding_mac; /* Packet Headers */ struct rte_ether_hdr *pkt_eth_hdr; @@ -89,9 +89,9 @@ static struct rte_ipv6_hdr pkt_ipv6_hdr; static struct rte_udp_hdr pkt_udp_hdr; static struct link_bonding_unittest_params default_params = { - .bonded_port_id = -1, + .bonding_port_id = -1, .member_port_ids = { -1 }, - .bonded_member_count = 0, + .bonding_member_count = 0, .bonding_mode = BONDING_MODE_ROUND_ROBIN, .nb_rx_q = 1, @@ -100,7 +100,7 @@ static struct link_bonding_unittest_params default_params = { .mbuf_pool = NULL, .default_member_mac = (struct rte_ether_addr *)member_mac, - .default_bonded_mac = (struct rte_ether_addr *)bonded_mac, + .default_bonding_mac = (struct rte_ether_addr *)bonding_mac, .pkt_eth_hdr = NULL, .pkt_ipv4_hdr = &pkt_ipv4_hdr, @@ -259,29 +259,29 @@ test_setup(void) } static int -test_create_bonded_device(void) +test_create_bonding_device(void) { int current_member_count; uint16_t members[RTE_MAX_ETHPORTS]; - /* Don't try to recreate bonded device if re-running test suite*/ - if (test_params->bonded_port_id == -1) { - test_params->bonded_port_id = rte_eth_bond_create(BONDED_DEV_NAME, + /* Don't try to recreate bonding device if re-running test suite*/ + if (test_params->bonding_port_id == -1) { + test_params->bonding_port_id = rte_eth_bond_create(BONDING_DEV_NAME, test_params->bonding_mode, rte_socket_id()); - TEST_ASSERT(test_params->bonded_port_id >= 0, - "Failed to create bonded ethdev %s", BONDED_DEV_NAME); + TEST_ASSERT(test_params->bonding_port_id >= 0, + "Failed to create bonding ethdev %s", BONDING_DEV_NAME); - TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 0, 0), - "Failed to configure bonded ethdev %s", BONDED_DEV_NAME); + TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonding_port_id, 0, 0), + "Failed to configure bonding ethdev %s", BONDING_DEV_NAME); } - TEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonded_port_id, + TEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonding_port_id, test_params->bonding_mode), "Failed to set ethdev %d to mode %d", - test_params->bonded_port_id, test_params->bonding_mode); + test_params->bonding_port_id, test_params->bonding_mode); - current_member_count = rte_eth_bond_members_get(test_params->bonded_port_id, + current_member_count = rte_eth_bond_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(current_member_count, 0, @@ -289,7 +289,7 @@ test_create_bonded_device(void) current_member_count, 0); current_member_count = rte_eth_bond_active_members_get( - test_params->bonded_port_id, members, RTE_MAX_ETHPORTS); + test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(current_member_count, 0, "Number of active members %d is great than expected %d.", @@ -300,7 +300,7 @@ test_create_bonded_device(void) static int -test_create_bonded_device_with_invalid_params(void) +test_create_bonding_device_with_invalid_params(void) { int port_id; @@ -309,66 +309,66 @@ test_create_bonded_device_with_invalid_params(void) /* Invalid name */ port_id = rte_eth_bond_create(NULL, test_params->bonding_mode, rte_socket_id()); - TEST_ASSERT(port_id < 0, "Created bonded device unexpectedly"); + TEST_ASSERT(port_id < 0, "Created bonding device unexpectedly"); test_params->bonding_mode = INVALID_BONDING_MODE; /* Invalid bonding mode */ - port_id = rte_eth_bond_create(BONDED_DEV_NAME, test_params->bonding_mode, + port_id = rte_eth_bond_create(BONDING_DEV_NAME, test_params->bonding_mode, rte_socket_id()); - TEST_ASSERT(port_id < 0, "Created bonded device unexpectedly."); + TEST_ASSERT(port_id < 0, "Created bonding device unexpectedly."); test_params->bonding_mode = BONDING_MODE_ROUND_ROBIN; /* Invalid socket id */ - port_id = rte_eth_bond_create(BONDED_DEV_NAME, test_params->bonding_mode, + port_id = rte_eth_bond_create(BONDING_DEV_NAME, test_params->bonding_mode, INVALID_SOCKET_ID); - TEST_ASSERT(port_id < 0, "Created bonded device unexpectedly."); + TEST_ASSERT(port_id < 0, "Created bonding device unexpectedly."); return 0; } static int -test_add_member_to_bonded_device(void) +test_add_member_to_bonding_device(void) { int current_member_count; uint16_t members[RTE_MAX_ETHPORTS]; - TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(test_params->bonded_port_id, - test_params->member_port_ids[test_params->bonded_member_count]), - "Failed to add member (%d) to bonded port (%d).", - test_params->member_port_ids[test_params->bonded_member_count], - test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(test_params->bonding_port_id, + test_params->member_port_ids[test_params->bonding_member_count]), + "Failed to add member (%d) to bonding port (%d).", + test_params->member_port_ids[test_params->bonding_member_count], + test_params->bonding_port_id); - current_member_count = rte_eth_bond_members_get(test_params->bonded_port_id, + current_member_count = rte_eth_bond_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(current_member_count, test_params->bonded_member_count + 1, + TEST_ASSERT_EQUAL(current_member_count, test_params->bonding_member_count + 1, "Number of members (%d) is greater than expected (%d).", - current_member_count, test_params->bonded_member_count + 1); + current_member_count, test_params->bonding_member_count + 1); current_member_count = rte_eth_bond_active_members_get( - test_params->bonded_port_id, members, RTE_MAX_ETHPORTS); + test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(current_member_count, 0, "Number of active members (%d) is not as expected (%d).\n", current_member_count, 0); - test_params->bonded_member_count++; + test_params->bonding_member_count++; return 0; } static int -test_add_member_to_invalid_bonded_device(void) +test_add_member_to_invalid_bonding_device(void) { /* Invalid port ID */ - TEST_ASSERT_FAIL(rte_eth_bond_member_add(test_params->bonded_port_id + 5, - test_params->member_port_ids[test_params->bonded_member_count]), + TEST_ASSERT_FAIL(rte_eth_bond_member_add(test_params->bonding_port_id + 5, + test_params->member_port_ids[test_params->bonding_member_count]), "Expected call to failed as invalid port specified."); - /* Non bonded device */ + /* Non bonding device */ TEST_ASSERT_FAIL(rte_eth_bond_member_add(test_params->member_port_ids[0], - test_params->member_port_ids[test_params->bonded_member_count]), + test_params->member_port_ids[test_params->bonding_member_count]), "Expected call to failed as invalid port specified."); return 0; @@ -376,110 +376,110 @@ test_add_member_to_invalid_bonded_device(void) static int -test_remove_member_from_bonded_device(void) +test_remove_member_from_bonding_device(void) { int current_member_count; struct rte_ether_addr read_mac_addr, *mac_addr; uint16_t members[RTE_MAX_ETHPORTS]; - TEST_ASSERT_SUCCESS(rte_eth_bond_member_remove(test_params->bonded_port_id, - test_params->member_port_ids[test_params->bonded_member_count-1]), - "Failed to remove member %d from bonded port (%d).", - test_params->member_port_ids[test_params->bonded_member_count-1], - test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_bond_member_remove(test_params->bonding_port_id, + test_params->member_port_ids[test_params->bonding_member_count-1]), + "Failed to remove member %d from bonding port (%d).", + test_params->member_port_ids[test_params->bonding_member_count-1], + test_params->bonding_port_id); - current_member_count = rte_eth_bond_members_get(test_params->bonded_port_id, + current_member_count = rte_eth_bond_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(current_member_count, test_params->bonded_member_count - 1, + TEST_ASSERT_EQUAL(current_member_count, test_params->bonding_member_count - 1, "Number of members (%d) is great than expected (%d).\n", - current_member_count, test_params->bonded_member_count - 1); + current_member_count, test_params->bonding_member_count - 1); mac_addr = (struct rte_ether_addr *)member_mac; mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] = - test_params->bonded_member_count-1; + test_params->bonding_member_count-1; TEST_ASSERT_SUCCESS(rte_eth_macaddr_get( - test_params->member_port_ids[test_params->bonded_member_count-1], + test_params->member_port_ids[test_params->bonding_member_count-1], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->member_port_ids[test_params->bonded_member_count-1]); + test_params->member_port_ids[test_params->bonding_member_count-1]); TEST_ASSERT_SUCCESS(memcmp(mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port mac address not set to that of primary port\n"); + "bonding port mac address not set to that of primary port\n"); rte_eth_stats_reset( - test_params->member_port_ids[test_params->bonded_member_count-1]); + test_params->member_port_ids[test_params->bonding_member_count-1]); - virtual_ethdev_simulate_link_status_interrupt(test_params->bonded_port_id, + virtual_ethdev_simulate_link_status_interrupt(test_params->bonding_port_id, 0); - test_params->bonded_member_count--; + test_params->bonding_member_count--; return 0; } static int -test_remove_member_from_invalid_bonded_device(void) +test_remove_member_from_invalid_bonding_device(void) { /* Invalid port ID */ TEST_ASSERT_FAIL(rte_eth_bond_member_remove( - test_params->bonded_port_id + 5, - test_params->member_port_ids[test_params->bonded_member_count - 1]), + test_params->bonding_port_id + 5, + test_params->member_port_ids[test_params->bonding_member_count - 1]), "Expected call to failed as invalid port specified."); - /* Non bonded device */ + /* Non bonding device */ TEST_ASSERT_FAIL(rte_eth_bond_member_remove( test_params->member_port_ids[0], - test_params->member_port_ids[test_params->bonded_member_count - 1]), + test_params->member_port_ids[test_params->bonding_member_count - 1]), "Expected call to failed as invalid port specified."); return 0; } -static int bonded_id = 2; +static int bonding_id = 2; static int -test_add_already_bonded_member_to_bonded_device(void) +test_add_already_bonding_member_to_bonding_device(void) { int port_id, current_member_count; uint16_t members[RTE_MAX_ETHPORTS]; char pmd_name[RTE_ETH_NAME_MAX_LEN]; - test_add_member_to_bonded_device(); + test_add_member_to_bonding_device(); - current_member_count = rte_eth_bond_members_get(test_params->bonded_port_id, + current_member_count = rte_eth_bond_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(current_member_count, 1, "Number of members (%d) is not that expected (%d).", current_member_count, 1); - snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, "%s_%d", BONDED_DEV_NAME, ++bonded_id); + snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, "%s_%d", BONDING_DEV_NAME, ++bonding_id); port_id = rte_eth_bond_create(pmd_name, test_params->bonding_mode, rte_socket_id()); - TEST_ASSERT(port_id >= 0, "Failed to create bonded device."); + TEST_ASSERT(port_id >= 0, "Failed to create bonding device."); TEST_ASSERT(rte_eth_bond_member_add(port_id, - test_params->member_port_ids[test_params->bonded_member_count - 1]) + test_params->member_port_ids[test_params->bonding_member_count - 1]) < 0, - "Added member (%d) to bonded port (%d) unexpectedly.", - test_params->member_port_ids[test_params->bonded_member_count-1], + "Added member (%d) to bonding port (%d) unexpectedly.", + test_params->member_port_ids[test_params->bonding_member_count-1], port_id); - return test_remove_member_from_bonded_device(); + return test_remove_member_from_bonding_device(); } static int -test_get_members_from_bonded_device(void) +test_get_members_from_bonding_device(void) { int current_member_count; uint16_t members[RTE_MAX_ETHPORTS]; - TEST_ASSERT_SUCCESS(test_add_member_to_bonded_device(), - "Failed to add member to bonded device"); + TEST_ASSERT_SUCCESS(test_add_member_to_bonding_device(), + "Failed to add member to bonding device"); /* Invalid port id */ current_member_count = rte_eth_bond_members_get(INVALID_PORT_ID, members, @@ -493,17 +493,17 @@ test_get_members_from_bonded_device(void) "Invalid port id unexpectedly succeeded"); /* Invalid members pointer */ - current_member_count = rte_eth_bond_members_get(test_params->bonded_port_id, + current_member_count = rte_eth_bond_members_get(test_params->bonding_port_id, NULL, RTE_MAX_ETHPORTS); TEST_ASSERT(current_member_count < 0, "Invalid member array unexpectedly succeeded"); current_member_count = rte_eth_bond_active_members_get( - test_params->bonded_port_id, NULL, RTE_MAX_ETHPORTS); + test_params->bonding_port_id, NULL, RTE_MAX_ETHPORTS); TEST_ASSERT(current_member_count < 0, "Invalid member array unexpectedly succeeded"); - /* non bonded device*/ + /* non bonding device*/ current_member_count = rte_eth_bond_members_get( test_params->member_port_ids[0], NULL, RTE_MAX_ETHPORTS); TEST_ASSERT(current_member_count < 0, @@ -514,35 +514,35 @@ test_get_members_from_bonded_device(void) TEST_ASSERT(current_member_count < 0, "Invalid port id unexpectedly succeeded"); - TEST_ASSERT_SUCCESS(test_remove_member_from_bonded_device(), - "Failed to remove members from bonded device"); + TEST_ASSERT_SUCCESS(test_remove_member_from_bonding_device(), + "Failed to remove members from bonding device"); return 0; } static int -test_add_remove_multiple_members_to_from_bonded_device(void) +test_add_remove_multiple_members_to_from_bonding_device(void) { int i; for (i = 0; i < TEST_MAX_NUMBER_OF_PORTS; i++) - TEST_ASSERT_SUCCESS(test_add_member_to_bonded_device(), - "Failed to add member to bonded device"); + TEST_ASSERT_SUCCESS(test_add_member_to_bonding_device(), + "Failed to add member to bonding device"); for (i = 0; i < TEST_MAX_NUMBER_OF_PORTS; i++) - TEST_ASSERT_SUCCESS(test_remove_member_from_bonded_device(), - "Failed to remove members from bonded device"); + TEST_ASSERT_SUCCESS(test_remove_member_from_bonding_device(), + "Failed to remove members from bonding device"); return 0; } static void -enable_bonded_members(void) +enable_bonding_members(void) { int i; - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { virtual_ethdev_tx_burst_fn_set_success(test_params->member_port_ids[i], 1); @@ -552,7 +552,7 @@ enable_bonded_members(void) } static int -test_start_bonded_device(void) +test_start_bonding_device(void) { struct rte_eth_link link_status; @@ -560,56 +560,56 @@ test_start_bonded_device(void) uint16_t members[RTE_MAX_ETHPORTS]; int retval; - /* Add member to bonded device*/ - TEST_ASSERT_SUCCESS(test_add_member_to_bonded_device(), - "Failed to add member to bonded device"); + /* Add member to bonding device*/ + TEST_ASSERT_SUCCESS(test_add_member_to_bonding_device(), + "Failed to add member to bonding device"); - TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id), - "Failed to start bonded pmd eth device %d.", - test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonding_port_id), + "Failed to start bonding pmd eth device %d.", + test_params->bonding_port_id); /* * Change link status of virtual pmd so it will be added to the active - * member list of the bonded device. + * member list of the bonding device. */ virtual_ethdev_simulate_link_status_interrupt( - test_params->member_port_ids[test_params->bonded_member_count-1], 1); + test_params->member_port_ids[test_params->bonding_member_count-1], 1); - current_member_count = rte_eth_bond_members_get(test_params->bonded_port_id, + current_member_count = rte_eth_bond_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(current_member_count, test_params->bonded_member_count, + TEST_ASSERT_EQUAL(current_member_count, test_params->bonding_member_count, "Number of members (%d) is not expected value (%d).", - current_member_count, test_params->bonded_member_count); + current_member_count, test_params->bonding_member_count); current_member_count = rte_eth_bond_active_members_get( - test_params->bonded_port_id, members, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(current_member_count, test_params->bonded_member_count, + test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); + TEST_ASSERT_EQUAL(current_member_count, test_params->bonding_member_count, "Number of active members (%d) is not expected value (%d).", - current_member_count, test_params->bonded_member_count); + current_member_count, test_params->bonding_member_count); - current_bonding_mode = rte_eth_bond_mode_get(test_params->bonded_port_id); + current_bonding_mode = rte_eth_bond_mode_get(test_params->bonding_port_id); TEST_ASSERT_EQUAL(current_bonding_mode, test_params->bonding_mode, - "Bonded device mode (%d) is not expected value (%d).\n", + "Bonding device mode (%d) is not expected value (%d).\n", current_bonding_mode, test_params->bonding_mode); - primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); + primary_port = rte_eth_bond_primary_get(test_params->bonding_port_id); TEST_ASSERT_EQUAL(primary_port, test_params->member_port_ids[0], "Primary port (%d) is not expected value (%d).", primary_port, test_params->member_port_ids[0]); - retval = rte_eth_link_get(test_params->bonded_port_id, &link_status); + retval = rte_eth_link_get(test_params->bonding_port_id, &link_status); TEST_ASSERT(retval >= 0, - "Bonded port (%d) link get failed: %s\n", - test_params->bonded_port_id, rte_strerror(-retval)); + "Bonding port (%d) link get failed: %s\n", + test_params->bonding_port_id, rte_strerror(-retval)); TEST_ASSERT_EQUAL(link_status.link_status, 1, - "Bonded port (%d) status (%d) is not expected value (%d).\n", - test_params->bonded_port_id, link_status.link_status, 1); + "Bonding port (%d) status (%d) is not expected value (%d).\n", + test_params->bonding_port_id, link_status.link_status, 1); return 0; } static int -test_stop_bonded_device(void) +test_stop_bonding_device(void) { int current_member_count; uint16_t members[RTE_MAX_ETHPORTS]; @@ -617,26 +617,26 @@ test_stop_bonded_device(void) struct rte_eth_link link_status; int retval; - TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), - "Failed to stop bonded port %u", - test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonding_port_id), + "Failed to stop bonding port %u", + test_params->bonding_port_id); - retval = rte_eth_link_get(test_params->bonded_port_id, &link_status); + retval = rte_eth_link_get(test_params->bonding_port_id, &link_status); TEST_ASSERT(retval >= 0, - "Bonded port (%d) link get failed: %s\n", - test_params->bonded_port_id, rte_strerror(-retval)); + "Bonding port (%d) link get failed: %s\n", + test_params->bonding_port_id, rte_strerror(-retval)); TEST_ASSERT_EQUAL(link_status.link_status, 0, - "Bonded port (%d) status (%d) is not expected value (%d).", - test_params->bonded_port_id, link_status.link_status, 0); + "Bonding port (%d) status (%d) is not expected value (%d).", + test_params->bonding_port_id, link_status.link_status, 0); - current_member_count = rte_eth_bond_members_get(test_params->bonded_port_id, + current_member_count = rte_eth_bond_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(current_member_count, test_params->bonded_member_count, + TEST_ASSERT_EQUAL(current_member_count, test_params->bonding_member_count, "Number of members (%d) is not expected value (%d).", - current_member_count, test_params->bonded_member_count); + current_member_count, test_params->bonding_member_count); current_member_count = rte_eth_bond_active_members_get( - test_params->bonded_port_id, members, RTE_MAX_ETHPORTS); + test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(current_member_count, 0, "Number of active members (%d) is not expected value (%d).", current_member_count, 0); @@ -645,20 +645,20 @@ test_stop_bonded_device(void) } static int -remove_members_and_stop_bonded_device(void) +remove_members_and_stop_bonding_device(void) { - /* Clean up and remove members from bonded device */ + /* Clean up and remove members from bonding device */ free_virtualpmd_tx_queue(); - while (test_params->bonded_member_count > 0) - TEST_ASSERT_SUCCESS(test_remove_member_from_bonded_device(), - "test_remove_member_from_bonded_device failed"); + while (test_params->bonding_member_count > 0) + TEST_ASSERT_SUCCESS(test_remove_member_from_bonding_device(), + "test_remove_member_from_bonding_device failed"); - TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), - "Failed to stop bonded port %u", - test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonding_port_id), + "Failed to stop bonding port %u", + test_params->bonding_port_id); - rte_eth_stats_reset(test_params->bonded_port_id); - rte_eth_bond_mac_address_reset(test_params->bonded_port_id); + rte_eth_stats_reset(test_params->bonding_port_id); + rte_eth_bond_mac_address_reset(test_params->bonding_port_id); return 0; } @@ -682,21 +682,21 @@ test_set_bonding_mode(void) "Expected call to failed as invalid port (%d) specified.", INVALID_PORT_ID); - /* Non bonded device */ + /* Non bonding device */ TEST_ASSERT_FAIL(rte_eth_bond_mode_set(test_params->member_port_ids[0], bonding_modes[i]), "Expected call to failed as invalid port (%d) specified.", test_params->member_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonded_port_id, + TEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonding_port_id, bonding_modes[i]), "Failed to set link bonding mode on port (%d) to (%d).", - test_params->bonded_port_id, bonding_modes[i]); + test_params->bonding_port_id, bonding_modes[i]); - bonding_mode = rte_eth_bond_mode_get(test_params->bonded_port_id); + bonding_mode = rte_eth_bond_mode_get(test_params->bonding_port_id); TEST_ASSERT_EQUAL(bonding_mode, bonding_modes[i], "Link bonding mode (%d) of port (%d) is not expected value (%d).", - bonding_mode, test_params->bonded_port_id, + bonding_mode, test_params->bonding_port_id, bonding_modes[i]); /* Invalid port ID */ @@ -705,14 +705,14 @@ test_set_bonding_mode(void) "Expected call to failed as invalid port (%d) specified.", INVALID_PORT_ID); - /* Non bonded device */ + /* Non bonding device */ bonding_mode = rte_eth_bond_mode_get(test_params->member_port_ids[0]); TEST_ASSERT(bonding_mode < 0, "Expected call to failed as invalid port (%d) specified.", test_params->member_port_ids[0]); } - return remove_members_and_stop_bonded_device(); + return remove_members_and_stop_bonding_device(); } static int @@ -722,55 +722,55 @@ test_set_primary_member(void) struct rte_ether_addr read_mac_addr; struct rte_ether_addr *expected_mac_addr; - /* Add 4 members to bonded device */ - for (i = test_params->bonded_member_count; i < 4; i++) - TEST_ASSERT_SUCCESS(test_add_member_to_bonded_device(), - "Failed to add member to bonded device."); + /* Add 4 members to bonding device */ + for (i = test_params->bonding_member_count; i < 4; i++) + TEST_ASSERT_SUCCESS(test_add_member_to_bonding_device(), + "Failed to add member to bonding device."); - TEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonded_port_id, + TEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonding_port_id, BONDING_MODE_ROUND_ROBIN), "Failed to set link bonding mode on port (%d) to (%d).", - test_params->bonded_port_id, BONDING_MODE_ROUND_ROBIN); + test_params->bonding_port_id, BONDING_MODE_ROUND_ROBIN); /* Invalid port ID */ TEST_ASSERT_FAIL(rte_eth_bond_primary_set(INVALID_PORT_ID, test_params->member_port_ids[i]), "Expected call to failed as invalid port specified."); - /* Non bonded device */ + /* Non bonding device */ TEST_ASSERT_FAIL(rte_eth_bond_primary_set(test_params->member_port_ids[i], test_params->member_port_ids[i]), "Expected call to failed as invalid port specified."); /* Set member as primary * Verify member it is now primary member - * Verify that MAC address of bonded device is that of primary member - * Verify that MAC address of all bonded members are that of primary member + * Verify that MAC address of bonding device is that of primary member + * Verify that MAC address of all bonding members are that of primary member */ for (i = 0; i < 4; i++) { - TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonded_port_id, + TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonding_port_id, test_params->member_port_ids[i]), - "Failed to set bonded port (%d) primary port to (%d)", - test_params->bonded_port_id, test_params->member_port_ids[i]); + "Failed to set bonding port (%d) primary port to (%d)", + test_params->bonding_port_id, test_params->member_port_ids[i]); - retval = rte_eth_bond_primary_get(test_params->bonded_port_id); + retval = rte_eth_bond_primary_get(test_params->bonding_port_id); TEST_ASSERT(retval >= 0, - "Failed to read primary port from bonded port (%d)\n", - test_params->bonded_port_id); + "Failed to read primary port from bonding port (%d)\n", + test_params->bonding_port_id); TEST_ASSERT_EQUAL(retval, test_params->member_port_ids[i], - "Bonded port (%d) primary port (%d) not expected value (%d)\n", - test_params->bonded_port_id, retval, + "Bonding port (%d) primary port (%d) not expected value (%d)\n", + test_params->bonding_port_id, retval, test_params->member_port_ids[i]); - /* stop/start bonded eth dev to apply new MAC */ - TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), - "Failed to stop bonded port %u", - test_params->bonded_port_id); + /* stop/start bonding eth dev to apply new MAC */ + TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonding_port_id), + "Failed to stop bonding port %u", + test_params->bonding_port_id); - TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id), - "Failed to start bonded port %d", - test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonding_port_id), + "Failed to start bonding port %d", + test_params->bonding_port_id); expected_mac_addr = (struct rte_ether_addr *)&member_mac; expected_mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] = i; @@ -782,15 +782,16 @@ test_set_primary_member(void) test_params->member_port_ids[i]); TEST_ASSERT_SUCCESS(memcmp(expected_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port mac address not set to that of primary port\n"); + "bonding port mac address not set to that of primary port\n"); - /* Check bonded MAC */ - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + /* Check bonding MAC */ + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, + &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(memcmp(&read_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port mac address not set to that of primary port\n"); + "bonding port mac address not set to that of primary port\n"); /* Check other members MACs */ for (j = 0; j < 4; j++) { @@ -810,65 +811,65 @@ test_set_primary_member(void) /* Test with none existent port */ - TEST_ASSERT_FAIL(rte_eth_bond_primary_get(test_params->bonded_port_id + 10), + TEST_ASSERT_FAIL(rte_eth_bond_primary_get(test_params->bonding_port_id + 10), "read primary port from expectedly"); /* Test with member port */ TEST_ASSERT_FAIL(rte_eth_bond_primary_get(test_params->member_port_ids[0]), "read primary port from expectedly\n"); - TEST_ASSERT_SUCCESS(remove_members_and_stop_bonded_device(), - "Failed to stop and remove members from bonded device"); + TEST_ASSERT_SUCCESS(remove_members_and_stop_bonding_device(), + "Failed to stop and remove members from bonding device"); /* No members */ - TEST_ASSERT(rte_eth_bond_primary_get(test_params->bonded_port_id) < 0, + TEST_ASSERT(rte_eth_bond_primary_get(test_params->bonding_port_id) < 0, "read primary port from expectedly\n"); return 0; } static int -test_set_explicit_bonded_mac(void) +test_set_explicit_bonding_mac(void) { int i; struct rte_ether_addr read_mac_addr; struct rte_ether_addr *mac_addr; - uint8_t explicit_bonded_mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x01 }; + uint8_t explicit_bonding_mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x01 }; - mac_addr = (struct rte_ether_addr *)explicit_bonded_mac; + mac_addr = (struct rte_ether_addr *)explicit_bonding_mac; /* Invalid port ID */ TEST_ASSERT_FAIL(rte_eth_bond_mac_address_set(INVALID_PORT_ID, mac_addr), "Expected call to failed as invalid port specified."); - /* Non bonded device */ + /* Non bonding device */ TEST_ASSERT_FAIL(rte_eth_bond_mac_address_set( test_params->member_port_ids[0], mac_addr), "Expected call to failed as invalid port specified."); /* NULL MAC address */ TEST_ASSERT_FAIL(rte_eth_bond_mac_address_set( - test_params->bonded_port_id, NULL), + test_params->bonding_port_id, NULL), "Expected call to failed as NULL MAC specified"); TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set( - test_params->bonded_port_id, mac_addr), - "Failed to set MAC address on bonded port (%d)", - test_params->bonded_port_id); - - /* Add 4 members to bonded device */ - for (i = test_params->bonded_member_count; i < 4; i++) { - TEST_ASSERT_SUCCESS(test_add_member_to_bonded_device(), - "Failed to add member to bonded device.\n"); + test_params->bonding_port_id, mac_addr), + "Failed to set MAC address on bonding port (%d)", + test_params->bonding_port_id); + + /* Add 4 members to bonding device */ + for (i = test_params->bonding_member_count; i < 4; i++) { + TEST_ASSERT_SUCCESS(test_add_member_to_bonding_device(), + "Failed to add member to bonding device.\n"); } - /* Check bonded MAC */ - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + /* Check bonding MAC */ + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(memcmp(mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port mac address not set to that of primary port"); + "bonding port mac address not set to that of primary port"); /* Check other members MACs */ for (i = 0; i < 4; i++) { @@ -881,59 +882,59 @@ test_set_explicit_bonded_mac(void) "member port mac address not set to that of primary port"); } - /* test resetting mac address on bonded device */ + /* test resetting mac address on bonding device */ TEST_ASSERT_SUCCESS( - rte_eth_bond_mac_address_reset(test_params->bonded_port_id), - "Failed to reset MAC address on bonded port (%d)", - test_params->bonded_port_id); + rte_eth_bond_mac_address_reset(test_params->bonding_port_id), + "Failed to reset MAC address on bonding port (%d)", + test_params->bonding_port_id); TEST_ASSERT_FAIL( rte_eth_bond_mac_address_reset(test_params->member_port_ids[0]), - "Reset MAC address on bonded port (%d) unexpectedly", + "Reset MAC address on bonding port (%d) unexpectedly", test_params->member_port_ids[1]); - /* test resetting mac address on bonded device with no members */ - TEST_ASSERT_SUCCESS(remove_members_and_stop_bonded_device(), - "Failed to remove members and stop bonded device"); + /* test resetting mac address on bonding device with no members */ + TEST_ASSERT_SUCCESS(remove_members_and_stop_bonding_device(), + "Failed to remove members and stop bonding device"); - TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_reset(test_params->bonded_port_id), - "Failed to reset MAC address on bonded port (%d)", - test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_reset(test_params->bonding_port_id), + "Failed to reset MAC address on bonding port (%d)", + test_params->bonding_port_id); return 0; } -#define BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT (3) +#define BONDING_INIT_MAC_ASSIGNMENT_MEMBER_COUNT (3) static int -test_set_bonded_port_initialization_mac_assignment(void) +test_set_bonding_port_initialization_mac_assignment(void) { int i, member_count; uint16_t members[RTE_MAX_ETHPORTS]; - static int bonded_port_id = -1; - static int member_port_ids[BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT]; + static int bonding_port_id = -1; + static int member_port_ids[BONDING_INIT_MAC_ASSIGNMENT_MEMBER_COUNT]; - struct rte_ether_addr member_mac_addr, bonded_mac_addr, read_mac_addr; + struct rte_ether_addr member_mac_addr, bonding_mac_addr, read_mac_addr; /* Initialize default values for MAC addresses */ memcpy(&member_mac_addr, member_mac, sizeof(struct rte_ether_addr)); - memcpy(&bonded_mac_addr, member_mac, sizeof(struct rte_ether_addr)); + memcpy(&bonding_mac_addr, member_mac, sizeof(struct rte_ether_addr)); /* - * 1. a - Create / configure bonded / member ethdevs + * 1. a - Create / configure bonding / member ethdevs */ - if (bonded_port_id == -1) { - bonded_port_id = rte_eth_bond_create("net_bonding_mac_ass_test", + if (bonding_port_id == -1) { + bonding_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(bonding_port_id > 0, "failed to create bonding device"); - TEST_ASSERT_SUCCESS(configure_ethdev(bonded_port_id, 0, 0), - "Failed to configure bonded ethdev"); + TEST_ASSERT_SUCCESS(configure_ethdev(bonding_port_id, 0, 0), + "Failed to configure bonding ethdev"); } if (!mac_members_initialized) { - for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT; i++) { + for (i = 0; i < BONDING_INIT_MAC_ASSIGNMENT_MEMBER_COUNT; i++) { char pmd_name[RTE_ETH_NAME_MAX_LEN]; member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = @@ -958,58 +959,58 @@ test_set_bonded_port_initialization_mac_assignment(void) /* - * 2. Add member ethdevs to bonded device + * 2. Add member ethdevs to bonding device */ - for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT; i++) { - TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(bonded_port_id, + for (i = 0; i < BONDING_INIT_MAC_ASSIGNMENT_MEMBER_COUNT; i++) { + TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(bonding_port_id, member_port_ids[i]), - "Failed to add member (%d) to bonded port (%d).", - member_port_ids[i], bonded_port_id); + "Failed to add member (%d) to bonding port (%d).", + member_port_ids[i], bonding_port_id); } - member_count = rte_eth_bond_members_get(bonded_port_id, members, + member_count = rte_eth_bond_members_get(bonding_port_id, members, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT, member_count, + TEST_ASSERT_EQUAL(BONDING_INIT_MAC_ASSIGNMENT_MEMBER_COUNT, member_count, "Number of members (%d) is not as expected (%d)", - member_count, BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT); + member_count, BONDING_INIT_MAC_ASSIGNMENT_MEMBER_COUNT); /* - * 3. Set explicit MAC address on bonded ethdev + * 3. Set explicit MAC address on bonding ethdev */ - bonded_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-2] = 0xFF; - bonded_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0xAA; + bonding_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-2] = 0xFF; + bonding_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0xAA; TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set( - bonded_port_id, &bonded_mac_addr), - "Failed to set MAC address on bonded port (%d)", - bonded_port_id); + bonding_port_id, &bonding_mac_addr), + "Failed to set MAC address on bonding port (%d)", + bonding_port_id); - /* 4. a - Start bonded ethdev + /* 4. a - Start bonding ethdev * b - Enable member devices - * c - Verify bonded/members ethdev MAC addresses + * c - Verify bonding/members ethdev MAC addresses */ - TEST_ASSERT_SUCCESS(rte_eth_dev_start(bonded_port_id), - "Failed to start bonded pmd eth device %d.", - bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_start(bonding_port_id), + "Failed to start bonding pmd eth device %d.", + bonding_port_id); - for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT; i++) { + for (i = 0; i < BONDING_INIT_MAC_ASSIGNMENT_MEMBER_COUNT; i++) { virtual_ethdev_simulate_link_status_interrupt( member_port_ids[i], 1); } - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - bonded_port_id); - TEST_ASSERT_SUCCESS(memcmp(&bonded_mac_addr, &read_mac_addr, + bonding_port_id); + TEST_ASSERT_SUCCESS(memcmp(&bonding_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port mac address not as expected"); + "bonding port mac address not as expected"); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(member_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", member_port_ids[0]); - TEST_ASSERT_SUCCESS(memcmp(&bonded_mac_addr, &read_mac_addr, + TEST_ASSERT_SUCCESS(memcmp(&bonding_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), "member port 0 mac address not as expected"); @@ -1031,27 +1032,27 @@ test_set_bonded_port_initialization_mac_assignment(void) /* 7. a - Change primary port - * b - Stop / Start bonded port + * b - Stop / Start bonding port * d - Verify member ethdev MAC addresses */ - TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(bonded_port_id, + TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(bonding_port_id, member_port_ids[2]), - "failed to set primary port on bonded device."); + "failed to set primary port on bonding device."); - TEST_ASSERT_SUCCESS(rte_eth_dev_stop(bonded_port_id), - "Failed to stop bonded port %u", - bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_stop(bonding_port_id), + "Failed to stop bonding port %u", + bonding_port_id); - TEST_ASSERT_SUCCESS(rte_eth_dev_start(bonded_port_id), - "Failed to start bonded pmd eth device %d.", - bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_start(bonding_port_id), + "Failed to start bonding pmd eth device %d.", + bonding_port_id); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - bonded_port_id); - TEST_ASSERT_SUCCESS(memcmp(&bonded_mac_addr, &read_mac_addr, + bonding_port_id); + TEST_ASSERT_SUCCESS(memcmp(&bonding_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port mac address not as expected"); + "bonding port mac address not as expected"); member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0 + 100; TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(member_port_ids[0], &read_mac_addr), @@ -1072,26 +1073,26 @@ test_set_bonded_port_initialization_mac_assignment(void) TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(member_port_ids[2], &read_mac_addr), "Failed to get mac address (port %d)", member_port_ids[2]); - TEST_ASSERT_SUCCESS(memcmp(&bonded_mac_addr, &read_mac_addr, + TEST_ASSERT_SUCCESS(memcmp(&bonding_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), "member port 2 mac address not as expected"); - /* 6. a - Stop bonded ethdev + /* 6. a - Stop bonding ethdev * b - remove member ethdevs * c - Verify member ethdevs MACs are restored */ - TEST_ASSERT_SUCCESS(rte_eth_dev_stop(bonded_port_id), - "Failed to stop bonded port %u", - bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_stop(bonding_port_id), + "Failed to stop bonding port %u", + bonding_port_id); - for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT; i++) { - TEST_ASSERT_SUCCESS(rte_eth_bond_member_remove(bonded_port_id, + for (i = 0; i < BONDING_INIT_MAC_ASSIGNMENT_MEMBER_COUNT; i++) { + TEST_ASSERT_SUCCESS(rte_eth_bond_member_remove(bonding_port_id, member_port_ids[i]), - "Failed to remove member %d from bonded port (%d).", - member_port_ids[i], bonded_port_id); + "Failed to remove member %d from bonding port (%d).", + member_port_ids[i], bonding_port_id); } - member_count = rte_eth_bond_members_get(bonded_port_id, members, + member_count = rte_eth_bond_members_get(bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(member_count, 0, @@ -1127,63 +1128,63 @@ test_set_bonded_port_initialization_mac_assignment(void) static int -initialize_bonded_device_with_members(uint8_t bonding_mode, uint8_t bond_en_isr, +initialize_bonding_device_with_members(uint8_t bonding_mode, uint8_t bond_en_isr, uint16_t number_of_members, uint8_t enable_member) { - /* Configure bonded device */ - TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 0, + /* Configure bonding device */ + TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonding_port_id, 0, bond_en_isr), "Failed to configure bonding port (%d) in mode %d " - "with (%d) members.", test_params->bonded_port_id, bonding_mode, + "with (%d) members.", test_params->bonding_port_id, bonding_mode, number_of_members); - /* Add members to bonded device */ - while (number_of_members > test_params->bonded_member_count) - TEST_ASSERT_SUCCESS(test_add_member_to_bonded_device(), + /* Add members to bonding device */ + while (number_of_members > test_params->bonding_member_count) + TEST_ASSERT_SUCCESS(test_add_member_to_bonding_device(), "Failed to add member (%d to bonding port (%d).", - test_params->bonded_member_count - 1, - test_params->bonded_port_id); + test_params->bonding_member_count - 1, + test_params->bonding_port_id); /* Set link bonding mode */ - TEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonded_port_id, + TEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonding_port_id, bonding_mode), "Failed to set link bonding mode on port (%d) to (%d).", - test_params->bonded_port_id, bonding_mode); + test_params->bonding_port_id, bonding_mode); - TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id), - "Failed to start bonded pmd eth device %d.", - test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonding_port_id), + "Failed to start bonding pmd eth device %d.", + test_params->bonding_port_id); if (enable_member) - enable_bonded_members(); + enable_bonding_members(); return 0; } static int -test_adding_member_after_bonded_device_started(void) +test_adding_member_after_bonding_device_started(void) { int i; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_ROUND_ROBIN, 0, 4, 0), - "Failed to add members to bonded device"); + "Failed to add members to bonding device"); /* Enabled member devices */ - for (i = 0; i < test_params->bonded_member_count + 1; i++) { + for (i = 0; i < test_params->bonding_member_count + 1; i++) { virtual_ethdev_simulate_link_status_interrupt( test_params->member_port_ids[i], 1); } - TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(test_params->bonded_port_id, - test_params->member_port_ids[test_params->bonded_member_count]), - "Failed to add member to bonded port.\n"); + TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(test_params->bonding_port_id, + test_params->member_port_ids[test_params->bonding_member_count]), + "Failed to add member to bonding port.\n"); rte_eth_stats_reset( - test_params->member_port_ids[test_params->bonded_member_count]); + test_params->member_port_ids[test_params->bonding_member_count]); - test_params->bonded_member_count++; + test_params->bonding_member_count++; - return remove_members_and_stop_bonded_device(); + return remove_members_and_stop_bonding_device(); } #define TEST_STATUS_INTERRUPT_MEMBER_COUNT 4 @@ -1246,19 +1247,19 @@ test_status_interrupt(void) uint16_t members[RTE_MAX_ETHPORTS]; /* initialized bonding device with T members */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_ROUND_ROBIN, 1, TEST_STATUS_INTERRUPT_MEMBER_COUNT, 1), - "Failed to initialise bonded device"); + "Failed to initialise bonding device"); test_lsc_interrupt_count = 0; /* register link status change interrupt callback */ - rte_eth_dev_callback_register(test_params->bonded_port_id, + rte_eth_dev_callback_register(test_params->bonding_port_id, RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback, - &test_params->bonded_port_id); + &test_params->bonding_port_id); - member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id, + member_count = rte_eth_bond_active_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(member_count, TEST_STATUS_INTERRUPT_MEMBER_COUNT, @@ -1286,7 +1287,7 @@ test_status_interrupt(void) TEST_ASSERT(test_lsc_interrupt_count > 0, "Did not receive link status change interrupt"); - member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id, + member_count = rte_eth_bond_active_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(member_count, 0, @@ -1306,8 +1307,10 @@ test_status_interrupt(void) TEST_ASSERT(test_lsc_interrupt_count > 0, "Did not receive link status change interrupt"); - /* Verify that calling the same member lsc interrupt doesn't cause another - * lsc interrupt from bonded device */ + /* + * Verify that calling the same member lsc interrupt doesn't cause another + * lsc interrupt from bonding device. + */ test_lsc_interrupt_count = 0; virtual_ethdev_simulate_link_status_interrupt( @@ -1321,12 +1324,12 @@ test_status_interrupt(void) /* unregister lsc callback before exiting */ - rte_eth_dev_callback_unregister(test_params->bonded_port_id, + rte_eth_dev_callback_unregister(test_params->bonding_port_id, RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback, - &test_params->bonded_port_id); + &test_params->bonding_port_id); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -1403,11 +1406,11 @@ test_roundrobin_tx_burst(void) struct rte_mbuf *pkt_burst[MAX_PKT_BURST]; struct rte_eth_stats port_stats; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_ROUND_ROBIN, 0, 2, 1), - "Failed to initialise bonded device"); + "Failed to initialise bonding device"); - burst_size = 20 * test_params->bonded_member_count; + burst_size = 20 * test_params->bonding_member_count; TEST_ASSERT(burst_size <= MAX_PKT_BURST, "Burst size specified is greater than supported."); @@ -1416,41 +1419,41 @@ test_roundrobin_tx_burst(void) TEST_ASSERT_EQUAL(generate_test_burst(pkt_burst, burst_size, 0, 1, 0, 0, 0), burst_size, "failed to generate test burst"); - /* Send burst on bonded port */ + /* Send burst on bonding port */ TEST_ASSERT_EQUAL(rte_eth_tx_burst( - test_params->bonded_port_id, 0, pkt_burst, burst_size), burst_size, + test_params->bonding_port_id, 0, pkt_burst, burst_size), burst_size, "tx burst failed"); - /* Verify bonded port tx stats */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding port tx stats */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size, - "Bonded Port (%d) opackets value (%u) not as expected (%d)\n", - test_params->bonded_port_id, (unsigned int)port_stats.opackets, + "Bonding Port (%d) opackets value (%u) not as expected (%d)\n", + test_params->bonding_port_id, (unsigned int)port_stats.opackets, burst_size); /* Verify member ports tx stats */ - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { rte_eth_stats_get(test_params->member_port_ids[i], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, - (uint64_t)burst_size / test_params->bonded_member_count, + (uint64_t)burst_size / test_params->bonding_member_count, "Member Port (%d) opackets value (%u) not as expected (%d)\n", - test_params->bonded_port_id, (unsigned int)port_stats.opackets, - burst_size / test_params->bonded_member_count); + test_params->bonding_port_id, (unsigned int)port_stats.opackets, + burst_size / test_params->bonding_member_count); } /* Put all members down and try and transmit */ - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { virtual_ethdev_simulate_link_status_interrupt( test_params->member_port_ids[i], 0); } - /* Send burst on bonded port */ - TEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonded_port_id, 0, + /* Send burst on bonding port */ + TEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonding_port_id, 0, pkt_burst, burst_size), 0, "tx burst return unexpected value"); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -1491,10 +1494,10 @@ test_roundrobin_tx_burst_member_tx_fail(void) int i, first_fail_idx, tx_count; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_ROUND_ROBIN, 0, TEST_RR_MEMBER_TX_FAIL_MEMBER_COUNT, 1), - "Failed to initialise bonded device"); + "Failed to initialise bonding device"); /* Generate test bursts of packets to transmit */ TEST_ASSERT_EQUAL(generate_test_burst(pkt_burst, @@ -1525,7 +1528,7 @@ test_roundrobin_tx_burst_member_tx_fail(void) test_params->member_port_ids[TEST_RR_MEMBER_TX_FAIL_FAILING_MEMBER_IDX], TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT); - tx_count = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkt_burst, + tx_count = rte_eth_tx_burst(test_params->bonding_port_id, 0, pkt_burst, TEST_RR_MEMBER_TX_FAIL_BURST_SIZE); TEST_ASSERT_EQUAL(tx_count, TEST_RR_MEMBER_TX_FAIL_BURST_SIZE - @@ -1541,25 +1544,25 @@ test_roundrobin_tx_burst_member_tx_fail(void) i, expected_tx_fail_pkts[i], pkt_burst[i + tx_count]); } - /* Verify bonded port tx stats */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding port tx stats */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)TEST_RR_MEMBER_TX_FAIL_BURST_SIZE - TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT, - "Bonded Port (%d) opackets value (%u) not as expected (%d)", - test_params->bonded_port_id, (unsigned int)port_stats.opackets, + "Bonding Port (%d) opackets value (%u) not as expected (%d)", + test_params->bonding_port_id, (unsigned int)port_stats.opackets, TEST_RR_MEMBER_TX_FAIL_BURST_SIZE - TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT); /* Verify member ports tx stats */ - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { int member_expected_tx_count; rte_eth_stats_get(test_params->member_port_ids[i], &port_stats); member_expected_tx_count = TEST_RR_MEMBER_TX_FAIL_BURST_SIZE / - test_params->bonded_member_count; + test_params->bonding_member_count; if (i == TEST_RR_MEMBER_TX_FAIL_FAILING_MEMBER_IDX) member_expected_tx_count = member_expected_tx_count - @@ -1578,8 +1581,8 @@ test_roundrobin_tx_burst_member_tx_fail(void) "mbufs refcnts not as expected"); free_mbufs(&pkt_burst[tx_count], TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -1592,40 +1595,40 @@ test_roundrobin_rx_burst_on_single_member(void) int i, j, burst_size = 25; - /* Initialize bonded device with 4 members in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 4 members in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_ROUND_ROBIN, 0, 4, 1), - "Failed to initialize bonded device with members"); + "Failed to initialize bonding device with members"); /* Generate test bursts of packets to transmit */ TEST_ASSERT_EQUAL(generate_test_burst( gen_pkt_burst, burst_size, 0, 1, 0, 0, 0), burst_size, "burst generation failed"); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { /* Add rx data to member */ virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[i], &gen_pkt_burst[0], burst_size); - /* Call rx burst on bonded device */ - /* Send burst on bonded port */ + /* Call rx burst on bonding device */ + /* Send burst on bonding port */ TEST_ASSERT_EQUAL(rte_eth_rx_burst( - test_params->bonded_port_id, 0, rx_pkt_burst, + test_params->bonding_port_id, 0, rx_pkt_burst, MAX_PKT_BURST), burst_size, "round-robin rx burst failed"); - /* Verify bonded device rx count */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding device rx count */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size, - "Bonded Port (%d) ipackets value (%u) not as expected (%d)", - test_params->bonded_port_id, + "Bonding Port (%d) ipackets value (%u) not as expected (%d)", + test_params->bonding_port_id, (unsigned int)port_stats.ipackets, burst_size); - /* Verify bonded member devices rx count */ + /* Verify bonding member devices rx count */ /* Verify member ports tx stats */ - for (j = 0; j < test_params->bonded_member_count; j++) { + for (j = 0; j < test_params->bonding_member_count; j++) { rte_eth_stats_get(test_params->member_port_ids[j], &port_stats); if (i == j) { @@ -1640,11 +1643,11 @@ test_roundrobin_rx_burst_on_single_member(void) (unsigned int)port_stats.ipackets, 0); } - /* Reset bonded members stats */ + /* Reset bonding members stats */ rte_eth_stats_reset(test_params->member_port_ids[j]); } - /* reset bonded device stats */ - rte_eth_stats_reset(test_params->bonded_port_id); + /* reset bonding device stats */ + rte_eth_stats_reset(test_params->bonding_port_id); } /* free mbufs */ @@ -1653,8 +1656,8 @@ test_roundrobin_rx_burst_on_single_member(void) } - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } #define TEST_ROUNDROBIN_TX_BURST_MEMBER_COUNT (3) @@ -1670,10 +1673,10 @@ test_roundrobin_rx_burst_on_multiple_members(void) int burst_size[TEST_ROUNDROBIN_TX_BURST_MEMBER_COUNT] = { 15, 13, 36 }; int i, nb_rx; - /* Initialize bonded device with 4 members in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 4 members in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_ROUND_ROBIN, 0, 4, 1), - "Failed to initialize bonded device with members"); + "Failed to initialize bonding device with members"); /* Generate test bursts of packets to transmit */ for (i = 0; i < TEST_ROUNDROBIN_TX_BURST_MEMBER_COUNT; i++) { @@ -1688,23 +1691,23 @@ test_roundrobin_rx_burst_on_multiple_members(void) &gen_pkt_burst[i][0], burst_size[i]); } - /* Call rx burst on bonded device */ - /* Send burst on bonded port */ - nb_rx = rte_eth_rx_burst(test_params->bonded_port_id, 0, rx_pkt_burst, + /* Call rx burst on bonding device */ + /* Send burst on bonding port */ + nb_rx = rte_eth_rx_burst(test_params->bonding_port_id, 0, rx_pkt_burst, MAX_PKT_BURST); TEST_ASSERT_EQUAL(nb_rx , burst_size[0] + burst_size[1] + burst_size[2], "round-robin rx burst failed (%d != %d)\n", nb_rx, burst_size[0] + burst_size[1] + burst_size[2]); - /* Verify bonded device rx count */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding device rx count */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)(burst_size[0] + burst_size[1] + burst_size[2]), - "Bonded Port (%d) ipackets value (%u) not as expected (%d)", - test_params->bonded_port_id, (unsigned int)port_stats.ipackets, + "Bonding Port (%d) ipackets value (%u) not as expected (%d)", + test_params->bonding_port_id, (unsigned int)port_stats.ipackets, burst_size[0] + burst_size[1] + burst_size[2]); - /* Verify bonded member devices rx counts */ + /* Verify bonding member devices rx counts */ rte_eth_stats_get(test_params->member_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[0], "Member Port (%d) ipackets value (%u) not as expected (%d)", @@ -1734,8 +1737,8 @@ test_roundrobin_rx_burst_on_multiple_members(void) rte_pktmbuf_free(rx_pkt_burst[i]); } - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -1755,13 +1758,13 @@ test_roundrobin_verify_mac_assignment(void) "Failed to get mac address (port %d)", test_params->member_port_ids[2]); - /* Initialize bonded device with 4 members in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 4 members in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_ROUND_ROBIN, 0, 4, 1), - "Failed to initialize bonded device with members"); + "Failed to initialize bonding device with members"); - /* Verify that all MACs are the same as first member added to bonded dev */ - for (i = 0; i < test_params->bonded_member_count; i++) { + /* Verify that all MACs are the same as first member added to bonding dev */ + for (i = 0; i < test_params->bonding_member_count; i++) { TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", @@ -1773,12 +1776,12 @@ test_roundrobin_verify_mac_assignment(void) } /* change primary and verify that MAC addresses haven't changed */ - TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonded_port_id, + TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonding_port_id, test_params->member_port_ids[2]), - "Failed to set bonded port (%d) primary port to (%d)", - test_params->bonded_port_id, test_params->member_port_ids[i]); + "Failed to set bonding port (%d) primary port to (%d)", + test_params->bonding_port_id, test_params->member_port_ids[i]); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", @@ -1786,30 +1789,30 @@ test_roundrobin_verify_mac_assignment(void) TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), "member port (%d) mac address has changed to that of primary" - " port without stop/start toggle of bonded device", + " port without stop/start toggle of bonding device", test_params->member_port_ids[i]); } /* - * stop / start bonded device and verify that primary MAC address is - * propagate to bonded device and members. + * stop / start bonding device and verify that primary MAC address is + * propagate to bonding device and members. */ - TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), - "Failed to stop bonded port %u", - test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonding_port_id), + "Failed to stop bonding port %u", + test_params->bonding_port_id); - TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id), - "Failed to start bonded device"); + TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonding_port_id), + "Failed to start bonding device"); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); + test_params->bonding_port_id); TEST_ASSERT_SUCCESS( memcmp(&expected_mac_addr_2, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port (%d) mac address not set to that of new primary port", + "bonding port (%d) mac address not set to that of new primary port", test_params->member_port_ids[i]); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", @@ -1822,30 +1825,30 @@ test_roundrobin_verify_mac_assignment(void) /* Set explicit MAC address */ TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set( - test_params->bonded_port_id, - (struct rte_ether_addr *)bonded_mac), + test_params->bonding_port_id, + (struct rte_ether_addr *)bonding_mac), "Failed to set MAC"); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr, + test_params->bonding_port_id); + TEST_ASSERT_SUCCESS(memcmp(bonding_mac, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port (%d) mac address not set to that of new primary port", + "bonding port (%d) mac address not set to that of new primary port", test_params->member_port_ids[i]); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", test_params->member_port_ids[i]); - TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr, + TEST_ASSERT_SUCCESS(memcmp(bonding_mac, &read_mac_addr, sizeof(read_mac_addr)), "member port (%d) mac address not set to" " that of new primary port\n", test_params->member_port_ids[i]); } - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -1854,22 +1857,22 @@ test_roundrobin_verify_promiscuous_enable_disable(void) int i, promiscuous_en; int ret; - /* Initialize bonded device with 4 members in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 4 members in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_ROUND_ROBIN, 0, 4, 1), - "Failed to initialize bonded device with members"); + "Failed to initialize bonding device with members"); - ret = rte_eth_promiscuous_enable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_enable(test_params->bonding_port_id); TEST_ASSERT_SUCCESS(ret, "Failed to enable promiscuous mode for port %d: %s", - test_params->bonded_port_id, rte_strerror(-ret)); + test_params->bonding_port_id, rte_strerror(-ret)); - promiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id); + promiscuous_en = rte_eth_promiscuous_get(test_params->bonding_port_id); TEST_ASSERT_EQUAL(promiscuous_en, 1, "Port (%d) promiscuous mode not enabled", - test_params->bonded_port_id); + test_params->bonding_port_id); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { promiscuous_en = rte_eth_promiscuous_get( test_params->member_port_ids[i]); TEST_ASSERT_EQUAL(promiscuous_en, 1, @@ -1877,17 +1880,17 @@ test_roundrobin_verify_promiscuous_enable_disable(void) test_params->member_port_ids[i]); } - ret = rte_eth_promiscuous_disable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_disable(test_params->bonding_port_id); TEST_ASSERT_SUCCESS(ret, "Failed to disable promiscuous mode for port %d: %s", - test_params->bonded_port_id, rte_strerror(-ret)); + test_params->bonding_port_id, rte_strerror(-ret)); - promiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id); + promiscuous_en = rte_eth_promiscuous_get(test_params->bonding_port_id); TEST_ASSERT_EQUAL(promiscuous_en, 0, "Port (%d) promiscuous mode not disabled\n", - test_params->bonded_port_id); + test_params->bonding_port_id); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { promiscuous_en = rte_eth_promiscuous_get( test_params->member_port_ids[i]); TEST_ASSERT_EQUAL(promiscuous_en, 0, @@ -1895,8 +1898,8 @@ test_roundrobin_verify_promiscuous_enable_disable(void) test_params->member_port_ids[i]); } - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } #define TEST_RR_LINK_STATUS_MEMBER_COUNT (4) @@ -1917,20 +1920,20 @@ test_roundrobin_verify_member_link_status_change_behaviour(void) /* NULL all pointers in array to simplify cleanup */ memset(gen_pkt_burst, 0, sizeof(gen_pkt_burst)); - /* Initialize bonded device with TEST_RR_LINK_STATUS_MEMBER_COUNT members + /* Initialize bonding device with TEST_RR_LINK_STATUS_MEMBER_COUNT members * in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_ROUND_ROBIN, 0, TEST_RR_LINK_STATUS_MEMBER_COUNT, 1), - "Failed to initialize bonded device with members"); + "Failed to initialize bonding device with members"); /* Verify Current Members Count /Active Member Count is */ - member_count = rte_eth_bond_members_get(test_params->bonded_port_id, members, + member_count = rte_eth_bond_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(member_count, TEST_RR_LINK_STATUS_MEMBER_COUNT, "Number of members (%d) is not as expected (%d).", member_count, TEST_RR_LINK_STATUS_MEMBER_COUNT); - member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id, + member_count = rte_eth_bond_active_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(member_count, TEST_RR_LINK_STATUS_MEMBER_COUNT, "Number of active members (%d) is not as expected (%d).", @@ -1942,7 +1945,7 @@ test_roundrobin_verify_member_link_status_change_behaviour(void) virtual_ethdev_simulate_link_status_interrupt( test_params->member_port_ids[3], 0); - member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id, + member_count = rte_eth_bond_active_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(member_count, TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_MEMBER_COUNT, @@ -1954,25 +1957,25 @@ test_roundrobin_verify_member_link_status_change_behaviour(void) /* Verify that pkts are not sent on members with link status down: * * 1. Generate test burst of traffic - * 2. Transmit burst on bonded eth_dev - * 3. Verify stats for bonded eth_dev (opackets = burst_size) + * 2. Transmit burst on bonding eth_dev + * 3. Verify stats for bonding eth_dev (opackets = burst_size) * 4. Verify stats for member eth_devs (s0 = 10, s1 = 0, s2 = 10, s3 = 0) */ TEST_ASSERT_EQUAL( generate_test_burst(tx_pkt_burst, burst_size, 0, 1, 0, 0, 0), burst_size, "generate_test_burst failed"); - rte_eth_stats_reset(test_params->bonded_port_id); + rte_eth_stats_reset(test_params->bonding_port_id); TEST_ASSERT_EQUAL( - rte_eth_tx_burst(test_params->bonded_port_id, 0, tx_pkt_burst, + rte_eth_tx_burst(test_params->bonding_port_id, 0, tx_pkt_burst, burst_size), burst_size, "rte_eth_tx_burst failed"); - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size, "Port (%d) opackets stats (%d) not expected (%d) value", - test_params->bonded_port_id, (int)port_stats.opackets, + test_params->bonding_port_id, (int)port_stats.opackets, burst_size); rte_eth_stats_get(test_params->member_port_ids[0], &port_stats); @@ -1999,9 +2002,9 @@ test_roundrobin_verify_member_link_status_change_behaviour(void) * * 1. Generate test bursts of traffic * 2. Add bursts on to virtual eth_devs - * 3. Rx burst on bonded eth_dev, expected (burst_ size * + * 3. Rx burst on bonding eth_dev, expected (burst_ size * * TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_MEMBER_COUNT) received - * 4. Verify stats for bonded eth_dev + * 4. Verify stats for bonding eth_dev * 6. Verify stats for member eth_devs (s0 = 10, s1 = 0, s2 = 10, s3 = 0) */ for (i = 0; i < TEST_RR_LINK_STATUS_MEMBER_COUNT; i++) { @@ -2014,23 +2017,23 @@ test_roundrobin_verify_member_link_status_change_behaviour(void) } TEST_ASSERT_EQUAL(rte_eth_rx_burst( - test_params->bonded_port_id, 0, rx_pkt_burst, MAX_PKT_BURST), + test_params->bonding_port_id, 0, rx_pkt_burst, MAX_PKT_BURST), burst_size + burst_size, "rte_eth_rx_burst failed"); - /* Verify bonded device rx count */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding device rx count */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets , (uint64_t)(burst_size + burst_size), "(%d) port_stats.ipackets not as expected\n", - test_params->bonded_port_id); + test_params->bonding_port_id); /* free mbufs */ for (i = 0; i < MAX_PKT_BURST; i++) { rte_pktmbuf_free(rx_pkt_burst[i]); } - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } #define TEST_RR_POLLING_LINK_STATUS_MEMBER_COUNT (2) @@ -2067,24 +2070,24 @@ test_roundrobin_verify_polling_member_link_status_change(void) polling_test_members[i]); } - /* Add member to bonded device */ - TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(test_params->bonded_port_id, + /* Add member to bonding device */ + TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(test_params->bonding_port_id, polling_test_members[i]), - "Failed to add member %s(%d) to bonded device %d", + "Failed to add member %s(%d) to bonding device %d", member_name, polling_test_members[i], - test_params->bonded_port_id); + test_params->bonding_port_id); } - /* Initialize bonded device */ - TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 1, 1), - "Failed to configure bonded device %d", - test_params->bonded_port_id); + /* Initialize bonding device */ + TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonding_port_id, 1, 1), + "Failed to configure bonding device %d", + test_params->bonding_port_id); /* Register link status change interrupt callback */ - rte_eth_dev_callback_register(test_params->bonded_port_id, + rte_eth_dev_callback_register(test_params->bonding_port_id, RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback, - &test_params->bonded_port_id); + &test_params->bonding_port_id); /* link status change callback for first member link up */ test_lsc_interrupt_count = 0; @@ -2110,22 +2113,22 @@ test_roundrobin_verify_polling_member_link_status_change(void) TEST_ASSERT_SUCCESS(lsc_timeout(20000), "timed out waiting for interrupt"); /* Un-Register link status change interrupt callback */ - rte_eth_dev_callback_unregister(test_params->bonded_port_id, + rte_eth_dev_callback_unregister(test_params->bonding_port_id, RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback, - &test_params->bonded_port_id); + &test_params->bonding_port_id); - /* Clean up and remove members from bonded device */ + /* Clean up and remove members from bonding device */ for (i = 0; i < TEST_RR_POLLING_LINK_STATUS_MEMBER_COUNT; i++) { TEST_ASSERT_SUCCESS( - rte_eth_bond_member_remove(test_params->bonded_port_id, + rte_eth_bond_member_remove(test_params->bonding_port_id, polling_test_members[i]), - "Failed to remove member %d from bonded port (%d)", - polling_test_members[i], test_params->bonded_port_id); + "Failed to remove member %d from bonding port (%d)", + polling_test_members[i], test_params->bonding_port_id); } - return remove_members_and_stop_bonded_device(); + return remove_members_and_stop_bonding_device(); } @@ -2138,9 +2141,9 @@ test_activebackup_tx_burst(void) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct rte_eth_stats port_stats; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_ACTIVE_BACKUP, 0, 1, 1), - "Failed to initialize bonded device with members"); + "Failed to initialize bonding device with members"); initialize_eth_header(test_params->pkt_eth_hdr, (struct rte_ether_addr *)src_mac, @@ -2151,7 +2154,7 @@ test_activebackup_tx_burst(void) pktlen = initialize_ipv4_header(test_params->pkt_ipv4_hdr, src_addr, dst_addr_0, pktlen); - burst_size = 20 * test_params->bonded_member_count; + burst_size = 20 * test_params->bonding_member_count; TEST_ASSERT(burst_size < MAX_PKT_BURST, "Burst size specified is greater than supported."); @@ -2162,48 +2165,48 @@ test_activebackup_tx_burst(void) test_params->pkt_udp_hdr, burst_size, PACKET_BURST_GEN_PKT_LEN, 1), burst_size, "failed to generate burst correctly"); - /* Send burst on bonded port */ - TEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst, + /* Send burst on bonding port */ + TEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonding_port_id, 0, pkts_burst, burst_size), burst_size, "tx burst failed"); - /* Verify bonded port tx stats */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding port tx stats */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size, - "Bonded Port (%d) opackets value (%u) not as expected (%d)", - test_params->bonded_port_id, (unsigned int)port_stats.opackets, + "Bonding Port (%d) opackets value (%u) not as expected (%d)", + test_params->bonding_port_id, (unsigned int)port_stats.opackets, burst_size); - primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); + primary_port = rte_eth_bond_primary_get(test_params->bonding_port_id); /* Verify member ports tx stats */ - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { rte_eth_stats_get(test_params->member_port_ids[i], &port_stats); if (test_params->member_port_ids[i] == primary_port) { TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size, "Member Port (%d) opackets value (%u) not as expected (%d)", - test_params->bonded_port_id, + test_params->bonding_port_id, (unsigned int)port_stats.opackets, - burst_size / test_params->bonded_member_count); + burst_size / test_params->bonding_member_count); } else { TEST_ASSERT_EQUAL(port_stats.opackets, 0, "Member Port (%d) opackets value (%u) not as expected (%d)", - test_params->bonded_port_id, + test_params->bonding_port_id, (unsigned int)port_stats.opackets, 0); } } /* Put all members down and try and transmit */ - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { virtual_ethdev_simulate_link_status_interrupt( test_params->member_port_ids[i], 0); } - /* Send burst on bonded port */ - TEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonded_port_id, 0, + /* Send burst on bonding port */ + TEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonding_port_id, 0, pkts_burst, burst_size), 0, "Sending empty burst failed"); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } #define TEST_ACTIVE_BACKUP_RX_BURST_MEMBER_COUNT (4) @@ -2220,17 +2223,17 @@ test_activebackup_rx_burst(void) int i, j, burst_size = 17; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_ACTIVE_BACKUP, 0, TEST_ACTIVE_BACKUP_RX_BURST_MEMBER_COUNT, 1), - "Failed to initialize bonded device with members"); + "Failed to initialize bonding device with members"); - primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); + primary_port = rte_eth_bond_primary_get(test_params->bonding_port_id); TEST_ASSERT(primary_port >= 0, - "failed to get primary member for bonded port (%d)", - test_params->bonded_port_id); + "failed to get primary member for bonding port (%d)", + test_params->bonding_port_id); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { /* Generate test bursts of packets to transmit */ TEST_ASSERT_EQUAL(generate_test_burst( &gen_pkt_burst[0], burst_size, 0, 1, 0, 0, 0), @@ -2240,21 +2243,21 @@ test_activebackup_rx_burst(void) virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[i], &gen_pkt_burst[0], burst_size); - /* Call rx burst on bonded device */ - TEST_ASSERT_EQUAL(rte_eth_rx_burst(test_params->bonded_port_id, 0, + /* Call rx burst on bonding device */ + TEST_ASSERT_EQUAL(rte_eth_rx_burst(test_params->bonding_port_id, 0, &rx_pkt_burst[0], MAX_PKT_BURST), burst_size, "rte_eth_rx_burst failed"); if (test_params->member_port_ids[i] == primary_port) { - /* Verify bonded device rx count */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding device rx count */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size, - "Bonded Port (%d) ipackets value (%u) not as expected (%d)", - test_params->bonded_port_id, + "Bonding Port (%d) ipackets value (%u) not as expected (%d)", + test_params->bonding_port_id, (unsigned int)port_stats.ipackets, burst_size); - /* Verify bonded member devices rx count */ - for (j = 0; j < test_params->bonded_member_count; j++) { + /* Verify bonding member devices rx count */ + for (j = 0; j < test_params->bonding_member_count; j++) { rte_eth_stats_get(test_params->member_port_ids[j], &port_stats); if (i == j) { TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size, @@ -2272,7 +2275,7 @@ test_activebackup_rx_burst(void) } } } else { - for (j = 0; j < test_params->bonded_member_count; j++) { + for (j = 0; j < test_params->bonding_member_count; j++) { rte_eth_stats_get(test_params->member_port_ids[j], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, 0, "Member Port (%d) ipackets value (%u) not as expected " @@ -2289,12 +2292,12 @@ test_activebackup_rx_burst(void) } } - /* reset bonded device stats */ - rte_eth_stats_reset(test_params->bonded_port_id); + /* reset bonding device stats */ + rte_eth_stats_reset(test_params->bonding_port_id); } - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -2303,26 +2306,26 @@ test_activebackup_verify_promiscuous_enable_disable(void) int i, primary_port, promiscuous_en; int ret; - /* Initialize bonded device with 4 members in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 4 members in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_ACTIVE_BACKUP, 0, 4, 1), - "Failed to initialize bonded device with members"); + "Failed to initialize bonding device with members"); - primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); + primary_port = rte_eth_bond_primary_get(test_params->bonding_port_id); TEST_ASSERT(primary_port >= 0, - "failed to get primary member for bonded port (%d)", - test_params->bonded_port_id); + "failed to get primary member for bonding port (%d)", + test_params->bonding_port_id); - ret = rte_eth_promiscuous_enable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_enable(test_params->bonding_port_id); TEST_ASSERT_SUCCESS(ret, "Failed to enable promiscuous mode for port %d: %s", - test_params->bonded_port_id, rte_strerror(-ret)); + test_params->bonding_port_id, rte_strerror(-ret)); - TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 1, + TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonding_port_id), 1, "Port (%d) promiscuous mode not enabled", - test_params->bonded_port_id); + test_params->bonding_port_id); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { promiscuous_en = rte_eth_promiscuous_get( test_params->member_port_ids[i]); if (primary_port == test_params->member_port_ids[i]) { @@ -2337,16 +2340,16 @@ test_activebackup_verify_promiscuous_enable_disable(void) } - ret = rte_eth_promiscuous_disable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_disable(test_params->bonding_port_id); TEST_ASSERT_SUCCESS(ret, "Failed to disable promiscuous mode for port %d: %s", - test_params->bonded_port_id, rte_strerror(-ret)); + test_params->bonding_port_id, rte_strerror(-ret)); - TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 0, + TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonding_port_id), 0, "Port (%d) promiscuous mode not disabled\n", - test_params->bonded_port_id); + test_params->bonding_port_id); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { promiscuous_en = rte_eth_promiscuous_get( test_params->member_port_ids[i]); TEST_ASSERT_EQUAL(promiscuous_en, 0, @@ -2354,8 +2357,8 @@ test_activebackup_verify_promiscuous_enable_disable(void) test_params->member_port_ids[i]); } - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -2373,20 +2376,20 @@ test_activebackup_verify_mac_assignment(void) "Failed to get mac address (port %d)", test_params->member_port_ids[1]); - /* Initialize bonded device with 2 members in active backup mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 2 members in active backup mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_ACTIVE_BACKUP, 0, 2, 1), - "Failed to initialize bonded device with members"); + "Failed to initialize bonding device with members"); - /* Verify that bonded MACs is that of first member and that the other member + /* Verify that bonding MACs is that of first member and that the other member * MAC hasn't been changed */ - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port (%d) mac address not set to that of primary port", - test_params->bonded_port_id); + "bonding port (%d) mac address not set to that of primary port", + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", @@ -2405,18 +2408,18 @@ test_activebackup_verify_mac_assignment(void) test_params->member_port_ids[1]); /* change primary and verify that MAC addresses haven't changed */ - TEST_ASSERT_EQUAL(rte_eth_bond_primary_set(test_params->bonded_port_id, + TEST_ASSERT_EQUAL(rte_eth_bond_primary_set(test_params->bonding_port_id, test_params->member_port_ids[1]), 0, - "Failed to set bonded port (%d) primary port to (%d)", - test_params->bonded_port_id, test_params->member_port_ids[1]); + "Failed to set bonding port (%d) primary port to (%d)", + test_params->bonding_port_id, test_params->member_port_ids[1]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port (%d) mac address not set to that of primary port", - test_params->bonded_port_id); + "bonding port (%d) mac address not set to that of primary port", + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", @@ -2435,24 +2438,24 @@ test_activebackup_verify_mac_assignment(void) test_params->member_port_ids[1]); /* - * stop / start bonded device and verify that primary MAC address is - * propagated to bonded device and members. + * stop / start bonding device and verify that primary MAC address is + * propagated to bonding device and members. */ - TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), - "Failed to stop bonded port %u", - test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonding_port_id), + "Failed to stop bonding port %u", + test_params->bonding_port_id); - TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id), + TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonding_port_id), "Failed to start device"); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port (%d) mac address not set to that of primary port", - test_params->bonded_port_id); + "bonding port (%d) mac address not set to that of primary port", + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", @@ -2472,17 +2475,17 @@ test_activebackup_verify_mac_assignment(void) /* Set explicit MAC address */ TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set( - test_params->bonded_port_id, - (struct rte_ether_addr *)bonded_mac), + test_params->bonding_port_id, + (struct rte_ether_addr *)bonding_mac), "failed to set MAC address"); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr, + test_params->bonding_port_id); + TEST_ASSERT_SUCCESS(memcmp(&bonding_mac, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port (%d) mac address not set to that of bonded port", - test_params->bonded_port_id); + "bonding port (%d) mac address not set to that of bonding port", + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", @@ -2495,13 +2498,13 @@ test_activebackup_verify_mac_assignment(void) TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", test_params->member_port_ids[1]); - TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr, + TEST_ASSERT_SUCCESS(memcmp(&bonding_mac, &read_mac_addr, sizeof(read_mac_addr)), - "member port (%d) mac address not set to that of bonded port", + "member port (%d) mac address not set to that of bonding port", test_params->member_port_ids[1]); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -2524,26 +2527,26 @@ test_activebackup_verify_member_link_status_change_failover(void) &pkt_burst[0][0], burst_size, 0, 1, 0, 0, 0), burst_size, "generate_test_burst failed"); - /* Initialize bonded device with 4 members in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 4 members in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_ACTIVE_BACKUP, 0, TEST_ACTIVE_BACKUP_RX_BURST_MEMBER_COUNT, 1), - "Failed to initialize bonded device with members"); + "Failed to initialize bonding device with members"); /* Verify Current Members Count /Active Member Count is */ - member_count = rte_eth_bond_members_get(test_params->bonded_port_id, members, + member_count = rte_eth_bond_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(member_count, 4, "Number of members (%d) is not as expected (%d).", member_count, 4); - member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id, + member_count = rte_eth_bond_active_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(member_count, 4, "Number of active members (%d) is not as expected (%d).", member_count, 4); - primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); + primary_port = rte_eth_bond_primary_get(test_params->bonding_port_id); TEST_ASSERT_EQUAL(primary_port, test_params->member_port_ids[0], "Primary port not as expected"); @@ -2554,7 +2557,7 @@ test_activebackup_verify_member_link_status_change_failover(void) test_params->member_port_ids[3], 0); TEST_ASSERT_EQUAL(rte_eth_bond_active_members_get( - test_params->bonded_port_id, members, RTE_MAX_ETHPORTS), 2, + test_params->bonding_port_id, members, RTE_MAX_ETHPORTS), 2, "Number of active members (%d) is not as expected (%d).", member_count, 2); @@ -2570,19 +2573,19 @@ test_activebackup_verify_member_link_status_change_failover(void) test_params->member_port_ids[0], 0); TEST_ASSERT_EQUAL(rte_eth_bond_active_members_get( - test_params->bonded_port_id, members, RTE_MAX_ETHPORTS), + test_params->bonding_port_id, members, RTE_MAX_ETHPORTS), 3, "Number of active members (%d) is not as expected (%d).", member_count, 3); - primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); + primary_port = rte_eth_bond_primary_get(test_params->bonding_port_id); TEST_ASSERT_EQUAL(primary_port, test_params->member_port_ids[2], "Primary port not as expected"); /* Verify that pkts are sent on new primary member */ TEST_ASSERT_EQUAL(rte_eth_tx_burst( - test_params->bonded_port_id, 0, &pkt_burst[0][0], + test_params->bonding_port_id, 0, &pkt_burst[0][0], burst_size), burst_size, "rte_eth_tx_burst failed"); rte_eth_stats_get(test_params->member_port_ids[2], &port_stats); @@ -2617,14 +2620,14 @@ test_activebackup_verify_member_link_status_change_failover(void) } TEST_ASSERT_EQUAL(rte_eth_rx_burst( - test_params->bonded_port_id, 0, rx_pkt_burst, MAX_PKT_BURST), + test_params->bonding_port_id, 0, rx_pkt_burst, MAX_PKT_BURST), burst_size, "rte_eth_rx_burst\n"); - /* Verify bonded device rx count */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding device rx count */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size, "(%d) port_stats.ipackets not as expected", - test_params->bonded_port_id); + test_params->bonding_port_id); rte_eth_stats_get(test_params->member_port_ids[2], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size, @@ -2646,8 +2649,8 @@ test_activebackup_verify_member_link_status_change_failover(void) "(%d) port_stats.opackets not as expected", test_params->member_port_ids[3]); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } /** Balance Mode Tests */ @@ -2655,43 +2658,43 @@ test_activebackup_verify_member_link_status_change_failover(void) static int test_balance_xmit_policy_configuration(void) { - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_ACTIVE_BACKUP, 0, 2, 1), - "Failed to initialize_bonded_device_with_members."); + "Failed to initialize_bonding_device_with_members."); /* Invalid port id */ TEST_ASSERT_FAIL(rte_eth_bond_xmit_policy_set( INVALID_PORT_ID, BALANCE_XMIT_POLICY_LAYER2), "Expected call to failed as invalid port specified."); - /* Set xmit policy on non bonded device */ + /* Set xmit policy on non bonding device */ TEST_ASSERT_FAIL(rte_eth_bond_xmit_policy_set( test_params->member_port_ids[0], BALANCE_XMIT_POLICY_LAYER2), "Expected call to failed as invalid port specified."); TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set( - test_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER2), + test_params->bonding_port_id, BALANCE_XMIT_POLICY_LAYER2), "Failed to set balance xmit policy."); - TEST_ASSERT_EQUAL(rte_eth_bond_xmit_policy_get(test_params->bonded_port_id), + TEST_ASSERT_EQUAL(rte_eth_bond_xmit_policy_get(test_params->bonding_port_id), BALANCE_XMIT_POLICY_LAYER2, "balance xmit policy not as expected."); TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set( - test_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER23), + test_params->bonding_port_id, BALANCE_XMIT_POLICY_LAYER23), "Failed to set balance xmit policy."); - TEST_ASSERT_EQUAL(rte_eth_bond_xmit_policy_get(test_params->bonded_port_id), + TEST_ASSERT_EQUAL(rte_eth_bond_xmit_policy_get(test_params->bonding_port_id), BALANCE_XMIT_POLICY_LAYER23, "balance xmit policy not as expected."); TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set( - test_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER34), + test_params->bonding_port_id, BALANCE_XMIT_POLICY_LAYER34), "Failed to set balance xmit policy."); - TEST_ASSERT_EQUAL(rte_eth_bond_xmit_policy_get(test_params->bonded_port_id), + TEST_ASSERT_EQUAL(rte_eth_bond_xmit_policy_get(test_params->bonding_port_id), BALANCE_XMIT_POLICY_LAYER34, "balance xmit policy not as expected."); @@ -2699,8 +2702,8 @@ test_balance_xmit_policy_configuration(void) TEST_ASSERT_FAIL(rte_eth_bond_xmit_policy_get(INVALID_PORT_ID), "Expected call to failed as invalid port specified."); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } #define TEST_BALANCE_L2_TX_BURST_MEMBER_COUNT (2) @@ -2715,12 +2718,12 @@ test_balance_l2_tx_burst(void) int i; struct rte_eth_stats port_stats; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_BALANCE, 0, TEST_BALANCE_L2_TX_BURST_MEMBER_COUNT, 1), - "Failed to initialize_bonded_device_with_members."); + "Failed to initialize_bonding_device_with_members."); TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set( - test_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER2), + test_params->bonding_port_id, BALANCE_XMIT_POLICY_LAYER2), "Failed to set balance xmit policy."); initialize_eth_header(test_params->pkt_eth_hdr, @@ -2751,19 +2754,19 @@ test_balance_l2_tx_burst(void) PACKET_BURST_GEN_PKT_LEN, 1), burst_size[1], "failed to generate packet burst"); - /* Send burst 1 on bonded port */ + /* Send burst 1 on bonding port */ for (i = 0; i < TEST_BALANCE_L2_TX_BURST_MEMBER_COUNT; i++) { - TEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonded_port_id, 0, + TEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonding_port_id, 0, &pkts_burst[i][0], burst_size[i]), burst_size[i], "Failed to transmit packet burst"); } - /* Verify bonded port tx stats */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding port tx stats */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(burst_size[0] + burst_size[1]), - "Bonded Port (%d) opackets value (%u) not as expected (%d)", - test_params->bonded_port_id, (unsigned int)port_stats.opackets, + "Bonding Port (%d) opackets value (%u) not as expected (%d)", + test_params->bonding_port_id, (unsigned int)port_stats.opackets, burst_size[0] + burst_size[1]); @@ -2781,19 +2784,19 @@ test_balance_l2_tx_burst(void) burst_size[1]); /* Put all members down and try and transmit */ - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { virtual_ethdev_simulate_link_status_interrupt( test_params->member_port_ids[i], 0); } - /* Send burst on bonded port */ + /* Send burst on bonding port */ TEST_ASSERT_EQUAL(rte_eth_tx_burst( - test_params->bonded_port_id, 0, &pkts_burst[0][0], burst_size[0]), + test_params->bonding_port_id, 0, &pkts_burst[0][0], burst_size[0]), 0, "Expected zero packet"); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -2807,12 +2810,12 @@ balance_l23_tx_burst(uint8_t vlan_enabled, uint8_t ipv4, struct rte_eth_stats port_stats; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_BALANCE, 0, 2, 1), - "Failed to initialize_bonded_device_with_members."); + "Failed to initialize_bonding_device_with_members."); TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set( - test_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER23), + test_params->bonding_port_id, BALANCE_XMIT_POLICY_LAYER23), "Failed to set balance xmit policy."); burst_size_1 = 20; @@ -2830,21 +2833,21 @@ balance_l23_tx_burst(uint8_t vlan_enabled, uint8_t ipv4, toggle_mac_addr, toggle_ip_addr, 0), burst_size_2, "failed to generate packet burst"); - /* Send burst 1 on bonded port */ - nb_tx_1 = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst_1, + /* Send burst 1 on bonding port */ + nb_tx_1 = rte_eth_tx_burst(test_params->bonding_port_id, 0, pkts_burst_1, burst_size_1); TEST_ASSERT_EQUAL(nb_tx_1, burst_size_1, "tx burst failed"); - /* Send burst 2 on bonded port */ - nb_tx_2 = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst_2, + /* Send burst 2 on bonding port */ + nb_tx_2 = rte_eth_tx_burst(test_params->bonding_port_id, 0, pkts_burst_2, burst_size_2); TEST_ASSERT_EQUAL(nb_tx_2, burst_size_2, "tx burst failed"); - /* Verify bonded port tx stats */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding port tx stats */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(nb_tx_1 + nb_tx_2), - "Bonded Port (%d) opackets value (%u) not as expected (%d)", - test_params->bonded_port_id, (unsigned int)port_stats.opackets, + "Bonding Port (%d) opackets value (%u) not as expected (%d)", + test_params->bonding_port_id, (unsigned int)port_stats.opackets, nb_tx_1 + nb_tx_2); /* Verify member ports tx stats */ @@ -2861,20 +2864,20 @@ balance_l23_tx_burst(uint8_t vlan_enabled, uint8_t ipv4, nb_tx_2); /* Put all members down and try and transmit */ - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { virtual_ethdev_simulate_link_status_interrupt( test_params->member_port_ids[i], 0); } - /* Send burst on bonded port */ + /* Send burst on bonding port */ TEST_ASSERT_EQUAL(rte_eth_tx_burst( - test_params->bonded_port_id, 0, pkts_burst_1, + test_params->bonding_port_id, 0, pkts_burst_1, burst_size_1), 0, "Expected zero packet"); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -2919,12 +2922,12 @@ balance_l34_tx_burst(uint8_t vlan_enabled, uint8_t ipv4, struct rte_eth_stats port_stats; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_BALANCE, 0, 2, 1), - "Failed to initialize_bonded_device_with_members."); + "Failed to initialize_bonding_device_with_members."); TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set( - test_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER34), + test_params->bonding_port_id, BALANCE_XMIT_POLICY_LAYER34), "Failed to set balance xmit policy."); burst_size_1 = 20; @@ -2942,22 +2945,22 @@ balance_l34_tx_burst(uint8_t vlan_enabled, uint8_t ipv4, vlan_enabled, ipv4, toggle_mac_addr, toggle_ip_addr, toggle_udp_port), burst_size_2, "failed to generate burst"); - /* Send burst 1 on bonded port */ - nb_tx_1 = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst_1, + /* Send burst 1 on bonding port */ + nb_tx_1 = rte_eth_tx_burst(test_params->bonding_port_id, 0, pkts_burst_1, burst_size_1); TEST_ASSERT_EQUAL(nb_tx_1, burst_size_1, "tx burst failed"); - /* Send burst 2 on bonded port */ - nb_tx_2 = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst_2, + /* Send burst 2 on bonding port */ + nb_tx_2 = rte_eth_tx_burst(test_params->bonding_port_id, 0, pkts_burst_2, burst_size_2); TEST_ASSERT_EQUAL(nb_tx_2, burst_size_2, "tx burst failed"); - /* Verify bonded port tx stats */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding port tx stats */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(nb_tx_1 + nb_tx_2), - "Bonded Port (%d) opackets value (%u) not as expected (%d)", - test_params->bonded_port_id, (unsigned int)port_stats.opackets, + "Bonding Port (%d) opackets value (%u) not as expected (%d)", + test_params->bonding_port_id, (unsigned int)port_stats.opackets, nb_tx_1 + nb_tx_2); /* Verify member ports tx stats */ @@ -2974,19 +2977,19 @@ balance_l34_tx_burst(uint8_t vlan_enabled, uint8_t ipv4, nb_tx_2); /* Put all members down and try and transmit */ - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { virtual_ethdev_simulate_link_status_interrupt( test_params->member_port_ids[i], 0); } - /* Send burst on bonded port */ + /* Send burst on bonding port */ TEST_ASSERT_EQUAL(rte_eth_tx_burst( - test_params->bonded_port_id, 0, pkts_burst_1, + test_params->bonding_port_id, 0, pkts_burst_1, burst_size_1), 0, "Expected zero packet"); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -3043,13 +3046,13 @@ test_balance_tx_burst_member_tx_fail(void) int i, first_tx_fail_idx, tx_count_1, tx_count_2; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_BALANCE, 0, TEST_BAL_MEMBER_TX_FAIL_MEMBER_COUNT, 1), - "Failed to initialise bonded device"); + "Failed to initialise bonding device"); TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set( - test_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER2), + test_params->bonding_port_id, BALANCE_XMIT_POLICY_LAYER2), "Failed to set balance xmit policy."); @@ -3086,7 +3089,7 @@ test_balance_tx_burst_member_tx_fail(void) /* Transmit burst 1 */ - tx_count_1 = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst_1, + tx_count_1 = rte_eth_tx_burst(test_params->bonding_port_id, 0, pkts_burst_1, TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_1); TEST_ASSERT_EQUAL(tx_count_1, TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_1 - @@ -3103,7 +3106,7 @@ test_balance_tx_burst_member_tx_fail(void) } /* Transmit burst 2 */ - tx_count_2 = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst_2, + tx_count_2 = rte_eth_tx_burst(test_params->bonding_port_id, 0, pkts_burst_2, TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_2); TEST_ASSERT_EQUAL(tx_count_2, TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_2, @@ -3111,15 +3114,15 @@ test_balance_tx_burst_member_tx_fail(void) tx_count_2, TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_2); - /* Verify bonded port tx stats */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding port tx stats */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)((TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_1 - TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT) + TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_2), - "Bonded Port (%d) opackets value (%u) not as expected (%d)", - test_params->bonded_port_id, (unsigned int)port_stats.opackets, + "Bonding Port (%d) opackets value (%u) not as expected (%d)", + test_params->bonding_port_id, (unsigned int)port_stats.opackets, (TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_1 - TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT) + TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_2); @@ -3157,8 +3160,8 @@ test_balance_tx_burst_member_tx_fail(void) free_mbufs(&pkts_burst_1[tx_count_1], TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } #define TEST_BALANCE_RX_BURST_MEMBER_COUNT (3) @@ -3176,10 +3179,10 @@ test_balance_rx_burst(void) memset(gen_pkt_burst, 0, sizeof(gen_pkt_burst)); - /* Initialize bonded device with 4 members in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 4 members in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_BALANCE, 0, 3, 1), - "Failed to initialise bonded device"); + "Failed to initialise bonding device"); /* Generate test bursts of packets to transmit */ for (i = 0; i < TEST_BALANCE_RX_BURST_MEMBER_COUNT; i++) { @@ -3195,23 +3198,23 @@ test_balance_rx_burst(void) &gen_pkt_burst[i][0], burst_size[i]); } - /* Call rx burst on bonded device */ - /* Send burst on bonded port */ - TEST_ASSERT_EQUAL(rte_eth_rx_burst(test_params->bonded_port_id, 0, + /* Call rx burst on bonding device */ + /* Send burst on bonding port */ + TEST_ASSERT_EQUAL(rte_eth_rx_burst(test_params->bonding_port_id, 0, rx_pkt_burst, MAX_PKT_BURST), burst_size[0] + burst_size[1] + burst_size[2], "balance rx burst failed\n"); - /* Verify bonded device rx count */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding device rx count */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)(burst_size[0] + burst_size[1] + burst_size[2]), - "Bonded Port (%d) ipackets value (%u) not as expected (%d)", - test_params->bonded_port_id, (unsigned int)port_stats.ipackets, + "Bonding Port (%d) ipackets value (%u) not as expected (%d)", + test_params->bonding_port_id, (unsigned int)port_stats.ipackets, burst_size[0] + burst_size[1] + burst_size[2]); - /* Verify bonded member devices rx counts */ + /* Verify bonding member devices rx counts */ rte_eth_stats_get(test_params->member_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[0], "Member Port (%d) ipackets value (%u) not as expected (%d)", @@ -3246,8 +3249,8 @@ test_balance_rx_burst(void) } } - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -3256,45 +3259,45 @@ test_balance_verify_promiscuous_enable_disable(void) int i; int ret; - /* Initialize bonded device with 4 members in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 4 members in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_BALANCE, 0, 4, 1), - "Failed to initialise bonded device"); + "Failed to initialise bonding device"); - ret = rte_eth_promiscuous_enable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_enable(test_params->bonding_port_id); TEST_ASSERT_SUCCESS(ret, "Failed to enable promiscuous mode for port %d: %s", - test_params->bonded_port_id, rte_strerror(-ret)); + test_params->bonding_port_id, rte_strerror(-ret)); - TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 1, + TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonding_port_id), 1, "Port (%d) promiscuous mode not enabled", - test_params->bonded_port_id); + test_params->bonding_port_id); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { TEST_ASSERT_EQUAL(rte_eth_promiscuous_get( test_params->member_port_ids[i]), 1, "Port (%d) promiscuous mode not enabled", test_params->member_port_ids[i]); } - ret = rte_eth_promiscuous_disable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_disable(test_params->bonding_port_id); TEST_ASSERT_SUCCESS(ret, "Failed to disable promiscuous mode for port %d: %s", - test_params->bonded_port_id, rte_strerror(-ret)); + test_params->bonding_port_id, rte_strerror(-ret)); - TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 0, + TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonding_port_id), 0, "Port (%d) promiscuous mode not disabled", - test_params->bonded_port_id); + test_params->bonding_port_id); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { TEST_ASSERT_EQUAL(rte_eth_promiscuous_get( test_params->member_port_ids[i]), 0, "Port (%d) promiscuous mode not disabled", test_params->member_port_ids[i]); } - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -3312,20 +3315,20 @@ test_balance_verify_mac_assignment(void) "Failed to get mac address (port %d)", test_params->member_port_ids[1]); - /* Initialize bonded device with 2 members in active backup mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 2 members in active backup mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_BALANCE, 0, 2, 1), - "Failed to initialise bonded device"); + "Failed to initialise bonding device"); - /* Verify that bonded MACs is that of first member and that the other member + /* Verify that bonding MACs is that of first member and that the other member * MAC hasn't been changed */ - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port (%d) mac address not set to that of primary port", - test_params->bonded_port_id); + "bonding port (%d) mac address not set to that of primary port", + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", @@ -3344,18 +3347,18 @@ test_balance_verify_mac_assignment(void) test_params->member_port_ids[1]); /* change primary and verify that MAC addresses haven't changed */ - TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonded_port_id, + TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonding_port_id, test_params->member_port_ids[1]), - "Failed to set bonded port (%d) primary port to (%d)\n", - test_params->bonded_port_id, test_params->member_port_ids[1]); + "Failed to set bonding port (%d) primary port to (%d)\n", + test_params->bonding_port_id, test_params->member_port_ids[1]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port (%d) mac address not set to that of primary port", - test_params->bonded_port_id); + "bonding port (%d) mac address not set to that of primary port", + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", @@ -3374,24 +3377,24 @@ test_balance_verify_mac_assignment(void) test_params->member_port_ids[1]); /* - * stop / start bonded device and verify that primary MAC address is - * propagated to bonded device and members. + * stop / start bonding device and verify that primary MAC address is + * propagated to bonding device and members. */ - TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), - "Failed to stop bonded port %u", - test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonding_port_id), + "Failed to stop bonding port %u", + test_params->bonding_port_id); - TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id), - "Failed to start bonded device"); + TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonding_port_id), + "Failed to start bonding device"); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port (%d) mac address not set to that of primary port", - test_params->bonded_port_id); + "bonding port (%d) mac address not set to that of primary port", + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", @@ -3411,22 +3414,22 @@ test_balance_verify_mac_assignment(void) /* Set explicit MAC address */ TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set( - test_params->bonded_port_id, - (struct rte_ether_addr *)bonded_mac), + test_params->bonding_port_id, + (struct rte_ether_addr *)bonding_mac), "failed to set MAC"); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr, + test_params->bonding_port_id); + TEST_ASSERT_SUCCESS(memcmp(&bonding_mac, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port (%d) mac address not set to that of bonded port", - test_params->bonded_port_id); + "bonding port (%d) mac address not set to that of bonding port", + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", test_params->member_port_ids[0]); - TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr, + TEST_ASSERT_SUCCESS(memcmp(&bonding_mac, &read_mac_addr, sizeof(read_mac_addr)), "member port (%d) mac address not as expected\n", test_params->member_port_ids[0]); @@ -3434,13 +3437,13 @@ test_balance_verify_mac_assignment(void) TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", test_params->member_port_ids[1]); - TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr, + TEST_ASSERT_SUCCESS(memcmp(&bonding_mac, &read_mac_addr, sizeof(read_mac_addr)), - "member port (%d) mac address not set to that of bonded port", + "member port (%d) mac address not set to that of bonding port", test_params->member_port_ids[1]); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } #define TEST_BALANCE_LINK_STATUS_MEMBER_COUNT (4) @@ -3458,24 +3461,24 @@ test_balance_verify_member_link_status_change_behaviour(void) memset(pkt_burst, 0, sizeof(pkt_burst)); - /* Initialize bonded device with 4 members in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 4 members in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_BALANCE, 0, TEST_BALANCE_LINK_STATUS_MEMBER_COUNT, 1), - "Failed to initialise bonded device"); + "Failed to initialise bonding device"); TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set( - test_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER2), + test_params->bonding_port_id, BALANCE_XMIT_POLICY_LAYER2), "Failed to set balance xmit policy."); /* Verify Current Members Count /Active Member Count is */ - member_count = rte_eth_bond_members_get(test_params->bonded_port_id, members, + member_count = rte_eth_bond_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(member_count, TEST_BALANCE_LINK_STATUS_MEMBER_COUNT, "Number of members (%d) is not as expected (%d).", member_count, TEST_BALANCE_LINK_STATUS_MEMBER_COUNT); - member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id, + member_count = rte_eth_bond_active_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(member_count, TEST_BALANCE_LINK_STATUS_MEMBER_COUNT, "Number of active members (%d) is not as expected (%d).", @@ -3488,7 +3491,7 @@ test_balance_verify_member_link_status_change_behaviour(void) test_params->member_port_ids[3], 0); TEST_ASSERT_EQUAL(rte_eth_bond_active_members_get( - test_params->bonded_port_id, members, RTE_MAX_ETHPORTS), 2, + test_params->bonding_port_id, members, RTE_MAX_ETHPORTS), 2, "Number of active members (%d) is not as expected (%d).", member_count, 2); @@ -3507,18 +3510,18 @@ test_balance_verify_member_link_status_change_behaviour(void) "generate_test_burst failed"); TEST_ASSERT_EQUAL(rte_eth_tx_burst( - test_params->bonded_port_id, 0, &pkt_burst[0][0], burst_size), + test_params->bonding_port_id, 0, &pkt_burst[0][0], burst_size), burst_size, "rte_eth_tx_burst failed"); TEST_ASSERT_EQUAL(rte_eth_tx_burst( - test_params->bonded_port_id, 0, &pkt_burst[1][0], burst_size), + test_params->bonding_port_id, 0, &pkt_burst[1][0], burst_size), burst_size, "rte_eth_tx_burst failed"); - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(burst_size + burst_size), "(%d) port_stats.opackets (%d) not as expected (%d).", - test_params->bonded_port_id, (int)port_stats.opackets, + test_params->bonding_port_id, (int)port_stats.opackets, burst_size + burst_size); rte_eth_stats_get(test_params->member_port_ids[0], &port_stats); @@ -3539,7 +3542,7 @@ test_balance_verify_member_link_status_change_behaviour(void) test_params->member_port_ids[2], 0); TEST_ASSERT_EQUAL(rte_eth_bond_active_members_get( - test_params->bonded_port_id, members, RTE_MAX_ETHPORTS), 1, + test_params->bonding_port_id, members, RTE_MAX_ETHPORTS), 1, "Number of active members (%d) is not as expected (%d).", member_count, 1); @@ -3548,14 +3551,14 @@ test_balance_verify_member_link_status_change_behaviour(void) "generate_test_burst failed"); TEST_ASSERT_EQUAL(rte_eth_tx_burst( - test_params->bonded_port_id, 0, &pkt_burst[1][0], burst_size), + test_params->bonding_port_id, 0, &pkt_burst[1][0], burst_size), burst_size, "rte_eth_tx_burst failed"); - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(burst_size + burst_size + burst_size), "(%d) port_stats.opackets (%d) not as expected (%d).\n", - test_params->bonded_port_id, (int)port_stats.opackets, + test_params->bonding_port_id, (int)port_stats.opackets, burst_size + burst_size + burst_size); rte_eth_stats_get(test_params->member_port_ids[0], &port_stats); @@ -3584,18 +3587,18 @@ test_balance_verify_member_link_status_change_behaviour(void) /* Verify that pkts are not received on members with link status down */ - rte_eth_rx_burst(test_params->bonded_port_id, 0, rx_pkt_burst, + rte_eth_rx_burst(test_params->bonding_port_id, 0, rx_pkt_burst, MAX_PKT_BURST); - /* Verify bonded device rx count */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding device rx count */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)(burst_size * 3), "(%d) port_stats.ipackets (%d) not as expected (%d)\n", - test_params->bonded_port_id, (int)port_stats.ipackets, + test_params->bonding_port_id, (int)port_stats.ipackets, burst_size * 3); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -3606,9 +3609,9 @@ test_broadcast_tx_burst(void) struct rte_eth_stats port_stats; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_BROADCAST, 0, 2, 1), - "Failed to initialise bonded device"); + "Failed to initialise bonding device"); initialize_eth_header(test_params->pkt_eth_hdr, (struct rte_ether_addr *)src_mac, @@ -3620,7 +3623,7 @@ test_broadcast_tx_burst(void) pktlen = initialize_ipv4_header(test_params->pkt_ipv4_hdr, src_addr, dst_addr_0, pktlen); - burst_size = 20 * test_params->bonded_member_count; + burst_size = 20 * test_params->bonding_member_count; TEST_ASSERT(burst_size < MAX_PKT_BURST, "Burst size specified is greater than supported."); @@ -3631,44 +3634,44 @@ test_broadcast_tx_burst(void) 1, test_params->pkt_udp_hdr, burst_size, PACKET_BURST_GEN_PKT_LEN, 1), burst_size, "Failed to generate packet burst"); - /* Send burst on bonded port */ - TEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonded_port_id, 0, + /* Send burst on bonding port */ + TEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonding_port_id, 0, pkts_burst, burst_size), burst_size, - "Bonded Port (%d) rx burst failed, packets transmitted value " + "Bonding Port (%d) rx burst failed, packets transmitted value " "not as expected (%d)", - test_params->bonded_port_id, burst_size); + test_params->bonding_port_id, burst_size); - /* Verify bonded port tx stats */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding port tx stats */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, - (uint64_t)burst_size * test_params->bonded_member_count, - "Bonded Port (%d) opackets value (%u) not as expected (%d)", - test_params->bonded_port_id, (unsigned int)port_stats.opackets, + (uint64_t)burst_size * test_params->bonding_member_count, + "Bonding Port (%d) opackets value (%u) not as expected (%d)", + test_params->bonding_port_id, (unsigned int)port_stats.opackets, burst_size); /* Verify member ports tx stats */ - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { rte_eth_stats_get(test_params->member_port_ids[i], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size, "Member Port (%d) opackets value (%u) not as expected (%d)\n", - test_params->bonded_port_id, + test_params->bonding_port_id, (unsigned int)port_stats.opackets, burst_size); } /* Put all members down and try and transmit */ - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { virtual_ethdev_simulate_link_status_interrupt( test_params->member_port_ids[i], 0); } - /* Send burst on bonded port */ + /* Send burst on bonding port */ TEST_ASSERT_EQUAL(rte_eth_tx_burst( - test_params->bonded_port_id, 0, pkts_burst, burst_size), 0, + test_params->bonding_port_id, 0, pkts_burst, burst_size), 0, "transmitted an unexpected number of packets"); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } @@ -3687,10 +3690,10 @@ test_broadcast_tx_burst_member_tx_fail(void) int i, tx_count; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_BROADCAST, 0, TEST_BCAST_MEMBER_TX_FAIL_MEMBER_COUNT, 1), - "Failed to initialise bonded device"); + "Failed to initialise bonding device"); /* Generate test bursts for transmission */ TEST_ASSERT_EQUAL(generate_test_burst(pkts_burst, @@ -3730,7 +3733,7 @@ test_broadcast_tx_burst_member_tx_fail(void) TEST_BCAST_MEMBER_TX_FAIL_MAX_PACKETS_COUNT); /* Transmit burst */ - tx_count = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst, + tx_count = rte_eth_tx_burst(test_params->bonding_port_id, 0, pkts_burst, TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE); TEST_ASSERT_EQUAL(tx_count, TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE - @@ -3754,7 +3757,7 @@ test_broadcast_tx_burst_member_tx_fail(void) (uint64_t)TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE - TEST_BCAST_MEMBER_TX_FAIL_MAX_PACKETS_COUNT, "Port (%d) opackets value (%u) not as expected (%d)", - test_params->bonded_port_id, (unsigned int)port_stats.opackets, + test_params->bonding_port_id, (unsigned int)port_stats.opackets, TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE - TEST_BCAST_MEMBER_TX_FAIL_MAX_PACKETS_COUNT); @@ -3765,7 +3768,7 @@ test_broadcast_tx_burst_member_tx_fail(void) (uint64_t)TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE - TEST_BCAST_MEMBER_TX_FAIL_MIN_PACKETS_COUNT, "Port (%d) opackets value (%u) not as expected (%d)", - test_params->bonded_port_id, (unsigned int)port_stats.opackets, + test_params->bonding_port_id, (unsigned int)port_stats.opackets, TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE - TEST_BCAST_MEMBER_TX_FAIL_MIN_PACKETS_COUNT); @@ -3775,7 +3778,7 @@ test_broadcast_tx_burst_member_tx_fail(void) (uint64_t)TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE - TEST_BCAST_MEMBER_TX_FAIL_MAX_PACKETS_COUNT, "Port (%d) opackets value (%u) not as expected (%d)", - test_params->bonded_port_id, (unsigned int)port_stats.opackets, + test_params->bonding_port_id, (unsigned int)port_stats.opackets, TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE - TEST_BCAST_MEMBER_TX_FAIL_MAX_PACKETS_COUNT); @@ -3788,8 +3791,8 @@ test_broadcast_tx_burst_member_tx_fail(void) free_mbufs(&pkts_burst[tx_count], TEST_BCAST_MEMBER_TX_FAIL_MIN_PACKETS_COUNT); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } #define BROADCAST_RX_BURST_NUM_OF_MEMBERS (3) @@ -3807,10 +3810,10 @@ test_broadcast_rx_burst(void) memset(gen_pkt_burst, 0, sizeof(gen_pkt_burst)); - /* Initialize bonded device with 4 members in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 4 members in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_BROADCAST, 0, 3, 1), - "Failed to initialise bonded device"); + "Failed to initialise bonding device"); /* Generate test bursts of packets to transmit */ for (i = 0; i < BROADCAST_RX_BURST_NUM_OF_MEMBERS; i++) { @@ -3826,23 +3829,23 @@ test_broadcast_rx_burst(void) } - /* Call rx burst on bonded device */ - /* Send burst on bonded port */ + /* Call rx burst on bonding device */ + /* Send burst on bonding port */ TEST_ASSERT_EQUAL(rte_eth_rx_burst( - test_params->bonded_port_id, 0, rx_pkt_burst, MAX_PKT_BURST), + test_params->bonding_port_id, 0, rx_pkt_burst, MAX_PKT_BURST), burst_size[0] + burst_size[1] + burst_size[2], "rx burst failed"); - /* Verify bonded device rx count */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding device rx count */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)(burst_size[0] + burst_size[1] + burst_size[2]), - "Bonded Port (%d) ipackets value (%u) not as expected (%d)", - test_params->bonded_port_id, (unsigned int)port_stats.ipackets, + "Bonding Port (%d) ipackets value (%u) not as expected (%d)", + test_params->bonding_port_id, (unsigned int)port_stats.ipackets, burst_size[0] + burst_size[1] + burst_size[2]); - /* Verify bonded member devices rx counts */ + /* Verify bonding member devices rx counts */ rte_eth_stats_get(test_params->member_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[0], "Member Port (%d) ipackets value (%u) not as expected (%d)", @@ -3877,8 +3880,8 @@ test_broadcast_rx_burst(void) } } - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -3887,46 +3890,46 @@ test_broadcast_verify_promiscuous_enable_disable(void) int i; int ret; - /* Initialize bonded device with 4 members in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 4 members in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_BROADCAST, 0, 4, 1), - "Failed to initialise bonded device"); + "Failed to initialise bonding device"); - ret = rte_eth_promiscuous_enable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_enable(test_params->bonding_port_id); TEST_ASSERT_SUCCESS(ret, "Failed to enable promiscuous mode for port %d: %s", - test_params->bonded_port_id, rte_strerror(-ret)); + test_params->bonding_port_id, rte_strerror(-ret)); - TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 1, + TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonding_port_id), 1, "Port (%d) promiscuous mode not enabled", - test_params->bonded_port_id); + test_params->bonding_port_id); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { TEST_ASSERT_EQUAL(rte_eth_promiscuous_get( test_params->member_port_ids[i]), 1, "Port (%d) promiscuous mode not enabled", test_params->member_port_ids[i]); } - ret = rte_eth_promiscuous_disable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_disable(test_params->bonding_port_id); TEST_ASSERT_SUCCESS(ret, "Failed to disable promiscuous mode for port %d: %s", - test_params->bonded_port_id, rte_strerror(-ret)); + test_params->bonding_port_id, rte_strerror(-ret)); - TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonded_port_id), 0, + TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(test_params->bonding_port_id), 0, "Port (%d) promiscuous mode not disabled", - test_params->bonded_port_id); + test_params->bonding_port_id); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { TEST_ASSERT_EQUAL(rte_eth_promiscuous_get( test_params->member_port_ids[i]), 0, "Port (%d) promiscuous mode not disabled", test_params->member_port_ids[i]); } - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -3946,14 +3949,14 @@ test_broadcast_verify_mac_assignment(void) "Failed to get mac address (port %d)", test_params->member_port_ids[2]); - /* Initialize bonded device with 4 members in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 4 members in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_BROADCAST, 0, 4, 1), - "Failed to initialise bonded device"); + "Failed to initialise bonding device"); - /* Verify that all MACs are the same as first member added to bonded + /* Verify that all MACs are the same as first member added to bonding * device */ - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", @@ -3965,12 +3968,12 @@ test_broadcast_verify_mac_assignment(void) } /* change primary and verify that MAC addresses haven't changed */ - TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonded_port_id, + TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonding_port_id, test_params->member_port_ids[2]), - "Failed to set bonded port (%d) primary port to (%d)", - test_params->bonded_port_id, test_params->member_port_ids[i]); + "Failed to set bonding port (%d) primary port to (%d)", + test_params->bonding_port_id, test_params->member_port_ids[i]); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", @@ -3978,31 +3981,31 @@ test_broadcast_verify_mac_assignment(void) TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), "member port (%d) mac address has changed to that of primary " - "port without stop/start toggle of bonded device", + "port without stop/start toggle of bonding device", test_params->member_port_ids[i]); } /* - * stop / start bonded device and verify that primary MAC address is - * propagated to bonded device and members. + * stop / start bonding device and verify that primary MAC address is + * propagated to bonding device and members. */ - TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), - "Failed to stop bonded port %u", - test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonding_port_id), + "Failed to stop bonding port %u", + test_params->bonding_port_id); - TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id), - "Failed to start bonded device"); + TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonding_port_id), + "Failed to start bonding device"); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port (%d) mac address not set to that of new primary port", + "bonding port (%d) mac address not set to that of new primary port", test_params->member_port_ids[i]); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", @@ -4015,32 +4018,32 @@ test_broadcast_verify_mac_assignment(void) /* Set explicit MAC address */ TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set( - test_params->bonded_port_id, - (struct rte_ether_addr *)bonded_mac), + test_params->bonding_port_id, + (struct rte_ether_addr *)bonding_mac), "Failed to set MAC address"); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr, + test_params->bonding_port_id); + TEST_ASSERT_SUCCESS(memcmp(bonding_mac, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port (%d) mac address not set to that of new primary port", + "bonding port (%d) mac address not set to that of new primary port", test_params->member_port_ids[i]); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", test_params->member_port_ids[i]); - TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr, + TEST_ASSERT_SUCCESS(memcmp(bonding_mac, &read_mac_addr, sizeof(read_mac_addr)), "member port (%d) mac address not set to that of new primary " "port", test_params->member_port_ids[i]); } - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } #define BROADCAST_LINK_STATUS_NUM_OF_MEMBERS (4) @@ -4057,19 +4060,19 @@ test_broadcast_verify_member_link_status_change_behaviour(void) memset(pkt_burst, 0, sizeof(pkt_burst)); - /* Initialize bonded device with 4 members in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 4 members in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_BROADCAST, 0, BROADCAST_LINK_STATUS_NUM_OF_MEMBERS, - 1), "Failed to initialise bonded device"); + 1), "Failed to initialise bonding device"); /* Verify Current Members Count /Active Member Count is */ - member_count = rte_eth_bond_members_get(test_params->bonded_port_id, members, + member_count = rte_eth_bond_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(member_count, 4, "Number of members (%d) is not as expected (%d).", member_count, 4); - member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id, + member_count = rte_eth_bond_active_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(member_count, 4, "Number of active members (%d) is not as expected (%d).", @@ -4081,13 +4084,13 @@ test_broadcast_verify_member_link_status_change_behaviour(void) virtual_ethdev_simulate_link_status_interrupt( test_params->member_port_ids[3], 0); - member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id, + member_count = rte_eth_bond_active_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(member_count, 2, "Number of active members (%d) is not as expected (%d).", member_count, 2); - for (i = 0; i < test_params->bonded_member_count; i++) + for (i = 0; i < test_params->bonding_member_count; i++) rte_eth_stats_reset(test_params->member_port_ids[i]); /* Verify that pkts are not sent on members with link status down */ @@ -4097,14 +4100,14 @@ test_broadcast_verify_member_link_status_change_behaviour(void) &pkt_burst[0][0], burst_size, 0, 0, 1, 0, 0), burst_size, "generate_test_burst failed"); - TEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonded_port_id, 0, + TEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonding_port_id, 0, &pkt_burst[0][0], burst_size), burst_size, "rte_eth_tx_burst failed\n"); - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(burst_size * member_count), "(%d) port_stats.opackets (%d) not as expected (%d)\n", - test_params->bonded_port_id, (int)port_stats.opackets, + test_params->bonding_port_id, (int)port_stats.opackets, burst_size * member_count); rte_eth_stats_get(test_params->member_port_ids[0], &port_stats); @@ -4140,43 +4143,43 @@ test_broadcast_verify_member_link_status_change_behaviour(void) /* Verify that pkts are not received on members with link status down */ TEST_ASSERT_EQUAL(rte_eth_rx_burst( - test_params->bonded_port_id, 0, rx_pkt_burst, MAX_PKT_BURST), + test_params->bonding_port_id, 0, rx_pkt_burst, MAX_PKT_BURST), burst_size + burst_size, "rte_eth_rx_burst failed"); - /* Verify bonded device rx count */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding device rx count */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)(burst_size + burst_size), "(%d) port_stats.ipackets not as expected\n", - test_params->bonded_port_id); + test_params->bonding_port_id); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int -test_reconfigure_bonded_device(void) +test_reconfigure_bonding_device(void) { test_params->nb_rx_q = 4; test_params->nb_tx_q = 4; - TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 0, 0), - "failed to reconfigure bonded device"); + TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonding_port_id, 0, 0), + "failed to reconfigure bonding device"); test_params->nb_rx_q = 2; test_params->nb_tx_q = 2; - TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 0, 0), - "failed to reconfigure bonded device with less rx/tx queues"); + TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonding_port_id, 0, 0), + "failed to reconfigure bonding device with less rx/tx queues"); return 0; } static int -test_close_bonded_device(void) +test_close_bonding_device(void) { - rte_eth_dev_close(test_params->bonded_port_id); + rte_eth_dev_close(test_params->bonding_port_id); return 0; } @@ -4186,8 +4189,8 @@ testsuite_teardown(void) free(test_params->pkt_eth_hdr); test_params->pkt_eth_hdr = NULL; - /* Clean up and remove members from bonded device */ - remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + remove_members_and_stop_bonding_device(); } static void @@ -4197,7 +4200,7 @@ free_virtualpmd_tx_queue(void) struct rte_mbuf *pkts_to_free[MAX_PKT_BURST]; /* Free tx queue of virtual pmd */ - for (member_port = 0; member_port < test_params->bonded_member_count; + for (member_port = 0; member_port < test_params->bonding_member_count; member_port++) { to_free_cnt = virtual_ethdev_get_mbufs_from_tx_queue( test_params->member_port_ids[member_port], @@ -4217,11 +4220,11 @@ test_tlb_tx_burst(void) uint64_t sum_ports_opackets = 0, all_bond_opackets = 0, all_bond_obytes = 0; uint16_t pktlen; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members (BONDING_MODE_TLB, 1, 3, 1), - "Failed to initialise bonded device"); + "Failed to initialise bonding device"); - burst_size = 20 * test_params->bonded_member_count; + burst_size = 20 * test_params->bonding_member_count; TEST_ASSERT(burst_size < MAX_PKT_BURST, "Burst size specified is greater than supported.\n"); @@ -4248,8 +4251,8 @@ test_tlb_tx_burst(void) generate_packet_burst(test_params->mbuf_pool, pkt_burst, test_params->pkt_eth_hdr, 0, test_params->pkt_ipv4_hdr, 1, test_params->pkt_udp_hdr, burst_size, 60, 1); - /* Send burst on bonded port */ - nb_tx = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkt_burst, + /* Send burst on bonding port */ + nb_tx = rte_eth_tx_burst(test_params->bonding_port_id, 0, pkt_burst, burst_size); nb_tx2 += nb_tx; @@ -4262,20 +4265,20 @@ test_tlb_tx_burst(void) } - /* Verify bonded port tx stats */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats[0]); + /* Verify bonding port tx stats */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats[0]); all_bond_opackets = port_stats[0].opackets; all_bond_obytes = port_stats[0].obytes; TEST_ASSERT_EQUAL(port_stats[0].opackets, (uint64_t)nb_tx2, - "Bonded Port (%d) opackets value (%u) not as expected (%d)\n", - test_params->bonded_port_id, (unsigned int)port_stats[0].opackets, + "Bonding Port (%d) opackets value (%u) not as expected (%d)\n", + test_params->bonding_port_id, (unsigned int)port_stats[0].opackets, burst_size); /* Verify member ports tx stats */ - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { rte_eth_stats_get(test_params->member_port_ids[i], &port_stats[i]); sum_ports_opackets += port_stats[i].opackets; } @@ -4284,25 +4287,25 @@ test_tlb_tx_burst(void) "Total packets sent by members is not equal to packets sent by bond interface"); /* checking if distribution of packets is balanced over members */ - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { TEST_ASSERT(port_stats[i].obytes > 0 && port_stats[i].obytes < all_bond_obytes, "Packets are not balanced over members"); } /* Put all members down and try and transmit */ - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { virtual_ethdev_simulate_link_status_interrupt( test_params->member_port_ids[i], 0); } - /* Send burst on bonded port */ - nb_tx = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkt_burst, + /* Send burst on bonding port */ + nb_tx = rte_eth_tx_burst(test_params->bonding_port_id, 0, pkt_burst, burst_size); TEST_ASSERT_EQUAL(nb_tx, 0, " bad number of packet in burst"); - /* Clean ugit checkout masterp and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean ugit checkout masterp and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } #define TEST_ADAPTIVE_TLB_RX_BURST_MEMBER_COUNT (4) @@ -4319,19 +4322,19 @@ test_tlb_rx_burst(void) uint16_t i, j, nb_rx, burst_size = 17; - /* Initialize bonded device with 4 members in transmit load balancing mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 4 members in transmit load balancing mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_TLB, TEST_ADAPTIVE_TLB_RX_BURST_MEMBER_COUNT, 1, 1), - "Failed to initialize bonded device"); + "Failed to initialize bonding device"); - primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); + primary_port = rte_eth_bond_primary_get(test_params->bonding_port_id); TEST_ASSERT(primary_port >= 0, - "failed to get primary member for bonded port (%d)", - test_params->bonded_port_id); + "failed to get primary member for bonding port (%d)", + test_params->bonding_port_id); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { /* Generate test bursts of packets to transmit */ TEST_ASSERT_EQUAL(generate_test_burst( &gen_pkt_burst[0], burst_size, 0, 1, 0, 0, 0), burst_size, @@ -4341,22 +4344,22 @@ test_tlb_rx_burst(void) virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[i], &gen_pkt_burst[0], burst_size); - /* Call rx burst on bonded device */ - nb_rx = rte_eth_rx_burst(test_params->bonded_port_id, 0, + /* Call rx burst on bonding device */ + nb_rx = rte_eth_rx_burst(test_params->bonding_port_id, 0, &rx_pkt_burst[0], MAX_PKT_BURST); TEST_ASSERT_EQUAL(nb_rx, burst_size, "rte_eth_rx_burst failed\n"); if (test_params->member_port_ids[i] == primary_port) { - /* Verify bonded device rx count */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding device rx count */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size, - "Bonded Port (%d) ipackets value (%u) not as expected (%d)\n", - test_params->bonded_port_id, + "Bonding Port (%d) ipackets value (%u) not as expected (%d)\n", + test_params->bonding_port_id, (unsigned int)port_stats.ipackets, burst_size); - /* Verify bonded member devices rx count */ - for (j = 0; j < test_params->bonded_member_count; j++) { + /* Verify bonding member devices rx count */ + for (j = 0; j < test_params->bonding_member_count; j++) { rte_eth_stats_get(test_params->member_port_ids[j], &port_stats); if (i == j) { TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size, @@ -4371,7 +4374,7 @@ test_tlb_rx_burst(void) } } } else { - for (j = 0; j < test_params->bonded_member_count; j++) { + for (j = 0; j < test_params->bonding_member_count; j++) { rte_eth_stats_get(test_params->member_port_ids[j], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)0, "Member Port (%d) ipackets value (%u) not as expected (%d)\n", @@ -4384,12 +4387,12 @@ test_tlb_rx_burst(void) for (i = 0; i < burst_size; i++) rte_pktmbuf_free(rx_pkt_burst[i]); - /* reset bonded device stats */ - rte_eth_stats_reset(test_params->bonded_port_id); + /* reset bonding device stats */ + rte_eth_stats_reset(test_params->bonding_port_id); } - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -4398,51 +4401,51 @@ test_tlb_verify_promiscuous_enable_disable(void) int i, primary_port, promiscuous_en; int ret; - /* Initialize bonded device with 4 members in transmit load balancing mode */ - TEST_ASSERT_SUCCESS( initialize_bonded_device_with_members( + /* Initialize bonding device with 4 members in transmit load balancing mode */ + TEST_ASSERT_SUCCESS( initialize_bonding_device_with_members( BONDING_MODE_TLB, 0, 4, 1), - "Failed to initialize bonded device"); + "Failed to initialize bonding device"); - primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); + primary_port = rte_eth_bond_primary_get(test_params->bonding_port_id); TEST_ASSERT(primary_port >= 0, - "failed to get primary member for bonded port (%d)", - test_params->bonded_port_id); + "failed to get primary member for bonding port (%d)", + test_params->bonding_port_id); - ret = rte_eth_promiscuous_enable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_enable(test_params->bonding_port_id); TEST_ASSERT_SUCCESS(ret, "Failed to enable promiscuous mode for port %d: %s", - test_params->bonded_port_id, rte_strerror(-ret)); + test_params->bonding_port_id, rte_strerror(-ret)); - promiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id); + promiscuous_en = rte_eth_promiscuous_get(test_params->bonding_port_id); TEST_ASSERT_EQUAL(promiscuous_en, (int)1, "Port (%d) promiscuous mode not enabled\n", - test_params->bonded_port_id); - for (i = 0; i < test_params->bonded_member_count; i++) { + test_params->bonding_port_id); + for (i = 0; i < test_params->bonding_member_count; i++) { promiscuous_en = rte_eth_promiscuous_get( test_params->member_port_ids[i]); if (primary_port == test_params->member_port_ids[i]) { TEST_ASSERT_EQUAL(promiscuous_en, (int)1, "Port (%d) promiscuous mode not enabled\n", - test_params->bonded_port_id); + test_params->bonding_port_id); } else { TEST_ASSERT_EQUAL(promiscuous_en, (int)0, "Port (%d) promiscuous mode enabled\n", - test_params->bonded_port_id); + test_params->bonding_port_id); } } - ret = rte_eth_promiscuous_disable(test_params->bonded_port_id); + ret = rte_eth_promiscuous_disable(test_params->bonding_port_id); TEST_ASSERT_SUCCESS(ret, "Failed to disable promiscuous mode for port %d: %s\n", - test_params->bonded_port_id, rte_strerror(-ret)); + test_params->bonding_port_id, rte_strerror(-ret)); - promiscuous_en = rte_eth_promiscuous_get(test_params->bonded_port_id); + promiscuous_en = rte_eth_promiscuous_get(test_params->bonding_port_id); TEST_ASSERT_EQUAL(promiscuous_en, (int)0, "Port (%d) promiscuous mode not disabled\n", - test_params->bonded_port_id); + test_params->bonding_port_id); - for (i = 0; i < test_params->bonded_member_count; i++) { + for (i = 0; i < test_params->bonding_member_count; i++) { promiscuous_en = rte_eth_promiscuous_get( test_params->member_port_ids[i]); TEST_ASSERT_EQUAL(promiscuous_en, (int)0, @@ -4450,8 +4453,8 @@ test_tlb_verify_promiscuous_enable_disable(void) test_params->member_port_ids[i]); } - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -4469,22 +4472,22 @@ test_tlb_verify_mac_assignment(void) "Failed to get mac address (port %d)", test_params->member_port_ids[1]); - /* Initialize bonded device with 2 members in active backup mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 2 members in active backup mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_TLB, 0, 2, 1), - "Failed to initialize bonded device"); + "Failed to initialize bonding device"); /* - * Verify that bonded MACs is that of first member and that the other member + * Verify that bonding MACs is that of first member and that the other member * MAC hasn't been changed. */ - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port (%d) mac address not set to that of primary port", - test_params->bonded_port_id); + "bonding port (%d) mac address not set to that of primary port", + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", @@ -4503,18 +4506,18 @@ test_tlb_verify_mac_assignment(void) test_params->member_port_ids[1]); /* change primary and verify that MAC addresses haven't changed */ - TEST_ASSERT_EQUAL(rte_eth_bond_primary_set(test_params->bonded_port_id, + TEST_ASSERT_EQUAL(rte_eth_bond_primary_set(test_params->bonding_port_id, test_params->member_port_ids[1]), 0, - "Failed to set bonded port (%d) primary port to (%d)", - test_params->bonded_port_id, test_params->member_port_ids[1]); + "Failed to set bonding port (%d) primary port to (%d)", + test_params->bonding_port_id, test_params->member_port_ids[1]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port (%d) mac address not set to that of primary port", - test_params->bonded_port_id); + "bonding port (%d) mac address not set to that of primary port", + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", @@ -4533,24 +4536,24 @@ test_tlb_verify_mac_assignment(void) test_params->member_port_ids[1]); /* - * stop / start bonded device and verify that primary MAC address is - * propagated to bonded device and members. + * stop / start bonding device and verify that primary MAC address is + * propagated to bonding device and members. */ - TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), - "Failed to stop bonded port %u", - test_params->bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonding_port_id), + "Failed to stop bonding port %u", + test_params->bonding_port_id); - TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id), + TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonding_port_id), "Failed to start device"); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port (%d) mac address not set to that of primary port", - test_params->bonded_port_id); + "bonding port (%d) mac address not set to that of primary port", + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", @@ -4571,17 +4574,17 @@ test_tlb_verify_mac_assignment(void) /* Set explicit MAC address */ TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set( - test_params->bonded_port_id, - (struct rte_ether_addr *)bonded_mac), + test_params->bonding_port_id, + (struct rte_ether_addr *)bonding_mac), "failed to set MAC address"); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonding_port_id, &read_mac_addr), "Failed to get mac address (port %d)", - test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr, + test_params->bonding_port_id); + TEST_ASSERT_SUCCESS(memcmp(&bonding_mac, &read_mac_addr, sizeof(read_mac_addr)), - "bonded port (%d) mac address not set to that of bonded port", - test_params->bonded_port_id); + "bonding port (%d) mac address not set to that of bonding port", + test_params->bonding_port_id); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", @@ -4594,13 +4597,13 @@ test_tlb_verify_mac_assignment(void) TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", test_params->member_port_ids[1]); - TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr, + TEST_ASSERT_SUCCESS(memcmp(&bonding_mac, &read_mac_addr, sizeof(read_mac_addr)), - "member port (%d) mac address not set to that of bonded port", + "member port (%d) mac address not set to that of bonding port", test_params->member_port_ids[1]); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } static int @@ -4620,26 +4623,26 @@ test_tlb_verify_member_link_status_change_failover(void) - /* Initialize bonded device with 4 members in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members( + /* Initialize bonding device with 4 members in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonding_device_with_members( BONDING_MODE_TLB, 0, TEST_ADAPTIVE_TLB_RX_BURST_MEMBER_COUNT, 1), - "Failed to initialize bonded device with members"); + "Failed to initialize bonding device with members"); /* Verify Current Members Count /Active Member Count is */ - member_count = rte_eth_bond_members_get(test_params->bonded_port_id, members, + member_count = rte_eth_bond_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(member_count, 4, "Number of members (%d) is not as expected (%d).\n", member_count, 4); - member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id, + member_count = rte_eth_bond_active_members_get(test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); TEST_ASSERT_EQUAL(member_count, 4, "Number of members (%d) is not as expected (%d).\n", member_count, 4); - primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); + primary_port = rte_eth_bond_primary_get(test_params->bonding_port_id); TEST_ASSERT_EQUAL(primary_port, test_params->member_port_ids[0], "Primary port not as expected"); @@ -4650,7 +4653,7 @@ test_tlb_verify_member_link_status_change_failover(void) test_params->member_port_ids[3], 0); TEST_ASSERT_EQUAL(rte_eth_bond_active_members_get( - test_params->bonded_port_id, members, RTE_MAX_ETHPORTS), 2, + test_params->bonding_port_id, members, RTE_MAX_ETHPORTS), 2, "Number of active members (%d) is not as expected (%d).", member_count, 2); @@ -4668,11 +4671,11 @@ test_tlb_verify_member_link_status_change_failover(void) test_params->member_port_ids[0], 0); TEST_ASSERT_EQUAL(rte_eth_bond_active_members_get( - test_params->bonded_port_id, members, RTE_MAX_ETHPORTS), 3, + test_params->bonding_port_id, members, RTE_MAX_ETHPORTS), 3, "Number of active members (%d) is not as expected (%d).", member_count, 3); - primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); + primary_port = rte_eth_bond_primary_get(test_params->bonding_port_id); TEST_ASSERT_EQUAL(primary_port, test_params->member_port_ids[2], "Primary port not as expected"); rte_delay_us(500000); @@ -4682,7 +4685,8 @@ test_tlb_verify_member_link_status_change_failover(void) &pkt_burst[0][0], burst_size, 0, 1, 0, 0, 0), burst_size, "generate_test_burst failed\n"); TEST_ASSERT_EQUAL(rte_eth_tx_burst( - test_params->bonded_port_id, 0, &pkt_burst[0][0], burst_size), burst_size, + test_params->bonding_port_id, 0, &pkt_burst[0][0], burst_size), + burst_size, "rte_eth_tx_burst failed\n"); rte_delay_us(11000); } @@ -4719,21 +4723,21 @@ test_tlb_verify_member_link_status_change_failover(void) test_params->member_port_ids[i], &pkt_burst[i][0], burst_size); } - if (rte_eth_rx_burst(test_params->bonded_port_id, 0, rx_pkt_burst, + if (rte_eth_rx_burst(test_params->bonding_port_id, 0, rx_pkt_burst, MAX_PKT_BURST) != burst_size) { printf("rte_eth_rx_burst\n"); return -1; } - /* Verify bonded device rx count */ - rte_eth_stats_get(test_params->bonded_port_id, &port_stats); + /* Verify bonding device rx count */ + rte_eth_stats_get(test_params->bonding_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size, "(%d) port_stats.ipackets not as expected\n", - test_params->bonded_port_id); + test_params->bonding_port_id); - /* Clean up and remove members from bonded device */ - return remove_members_and_stop_bonded_device(); + /* Clean up and remove members from bonding device */ + return remove_members_and_stop_bonding_device(); } #define TEST_ALB_MEMBER_COUNT 2 @@ -4765,13 +4769,13 @@ test_alb_change_mac_in_reply_sent(void) struct rte_ether_addr *member_mac1, *member_mac2; TEST_ASSERT_SUCCESS( - initialize_bonded_device_with_members(BONDING_MODE_ALB, + initialize_bonding_device_with_members(BONDING_MODE_ALB, 0, TEST_ALB_MEMBER_COUNT, 1), - "Failed to initialize_bonded_device_with_members."); + "Failed to initialize_bonding_device_with_members."); /* Flush tx queue */ - rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0); - for (member_idx = 0; member_idx < test_params->bonded_member_count; + rte_eth_tx_burst(test_params->bonding_port_id, 0, NULL, 0); + for (member_idx = 0; member_idx < test_params->bonding_member_count; member_idx++) { nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue( test_params->member_port_ids[member_idx], pkts_sent, @@ -4779,7 +4783,7 @@ test_alb_change_mac_in_reply_sent(void) } rte_ether_addr_copy( - rte_eth_devices[test_params->bonded_port_id].data->mac_addrs, + rte_eth_devices[test_params->bonding_port_id].data->mac_addrs, &bond_mac); /* @@ -4795,7 +4799,7 @@ test_alb_change_mac_in_reply_sent(void) sizeof(struct rte_ether_hdr)); initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client1, RTE_ARP_OP_REPLY); - rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1); + rte_eth_tx_burst(test_params->bonding_port_id, 0, &pkt, 1); pkt = rte_pktmbuf_alloc(test_params->mbuf_pool); memcpy(client_mac.addr_bytes, mac_client2, RTE_ETHER_ADDR_LEN); @@ -4806,7 +4810,7 @@ test_alb_change_mac_in_reply_sent(void) sizeof(struct rte_ether_hdr)); initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client2, RTE_ARP_OP_REPLY); - rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1); + rte_eth_tx_burst(test_params->bonding_port_id, 0, &pkt, 1); pkt = rte_pktmbuf_alloc(test_params->mbuf_pool); memcpy(client_mac.addr_bytes, mac_client3, RTE_ETHER_ADDR_LEN); @@ -4817,7 +4821,7 @@ test_alb_change_mac_in_reply_sent(void) sizeof(struct rte_ether_hdr)); initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client3, RTE_ARP_OP_REPLY); - rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1); + rte_eth_tx_burst(test_params->bonding_port_id, 0, &pkt, 1); pkt = rte_pktmbuf_alloc(test_params->mbuf_pool); memcpy(client_mac.addr_bytes, mac_client4, RTE_ETHER_ADDR_LEN); @@ -4828,7 +4832,7 @@ test_alb_change_mac_in_reply_sent(void) sizeof(struct rte_ether_hdr)); initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client4, RTE_ARP_OP_REPLY); - rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1); + rte_eth_tx_burst(test_params->bonding_port_id, 0, &pkt, 1); member_mac1 = rte_eth_devices[test_params->member_port_ids[0]].data->mac_addrs; @@ -4839,7 +4843,7 @@ test_alb_change_mac_in_reply_sent(void) * Checking if packets are properly distributed on bonding ports. Packets * 0 and 2 should be sent on port 0 and packets 1 and 3 on port 1. */ - for (member_idx = 0; member_idx < test_params->bonded_member_count; member_idx++) { + for (member_idx = 0; member_idx < test_params->bonding_member_count; member_idx++) { nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue( test_params->member_port_ids[member_idx], pkts_sent, MAX_PKT_BURST); @@ -4867,7 +4871,7 @@ test_alb_change_mac_in_reply_sent(void) } test_end: - retval += remove_members_and_stop_bonded_device(); + retval += remove_members_and_stop_bonding_device(); return retval; } @@ -4887,20 +4891,20 @@ test_alb_reply_from_client(void) struct rte_ether_addr *member_mac1, *member_mac2; TEST_ASSERT_SUCCESS( - initialize_bonded_device_with_members(BONDING_MODE_ALB, + initialize_bonding_device_with_members(BONDING_MODE_ALB, 0, TEST_ALB_MEMBER_COUNT, 1), - "Failed to initialize_bonded_device_with_members."); + "Failed to initialize_bonding_device_with_members."); /* Flush tx queue */ - rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0); - for (member_idx = 0; member_idx < test_params->bonded_member_count; member_idx++) { + rte_eth_tx_burst(test_params->bonding_port_id, 0, NULL, 0); + for (member_idx = 0; member_idx < test_params->bonding_member_count; member_idx++) { nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue( test_params->member_port_ids[member_idx], pkts_sent, MAX_PKT_BURST); } rte_ether_addr_copy( - rte_eth_devices[test_params->bonded_port_id].data->mac_addrs, + rte_eth_devices[test_params->bonding_port_id].data->mac_addrs, &bond_mac); /* @@ -4959,8 +4963,8 @@ test_alb_reply_from_client(void) * Issue rx_burst and tx_burst to force bonding driver to send update ARP * packets to every client in alb table. */ - rte_eth_rx_burst(test_params->bonded_port_id, 0, pkts_sent, MAX_PKT_BURST); - rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0); + rte_eth_rx_burst(test_params->bonding_port_id, 0, pkts_sent, MAX_PKT_BURST); + rte_eth_tx_burst(test_params->bonding_port_id, 0, NULL, 0); member_mac1 = rte_eth_devices[test_params->member_port_ids[0]].data->mac_addrs; member_mac2 = rte_eth_devices[test_params->member_port_ids[1]].data->mac_addrs; @@ -4968,7 +4972,7 @@ test_alb_reply_from_client(void) /* * Checking if update ARP packets were properly send on member ports. */ - for (member_idx = 0; member_idx < test_params->bonded_member_count; member_idx++) { + for (member_idx = 0; member_idx < test_params->bonding_member_count; member_idx++) { nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue( test_params->member_port_ids[member_idx], pkts_sent, MAX_PKT_BURST); nb_pkts_sum += nb_pkts; @@ -5002,7 +5006,7 @@ test_alb_reply_from_client(void) } test_end: - retval += remove_members_and_stop_bonded_device(); + retval += remove_members_and_stop_bonding_device(); return retval; } @@ -5022,20 +5026,20 @@ test_alb_receive_vlan_reply(void) struct rte_ether_addr bond_mac, client_mac; TEST_ASSERT_SUCCESS( - initialize_bonded_device_with_members(BONDING_MODE_ALB, + initialize_bonding_device_with_members(BONDING_MODE_ALB, 0, TEST_ALB_MEMBER_COUNT, 1), - "Failed to initialize_bonded_device_with_members."); + "Failed to initialize_bonding_device_with_members."); /* Flush tx queue */ - rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0); - for (member_idx = 0; member_idx < test_params->bonded_member_count; member_idx++) { + rte_eth_tx_burst(test_params->bonding_port_id, 0, NULL, 0); + for (member_idx = 0; member_idx < test_params->bonding_member_count; member_idx++) { nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue( test_params->member_port_ids[member_idx], pkts_sent, MAX_PKT_BURST); } rte_ether_addr_copy( - rte_eth_devices[test_params->bonded_port_id].data->mac_addrs, + rte_eth_devices[test_params->bonding_port_id].data->mac_addrs, &bond_mac); /* @@ -5058,13 +5062,13 @@ test_alb_receive_vlan_reply(void) virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[0], &pkt, 1); - rte_eth_rx_burst(test_params->bonded_port_id, 0, pkts_sent, MAX_PKT_BURST); - rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0); + rte_eth_rx_burst(test_params->bonding_port_id, 0, pkts_sent, MAX_PKT_BURST); + rte_eth_tx_burst(test_params->bonding_port_id, 0, NULL, 0); /* * Checking if VLAN headers in generated ARP Update packet are correct. */ - for (member_idx = 0; member_idx < test_params->bonded_member_count; member_idx++) { + for (member_idx = 0; member_idx < test_params->bonding_member_count; member_idx++) { nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue( test_params->member_port_ids[member_idx], pkts_sent, MAX_PKT_BURST); @@ -5097,7 +5101,7 @@ test_alb_receive_vlan_reply(void) } test_end: - retval += remove_members_and_stop_bonded_device(); + retval += remove_members_and_stop_bonding_device(); return retval; } @@ -5110,9 +5114,9 @@ test_alb_ipv4_tx(void) retval = 0; TEST_ASSERT_SUCCESS( - initialize_bonded_device_with_members(BONDING_MODE_ALB, + initialize_bonding_device_with_members(BONDING_MODE_ALB, 0, TEST_ALB_MEMBER_COUNT, 1), - "Failed to initialize_bonded_device_with_members."); + "Failed to initialize_bonding_device_with_members."); burst_size = 32; @@ -5126,14 +5130,14 @@ test_alb_ipv4_tx(void) * Checking if ipv4 traffic is transmitted via TLB policy. */ pkts_send = rte_eth_tx_burst( - test_params->bonded_port_id, 0, pkt_burst, burst_size); + test_params->bonding_port_id, 0, pkt_burst, burst_size); if (pkts_send != burst_size) { retval = -1; goto test_end; } test_end: - retval += remove_members_and_stop_bonded_device(); + retval += remove_members_and_stop_bonding_device(); return retval; } @@ -5142,23 +5146,23 @@ static struct unit_test_suite link_bonding_test_suite = { .setup = test_setup, .teardown = testsuite_teardown, .unit_test_cases = { - TEST_CASE(test_create_bonded_device), - TEST_CASE(test_create_bonded_device_with_invalid_params), - TEST_CASE(test_add_member_to_bonded_device), - TEST_CASE(test_add_member_to_invalid_bonded_device), - TEST_CASE(test_remove_member_from_bonded_device), - TEST_CASE(test_remove_member_from_invalid_bonded_device), - TEST_CASE(test_get_members_from_bonded_device), - TEST_CASE(test_add_already_bonded_member_to_bonded_device), - TEST_CASE(test_add_remove_multiple_members_to_from_bonded_device), - TEST_CASE(test_start_bonded_device), - TEST_CASE(test_stop_bonded_device), + TEST_CASE(test_create_bonding_device), + TEST_CASE(test_create_bonding_device_with_invalid_params), + TEST_CASE(test_add_member_to_bonding_device), + TEST_CASE(test_add_member_to_invalid_bonding_device), + TEST_CASE(test_remove_member_from_bonding_device), + TEST_CASE(test_remove_member_from_invalid_bonding_device), + TEST_CASE(test_get_members_from_bonding_device), + TEST_CASE(test_add_already_bonding_member_to_bonding_device), + TEST_CASE(test_add_remove_multiple_members_to_from_bonding_device), + TEST_CASE(test_start_bonding_device), + TEST_CASE(test_stop_bonding_device), TEST_CASE(test_set_bonding_mode), TEST_CASE(test_set_primary_member), - TEST_CASE(test_set_explicit_bonded_mac), - TEST_CASE(test_set_bonded_port_initialization_mac_assignment), + TEST_CASE(test_set_explicit_bonding_mac), + TEST_CASE(test_set_bonding_port_initialization_mac_assignment), TEST_CASE(test_status_interrupt), - TEST_CASE(test_adding_member_after_bonded_device_started), + TEST_CASE(test_adding_member_after_bonding_device_started), TEST_CASE(test_roundrobin_tx_burst), TEST_CASE(test_roundrobin_tx_burst_member_tx_fail), TEST_CASE(test_roundrobin_rx_burst_on_single_member), @@ -5205,8 +5209,8 @@ static struct unit_test_suite link_bonding_test_suite = { TEST_CASE(test_broadcast_verify_promiscuous_enable_disable), TEST_CASE(test_broadcast_verify_mac_assignment), TEST_CASE(test_broadcast_verify_member_link_status_change_behaviour), - TEST_CASE(test_reconfigure_bonded_device), - TEST_CASE(test_close_bonded_device), + TEST_CASE(test_reconfigure_bonding_device), + TEST_CASE(test_close_bonding_device), TEST_CASES_END() /**< NULL terminate unit test array */ } diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c index 2de907e7f3..f024bdf931 100644 --- a/app/test/test_link_bonding_mode4.c +++ b/app/test/test_link_bonding_mode4.c @@ -44,7 +44,7 @@ #define MAX_PKT_BURST (32) #define DEF_PKT_BURST (16) -#define BONDED_DEV_NAME ("net_bonding_m4_bond_dev") +#define BONDING_DEV_NAME ("net_bonding_m4_bond_dev") #define MEMBER_DEV_NAME_FMT ("net_virt_%d") #define MEMBER_RX_QUEUE_FMT ("net_virt_%d_rx") @@ -74,7 +74,7 @@ struct member_conf { struct rte_ring *rx_queue; struct rte_ring *tx_queue; uint16_t port_id; - uint8_t bonded : 1; + uint8_t bonding : 1; uint8_t lacp_parnter_state; }; @@ -85,7 +85,7 @@ struct ether_vlan_hdr { }; struct link_bonding_unittest_params { - uint8_t bonded_port_id; + uint8_t bonding_port_id; struct member_conf member_ports[MEMBER_COUNT]; struct rte_mempool *mbuf_pool; @@ -99,7 +99,7 @@ struct link_bonding_unittest_params { #define TEST_PROMISC_MEMBER_COUNT TEST_DEFAULT_MEMBER_COUNT static struct link_bonding_unittest_params test_params = { - .bonded_port_id = INVALID_PORT_ID, + .bonding_port_id = INVALID_PORT_ID, .member_ports = { [0 ... MEMBER_COUNT - 1] = { .port_id = INVALID_PORT_ID} }, .mbuf_pool = NULL, @@ -139,13 +139,13 @@ static uint8_t lacpdu_rx_count[RTE_MAX_ETHPORTS] = {0, }; #define FOR_EACH_PORT_IF(_i, _port, _condition) FOR_EACH_PORT((_i), (_port)) \ if (!!(_condition)) -/* Macro for iterating over every port that is currently a member of a bonded +/* Macro for iterating over every port that is currently a member of a bonding * device. * _i variable used as an index in test_params->member_ports * _member pointer to &test_params->member_ports[_idx] * */ #define FOR_EACH_MEMBER(_i, _member) \ - FOR_EACH_PORT_IF(_i, _member, (_member)->bonded != 0) + FOR_EACH_PORT_IF(_i, _member, (_member)->bonding != 0) /* * Returns packets from members TX queue. @@ -178,13 +178,13 @@ member_put_pkts(struct member_conf *member, struct rte_mbuf **buf, uint16_t size static uint16_t bond_rx(struct rte_mbuf **buf, uint16_t size) { - return rte_eth_rx_burst(test_params.bonded_port_id, 0, buf, size); + return rte_eth_rx_burst(test_params.bonding_port_id, 0, buf, size); } static uint16_t bond_tx(struct rte_mbuf **buf, uint16_t size) { - return rte_eth_tx_burst(test_params.bonded_port_id, 0, buf, size); + return rte_eth_tx_burst(test_params.bonding_port_id, 0, buf, size); } static void @@ -227,7 +227,7 @@ add_member(struct member_conf *member, uint8_t start) /* Some sanity check */ RTE_VERIFY(test_params.member_ports <= member && member - test_params.member_ports < (int)RTE_DIM(test_params.member_ports)); - RTE_VERIFY(member->bonded == 0); + RTE_VERIFY(member->bonding == 0); RTE_VERIFY(member->port_id != INVALID_PORT_ID); rte_ether_addr_copy(&member_mac_default, &addr); @@ -238,13 +238,13 @@ add_member(struct member_conf *member, uint8_t start) TEST_ASSERT_SUCCESS(rte_eth_dev_mac_addr_add(member->port_id, &addr, 0), "Failed to set member MAC address"); - TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(test_params.bonded_port_id, + TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(test_params.bonding_port_id, member->port_id), "Failed to add member (idx=%u, id=%u) to bonding (id=%u)", (uint8_t)(member - test_params.member_ports), member->port_id, - test_params.bonded_port_id); + test_params.bonding_port_id); - member->bonded = 1; + member->bonding = 1; if (start) { TEST_ASSERT_SUCCESS(rte_eth_dev_start(member->port_id), "Failed to start member %u", member->port_id); @@ -268,7 +268,7 @@ remove_member(struct member_conf *member) RTE_VERIFY(test_params.member_ports <= member && member_idx < (ptrdiff_t)RTE_DIM(test_params.member_ports)); - RTE_VERIFY(member->bonded == 1); + RTE_VERIFY(member->bonding == 1); RTE_VERIFY(member->port_id != INVALID_PORT_ID); TEST_ASSERT_EQUAL(rte_ring_count(member->rx_queue), 0, @@ -279,13 +279,13 @@ remove_member(struct member_conf *member) "Member %u tx queue not empty while removing from bonding.", member->port_id); - TEST_ASSERT_EQUAL(rte_eth_bond_member_remove(test_params.bonded_port_id, + TEST_ASSERT_EQUAL(rte_eth_bond_member_remove(test_params.bonding_port_id, member->port_id), 0, "Failed to remove member (idx=%u, id=%u) from bonding (id=%u)", (uint8_t)member_idx, member->port_id, - test_params.bonded_port_id); + test_params.bonding_port_id); - member->bonded = 0; + member->bonding = 0; member->lacp_parnter_state = 0; return 0; } @@ -309,69 +309,69 @@ lacp_recv_cb(uint16_t member_id, struct rte_mbuf *lacp_pkt) } static int -initialize_bonded_device_with_members(uint16_t member_count, uint8_t external_sm) +initialize_bonding_device_with_members(uint16_t member_count, uint8_t external_sm) { uint8_t i; int ret; - RTE_VERIFY(test_params.bonded_port_id != INVALID_PORT_ID); + RTE_VERIFY(test_params.bonding_port_id != INVALID_PORT_ID); for (i = 0; i < member_count; i++) { TEST_ASSERT_SUCCESS(add_member(&test_params.member_ports[i], 1), - "Failed to add port %u to bonded device.\n", + "Failed to add port %u to bonding device.\n", test_params.member_ports[i].port_id); } /* Reset mode 4 configuration */ - rte_eth_bond_8023ad_setup(test_params.bonded_port_id, NULL); - ret = rte_eth_promiscuous_disable(test_params.bonded_port_id); + rte_eth_bond_8023ad_setup(test_params.bonding_port_id, NULL); + ret = rte_eth_promiscuous_disable(test_params.bonding_port_id); TEST_ASSERT_SUCCESS(ret, "Failed disable promiscuous mode for port %d: %s", - test_params.bonded_port_id, rte_strerror(-ret)); + test_params.bonding_port_id, rte_strerror(-ret)); if (external_sm) { struct rte_eth_bond_8023ad_conf conf; - rte_eth_bond_8023ad_conf_get(test_params.bonded_port_id, &conf); + rte_eth_bond_8023ad_conf_get(test_params.bonding_port_id, &conf); conf.slowrx_cb = lacp_recv_cb; - rte_eth_bond_8023ad_setup(test_params.bonded_port_id, &conf); + rte_eth_bond_8023ad_setup(test_params.bonding_port_id, &conf); } - TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params.bonded_port_id), - "Failed to start bonded device"); + TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params.bonding_port_id), + "Failed to start bonding device"); return TEST_SUCCESS; } static int -remove_members_and_stop_bonded_device(void) +remove_members_and_stop_bonding_device(void) { struct member_conf *member; int retval; uint16_t members[RTE_MAX_ETHPORTS]; uint16_t i; - TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params.bonded_port_id), - "Failed to stop bonded port %u", - test_params.bonded_port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params.bonding_port_id), + "Failed to stop bonding port %u", + test_params.bonding_port_id); FOR_EACH_MEMBER(i, member) remove_member(member); - retval = rte_eth_bond_members_get(test_params.bonded_port_id, members, + retval = rte_eth_bond_members_get(test_params.bonding_port_id, members, RTE_DIM(members)); TEST_ASSERT_EQUAL(retval, 0, - "Expected bonded device %u have 0 members but returned %d.", - test_params.bonded_port_id, retval); + "Expected bonding device %u have 0 members but returned %d.", + test_params.bonding_port_id, retval); FOR_EACH_PORT(i, member) { TEST_ASSERT_SUCCESS(rte_eth_dev_stop(member->port_id), - "Failed to stop bonded port %u", + "Failed to stop bonding port %u", member->port_id); - TEST_ASSERT(member->bonded == 0, + TEST_ASSERT(member->bonding == 0, "Port id=%u is still marked as enmemberd.", member->port_id); } @@ -436,22 +436,22 @@ test_setup(void) name); } - if (test_params.bonded_port_id == INVALID_PORT_ID) { - retval = rte_eth_bond_create(BONDED_DEV_NAME, BONDING_MODE_8023AD, + if (test_params.bonding_port_id == INVALID_PORT_ID) { + retval = rte_eth_bond_create(BONDING_DEV_NAME, BONDING_MODE_8023AD, socket_id); - TEST_ASSERT(retval >= 0, "Failed to create bonded ethdev %s", - BONDED_DEV_NAME); + TEST_ASSERT(retval >= 0, "Failed to create bonding ethdev %s", + BONDING_DEV_NAME); - test_params.bonded_port_id = retval; - TEST_ASSERT_SUCCESS(configure_ethdev(test_params.bonded_port_id, 0), - "Failed to configure bonded ethdev %s", BONDED_DEV_NAME); - } else if (rte_eth_bond_mode_get(test_params.bonded_port_id) != + test_params.bonding_port_id = retval; + TEST_ASSERT_SUCCESS(configure_ethdev(test_params.bonding_port_id, 0), + "Failed to configure bonding ethdev %s", BONDING_DEV_NAME); + } else if (rte_eth_bond_mode_get(test_params.bonding_port_id) != BONDING_MODE_8023AD) { - TEST_ASSERT(rte_eth_bond_mode_set(test_params.bonded_port_id, + TEST_ASSERT(rte_eth_bond_mode_set(test_params.bonding_port_id, BONDING_MODE_8023AD) == 0, "Failed to set ethdev %d to mode %d", - test_params.bonded_port_id, BONDING_MODE_8023AD); + test_params.bonding_port_id, BONDING_MODE_8023AD); } return 0; @@ -467,7 +467,7 @@ testsuite_teardown(void) * Any cleanup/reset state is done when particular test is * started. */ - rte_eth_dev_stop(test_params.bonded_port_id); + rte_eth_dev_stop(test_params.bonding_port_id); FOR_EACH_PORT(i, port) rte_eth_dev_stop(port->port_id); @@ -586,7 +586,7 @@ bond_get_update_timeout_ms(void) { struct rte_eth_bond_8023ad_conf conf; - if (rte_eth_bond_8023ad_conf_get(test_params.bonded_port_id, &conf) < 0) { + if (rte_eth_bond_8023ad_conf_get(test_params.bonding_port_id, &conf) < 0) { RTE_LOG(DEBUG, EAL, "Failed to get bonding configuration: " "%s at %d\n", __func__, __LINE__); RTE_TEST_TRACE_FAILURE(__FILE__, __LINE__, __func__); @@ -651,14 +651,14 @@ test_mode4_lacp(void) { int retval; - retval = initialize_bonded_device_with_members(TEST_LACP_MEMBER_COUT, 0); - TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); + retval = initialize_bonding_device_with_members(TEST_LACP_MEMBER_COUT, 0); + TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonding device"); /* Test LACP handshake function */ retval = bond_handshake(); TEST_ASSERT_SUCCESS(retval, "Initial handshake failed"); - retval = remove_members_and_stop_bonded_device(); + retval = remove_members_and_stop_bonding_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); return TEST_SUCCESS; @@ -668,33 +668,33 @@ test_mode4_agg_mode_selection(void) { int retval; /* Test and verify for Stable mode */ - retval = initialize_bonded_device_with_members(TEST_LACP_MEMBER_COUT, 0); - TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); + retval = initialize_bonding_device_with_members(TEST_LACP_MEMBER_COUT, 0); + TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonding device"); retval = rte_eth_bond_8023ad_agg_selection_set( - test_params.bonded_port_id, AGG_STABLE); + test_params.bonding_port_id, AGG_STABLE); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bond aggregation mode"); retval = bond_handshake(); TEST_ASSERT_SUCCESS(retval, "Initial handshake failed"); retval = rte_eth_bond_8023ad_agg_selection_get( - test_params.bonded_port_id); + test_params.bonding_port_id); TEST_ASSERT_EQUAL(retval, AGG_STABLE, "Wrong agg mode received from bonding device"); - retval = remove_members_and_stop_bonded_device(); + retval = remove_members_and_stop_bonding_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); /* test and verify for Bandwidth mode */ - retval = initialize_bonded_device_with_members(TEST_LACP_MEMBER_COUT, 0); - TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); + retval = initialize_bonding_device_with_members(TEST_LACP_MEMBER_COUT, 0); + TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonding device"); retval = rte_eth_bond_8023ad_agg_selection_set( - test_params.bonded_port_id, + test_params.bonding_port_id, AGG_BANDWIDTH); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bond aggregation mode"); @@ -702,31 +702,31 @@ test_mode4_agg_mode_selection(void) TEST_ASSERT_SUCCESS(retval, "Initial handshake failed"); retval = rte_eth_bond_8023ad_agg_selection_get( - test_params.bonded_port_id); + test_params.bonding_port_id); TEST_ASSERT_EQUAL(retval, AGG_BANDWIDTH, "Wrong agg mode received from bonding device"); - retval = remove_members_and_stop_bonded_device(); + retval = remove_members_and_stop_bonding_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); /* test and verify selection for count mode */ - retval = initialize_bonded_device_with_members(TEST_LACP_MEMBER_COUT, 0); - TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); + retval = initialize_bonding_device_with_members(TEST_LACP_MEMBER_COUT, 0); + TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonding device"); retval = rte_eth_bond_8023ad_agg_selection_set( - test_params.bonded_port_id, AGG_COUNT); + test_params.bonding_port_id, AGG_COUNT); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bond aggregation mode"); retval = bond_handshake(); TEST_ASSERT_SUCCESS(retval, "Initial handshake failed"); retval = rte_eth_bond_8023ad_agg_selection_get( - test_params.bonded_port_id); + test_params.bonding_port_id); TEST_ASSERT_EQUAL(retval, AGG_COUNT, "Wrong agg mode received from bonding device"); - retval = remove_members_and_stop_bonded_device(); + retval = remove_members_and_stop_bonding_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); return TEST_SUCCESS; @@ -817,19 +817,19 @@ test_mode4_rx(void) struct rte_ether_addr src_mac = { { 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 } }; struct rte_ether_addr dst_mac; - struct rte_ether_addr bonded_mac; + struct rte_ether_addr bonding_mac; - retval = initialize_bonded_device_with_members(TEST_PROMISC_MEMBER_COUNT, + retval = initialize_bonding_device_with_members(TEST_PROMISC_MEMBER_COUNT, 0); - TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); + TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonding device"); retval = bond_handshake(); TEST_ASSERT_SUCCESS(retval, "Initial handshake failed"); - retval = rte_eth_macaddr_get(test_params.bonded_port_id, &bonded_mac); + retval = rte_eth_macaddr_get(test_params.bonding_port_id, &bonding_mac); TEST_ASSERT_SUCCESS(retval, "Failed to get mac address: %s", strerror(-retval)); - rte_ether_addr_copy(&bonded_mac, &dst_mac); + rte_ether_addr_copy(&bonding_mac, &dst_mac); /* Assert that dst address is not bonding address. Do not set the * least significant bit of the zero byte as this would create a @@ -840,14 +840,14 @@ test_mode4_rx(void) /* First try with promiscuous mode enabled. * Add 2 packets to each member. First with bonding MAC address, second with * different. Check if we received all of them. */ - retval = rte_eth_promiscuous_enable(test_params.bonded_port_id); + retval = rte_eth_promiscuous_enable(test_params.bonding_port_id); TEST_ASSERT_SUCCESS(retval, "Failed to enable promiscuous mode for port %d: %s", - test_params.bonded_port_id, rte_strerror(-retval)); + test_params.bonding_port_id, rte_strerror(-retval)); expected_pkts_cnt = 0; FOR_EACH_MEMBER(i, member) { - retval = generate_and_put_packets(member, &src_mac, &bonded_mac, 1); + retval = generate_and_put_packets(member, &src_mac, &bonding_mac, 1); TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to member %u", member->port_id); @@ -859,7 +859,7 @@ test_mode4_rx(void) expected_pkts_cnt += 2; } - retval = rte_eth_rx_burst(test_params.bonded_port_id, 0, pkts, + retval = rte_eth_rx_burst(test_params.bonding_port_id, 0, pkts, RTE_DIM(pkts)); if (retval == expected_pkts_cnt) { @@ -868,7 +868,7 @@ test_mode4_rx(void) for (i = 0; i < expected_pkts_cnt; i++) { hdr = rte_pktmbuf_mtod(pkts[i], struct rte_ether_hdr *); cnt[rte_is_same_ether_addr(&hdr->dst_addr, - &bonded_mac)]++; + &bonding_mac)]++; } free_pkts(pkts, expected_pkts_cnt); @@ -888,14 +888,14 @@ 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. */ - retval = rte_eth_promiscuous_disable(test_params.bonded_port_id); + retval = rte_eth_promiscuous_disable(test_params.bonding_port_id); TEST_ASSERT_SUCCESS(retval, "Failed to disable promiscuous mode for port %d: %s", - test_params.bonded_port_id, rte_strerror(-retval)); + test_params.bonding_port_id, rte_strerror(-retval)); expected_pkts_cnt = 0; FOR_EACH_MEMBER(i, member) { - retval = generate_and_put_packets(member, &src_mac, &bonded_mac, 1); + retval = generate_and_put_packets(member, &src_mac, &bonding_mac, 1); TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to member %u", member->port_id); @@ -907,7 +907,7 @@ test_mode4_rx(void) expected_pkts_cnt += 1; } - retval = rte_eth_rx_burst(test_params.bonded_port_id, 0, pkts, + retval = rte_eth_rx_burst(test_params.bonding_port_id, 0, pkts, RTE_DIM(pkts)); if (retval == expected_pkts_cnt) { @@ -916,7 +916,7 @@ test_mode4_rx(void) for (i = 0; i < expected_pkts_cnt; i++) { hdr = rte_pktmbuf_mtod(pkts[i], struct rte_ether_hdr *); eq_cnt += rte_is_same_ether_addr(&hdr->dst_addr, - &bonded_mac); + &bonding_mac); } free_pkts(pkts, expected_pkts_cnt); @@ -958,7 +958,7 @@ test_mode4_rx(void) TEST_ASSERT_SUCCESS(retval, "Failed to generate test packet burst."); src_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = member->port_id; - retval = generate_and_put_packets(member, &src_mac, &bonded_mac, 1); + retval = generate_and_put_packets(member, &src_mac, &bonding_mac, 1); TEST_ASSERT_SUCCESS(retval, "Failed to generate test packet burst."); retval = bond_rx(pkts, RTE_DIM(pkts)); @@ -989,7 +989,7 @@ test_mode4_rx(void) TEST_ASSERT(j < 5, "Failed to aggregate member after link up"); } - remove_members_and_stop_bonded_device(); + remove_members_and_stop_bonding_device(); return TEST_SUCCESS; } @@ -1006,21 +1006,21 @@ test_mode4_tx_burst(void) struct rte_ether_addr dst_mac = { { 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 } }; - struct rte_ether_addr bonded_mac; + struct rte_ether_addr bonding_mac; - retval = initialize_bonded_device_with_members(TEST_TX_MEMBER_COUNT, 0); - TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); + retval = initialize_bonding_device_with_members(TEST_TX_MEMBER_COUNT, 0); + TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonding device"); retval = bond_handshake(); TEST_ASSERT_SUCCESS(retval, "Initial handshake failed"); - retval = rte_eth_macaddr_get(test_params.bonded_port_id, &bonded_mac); + retval = rte_eth_macaddr_get(test_params.bonding_port_id, &bonding_mac); TEST_ASSERT_SUCCESS(retval, "Failed to get mac address: %s", strerror(-retval)); /* Prepare burst */ for (pkts_cnt = 0; pkts_cnt < RTE_DIM(pkts); pkts_cnt++) { dst_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = pkts_cnt; - retval = generate_packets(&bonded_mac, &dst_mac, 1, &pkts[pkts_cnt]); + retval = generate_packets(&bonding_mac, &dst_mac, 1, &pkts[pkts_cnt]); if (retval != 1) free_pkts(pkts, pkts_cnt); @@ -1029,12 +1029,12 @@ test_mode4_tx_burst(void) } exp_pkts_cnt = pkts_cnt; - /* Transmit packets on bonded device */ + /* Transmit packets on bonding device */ retval = bond_tx(pkts, pkts_cnt); if (retval > 0 && retval < pkts_cnt) free_pkts(&pkts[retval], pkts_cnt - retval); - TEST_ASSERT_EQUAL(retval, pkts_cnt, "TX on bonded device failed"); + TEST_ASSERT_EQUAL(retval, pkts_cnt, "TX on bonding device failed"); /* Check if packets were transmitted properly. Every member should have * at least one packet, and sum must match. Under normal operation @@ -1095,7 +1095,7 @@ test_mode4_tx_burst(void) /* Prepare burst. */ for (pkts_cnt = 0; pkts_cnt < RTE_DIM(pkts); pkts_cnt++) { dst_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = pkts_cnt; - retval = generate_packets(&bonded_mac, &dst_mac, 1, &pkts[pkts_cnt]); + retval = generate_packets(&bonding_mac, &dst_mac, 1, &pkts[pkts_cnt]); if (retval != 1) free_pkts(pkts, pkts_cnt); @@ -1105,12 +1105,12 @@ test_mode4_tx_burst(void) } exp_pkts_cnt = pkts_cnt; - /* Transmit packets on bonded device. */ + /* Transmit packets on bonding device. */ retval = bond_tx(pkts, pkts_cnt); if (retval > 0 && retval < pkts_cnt) free_pkts(&pkts[retval], pkts_cnt - retval); - TEST_ASSERT_EQUAL(retval, pkts_cnt, "TX on bonded device failed"); + TEST_ASSERT_EQUAL(retval, pkts_cnt, "TX on bonding device failed"); /* Check if packets was transmitted properly. Every member should have * at least one packet, and sum must match. Under normal operation @@ -1151,7 +1151,7 @@ test_mode4_tx_burst(void) TEST_ASSERT_EQUAL(exp_pkts_cnt, pkts_cnt, "Expected %u packets but transmitted only %d", exp_pkts_cnt, pkts_cnt); - return remove_members_and_stop_bonded_device(); + return remove_members_and_stop_bonding_device(); } static void @@ -1198,9 +1198,9 @@ test_mode4_marker(void) uint8_t i, j; const uint16_t ethtype_slow_be = rte_be_to_cpu_16(RTE_ETHER_TYPE_SLOW); - retval = initialize_bonded_device_with_members(TEST_MARKER_MEMBER_COUT, + retval = initialize_bonding_device_with_members(TEST_MARKER_MEMBER_COUT, 0); - TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); + TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonding device"); /* Test LACP handshake function */ retval = bond_handshake(); @@ -1221,7 +1221,7 @@ test_mode4_marker(void) for (j = 0; j < 20; ++j) { rte_delay_ms(delay); - retval = rte_eth_rx_burst(test_params.bonded_port_id, 0, pkts, + retval = rte_eth_rx_burst(test_params.bonding_port_id, 0, pkts, RTE_DIM(pkts)); if (retval > 0) @@ -1229,7 +1229,7 @@ test_mode4_marker(void) TEST_ASSERT_EQUAL(retval, 0, "Received packets unexpectedly"); - retval = rte_eth_tx_burst(test_params.bonded_port_id, 0, NULL, 0); + retval = rte_eth_tx_burst(test_params.bonding_port_id, 0, NULL, 0); TEST_ASSERT_EQUAL(retval, 0, "Requested TX of 0 packets but %d transmitted", retval); @@ -1265,7 +1265,7 @@ test_mode4_marker(void) TEST_ASSERT(j < 20, "Marker response not found"); } - retval = remove_members_and_stop_bonded_device(); + retval = remove_members_and_stop_bonding_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); return TEST_SUCCESS; @@ -1284,10 +1284,10 @@ test_mode4_expired(void) struct rte_eth_bond_8023ad_conf conf; - retval = initialize_bonded_device_with_members(TEST_EXPIRED_MEMBER_COUNT, + retval = initialize_bonding_device_with_members(TEST_EXPIRED_MEMBER_COUNT, 0); /* Set custom timeouts to make test last shorter. */ - rte_eth_bond_8023ad_conf_get(test_params.bonded_port_id, &conf); + rte_eth_bond_8023ad_conf_get(test_params.bonding_port_id, &conf); conf.fast_periodic_ms = 100; conf.slow_periodic_ms = 600; conf.short_timeout_ms = 300; @@ -1296,7 +1296,7 @@ test_mode4_expired(void) conf.tx_period_ms = 100; old_delay = conf.update_timeout_ms; conf.update_timeout_ms = 10; - rte_eth_bond_8023ad_setup(test_params.bonded_port_id, &conf); + rte_eth_bond_8023ad_setup(test_params.bonding_port_id, &conf); /* Wait for new settings to be applied. */ for (i = 0; i < old_delay/conf.update_timeout_ms * 2; i++) { @@ -1360,7 +1360,7 @@ test_mode4_expired(void) "Member %u should be operational.", member->port_id); } - retval = remove_members_and_stop_bonded_device(); + retval = remove_members_and_stop_bonding_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); return TEST_SUCCESS; @@ -1370,7 +1370,7 @@ static int test_mode4_ext_ctrl(void) { /* - * configure bonded interface without the external sm enabled + * configure bonding interface without the external sm enabled * . try to transmit lacpdu (should fail) * . try to set collecting and distributing flags (should fail) * reconfigure w/external sm @@ -1405,24 +1405,24 @@ test_mode4_ext_ctrl(void) rte_pktmbuf_pkt_len(lacp_tx_buf[i]) = sizeof(lacpdu); } - retval = initialize_bonded_device_with_members(TEST_TX_MEMBER_COUNT, 0); - TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); + retval = initialize_bonding_device_with_members(TEST_TX_MEMBER_COUNT, 0); + TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonding device"); FOR_EACH_MEMBER(i, member) { TEST_ASSERT_FAIL(rte_eth_bond_8023ad_ext_slowtx( - test_params.bonded_port_id, + test_params.bonding_port_id, member->port_id, lacp_tx_buf[i]), "Member should not allow manual LACP xmit"); TEST_ASSERT_FAIL(rte_eth_bond_8023ad_ext_collect( - test_params.bonded_port_id, + test_params.bonding_port_id, member->port_id, 1), "Member should not allow external state controls"); } free_pkts(lacp_tx_buf, RTE_DIM(lacp_tx_buf)); - retval = remove_members_and_stop_bonded_device(); - TEST_ASSERT_SUCCESS(retval, "Bonded device cleanup failed."); + retval = remove_members_and_stop_bonding_device(); + TEST_ASSERT_SUCCESS(retval, "Bonding device cleanup failed."); return TEST_SUCCESS; } @@ -1459,8 +1459,8 @@ test_mode4_ext_lacp(void) rte_pktmbuf_pkt_len(lacp_tx_buf[i]) = sizeof(lacpdu); } - retval = initialize_bonded_device_with_members(TEST_TX_MEMBER_COUNT, 1); - TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); + retval = initialize_bonding_device_with_members(TEST_TX_MEMBER_COUNT, 1); + TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonding device"); memset(lacpdu_rx_count, 0, sizeof(lacpdu_rx_count)); @@ -1470,7 +1470,7 @@ test_mode4_ext_lacp(void) FOR_EACH_MEMBER(i, member) { retval = rte_eth_bond_8023ad_ext_slowtx( - test_params.bonded_port_id, + test_params.bonding_port_id, member->port_id, lacp_tx_buf[i]); TEST_ASSERT_SUCCESS(retval, "Member should allow manual LACP xmit"); @@ -1510,7 +1510,7 @@ test_mode4_ext_lacp(void) lacpdu_rx_count[member->port_id]); } - retval = remove_members_and_stop_bonded_device(); + retval = remove_members_and_stop_bonding_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); return TEST_SUCCESS; @@ -1532,7 +1532,7 @@ check_environment(void) if (rte_ring_count(port->tx_queue) != 0) env_state |= 0x02; - if (port->bonded != 0) + if (port->bonding != 0) env_state |= 0x04; if (port->lacp_parnter_state != 0) @@ -1542,7 +1542,7 @@ check_environment(void) break; } - members_count = rte_eth_bond_members_get(test_params.bonded_port_id, + members_count = rte_eth_bond_members_get(test_params.bonding_port_id, members, RTE_DIM(members)); if (members_count != 0) @@ -1583,8 +1583,8 @@ test_mode4_executor(int (*test_func)(void)) /* Reset environment in case test failed to do that. */ if (test_result != TEST_SUCCESS) { - TEST_ASSERT_SUCCESS(remove_members_and_stop_bonded_device(), - "Failed to stop bonded device"); + TEST_ASSERT_SUCCESS(remove_members_and_stop_bonding_device(), + "Failed to stop bonding device"); FOR_EACH_PORT(i, port) { while (rte_ring_count(port->rx_queue) != 0) { diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bonding_rssconf.c index 1f888b4771..f1c63fed5e 100644 --- a/app/test/test_link_bonding_rssconf.c +++ b/app/test/test_link_bonding_rssconf.c @@ -32,7 +32,7 @@ #define RXTX_RING_SIZE 1024 #define RXTX_QUEUE_COUNT 4 -#define BONDED_DEV_NAME ("net_bonding_rss") +#define BONDING_DEV_NAME ("net_bonding_rss") #define MEMBER_DEV_NAME_FMT ("net_null%d") #define MEMBER_RXTX_QUEUE_FMT ("rssconf_member%d_q%d") @@ -173,7 +173,7 @@ remove_members(void) } static int -remove_members_and_stop_bonded_device(void) +remove_members_and_stop_bonding_device(void) { TEST_ASSERT_SUCCESS(remove_members(), "Removing members"); TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params.bond_port_id), @@ -390,7 +390,7 @@ test_propagate(void) retval = rte_eth_dev_rss_hash_update(test_params.bond_port_id, &bond_rss_conf); - TEST_ASSERT_SUCCESS(retval, "Cannot set bonded port RSS keys"); + TEST_ASSERT_SUCCESS(retval, "Cannot set bonding port RSS keys"); FOR_EACH_PORT(n, port) { port = &test_params.member_ports[n]; @@ -424,7 +424,7 @@ test_propagate(void) TEST_ASSERT_SUCCESS(reta_set(test_params.bond_port_id, i % RXTX_QUEUE_COUNT, test_params.bond_dev_info.reta_size), - "Cannot set bonded port RETA"); + "Cannot set bonding port RETA"); bond_reta_fetch(); @@ -468,14 +468,14 @@ test_rss(void) TEST_ASSERT(member_remove_and_add() == 1, "remove and add members success."); - remove_members_and_stop_bonded_device(); + remove_members_and_stop_bonding_device(); return TEST_SUCCESS; } /** - * Test RSS configuration over bonded and members. + * Test RSS configuration over bonding and members. */ static int test_rss_config_lazy(void) @@ -499,7 +499,7 @@ test_rss_config_lazy(void) bond_rss_conf.rss_hf = rss_hf; retval = rte_eth_dev_rss_hash_update(test_params.bond_port_id, &bond_rss_conf); - TEST_ASSERT(retval != 0, "Succeeded in setting bonded port hash function"); + TEST_ASSERT(retval != 0, "Succeeded in setting bonding port hash function"); } /* Set all keys to zero for all members */ @@ -516,7 +516,7 @@ test_rss_config_lazy(void) TEST_ASSERT(retval != 0, "Succeeded in setting members RSS keys"); } - /* Set RSS keys for bonded port */ + /* Set RSS keys for bonding port */ memset(rss_key, 1, sizeof(rss_key)); bond_rss_conf.rss_hf = rss_hf; bond_rss_conf.rss_key = rss_key; @@ -524,7 +524,7 @@ test_rss_config_lazy(void) retval = rte_eth_dev_rss_hash_update(test_params.bond_port_id, &bond_rss_conf); - TEST_ASSERT(retval != 0, "Succeeded in setting bonded port RSS keys"); + TEST_ASSERT(retval != 0, "Succeeded in setting bonding port RSS keys"); /* Test RETA propagation */ for (i = 0; i < RXTX_QUEUE_COUNT; i++) { @@ -537,7 +537,7 @@ test_rss_config_lazy(void) retval = reta_set(test_params.bond_port_id, i % RXTX_QUEUE_COUNT, test_params.bond_dev_info.reta_size); - TEST_ASSERT(retval != 0, "Succeeded in setting bonded port RETA"); + TEST_ASSERT(retval != 0, "Succeeded in setting bonding port RETA"); } return TEST_SUCCESS; @@ -567,7 +567,7 @@ test_rss_lazy(void) TEST_ASSERT_SUCCESS(test_rss_config_lazy(), "Succeeded in setting RSS hash when RX_RSS mq_mode is turned off"); - remove_members_and_stop_bonded_device(); + remove_members_and_stop_bonding_device(); return TEST_SUCCESS; } @@ -624,10 +624,10 @@ test_setup(void) } if (test_params.bond_port_id == INVALID_PORT_ID) { - retval = rte_eth_bond_create(BONDED_DEV_NAME, 0, rte_socket_id()); + retval = rte_eth_bond_create(BONDING_DEV_NAME, 0, rte_socket_id()); - TEST_ASSERT(retval >= 0, "Failed to create bonded ethdev %s", - BONDED_DEV_NAME); + TEST_ASSERT(retval >= 0, "Failed to create bonding ethdev %s", + BONDING_DEV_NAME); test_params.bond_port_id = retval; @@ -685,8 +685,8 @@ test_rssconf_executor(int (*test_func)(void)) /* Reset environment in case test failed to do that. */ if (test_result != TEST_SUCCESS) { - TEST_ASSERT_SUCCESS(remove_members_and_stop_bonded_device(), - "Failed to stop bonded device"); + TEST_ASSERT_SUCCESS(remove_members_and_stop_bonding_device(), + "Failed to stop bonding device"); } return test_result; diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c index 2b55c85fd8..b7d74a467a 100644 --- a/app/test/virtual_pmd.c +++ b/app/test/virtual_pmd.c @@ -164,17 +164,17 @@ virtual_ethdev_tx_queue_setup_fail(struct rte_eth_dev *dev __rte_unused, } static int -virtual_ethdev_link_update_success(struct rte_eth_dev *bonded_eth_dev, +virtual_ethdev_link_update_success(struct rte_eth_dev *bonding_eth_dev, int wait_to_complete __rte_unused) { - if (!bonded_eth_dev->data->dev_started) - bonded_eth_dev->data->dev_link.link_status = RTE_ETH_LINK_DOWN; + if (!bonding_eth_dev->data->dev_started) + bonding_eth_dev->data->dev_link.link_status = RTE_ETH_LINK_DOWN; return 0; } static int -virtual_ethdev_link_update_fail(struct rte_eth_dev *bonded_eth_dev __rte_unused, +virtual_ethdev_link_update_fail(struct rte_eth_dev *bonding_eth_dev __rte_unused, int wait_to_complete __rte_unused) { return -1; diff --git a/doc/guides/prog_guide/img/bond-mode-0.svg b/doc/guides/prog_guide/img/bond-mode-0.svg index 850e4d3b62..ae0af22688 100644 --- a/doc/guides/prog_guide/img/bond-mode-0.svg +++ b/doc/guides/prog_guide/img/bond-mode-0.svg @@ -209,7 +209,7 @@ id="shape4-13" transform="translate(6.87402,-7.17304)">Rectangle.16bonded ethdevbonding ethdevbonded ethdev + style="fill:#feffff;font-family:Calibri">bonding ethdev <title id="title4060">Rectangle.16bonded ethdevbonding ethdevbonded ethdev + v:horizAlign="1" />bonding ethdev Rectangle.16bonded ethdevbonding ethdevbonded ethdev + style="fill:#feffff;font-family:Calibri">bonding ethdev <title id="title5779">Rectangle.16bonded ethdevbonding ethdevbonded ethdev + style="fill:#feffff;font-family:Calibri">bonding ethdev <title id="title6063">Rectangle.16bonded ethdevbonding ethdevbonded ethdev + style="fill:#feffff;font-family:Calibri">bonding ethdev <title id="title6371">Rectangle.16bonded ethdevbonding ethdevbonded ethdev + style="fill:#feffff;font-family:Calibri">bonding ethdev DPDK</text> </g> <g id="shape8-6" transform="translate(12.5358,-7.83661)"> <title>Rectangle.8 - bonded ethdev + bonding ethdev - bonded ethdev + bonding ethdev Rectangle User Application diff --git a/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst b/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst index 58e5ef41da..1a5f1dd5de 100644 --- a/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +++ b/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst @@ -10,20 +10,20 @@ allows physical PMDs to be bonded together to create a single logical PMD. .. figure:: img/bond-overview.* - Bonded PMDs + Bonding PMDs The Link Bonding PMD library(librte_net_bond) supports bonding of groups of ``rte_eth_dev`` ports of the same speed and duplex to provide similar capabilities to that found in Linux bonding driver to allow the aggregation of multiple (member) NICs into a single logical interface between a server -and a switch. The new bonded PMD will then process these interfaces based on +and a switch. The new bonding PMD will then process these interfaces based on the mode of operation specified to provide support for features such as redundant links, fault tolerance and/or load balancing. The librte_net_bond library exports a C API which provides an API for the -creation of bonded devices as well as the configuration and management of the -bonded device and its member devices. +creation of bonding devices as well as the configuration and management of the +bonding device and its member devices. .. note:: @@ -60,7 +60,7 @@ Currently the Link Bonding PMD library supports following modes of operation: In this mode only one member in the bond is active at any time, a different member becomes active if, and only if, the primary active member fails, thereby providing fault tolerance to member failure. The single logical - bonded interface's MAC address is externally visible on only one NIC (port) + bonding interface's MAC address is externally visible on only one NIC (port) to avoid confusing the network switch. * **Balance XOR (Mode 2):** @@ -73,7 +73,7 @@ Currently the Link Bonding PMD library supports following modes of operation: This mode provides transmit load balancing (based on the selected transmission policy) and fault tolerance. The default policy (layer2) uses a simple calculation based on the packet flow source and destination MAC - addresses as well as the number of active members available to the bonded + addresses as well as the number of active members available to the bonding device to classify the packet to a specific member to transmit on. Alternate transmission policies supported are layer 2+3, this takes the IP source and destination addresses into the calculation of the transmit member port and @@ -133,17 +133,17 @@ Currently the Link Bonding PMD library supports following modes of operation: Implementation Details ---------------------- -The librte_net_bond bonded device are compatible with the Ethernet device API +The librte_net_bond bonding device is compatible with the Ethernet device API exported by the Ethernet PMDs described in the *DPDK API Reference*. -The Link Bonding Library supports the creation of bonded devices at application +The Link Bonding Library supports the creation of bonding devices at application startup time during EAL initialization using the ``--vdev`` option as well as programmatically via the C API ``rte_eth_bond_create`` function. -Bonded devices support the dynamical addition and removal of member devices using +Bonding devices support the dynamical addition and removal of member devices using the ``rte_eth_bond_member_add`` / ``rte_eth_bond_member_remove`` APIs. -After a member device is added to a bonded device member is stopped using +After a member device is added to a bonding device member is stopped using ``rte_eth_dev_stop`` and then reconfigured using ``rte_eth_dev_configure`` the RX and TX queues are also reconfigured using ``rte_eth_tx_queue_setup`` / ``rte_eth_rx_queue_setup`` with the parameters use to configure the bonding @@ -164,12 +164,12 @@ of RSS configuration of bonding device as desired configuration of whole bonding consistency and made it more error-proof. RSS hash function set for bonding device, is a maximal set of RSS hash functions -supported by all bonded members. RETA size is a GCD of all its RETA's sizes, so +supported by all bonding members. RETA size is a GCD of all its RETA's sizes, so it can be easily used as a pattern providing expected behavior, even if member -RETAs' sizes are different. If RSS Key is not set for bonded device, it's not +RETAs' sizes are different. If RSS Key is not set for bonding device, it's not changed on the members and default key for device is used. -As RSS configurations, there is flow consistency in the bonded members for the +As RSS configurations, there is flow consistency in the bonding members for the next rte flow operations: Validate: @@ -233,9 +233,9 @@ Requirements / Limitations ~~~~~~~~~~~~~~~~~~~~~~~~~~ The current implementation only supports devices that support the same speed -and duplex to be added as a members to the same bonded device. The bonded device -inherits these attributes from the first active member added to the bonded -device and then all further members added to the bonded device must support +and duplex to be added as a members to the same bonding device. The bonding device +inherits these attributes from the first active member added to the bonding +device and then all further members added to the bonding device must support these parameters. A bonding device must have a minimum of one member before the bonding device @@ -255,9 +255,9 @@ that are assumed not to be invoked in parallel on different logical cores to work on the same target object. It should also be noted that the PMD receive function should not be invoked -directly on a member devices after they have been to a bonded device since +directly on a member devices after they have been to a bonding device since packets read directly from the member device will no longer be available to the -bonded device to read. +bonding device to read. Configuration ~~~~~~~~~~~~~ @@ -265,7 +265,7 @@ Configuration Link bonding devices are created using the ``rte_eth_bond_create`` API which requires a unique device name, the bonding mode, and the socket Id to allocate the bonding device's resources on. -The other configurable parameters for a bonded device are its member devices, +The other configurable parameters for a bonding device are its member devices, its primary member, a user defined MAC address and transmission policy to use if the device is in balance XOR mode. @@ -274,37 +274,37 @@ Member Devices Bonding devices support up to a maximum of ``RTE_MAX_ETHPORTS`` member devices of the same speed and duplex. Ethernet devices can be added as a member to a -maximum of one bonded device. Member devices are reconfigured with the -configuration of the bonded device on being added to a bonded device. +maximum of one bonding device. Member devices are reconfigured with the +configuration of the bonding device on being added to a bonding device. -The bonded also guarantees to return the MAC address of the member device to its +The bonding also guarantees to return the MAC address of the member device to its original value of removal of a member from it. Primary Member ^^^^^^^^^^^^^^ -The primary member is used to define the default port to use when a bonded +The primary member is used to define the default port to use when a bonding device is in active backup mode. A different port will only be used if, and only if, the current primary port goes down. If the user does not specify a -primary port it will default to being the first port added to the bonded device. +primary port it will default to being the first port added to the bonding device. MAC Address ^^^^^^^^^^^ -The bonded device can be configured with a user specified MAC address, this +The bonding device can be configured with a user specified MAC address, this address will be inherited by the some/all member devices depending on the operating mode. If the device is in active backup mode then only the primary device will have the user specified MAC, all other members will retain their original MAC address. In mode 0, 2, 3, 4 all members devices are configure with -the bonded devices MAC address. +the bonding devices MAC address. -If a user defined MAC address is not defined then the bonded device will +If a user defined MAC address is not defined then the bonding device will default to using the primary members MAC address. Balance XOR Transmit Policies ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -There are 3 supported transmission policies for bonded device running in +There are 3 supported transmission policies for bonding device running in Balance XOR mode. Layer 2, Layer 2+3, Layer 3+4. * **Layer 2:** Ethernet MAC address based balancing is the default @@ -355,12 +355,12 @@ using the ``rte_eth_bond_member_add`` / ``rte_eth_bond_member_remove`` APIs but at least one member device must be added to the link bonding device before it can be started using ``rte_eth_dev_start``. -The link status of a bonded device is dictated by that of its members, if all +The link status of a bonding device is dictated by that of its members, if all member device link status are down or if all members are removed from the link bonding device then the link status of the bonding device will go down. It is also possible to configure / query the configuration of the control -parameters of a bonded device using the provided APIs +parameters of a bonding device using the provided APIs ``rte_eth_bond_mode_set/ get``, ``rte_eth_bond_primary_set/get``, ``rte_eth_bond_mac_set/reset`` and ``rte_eth_bond_xmit_policy_set/get``. @@ -390,9 +390,9 @@ long as the following two rules are respected: where X can be any combination of numbers and/or letters, and the name is no greater than 32 characters long. -* A least one member device is provided with for each bonded device definition. +* A least one member device is provided with for each bonding device definition. -* The operation mode of the bonded device being created is provided. +* The operation mode of the bonding device being created is provided. The different options are: @@ -404,7 +404,7 @@ The different options are: mode=2 -* member: Defines the PMD device which will be added as member to the bonded +* member: Defines the PMD device which will be added as member to the bonding device. This option can be selected multiple times, for each device to be added as a member. Physical devices should be specified using their PCI address, in the format domain:bus:devid.function @@ -418,14 +418,14 @@ The different options are: it is available. The primary port also is used to select the MAC address to use when it is not defined by the user. This defaults to the first member added to the device if it is specified. The primary device must be a member - of the bonded device. + of the bonding device. .. code-block:: console primary=0000:0a:00.0 * socket_id: Optional parameter used to select which socket on a NUMA device - the bonded devices resources will be allocated on. + the bonding devices resources will be allocated on. .. code-block:: console @@ -439,7 +439,7 @@ The different options are: mac=00:1e:67:1d:fd:1d * xmit_policy: Optional parameter which defines the transmission policy when - the bonded device is in balance mode. If not user specified this defaults + the bonding device is in balance mode. If not user specified this defaults to l2 (layer 2) forwarding, the other transmission policies available are l23 (layer 2+3) and l34 (layer 3+4) @@ -474,25 +474,25 @@ The different options are: Examples of Usage ^^^^^^^^^^^^^^^^^ -Create a bonded device in round robin mode with two members specified by their PCI address: +Create a bonding device in round robin mode with two members specified by their PCI address: .. code-block:: console .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=0,member=0000:0a:00.01,member=0000:04:00.00' -- --port-topology=chained -Create a bonded device in round robin mode with two members specified by their PCI address and an overriding MAC address: +Create a bonding device in round robin mode with two members specified by their PCI address and an overriding MAC address: .. code-block:: console .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=0,member=0000:0a:00.01,member=0000:04:00.00,mac=00:1e:67:1d:fd:1d' -- --port-topology=chained -Create a bonded device in active backup mode with two members specified, and a primary member specified by their PCI addresses: +Create a bonding device in active backup mode with two members specified, and a primary member specified by their PCI addresses: .. code-block:: console .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=1,member=0000:0a:00.01,member=0000:04:00.00,primary=0000:0a:00.01' -- --port-topology=chained -Create a bonded device in balance mode with two members specified by their PCI addresses, and a transmission policy of layer 3 + 4 forwarding: +Create a bonding device in balance mode with two members specified by their PCI addresses, and a transmission policy of layer 3 + 4 forwarding: .. code-block:: console @@ -505,17 +505,17 @@ Testpmd driver specific commands Some bonding driver specific features are integrated in testpmd. -create bonded device +create bonding device ~~~~~~~~~~~~~~~~~~~~ Create a new bonding device:: - testpmd> create bonded device (mode) (socket) + testpmd> create bonding device (mode) (socket) -For example, to create a bonded device in mode 1 on socket 0:: +For example, to create a bonding device in mode 1 on socket 0:: - testpmd> create bonded device 1 0 - created new bonded device (port X) + testpmd> create bonding device 1 0 + created new bonding device (port X) add bonding member ~~~~~~~~~~~~~~~~~~ @@ -596,7 +596,7 @@ link status ISR will be queried every polling interval to check if their link st testpmd> set bonding mon_period (port_id) (value) -For example, to set the link status monitoring polling period of bonded device (port 5) to 150ms:: +For example, to set the link status monitoring polling period of bonding device (port 5) to 150ms:: testpmd> set bonding mon_period 5 150 diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 8f23847859..7ee2e64972 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -1900,7 +1900,7 @@ For example, to attach a port created by pcap PMD. In this case, identifier is ``net_pcap0``. This identifier format is the same as ``--vdev`` format of DPDK applications. -For example, to re-attach a bonded port which has been previously detached, +For example, to re-attach a bonding port which has been previously detached, the mode and slave parameters must be given. .. code-block:: console @@ -1908,7 +1908,7 @@ the mode and slave parameters must be given. testpmd> port attach net_bond_0,mode=0,slave=1 Attaching a new port... EAL: Initializing pmd_bond for net_bond_0 - EAL: Create bonded device net_bond_0 on port 0 in mode 0 on socket 0. + EAL: Create bonding device net_bond_0 on port 0 in mode 0 on socket 0. Port 0 is attached. Now total ports is 1 Done diff --git a/drivers/net/bonding/bonding_testpmd.c b/drivers/net/bonding/bonding_testpmd.c index 1fe85839ed..8fcd6cadd0 100644 --- a/drivers/net/bonding/bonding_testpmd.c +++ b/drivers/net/bonding/bonding_testpmd.c @@ -290,7 +290,7 @@ static void cmd_set_bonding_primary_parsed(void *parsed_result, portid_t main_port_id = res->port_id; portid_t member_port_id = res->member_id; - /* Set the primary member for a bonded device. */ + /* Set the primary member for a bonding device. */ if (rte_eth_bond_primary_set(main_port_id, member_port_id) != 0) { fprintf(stderr, "\t Failed to set primary member for port = %d.\n", main_port_id); @@ -346,7 +346,7 @@ static void cmd_add_bonding_member_parsed(void *parsed_result, portid_t main_port_id = res->port_id; portid_t member_port_id = res->member_id; - /* add the member for a bonded device. */ + /* add the member for a bonding device. */ if (rte_eth_bond_member_add(main_port_id, member_port_id) != 0) { fprintf(stderr, "\t Failed to add member %d to main port = %d.\n", @@ -377,7 +377,7 @@ static cmdline_parse_token_num_t cmd_addbonding_member_port = static cmdline_parse_inst_t cmd_add_bonding_member = { .f = cmd_add_bonding_member_parsed, .help_str = "add bonding member : " - "Add a member device to a bonded device", + "Add a member device to a bonding device", .data = NULL, .tokens = { (void *)&cmd_addbonding_member_add, @@ -405,7 +405,7 @@ static void cmd_remove_bonding_member_parsed(void *parsed_result, portid_t main_port_id = res->port_id; portid_t member_port_id = res->member_id; - /* remove the member from a bonded device. */ + /* remove the member from a bonding device. */ if (rte_eth_bond_member_remove(main_port_id, member_port_id) != 0) { fprintf(stderr, "\t Failed to remove member %d from main port = %d.\n", @@ -435,7 +435,7 @@ static cmdline_parse_token_num_t cmd_removebonding_member_port = static cmdline_parse_inst_t cmd_remove_bonding_member = { .f = cmd_remove_bonding_member_parsed, .help_str = "remove bonding member : " - "Remove a member device from a bonded device", + "Remove a member device from a bonding device", .data = NULL, .tokens = { (void *)&cmd_removebonding_member_remove, @@ -447,10 +447,10 @@ static cmdline_parse_inst_t cmd_remove_bonding_member = { } }; -/* *** CREATE BONDED DEVICE *** */ -struct cmd_create_bonded_device_result { +/* *** CREATE BONDING DEVICE *** */ +struct cmd_create_bonding_device_result { cmdline_fixed_string_t create; - cmdline_fixed_string_t bonded; + cmdline_fixed_string_t bonding; cmdline_fixed_string_t device; uint8_t mode; uint8_t socket; @@ -458,10 +458,10 @@ struct cmd_create_bonded_device_result { static int bond_dev_num; -static void cmd_create_bonded_device_parsed(void *parsed_result, +static void cmd_create_bonding_device_parsed(void *parsed_result, __rte_unused struct cmdline *cl, __rte_unused void *data) { - struct cmd_create_bonded_device_result *res = parsed_result; + struct cmd_create_bonding_device_result *res = parsed_result; char ethdev_name[RTE_ETH_NAME_MAX_LEN]; int port_id; int ret; @@ -474,13 +474,13 @@ static void cmd_create_bonded_device_parsed(void *parsed_result, snprintf(ethdev_name, RTE_ETH_NAME_MAX_LEN, "net_bonding_testpmd_%d", bond_dev_num++); - /* Create a new bonded device. */ + /* Create a new bonding device. */ port_id = rte_eth_bond_create(ethdev_name, res->mode, res->socket); if (port_id < 0) { - fprintf(stderr, "\t Failed to create bonded device.\n"); + fprintf(stderr, "\t Failed to create bonding device.\n"); return; } - printf("Created new bonded device %s on (port %d).\n", ethdev_name, + printf("Created new bonding device %s on (port %d).\n", ethdev_name, port_id); /* Update number of ports */ @@ -497,38 +497,38 @@ static void cmd_create_bonded_device_parsed(void *parsed_result, ports[port_id].port_status = RTE_PORT_STOPPED; } -static cmdline_parse_token_string_t cmd_createbonded_device_create = - TOKEN_STRING_INITIALIZER(struct cmd_create_bonded_device_result, +static cmdline_parse_token_string_t cmd_createbonding_device_create = + TOKEN_STRING_INITIALIZER(struct cmd_create_bonding_device_result, create, "create"); -static cmdline_parse_token_string_t cmd_createbonded_device_bonded = - TOKEN_STRING_INITIALIZER(struct cmd_create_bonded_device_result, - bonded, "bonded"); -static cmdline_parse_token_string_t cmd_createbonded_device_device = - TOKEN_STRING_INITIALIZER(struct cmd_create_bonded_device_result, +static cmdline_parse_token_string_t cmd_createbonding_device_bonding = + TOKEN_STRING_INITIALIZER(struct cmd_create_bonding_device_result, + bonding, "bonding"); +static cmdline_parse_token_string_t cmd_createbonding_device_device = + TOKEN_STRING_INITIALIZER(struct cmd_create_bonding_device_result, device, "device"); -static cmdline_parse_token_num_t cmd_createbonded_device_mode = - TOKEN_NUM_INITIALIZER(struct cmd_create_bonded_device_result, +static cmdline_parse_token_num_t cmd_createbonding_device_mode = + TOKEN_NUM_INITIALIZER(struct cmd_create_bonding_device_result, mode, RTE_UINT8); -static cmdline_parse_token_num_t cmd_createbonded_device_socket = - TOKEN_NUM_INITIALIZER(struct cmd_create_bonded_device_result, +static cmdline_parse_token_num_t cmd_createbonding_device_socket = + TOKEN_NUM_INITIALIZER(struct cmd_create_bonding_device_result, socket, RTE_UINT8); -static cmdline_parse_inst_t cmd_create_bonded_device = { - .f = cmd_create_bonded_device_parsed, - .help_str = "create bonded device : " - "Create a new bonded device with specific bonding mode and socket", +static cmdline_parse_inst_t cmd_create_bonding_device = { + .f = cmd_create_bonding_device_parsed, + .help_str = "create bonding device : " + "Create a new bonding device with specific bonding mode and socket", .data = NULL, .tokens = { - (void *)&cmd_createbonded_device_create, - (void *)&cmd_createbonded_device_bonded, - (void *)&cmd_createbonded_device_device, - (void *)&cmd_createbonded_device_mode, - (void *)&cmd_createbonded_device_socket, + (void *)&cmd_createbonding_device_create, + (void *)&cmd_createbonding_device_bonding, + (void *)&cmd_createbonding_device_device, + (void *)&cmd_createbonding_device_mode, + (void *)&cmd_createbonding_device_socket, NULL } }; -/* *** SET MAC ADDRESS IN BONDED DEVICE *** */ +/* *** SET MAC ADDRESS IN BONDING DEVICE *** */ struct cmd_set_bond_mac_addr_result { cmdline_fixed_string_t set; cmdline_fixed_string_t bonding; @@ -584,7 +584,7 @@ static cmdline_parse_inst_t cmd_set_bond_mac_addr = { } }; -/* *** SET LINK STATUS MONITORING POLLING PERIOD ON BONDED DEVICE *** */ +/* *** SET LINK STATUS MONITORING POLLING PERIOD ON BONDING DEVICE *** */ struct cmd_set_bond_mon_period_result { cmdline_fixed_string_t set; cmdline_fixed_string_t bonding; @@ -697,7 +697,7 @@ static struct testpmd_driver_commands bonding_cmds = { { &cmd_set_bonding_mode, "set bonding mode (value) (port_id)\n" - " Set the bonding mode on a bonded device.\n", + " Set the bonding mode on a bonding device.\n", }, { &cmd_show_bonding_config, @@ -707,32 +707,32 @@ static struct testpmd_driver_commands bonding_cmds = { { &cmd_set_bonding_primary, "set bonding primary (member_id) (port_id)\n" - " Set the primary member for a bonded device.\n", + " Set the primary member for a bonding device.\n", }, { &cmd_add_bonding_member, "add bonding member (member_id) (port_id)\n" - " Add a member device to a bonded device.\n", + " Add a member device to a bonding device.\n", }, { &cmd_remove_bonding_member, "remove bonding member (member_id) (port_id)\n" - " Remove a member device from a bonded device.\n", + " Remove a member device from a bonding device.\n", }, { - &cmd_create_bonded_device, - "create bonded device (mode) (socket)\n" - " Create a new bonded device with specific bonding mode and socket.\n", + &cmd_create_bonding_device, + "create bonding device (mode) (socket)\n" + " Create a new bonding device with specific bonding mode and socket.\n", }, { &cmd_set_bond_mac_addr, "set bonding mac_addr (port_id) (address)\n" - " Set the MAC address of a bonded device.\n", + " Set the MAC address of a bonding device.\n", }, { &cmd_set_balance_xmit_policy, "set bonding balance_xmit_policy (port_id) (l2|l23|l34)\n" - " Set the transmit balance policy for bonded device running in balance mode.\n", + " Set the transmit balance policy for bonding device running in balance mode.\n", }, { &cmd_set_bond_mon_period, diff --git a/drivers/net/bonding/eth_bond_8023ad_private.h b/drivers/net/bonding/eth_bond_8023ad_private.h index 77892c0601..ab7d15f81a 100644 --- a/drivers/net/bonding/eth_bond_8023ad_private.h +++ b/drivers/net/bonding/eth_bond_8023ad_private.h @@ -194,11 +194,11 @@ struct bond_dev_private; /** * @internal * - * Set mode 4 configuration of bonded interface. + * Set mode 4 configuration of bonding interface. * - * @pre Bonded interface must be stopped. + * @pre Bonding interface must be stopped. * - * @param dev Bonded interface + * @param dev Bonding interface * @param conf new configuration. If NULL set default configuration. */ void @@ -208,9 +208,9 @@ bond_mode_8023ad_setup(struct rte_eth_dev *dev, /** * @internal * - * Enables 802.1AX mode and all active members on bonded interface. + * Enables 802.1AX mode and all active members on bonding interface. * - * @param dev Bonded interface + * @param dev Bonding interface * @return * 0 on success, negative value otherwise. */ @@ -220,9 +220,9 @@ bond_mode_8023ad_enable(struct rte_eth_dev *dev); /** * @internal * - * Disables 802.1AX mode of the bonded interface and members. + * Disables 802.1AX mode of the bonding interface and members. * - * @param dev Bonded interface + * @param dev Bonding interface * @return * 0 on success, negative value otherwise. */ @@ -232,7 +232,7 @@ int bond_mode_8023ad_disable(struct rte_eth_dev *dev); * @internal * * Starts 802.3AX state machines management logic. - * @param dev Bonded interface + * @param dev Bonding interface * @return * 0 if machines was started, 1 if machines was already running, * negative value otherwise. @@ -244,7 +244,7 @@ bond_mode_8023ad_start(struct rte_eth_dev *dev); * @internal * * Stops 802.3AX state machines management logic. - * @param dev Bonded interface + * @param dev Bonding interface * @return * 0 if this call stopped state machines, -ENOENT if alarm was not set. */ @@ -255,7 +255,7 @@ bond_mode_8023ad_stop(struct rte_eth_dev *dev); * @internal * * Passes given slow packet to state machines management logic. - * @param internals Bonded device private data. + * @param internals Bonding device private data. * @param member_id Member port id. * @param slot_pkt Slow packet. */ @@ -268,7 +268,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, * * Appends given member used member * - * @param dev Bonded interface. + * @param dev Bonding interface. * @param port_id Member port ID to be added * * @return @@ -282,7 +282,7 @@ bond_mode_8023ad_activate_member(struct rte_eth_dev *dev, uint16_t port_id); * * Denitializes and removes given member from 802.1AX mode. * - * @param dev Bonded interface. + * @param dev Bonding interface. * @param member_num Position of member in active_members array * * @return @@ -292,8 +292,8 @@ int bond_mode_8023ad_deactivate_member(struct rte_eth_dev *dev, uint16_t member_pos); /** - * Updates state when MAC was changed on bonded device or one of its members. - * @param bond_dev Bonded device + * Updates state when MAC was changed on bonding device or one of its members. + * @param bond_dev Bonding device */ void bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev); diff --git a/drivers/net/bonding/eth_bond_private.h b/drivers/net/bonding/eth_bond_private.h index 93d03b0a79..e688894210 100644 --- a/drivers/net/bonding/eth_bond_private.h +++ b/drivers/net/bonding/eth_bond_private.h @@ -74,7 +74,7 @@ struct bond_tx_queue { /**< Copy of TX configuration structure for queue */ }; -/** Bonded member devices structure */ +/** Bonding member devices structure */ struct bond_ethdev_member_ports { uint16_t members[RTE_MAX_ETHPORTS]; /**< Member port id array */ uint16_t member_count; /**< Number of members */ @@ -106,7 +106,7 @@ typedef void (*burst_xmit_hash_t)(struct rte_mbuf **buf, uint16_t nb_pkts, /** Link Bonding PMD device private configuration Structure */ struct bond_dev_private { - uint16_t port_id; /**< Port Id of Bonded Port */ + uint16_t port_id; /**< Port Id of Bonding Port */ uint8_t mode; /**< Link Bonding Mode */ rte_spinlock_t lock; @@ -140,9 +140,9 @@ struct bond_dev_private { uint16_t active_member_count; /**< Number of active members */ uint16_t active_members[RTE_MAX_ETHPORTS]; /**< Active member list */ - uint16_t member_count; /**< Number of bonded members */ + uint16_t member_count; /**< Number of bonding members */ struct bond_member_details members[RTE_MAX_ETHPORTS]; - /**< Array of bonded members details */ + /**< Array of bonding members details */ struct mode8023ad_private mode4; uint16_t tlb_members_order[RTE_MAX_ETHPORTS]; @@ -191,10 +191,10 @@ struct bond_dev_private { extern const struct eth_dev_ops default_dev_ops; int -check_for_main_bonded_ethdev(const struct rte_eth_dev *eth_dev); +check_for_main_bonding_ethdev(const struct rte_eth_dev *eth_dev); int -check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev); +check_for_bonding_ethdev(const struct rte_eth_dev *eth_dev); /* * Search given member array to find position of given id. @@ -216,7 +216,7 @@ int valid_port_id(uint16_t port_id); int -valid_bonded_port_id(uint16_t port_id); +valid_bonding_port_id(uint16_t port_id); int valid_member_port_id(struct bond_dev_private *internals, uint16_t port_id); @@ -236,25 +236,25 @@ mac_address_get(struct rte_eth_dev *eth_dev, struct rte_ether_addr *dst_mac_addr); int -mac_address_members_update(struct rte_eth_dev *bonded_eth_dev); +mac_address_members_update(struct rte_eth_dev *bonding_eth_dev); int -member_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev, +member_add_mac_addresses(struct rte_eth_dev *bonding_eth_dev, uint16_t member_port_id); int -member_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev, +member_remove_mac_addresses(struct rte_eth_dev *bonding_eth_dev, uint16_t member_port_id); int bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode); int -member_configure(struct rte_eth_dev *bonded_eth_dev, +member_configure(struct rte_eth_dev *bonding_eth_dev, struct rte_eth_dev *member_eth_dev); int -member_start(struct rte_eth_dev *bonded_eth_dev, +member_start(struct rte_eth_dev *bonding_eth_dev, struct rte_eth_dev *member_eth_dev); void diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h index b90242264d..6c4045adec 100644 --- a/drivers/net/bonding/rte_eth_bond.h +++ b/drivers/net/bonding/rte_eth_bond.h @@ -10,7 +10,7 @@ * * RTE Link Bonding Ethernet Device * Link Bonding for 1GbE and 10GbE ports to allow the aggregation of multiple - * (member) NICs into a single logical interface. The bonded device processes + * (member) NICs into a single logical interface. The bonding device processes * these interfaces based on the mode of operation specified and supported. * This implementation supports 4 modes of operation round robin, active backup * balance and broadcast. Providing redundant links, fault tolerance and/or @@ -28,7 +28,7 @@ extern "C" { #define BONDING_MODE_ROUND_ROBIN (0) /**< Round Robin (Mode 0). * In this mode all transmitted packets will be balanced equally across all - * active members of the bonded in a round robin fashion. + * active members of the bonding in a round robin fashion. */ #define BONDING_MODE_ACTIVE_BACKUP (1) /**< Active Backup (Mode 1). @@ -48,7 +48,7 @@ extern "C" { #define BONDING_MODE_BROADCAST (3) /**< Broadcast (Mode 3). * In this mode all transmitted packets will be transmitted on all available - * active members of the bonded. + * active members of the bonding. */ #define BONDING_MODE_8023AD (4) /**< 802.3AD (Mode 4). @@ -93,7 +93,7 @@ extern "C" { /**< Layer 3+4 (IP Addresses + UDP Ports) transmit load balancing */ /** - * Create a bonded rte_eth_dev device + * Create a bonding rte_eth_dev device * * @param name Name of new link bonding device. * @param mode Mode to initialize bonding device in. @@ -106,7 +106,7 @@ int rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id); /** - * Free a bonded rte_eth_dev device + * Free a bonding rte_eth_dev device * * @param name Name of the link bonding device. * @@ -117,9 +117,9 @@ int rte_eth_bond_free(const char *name); /** - * Add a rte_eth_dev device as a member to the bonded device + * Add a rte_eth_dev device as a member to the bonding device * - * @param bonded_port_id Port ID of bonded device. + * @param bonding_port_id Port ID of bonding device. * @param member_port_id Port ID of member device. * * @return @@ -127,7 +127,7 @@ rte_eth_bond_free(const char *name); */ __rte_experimental int -rte_eth_bond_member_add(uint16_t bonded_port_id, uint16_t member_port_id); +rte_eth_bond_member_add(uint16_t bonding_port_id, uint16_t member_port_id); __rte_deprecated static inline int @@ -137,9 +137,9 @@ rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t member_port_id) } /** - * Remove a member rte_eth_dev device from the bonded device + * Remove a member rte_eth_dev device from the bonding device * - * @param bonded_port_id Port ID of bonded device. + * @param bonding_port_id Port ID of bonding device. * @param member_port_id Port ID of member device. * * @return @@ -147,7 +147,7 @@ rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t member_port_id) */ __rte_experimental int -rte_eth_bond_member_remove(uint16_t bonded_port_id, uint16_t member_port_id); +rte_eth_bond_member_remove(uint16_t bonding_port_id, uint16_t member_port_id); __rte_deprecated static inline int @@ -157,156 +157,156 @@ rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t member_port_id) } /** - * Set link bonding mode of bonded device + * Set link bonding mode of bonding device * - * @param bonded_port_id Port ID of bonded device. + * @param bonding_port_id Port ID of bonding device. * @param mode Bonding mode to set * * @return * 0 on success, negative value otherwise */ int -rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode); +rte_eth_bond_mode_set(uint16_t bonding_port_id, uint8_t mode); /** - * Get link bonding mode of bonded device + * Get link bonding mode of bonding device * - * @param bonded_port_id Port ID of bonded device. + * @param bonding_port_id Port ID of bonding device. * * @return * link bonding mode on success, negative value otherwise */ int -rte_eth_bond_mode_get(uint16_t bonded_port_id); +rte_eth_bond_mode_get(uint16_t bonding_port_id); /** - * Set member rte_eth_dev as primary member of bonded device + * Set member rte_eth_dev as primary member of bonding device * - * @param bonded_port_id Port ID of bonded device. + * @param bonding_port_id Port ID of bonding device. * @param member_port_id Port ID of member device. * * @return * 0 on success, negative value otherwise */ int -rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t member_port_id); +rte_eth_bond_primary_set(uint16_t bonding_port_id, uint16_t member_port_id); /** - * Get primary member of bonded device + * Get primary member of bonding device * - * @param bonded_port_id Port ID of bonded device. + * @param bonding_port_id Port ID of bonding device. * * @return * Port Id of primary member on success, -1 on failure */ int -rte_eth_bond_primary_get(uint16_t bonded_port_id); +rte_eth_bond_primary_get(uint16_t bonding_port_id); /** - * Populate an array with list of the members port id's of the bonded device + * Populate an array with list of the members port id's of the bonding device * - * @param bonded_port_id Port ID of bonded eth_dev to interrogate + * @param bonding_port_id Port ID of bonding eth_dev to interrogate * @param members Array to be populated with the current active members * @param len Length of members array * * @return - * Number of members associated with bonded device on success, + * Number of members associated with bonding device on success, * negative value otherwise */ __rte_experimental int -rte_eth_bond_members_get(uint16_t bonded_port_id, uint16_t members[], +rte_eth_bond_members_get(uint16_t bonding_port_id, uint16_t members[], uint16_t len); __rte_deprecated static inline int -rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t members[], +rte_eth_bond_slaves_get(uint16_t bonding_port_id, uint16_t members[], uint16_t len) { - return rte_eth_bond_members_get(bonded_port_id, members, len); + return rte_eth_bond_members_get(bonding_port_id, members, len); } /** - * Populate an array with list of the active members port id's of the bonded + * Populate an array with list of the active members port id's of the bonding * device. * - * @param bonded_port_id Port ID of bonded eth_dev to interrogate + * @param bonding_port_id Port ID of bonding eth_dev to interrogate * @param members Array to be populated with the current active members * @param len Length of members array * * @return - * Number of active members associated with bonded device on success, + * Number of active members associated with bonding device on success, * negative value otherwise */ __rte_experimental int -rte_eth_bond_active_members_get(uint16_t bonded_port_id, uint16_t members[], +rte_eth_bond_active_members_get(uint16_t bonding_port_id, uint16_t members[], uint16_t len); __rte_deprecated static inline int -rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t members[], +rte_eth_bond_active_slaves_get(uint16_t bonding_port_id, uint16_t members[], uint16_t len) { - return rte_eth_bond_active_members_get(bonded_port_id, members, len); + return rte_eth_bond_active_members_get(bonding_port_id, members, len); } /** - * Set explicit MAC address to use on bonded device and it's members. + * Set explicit MAC address to use on bonding device and it's members. * - * @param bonded_port_id Port ID of bonded device. - * @param mac_addr MAC Address to use on bonded device overriding + * @param bonding_port_id Port ID of bonding device. + * @param mac_addr MAC Address to use on bonding device overriding * members MAC addresses * * @return * 0 on success, negative value otherwise */ int -rte_eth_bond_mac_address_set(uint16_t bonded_port_id, +rte_eth_bond_mac_address_set(uint16_t bonding_port_id, struct rte_ether_addr *mac_addr); /** - * Reset bonded device to use MAC from primary member on bonded device and it's + * Reset bonding device to use MAC from primary member on bonding device and it's * members. * - * @param bonded_port_id Port ID of bonded device. + * @param bonding_port_id Port ID of bonding device. * * @return * 0 on success, negative value otherwise */ int -rte_eth_bond_mac_address_reset(uint16_t bonded_port_id); +rte_eth_bond_mac_address_reset(uint16_t bonding_port_id); /** - * Set the transmit policy for bonded device to use when it is operating in + * Set the transmit policy for bonding device to use when it is operating in * balance mode, this parameter is otherwise ignored in other modes of * operation. * - * @param bonded_port_id Port ID of bonded device. + * @param bonding_port_id Port ID of bonding device. * @param policy Balance mode transmission policy. * * @return * 0 on success, negative value otherwise. */ int -rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy); +rte_eth_bond_xmit_policy_set(uint16_t bonding_port_id, uint8_t policy); /** - * Get the transmit policy set on bonded device for balance mode operation + * Get the transmit policy set on bonding device for balance mode operation * - * @param bonded_port_id Port ID of bonded device. + * @param bonding_port_id Port ID of bonding device. * * @return * Balance transmit policy on success, negative value otherwise. */ int -rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id); +rte_eth_bond_xmit_policy_get(uint16_t bonding_port_id); /** * Set the link monitoring frequency (in ms) for monitoring the link status of * member devices * - * @param bonded_port_id Port ID of bonded device. + * @param bonding_port_id Port ID of bonding device. * @param internal_ms Monitoring interval in milliseconds * * @return @@ -314,72 +314,72 @@ rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id); */ int -rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms); +rte_eth_bond_link_monitoring_set(uint16_t bonding_port_id, uint32_t internal_ms); /** * Get the current link monitoring frequency (in ms) for monitoring of the link * status of member devices * - * @param bonded_port_id Port ID of bonded device. + * @param bonding_port_id Port ID of bonding device. * * @return * Monitoring interval on success, negative value otherwise. */ int -rte_eth_bond_link_monitoring_get(uint16_t bonded_port_id); +rte_eth_bond_link_monitoring_get(uint16_t bonding_port_id); /** - * Set the period in milliseconds for delaying the disabling of a bonded link + * Set the period in milliseconds for delaying the disabling of a bonding link * when the link down status has been detected * - * @param bonded_port_id Port ID of bonded device. + * @param bonding_port_id Port ID of bonding device. * @param delay_ms Delay period in milliseconds. * * @return * 0 on success, negative value otherwise. */ int -rte_eth_bond_link_down_prop_delay_set(uint16_t bonded_port_id, +rte_eth_bond_link_down_prop_delay_set(uint16_t bonding_port_id, uint32_t delay_ms); /** - * Get the period in milliseconds set for delaying the disabling of a bonded + * Get the period in milliseconds set for delaying the disabling of a bonding * link when the link down status has been detected * - * @param bonded_port_id Port ID of bonded device. + * @param bonding_port_id Port ID of bonding device. * * @return * Delay period on success, negative value otherwise. */ int -rte_eth_bond_link_down_prop_delay_get(uint16_t bonded_port_id); +rte_eth_bond_link_down_prop_delay_get(uint16_t bonding_port_id); /** - * Set the period in milliseconds for delaying the enabling of a bonded link + * Set the period in milliseconds for delaying the enabling of a bonding link * when the link up status has been detected * - * @param bonded_port_id Port ID of bonded device. + * @param bonding_port_id Port ID of bonding device. * @param delay_ms Delay period in milliseconds. * * @return * 0 on success, negative value otherwise. */ int -rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id, +rte_eth_bond_link_up_prop_delay_set(uint16_t bonding_port_id, uint32_t delay_ms); /** - * Get the period in milliseconds set for delaying the enabling of a bonded + * Get the period in milliseconds set for delaying the enabling of a bonding * link when the link up status has been detected * - * @param bonded_port_id Port ID of bonded device. + * @param bonding_port_id Port ID of bonding device. * * @return * Delay period on success, negative value otherwise. */ int -rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id); +rte_eth_bond_link_up_prop_delay_get(uint16_t bonding_port_id); #ifdef __cplusplus diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index ac9f414e74..677067870f 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -206,7 +206,7 @@ show_warnings(uint16_t member_id) if (warnings & WRN_RX_QUEUE_FULL) { RTE_BOND_LOG(DEBUG, "Member %u: failed to enqueue LACP packet into RX ring.\n" - "Receive and transmit functions must be invoked on bonded" + "Receive and transmit functions must be invoked on bonding" "interface at least 10 times per second or LACP will notwork correctly", member_id); } @@ -214,7 +214,7 @@ show_warnings(uint16_t member_id) if (warnings & WRN_TX_QUEUE_FULL) { RTE_BOND_LOG(DEBUG, "Member %u: failed to enqueue LACP packet into TX ring.\n" - "Receive and transmit functions must be invoked on bonded" + "Receive and transmit functions must be invoked on bonding" "interface at least 10 times per second or LACP will not work correctly", member_id); } @@ -1415,7 +1415,7 @@ rte_eth_bond_8023ad_conf_get(uint16_t port_id, { struct rte_eth_dev *bond_dev; - if (valid_bonded_port_id(port_id) != 0) + if (valid_bonding_port_id(port_id) != 0) return -EINVAL; if (conf == NULL) @@ -1434,7 +1434,7 @@ rte_eth_bond_8023ad_agg_selection_set(uint16_t port_id, struct bond_dev_private *internals; struct mode8023ad_private *mode4; - if (valid_bonded_port_id(port_id) != 0) + if (valid_bonding_port_id(port_id) != 0) return -EINVAL; bond_dev = &rte_eth_devices[port_id]; @@ -1456,7 +1456,7 @@ int rte_eth_bond_8023ad_agg_selection_get(uint16_t port_id) struct bond_dev_private *internals; struct mode8023ad_private *mode4; - if (valid_bonded_port_id(port_id) != 0) + if (valid_bonding_port_id(port_id) != 0) return -EINVAL; bond_dev = &rte_eth_devices[port_id]; @@ -1475,7 +1475,7 @@ static int bond_8023ad_setup_validate(uint16_t port_id, struct rte_eth_bond_8023ad_conf *conf) { - if (valid_bonded_port_id(port_id) != 0) + if (valid_bonding_port_id(port_id) != 0) return -EINVAL; if (conf != NULL) { @@ -1526,7 +1526,7 @@ rte_eth_bond_8023ad_member_info(uint16_t port_id, uint16_t member_id, struct bond_dev_private *internals; struct port *port; - if (info == NULL || valid_bonded_port_id(port_id) != 0 || + if (info == NULL || valid_bonding_port_id(port_id) != 0 || rte_eth_bond_mode_get(port_id) != BONDING_MODE_8023AD) return -EINVAL; @@ -1717,7 +1717,7 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port) struct rte_eth_dev *dev; struct bond_dev_private *internals; - if (valid_bonded_port_id(port) != 0) + if (valid_bonding_port_id(port) != 0) return -EINVAL; dev = &rte_eth_devices[port]; @@ -1743,7 +1743,7 @@ rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port) struct rte_eth_dev *dev; struct bond_dev_private *internals; - if (valid_bonded_port_id(port) != 0) + if (valid_bonding_port_id(port) != 0) return -EINVAL; dev = &rte_eth_devices[port]; diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h index 3144ee378a..27f13fd05c 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h @@ -191,7 +191,7 @@ rte_eth_bond_8023ad_setup(uint16_t port_id, * @return * 0 - if ok * -EINVAL if conf is NULL or member id is invalid (not a member of given - * bonded device or is not inactive). + * bonding device or is not inactive). */ __rte_experimental int @@ -286,9 +286,9 @@ rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t member_id, * dedicated 802.3ad control plane traffic . A flow filtering rule is * programmed on each member to redirect all LACP slow packets to that rx queue * for processing in the LACP state machine, this removes the need to filter - * these packets in the bonded devices data path. The additional tx queue is + * these packets in the bonding devices data path. The additional tx queue is * used to enable the LACP state machine to enqueue LACP packets directly to - * member hw independently of the bonded devices data path. + * member hw independently of the bonding devices data path. * * To use this feature all members must support the programming of the flow * filter rule required for rx and have enough queues that one rx and tx queue diff --git a/drivers/net/bonding/rte_eth_bond_alb.h b/drivers/net/bonding/rte_eth_bond_alb.h index beb2e619f9..f51c355d36 100644 --- a/drivers/net/bonding/rte_eth_bond_alb.h +++ b/drivers/net/bonding/rte_eth_bond_alb.h @@ -105,7 +105,7 @@ bond_mode_alb_arp_upd(struct client_data *client_info, /** * Function updates member indexes of active connections. * - * @param bond_dev Pointer to bonded device struct. + * @param bond_dev Pointer to bonding device struct. */ void bond_mode_alb_client_list_upd(struct rte_eth_dev *bond_dev); diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index b6512a098a..0f2c7138a3 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -16,7 +16,7 @@ #include "eth_bond_8023ad_private.h" int -check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev) +check_for_bonding_ethdev(const struct rte_eth_dev *eth_dev) { /* Check valid pointer */ if (eth_dev == NULL || @@ -30,26 +30,26 @@ check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev) } int -valid_bonded_port_id(uint16_t port_id) +valid_bonding_port_id(uint16_t port_id) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -1); - return check_for_bonded_ethdev(&rte_eth_devices[port_id]); + return check_for_bonding_ethdev(&rte_eth_devices[port_id]); } int -check_for_main_bonded_ethdev(const struct rte_eth_dev *eth_dev) +check_for_main_bonding_ethdev(const struct rte_eth_dev *eth_dev) { int i; struct bond_dev_private *internals; - if (check_for_bonded_ethdev(eth_dev) != 0) + if (check_for_bonding_ethdev(eth_dev) != 0) return 0; internals = eth_dev->data->dev_private; - /* Check if any of member devices is a bonded device */ + /* Check if any of member devices is a bonding device */ for (i = 0; i < internals->member_count; i++) - if (valid_bonded_port_id(internals->members[i].port_id) == 0) + if (valid_bonding_port_id(internals->members[i].port_id) == 0) return 1; return 0; @@ -60,18 +60,18 @@ valid_member_port_id(struct bond_dev_private *internals, uint16_t member_port_id { RTE_ETH_VALID_PORTID_OR_ERR_RET(member_port_id, -1); - /* Verify that member_port_id refers to a non bonded port */ - if (check_for_bonded_ethdev(&rte_eth_devices[member_port_id]) == 0 && + /* Verify that member_port_id refers to a non bonding port */ + if (check_for_bonding_ethdev(&rte_eth_devices[member_port_id]) == 0 && internals->mode == BONDING_MODE_8023AD) { - RTE_BOND_LOG(ERR, "Cannot add member to bonded device in 802.3ad" - " mode as member is also a bonded device, only " + RTE_BOND_LOG(ERR, "Cannot add member to bonding device in 802.3ad" + " mode as member is also a bonding device, only " "physical devices can be support in this mode."); return -1; } if (internals->port_id == member_port_id) { RTE_BOND_LOG(ERR, - "Cannot add the bonded device itself as its member."); + "Cannot add the bonding device itself as its member."); return -1; } @@ -194,9 +194,9 @@ rte_eth_bond_free(const char *name) } static int -member_vlan_filter_set(uint16_t bonded_port_id, uint16_t member_port_id) +member_vlan_filter_set(uint16_t bonding_port_id, uint16_t member_port_id) { - struct rte_eth_dev *bonded_eth_dev; + struct rte_eth_dev *bonding_eth_dev; struct bond_dev_private *internals; int found; int res = 0; @@ -204,12 +204,12 @@ member_vlan_filter_set(uint16_t bonded_port_id, uint16_t member_port_id) uint32_t pos = 0; uint16_t first; - bonded_eth_dev = &rte_eth_devices[bonded_port_id]; - if ((bonded_eth_dev->data->dev_conf.rxmode.offloads & + bonding_eth_dev = &rte_eth_devices[bonding_port_id]; + if ((bonding_eth_dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_VLAN_FILTER) == 0) return 0; - internals = bonded_eth_dev->data->dev_private; + internals = bonding_eth_dev->data->dev_private; found = rte_bitmap_scan(internals->vlan_filter_bmp, &pos, &slab); first = pos; @@ -459,23 +459,23 @@ eth_bond_member_inherit_desc_lim_next(struct rte_eth_desc_lim *bond_desc_lim, } static int -__eth_bond_member_add_lock_free(uint16_t bonded_port_id, uint16_t member_port_id) +__eth_bond_member_add_lock_free(uint16_t bonding_port_id, uint16_t member_port_id) { - struct rte_eth_dev *bonded_eth_dev, *member_eth_dev; + struct rte_eth_dev *bonding_eth_dev, *member_eth_dev; struct bond_dev_private *internals; struct rte_eth_link link_props; struct rte_eth_dev_info dev_info; int ret; - bonded_eth_dev = &rte_eth_devices[bonded_port_id]; - internals = bonded_eth_dev->data->dev_private; + bonding_eth_dev = &rte_eth_devices[bonding_port_id]; + internals = bonding_eth_dev->data->dev_private; if (valid_member_port_id(internals, member_port_id) != 0) return -1; member_eth_dev = &rte_eth_devices[member_port_id]; - if (member_eth_dev->data->dev_flags & RTE_ETH_DEV_BONDED_MEMBER) { - RTE_BOND_LOG(ERR, "Member device is already a member of a bonded device"); + if (member_eth_dev->data->dev_flags & RTE_ETH_DEV_BONDING_MEMBER) { + RTE_BOND_LOG(ERR, "Member device is already a member of a bonding device"); return -1; } @@ -501,10 +501,12 @@ __eth_bond_member_add_lock_free(uint16_t bonded_port_id, uint16_t member_port_id internals->members[internals->member_count].reta_size = dev_info.reta_size; if (internals->member_count < 1) { - /* if MAC is not user defined then use MAC of first member add to - * bonded device */ + /* + * if MAC is not user defined then use MAC of first member add to + * bonding device. + */ if (!internals->user_defined_mac) { - if (mac_address_set(bonded_eth_dev, + if (mac_address_set(bonding_eth_dev, member_eth_dev->data->mac_addrs)) { RTE_BOND_LOG(ERR, "Failed to set MAC address"); return -1; @@ -551,7 +553,7 @@ __eth_bond_member_add_lock_free(uint16_t bonded_port_id, uint16_t member_port_id internals->mode == BONDING_MODE_BROADCAST) internals->tx_offload_capa &= ~RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE; - bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &= + bonding_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &= internals->flow_type_rss_offloads; if (member_rte_flow_prepare(internals->member_count, internals) != 0) { @@ -561,7 +563,7 @@ __eth_bond_member_add_lock_free(uint16_t bonded_port_id, uint16_t member_port_id } /* Add additional MAC addresses to the member */ - if (member_add_mac_addresses(bonded_eth_dev, member_port_id) != 0) { + if (member_add_mac_addresses(bonding_eth_dev, member_port_id) != 0) { RTE_BOND_LOG(ERR, "Failed to add mac address(es) to member %hu", member_port_id); return -1; @@ -569,14 +571,14 @@ __eth_bond_member_add_lock_free(uint16_t bonded_port_id, uint16_t member_port_id internals->member_count++; - if (bonded_eth_dev->data->dev_started) { - if (member_configure(bonded_eth_dev, member_eth_dev) != 0) { + if (bonding_eth_dev->data->dev_started) { + if (member_configure(bonding_eth_dev, member_eth_dev) != 0) { internals->member_count--; RTE_BOND_LOG(ERR, "rte_bond_members_configure: port=%d", member_port_id); return -1; } - if (member_start(bonded_eth_dev, member_eth_dev) != 0) { + if (member_start(bonding_eth_dev, member_eth_dev) != 0) { internals->member_count--; RTE_BOND_LOG(ERR, "rte_bond_members_start: port=%d", member_port_id); @@ -585,24 +587,26 @@ __eth_bond_member_add_lock_free(uint16_t bonded_port_id, uint16_t member_port_id } /* Update all member devices MACs */ - mac_address_members_update(bonded_eth_dev); + mac_address_members_update(bonding_eth_dev); - /* Register link status change callback with bonded device pointer as - * argument*/ + /* + * Register link status change callback with bonding device pointer as + * argument. + */ rte_eth_dev_callback_register(member_port_id, RTE_ETH_EVENT_INTR_LSC, - bond_ethdev_lsc_event_callback, &bonded_eth_dev->data->port_id); + bond_ethdev_lsc_event_callback, &bonding_eth_dev->data->port_id); /* - * If bonded device is started then we can add the member to our active + * If bonding device is started then we can add the member to our active * member array. */ - if (bonded_eth_dev->data->dev_started) { + if (bonding_eth_dev->data->dev_started) { ret = rte_eth_link_get_nowait(member_port_id, &link_props); if (ret < 0) { rte_eth_dev_callback_unregister(member_port_id, RTE_ETH_EVENT_INTR_LSC, bond_ethdev_lsc_event_callback, - &bonded_eth_dev->data->port_id); + &bonding_eth_dev->data->port_id); internals->member_count--; RTE_BOND_LOG(ERR, "Member (port %u) link get failed: %s\n", @@ -618,35 +622,35 @@ __eth_bond_member_add_lock_free(uint16_t bonded_port_id, uint16_t member_port_id } } - /* Add member details to bonded device */ - member_eth_dev->data->dev_flags |= RTE_ETH_DEV_BONDED_MEMBER; + /* Add member details to bonding device */ + member_eth_dev->data->dev_flags |= RTE_ETH_DEV_BONDING_MEMBER; - member_vlan_filter_set(bonded_port_id, member_port_id); + member_vlan_filter_set(bonding_port_id, member_port_id); return 0; } int -rte_eth_bond_member_add(uint16_t bonded_port_id, uint16_t member_port_id) +rte_eth_bond_member_add(uint16_t bonding_port_id, uint16_t member_port_id) { - struct rte_eth_dev *bonded_eth_dev; + struct rte_eth_dev *bonding_eth_dev; struct bond_dev_private *internals; int retval; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; - bonded_eth_dev = &rte_eth_devices[bonded_port_id]; - internals = bonded_eth_dev->data->dev_private; + bonding_eth_dev = &rte_eth_devices[bonding_port_id]; + internals = bonding_eth_dev->data->dev_private; if (valid_member_port_id(internals, member_port_id) != 0) return -1; rte_spinlock_lock(&internals->lock); - retval = __eth_bond_member_add_lock_free(bonded_port_id, member_port_id); + retval = __eth_bond_member_add_lock_free(bonding_port_id, member_port_id); rte_spinlock_unlock(&internals->lock); @@ -654,18 +658,18 @@ rte_eth_bond_member_add(uint16_t bonded_port_id, uint16_t member_port_id) } static int -__eth_bond_member_remove_lock_free(uint16_t bonded_port_id, +__eth_bond_member_remove_lock_free(uint16_t bonding_port_id, uint16_t member_port_id) { - struct rte_eth_dev *bonded_eth_dev; + struct rte_eth_dev *bonding_eth_dev; struct bond_dev_private *internals; struct rte_eth_dev *member_eth_dev; struct rte_flow_error flow_error; struct rte_flow *flow; int i, member_idx; - bonded_eth_dev = &rte_eth_devices[bonded_port_id]; - internals = bonded_eth_dev->data->dev_private; + bonding_eth_dev = &rte_eth_devices[bonding_port_id]; + internals = bonding_eth_dev->data->dev_private; if (valid_member_port_id(internals, member_port_id) < 0) return -1; @@ -675,7 +679,7 @@ __eth_bond_member_remove_lock_free(uint16_t bonded_port_id, internals->active_member_count, member_port_id); if (member_idx < internals->active_member_count) - deactivate_member(bonded_eth_dev, member_port_id); + deactivate_member(bonding_eth_dev, member_port_id); member_idx = -1; /* now find in member list */ @@ -691,18 +695,18 @@ __eth_bond_member_remove_lock_free(uint16_t bonded_port_id, return -1; } - /* Un-register link status change callback with bonded device pointer as + /* Un-register link status change callback with bonding device pointer as * argument*/ rte_eth_dev_callback_unregister(member_port_id, RTE_ETH_EVENT_INTR_LSC, bond_ethdev_lsc_event_callback, - &rte_eth_devices[bonded_port_id].data->port_id); + &rte_eth_devices[bonding_port_id].data->port_id); /* Restore original MAC address of member device */ rte_eth_dev_default_mac_addr_set(member_port_id, &internals->members[member_idx].persisted_mac_addr); /* remove additional MAC addresses from the member */ - member_remove_mac_addresses(bonded_eth_dev, member_port_id); + member_remove_mac_addresses(bonding_eth_dev, member_port_id); /* * Remove bond device flows from member device. @@ -718,7 +722,7 @@ __eth_bond_member_remove_lock_free(uint16_t bonded_port_id, member_eth_dev = &rte_eth_devices[member_port_id]; member_remove(internals, member_eth_dev); - member_eth_dev->data->dev_flags &= (~RTE_ETH_DEV_BONDED_MEMBER); + member_eth_dev->data->dev_flags &= (~RTE_ETH_DEV_BONDING_MEMBER); /* first member in the active list will be the primary by default, * otherwise use first device in list */ @@ -729,18 +733,18 @@ __eth_bond_member_remove_lock_free(uint16_t bonded_port_id, internals->current_primary_port = internals->members[0].port_id; else internals->primary_port = 0; - mac_address_members_update(bonded_eth_dev); + mac_address_members_update(bonding_eth_dev); } if (internals->active_member_count < 1) { /* - * if no members are any longer attached to bonded device and MAC is not - * user defined then clear MAC of bonded device as it will be reset + * if no members are any longer attached to bonding device and MAC is not + * user defined then clear MAC of bonding device as it will be reset * when a new member is added. */ if (internals->member_count < 1 && !internals->user_defined_mac) - memset(rte_eth_devices[bonded_port_id].data->mac_addrs, 0, - sizeof(*(rte_eth_devices[bonded_port_id].data->mac_addrs))); + memset(rte_eth_devices[bonding_port_id].data->mac_addrs, 0, + sizeof(*rte_eth_devices[bonding_port_id].data->mac_addrs)); } if (internals->member_count == 0) { internals->rx_offload_capa = 0; @@ -756,21 +760,21 @@ __eth_bond_member_remove_lock_free(uint16_t bonded_port_id, } int -rte_eth_bond_member_remove(uint16_t bonded_port_id, uint16_t member_port_id) +rte_eth_bond_member_remove(uint16_t bonding_port_id, uint16_t member_port_id) { - struct rte_eth_dev *bonded_eth_dev; + struct rte_eth_dev *bonding_eth_dev; struct bond_dev_private *internals; int retval; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; - bonded_eth_dev = &rte_eth_devices[bonded_port_id]; - internals = bonded_eth_dev->data->dev_private; + bonding_eth_dev = &rte_eth_devices[bonding_port_id]; + internals = bonding_eth_dev->data->dev_private; rte_spinlock_lock(&internals->lock); - retval = __eth_bond_member_remove_lock_free(bonded_port_id, member_port_id); + retval = __eth_bond_member_remove_lock_free(bonding_port_id, member_port_id); rte_spinlock_unlock(&internals->lock); @@ -778,44 +782,44 @@ rte_eth_bond_member_remove(uint16_t bonded_port_id, uint16_t member_port_id) } int -rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode) +rte_eth_bond_mode_set(uint16_t bonding_port_id, uint8_t mode) { - struct rte_eth_dev *bonded_eth_dev; + struct rte_eth_dev *bonding_eth_dev; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; - bonded_eth_dev = &rte_eth_devices[bonded_port_id]; + bonding_eth_dev = &rte_eth_devices[bonding_port_id]; - if (check_for_main_bonded_ethdev(bonded_eth_dev) != 0 && + if (check_for_main_bonding_ethdev(bonding_eth_dev) != 0 && mode == BONDING_MODE_8023AD) return -1; - return bond_ethdev_mode_set(bonded_eth_dev, mode); + return bond_ethdev_mode_set(bonding_eth_dev, mode); } int -rte_eth_bond_mode_get(uint16_t bonded_port_id) +rte_eth_bond_mode_get(uint16_t bonding_port_id) { struct bond_dev_private *internals; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; - internals = rte_eth_devices[bonded_port_id].data->dev_private; + internals = rte_eth_devices[bonding_port_id].data->dev_private; return internals->mode; } int -rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t member_port_id) +rte_eth_bond_primary_set(uint16_t bonding_port_id, uint16_t member_port_id) { struct bond_dev_private *internals; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; - internals = rte_eth_devices[bonded_port_id].data->dev_private; + internals = rte_eth_devices[bonding_port_id].data->dev_private; if (valid_member_port_id(internals, member_port_id) != 0) return -1; @@ -829,14 +833,14 @@ rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t member_port_id) } int -rte_eth_bond_primary_get(uint16_t bonded_port_id) +rte_eth_bond_primary_get(uint16_t bonding_port_id) { struct bond_dev_private *internals; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; - internals = rte_eth_devices[bonded_port_id].data->dev_private; + internals = rte_eth_devices[bonding_port_id].data->dev_private; if (internals->member_count < 1) return -1; @@ -845,19 +849,19 @@ rte_eth_bond_primary_get(uint16_t bonded_port_id) } int -rte_eth_bond_members_get(uint16_t bonded_port_id, uint16_t members[], +rte_eth_bond_members_get(uint16_t bonding_port_id, uint16_t members[], uint16_t len) { struct bond_dev_private *internals; uint16_t i; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; if (members == NULL) return -1; - internals = rte_eth_devices[bonded_port_id].data->dev_private; + internals = rte_eth_devices[bonding_port_id].data->dev_private; if (internals->member_count > len) return -1; @@ -869,18 +873,18 @@ rte_eth_bond_members_get(uint16_t bonded_port_id, uint16_t members[], } int -rte_eth_bond_active_members_get(uint16_t bonded_port_id, uint16_t members[], +rte_eth_bond_active_members_get(uint16_t bonding_port_id, uint16_t members[], uint16_t len) { struct bond_dev_private *internals; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; if (members == NULL) return -1; - internals = rte_eth_devices[bonded_port_id].data->dev_private; + internals = rte_eth_devices[bonding_port_id].data->dev_private; if (internals->active_member_count > len) return -1; @@ -892,42 +896,42 @@ rte_eth_bond_active_members_get(uint16_t bonded_port_id, uint16_t members[], } int -rte_eth_bond_mac_address_set(uint16_t bonded_port_id, +rte_eth_bond_mac_address_set(uint16_t bonding_port_id, struct rte_ether_addr *mac_addr) { - struct rte_eth_dev *bonded_eth_dev; + struct rte_eth_dev *bonding_eth_dev; struct bond_dev_private *internals; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; - bonded_eth_dev = &rte_eth_devices[bonded_port_id]; - internals = bonded_eth_dev->data->dev_private; + bonding_eth_dev = &rte_eth_devices[bonding_port_id]; + internals = bonding_eth_dev->data->dev_private; - /* Set MAC Address of Bonded Device */ - if (mac_address_set(bonded_eth_dev, mac_addr)) + /* Set MAC Address of Bonding Device */ + if (mac_address_set(bonding_eth_dev, mac_addr)) return -1; internals->user_defined_mac = 1; /* Update all member devices MACs*/ if (internals->member_count > 0) - return mac_address_members_update(bonded_eth_dev); + return mac_address_members_update(bonding_eth_dev); return 0; } int -rte_eth_bond_mac_address_reset(uint16_t bonded_port_id) +rte_eth_bond_mac_address_reset(uint16_t bonding_port_id) { - struct rte_eth_dev *bonded_eth_dev; + struct rte_eth_dev *bonding_eth_dev; struct bond_dev_private *internals; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; - bonded_eth_dev = &rte_eth_devices[bonded_port_id]; - internals = bonded_eth_dev->data->dev_private; + bonding_eth_dev = &rte_eth_devices[bonding_port_id]; + internals = bonding_eth_dev->data->dev_private; internals->user_defined_mac = 0; @@ -944,29 +948,29 @@ rte_eth_bond_mac_address_reset(uint16_t bonded_port_id) break; } - /* Set MAC Address of Bonded Device */ - if (mac_address_set(bonded_eth_dev, + /* Set MAC Address of Bonding Device */ + if (mac_address_set(bonding_eth_dev, &internals->members[member_port].persisted_mac_addr) != 0) { - RTE_BOND_LOG(ERR, "Failed to set MAC address on bonded device"); + RTE_BOND_LOG(ERR, "Failed to set MAC address on bonding device"); return -1; } /* Update all member devices MAC addresses */ - return mac_address_members_update(bonded_eth_dev); + return mac_address_members_update(bonding_eth_dev); } /* No need to update anything as no members present */ return 0; } int -rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy) +rte_eth_bond_xmit_policy_set(uint16_t bonding_port_id, uint8_t policy) { struct bond_dev_private *internals; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; - internals = rte_eth_devices[bonded_port_id].data->dev_private; + internals = rte_eth_devices[bonding_port_id].data->dev_private; switch (policy) { case BALANCE_XMIT_POLICY_LAYER2: @@ -989,98 +993,98 @@ rte_eth_bond_xmit_policy_set(uint16_t bonded_port_id, uint8_t policy) } int -rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id) +rte_eth_bond_xmit_policy_get(uint16_t bonding_port_id) { struct bond_dev_private *internals; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; - internals = rte_eth_devices[bonded_port_id].data->dev_private; + internals = rte_eth_devices[bonding_port_id].data->dev_private; return internals->balance_xmit_policy; } int -rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms) +rte_eth_bond_link_monitoring_set(uint16_t bonding_port_id, uint32_t internal_ms) { struct bond_dev_private *internals; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; - internals = rte_eth_devices[bonded_port_id].data->dev_private; + internals = rte_eth_devices[bonding_port_id].data->dev_private; internals->link_status_polling_interval_ms = internal_ms; return 0; } int -rte_eth_bond_link_monitoring_get(uint16_t bonded_port_id) +rte_eth_bond_link_monitoring_get(uint16_t bonding_port_id) { struct bond_dev_private *internals; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; - internals = rte_eth_devices[bonded_port_id].data->dev_private; + internals = rte_eth_devices[bonding_port_id].data->dev_private; return internals->link_status_polling_interval_ms; } int -rte_eth_bond_link_down_prop_delay_set(uint16_t bonded_port_id, +rte_eth_bond_link_down_prop_delay_set(uint16_t bonding_port_id, uint32_t delay_ms) { struct bond_dev_private *internals; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; - internals = rte_eth_devices[bonded_port_id].data->dev_private; + internals = rte_eth_devices[bonding_port_id].data->dev_private; internals->link_down_delay_ms = delay_ms; return 0; } int -rte_eth_bond_link_down_prop_delay_get(uint16_t bonded_port_id) +rte_eth_bond_link_down_prop_delay_get(uint16_t bonding_port_id) { struct bond_dev_private *internals; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; - internals = rte_eth_devices[bonded_port_id].data->dev_private; + internals = rte_eth_devices[bonding_port_id].data->dev_private; return internals->link_down_delay_ms; } int -rte_eth_bond_link_up_prop_delay_set(uint16_t bonded_port_id, uint32_t delay_ms) +rte_eth_bond_link_up_prop_delay_set(uint16_t bonding_port_id, uint32_t delay_ms) { struct bond_dev_private *internals; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; - internals = rte_eth_devices[bonded_port_id].data->dev_private; + internals = rte_eth_devices[bonding_port_id].data->dev_private; internals->link_up_delay_ms = delay_ms; return 0; } int -rte_eth_bond_link_up_prop_delay_get(uint16_t bonded_port_id) +rte_eth_bond_link_up_prop_delay_get(uint16_t bonding_port_id) { struct bond_dev_private *internals; - if (valid_bonded_port_id(bonded_port_id) != 0) + if (valid_bonding_port_id(bonding_port_id) != 0) return -1; - internals = rte_eth_devices[bonded_port_id].data->dev_private; + internals = rte_eth_devices[bonding_port_id].data->dev_private; return internals->link_up_delay_ms; } diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 0e17febcf6..be95b71dbb 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -65,7 +65,7 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) uint16_t active_member; int i; - /* Cast to structure, containing bonded device's port id and queue id */ + /* Cast to structure, containing bonding device's port id and queue id */ struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue; internals = bd_rx_q->dev_private; member_count = internals->active_member_count; @@ -99,7 +99,7 @@ bond_ethdev_rx_burst_active_backup(void *queue, struct rte_mbuf **bufs, { struct bond_dev_private *internals; - /* Cast to structure, containing bonded device's port id and queue id */ + /* Cast to structure, containing bonding device's port id and queue id */ struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue; internals = bd_rx_q->dev_private; @@ -295,12 +295,12 @@ static inline uint16_t rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts, bool dedicated_rxq) { - /* Cast to structure, containing bonded device's port id and queue id */ + /* Cast to structure, containing bonding device's port id and queue id */ struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue; struct bond_dev_private *internals = bd_rx_q->dev_private; - struct rte_eth_dev *bonded_eth_dev = + struct rte_eth_dev *bonding_eth_dev = &rte_eth_devices[internals->port_id]; - struct rte_ether_addr *bond_mac = bonded_eth_dev->data->mac_addrs; + struct rte_ether_addr *bond_mac = bonding_eth_dev->data->mac_addrs; struct rte_ether_hdr *hdr; const uint16_t ether_type_slow_be = @@ -1487,14 +1487,14 @@ static const struct rte_ether_addr null_mac_addr; * Add additional MAC addresses to the member */ int -member_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev, +member_add_mac_addresses(struct rte_eth_dev *bonding_eth_dev, uint16_t member_port_id) { int i, ret; struct rte_ether_addr *mac_addr; for (i = 1; i < BOND_MAX_MAC_ADDRS; i++) { - mac_addr = &bonded_eth_dev->data->mac_addrs[i]; + mac_addr = &bonding_eth_dev->data->mac_addrs[i]; if (rte_is_same_ether_addr(mac_addr, &null_mac_addr)) break; @@ -1503,7 +1503,7 @@ member_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev, /* rollback */ for (i--; i > 0; i--) rte_eth_dev_mac_addr_remove(member_port_id, - &bonded_eth_dev->data->mac_addrs[i]); + &bonding_eth_dev->data->mac_addrs[i]); return ret; } } @@ -1515,7 +1515,7 @@ member_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev, * Remove additional MAC addresses from the member */ int -member_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev, +member_remove_mac_addresses(struct rte_eth_dev *bonding_eth_dev, uint16_t member_port_id) { int i, rc, ret; @@ -1523,7 +1523,7 @@ member_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev, rc = 0; for (i = 1; i < BOND_MAX_MAC_ADDRS; i++) { - mac_addr = &bonded_eth_dev->data->mac_addrs[i]; + mac_addr = &bonding_eth_dev->data->mac_addrs[i]; if (rte_is_same_ether_addr(mac_addr, &null_mac_addr)) break; @@ -1537,9 +1537,9 @@ member_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev, } int -mac_address_members_update(struct rte_eth_dev *bonded_eth_dev) +mac_address_members_update(struct rte_eth_dev *bonding_eth_dev) { - struct bond_dev_private *internals = bonded_eth_dev->data->dev_private; + struct bond_dev_private *internals = bonding_eth_dev->data->dev_private; bool set; int i; @@ -1554,7 +1554,7 @@ mac_address_members_update(struct rte_eth_dev *bonded_eth_dev) for (i = 0; i < internals->member_count; i++) { if (rte_eth_dev_default_mac_addr_set( internals->members[i].port_id, - bonded_eth_dev->data->mac_addrs)) { + bonding_eth_dev->data->mac_addrs)) { RTE_BOND_LOG(ERR, "Failed to update port Id %d MAC address", internals->members[i].port_id); return -1; @@ -1562,7 +1562,7 @@ mac_address_members_update(struct rte_eth_dev *bonded_eth_dev) } break; case BONDING_MODE_8023AD: - bond_mode_8023ad_mac_address_update(bonded_eth_dev); + bond_mode_8023ad_mac_address_update(bonding_eth_dev); break; case BONDING_MODE_ACTIVE_BACKUP: case BONDING_MODE_TLB: @@ -1574,7 +1574,7 @@ mac_address_members_update(struct rte_eth_dev *bonded_eth_dev) internals->current_primary_port) { if (rte_eth_dev_default_mac_addr_set( internals->current_primary_port, - bonded_eth_dev->data->mac_addrs)) { + bonding_eth_dev->data->mac_addrs)) { RTE_BOND_LOG(ERR, "Failed to update port Id %d MAC address", internals->current_primary_port); set = false; @@ -1659,11 +1659,11 @@ bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode) static int -member_configure_slow_queue(struct rte_eth_dev *bonded_eth_dev, +member_configure_slow_queue(struct rte_eth_dev *bonding_eth_dev, struct rte_eth_dev *member_eth_dev) { int errval = 0; - struct bond_dev_private *internals = bonded_eth_dev->data->dev_private; + struct bond_dev_private *internals = bonding_eth_dev->data->dev_private; struct port *port = &bond_mode_8023ad_ports[member_eth_dev->data->port_id]; if (port->slow_pool == NULL) { @@ -1717,7 +1717,7 @@ member_configure_slow_queue(struct rte_eth_dev *bonded_eth_dev, } int -member_configure(struct rte_eth_dev *bonded_eth_dev, +member_configure(struct rte_eth_dev *bonding_eth_dev, struct rte_eth_dev *member_eth_dev) { uint16_t nb_rx_queues; @@ -1725,7 +1725,7 @@ member_configure(struct rte_eth_dev *bonded_eth_dev, int errval; - struct bond_dev_private *internals = bonded_eth_dev->data->dev_private; + struct bond_dev_private *internals = bonding_eth_dev->data->dev_private; /* Stop member */ errval = rte_eth_dev_stop(member_eth_dev->data->port_id); @@ -1738,38 +1738,38 @@ member_configure(struct rte_eth_dev *bonded_eth_dev, member_eth_dev->data->dev_conf.intr_conf.lsc = 1; /* If RSS is enabled for bonding, try to enable it for members */ - if (bonded_eth_dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) { - /* rss_key won't be empty if RSS is configured in bonded dev */ + if (bonding_eth_dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) { + /* rss_key won't be empty if RSS is configured in bonding dev */ member_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len = internals->rss_key_len; member_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key = internals->rss_key; member_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = - bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf; + bonding_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf; member_eth_dev->data->dev_conf.rxmode.mq_mode = - bonded_eth_dev->data->dev_conf.rxmode.mq_mode; + bonding_eth_dev->data->dev_conf.rxmode.mq_mode; } else { member_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len = 0; member_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL; member_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = 0; member_eth_dev->data->dev_conf.rxmode.mq_mode = - bonded_eth_dev->data->dev_conf.rxmode.mq_mode; + bonding_eth_dev->data->dev_conf.rxmode.mq_mode; } member_eth_dev->data->dev_conf.rxmode.mtu = - bonded_eth_dev->data->dev_conf.rxmode.mtu; + bonding_eth_dev->data->dev_conf.rxmode.mtu; member_eth_dev->data->dev_conf.link_speeds = - bonded_eth_dev->data->dev_conf.link_speeds; + bonding_eth_dev->data->dev_conf.link_speeds; member_eth_dev->data->dev_conf.txmode.offloads = - bonded_eth_dev->data->dev_conf.txmode.offloads; + bonding_eth_dev->data->dev_conf.txmode.offloads; member_eth_dev->data->dev_conf.rxmode.offloads = - bonded_eth_dev->data->dev_conf.rxmode.offloads; + bonding_eth_dev->data->dev_conf.rxmode.offloads; - nb_rx_queues = bonded_eth_dev->data->nb_rx_queues; - nb_tx_queues = bonded_eth_dev->data->nb_tx_queues; + nb_rx_queues = bonding_eth_dev->data->nb_rx_queues; + nb_tx_queues = bonding_eth_dev->data->nb_tx_queues; if (internals->mode == BONDING_MODE_8023AD) { if (internals->mode4.dedicated_queues.enabled == 1) { @@ -1789,7 +1789,7 @@ member_configure(struct rte_eth_dev *bonded_eth_dev, } errval = rte_eth_dev_set_mtu(member_eth_dev->data->port_id, - bonded_eth_dev->data->mtu); + bonding_eth_dev->data->mtu); if (errval != 0 && errval != -ENOTSUP) { RTE_BOND_LOG(ERR, "rte_eth_dev_set_mtu: port %u, err (%d)", member_eth_dev->data->port_id, errval); @@ -1799,7 +1799,7 @@ member_configure(struct rte_eth_dev *bonded_eth_dev, } int -member_start(struct rte_eth_dev *bonded_eth_dev, +member_start(struct rte_eth_dev *bonding_eth_dev, struct rte_eth_dev *member_eth_dev) { int errval = 0; @@ -1807,12 +1807,12 @@ member_start(struct rte_eth_dev *bonded_eth_dev, struct bond_tx_queue *bd_tx_q; uint16_t q_id; struct rte_flow_error flow_error; - struct bond_dev_private *internals = bonded_eth_dev->data->dev_private; + struct bond_dev_private *internals = bonding_eth_dev->data->dev_private; uint16_t member_port_id = member_eth_dev->data->port_id; /* Setup Rx Queues */ - for (q_id = 0; q_id < bonded_eth_dev->data->nb_rx_queues; q_id++) { - bd_rx_q = (struct bond_rx_queue *)bonded_eth_dev->data->rx_queues[q_id]; + for (q_id = 0; q_id < bonding_eth_dev->data->nb_rx_queues; q_id++) { + bd_rx_q = (struct bond_rx_queue *)bonding_eth_dev->data->rx_queues[q_id]; errval = rte_eth_rx_queue_setup(member_port_id, q_id, bd_rx_q->nb_rx_desc, @@ -1827,8 +1827,8 @@ member_start(struct rte_eth_dev *bonded_eth_dev, } /* Setup Tx Queues */ - for (q_id = 0; q_id < bonded_eth_dev->data->nb_tx_queues; q_id++) { - bd_tx_q = (struct bond_tx_queue *)bonded_eth_dev->data->tx_queues[q_id]; + for (q_id = 0; q_id < bonding_eth_dev->data->nb_tx_queues; q_id++) { + bd_tx_q = (struct bond_tx_queue *)bonding_eth_dev->data->tx_queues[q_id]; errval = rte_eth_tx_queue_setup(member_port_id, q_id, bd_tx_q->nb_tx_desc, @@ -1844,11 +1844,11 @@ member_start(struct rte_eth_dev *bonded_eth_dev, if (internals->mode == BONDING_MODE_8023AD && internals->mode4.dedicated_queues.enabled == 1) { - if (member_configure_slow_queue(bonded_eth_dev, member_eth_dev) + if (member_configure_slow_queue(bonding_eth_dev, member_eth_dev) != 0) return errval; - errval = bond_ethdev_8023ad_flow_verify(bonded_eth_dev, + errval = bond_ethdev_8023ad_flow_verify(bonding_eth_dev, member_port_id); if (errval != 0) { RTE_BOND_LOG(ERR, @@ -1876,7 +1876,7 @@ member_start(struct rte_eth_dev *bonded_eth_dev, if (internals->mode == BONDING_MODE_8023AD && internals->mode4.dedicated_queues.enabled == 1) { - errval = bond_ethdev_8023ad_flow_set(bonded_eth_dev, + errval = bond_ethdev_8023ad_flow_set(bonding_eth_dev, member_port_id); if (errval != 0) { RTE_BOND_LOG(ERR, @@ -1887,11 +1887,11 @@ member_start(struct rte_eth_dev *bonded_eth_dev, } /* If RSS is enabled for bonding, synchronize RETA */ - if (bonded_eth_dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_RSS) { + if (bonding_eth_dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_RSS) { int i; struct bond_dev_private *internals; - internals = bonded_eth_dev->data->dev_private; + internals = bonding_eth_dev->data->dev_private; for (i = 0; i < internals->member_count; i++) { if (internals->members[i].port_id == member_port_id) { @@ -1914,7 +1914,7 @@ member_start(struct rte_eth_dev *bonded_eth_dev, if (member_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) { member_eth_dev->dev_ops->link_update(member_eth_dev, 0); bond_ethdev_lsc_event_callback(member_port_id, - RTE_ETH_EVENT_INTR_LSC, &bonded_eth_dev->data->port_id, + RTE_ETH_EVENT_INTR_LSC, &bonding_eth_dev->data->port_id, NULL); } @@ -1986,7 +1986,7 @@ bond_ethdev_primary_set(struct bond_dev_private *internals, if (internals->active_member_count < 1) internals->current_primary_port = member_port_id; else - /* Search bonded device member ports for new proposed primary port */ + /* Search bonding device member ports for new proposed primary port */ for (i = 0; i < internals->active_member_count; i++) { if (internals->active_members[i] == member_port_id) internals->current_primary_port = member_port_id; @@ -2002,8 +2002,8 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) struct bond_dev_private *internals; int i; - /* member eth dev will be started by bonded device */ - if (check_for_bonded_ethdev(eth_dev)) { + /* member eth dev will be started by bonding device */ + if (check_for_bonding_ethdev(eth_dev)) { RTE_BOND_LOG(ERR, "User tried to explicitly start a member eth_dev (%d)", eth_dev->data->port_id); return -1; @@ -2030,7 +2030,7 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) goto out_err; if (mac_address_set(eth_dev, new_mac_addr) != 0) { - RTE_BOND_LOG(ERR, "bonded port (%d) failed to update MAC address", + RTE_BOND_LOG(ERR, "bonding port (%d) failed to update MAC address", eth_dev->data->port_id); goto out_err; } @@ -2046,20 +2046,20 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) } - /* Reconfigure each member device if starting bonded device */ + /* Reconfigure each member device if starting bonding device */ for (i = 0; i < internals->member_count; i++) { struct rte_eth_dev *member_ethdev = &(rte_eth_devices[internals->members[i].port_id]); if (member_configure(eth_dev, member_ethdev) != 0) { RTE_BOND_LOG(ERR, - "bonded port (%d) failed to reconfigure member device (%d)", + "bonding port (%d) failed to reconfigure member device (%d)", eth_dev->data->port_id, internals->members[i].port_id); goto out_err; } if (member_start(eth_dev, member_ethdev) != 0) { RTE_BOND_LOG(ERR, - "bonded port (%d) failed to start member device (%d)", + "bonding port (%d) failed to start member device (%d)", eth_dev->data->port_id, internals->members[i].port_id); goto out_err; @@ -2209,7 +2209,7 @@ bond_ethdev_cfg_cleanup(struct rte_eth_dev *dev, bool remove) if (rte_eth_bond_member_remove(bond_port_id, port_id) != 0) { RTE_BOND_LOG(ERR, - "Failed to remove port %d from bonded device %s", + "Failed to remove port %d from bonding device %s", port_id, dev->device->name); skipped++; } @@ -2224,7 +2224,7 @@ bond_ethdev_close(struct rte_eth_dev *dev) if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; - RTE_BOND_LOG(INFO, "Closing bonded device %s", dev->device->name); + RTE_BOND_LOG(INFO, "Closing bonding device %s", dev->device->name); bond_ethdev_cfg_cleanup(dev, true); @@ -2262,8 +2262,8 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) internals->candidate_max_rx_pktlen : RTE_ETHER_MAX_JUMBO_FRAME_LEN; - /* Max number of tx/rx queues that the bonded device can support is the - * minimum values of the bonded members, as all members must be capable + /* Max number of tx/rx queues that the bonding device can support is the + * minimum values of the bonding members, as all members must be capable * of supporting the same number of tx/rx queues. */ if (internals->member_count > 0) { @@ -2430,7 +2430,7 @@ bond_ethdev_tx_queue_release(struct rte_eth_dev *dev, uint16_t queue_id) static void bond_ethdev_member_link_status_change_monitor(void *cb_arg) { - struct rte_eth_dev *bonded_ethdev, *member_ethdev; + struct rte_eth_dev *bonding_ethdev, *member_ethdev; struct bond_dev_private *internals; /* Default value for polling member found is true as we don't want to @@ -2440,10 +2440,10 @@ bond_ethdev_member_link_status_change_monitor(void *cb_arg) if (cb_arg == NULL) return; - bonded_ethdev = cb_arg; - internals = bonded_ethdev->data->dev_private; + bonding_ethdev = cb_arg; + internals = bonding_ethdev->data->dev_private; - if (!bonded_ethdev->data->dev_started || + if (!bonding_ethdev->data->dev_started || !internals->link_status_polling_enabled) return; @@ -2470,7 +2470,7 @@ bond_ethdev_member_link_status_change_monitor(void *cb_arg) internals->members[i].last_link_status) { bond_ethdev_lsc_event_callback(internals->members[i].port_id, RTE_ETH_EVENT_INTR_LSC, - &bonded_ethdev->data->port_id, + &bonding_ethdev->data->port_id, NULL); } } @@ -2958,7 +2958,7 @@ int bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param __rte_unused) { - struct rte_eth_dev *bonded_eth_dev; + struct rte_eth_dev *bonding_eth_dev; struct bond_dev_private *internals; struct rte_eth_link link; int rc = -1; @@ -2972,18 +2972,18 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, if (type != RTE_ETH_EVENT_INTR_LSC || param == NULL) return rc; - bonded_eth_dev = &rte_eth_devices[*(uint16_t *)param]; + bonding_eth_dev = &rte_eth_devices[*(uint16_t *)param]; - if (check_for_bonded_ethdev(bonded_eth_dev)) + if (check_for_bonding_ethdev(bonding_eth_dev)) return rc; - internals = bonded_eth_dev->data->dev_private; + internals = bonding_eth_dev->data->dev_private; /* If the device isn't started don't handle interrupts */ - if (!bonded_eth_dev->data->dev_started) + if (!bonding_eth_dev->data->dev_started) return rc; - /* verify that port_id is a valid member of bonded port */ + /* verify that port_id is a valid member of bonding port */ for (i = 0; i < internals->member_count; i++) { if (internals->members[i].port_id == port_id) { valid_member = 1; @@ -3012,15 +3012,15 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, if (active_pos < internals->active_member_count) goto link_update; - /* check link state properties if bonded link is up*/ - if (bonded_eth_dev->data->dev_link.link_status == RTE_ETH_LINK_UP) { - if (link_properties_valid(bonded_eth_dev, &link) != 0) + /* check link state properties if bonding link is up*/ + if (bonding_eth_dev->data->dev_link.link_status == RTE_ETH_LINK_UP) { + if (link_properties_valid(bonding_eth_dev, &link) != 0) RTE_BOND_LOG(ERR, "Invalid link properties " "for member %d in bonding mode %d", port_id, internals->mode); } else { /* inherit member link properties */ - link_properties_set(bonded_eth_dev, &link); + link_properties_set(bonding_eth_dev, &link); } /* If no active member ports then set this port to be @@ -3028,17 +3028,17 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, */ if (internals->active_member_count < 1) { /* If first active member, then change link status */ - bonded_eth_dev->data->dev_link.link_status = + bonding_eth_dev->data->dev_link.link_status = RTE_ETH_LINK_UP; internals->current_primary_port = port_id; lsc_flag = 1; - mac_address_members_update(bonded_eth_dev); - bond_ethdev_promiscuous_update(bonded_eth_dev); - bond_ethdev_allmulticast_update(bonded_eth_dev); + mac_address_members_update(bonding_eth_dev); + bond_ethdev_promiscuous_update(bonding_eth_dev); + bond_ethdev_allmulticast_update(bonding_eth_dev); } - activate_member(bonded_eth_dev, port_id); + activate_member(bonding_eth_dev, port_id); /* If the user has defined the primary port then default to * using it. @@ -3051,7 +3051,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, goto link_update; /* Remove from active member list */ - deactivate_member(bonded_eth_dev, port_id); + deactivate_member(bonding_eth_dev, port_id); if (internals->active_member_count < 1) lsc_flag = 1; @@ -3064,18 +3064,18 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, internals->active_members[0]); else internals->current_primary_port = internals->primary_port; - mac_address_members_update(bonded_eth_dev); - bond_ethdev_promiscuous_update(bonded_eth_dev); - bond_ethdev_allmulticast_update(bonded_eth_dev); + mac_address_members_update(bonding_eth_dev); + bond_ethdev_promiscuous_update(bonding_eth_dev); + bond_ethdev_allmulticast_update(bonding_eth_dev); } } link_update: /** - * Update bonded device link properties after any change to active + * Update bonding device link properties after any change to active * members */ - bond_ethdev_link_update(bonded_eth_dev, 0); + bond_ethdev_link_update(bonding_eth_dev, 0); internals->members[member_idx].last_link_status = link.link_status; if (lsc_flag) { @@ -3083,15 +3083,15 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, if (internals->link_up_delay_ms > 0 || internals->link_down_delay_ms > 0) rte_eal_alarm_cancel(bond_ethdev_delayed_lsc_propagation, - bonded_eth_dev); + bonding_eth_dev); - if (bonded_eth_dev->data->dev_link.link_status) { + if (bonding_eth_dev->data->dev_link.link_status) { if (internals->link_up_delay_ms > 0) rte_eal_alarm_set(internals->link_up_delay_ms * 1000, bond_ethdev_delayed_lsc_propagation, - (void *)bonded_eth_dev); + (void *)bonding_eth_dev); else - rte_eth_dev_callback_process(bonded_eth_dev, + rte_eth_dev_callback_process(bonding_eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL); @@ -3099,9 +3099,9 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, if (internals->link_down_delay_ms > 0) rte_eal_alarm_set(internals->link_down_delay_ms * 1000, bond_ethdev_delayed_lsc_propagation, - (void *)bonded_eth_dev); + (void *)bonding_eth_dev); else - rte_eth_dev_callback_process(bonded_eth_dev, + rte_eth_dev_callback_process(bonding_eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL); } @@ -3543,7 +3543,7 @@ dump_lacp(uint16_t port_id, FILE *f) fprintf(f, "\tIEEE802.3 port: %u\n", port_id); ret = rte_eth_bond_8023ad_conf_get(port_id, &port_conf); if (ret) { - fprintf(f, "\tGet bonded device %u 8023ad config failed\n", + fprintf(f, "\tGet bonding device %u 8023ad config failed\n", port_id); return; } @@ -3697,7 +3697,7 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode) /* Set mode 4 default configuration */ bond_mode_8023ad_setup(eth_dev, NULL); if (bond_ethdev_mode_set(eth_dev, mode)) { - RTE_BOND_LOG(ERR, "Failed to set bonded device %u mode to %u", + RTE_BOND_LOG(ERR, "Failed to set bonding device %u mode to %u", eth_dev->data->port_id, mode); goto err; } @@ -3708,7 +3708,7 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode) RTE_CACHE_LINE_SIZE); if (internals->vlan_filter_bmpmem == NULL) { RTE_BOND_LOG(ERR, - "Failed to allocate vlan bitmap for bonded device %u", + "Failed to allocate vlan bitmap for bonding device %u", eth_dev->data->port_id); goto err; } @@ -3717,7 +3717,7 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode) internals->vlan_filter_bmpmem, vlan_filter_bmp_size); if (internals->vlan_filter_bmp == NULL) { RTE_BOND_LOG(ERR, - "Failed to init vlan bitmap for bonded device %u", + "Failed to init vlan bitmap for bonding device %u", eth_dev->data->port_id); rte_free(internals->vlan_filter_bmpmem); goto err; @@ -3776,12 +3776,12 @@ bond_probe(struct rte_vdev_device *dev) if (rte_kvargs_process(kvlist, PMD_BOND_MODE_KVARG, &bond_ethdev_parse_member_mode_kvarg, &bonding_mode) != 0) { - RTE_BOND_LOG(ERR, "Invalid mode for bonded device %s", + RTE_BOND_LOG(ERR, "Invalid mode for bonding device %s", name); goto parse_error; } } else { - RTE_BOND_LOG(ERR, "Mode must be specified only once for bonded " + RTE_BOND_LOG(ERR, "Mode must be specified only once for bonding " "device %s", name); goto parse_error; } @@ -3793,12 +3793,12 @@ bond_probe(struct rte_vdev_device *dev) &bond_ethdev_parse_socket_id_kvarg, &socket_id) != 0) { RTE_BOND_LOG(ERR, "Invalid socket Id specified for " - "bonded device %s", name); + "bonding device %s", name); goto parse_error; } } else if (arg_count > 1) { RTE_BOND_LOG(ERR, "Socket Id can be specified only once for " - "bonded device %s", name); + "bonding device %s", name); goto parse_error; } else { socket_id = rte_socket_id(); @@ -3822,7 +3822,7 @@ bond_probe(struct rte_vdev_device *dev) &bond_ethdev_parse_member_agg_mode_kvarg, &agg_mode) != 0) { RTE_BOND_LOG(ERR, - "Failed to parse agg selection mode for bonded device %s", + "Failed to parse agg selection mode for bonding device %s", name); goto parse_error; } @@ -3834,7 +3834,7 @@ bond_probe(struct rte_vdev_device *dev) } rte_eth_dev_probing_finish(&rte_eth_devices[port_id]); - RTE_BOND_LOG(INFO, "Create bonded device %s on port %d in mode %u on " + RTE_BOND_LOG(INFO, "Create bonding device %s on port %d in mode %u on " "socket %u.", name, port_id, bonding_mode, socket_id); return 0; @@ -3980,7 +3980,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) internals->max_rx_pktlen = internals->candidate_max_rx_pktlen; /* - * if no kvlist, it means that this bonded device has been created + * if no kvlist, it means that this bonding device has been created * through the bonding api. */ if (!kvlist || internals->kvargs_processing_is_done) @@ -3988,14 +3988,14 @@ bond_ethdev_configure(struct rte_eth_dev *dev) internals->kvargs_processing_is_done = true; - /* Parse MAC address for bonded device */ + /* Parse MAC address for bonding device */ arg_count = rte_kvargs_count(kvlist, PMD_BOND_MAC_ADDR_KVARG); if (arg_count == 1) { struct rte_ether_addr bond_mac; if (rte_kvargs_process(kvlist, PMD_BOND_MAC_ADDR_KVARG, &bond_ethdev_parse_bond_mac_addr_kvarg, &bond_mac) < 0) { - RTE_BOND_LOG(INFO, "Invalid mac address for bonded device %s", + RTE_BOND_LOG(INFO, "Invalid mac address for bonding device %s", name); return -1; } @@ -4003,13 +4003,13 @@ bond_ethdev_configure(struct rte_eth_dev *dev) /* Set MAC address */ if (rte_eth_bond_mac_address_set(port_id, &bond_mac) != 0) { RTE_BOND_LOG(ERR, - "Failed to set mac address on bonded device %s", + "Failed to set mac address on bonding device %s", name); return -1; } } else if (arg_count > 1) { RTE_BOND_LOG(ERR, - "MAC address can be specified only once for bonded device %s", + "MAC address can be specified only once for bonding device %s", name); return -1; } @@ -4023,7 +4023,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) &bond_ethdev_parse_balance_xmit_policy_kvarg, &xmit_policy) != 0) { RTE_BOND_LOG(INFO, - "Invalid xmit policy specified for bonded device %s", + "Invalid xmit policy specified for bonding device %s", name); return -1; } @@ -4031,13 +4031,13 @@ bond_ethdev_configure(struct rte_eth_dev *dev) /* Set balance mode transmit policy*/ if (rte_eth_bond_xmit_policy_set(port_id, xmit_policy) != 0) { RTE_BOND_LOG(ERR, - "Failed to set balance xmit policy on bonded device %s", + "Failed to set balance xmit policy on bonding device %s", name); return -1; } } else if (arg_count > 1) { RTE_BOND_LOG(ERR, - "Transmit policy can be specified only once for bonded device %s", + "Transmit policy can be specified only once for bonding device %s", name); return -1; } @@ -4048,7 +4048,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) &bond_ethdev_parse_member_agg_mode_kvarg, &agg_mode) != 0) { RTE_BOND_LOG(ERR, - "Failed to parse agg selection mode for bonded device %s", + "Failed to parse agg selection mode for bonding device %s", name); } if (internals->mode == BONDING_MODE_8023AD) { @@ -4056,14 +4056,14 @@ bond_ethdev_configure(struct rte_eth_dev *dev) agg_mode); if (ret < 0) { RTE_BOND_LOG(ERR, - "Invalid args for agg selection set for bonded device %s", + "Invalid args for agg selection set for bonding device %s", name); return -1; } } } - /* Parse/add member ports to bonded device */ + /* Parse/add member ports to bonding device */ if (rte_kvargs_count(kvlist, PMD_BOND_MEMBER_PORT_KVARG) > 0) { struct bond_ethdev_member_ports member_ports; unsigned i; @@ -4073,7 +4073,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) if (rte_kvargs_process(kvlist, PMD_BOND_MEMBER_PORT_KVARG, &bond_ethdev_parse_member_port_kvarg, &member_ports) != 0) { RTE_BOND_LOG(ERR, - "Failed to parse member ports for bonded device %s", + "Failed to parse member ports for bonding device %s", name); return -1; } @@ -4081,13 +4081,13 @@ bond_ethdev_configure(struct rte_eth_dev *dev) for (i = 0; i < member_ports.member_count; i++) { if (rte_eth_bond_member_add(port_id, member_ports.members[i]) != 0) { RTE_BOND_LOG(ERR, - "Failed to add port %d as member to bonded device %s", + "Failed to add port %d as member to bonding device %s", member_ports.members[i], name); } } } else { - RTE_BOND_LOG(INFO, "No members specified for bonded device %s", name); + RTE_BOND_LOG(INFO, "No members specified for bonding device %s", name); return -1; } @@ -4101,7 +4101,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) &bond_ethdev_parse_primary_member_port_id_kvarg, &primary_member_port_id) < 0) { RTE_BOND_LOG(INFO, - "Invalid primary member port id specified for bonded device %s", + "Invalid primary member port id specified for bonding device %s", name); return -1; } @@ -4110,13 +4110,13 @@ bond_ethdev_configure(struct rte_eth_dev *dev) if (rte_eth_bond_primary_set(port_id, primary_member_port_id) != 0) { RTE_BOND_LOG(ERR, - "Failed to set primary member port %d on bonded device %s", + "Failed to set primary member port %d on bonding device %s", primary_member_port_id, name); return -1; } } else if (arg_count > 1) { RTE_BOND_LOG(INFO, - "Primary member can be specified only once for bonded device %s", + "Primary member can be specified only once for bonding device %s", name); return -1; } @@ -4131,7 +4131,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) &bond_ethdev_parse_time_ms_kvarg, &lsc_poll_interval_ms) < 0) { RTE_BOND_LOG(INFO, - "Invalid lsc polling interval value specified for bonded" + "Invalid lsc polling interval value specified for bonding" " device %s", name); return -1; } @@ -4139,13 +4139,13 @@ bond_ethdev_configure(struct rte_eth_dev *dev) if (rte_eth_bond_link_monitoring_set(port_id, lsc_poll_interval_ms) != 0) { RTE_BOND_LOG(ERR, - "Failed to set lsc monitor polling interval (%u ms) on bonded device %s", + "Failed to set lsc monitor polling interval (%u ms) on bonding device %s", lsc_poll_interval_ms, name); return -1; } } else if (arg_count > 1) { RTE_BOND_LOG(INFO, - "LSC polling interval can be specified only once for bonded" + "LSC polling interval can be specified only once for bonding" " device %s", name); return -1; } @@ -4161,7 +4161,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) &link_up_delay_ms) < 0) { RTE_BOND_LOG(INFO, "Invalid link up propagation delay value specified for" - " bonded device %s", name); + " bonding device %s", name); return -1; } @@ -4169,14 +4169,14 @@ bond_ethdev_configure(struct rte_eth_dev *dev) if (rte_eth_bond_link_up_prop_delay_set(port_id, link_up_delay_ms) != 0) { RTE_BOND_LOG(ERR, - "Failed to set link up propagation delay (%u ms) on bonded" + "Failed to set link up propagation delay (%u ms) on bonding" " device %s", link_up_delay_ms, name); return -1; } } else if (arg_count > 1) { RTE_BOND_LOG(INFO, "Link up propagation delay can be specified only once for" - " bonded device %s", name); + " bonding device %s", name); return -1; } @@ -4191,7 +4191,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) &link_down_delay_ms) < 0) { RTE_BOND_LOG(INFO, "Invalid link down propagation delay value specified for" - " bonded device %s", name); + " bonding device %s", name); return -1; } @@ -4199,13 +4199,13 @@ bond_ethdev_configure(struct rte_eth_dev *dev) if (rte_eth_bond_link_down_prop_delay_set(port_id, link_down_delay_ms) != 0) { RTE_BOND_LOG(ERR, - "Failed to set link down propagation delay (%u ms) on bonded device %s", + "Failed to set link down propagation delay (%u ms) on bonding device %s", link_down_delay_ms, name); return -1; } } else if (arg_count > 1) { RTE_BOND_LOG(INFO, - "Link down propagation delay can be specified only once for bonded device %s", + "Link down propagation delay can be specified only once for bonding device %s", name); return -1; } @@ -4216,7 +4216,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) &(rte_eth_devices[internals->members[i].port_id]); if (member_configure(dev, member_ethdev) != 0) { RTE_BOND_LOG(ERR, - "bonded port (%d) failed to configure member device (%d)", + "bonding port (%d) failed to configure member device (%d)", dev->data->port_id, internals->members[i].port_id); return -1; diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index 85439e3a41..e717079dd0 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -2036,12 +2036,13 @@ struct rte_eth_dev_owner { /** Device supports link state interrupt */ #define RTE_ETH_DEV_INTR_LSC RTE_BIT32(1) /** Device is a bonded member */ -#define RTE_ETH_DEV_BONDED_MEMBER RTE_BIT32(2) +#define RTE_ETH_DEV_BONDING_MEMBER RTE_BIT32(2) #define RTE_ETH_DEV_BONDED_SLAVE \ do { \ RTE_DEPRECATED(RTE_ETH_DEV_BONDED_SLAVE) \ - RTE_ETH_DEV_BONDED_MEMBER \ + RTE_ETH_DEV_BONDING_MEMBER \ } while (0) + /** Device supports device removal interrupt */ #define RTE_ETH_DEV_INTR_RMV RTE_BIT32(3) /** Device is port representor */