public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: Vladimir Nikishkin <vladimir@nikishkin.pw>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com,
	eng.alaamohamedsoliman.am@gmail.com, gnault@redhat.com,
	razor@blackwall.org, idosch@nvidia.com, liuhangbin@gmail.com,
	eyal.birger@gmail.com, jtoppins@redhat.com
Subject: Re: [PATCH iproute2-next v7] ip-link: add support for nolocalbypass in vxlan
Date: Mon, 5 Jun 2023 11:26:56 +0300	[thread overview]
Message-ID: <ZH2cUO7pFnU/tcXL@shredder> (raw)
In-Reply-To: <87sfb6pfqh.fsf@laptop.lockywolf.net>

On Mon, Jun 05, 2023 at 02:47:12PM +0800, Vladimir Nikishkin wrote:
> 
> Ido Schimmel <idosch@idosch.org> writes:
> 
> > On Sun, Jun 04, 2023 at 10:00:51PM +0800, Vladimir Nikishkin wrote:
> >> Add userspace support for the [no]localbypass vxlan netlink
> >> attribute. With localbypass on (default), the vxlan driver processes
> >> the packets destined to the local machine by itself, bypassing the
> >> userspace nework stack. With nolocalbypass the packets are always
> >> forwarded to the userspace network stack, so userspace programs,
> >> such as tcpdump have a chance to process them.
> >> 
> >> Signed-off-by: Vladimir Nikishkin <vladimir@nikishkin.pw>
> >> ---
> >> v6=>v7:
> >> Use the new vxlan_opts data structure. Rely on the printing loop
> >> in vxlan_print_opt when printing the value of [no] localbypass.
> >
> > Stephen's changes are still not present in the next branch so this patch
> > does not apply
> 
> Sorry for the confusion, I thought that the tree to develop against is
> git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git

iproute2-next is developed at
git://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git

See the README file.

Anyway, patch looks fine, but indentation is a bit off. Please fold this
in:

diff --git a/ip/iplink_vxlan.c b/ip/iplink_vxlan.c
index 70f38a866c3b..7781d60bbb52 100644
--- a/ip/iplink_vxlan.c
+++ b/ip/iplink_vxlan.c
@@ -36,7 +36,7 @@ static const struct vxlan_bool_opt {
        { "udp_zero_csum6_rx", IFLA_VXLAN_UDP_ZERO_CSUM6_RX, false },
        { "remcsum_tx", IFLA_VXLAN_REMCSUM_TX,          false },
        { "remcsum_rx", IFLA_VXLAN_REMCSUM_RX,          false },
-       { "localbypass", IFLA_VXLAN_LOCALBYPASS,                true },
+       { "localbypass", IFLA_VXLAN_LOCALBYPASS,        true },
 };

And the kernel selftest would need to be modified to use the JSON output
(it fails with this version). Something like this:

diff --git a/tools/testing/selftests/net/test_vxlan_nolocalbypass.sh b/tools/testing/selftests/net/test_vxlan_nolocalbypass.sh
index 46067db53068..f75212bf142c 100755
--- a/tools/testing/selftests/net/test_vxlan_nolocalbypass.sh
+++ b/tools/testing/selftests/net/test_vxlan_nolocalbypass.sh
@@ -130,7 +130,7 @@ nolocalbypass()
        run_cmd "tc -n ns1 qdisc add dev lo clsact"
        run_cmd "tc -n ns1 filter add dev lo ingress pref 1 handle 101 proto ip flower ip_proto udp dst_port 4790 action drop"
 
-       run_cmd "ip -n ns1 -d link show dev vx0 | grep ' localbypass'"
+       run_cmd "ip -n ns1 -d -j link show dev vx0 | jq -e '.[][\"linkinfo\"][\"info_data\"][\"localbypass\"] == true'"
        log_test $? 0 "localbypass enabled"
 
        run_cmd "ip netns exec ns1 mausezahn vx0 -a $smac -b $dmac -c 1 -p 100 -q"
@@ -140,7 +140,7 @@ nolocalbypass()
 
        run_cmd "ip -n ns1 link set dev vx0 type vxlan nolocalbypass"
 
-       run_cmd "ip -n ns1 -d link show dev vx0 | grep 'nolocalbypass'"
+       run_cmd "ip -n ns1 -d -j link show dev vx0 | jq -e '.[][\"linkinfo\"][\"info_data\"][\"localbypass\"] == false'"
        log_test $? 0 "localbypass disabled"
 
        run_cmd "ip netns exec ns1 mausezahn vx0 -a $smac -b $dmac -c 1 -p 100 -q"
@@ -150,7 +150,7 @@ nolocalbypass()
 
        run_cmd "ip -n ns1 link set dev vx0 type vxlan localbypass"
 
-       run_cmd "ip -n ns1 -d link show dev vx0 | grep ' localbypass'"
+       run_cmd "ip -n ns1 -d -j link show dev vx0 | jq -e '.[][\"linkinfo\"][\"info_data\"][\"localbypass\"] == true'"
        log_test $? 0 "localbypass enabled"
 
        run_cmd "ip netns exec ns1 mausezahn vx0 -a $smac -b $dmac -c 1 -p 100 -q"

Please submit it after the iproute2 changes are accepted.

Thanks

  reply	other threads:[~2023-06-05  8:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-04 14:00 [PATCH iproute2-next v7] ip-link: add support for nolocalbypass in vxlan Vladimir Nikishkin
2023-06-05  6:36 ` Ido Schimmel
2023-06-05  6:47   ` Vladimir Nikishkin
2023-06-05  8:26     ` Ido Schimmel [this message]
2023-06-05 15:02       ` Stephen Hemminger
2023-06-05 15:14         ` Ido Schimmel
2023-06-05 15:19           ` David Ahern

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=ZH2cUO7pFnU/tcXL@shredder \
    --to=idosch@idosch.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eng.alaamohamedsoliman.am@gmail.com \
    --cc=eyal.birger@gmail.com \
    --cc=gnault@redhat.com \
    --cc=idosch@nvidia.com \
    --cc=jtoppins@redhat.com \
    --cc=kuba@kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=vladimir@nikishkin.pw \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox