BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Bobby Eshleman" <bobbyeshleman@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH net-next 10/11] selftests: drv-net: add primary_rx_redirect support to NetDrvContEnv
Date: Wed, 29 Apr 2026 22:43:32 +0000	[thread overview]
Message-ID: <20260429224333.A2FC9C19425@smtp.kernel.org> (raw)
In-Reply-To: <20260428-tcp-dm-netkit-v1-10-719280eba4d2@meta.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Hardcoded little-endian byte order for BPF global variable map update breaks the test on big-endian architectures.
--

commit 33211f25ad75b60103232678a2183e101cf2a050
Author: Bobby Eshleman <bobbyeshleman@meta.com>

selftests: drv-net: add primary_rx_redirect support to NetDrvContEnv

When sending from a namespace that has access to a netkit device with a
leased queue, the nk primary in the host namespace needs to redirect its
RX to the physical device. This patch adds that redirection bpf program
and teaches the harness to install it.

> diff --git a/tools/testing/selftests/drivers/net/lib/py/env.py b/tools/testing/selftests/drivers/net/lib/py/env.py
> --- a/tools/testing/selftests/drivers/net/lib/py/env.py
> +++ b/tools/testing/selftests/drivers/net/lib/py/env.py

[ ... ]

> @@ -505,3 +520,31 @@ class NetDrvContEnv(NetDrvEpEnv):
> +    def _attach_primary_rx_redirect_bpf(self):

[ ... ]

> +        bss_map_id = self._find_bss_map_id(redirect_prog_id)
> +        phys_ifindex_bytes = self.ifindex.to_bytes(4, byteorder='little')

Will this cause the selftest to fail on big-endian architectures like s390x?

The test script hardcodes byteorder='little' when serializing the physical
interface index to write to the BPF .bss map. However, the BPF program runs in
native byte order and will read the little-endian map bytes as a byte-reversed
32-bit integer on big-endian architectures.

This would result in an incorrect interface index being passed to
bpf_redirect_neigh(), causing it to fail silently.

> +        value_hex = ' '.join(f'{b:02x}' for b in phys_ifindex_bytes)
> +        bpftool(f"map update id {bss_map_id} key hex 00 00 00 00 value hex {value_hex}")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260428-tcp-dm-netkit-v1-0-719280eba4d2@meta.com?part=10

  reply	other threads:[~2026-04-29 22:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28 22:41 [PATCH net-next 00/11] net: devmem: support devmem with netkit devices Bobby Eshleman
2026-04-28 22:41 ` [PATCH net-next 01/11] net: add netmem_tx modes that indicate dma capability Bobby Eshleman
2026-04-28 22:41 ` [PATCH net-next 02/11] net: bnxt: convert netmem_tx from bool to NETMEM_TX_DMA enum Bobby Eshleman
2026-04-28 22:42 ` [PATCH net-next 03/11] gve: " Bobby Eshleman
2026-04-28 22:42 ` [PATCH net-next 04/11] net/mlx5e: " Bobby Eshleman
2026-04-28 22:42 ` [PATCH net-next 05/11] eth: fbnic: " Bobby Eshleman
2026-04-28 22:42 ` [PATCH net-next 06/11] netkit: set NETMEM_TX_NO_DMA for unreadable skb passthrough Bobby Eshleman
2026-04-28 22:42 ` [PATCH net-next 07/11] net: devmem: support TX over NETMEM_TX_NO_DMA devices Bobby Eshleman
2026-04-29 22:43   ` sashiko-bot
2026-05-01  0:57   ` Jakub Kicinski
2026-05-01  1:07     ` Bobby Eshleman
2026-04-28 22:42 ` [PATCH net-next 08/11] selftests: drv-net: ncdevmem: add -n flag to skip NIC configuration Bobby Eshleman
2026-04-28 22:42 ` [PATCH net-next 09/11] selftests: drv-net: refactor devmem command builders into lib module Bobby Eshleman
2026-04-29 22:43   ` sashiko-bot
2026-04-28 22:42 ` [PATCH net-next 10/11] selftests: drv-net: add primary_rx_redirect support to NetDrvContEnv Bobby Eshleman
2026-04-29 22:43   ` sashiko-bot [this message]
2026-04-28 22:42 ` [PATCH net-next 11/11] selftests: drv-net: add netkit devmem tests Bobby Eshleman
2026-04-29 22:43   ` sashiko-bot
2026-04-29 12:08 ` [PATCH net-next 00/11] net: devmem: support devmem with netkit devices Daniel Borkmann
2026-04-29 15:18   ` Bobby Eshleman
2026-04-29 15:33     ` Daniel Borkmann
2026-05-01  0:59 ` Jakub Kicinski
2026-05-01  1:04   ` Bobby Eshleman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260429224333.A2FC9C19425@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bobbyeshleman@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=sashiko@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox