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 <step...@networkplumber.org> 
Sent: 12 January 2024 22:17
To: Madhuker Mythri <madhuker.myt...@oracle.com>
Cc: dev@dpdk.org; ferruh.yi...@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.myt...@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.

Reply via email to