patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] app/test: fix IPv6 header initialization
@ 2021-03-26 16:37 Lance Richardson
  0 siblings, 0 replies; only message in thread
From: Lance Richardson @ 2021-03-26 16:37 UTC (permalink / raw)
  To: Declan Doherty, Pablo de Lara; +Cc: dev, stable

[-- Attachment #1: Type: text/plain, Size: 1335 bytes --]

Fix two issues found when writing PMD unit tests for HW ptype and
L4 checksum offload:

   - The version field in the IPv6 header was being set to zero,
     which prevented hardware from recognizing it as IPv6. The
     IP version field is now set to six.
   - The payload_len field was being initialized using host byte
     order, which (among other things) resulted in incorrect L4
     checksum computation. The payload_len field is now set using
     network (big-endian) byte order.

Fixes: 92073ef961ee ("bond: unit tests")

Signed-off-by: Lance Richardson <>
 app/test/packet_burst_generator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c
index f203f9d09e..8b390853a2 100644
--- a/app/test/packet_burst_generator.c
+++ b/app/test/packet_burst_generator.c
@@ -141,8 +141,8 @@ uint16_t
 initialize_ipv6_header(struct rte_ipv6_hdr *ip_hdr, uint8_t *src_addr,
 		uint8_t *dst_addr, uint16_t pkt_data_len)
-	ip_hdr->vtc_flow = 0;
-	ip_hdr->payload_len = pkt_data_len;
+	ip_hdr->vtc_flow = rte_cpu_to_be_32(0x60000000); /* Set version to 6. */
+	ip_hdr->payload_len = rte_cpu_to_be_16(pkt_data_len);
 	ip_hdr->proto = IPPROTO_UDP;
 	ip_hdr->hop_limits = IP_DEFTTL;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-26 16:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 16:37 [dpdk-stable] [PATCH] app/test: fix IPv6 header initialization Lance Richardson

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ \
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone