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 6E3F0A034F for ; Wed, 10 Nov 2021 07:54:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C03940142; Wed, 10 Nov 2021 07:54:53 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2064.outbound.protection.outlook.com [40.107.223.64]) by mails.dpdk.org (Postfix) with ESMTP id E397040142 for ; Wed, 10 Nov 2021 07:54:51 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GXlaEsBNYm+oASYB+rSFyUI3nn8gwrR++q1EZwLqi0K6R+I4BNz2PHgW/1OLdQIiHfY4JBgCCMzjr0U2dP/TBfabCDpuqpoYQALIZ3TER0Kmc3K6q+Kiy4P/KNxztxKQXaXYUwuvd0LaDvSE1eCBWrN2mnOCLPXekCmg9NIE63bfG4fXJCC9DAeDUePLhL7VZi5xJDgGyFPUp9iyJt0Wnm4E3jhDXGCfa4hOBYofeKL68iOa+EKzUm5fHSJr51JDsBs2o5IG1yGcp1/FXwkbFM9FyyjUwhSkGZ2xgEdUVJeTi8Oqi+pmeqgZ4X+ua0S3qhG0GJz2yol1Q+DG8o+Xcw== 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=wHKVoVwbSiUIs/6kC/OKN1NmBwA5AlrGDUIKCeiA16o=; b=OhiNW1eFeJbyOvovICMwPg5AyqCFyuuKyBmvDJcDrWZsNsOYT3CE8YPU+DsxMpi/USi3LYXzvY8UENX8oCspauROYVARCvI32oKUf+J4WWKVhJbDBpn87jzFXshT3SefjsN4I/Is6XUCakjzvBMh0PUFfbv3x36fJepFpymxL7NbGEt6HEcR4lK5hr1lAygC3kN0Qi5u0H3Ur9vv45w3irceoIGIR0sPkbrhKJMbKsaojBuvb3h33Ux3GKw719voI+uMLS+FBDnZSHtu/fZAQHNPghyH8hIUGk+29nefVqQ4HXGsWxQh7aVCtFNce1CxbOMzJLJJr91MrOjqiyAaJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wHKVoVwbSiUIs/6kC/OKN1NmBwA5AlrGDUIKCeiA16o=; b=FnoXuO3nHE1+t/dp8Qc1L6QEIZN952V9yd7Nwq1bkUaWMasTsRzhxexZM5nUEZ0pLt3UzWzSeO8trNIphidRd1dAQji96zRXQMVIik48YT7BEHvQ5R5YPIxwAbwbfA8+XUgmiciyDOsrtq6RvGwBcQkGZ22LCvuYIbgvNZTIzGIXLbfXYqHDFJm2b6/IINwa4E6C1lsLF1Cn/CfOrCE6Cs2HMHGqdmiP3CSArgA9K6hdM+fGfMyyWM2IJaDSJaBtYlrQd2raPLWqUJ1vomKcxqWUUiY3VmcmW4ey8YcxUNwkHNQBeBzPJTrl2C4NgpO2U9wSvyMkG7vCZo36LUsy1w== Received: from DM6PR07CA0105.namprd07.prod.outlook.com (2603:10b6:5:330::8) by DM6PR12MB4810.namprd12.prod.outlook.com (2603:10b6:5:1f7::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Wed, 10 Nov 2021 06:54:50 +0000 Received: from DM6NAM11FT047.eop-nam11.prod.protection.outlook.com (2603:10b6:5:330:cafe::5b) by DM6PR07CA0105.outlook.office365.com (2603:10b6:5:330::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 10 Nov 2021 06:54:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT047.mail.protection.outlook.com (10.13.172.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:54:49 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:54:47 +0000 From: Xueming Li To: Konstantin Ananyev CC: Luca Boccassi , David Marchand , dpdk stable Date: Wed, 10 Nov 2021 14:31:24 +0800 Message-ID: <20211110063216.2744012-201-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5e8fc87f-9bf1-49ec-d933-08d9a416fd70 X-MS-TrafficTypeDiagnostic: DM6PR12MB4810: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J+IKl4SjEQ7LqRBqkMPNisZyZnKsKtrJVhDxq3oCkZYAHR/s2Q8FoRJ9WtO8udui25HsJtT1F/4tKrWJSX2iZgUhfQ7HSmBx4xsXR2FSuYBZurs7AoeHJkAUj3uVyByxvz/hFEHUDn/3UYVgXK/nmw0iU3x3XQ62CTGgt1jApBB0b3/FCQN3W35Ku/wqwfo7FByDw0J53YP0kim0kSaxR3JfDgizEBRh7gIs25YqBuIJ/bSZBz0A+j5O0gZdR4eh7/24zOgKQrkMP4Ls5ogtHv3SocqfgbjPcZKCUG2m+9yGsg7ZkaS2cZPrfjnEaq3GUq90HBO6DDMJlNtSayIOg29osWKOMW1oGUJyb/zMEcd90D7ASa6Yj7/ySGYUwjU+TA7ScK6z5soceqgHRYFdPMmtBYpw+aT5n0RpI1vS24IUnlhWFaHTkeTXCmMlZcDw3+8a6euocj+KFTP8+Z9bxZ8yg3KCImqITJdnf/PkwRUkRqjmabstW44qBPaos8s3QAu7MelS5JehbvSR3U4DX38MqNDjXArQewBnr0ti9TgygaJ4qeueVibzYgMh8azj2R/Sa2zGGB2uMULJGWVYh4+RSaEVRj08tYAVUw6+6P/jxFu1G4jQ+H/ZsPrsX8DWZEjmWDB7nY47kEpqZs6C+XmAW3mAh4TXExssVd4MzSaY/4x6KjfhE5HXtijh8L4Vu9SC5FlFztesMbdhsi/9+2jEATEOAzEOnvs3/Q7Eq7ZHaWGFW4su8GGvuKrb1Et8rg0MMVix1pRBXu3zQYFbIGFKbI6gdFmK+Nsq8WauD+WInLWlr1l6KghRz1Nl72GXG5xA73b+nDUlB454pccrpQ== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(2616005)(16526019)(186003)(7636003)(5660300002)(6916009)(47076005)(82310400003)(70586007)(4326008)(8676002)(2906002)(36906005)(316002)(8936002)(86362001)(70206006)(36860700001)(53546011)(426003)(336012)(54906003)(26005)(36756003)(83380400001)(1076003)(508600001)(966005)(4001150100001)(55016002)(6286002)(6666004)(7696005)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:54:49.6803 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5e8fc87f-9bf1-49ec-d933-08d9a416fd70 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT047.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4810 Subject: [dpdk-stable] patch 'test: fix ring PMD initialisation' has been queued to stable release 20.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/e9f391e952889dc47ebe53a005ee8ff55725cf31 Thanks. Xueming Li --- >From e9f391e952889dc47ebe53a005ee8ff55725cf31 Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Tue, 26 Oct 2021 12:19:43 +0100 Subject: [PATCH] test: fix ring PMD initialisation Cc: Xueming Li [ upstream commit b66412f24f17fcba5a248888bf4b3c1f5d6880de ] (bitratestats_autotest|latencystats_autotest|pdump_autotest) tests generate a log of error messages like that: test_packet_forward() line 104: Error sending packet to port 0 Send pkts Failed These tests use of app/test/sample_packet_forward.* code. This code creates a portid from a ring, but doesn't properly configure/start it. The fix adds code to configure/start given port before usage. Fixes: 7a0935239b9e ("ethdev: make fast-path functions to use new flat array") Fixes: a52966cd48fd ("test: add helpers using ring PMD Rx/Tx") Reported-by: David Marchand Signed-off-by: Konstantin Ananyev Tested-by: David Marchand --- app/test/sample_packet_forward.c | 29 +++++++++++++++++++++++++++++ app/test/sample_packet_forward.h | 3 +++ app/test/test_bitratestats.c | 12 +++++++++++- app/test/test_latencystats.c | 12 +++++++++++- app/test/test_pdump.c | 12 ++++++++++-- 5 files changed, 64 insertions(+), 4 deletions(-) diff --git a/app/test/sample_packet_forward.c b/app/test/sample_packet_forward.c index 61384b3d9b..aa897274d8 100644 --- a/app/test/sample_packet_forward.c +++ b/app/test/sample_packet_forward.c @@ -15,6 +15,35 @@ #include "sample_packet_forward.h" +/* + * heper function: configure and start test device + */ +int +test_dev_start(uint16_t port, struct rte_mempool *mp) +{ + int32_t rc; + struct rte_eth_conf pconf; + + memset(&pconf, 0, sizeof(pconf)); + + rc = rte_eth_dev_configure(port, NUM_QUEUES, NUM_QUEUES, &pconf); + if (rc != 0) + return rc; + + rc = rte_eth_rx_queue_setup(port, 0, RING_SIZE, SOCKET_ID_ANY, + NULL, mp); + if (rc != 0) + return rc; + + rc = rte_eth_tx_queue_setup(port, 0, RING_SIZE, SOCKET_ID_ANY, + NULL); + if (rc != 0) + return rc; + + rc = rte_eth_dev_start(port); + return rc; +} + /* Sample test to create virtual rings and tx,rx portid from rings */ int test_ring_setup(struct rte_ring **ring, uint16_t *portid) diff --git a/app/test/sample_packet_forward.h b/app/test/sample_packet_forward.h index 6789217de3..af0b1d9924 100644 --- a/app/test/sample_packet_forward.h +++ b/app/test/sample_packet_forward.h @@ -21,6 +21,9 @@ struct rte_ring; /* Sample test to create virtual rings and tx,rx portid from rings */ int test_ring_setup(struct rte_ring **ring, uint16_t *portid); +/* configure and start device created by test_ring_setup */ +int test_dev_start(uint16_t port, struct rte_mempool *mp); + /* Sample test to free the virtual rings */ void test_ring_free(struct rte_ring *rxtx); diff --git a/app/test/test_bitratestats.c b/app/test/test_bitratestats.c index f4a92c9be6..1ff540f4c4 100644 --- a/app/test/test_bitratestats.c +++ b/app/test/test_bitratestats.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "sample_packet_forward.h" #include "test.h" @@ -159,12 +160,21 @@ test_bit_packet_forward(void) printf("allocate mbuf pool Failed\n"); return TEST_FAILED; } + ret = test_dev_start(portid, mp); + if (ret < 0) { + printf("test_dev_start(%hu, %p) failed, error code: %d\n", + portid, mp, ret); + return TEST_FAILED; + } + ret = test_packet_forward(pbuf, portid, QUEUE_ID); if (ret < 0) printf("send pkts Failed\n"); + + rte_eth_dev_stop(portid); test_put_mbuf_to_pool(mp, pbuf); - return TEST_SUCCESS; + return (ret >= 0) ? TEST_SUCCESS : TEST_FAILED; } static int diff --git a/app/test/test_latencystats.c b/app/test/test_latencystats.c index 724acbc315..db06c7d5c7 100644 --- a/app/test/test_latencystats.c +++ b/app/test/test_latencystats.c @@ -6,6 +6,7 @@ #include #include +#include #include #include "rte_lcore.h" #include "rte_metrics.h" @@ -158,12 +159,21 @@ static int test_latency_packet_forward(void) printf("allocate mbuf pool Failed\n"); return TEST_FAILED; } + ret = test_dev_start(portid, mp); + if (ret < 0) { + printf("test_dev_start(%hu, %p) failed, error code: %d\n", + portid, mp, ret); + return TEST_FAILED; + } + ret = test_packet_forward(pbuf, portid, QUEUE_ID); if (ret < 0) printf("send pkts Failed\n"); + + rte_eth_dev_stop(portid); test_put_mbuf_to_pool(mp, pbuf); - return TEST_SUCCESS; + return (ret >= 0) ? TEST_SUCCESS : TEST_FAILED; } static struct diff --git a/app/test/test_pdump.c b/app/test/test_pdump.c index 21fcc1bc4c..03b26dd26d 100644 --- a/app/test/test_pdump.c +++ b/app/test/test_pdump.c @@ -147,11 +147,19 @@ send_pkts(void *empty) ret = test_get_mbuf_from_pool(&mp, pbuf, poolname); if (ret < 0) printf("get_mbuf_from_pool failed\n"); - do { + + ret = test_dev_start(portid, mp); + if (ret < 0) + printf("test_dev_start(%hu, %p) failed, error code: %d\n", + portid, mp, ret); + + while (ret >= 0 && flag_for_send_pkts) { ret = test_packet_forward(pbuf, portid, QUEUE_ID); if (ret < 0) printf("send pkts Failed\n"); - } while (flag_for_send_pkts); + }; + + rte_eth_dev_stop(portid); test_put_mbuf_to_pool(mp, pbuf); return empty; } -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:10.770243814 +0800 +++ 0200-test-fix-ring-PMD-initialisation.patch 2021-11-10 14:17:02.010744945 +0800 @@ -1 +1 @@ -From b66412f24f17fcba5a248888bf4b3c1f5d6880de Mon Sep 17 00:00:00 2001 +From e9f391e952889dc47ebe53a005ee8ff55725cf31 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit b66412f24f17fcba5a248888bf4b3c1f5d6880de ] @@ -19 +21,0 @@ -Cc: stable@dpdk.org @@ -157 +159 @@ -index b49fcfb3f1..ea03056b47 100644 +index 21fcc1bc4c..03b26dd26d 100644