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 7F51442800 for ; Wed, 22 Mar 2023 01:42:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A0CD40F18; Wed, 22 Mar 2023 01:42:04 +0100 (CET) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mails.dpdk.org (Postfix) with ESMTP id 44E9042B7E for ; Wed, 22 Mar 2023 01:42:02 +0100 (CET) Received: by mail-wm1-f44.google.com with SMTP id v4-20020a05600c470400b003ee4f06428fso926043wmo.4 for ; Tue, 21 Mar 2023 17:42:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679445722; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=w3fkXW7V4j7Hm8KhhrLxShifvKekjMCoS+dhiRIbBoc=; b=Gy1tpiJVIlEm3re/78G0BmsuLp5xNU2gVP6DMuBul/xHsfrfeWPkcx7AlrNHvxJ/ko Jy3RMY5tQrX0EH3ZbpmH5B+XsKmb3mTYD5fU88o/o6nqRbWTbyIjD+/DKT1CVNhYkqJ0 PTUs90RVIl3hnLvNRlju2N3Ho49dSJRsKe3MgW9OmHnIciUspyYNtasHFVdqoHt4ye4K eylOaQBwy80hBEC+VFV8O1DVn8AJ517RIwZivEot8YiNV+MFXFd7mv32d2uOCUVKAxIg kmcDCDimtQ5Gba6zSa0OmWyGybUhdPRMd+GSG6TOhj/jpDRpCzNdy5N4K8jZMXE8mCue XbNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679445722; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w3fkXW7V4j7Hm8KhhrLxShifvKekjMCoS+dhiRIbBoc=; b=waMLh/3ujQNFCKxqI05QSx/lrgPwi0ijR1P04b9pltuIWApgp47GEY2nM+mR0/n2SY OZoV2VmHk+NPq27ZLhX+c/uf5KzXQDuBoDX5oavxjYXxVnRktYKfUI/CZP814puFZnda GIg6u5mUGLi64cH8euxr01gmbQgp/lVH5RlhkA1Ssb4xRx/HgUFIOGuQpNPsa2bL9Wc2 pYd4hSBI+0fqNuAoKOpiPqy/Mck7U3wxoJz5a5VTvvZTDKUhBfZ1HWDwtr2fTeWEtVOm TQEv9g/aKQMed64oAWfMoJdwJ5TQ3hdWphtBhrmuVyHYFO+fCd4zxEIgsnWs4P1X7jsy n88A== X-Gm-Message-State: AO0yUKXpGEO0w63XHn8K7VMbxvUVa3yhSG+GdlmgdEMCU341MjeRcNIS c431px/QASVVLQiPLFdFBWQB0fq5o0g= X-Google-Smtp-Source: AK7set8udj7DNsvpAgKkhnrd/Wo86+3p36T2pnGQo65feYlAnQof15GkJhJKda5dbZiKGgIK5bfy4w== X-Received: by 2002:a05:600c:218f:b0:3e9:f15b:935b with SMTP id e15-20020a05600c218f00b003e9f15b935bmr3564846wme.32.1679445721907; Tue, 21 Mar 2023 17:42:01 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id y6-20020a05600c364600b003ed2c0a0f37sm15004419wmq.35.2023.03.21.17.42.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Mar 2023 17:42:01 -0700 (PDT) From: luca.boccassi@gmail.com To: Zhuobin Huang Cc: David Marchand , dpdk stable Subject: patch 'test: fix segment length in packet generator' has been queued to stable release 20.11.8 Date: Wed, 22 Mar 2023 00:41:40 +0000 Message-Id: <20230322004155.2333903-4-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230322004155.2333903-1-luca.boccassi@gmail.com> References: <20230315224631.1025649-39-luca.boccassi@gmail.com> <20230322004155.2333903-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.8 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/23/23. 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/5e6d899166d0e85d3111f2c51b7c542dc93b1b88 Thanks. Luca Boccassi --- >From 5e6d899166d0e85d3111f2c51b7c542dc93b1b88 Mon Sep 17 00:00:00 2001 From: Zhuobin Huang Date: Mon, 6 Mar 2023 14:51:56 +0800 Subject: [PATCH] test: fix segment length in packet generator [ upstream commit b88b8af25e7cbb267584bd4c36d3615c4b20109f ] Assign correct data length to each segments according to the given pkt_len and nb_pkt_segs, instead of using pkt_len as the data_len of every packet segment. Fixes: a9c9e9698d5e ("app/test: allow to create packets of different sizes") Signed-off-by: Zhuobin Huang Reviewed-by: David Marchand --- app/test/packet_burst_generator.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c index 0fd7290b0e..121eaf4da6 100644 --- a/app/test/packet_burst_generator.c +++ b/app/test/packet_burst_generator.c @@ -262,11 +262,11 @@ generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, void *ip_hdr, uint8_t ipv4, struct rte_udp_hdr *udp_hdr, int nb_pkt_per_burst, uint8_t pkt_len, uint8_t nb_pkt_segs) { - int i, nb_pkt = 0; - size_t eth_hdr_size; - + const uint8_t pkt_seg_data_len = pkt_len / nb_pkt_segs; struct rte_mbuf *pkt_seg; struct rte_mbuf *pkt; + size_t eth_hdr_size; + int i, nb_pkt = 0; for (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) { pkt = rte_pktmbuf_alloc(mp); @@ -277,7 +277,7 @@ nomore_mbuf: break; } - pkt->data_len = pkt_len; + pkt->data_len = pkt_seg_data_len; pkt_seg = pkt; for (i = 1; i < nb_pkt_segs; i++) { pkt_seg->next = rte_pktmbuf_alloc(mp); @@ -287,7 +287,10 @@ nomore_mbuf: goto nomore_mbuf; } pkt_seg = pkt_seg->next; - pkt_seg->data_len = pkt_len; + if (i != nb_pkt_segs - 1) + pkt_seg->data_len = pkt_seg_data_len; + else + pkt_seg->data_len = pkt_seg_data_len + pkt_len % nb_pkt_segs; } pkt_seg->next = NULL; /* Last segment of packet. */ @@ -343,11 +346,11 @@ generate_packet_burst_proto(struct rte_mempool *mp, uint8_t ipv4, uint8_t proto, void *proto_hdr, int nb_pkt_per_burst, uint8_t pkt_len, uint8_t nb_pkt_segs) { - int i, nb_pkt = 0; - size_t eth_hdr_size; - + const uint8_t pkt_seg_data_len = pkt_len / nb_pkt_segs; struct rte_mbuf *pkt_seg; struct rte_mbuf *pkt; + size_t eth_hdr_size; + int i, nb_pkt = 0; for (nb_pkt = 0; nb_pkt < nb_pkt_per_burst; nb_pkt++) { pkt = rte_pktmbuf_alloc(mp); @@ -358,7 +361,7 @@ nomore_mbuf: break; } - pkt->data_len = pkt_len; + pkt->data_len = pkt_seg_data_len; pkt_seg = pkt; for (i = 1; i < nb_pkt_segs; i++) { pkt_seg->next = rte_pktmbuf_alloc(mp); @@ -368,7 +371,10 @@ nomore_mbuf: goto nomore_mbuf; } pkt_seg = pkt_seg->next; - pkt_seg->data_len = pkt_len; + if (i != nb_pkt_segs - 1) + pkt_seg->data_len = pkt_seg_data_len; + else + pkt_seg->data_len = pkt_seg_data_len + pkt_len % nb_pkt_segs; } pkt_seg->next = NULL; /* Last segment of packet. */ -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-03-21 21:56:37.217270782 +0000 +++ 0004-test-fix-segment-length-in-packet-generator.patch 2023-03-21 21:56:37.008805712 +0000 @@ -1 +1 @@ -From b88b8af25e7cbb267584bd4c36d3615c4b20109f Mon Sep 17 00:00:00 2001 +From 5e6d899166d0e85d3111f2c51b7c542dc93b1b88 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit b88b8af25e7cbb267584bd4c36d3615c4b20109f ] + @@ -15 +16,0 @@ - .mailmap | 1 + @@ -17 +18 @@ - 2 files changed, 17 insertions(+), 10 deletions(-) + 1 file changed, 16 insertions(+), 10 deletions(-) @@ -19,12 +19,0 @@ -diff --git a/.mailmap b/.mailmap -index 4018f0fc47..6a56239c3a 100644 ---- a/.mailmap -+++ b/.mailmap -@@ -1584,6 +1584,7 @@ Zhipeng Lu - Zhirun Yan - Zhiwei He - Zhiyong Yang -+Zhuobin Huang - Zi Hu - Zijie Pan - Ziyang Xuan @@ -32 +21 @@ -index 6b42b9b83b..867a88da00 100644 +index 0fd7290b0e..121eaf4da6 100644 @@ -35 +24 @@ -@@ -263,11 +263,11 @@ generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, +@@ -262,11 +262,11 @@ generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, @@ -50 +39 @@ -@@ -278,7 +278,7 @@ nomore_mbuf: +@@ -277,7 +277,7 @@ nomore_mbuf: @@ -59 +48 @@ -@@ -288,7 +288,10 @@ nomore_mbuf: +@@ -287,7 +287,10 @@ nomore_mbuf: @@ -71 +60 @@ -@@ -344,11 +347,11 @@ generate_packet_burst_proto(struct rte_mempool *mp, +@@ -343,11 +346,11 @@ generate_packet_burst_proto(struct rte_mempool *mp, @@ -86 +75 @@ -@@ -359,7 +362,7 @@ nomore_mbuf: +@@ -358,7 +361,7 @@ nomore_mbuf: @@ -95 +84 @@ -@@ -369,7 +372,10 @@ nomore_mbuf: +@@ -368,7 +371,10 @@ nomore_mbuf: