netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, nhorman@tuxdriver.com, andy@greyhouse.net,
	tgraf@suug.ch, dborkman@redhat.com, ogerlitz@mellanox.com,
	jesse@nicira.com, pshelar@nicira.com, azhou@nicira.com,
	ben@decadent.org.uk, stephen@networkplumber.org,
	jeffrey.t.kirsher@intel.com, vyasevic@redhat.com,
	xiyou.wangcong@gmail.com, john.r.fastabend@intel.com,
	edumazet@google.com, jhs@mojatatu.com, sfeldma@gmail.com,
	f.fainelli@gmail.com, roopa@cumulusnetworks.com,
	linville@tuxdriver.com, jasowang@redhat.com,
	ebiederm@xmission.com, nicolas.dichtel@6wind.com,
	ryazanov.s.a@gmail.com, buytenh@wantstofly.org,
	aviadr@mellanox.com, nbd@openwrt.org,
	alexei.starovoitov@gmail.com, Neil.Jerram@metaswitch.com,
	ronye@mellanox.com, simon.horman@netronome.com,
	alexander.h.duyck@redhat.com, john.ronciak@intel.com,
	mleitner@redhat.com, shrijeet@gmail.com,
	gospo@cumulusnetworks.com, bcrl@kvack.org, hemal@broadcom.co
Subject: [patch iproute2 6/6] bridge/link: add learning_sync policy flag
Date: Thu,  4 Dec 2014 09:57:18 +0100	[thread overview]
Message-ID: <1417683438-10935-7-git-send-email-jiri@resnulli.us> (raw)
In-Reply-To: <1417683438-10935-1-git-send-email-jiri@resnulli.us>

From: Scott Feldman <sfeldma@gmail.com>

Add 'learned_sync' flag to turn on/off syncing of learned FDB entries from
offload device to bridge's FDB.   Flag would be set/cleared in on SELF using
hwmode qualifier 'swdev'.  E.g.:

  $ sudo bridge link set dev swp1 hwmode swdev learning_sync on

  $ bridge -d link show dev swp1
  2: swp1 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 2
      hairpin off guard off root_block off fastleave off learning off flood off
  2: swp1 state UNKNOWN : <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 master br0
      learning on learning_sync on hwmode swdev

Adds new IFLA_BRPORT_LEARNING_SYNC attribute for IFLA_PROTINFO on the SELF
brport.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
---
 bridge/link.c           | 11 +++++++++++
 include/linux/if_link.h |  1 +
 man/man8/bridge.8       |  6 ++++++
 3 files changed, 18 insertions(+)

diff --git a/bridge/link.c b/bridge/link.c
index efe0b8c..0f8649f 100644
--- a/bridge/link.c
+++ b/bridge/link.c
@@ -188,6 +188,9 @@ int print_linkinfo(const struct sockaddr_nl *who,
 				if (prtb[IFLA_BRPORT_LEARNING])
 					print_onoff(fp, "learning",
 						    rta_getattr_u8(prtb[IFLA_BRPORT_LEARNING]));
+				if (prtb[IFLA_BRPORT_LEARNING_SYNC])
+					print_onoff(fp, "learning_sync",
+						    rta_getattr_u8(prtb[IFLA_BRPORT_LEARNING_SYNC]));
 				if (prtb[IFLA_BRPORT_UNICAST_FLOOD])
 					print_onoff(fp, "flood",
 						    rta_getattr_u8(prtb[IFLA_BRPORT_UNICAST_FLOOD]));
@@ -221,6 +224,7 @@ static void usage(void)
 	fprintf(stderr, "                               [ fastleave {on | off} ]\n");
 	fprintf(stderr,	"                               [ root_block {on | off} ]\n");
 	fprintf(stderr,	"                               [ learning {on | off} ]\n");
+	fprintf(stderr,	"                               [ learning_sync {on | off} ]\n");
 	fprintf(stderr,	"                               [ flood {on | off} ]\n");
 	fprintf(stderr, "                               [ hwmode {vepa | veb} ]\n");
 	fprintf(stderr, "       bridge link show [dev DEV]\n");
@@ -252,6 +256,7 @@ static int brlink_modify(int argc, char **argv)
 	} req;
 	char *d = NULL;
 	__s8 learning = -1;
+	__s8 learning_sync = -1;
 	__s8 flood = -1;
 	__s8 hairpin = -1;
 	__s8 bpdu_guard = -1;
@@ -295,6 +300,10 @@ static int brlink_modify(int argc, char **argv)
 			NEXT_ARG();
 			if (!on_off("learning", &learning, *argv))
 				exit(-1);
+		} else if (strcmp(*argv, "learning_sync") == 0) {
+			NEXT_ARG();
+			if (!on_off("learning_sync", &learning_sync, *argv))
+				exit(-1);
 		} else if (strcmp(*argv, "flood") == 0) {
 			NEXT_ARG();
 			if (!on_off("flood", &flood, *argv))
@@ -359,6 +368,8 @@ static int brlink_modify(int argc, char **argv)
 		addattr8(&req.n, sizeof(req), IFLA_BRPORT_UNICAST_FLOOD, flood);
 	if (learning >= 0)
 		addattr8(&req.n, sizeof(req), IFLA_BRPORT_LEARNING, learning);
+	if (learning_sync >= 0)
+		addattr8(&req.n, sizeof(req), IFLA_BRPORT_LEARNING_SYNC, learning_sync);
 
 	if (cost > 0)
 		addattr32(&req.n, sizeof(req), IFLA_BRPORT_COST, cost);
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 06efa2d..9947f1b 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -243,6 +243,7 @@ enum {
 	IFLA_BRPORT_LEARNING,	/* mac learning */
 	IFLA_BRPORT_UNICAST_FLOOD, /* flood unicast traffic */
 	IFLA_BRPORT_PROXYARP,   /* proxy ARP */
+	IFLA_BRPORT_LEARNING_SYNC, /* mac learning sync from device */
 	__IFLA_BRPORT_MAX
 };
 #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
diff --git a/man/man8/bridge.8 b/man/man8/bridge.8
index d3d64d1..83c049a 100644
--- a/man/man8/bridge.8
+++ b/man/man8/bridge.8
@@ -37,6 +37,7 @@ bridge \- show / manipulate bridge addresses and devices
 .BR fastleave " { " on " | " off " } ] [ "
 .BR root_block " { " on " | " off " } ] [ "
 .BR learning " { " on " | " off " } ] [ "
+.BR learning_sync " { " on " | " off " } ] [ "
 .BR flood " { " on " | " off " } ] [ "
 .BR hwmode " { " vepa " | " veb " | " swdev " } ] "
 
@@ -242,6 +243,11 @@ not.  If learning if off, the bridge will end up flooding any traffic for which
 it has no FDB entry.  By default this flag is on.
 
 .TP
+.BR "learning_sync on " or " learning_sync off "
+Controls whether a given port will sync MAC addresses learned on device port
+to bridge FDB.  This flags applies to device ports in "swdev" hwmode.
+
+.TP
 .BR "flooding on " or " flooding off "
 Controls whether a given port will flood unicast traffic for which there is no FDB entry.  By default this flag is on.
 
-- 
1.9.3

  parent reply	other threads:[~2014-12-04  8:57 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04  8:57 [patch iproute2 0/6] iproute2: add changes for switchdev Jiri Pirko
2014-12-04  8:57 ` [patch iproute2 1/6] iproute2: ipa: show switch id Jiri Pirko
2014-12-04 13:17   ` Jamal Hadi Salim
2014-12-04 14:20   ` Andy Gospodarek
2014-12-04 14:29     ` Roopa Prabhu
2014-12-04 14:33     ` Jiri Pirko
2014-12-04 14:57       ` Andy Gospodarek
2014-12-04 15:12         ` Jiri Pirko
2014-12-04 15:15         ` Jiri Pirko
2014-12-04 15:28           ` Andy Gospodarek
2014-12-04 15:37         ` Thomas Graf
2014-12-04 16:15   ` Eric W. Biederman
2014-12-04 16:30     ` Jiri Pirko
2014-12-04 17:52       ` Eric W. Biederman
2014-12-04 17:59         ` Roopa Prabhu
2014-12-04 18:24         ` Jiri Pirko
2014-12-04 18:57           ` Eric W. Biederman
2014-12-04 19:19             ` Jiri Pirko
2014-12-04 19:26               ` Eric W. Biederman
2014-12-04 19:54                 ` Jiri Pirko
2014-12-04 20:06                 ` Eric W. Biederman
2014-12-04 20:27                   ` Jiri Pirko
2014-12-04 20:55                     ` Eric W. Biederman
2014-12-04 21:10                       ` Jiri Pirko
2014-12-04 21:24                         ` Eric W. Biederman
2014-12-04 22:07                         ` Thomas Graf
2014-12-05  9:54                       ` David Laight
2014-12-08 21:56                         ` Eric W. Biederman
2014-12-04  8:57 ` [patch iproute2 2/6] bridge/fdb: fix statistics output spacing Jiri Pirko
2014-12-10  0:32   ` Stephen Hemminger
2014-12-04  8:57 ` [patch iproute2 3/6] bridge/fdb: add flag/indication for FDB entry synced from offload device Jiri Pirko
2014-12-04 13:19   ` Jamal Hadi Salim
2014-12-24 20:39   ` Stephen Hemminger
2014-12-04  8:57 ` [patch iproute2 4/6] bridge/link: add new offload hwmode swdev Jiri Pirko
2014-12-04 13:23   ` Jamal Hadi Salim
2014-12-04 20:55     ` Scott Feldman
2014-12-24 20:37   ` Stephen Hemminger
2014-12-04  8:57 ` [patch iproute2 5/6] link: add missing IFLA_BRPORT_PROXYARP Jiri Pirko
2014-12-04 18:53   ` Stephen Hemminger
2014-12-04  8:57 ` Jiri Pirko [this message]
2014-12-04 13:26   ` [patch iproute2 6/6] bridge/link: add learning_sync policy flag Jamal Hadi Salim
2014-12-04 14:15     ` Jamal Hadi Salim
2014-12-04 13:16 ` [patch iproute2 0/6] iproute2: add changes for switchdev Jamal Hadi Salim
2014-12-04 13:56   ` Andy Gospodarek
2014-12-04 14:22     ` Roopa Prabhu
2014-12-04 14:31       ` Jamal Hadi Salim
2014-12-04 14:26 ` Roopa Prabhu
2014-12-04 14:34   ` Jiri Pirko
2014-12-04 14:45     ` Roopa Prabhu
2014-12-04 16:04       ` Jiri Pirko
2014-12-04 16:55         ` Roopa Prabhu
2014-12-04 20:49           ` Scott Feldman
2014-12-05  2:28             ` Roopa Prabhu

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=1417683438-10935-7-git-send-email-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=Neil.Jerram@metaswitch.com \
    --cc=alexander.h.duyck@redhat.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andy@greyhouse.net \
    --cc=aviadr@mellanox.com \
    --cc=azhou@nicira.com \
    --cc=bcrl@kvack.org \
    --cc=ben@decadent.org.uk \
    --cc=buytenh@wantstofly.org \
    --cc=davem@davemloft.net \
    --cc=dborkman@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=gospo@cumulusnetworks.com \
    --cc=hemal@broadcom.co \
    --cc=jasowang@redhat.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jesse@nicira.com \
    --cc=jhs@mojatatu.com \
    --cc=john.r.fastabend@intel.com \
    --cc=john.ronciak@intel.com \
    --cc=linville@tuxdriver.com \
    --cc=mleitner@redhat.com \
    --cc=nbd@openwrt.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=nicolas.dichtel@6wind.com \
    --cc=ogerlitz@mellanox.com \
    --cc=pshelar@nicira.com \
    --cc=ronye@mellanox.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=ryazanov.s.a@gmail.com \
    --cc=sfeldma@gmail.com \
    --cc=shrijeet@gmail.com \
    --cc=simon.horman@netronome.com \
    --cc=stephen@networkplumber.org \
    --cc=tgraf@suug.ch \
    --cc=vyasevic@redhat.com \
    --cc=xiyou.wangcong@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).