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, idosch@mellanox.com, eladr@mellanox.com,
	yotamg@mellanox.com, ogerlitz@mellanox.com, sagir@mellanox.com
Subject: [patch net-next 01/12] switchdev: Add support for flood control
Date: Wed, 28 Oct 2015 10:16:54 +0100	[thread overview]
Message-ID: <1446023825-7162-2-git-send-email-jiri@resnulli.us> (raw)
In-Reply-To: <1446023825-7162-1-git-send-email-jiri@resnulli.us>

From: Ido Schimmel <idosch@mellanox.com>

Allow devices supporting this feature to control the flooding of unknown
unicast traffic, by making switchdev infrastructure propagate this setting
to the switch driver.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 Documentation/networking/switchdev.txt | 3 +++
 net/switchdev/switchdev.c              | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/Documentation/networking/switchdev.txt b/Documentation/networking/switchdev.txt
index 0714fe5..ce510e1 100644
--- a/Documentation/networking/switchdev.txt
+++ b/Documentation/networking/switchdev.txt
@@ -298,6 +298,9 @@ packets up to the bridge driver for flooding.  This is not ideal as the number
 of ports scale in the L2 domain as the device is much more efficient at
 flooding packets that software.
 
+If supported by the device, flood control can be offloaded to it, preventing
+certain netdevs from flooding unicast traffic for which there is no FDB entry.
+
 IGMP Snooping
 ^^^^^^^^^^^^^
 
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index 1eb76956..8950d39 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -746,7 +746,7 @@ int switchdev_port_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 		.id = SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS,
 	};
 	u16 mode = BRIDGE_MODE_UNDEF;
-	u32 mask = BR_LEARNING | BR_LEARNING_SYNC;
+	u32 mask = BR_LEARNING | BR_LEARNING_SYNC | BR_FLOOD;
 	int err;
 
 	err = switchdev_port_attr_get(dev, &attr);
@@ -817,6 +817,9 @@ static int switchdev_port_br_setlink_protinfo(struct net_device *dev,
 			err = switchdev_port_br_setflag(dev, attr,
 							BR_LEARNING_SYNC);
 			break;
+		case IFLA_BRPORT_UNICAST_FLOOD:
+			err = switchdev_port_br_setflag(dev, attr, BR_FLOOD);
+			break;
 		default:
 			err = -EOPNOTSUPP;
 			break;
-- 
1.9.3

  reply	other threads:[~2015-10-28  9:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-28  9:16 [patch net-next 00/12] mlxsw: driver update Jiri Pirko
2015-10-28  9:16 ` Jiri Pirko [this message]
2015-10-28  9:16 ` [patch net-next 02/12] switchdev: Make flood to CPU optional Jiri Pirko
2015-10-28  9:16 ` [patch net-next 03/12] mlxsw: spectrum: move "bridged" bool to u8 flags Jiri Pirko
2015-10-28  9:16 ` [patch net-next 04/12] mlxsw: spectrum: Add support for VLAN ranges in flooding configuration Jiri Pirko
2015-10-28  9:16 ` [patch net-next 05/12] mlxsw: spectrum: Add support for flood control Jiri Pirko
2015-10-28  9:16 ` [patch net-next 06/12] mlxsw: reg: Fix description for reg_sfd_uc_sub_port Jiri Pirko
2015-10-28  9:17 ` [patch net-next 07/12] mlxsw: reg: Fix desription typos of couple of SFN items Jiri Pirko
2015-10-28  9:17 ` [patch net-next 08/12] mlxsw: reg: Avoid unnecessary line wrap for mlxsw_reg_sfd_uc_unpack Jiri Pirko
2015-10-28  9:17 ` [patch net-next 09/12] mlxsw: spectrum: Fix ageing time value Jiri Pirko
2015-10-28  9:17 ` [patch net-next 10/12] mlxsw: Put constant on the right side of comparisons Jiri Pirko
2015-10-28  9:17 ` [patch net-next 11/12] mlxsw: Put braces on all arms of branch statement Jiri Pirko
2015-10-28  9:17 ` [patch net-next 12/12] mlxsw: spectrum: Make mlxsw_sp_port_switchdev_ops static Jiri Pirko
2015-10-30  3:27 ` [patch net-next 00/12] mlxsw: driver update David Miller

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=1446023825-7162-2-git-send-email-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=eladr@mellanox.com \
    --cc=idosch@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=sagir@mellanox.com \
    --cc=yotamg@mellanox.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).