From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, yotamg@mellanox.com, idosch@mellanox.com,
nogahf@mellanox.com, mlxsw@mellanox.com, ivecera@redhat.com,
nikolay@cumulusnetworks.com, andrew@lunn.ch,
stephen@networkplumber.org, nbd@nbd.name,
roopa@cumulusnetworks.com
Subject: [patch net-next 5/6] mlxsw: spectrum_switchdev: Add support for router port in SMID entries
Date: Thu, 5 Oct 2017 12:36:41 +0200 [thread overview]
Message-ID: <20171005103642.1414-6-jiri@resnulli.us> (raw)
In-Reply-To: <20171005103642.1414-1-jiri@resnulli.us>
From: Yotam Gigi <yotamg@mellanox.com>
In Spectrum, MDB entries point to MID entries, that indicate which ports a
packet should be forwarded to. Add the support in creating MID entries that
forward the packet to the Spectrum router port.
This will be later used to handle the bridge mrouter port switchdev
notifications.
Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Reviewed-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
index 0f9eac5..092231a 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c
@@ -48,6 +48,7 @@
#include <linux/rtnetlink.h>
#include <net/switchdev.h>
+#include "spectrum_router.h"
#include "spectrum.h"
#include "core.h"
#include "reg.h"
@@ -1241,7 +1242,8 @@ static int mlxsw_sp_port_mdb_op(struct mlxsw_sp *mlxsw_sp, const char *addr,
}
static int mlxsw_sp_port_smid_full_entry(struct mlxsw_sp *mlxsw_sp, u16 mid_idx,
- long *ports_bitmap)
+ long *ports_bitmap,
+ bool set_router_port)
{
char *smid_pl;
int err, i;
@@ -1256,9 +1258,15 @@ static int mlxsw_sp_port_smid_full_entry(struct mlxsw_sp *mlxsw_sp, u16 mid_idx,
mlxsw_reg_smid_port_mask_set(smid_pl, i, 1);
}
+ mlxsw_reg_smid_port_mask_set(smid_pl,
+ mlxsw_sp_router_port(mlxsw_sp), 1);
+
for_each_set_bit(i, ports_bitmap, mlxsw_core_max_ports(mlxsw_sp->core))
mlxsw_reg_smid_port_set(smid_pl, i, 1);
+ mlxsw_reg_smid_port_set(smid_pl, mlxsw_sp_router_port(mlxsw_sp),
+ set_router_port);
+
err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(smid), smid_pl);
kfree(smid_pl);
return err;
@@ -1362,7 +1370,8 @@ mlxsw_sp_mc_write_mdb_entry(struct mlxsw_sp *mlxsw_sp,
mlxsw_sp_mc_get_mrouters_bitmap(flood_bitmap, bridge_device, mlxsw_sp);
mid->mid = mid_idx;
- err = mlxsw_sp_port_smid_full_entry(mlxsw_sp, mid_idx, flood_bitmap);
+ err = mlxsw_sp_port_smid_full_entry(mlxsw_sp, mid_idx, flood_bitmap,
+ false);
kfree(flood_bitmap);
if (err)
return false;
--
2.9.5
next prev parent reply other threads:[~2017-10-05 10:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-05 10:36 [patch net-next 0/6] mlxsw: Offload bridge device mrouter Jiri Pirko
2017-10-05 10:36 ` [patch net-next 1/6] net: bridge: Use the MDB_RTR_TYPE_TEMP on bridge device too Jiri Pirko
2017-10-05 12:09 ` Nikolay Aleksandrov
2017-10-05 12:12 ` Nikolay Aleksandrov
2017-10-05 12:52 ` Nikolay Aleksandrov
2017-10-08 5:23 ` Yotam Gigi
2017-10-08 9:39 ` Nikolay Aleksandrov
2017-10-08 9:42 ` Nikolay Aleksandrov
2017-10-08 10:30 ` Yotam Gigi
2017-10-05 10:36 ` [patch net-next 2/6] net: bridge: Notify on bridge device mrouter state changes Jiri Pirko
2017-10-05 13:11 ` Nikolay Aleksandrov
2017-10-05 10:36 ` [patch net-next 3/6] net: bridge: Export bridge multicast router state Jiri Pirko
2017-10-05 13:09 ` Nikolay Aleksandrov
2017-10-05 10:36 ` [patch net-next 4/6] mlxsw: spectrum: router: Export the mlxsw_sp_router_port function Jiri Pirko
2017-10-05 10:36 ` Jiri Pirko [this message]
2017-10-05 10:36 ` [patch net-next 6/6] mlxsw: spectrum_switchdev: Support bridge mrouter notifications Jiri Pirko
2017-10-07 20:42 ` [patch net-next 0/6] mlxsw: Offload bridge device mrouter 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=20171005103642.1414-6-jiri@resnulli.us \
--to=jiri@resnulli.us \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=idosch@mellanox.com \
--cc=ivecera@redhat.com \
--cc=mlxsw@mellanox.com \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=nogahf@mellanox.com \
--cc=roopa@cumulusnetworks.com \
--cc=stephen@networkplumber.org \
--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).