[External] : Re: [PATCH] net/tap: Modified TAP BPF program as per the Kernel-version upgrade requirements.

Madhuker Mythri madhuker.mythri at oracle.com
Sat Jan 13 18:55:59 CET 2024


Even, in the original code the IP-address converted to host-order from network byte order.
Now, I just replaced with BPF API's to convert to host-order.

-----Original Message-----
From: Stephen Hemminger <stephen at networkplumber.org> 
Sent: 12 January 2024 22:17
To: Madhuker Mythri <madhuker.mythri at oracle.com>
Cc: dev at dpdk.org; ferruh.yigit at amd.com
Subject: [External] : Re: [PATCH] net/tap: Modified TAP BPF program as per the Kernel-version upgrade requirements.

On Fri, 12 Jan 2024 19:18:21 +0530
madhuker.mythri at oracle.com wrote:

>  		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)),
> +			.src_addr = bpf_ntohl(nh.iph.saddr),
> +			.dst_addr = bpf_ntohl(nh.iph.daddr),

Not sure this is correct.
The RSS calculation (Toeplitz) expects that data is in network byte order. See app/test/test_thash.c for example.


More information about the dev mailing list