[PATCH net v4 0/2] bpf: devmap: provide rxq after redirect

Florian Kauer posted 2 patches 2 months, 2 weeks ago
kernel/bpf/devmap.c                                |  11 +-
.../selftests/bpf/prog_tests/xdp_devmap_attach.c   | 114 +++++++++++++++++++--
2 files changed, 115 insertions(+), 10 deletions(-)
[PATCH net v4 0/2] bpf: devmap: provide rxq after redirect
Posted by Florian Kauer 2 months, 2 weeks ago
rxq contains a pointer to the device from where
the redirect happened. Currently, the BPF program
that was executed after a redirect via BPF_MAP_TYPE_DEVMAP*
does not have it set.

Add bugfix and related selftest.

Signed-off-by: Florian Kauer <florian.kauer@linutronix.de>
---
Changes in v4:
- return -> goto out_close, thanks Toke
- Link to v3: https://lore.kernel.org/r/20240909-devel-koalo-fix-ingress-ifindex-v3-0-66218191ecca@linutronix.de

Changes in v3:
- initialize skel to NULL, thanks Stanislav
- Link to v2: https://lore.kernel.org/r/20240906-devel-koalo-fix-ingress-ifindex-v2-0-4caa12c644b4@linutronix.de

Changes in v2:
- changed fixes tag
- added selftest
- Link to v1: https://lore.kernel.org/r/20240905-devel-koalo-fix-ingress-ifindex-v1-1-d12a0d74c29c@linutronix.de

---
Florian Kauer (2):
      bpf: devmap: provide rxq after redirect
      bpf: selftests: send packet to devmap redirect XDP

 kernel/bpf/devmap.c                                |  11 +-
 .../selftests/bpf/prog_tests/xdp_devmap_attach.c   | 114 +++++++++++++++++++--
 2 files changed, 115 insertions(+), 10 deletions(-)
---
base-commit: 8e69c96df771ab469cec278edb47009351de4da6
change-id: 20240905-devel-koalo-fix-ingress-ifindex-b9293d471db6

Best regards,
-- 
Florian Kauer <florian.kauer@linutronix.de>
Re: [PATCH net v4 0/2] bpf: devmap: provide rxq after redirect
Posted by Paolo Abeni 2 months, 1 week ago
On 9/11/24 10:41, Florian Kauer wrote:
> rxq contains a pointer to the device from where
> the redirect happened. Currently, the BPF program
> that was executed after a redirect via BPF_MAP_TYPE_DEVMAP*
> does not have it set.
> 
> Add bugfix and related selftest.
> 
> Signed-off-by: Florian Kauer <florian.kauer@linutronix.de>
> ---
> Changes in v4:
> - return -> goto out_close, thanks Toke
> - Link to v3: https://lore.kernel.org/r/20240909-devel-koalo-fix-ingress-ifindex-v3-0-66218191ecca@linutronix.de
> 
> Changes in v3:
> - initialize skel to NULL, thanks Stanislav
> - Link to v2: https://lore.kernel.org/r/20240906-devel-koalo-fix-ingress-ifindex-v2-0-4caa12c644b4@linutronix.de
> 
> Changes in v2:
> - changed fixes tag
> - added selftest
> - Link to v1: https://lore.kernel.org/r/20240905-devel-koalo-fix-ingress-ifindex-v1-1-d12a0d74c29c@linutronix.de
> 
> ---
> Florian Kauer (2):
>        bpf: devmap: provide rxq after redirect
>        bpf: selftests: send packet to devmap redirect XDP
> 
>   kernel/bpf/devmap.c                                |  11 +-
>   .../selftests/bpf/prog_tests/xdp_devmap_attach.c   | 114 +++++++++++++++++++--
>   2 files changed, 115 insertions(+), 10 deletions(-)

Alex, Daniel: this will go directly via the bpf tree, right?

Thanks,

Paolo
Re: [PATCH net v4 0/2] bpf: devmap: provide rxq after redirect
Posted by Martin KaFai Lau 2 months ago
On 9/19/24 11:12 AM, Paolo Abeni wrote:
> On 9/11/24 10:41, Florian Kauer wrote:
>> rxq contains a pointer to the device from where
>> the redirect happened. Currently, the BPF program
>> that was executed after a redirect via BPF_MAP_TYPE_DEVMAP*
>> does not have it set.
>>
>> Add bugfix and related selftest.
>>
>> Signed-off-by: Florian Kauer <florian.kauer@linutronix.de>
>> ---
>> Changes in v4:
>> - return -> goto out_close, thanks Toke
>> - Link to v3: https://lore.kernel.org/r/20240909-devel-koalo-fix-ingress- 
>> ifindex-v3-0-66218191ecca@linutronix.de
>>
>> Changes in v3:
>> - initialize skel to NULL, thanks Stanislav
>> - Link to v2: https://lore.kernel.org/r/20240906-devel-koalo-fix-ingress- 
>> ifindex-v2-0-4caa12c644b4@linutronix.de
>>
>> Changes in v2:
>> - changed fixes tag
>> - added selftest
>> - Link to v1: https://lore.kernel.org/r/20240905-devel-koalo-fix-ingress- 
>> ifindex-v1-1-d12a0d74c29c@linutronix.de
>>
>> ---
>> Florian Kauer (2):
>>        bpf: devmap: provide rxq after redirect
>>        bpf: selftests: send packet to devmap redirect XDP
>>
>>   kernel/bpf/devmap.c                                |  11 +-
>>   .../selftests/bpf/prog_tests/xdp_devmap_attach.c   | 114 +++++++++++++++++++--
>>   2 files changed, 115 insertions(+), 10 deletions(-)
> 
> Alex, Daniel: this will go directly via the bpf tree, right?

The patches lgtm also. Yes, it can directly go to the bpf tree.

It is useful if I can get an ack from netdev (Paolo?) at least for patch 1. Thanks.