[PATCH] net/tap: Fixed RSS algorithm to support fragmented packets
Stephen Hemminger
stephen at networkplumber.org
Fri Jun 3 17:53:59 CEST 2022
On Fri, 25 Mar 2022 20:58:09 +0530
madhuker.mythri at oracle.com wrote:
> From: Madhuker Mythri <madhuker.mythri at oracle.com>
>
> As per analysis on DPDK Tap PMD, the existing RSS algorithm considering 4-tuple(Src-IP, Dst-IP, Src-port and Dst-port) and identification of fragment packets is not done, thus we are seeing all the fragmented chunks of single packet differs RSS hash value and distributed across multiple queues.
> The RSS algorithm assumes that, all the incoming IP packets are based on L4-protocol(UDP/TCP) and trying to fetch the L4 fields(Src-port and Dst-port) for each incoming packet, but for the fragmented packets these L4-header will not be present(except for first packet) and should not consider in RSS hash for L4 header fields in-case of fragmented packets.
> Which is a bug in the RSS algorithm implemented in the BPF functionality under TAP PMD.
>
> So, modified the RSS eBPF C-program and generated the structure of C-array in the 'tap_bpf_insns.h' file, which is in eBPF byte-code instructions format.
>
> Bugzilla Id: 870
>
> Signed-off-by: Madhuker Mythri <madhuker.mythri at oracle.com>
> ---
> drivers/net/tap/tap_bpf_insns.h | 3371 +++++++++++++++--------------
> drivers/net/tap/tap_bpf_program.c | 48 +-
> 2 files changed, 1743 insertions(+), 1676 deletions(-)
>
Going back to the original RSS specs on Windows:
https://docs.microsoft.com/en-us/windows-hardware/drivers/network/rss-hashing-types
There is note there:
If a NIC receives a packet that has both IP and TCP headers, NDIS_HASH_TCP_IPV4 should not always
be used. In the case of a fragmented IP packet, NDIS_HASH_IPV4 must be used.
This includes the first fragment which contains both IP and TCP headers.
The modified BPF program in this patch does not do that exactly.
Adding port of 0 is not the same hashing a smaller tuple.
IPV6 fragments need similar fix?
More information about the dev
mailing list