public inbox for xdp-newbies@vger.kernel.org
 help / color / mirror / Atom feed
* Newbie help
@ 2021-12-12 15:06 Lorenzo Mainardi
  2021-12-12 16:47 ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 2+ messages in thread
From: Lorenzo Mainardi @ 2021-12-12 15:06 UTC (permalink / raw)
  To: xdp-newbies

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?

Thank you

-- 
LORENZO MAINARDI

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Newbie help
  2021-12-12 15:06 Newbie help Lorenzo Mainardi
@ 2021-12-12 16:47 ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 2+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-12-12 16:47 UTC (permalink / raw)
  To: Lorenzo Mainardi, xdp-newbies

Lorenzo Mainardi <lormayna@gmail.com> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-12 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-12 15:06 Newbie help Lorenzo Mainardi
2021-12-12 16:47 ` Toke Høiland-Jørgensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox