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 2B9D6A0C41 for ; Tue, 30 Nov 2021 17:41:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1F047410F7; Tue, 30 Nov 2021 17:41:33 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id 0BBCC41186 for ; Tue, 30 Nov 2021 17:41:30 +0100 (CET) Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 7A4613F1ED for ; Tue, 30 Nov 2021 16:41:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638290489; bh=2/MTm+beYRCuw1kbE6L6KGTF1cNgX/jsaoTxs7Xx8Mw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uTzVRXJo1teZ2yBG9PET1KzGgOXPfdKNkFG0REDGFon1g8tG+h0lK3k3aoERrXN6p Xjz2kDFnbwJ0QkxLsiF0QeyXNlwsDVyIZ0RaYbZOc9PN9obBVc8oc2zis6yn0vcctL SodwcTodVuVQr0TQv/9dBUzxILXR7ZE7iXSLq1nI9GUDh0J5e94dUxCtF9nvsXskDg T/UKm3b18Xzkokv+aXbwNvIutlDbWWbnKjwQ9pCR15J67mRBbBJfoOSsYdcWus7Y4S h52fAu/b9cUT7ZQqff8sb/VH1A3y8tr/8HFGr5ZVjbw1OUk8QeXtu7WIgN0bCWiVi1 4+2c4rfjK/7mA== Received: by mail-ed1-f70.google.com with SMTP id s12-20020a50ab0c000000b003efdf5a226fso11305890edc.10 for ; Tue, 30 Nov 2021 08:41:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2/MTm+beYRCuw1kbE6L6KGTF1cNgX/jsaoTxs7Xx8Mw=; b=1CQLKkvvmUFybla/YIyQCHrB8wDnyzbQHdob0ClUs0ngGt+EfYfmVC6GY228p8I0H8 o5M/1WYu4scYkWQhQX4iJII3DQstfKw+YTZwAGJAIl56ddwdcWS+CVdCPZoo46cQcFoG wCh7mofggZ6eHx4FdLrYSJxCvMJTwraQluV18pcMuFYo6tBqLMl5+axawBxSmJUytcuT YGsv0M3N6OxSXQk45x74rn8j7Ux02IHDlSve5C3YXwfCVcqz7nTe6/B2iaJ3Oxskt7h2 uwOJxw1k22JcgyrKCWDVcgXKKGgmChUz10U8TimvILAEq14akWuWZYfP9gF5JYlpUVpE 8MWw== X-Gm-Message-State: AOAM530nSSC8R4z4+syypbGmZGLCQkytcu0TroEpsVuPq1qVUOyHWcEO QFWxwJ/JyUsQqbN1OAetb3K6VPZCHXjPt9Dgo9Eju4OiaspEYLYo5guPDxeOjpaUoc9ddKpqpzv hSHxDYOnB/+ouzYQiwPCk19bx X-Received: by 2002:a17:907:7250:: with SMTP id ds16mr289762ejc.54.1638290488990; Tue, 30 Nov 2021 08:41:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqsEg1/nM1+xzN/dryDmx5zEP3OTW02JirG9I6QAFUUnxexQ/MCFK6ayStW7CP3x+qd3SEFg== X-Received: by 2002:a17:907:7250:: with SMTP id ds16mr289743ejc.54.1638290488748; Tue, 30 Nov 2021 08:41:28 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id k21sm11317473edo.87.2021.11.30.08.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 08:41:28 -0800 (PST) From: christian.ehrhardt@canonical.com To: Konstantin Ananyev Cc: David Marchand , dpdk stable Subject: patch 'test: fix ring PMD initialisation' has been queued to stable release 19.11.11 Date: Tue, 30 Nov 2021 17:35:09 +0100 Message-Id: <20211130163605.2460997-105-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> References: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Hi, FYI, your patch has been queued to stable release 19.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before December 10th 2021. 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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/7c712c51061e6d5c39746ff941e135f149813a0f Thanks. Christian Ehrhardt --- >From 7c712c51061e6d5c39746ff941e135f149813a0f 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 [ 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 3a7d9c037a..33b04c0369 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" @@ -145,12 +146,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 fcc9e83558..0f2a346209 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" @@ -155,12 +156,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 af206968b3..e377cfb5da 100644 --- a/app/test/test_pdump.c +++ b/app/test/test_pdump.c @@ -152,11 +152,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.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-30 16:50:11.924866813 +0100 +++ 0105-test-fix-ring-PMD-initialisation.patch 2021-11-30 16:50:05.906874381 +0100 @@ -1 +1 @@ -From b66412f24f17fcba5a248888bf4b3c1f5d6880de Mon Sep 17 00:00:00 2001 +From 7c712c51061e6d5c39746ff941e135f149813a0f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b66412f24f17fcba5a248888bf4b3c1f5d6880de ] + @@ -19 +20,0 @@ -Cc: stable@dpdk.org @@ -87 +88 @@ -index f4a92c9be6..1ff540f4c4 100644 +index 3a7d9c037a..33b04c0369 100644 @@ -98 +99 @@ -@@ -159,12 +160,21 @@ test_bit_packet_forward(void) +@@ -145,12 +146,21 @@ test_bit_packet_forward(void) @@ -122 +123 @@ -index 724acbc315..db06c7d5c7 100644 +index fcc9e83558..0f2a346209 100644 @@ -133 +134 @@ -@@ -158,12 +159,21 @@ static int test_latency_packet_forward(void) +@@ -155,12 +156,21 @@ static int test_latency_packet_forward(void) @@ -157 +158 @@ -index b49fcfb3f1..ea03056b47 100644 +index af206968b3..e377cfb5da 100644 @@ -160 +161 @@ -@@ -147,11 +147,19 @@ send_pkts(void *empty) +@@ -152,11 +152,19 @@ send_pkts(void *empty)