On Mon, Nov 20, 2023 at 01:15:41PM -0800, Stanislav Fomichev via xdp-hints wrote: > Date: Mon, 20 Nov 2023 13:15:41 -0800 > From: Stanislav Fomichev <sdf@xxxxxxxxxx> > To: Larysa Zaremba <larysa.zaremba@xxxxxxxxx> > CC: bpf@xxxxxxxxxxxxxxx, ast@xxxxxxxxxx, daniel@xxxxxxxxxxxxx, > andrii@xxxxxxxxxx, martin.lau@xxxxxxxxx, song@xxxxxxxxxx, yhs@xxxxxx, > john.fastabend@xxxxxxxxx, kpsingh@xxxxxxxxxx, haoluo@xxxxxxxxxx, > jolsa@xxxxxxxxxx, David Ahern <dsahern@xxxxxxxxx>, Jakub Kicinski > <kuba@xxxxxxxxxx>, Willem de Bruijn <willemb@xxxxxxxxxx>, Jesper Dangaard > Brouer <hawk@xxxxxxxxxx>, Anatoly Burakov <anatoly.burakov@xxxxxxxxx>, > Alexander Lobakin <alexandr.lobakin@xxxxxxxxx>, Magnus Karlsson > <magnus.karlsson@xxxxxxxxx>, Maryam Tahhan <mtahhan@xxxxxxxxxx>, > xdp-hints@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, Willem de Bruijn > <willemdebruijn.kernel@xxxxxxxxx>, Alexei Starovoitov > <alexei.starovoitov@xxxxxxxxx>, Tariq Toukan <tariqt@xxxxxxxxxxxx>, Saeed > Mahameed <saeedm@xxxxxxxxxxxx>, Maciej Fijalkowski > <maciej.fijalkowski@xxxxxxxxx> > Subject: [xdp-hints] Re: [PATCH bpf-next v7 17/18] selftests/bpf: Use > AF_INET for TX in xdp_metadata > > On 11/15, Larysa Zaremba wrote: > > The easiest way to simulate stripped VLAN tag in veth is to send a packet > > from VLAN interface, attached to veth. Unfortunately, this approach is > > incompatible with AF_XDP on TX side, because VLAN interfaces do not have > > such feature. > > > > Replace AF_XDP packet generation with sending the same datagram via > > AF_INET socket. > > > > This does not change the packet contents or hints values with one notable > > exception: rx_hash_type, which previously was expected to be 0, now is > > expected be at least XDP_RSS_TYPE_L4. > > Btw, I've been thinking a bit about how we can make this test work for both > your VLANs and my upcoming af_xdp tx side. And seems like the best > way, probably, is to have two tx paths exercised: veth and af_xdp. > For veth, we'll verify everything+vlans, for af_xdp we'll verify > everything except the vlans. > > Originally I was assuming that I'll switch this part back to af_xdp, but > I don't think having tx vlan offload makes sense (because af_xdp > userspace can just prepare the correct header from the start). > > So if you're doing a respin, maybe see if we can keep af_xdp tx part > but make it skip the vlans verification? > > generate_packet_af_xdp(); > verify_xsk_metadata(/*verify_vlans=*/false); > geenrate_packet_veth(); > verify_xsk_metadata(/*verify_vlans=*/true); > > ? Sounds good to me, will do so.