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 3542BA0C40; Fri, 26 Mar 2021 17:37:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6941E140D57; Fri, 26 Mar 2021 17:37:40 +0100 (CET) Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by mails.dpdk.org (Postfix) with ESMTP id 0FF9440686 for ; Fri, 26 Mar 2021 17:37:39 +0100 (CET) Received: by mail-ej1-f48.google.com with SMTP id u5so9340578ejn.8 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=06iVuvc1w3hr66CRHi7r21d+hvP41UB3B4NLgSoGYsw=; b=Q50hxEivHhReAUKz+TiRgDEGAzlCOycUADMjDGjAevAFvQFeTreC6o4AqjXmmeCLVU I4Rww4nK1BDbWczGcTxxcnFSo2aQSPE04oK15B3IEXCVfpTLgjDECUHc1koxtn/F05AQ zhwCvqKdAZg5THLK53JJZ7tdo9porjGyoPOtw= 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=06iVuvc1w3hr66CRHi7r21d+hvP41UB3B4NLgSoGYsw=; b=QVLVnQcNXpA0qIOrPlWQkxqpiGcikjraTfT2sZB6GCTQC5ZywDN6D6IjC7i7u3Hxy6 AiuqIqWvrO0BenzRkxDUN2Mgnv+gDuljFH/6KXG1Z19wBkCk0DOwLFsWACuyHZgNpwjV A2rhLRZROkhbW03fdBibyXKjVHTDAU6IBcaprwcMnHadidWTrak8ZYoz/kocSshU3qHB wNYlK46k4PgU1tHLfbDBgo77zHLzK3g+jAnI3et+4j2SCnWV3ZYJBkjh7X15efEYhjPF VUNSQfjYYW8IGrETcbHnlShEjeLlWTQLht4BoGKHv7PLhIN05fyT304KYL3RggEtUu26 tHrA== X-Gm-Message-State: AOAM5337dss5tHiJJgBz6u6CsBfNcvVOTDBjUPX3B1jKi3dPyCUUn+d4 yXUVZDqGbXI1+GkvzN92nmIweA== 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="0000000000006eec4205be732646" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-dev] [PATCH] app/test: fix IPv6 header initialization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" --0000000000006eec4205be732646 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 --0000000000006eec4205be732646--