From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E007FA04FD; Wed, 8 Jun 2022 13:46:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 64DCE42B9D; Wed, 8 Jun 2022 13:46:19 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 6570D4021D; Wed, 8 Jun 2022 13:46:17 +0200 (CEST) Received: from kwepemi500017.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LJ54s2L4JzjYwy; Wed, 8 Jun 2022 19:45:17 +0800 (CST) Received: from localhost.localdomain (10.28.79.22) by kwepemi500017.china.huawei.com (7.221.188.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 8 Jun 2022 19:46:14 +0800 From: Dongdong Liu To: CC: , , , , , , Huisong Li , Dongdong Liu , Chas Williams , "Min Hu (Connor)" , Declan Doherty , Tomasz Kulasek Subject: [PATCH 2/2] app/test: fix bonding RSS test when disable RSS Date: Wed, 8 Jun 2022 19:45:48 +0800 Message-ID: <20220608114548.25837-3-liudongdong3@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20220608114548.25837-1-liudongdong3@huawei.com> References: <20220608114548.25837-1-liudongdong3@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500017.china.huawei.com (7.221.188.110) X-CFilter-Loop: Reflected 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: Huisong Li The "test_rss_lazy" test is used for testing bonding RSS functions when bonded port disable RSS. Currently, this test case can update RSS functions of bonded and slave port if bonded port turns off RSS. It is unreasonable and has been adjusted to be non-updateable in following patch: "93e1ea6dfa99 ethdev: fix RSS update when RSS is disabled" So this patch fixes this test code. Fixes: 43b630244e7e ("app/test: add dynamic bonding RSS configuration") Cc: stable@dpdk.org Signed-off-by: Huisong Li Signed-off-by: Dongdong Liu --- app/test/test_link_bonding_rssconf.c | 78 ++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 5 deletions(-) diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bonding_rssconf.c index 7228965ced..b3d71c6f3a 100644 --- a/app/test/test_link_bonding_rssconf.c +++ b/app/test/test_link_bonding_rssconf.c @@ -468,15 +468,85 @@ test_rss(void) TEST_ASSERT_SUCCESS(test_propagate(), "Propagation test failed"); - TEST_ASSERT(slave_remove_and_add() == 1, "New slave should be synced"); + TEST_ASSERT(slave_remove_and_add() == 1, "remove and add slaves success."); remove_slaves_and_stop_bonded_device(); return TEST_SUCCESS; } + +/** + * Test RSS configuration over bonded and slaves. + */ +static int +test_rss_config_lazy(void) +{ + struct rte_eth_rss_conf bond_rss_conf = {0}; + struct slave_conf *port; + uint8_t rss_key[40]; + uint64_t rss_hf; + int retval; + uint16_t i; + uint8_t n; + + retval = rte_eth_dev_info_get(test_params.bond_port_id, + &test_params.bond_dev_info); + TEST_ASSERT((retval == 0), "Error during getting device (port %u) info: %s\n", + test_params.bond_port_id, strerror(-retval)); + + rss_hf = test_params.bond_dev_info.flow_type_rss_offloads; + if (rss_hf != 0) { + bond_rss_conf.rss_key = NULL; + 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"); + } + + /* Set all keys to zero for all slaves */ + FOR_EACH_PORT(n, port) { + port = &test_params.slave_ports[n]; + retval = rte_eth_dev_rss_hash_conf_get(port->port_id, + &port->rss_conf); + TEST_ASSERT_SUCCESS(retval, "Cannot get slaves RSS configuration"); + memset(port->rss_key, 0, sizeof(port->rss_key)); + port->rss_conf.rss_key = port->rss_key; + port->rss_conf.rss_key_len = sizeof(port->rss_key); + retval = rte_eth_dev_rss_hash_update(port->port_id, + &port->rss_conf); + TEST_ASSERT(retval != 0, "Succeeded in setting slaves RSS keys"); + } + + /* Set RSS keys for bonded port */ + memset(rss_key, 1, sizeof(rss_key)); + bond_rss_conf.rss_hf = rss_hf; + bond_rss_conf.rss_key = rss_key; + bond_rss_conf.rss_key_len = sizeof(rss_key); + + 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 RETA propagation */ + for (i = 0; i < RXTX_QUEUE_COUNT; i++) { + FOR_EACH_PORT(n, port) { + port = &test_params.slave_ports[n]; + retval = reta_set(port->port_id, (i + 1) % RXTX_QUEUE_COUNT, + port->dev_info.reta_size); + TEST_ASSERT(retval != 0, "Succeeded in setting slaves RETA"); + } + + 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"); + } + + return TEST_SUCCESS; +} + /** - * Test propagation logic, when RX_RSS mq_mode is turned off for bonding port + * Test RSS function logic, when RX_RSS mq_mode is turned off for bonding port */ static int test_rss_lazy(void) @@ -497,9 +567,7 @@ test_rss_lazy(void) TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params.bond_port_id), "Failed to start bonding port (%d).", test_params.bond_port_id); - TEST_ASSERT_SUCCESS(test_propagate(), "Propagation test failed"); - - TEST_ASSERT(slave_remove_and_add() == 0, "New slave shouldn't be synced"); + TEST_ASSERT_SUCCESS(test_rss_config_lazy(), "Succeeded in setting RSS hash when RX_RSS mq_mode is turned off"); remove_slaves_and_stop_bonded_device(); -- 2.33.0