> I have used the latest master which includes the patch.

Ok thanks. To confirm this is an issue with the zero-copy mode, can you try to 
create the af_xdp interface in copy mode by adding the 'no-zero-copy' keyword 
in the create command, eg.
~# vppctl create int af_xdp host-if <linux iface> no-zero-copy

If it works in copy mode (as I think it will), it means the zero-copy mode does 
not work correctly for some reason. If it is an offset issue, you can look into 
the incoming data by breaking in af_xdp_device_input_bufs() and see if the 
extracted offset matches the start of the data in the packet.

Best
ben

> commit 1a06e53341224bb08cff2fb6d218415c50f947d3
> Author: Benoît Ganne <bga...@cisco.com>
> Date:   Wed May 19 16:41:03 2021 +0200
> 
>     af_xdp: use desc offset on rx
> 
>     Instead of pre-programming the data offset on rx, use offset passed in
>     the descriptor. This is more robust and future-proof.
> 
>     Type: fix
> 
>     Change-Id: I2bd910d92b8b03d17be5be85a24108be711dc7b9
>     Signed-off-by: Benoît Ganne <bga...@cisco.com>
> 
> Thx, Xuekun
> 
> -----Original Message-----
> From: Benoit Ganne (bganne) <bga...@cisco.com>
> Sent: Tuesday, May 25, 2021 9:18 PM
> To: Hu, Xuekun <xuekun...@intel.com>; vpp-dev@lists.fd.io
> Subject: RE: AF_XDP usage help in VPP21.01
> 
> Hi Xuekun,
> 
> Can you try with the latest master which now contains
> https://gerrit.fd.io/r/c/vpp/+/32384 if you did not already tried it?
> I suspect that could be an offset issue and this change should be more
> robust for those.
> 
> Best
> ben
> 
> > -----Original Message-----
> > From: Hu, Xuekun <xuekun...@intel.com>
> > Sent: mardi 25 mai 2021 14:21
> > To: Benoit Ganne (bganne) <bga...@cisco.com>; vpp-dev@lists.fd.io
> > Subject: RE: AF_XDP usage help in VPP21.01
> >
> > Hi,  Ben.
> >
> > I figured out the problem in my setup that on the ixgbe driver.
> > 1.  ixgbe 5.1.0 (which don't have XDP enabled yet) + VPP master (that
> > have your below patch)  : work 2. ixgbe 5.8.1 (which have XDP enabled)
> > + VPP master : doesn't work
> >
> > Strange. Have any ideas?
> > Thanks.
> >
> > Thx, Xuekun
> >
> > -----Original Message-----
> > From: Benoit Ganne (bganne) <bga...@cisco.com>
> > Sent: Thursday, May 20, 2021 12:50 AM
> > To: Hu, Xuekun <xuekun...@intel.com>; vpp-dev@lists.fd.io
> > Subject: RE: AF_XDP usage help in VPP21.01
> >
> > Hi Xuekun,
> >
> > > Thanks for reply. However my kernel is 5.7.19, and I checked that
> > > only the first patch was included.
> > > So, any more thoughts?
> >
> > Can you try https://gerrit.fd.io/r/c/vpp/+/32384 and see if it fixes
> > you issue?
> >
> > Best
> > ben
> >
> >
> > > -----Original Message-----
> > > From: Benoit Ganne (bganne) <bga...@cisco.com>
> > > Sent: Monday, May 17, 2021 4:26 PM
> > > To: Hu, Xuekun <xuekun...@intel.com>; vpp-dev@lists.fd.io
> > > Subject: RE: AF_XDP usage help in VPP21.01
> > >
> > > Hi Xuekun,
> > >
> > > I suspect you are using a Linux kernel >= 5.9. There was an ABI
> > > change between 5.8 and 5.9, the issue is discussed here:
> > > https://lore.kernel.org/bpf/BYAPR11MB365382C5DB1E5FCC53242609C1549@B
> > > YA
> > > PR11
> > > MB3653.namprd11.prod.outlook.com/
> > > I'd recommend using a Linux kernel between 5.6 and 5.9 for now until
> > > those issues are resolved.
> > >
> > > Best
> > > ben
> > >
> > > > -----Original Message-----
> > > > From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of
> > > > Xuekun
> > > > Sent: jeudi 13 mai 2021 15:17
> > > > To: vpp-dev@lists.fd.io
> > > > Subject: [vpp-dev] AF_XDP usage help in VPP21.01
> > > >
> > > > Hi, All
> > > >
> > > >
> > > >
> > > > I used VPP21.01 and AF_XDP on a physical nic.
> > > >
> > > > I followed the guide in
> > > > https://docs.fd.io/vpp/21.01/d8/d44/af_xdp_doc.html
> > > > <https://docs.fd.io/vpp/21.01/d8/d44/af_xdp_doc.html>  that
> > > >
> > > > 1.      ip link set dev <iface> promisc on
> > > > 2.      vppctl create int af_xdp host-if ...             // load the
> > default
> > > > one, which I think should forward all received packets from kernel
> > > > to
> > > VPP
> > > > 3.      vppctl set int mac address <iface> <mac>    // set to the NIC
> > MAC.
> > > > 4.      vppctl set int ip addr ...
> > > >
> > > >
> > > >
> > > > However "vppctl ping" still failed with "l3 mac mismatch".
> > > >
> > > >
> > > >
> > > > vpp# show errors
> > > >
> > > >    Count                  Node                              Reason
> > > > Severity
> > > >
> > > >         20             ip4-glean                      ARP requests
> > sent
> > > > error
> > > >
> > > >         20           enp9s0f0/0-tx                     sendto
> required
> > > > error
> > > >
> > > >         82           ethernet-input                    l3 mac
> mismatch
> > > > error
> > > >
> > > > From the remote ping target machine, tcpdump did show receiving
> > > > the arp request and sending the arp reply with the correct dmac.
> > > >
> > > >
> > > >
> > > > However in VPP, "trace add af_xdp-input 10", and  "show trace"
> > > >
> > > > Packet 1
> > > >
> > > >
> > > >
> > > > 00:14:16:539735: af_xdp-input
> > > >
> > > >   af_xdp: enp9s0f0/0 (2) next-node ethernet-input
> > > >
> > > > 00:14:16:539744: ethernet-input
> > > >
> > > >   frame: flags 0x1, hw-if-index 2, sw-if-index 2
> > > >
> > > >   0x0000: 00:00:00:00:00:00 -> 00:00:00:00:00:00
> > > >
> > > > 00:14:16:539748: error-punt
> > > >
> > > >   rx:enp9s0f0/0
> > > >
> > > > 00:14:16:539750: punt
> > > >
> > > >   ethernet-input: l3 mac mismatch
> > > >
> > > >
> > > >
> > > > Does anyone have any ideas?
> > > >
> > > > Many thanks.
> > > >
> > > >
> > > >
> > > > Thx, Xuekun
> > > >
> > > >

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#19461): https://lists.fd.io/g/vpp-dev/message/19461
Mute This Topic: https://lists.fd.io/mt/82798670/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to