Re: Newbie help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Lorenzo Mainardi <lormayna@xxxxxxxxx> writes:

> Hello everyone,
> I am trying to follow this tutorial
> (https://developers.redhat.com/blog/2021/04/01/get-started-with-xdp)
> to learn XDP.
>
> So I compiled my XDP program and then attached it to an interface:
>
> lorenzo@kwaremont:~/progetti/xdp_test$ ip addr show eno1
> 2: eno1: <NO-CARRIER,BROADCAST,MULTICAST,DYNAMIC,UP> mtu 1500
> xdpgeneric/id:37 qdisc pfifo_fast state DOWN group default qlen 1000
>     link/ether 8c:dc:d4:8e:38:c7 brd ff:ff:ff:ff:ff:ff
>     altname enp9s0
>     inet 10.0.8.1/24 scope global eno1
>        valid_lft forever preferred_lft forever
> lorenzo@kwaremont:~/progetti/xdp_test$ ping 10.0.8.1
> PING 10.0.8.1 (10.0.8.1) 56(84) bytes of data.
> 64 bytes from 10.0.8.1: icmp_seq=1 ttl=64 time=0.047 ms
> 64 bytes from 10.0.8.1: icmp_seq=2 ttl=64 time=0.033 ms
> ^C
> --- 10.0.8.1 ping statistics ---
> 2 packets transmitted, 2 received, 0% packet loss, time 1018ms
> rtt min/avg/max/mdev = 0.033/0.040/0.047/0.007 ms
>
> Anyway, it seems that the program is not dropping packets. Is there
> any way to troubleshoot it? Where am I wrong?

Erm, you're pinging the interface from within the machine itself? That
will never hit the XDP hook of the interface, those packets just go over
loopback.

XDP processes packets on ingress, when they arrive *on that interface*.
So you'll have to try the ping from outside the machine itself (although
from the NO-CARRIER flag on the interface it looks like it's not
actually connected to anything?).

For testing, it can be useful to use virtual Ethernet (veth) devices;
they have full support for XDP. The XDP tutorial will help you get setup
to use those: https://github.com/xdp-project/xdp-tutorial

-Toke




[Index of Archives]     [Linux Networking Development]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite Campsites]

  Powered by Linux