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 6BCF2A0C40 for ; Fri, 26 Mar 2021 17:37:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4CEAF40685; Fri, 26 Mar 2021 17:37:40 +0100 (CET) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by mails.dpdk.org (Postfix) with ESMTP id 0EC0240685 for ; Fri, 26 Mar 2021 17:37:39 +0100 (CET) Received: by mail-ej1-f41.google.com with SMTP id b7so9362344ejv.1 for ; Fri, 26 Mar 2021 09:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:mime-version; bh=v25+VwOHqLlnzeqVL+TwugF6cv463LXK5liuctX+aPE=; b=C95WNFzBrwGx0CODnKMnn/O7EeHOXl1rzsxNJHAKBHuEbFM/XLX9X55ifL6d/gppVE HESHVgqZ5TGvfGKh16dp91k8DNfhxiAVooqa38b6a9FCvDIMjht1JdDeH2VnRyuoOtRc 8R8qLgDWeRtPcL6w6PdioOkc16cVKM2k5BlH0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=v25+VwOHqLlnzeqVL+TwugF6cv463LXK5liuctX+aPE=; b=J8hqsGQEjae04K8r/sRxfdaoWdVzcCIOP06aJTxx6p5tqfR7CslLSJhvud8MzmvT/w sgqWp47Kf9nRejjCrvbRM3MPHGguvs1MfQK/GXnue/sifW12J/si/0ZSIQjYiksV3Ks0 73G9LZ/ad6NWV1Ai2M/J0SHPAQoMLv4BrOic1BgW2HCVce8tHX4Y1pScVfQHyH8yVoAU Ik1Tu8T86BJxxRZsGM1pTTyk3LaDt0aKcTu/WSCmkTE13gSdmzit2gzpCpwJDDkyQFjM b6yba8bGw0wBdmdiukgMQ/8W1MP2C110IZRrTpr/C5vWZsVWHwa7bzKZ1alu6BQOIbuF MD/Q== X-Gm-Message-State: AOAM5334smAkTKLsoZGH6BrpKHW8mf6YopkA11/iFK3N4qhFLBMuyjds fcM65XwWSxLHzay2gvEZax8Tkw== X-Google-Smtp-Source: ABdhPJyDn8j7JF8MA3lowhc6nrvWGm9rlI4h1qCBTWH2m7rAQ9+Aua+NGULoH7GNmI5ly7FBNy405w== X-Received: by 2002:a17:907:75d9:: with SMTP id jl25mr15892511ejc.452.1616776658549; Fri, 26 Mar 2021 09:37:38 -0700 (PDT) Received: from localhost.localdomain ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id gj13sm4037890ejb.118.2021.03.26.09.37.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Mar 2021 09:37:37 -0700 (PDT) From: Lance Richardson To: Declan Doherty , Pablo de Lara Cc: dev@dpdk.org, stable@dpdk.org Date: Fri, 26 Mar 2021 12:37:32 -0400 Message-Id: <20210326163732.763862-1-lance.richardson@broadcom.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="0000000000006eeb8d05be732645" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-stable] [PATCH] app/test: fix IPv6 header initialization 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" --0000000000006eeb8d05be732645 Content-Transfer-Encoding: 8bit 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") Cc: stable@dpdk.org 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; -- 2.25.1 --0000000000006eeb8d05be732645--