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 8A4FB43D1E; Fri, 22 Mar 2024 08:09:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32A3842E80; Fri, 22 Mar 2024 08:09:31 +0100 (CET) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id 5C08C42DE9 for ; Fri, 22 Mar 2024 08:09:26 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4V1D2g3kFgz1GChk; Fri, 22 Mar 2024 15:08:59 +0800 (CST) Received: from dggpeml500011.china.huawei.com (unknown [7.185.36.84]) by mail.maildlp.com (Postfix) with ESMTPS id C5B29140384; Fri, 22 Mar 2024 15:09:24 +0800 (CST) Received: from localhost.huawei.com (10.50.165.33) by dggpeml500011.china.huawei.com (7.185.36.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 22 Mar 2024 15:09:24 +0800 From: Dengdui Huang To: CC: , , , , , , , , , , , , Subject: [PATCH v2 2/6] test: updated UT for setting lanes Date: Fri, 22 Mar 2024 15:09:19 +0800 Message-ID: <20240322070923.244417-3-huangdengdui@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20240322070923.244417-1-huangdengdui@huawei.com> References: <20240312075238.3319480-4-huangdengdui@huawei.com> <20240322070923.244417-1-huangdengdui@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.50.165.33] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml500011.china.huawei.com (7.185.36.84) 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 The lanes number is added to the ethdev link test case. Signed-off-by: Dengdui Huang --- app/test/test_ethdev_link.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/test/test_ethdev_link.c b/app/test/test_ethdev_link.c index f063a5fe26..1c31bc0448 100644 --- a/app/test/test_ethdev_link.c +++ b/app/test/test_ethdev_link.c @@ -17,14 +17,15 @@ test_link_status_up_default(void) .link_speed = RTE_ETH_SPEED_NUM_2_5G, .link_status = RTE_ETH_LINK_UP, .link_autoneg = RTE_ETH_LINK_AUTONEG, - .link_duplex = RTE_ETH_LINK_FULL_DUPLEX + .link_duplex = RTE_ETH_LINK_FULL_DUPLEX, + .link_lanes = RTE_ETH_LANES_1 }; char text[RTE_ETH_LINK_MAX_STR_LEN]; ret = rte_eth_link_to_str(text, sizeof(text), &link_status); RTE_TEST_ASSERT(ret > 0, "Failed to format default string\n"); printf("Default link up #1: %s\n", text); - TEST_ASSERT_BUFFERS_ARE_EQUAL("Link up at 2.5 Gbps FDX Autoneg", + TEST_ASSERT_BUFFERS_ARE_EQUAL("Link up at 2.5 Gbps 1 lanes FDX Autoneg", text, strlen(text), "Invalid default link status string"); link_status.link_duplex = RTE_ETH_LINK_HALF_DUPLEX; @@ -33,7 +34,7 @@ test_link_status_up_default(void) ret = rte_eth_link_to_str(text, sizeof(text), &link_status); printf("Default link up #2: %s\n", text); RTE_TEST_ASSERT(ret > 0, "Failed to format default string\n"); - TEST_ASSERT_BUFFERS_ARE_EQUAL("Link up at 10 Mbps HDX Fixed", + TEST_ASSERT_BUFFERS_ARE_EQUAL("Link up at 10 Mbps 1 lanes HDX Fixed", text, strlen(text), "Invalid default link status " "string with HDX"); @@ -41,7 +42,7 @@ test_link_status_up_default(void) ret = rte_eth_link_to_str(text, sizeof(text), &link_status); printf("Default link up #3: %s\n", text); RTE_TEST_ASSERT(ret > 0, "Failed to format default string\n"); - TEST_ASSERT_BUFFERS_ARE_EQUAL("Link up at Unknown HDX Fixed", + TEST_ASSERT_BUFFERS_ARE_EQUAL("Link up at Unknown 1 lanes HDX Fixed", text, strlen(text), "Invalid default link status " "string with HDX"); @@ -49,7 +50,7 @@ test_link_status_up_default(void) ret = rte_eth_link_to_str(text, sizeof(text), &link_status); printf("Default link up #3: %s\n", text); RTE_TEST_ASSERT(ret > 0, "Failed to format default string\n"); - TEST_ASSERT_BUFFERS_ARE_EQUAL("Link up at None HDX Fixed", + TEST_ASSERT_BUFFERS_ARE_EQUAL("Link up at None 1 lanes HDX Fixed", text, strlen(text), "Invalid default link status " "string with HDX"); @@ -57,6 +58,7 @@ test_link_status_up_default(void) link_status.link_speed = RTE_ETH_SPEED_NUM_400G; link_status.link_duplex = RTE_ETH_LINK_HALF_DUPLEX; link_status.link_autoneg = RTE_ETH_LINK_AUTONEG; + link_status.link_lanes = RTE_ETH_LANES_4; ret = rte_eth_link_to_str(text, sizeof(text), &link_status); printf("Default link up #4:len = %d, %s\n", ret, text); RTE_TEST_ASSERT(ret < RTE_ETH_LINK_MAX_STR_LEN, @@ -72,7 +74,8 @@ test_link_status_down_default(void) .link_speed = RTE_ETH_SPEED_NUM_2_5G, .link_status = RTE_ETH_LINK_DOWN, .link_autoneg = RTE_ETH_LINK_AUTONEG, - .link_duplex = RTE_ETH_LINK_FULL_DUPLEX + .link_duplex = RTE_ETH_LINK_FULL_DUPLEX, + .link_lanes = RTE_ETH_LANES_1 }; char text[RTE_ETH_LINK_MAX_STR_LEN]; @@ -92,7 +95,8 @@ test_link_status_invalid(void) .link_speed = 55555, .link_status = RTE_ETH_LINK_UP, .link_autoneg = RTE_ETH_LINK_AUTONEG, - .link_duplex = RTE_ETH_LINK_FULL_DUPLEX + .link_duplex = RTE_ETH_LINK_FULL_DUPLEX, + .link_lanes = RTE_ETH_LANES_UNKNOWN }; char text[RTE_ETH_LINK_MAX_STR_LEN]; -- 2.33.0