All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [dpdk-dev] [Bug 870] Fragmented packets incorrect RSS distribution with TAP PMD on Hyper-V platform
Date: Fri, 29 Oct 2021 14:21:51 +0000	[thread overview]
Message-ID: <bug-870-3@http.bugs.dpdk.org/> (raw)

https://bugs.dpdk.org/show_bug.cgi?id=870

            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 network
ports come up on Failsafe-PMD(and underneath TAP PMD) configured with 4-queues
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-packet
were distributed across different queues, instead of arriving to single-queue.

As per the TAP PMD RSS(based on BPF) algorithm mentioned in the 
"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 algorithm
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 fragment
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
================ =========================
rss_l3_l4(struct __sk_buff *skb)
{
.....
.....

  __u8 *src_dst_addr = data + off + offsetof(struct iphdr, saddr);
        __u8 *src_dst_port = data + off + sizeof(struct iphdr);
        struct ipv4_l3_l4_tuple v4_tuple = {
            .src_addr = IPv4(*(src_dst_addr + 0),
                    *(src_dst_addr + 1),
                    *(src_dst_addr + 2),
                    *(src_dst_addr + 3)),
            .dst_addr = IPv4(*(src_dst_addr + 4),
                    *(src_dst_addr + 5),
                    *(src_dst_addr + 6),
                    *(src_dst_addr + 7)),
            .sport = PORT(*(src_dst_port + 0),
                    *(src_dst_port + 1)),
            .dport = PORT(*(src_dst_port + 2),
                    *(src_dst_port + 3)),
        };
....
....

}
=========================================

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 ports
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".

-- 
You are receiving this mail because:
You are the assignee for the bug.

             reply	other threads:[~2021-10-29 14:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29 14:21 bugzilla [this message]
2023-11-28 16:25 ` [Bug 870] Fragmented packets incorrect RSS distribution with TAP PMD on Hyper-V platform bugzilla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-870-3@http.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.