Netdev List
 help / color / mirror / Atom feed
From: Danielle Ratson <danieller@nvidia.com>
To: <netdev@vger.kernel.org>
Cc: <dsahern@kernel.org>, <stephen@networkplumber.org>,
	<razor@blackwall.org>, <petrm@nvidia.com>, <idosch@nvidia.com>,
	Danielle Ratson <danieller@nvidia.com>
Subject: [PATCH iproute2-next 2/2] bridge: vlan: Add support for neigh_forward_grat
Date: Sun, 17 May 2026 11:25:01 +0300	[thread overview]
Message-ID: <20260517082501.899009-3-danieller@nvidia.com> (raw)
In-Reply-To: <20260517082501.899009-1-danieller@nvidia.com>

Add support for controlling gratuitous ARP and unsolicited NA
forwarding at the per-VLAN level via the neigh_forward_grat option.

This allows configuring the option via:
$ bridge vlan set dev <port> vid <vlan> neigh_forward_grat {on|off}

Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Danielle Ratson <danieller@nvidia.com>
---
 bridge/vlan.c     | 18 ++++++++++++++++++
 man/man8/bridge.8 | 15 ++++++++++++++-
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/bridge/vlan.c b/bridge/vlan.c
index 27d31ba8..ff03ac86 100644
--- a/bridge/vlan.c
+++ b/bridge/vlan.c
@@ -39,6 +39,7 @@ static void usage(void)
 		"                                               [ mcast_router MULTICAST_ROUTER ]\n"
 		"                                               [ mcast_max_groups MAX_GROUPS ]\n"
 		"                                               [ neigh_suppress {on | off} ]\n"
+		"                                               [ neigh_forward_grat {on | off} ]\n"
 		"       bridge vlan { show } [ dev DEV ] [ vid VLAN_ID ]\n"
 		"       bridge vlan { tunnelshow } [ dev DEV ] [ vid VLAN_ID ]\n"
 		"       bridge vlan global { set } vid VLAN_ID dev DEV\n"
@@ -368,6 +369,18 @@ static int vlan_option_set(int argc, char **argv)
 			addattr8(&req.n, sizeof(req),
 				 BRIDGE_VLANDB_ENTRY_NEIGH_SUPPRESS,
 				 neigh_suppress);
+		} else if (strcmp(*argv, "neigh_forward_grat") == 0) {
+			bool neigh_forward_grat;
+			int ret;
+
+			NEXT_ARG();
+			neigh_forward_grat = parse_on_off("neigh_forward_grat",
+							  *argv, &ret);
+			if (ret)
+				return ret;
+			addattr8(&req.n, sizeof(req),
+				 BRIDGE_VLANDB_ENTRY_NEIGH_FORWARD_GRAT,
+				 neigh_forward_grat);
 		} else {
 			if (matches(*argv, "help") == 0)
 				NEXT_ARG();
@@ -1012,6 +1025,11 @@ static void print_vlan_opts(struct rtattr *a, int ifindex)
 		print_on_off(PRINT_ANY, "neigh_suppress", "neigh_suppress %s ",
 			     rta_getattr_u8(vattr));
 	}
+	if (vtb[BRIDGE_VLANDB_ENTRY_NEIGH_FORWARD_GRAT]) {
+		vattr = vtb[BRIDGE_VLANDB_ENTRY_NEIGH_FORWARD_GRAT];
+		print_on_off(PRINT_ANY, "neigh_forward_grat",
+			     "neigh_forward_grat %s ", rta_getattr_u8(vattr));
+	}
 	print_nl();
 	if (show_stats)
 		bridge_print_vlan_stats_only(&vstats);
diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
index aae6c75a..d2323521 100644
--- a/man/man8/bridge.8
+++ b/man/man8/bridge.8
@@ -241,7 +241,8 @@ bridge \- show / manipulate bridge addresses and devices
 .IR MAX_GROUPS " ] [ "
 .B mcast_router
 .IR MULTICAST_ROUTER " ] [ "
-.BR neigh_suppress " { " on " | " off " } ]"
+.BR neigh_suppress " { " on " | " off " } ] [ "
+.BR neigh_forward_grat " { " on " | " off " } ]"
 
 .ti -8
 .BR "bridge vlan" " [ " show " | " tunnelshow " ] [ "
@@ -1486,6 +1487,18 @@ for a given VLAN on a given port. By default this flag is off.
 Note that this option only takes effect when \fBbridge link\fR option
 \fBneigh_vlan_suppress\fR is enabled for a given port.
 
+.TP
+.BR "neigh_forward_grat on " or " neigh_forward_grat off "
+Controls whether gratuitous ARP packets and unsolicited Neighbor Advertisement
+packets are forwarded when neighbor suppression is enabled for a given VLAN
+on a given port. By default this flag is off, meaning gratuitous ARP and
+unsolicited NA packets will be suppressed when neighbor suppression is enabled.
+Setting this flag to on allows these packets to be forwarded even when
+neighbor suppression is enabled.
+
+Note that this option only takes effect when \fBbridge link\fR option
+\fBneigh_vlan_suppress\fR is enabled for a given port.
+
 .SS bridge vlan show - list vlan configuration.
 
 This command displays the current VLAN filter table.
-- 
2.51.0


  parent reply	other threads:[~2026-05-17  8:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-17  8:24 [PATCH iproute2-next 0/2] Add support for neigh_forward_grat Danielle Ratson
2026-05-17  8:25 ` [PATCH iproute2-next 1/2] iplink: bridge_slave: " Danielle Ratson
2026-05-17 14:09   ` Nikolay Aleksandrov
2026-05-17  8:25 ` Danielle Ratson [this message]
2026-05-17 14:10   ` [PATCH iproute2-next 2/2] bridge: vlan: " Nikolay Aleksandrov

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=20260517082501.899009-3-danieller@nvidia.com \
    --to=danieller@nvidia.com \
    --cc=dsahern@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@nvidia.com \
    --cc=razor@blackwall.org \
    --cc=stephen@networkplumber.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox