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 88D0DA0032 for ; Fri, 18 Feb 2022 13:41:31 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 80FF940141; Fri, 18 Feb 2022 13:41:31 +0100 (CET) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mails.dpdk.org (Postfix) with ESMTP id 4DDE940141 for ; Fri, 18 Feb 2022 13:41:30 +0100 (CET) Received: by mail-wr1-f47.google.com with SMTP id d27so14375231wrc.6 for ; Fri, 18 Feb 2022 04:41:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hUJIzScF+VoRqhNikyLftq3DekIigZwonz+OZXLiRq8=; b=HRH4a/PVVechboa8h+4d0751dntTY89GSdZOtzaIDPDaT5j9Lbir3LEefZUxJjVkOS 5YzYU5UJ+gZA2YUvalwaIEp2eYU8oIw+wfQKZuofMn7jE6fPZLKQZx7OC6nxZYo8jLuT IwQMCijO/QP2/D2zkVN7eW40otr+juUUlZtdG2qgjyL7UXCrtZ3F79cWeU6eEUSQXWsP KWioxUO9d3BgmyQ/w6LbvguCQYY59lxRY8Swdt9hBLMJZZ5R2H8GGZ3wwnBV90kuLgQp TapAdTlJBih735yDQQk8mYUi4oKb7myKPCS+dz/8Lfc9HnhOKgri0VYIRbUM6o4DDrrU nXMA== 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=hUJIzScF+VoRqhNikyLftq3DekIigZwonz+OZXLiRq8=; b=4GTQ6pZZkIAH78fhzBbr3Qg3Il/ABMd4Zixw1kgF8RtJL6Va3f4ULxjaMsm2xMziyi NfYZbdYXcm5k2qppR50QOKMLGeAhzlYcdv1Kjk70goI8BbPOrs0jiLj3Jm/XdHbdJ9X+ OlkHY2ni7rbQwDewVqmUk3kPInUaaeypuqA6fJ0DE7YjorRyopKof3RKXKZ7rgtSjCRC Fspoy2wF1s8KhdwMb8MzJRNMlQc38woy52nxORzZdnGumUCDEsGX8HBY/4XnF977r43Z /npXsUSoIFuWn3OHisWjO6hS/eavvaktGXQClsQiQZFB7/FVEhSJJuYYXdNSIK0v3WJ5 67EA== X-Gm-Message-State: AOAM531QjR7uUfnwAfBiexlVQBTMspNLf9ITtUc4QRnzdSRkqKpUyal0 yPtv4Ips/Ym2kACKhTjxFQSm7hKtn8Fm/KDZ X-Google-Smtp-Source: ABdhPJzr41/2q/nTnLm89NJS9UUqe5vYMfN6Hb7LTN3L57Y0hub7MDsDVkDwNzMB52i+Vi4BOihGyg== X-Received: by 2002:a5d:40cc:0:b0:1e3:f41:b308 with SMTP id b12-20020a5d40cc000000b001e30f41b308mr6119705wrq.284.1645188090020; Fri, 18 Feb 2022 04:41:30 -0800 (PST) Received: from localhost ([2a01:4b00:f41a:3600:360b:9754:2e3a:c344]) by smtp.gmail.com with ESMTPSA id bg23sm5625779wmb.5.2022.02.18.04.41.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 04:41:29 -0800 (PST) From: luca.boccassi@gmail.com To: Viacheslav Ovsiienko Cc: Ferruh Yigit , dpdk stable Subject: patch 'app/testpmd: fix Tx scheduling interval' has been queued to stable release 20.11.5 Date: Fri, 18 Feb 2022 12:38:05 +0000 Message-Id: <20220218123931.1749595-36-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220218123931.1749595-1-luca.boccassi@gmail.com> References: <20220218123931.1749595-1-luca.boccassi@gmail.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 20.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/20/22. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/a26506bce105af8f8ebc8f720a3b558d4c208689 Thanks. Luca Boccassi --- >From a26506bce105af8f8ebc8f720a3b558d4c208689 Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Tue, 23 Nov 2021 18:32:58 +0200 Subject: [PATCH] app/testpmd: fix Tx scheduling interval [ upstream commit 9fac5ca8edaebd0f6206193277876fdebb6f3eb2 ] The first "set txtimes" command parameter specifies the time interval between scheduled send bursts for single queue. This interval should be the same for all the forwarding ports. It requires to maintain the timing related variables on per queue basis instead of per core, as currently implemented. This resulted in wrong burst intervals if two or more cores were generating the scheduled traffic for two or more ports in txonly mode. This patch moves the timing variable to the fstream structure. Only txonly forwarding mode with enabled send scheduling is affected. Fixes: 4940344dab1d ("app/testpmd: add Tx scheduling command") Signed-off-by: Viacheslav Ovsiienko Acked-by: Ferruh Yigit --- app/test-pmd/testpmd.h | 1 + app/test-pmd/txonly.c | 20 ++++++-------------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 43e49a8069..2d4dc05332 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -137,6 +137,7 @@ struct fwd_stream { uint64_t rx_bad_l4_csum ; /**< received packets has bad l4 checksum */ uint64_t rx_bad_outer_l4_csum; /**< received packets has bad outer l4 checksum */ + uint64_t ts_skew; /**< TX scheduling timestamp */ unsigned int gro_times; /**< GRO operation times */ uint64_t core_cycles; /**< used for RX and TX processing */ struct pkt_burst_stats rx_burst_stats; diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c index 8e242e801b..9f5087d215 100644 --- a/app/test-pmd/txonly.c +++ b/app/test-pmd/txonly.c @@ -60,14 +60,10 @@ uint32_t tx_ip_dst_addr = (198U << 24) | (18 << 16) | (0 << 8) | 2; static struct rte_ipv4_hdr pkt_ip_hdr; /**< IP header of transmitted packets. */ RTE_DEFINE_PER_LCORE(uint8_t, _ip_var); /**< IP address variation */ static struct rte_udp_hdr pkt_udp_hdr; /**< UDP header of tx packets. */ -RTE_DEFINE_PER_LCORE(uint64_t, timestamp_qskew); - /**< Timestamp offset per queue */ -RTE_DEFINE_PER_LCORE(uint32_t, timestamp_idone); /**< Timestamp init done. */ static uint64_t timestamp_mask; /**< Timestamp dynamic flag mask */ static int32_t timestamp_off; /**< Timestamp dynamic field offset */ static bool timestamp_enable; /**< Timestamp enable */ -static uint32_t timestamp_init_req; /**< Timestamp initialization request. */ static uint64_t timestamp_initial[RTE_MAX_ETHPORTS]; static void @@ -195,7 +191,7 @@ static inline bool pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, struct rte_ether_hdr *eth_hdr, const uint16_t vlan_tci, const uint16_t vlan_tci_outer, const uint64_t ol_flags, - const uint16_t idx, const struct fwd_stream *fs) + const uint16_t idx, struct fwd_stream *fs) { struct rte_mbuf *pkt_segs[RTE_MAX_SEGS_PER_PKT]; struct rte_mbuf *pkt_seg; @@ -263,11 +259,10 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, update_pkt_header(pkt, pkt_len); if (unlikely(timestamp_enable)) { - uint64_t skew = RTE_PER_LCORE(timestamp_qskew); + uint64_t skew = fs->ts_skew; struct tx_timestamp timestamp_mark; - if (unlikely(timestamp_init_req != - RTE_PER_LCORE(timestamp_idone))) { + if (!skew) { struct rte_eth_dev *dev = &rte_eth_devices[fs->tx_port]; unsigned int txqs_n = dev->data->nb_tx_queues; uint64_t phase = tx_pkt_times_inter * fs->tx_queue / @@ -278,8 +273,7 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, */ skew = timestamp_initial[fs->tx_port] + tx_pkt_times_inter + phase; - RTE_PER_LCORE(timestamp_qskew) = skew; - RTE_PER_LCORE(timestamp_idone) = timestamp_init_req; + fs->ts_skew = skew; } timestamp_mark.pkt_idx = rte_cpu_to_be_16(idx); timestamp_mark.queue_idx = rte_cpu_to_be_16(fs->tx_queue); @@ -289,14 +283,14 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, pkt->ol_flags |= timestamp_mask; *RTE_MBUF_DYNFIELD (pkt, timestamp_off, uint64_t *) = skew; - RTE_PER_LCORE(timestamp_qskew) = skew; + fs->ts_skew = skew; timestamp_mark.ts = rte_cpu_to_be_64(skew); } else if (tx_pkt_times_intra) { skew += tx_pkt_times_intra; pkt->ol_flags |= timestamp_mask; *RTE_MBUF_DYNFIELD (pkt, timestamp_off, uint64_t *) = skew; - RTE_PER_LCORE(timestamp_qskew) = skew; + fs->ts_skew = skew; timestamp_mark.ts = rte_cpu_to_be_64(skew); } else { timestamp_mark.ts = RTE_BE64(0); @@ -450,7 +444,6 @@ tx_only_begin(portid_t pi) timestamp_enable = false; timestamp_mask = 0; timestamp_off = -1; - RTE_PER_LCORE(timestamp_qskew) = 0; dynf = rte_mbuf_dynflag_lookup (RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME, NULL); if (dynf >= 0) @@ -493,7 +486,6 @@ tx_only_begin(portid_t pi) return -EINVAL; } } - timestamp_init_req++; } /* Make sure all settings are visible on forwarding cores.*/ -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-18 12:37:39.501766816 +0000 +++ 0036-app-testpmd-fix-Tx-scheduling-interval.patch 2022-02-18 12:37:37.626790491 +0000 @@ -1 +1 @@ -From 9fac5ca8edaebd0f6206193277876fdebb6f3eb2 Mon Sep 17 00:00:00 2001 +From a26506bce105af8f8ebc8f720a3b558d4c208689 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 9fac5ca8edaebd0f6206193277876fdebb6f3eb2 ] + @@ -20 +21,0 @@ -Cc: stable@dpdk.org @@ -30 +31 @@ -index 2149ecd93a..9967825044 100644 +index 43e49a8069..2d4dc05332 100644 @@ -33 +34,3 @@ -@@ -147,6 +147,7 @@ struct fwd_stream { +@@ -137,6 +137,7 @@ struct fwd_stream { + uint64_t rx_bad_l4_csum ; /**< received packets has bad l4 checksum */ + uint64_t rx_bad_outer_l4_csum; @@ -35,2 +37,0 @@ - uint64_t rx_bad_outer_ip_csum; - /**< received packets having bad outer ip checksum */ @@ -38 +38,0 @@ - #ifdef RTE_LIB_GRO @@ -40 +40,2 @@ - #endif + uint64_t core_cycles; /**< used for RX and TX processing */ + struct pkt_burst_stats rx_burst_stats; @@ -42 +43 @@ -index e8c0c7b926..fc039a622c 100644 +index 8e242e801b..9f5087d215 100644 @@ -45 +46 @@ -@@ -59,14 +59,10 @@ uint32_t tx_ip_dst_addr = (198U << 24) | (18 << 16) | (0 << 8) | 2; +@@ -60,14 +60,10 @@ uint32_t tx_ip_dst_addr = (198U << 24) | (18 << 16) | (0 << 8) | 2; @@ -60 +61 @@ -@@ -194,7 +190,7 @@ static inline bool +@@ -195,7 +191,7 @@ static inline bool @@ -69 +70 @@ -@@ -262,11 +258,10 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, +@@ -263,11 +259,10 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, @@ -79,5 +80,5 @@ -+ if (unlikely(!skew)) { - struct rte_eth_dev_info dev_info; - unsigned int txqs_n; - uint64_t phase; -@@ -289,8 +284,7 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, ++ if (!skew) { + struct rte_eth_dev *dev = &rte_eth_devices[fs->tx_port]; + unsigned int txqs_n = dev->data->nb_tx_queues; + uint64_t phase = tx_pkt_times_inter * fs->tx_queue / +@@ -278,8 +273,7 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, @@ -93 +94 @@ -@@ -300,14 +294,14 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, +@@ -289,14 +283,14 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, @@ -110 +111 @@ -@@ -461,7 +455,6 @@ tx_only_begin(portid_t pi) +@@ -450,7 +444,6 @@ tx_only_begin(portid_t pi) @@ -118 +119 @@ -@@ -504,7 +497,6 @@ tx_only_begin(portid_t pi) +@@ -493,7 +486,6 @@ tx_only_begin(portid_t pi)