All of lore.kernel.org
 help / color / mirror / Atom feed
From: Topi Wala <walatopi@gmail.com>
To: xdp-newbies@vger.kernel.org
Subject: 
Date: Sun, 20 Sep 2020 22:05:22 -0700	[thread overview]
Message-ID: <CAOfgOfuNuRo_dNO=RJcz1XiK_=hZmdopG12XcUFB_s0No3vsRw@mail.gmail.com> (raw)

I have a setup that has 2 namespaces, connected using a linux bridge,
with veth pairs in each of the namespace.

ns1=192.168.1.10/24
ns2=192.168.1.11/24
host-br=192.168.1.1/24

I can ping between host, ns1, ns2 fine.

I'm attaching an xdp filter program
https://github.com/xdp-project/xdp-tools/blob/master/xdp-filter/xdpfilt_dny_ip.c

I'm using bpftool to attach this to ns1-host end. I also attach a
dummy xdp prog (that just returns XDP_PASS) to the end inside the ns1.
I see all ping packets to this destination dropped. Dumping
xdp_stats_map does show counters incremented for XDP_DROP

However, when using bpftool to update the filter_ipv4 map to allow
packets with destination to go through, it doesn't work.

./bpftool map update name filter_ipv4 key 192 168 1 10 value 2 0 0 0 0 0 0 0

I've tried with pinned maps, and different combinations of key/value
as well, to no avail. The lookup just doesn't seem to succeed. Any
suggestions on how I might go about debugging this?

--------

Update:

I did try with bpf_printk to see what was going on, and there seems to
be some really weird issue that happens after the bpf map is updated.

So, to keep things simple, I attached the xdp filter program to my
host bridge interface. Pinging the bridge address from either
namespace drops the packet, AND my printk message is logged and I can
read it from /sys/kernel/debug/tracing/trace_pipe

I insert entries into the map, and then when I try to do the same, not
only does it not work, there is no printk message either. Removing
these entries still does not get the printk message back.

How do I go about debugging this? Are there any known issues with
using maps that are not pinned (I have tried with pinning them, but
didn't debug that setup deeply).

Thanks.
Topi

             reply	other threads:[~2020-09-21  5:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21  5:05 Topi Wala [this message]
2020-09-21  9:44 ` xdp-filter troubles Toke Høiland-Jørgensen
2020-09-21 13:35   ` Topi Wala
2020-09-21 14:02     ` Toke Høiland-Jørgensen
2020-09-22  2:28       ` Topi Wala

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='CAOfgOfuNuRo_dNO=RJcz1XiK_=hZmdopG12XcUFB_s0No3vsRw@mail.gmail.com' \
    --to=walatopi@gmail.com \
    --cc=xdp-newbies@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.