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 0F8F5A0547; Fri, 29 Oct 2021 16:21:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E7161411C9; Fri, 29 Oct 2021 16:21:52 +0200 (CEST) Received: from inbox.dpdk.org (inbox.dpdk.org [95.142.172.178]) by mails.dpdk.org (Postfix) with ESMTP id 05ADD410E1 for ; Fri, 29 Oct 2021 16:21:52 +0200 (CEST) Received: by inbox.dpdk.org (Postfix, from userid 33) id CAE38A0C41; Fri, 29 Oct 2021 16:21:51 +0200 (CEST) From: bugzilla@dpdk.org To: dev@dpdk.org Date: Fri, 29 Oct 2021 14:21:51 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DPDK X-Bugzilla-Component: ethdev X-Bugzilla-Version: 20.11 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: madhuker.mythri@oracle.com 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: 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 MIME-Version: 1.0 Subject: [dpdk-dev] [Bug 870] Fragmented packets incorrect RSS distribution with TAP PMD on Hyper-V platform 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" https://bugs.dpdk.org/show_bug.cgi?id=3D870 Bug ID: 870 Summary: Fragmented packets incorrect RSS distribution with TAP PMD on Hyper-V platform Product: DPDK Version: 20.11 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: Normal Component: ethdev Assignee: dev@dpdk.org Reporter: madhuker.mythri@oracle.com Target Milestone: --- On Hyper-V based platforms(Azure with Accelerated-mode disabled), the netwo= rk ports come up on Failsafe-PMD(and underneath TAP PMD) configured with 4-que= ues RSS enabled. The normal Rx/Tx packets were received and transmitted well. But, when the = IP fragmented packets received on these ports, all the fragments of single-pac= ket were distributed across different queues, instead of arriving to single-que= ue. As per the TAP PMD RSS(based on BPF) algorithm mentioned in the=20 "tap_bpf_program.c" file, the RSS algorithm written based on 4-tuple(L3 Src= /Dst and L4 Src-port/Dst-port) as mentioned in below code snippet, the RSS algor= ithm does not check for the IP fragmented packets. It assumes all the incoming IP based packets will have L4-header and trying= to access the L4 Src-port/Dst-port fields using the pointer of L3-header end-address without cross checking the L4 header presence. since, in-case= of fragmented packets the L4 header will not be present expect for first fragm= ent and thus should not consider L4 Src-port/Dst-port under the 4-tuple hash calculation. So, this RSS hash calculation has a bug in-case of fragmented packets. File-name: ./drivers/net/tap/tap_bpf_program.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D rss_l3_l4(struct __sk_buff *skb) { ..... ..... __u8 *src_dst_addr =3D data + off + offsetof(struct iphdr, saddr); __u8 *src_dst_port =3D data + off + sizeof(struct iphdr); struct ipv4_l3_l4_tuple v4_tuple =3D { .src_addr =3D IPv4(*(src_dst_addr + 0), *(src_dst_addr + 1), *(src_dst_addr + 2), *(src_dst_addr + 3)), .dst_addr =3D IPv4(*(src_dst_addr + 4), *(src_dst_addr + 5), *(src_dst_addr + 6), *(src_dst_addr + 7)), .sport =3D PORT(*(src_dst_port + 0), *(src_dst_port + 1)), .dport =3D PORT(*(src_dst_port + 2), *(src_dst_port + 3)), }; .... .... } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D So, here we can see the L4 src/dst ports were fetched without cross-checking the packet has L4 header and in-case of fragmented packets the L4 src/dst p= orts will be some junk values. Due to this all the fragments of same packet were landing on to different queues and thus re-assembling the fragments got failed. Tested with DPDK-version "20.11.2" and the Linux Kernel-version is "5.4.17". --=20 You are receiving this mail because: You are the assignee for the bug.=