I had tested with 5.4 and 5.15 kernel-versions with this new changes and works 
well.
I found that the helper functions were introduced in Kernel 4.7 version. So, 
thinking this code should work from Kernel-4.9, as mentioned in the TAP PMD 
link: https://doc.dpdk.org/guides/nics/tap.html.

Yes, I understand BPF program code is very sensitive and difficult to debug. 
However, as per testing this work well(able to load the RSS BPF instructions) 
on Azure/Hyper-V platforms with failsafe/tap PMD.

Thanks,
Madhuker.

-----Original Message-----
From: Stephen Hemminger <step...@networkplumber.org> 
Sent: 05 January 2024 23:10
To: Madhuker Mythri <madhuker.myt...@oracle.com>
Cc: ferruh.yi...@amd.com; dev@dpdk.org
Subject: Re: [External] : Re: [PATCH] net/tap: Modified TAP BPF program as per 
the new Kernel-version upgrade requirements.

On Fri, 5 Jan 2024 14:44:00 +0000
Madhuker Mythri <madhuker.myt...@oracle.com> wrote:

> Hi Stephen,
> 
> The BPF helper man pages implies in that way and the SKB data pointer access 
> was working till 5.4 kernel also, however from Kernel-5.15 version, we do see 
> eBPF verifier throws error when we use SKB data pointer access.
> So, I had used this helper functions and able to resolve the errors. This is 
> helper functions are safe to use and also protects from any non-linear skb 
> data buffer access also.
> 
> So, I think using helper functions is better and safe way to access the SKB 
> data, instead of pointer access.
> 
> Thanks,
> Madhuker.

Using the accessors may mean it won't work with older kernels, but that is not 
a huge concern given how fragile this code is.

Reply via email to