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 1485845DFC;
Sun, 1 Dec 2024 20:02:58 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
by mails.dpdk.org (Postfix) with ESMTP id B3C7140289;
Sun, 1 Dec 2024 20:02:57 +0100 (CET)
Received: from inbox.dpdk.org (inbox.dpdk.org [95.142.172.178])
by mails.dpdk.org (Postfix) with ESMTP id DF96640268
for ; Sun, 1 Dec 2024 20:02:56 +0100 (CET)
Received: by inbox.dpdk.org (Postfix, from userid 33)
id C6EBD45DFD; Sun, 1 Dec 2024 20:02:56 +0100 (CET)
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [DPDK/core Bug 1590] rte_ipv6_phdr_cksum users wrong proto
Date: Sun, 01 Dec 2024 19:02:55 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: DPDK
X-Bugzilla-Component: core
X-Bugzilla-Version: 20.11
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: maaaah@mail.ru
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: Normal
X-Bugzilla-Assigned-To: dev@dpdk.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform
op_sys bug_status bug_severity priority component assigned_to reporter
target_milestone
Message-ID:
Content-Type: multipart/alternative; boundary=17330797760.FeDD2a95.2563013
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://bugs.dpdk.org/
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All
MIME-Version: 1.0
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
--17330797760.FeDD2a95.2563013
Date: Sun, 1 Dec 2024 20:02:56 +0100
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://bugs.dpdk.org/
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All
https://bugs.dpdk.org/show_bug.cgi?id=3D1590
Bug ID: 1590
Summary: rte_ipv6_phdr_cksum users wrong proto
Product: DPDK
Version: 20.11
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: core
Assignee: dev@dpdk.org
Reporter: maaaah@mail.ru
Target Milestone: ---
It seems rte_ipv6_phdr_cksum implementation uses wrong proto field for
pseudo-header during calculating checksum:
static inline uint16_t
rte_ipv6_phdr_cksum(const struct rte_ipv6_hdr *ipv6_hdr, uint64_t ol_flags)
{
uint32_t sum;
struct {
rte_be32_t len; /* L4 length. */
rte_be32_t proto; /* L4 protocol - top 3 bytes must be zero=
*/
} psd_hdr;
psd_hdr.proto =3D (uint32_t)(ipv6_hdr->proto << 24);
if (ol_flags & PKT_TX_TCP_SEG) {
psd_hdr.len =3D 0;
} else {
psd_hdr.len =3D ipv6_hdr->payload_len;
}
sum =3D __rte_raw_cksum(ipv6_hdr->src_addr,
sizeof(ipv6_hdr->src_addr) + sizeof(ipv6_hdr->dst_addr),
0);
sum =3D __rte_raw_cksum(&psd_hdr, sizeof(psd_hdr), sum);
return __rte_raw_cksum_reduce(sum);
}
proto is taken directly from the header while RFC 8200 clearly states:
The Next Header value in the pseudo-header identifies the upper-layer proto=
col
(e.g., 6 for TCP or 17 for UDP). It will differ from the Next Header value=
in
the IPv6 header if there are extension headers between the IPv6 header and =
the
upper-layer header.
see https://www.rfc-editor.org/rfc/rfc8200
--=20
You are receiving this mail because:
You are the assignee for the bug.=
--17330797760.FeDD2a95.2563013
Date: Sun, 1 Dec 2024 20:02:56 +0100
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://bugs.dpdk.org/
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All
It seems rte_ipv6_phdr_cksum imple=
mentation uses wrong proto field for
pseudo-header during calculating checksum:
static inline uint16_t
rte_ipv6_phdr_cksum(const struct rte_ipv6_hdr *ipv6_hdr, uint64_t ol_flags)
{
uint32_t sum;
struct {
rte_be32_t len; /* L4 length. */
rte_be32_t proto; /* L4 protocol - top 3 bytes must be zero=
*/
} psd_hdr;
psd_hdr.proto =3D (uint32_t)(ipv6_hdr->proto << 24);
if (ol_flags & PKT_TX_TCP_SEG) {
psd_hdr.len =3D 0;
} else {
psd_hdr.len =3D ipv6_hdr->payload_len;
}
sum =3D __rte_raw_cksum(ipv6_hdr->src_addr,
sizeof(ipv6_hdr->src_addr) + sizeof(ipv6_hdr->dst_add=
r),
0);
sum =3D __rte_raw_cksum(&psd_hdr, sizeof(psd_hdr), sum);
return __rte_raw_cksum_reduce(sum);
}
proto is taken directly from the header while RFC 8200 clearly states:
The Next Header value in the pseudo-header identifies the upper-layer proto=
col
(e.g., 6 for TCP or 17 for UDP). It will differ from the Next Header value=
in
the IPv6 header if there are extension headers between the IPv6 header and =
the
upper-layer header.
see https://www.rfc-edit=
or.org/rfc/rfc8200