summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIoana Ciornei <ioana.ciornei@nxp.com>2019-07-29 19:11:52 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-30 18:46:54 +0200
commit939878fe06461dec3edfb31f7dd130dcea1d21e4 (patch)
treec2ba0f24a7ee020b0f60734d4e2ba857e6be7516 /drivers
parente1e6a04d97cf747ccbec3ae23008c9faf8557aee (diff)
downloadlinux-939878fe06461dec3edfb31f7dd130dcea1d21e4.tar.bz2
staging: fsl-dpaa2/ethsw: add .ndo_fdb[add|del] callbacks
Add the .ndo_fdb_[add|del] callbacks so that FDB entries not associated with a master device still end up offloaded. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Link: https://lore.kernel.org/r/1564416712-16946-6-git-send-email-ioana.ciornei@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/fsl-dpaa2/ethsw/ethsw.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
index 2d3179c6bad8..4b94a01513a7 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
@@ -316,6 +316,31 @@ static int ethsw_port_fdb_del_mc(struct ethsw_port_priv *port_priv,
return err;
}
+static int port_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
+ struct net_device *dev, const unsigned char *addr,
+ u16 vid, u16 flags,
+ struct netlink_ext_ack *extack)
+{
+ if (is_unicast_ether_addr(addr))
+ return ethsw_port_fdb_add_uc(netdev_priv(dev),
+ addr);
+ else
+ return ethsw_port_fdb_add_mc(netdev_priv(dev),
+ addr);
+}
+
+static int port_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
+ struct net_device *dev,
+ const unsigned char *addr, u16 vid)
+{
+ if (is_unicast_ether_addr(addr))
+ return ethsw_port_fdb_del_uc(netdev_priv(dev),
+ addr);
+ else
+ return ethsw_port_fdb_del_mc(netdev_priv(dev),
+ addr);
+}
+
static void port_get_stats(struct net_device *netdev,
struct rtnl_link_stats64 *stats)
{
@@ -670,6 +695,8 @@ static const struct net_device_ops ethsw_port_ops = {
.ndo_change_mtu = port_change_mtu,
.ndo_has_offload_stats = port_has_offload_stats,
.ndo_get_offload_stats = port_get_offload_stats,
+ .ndo_fdb_add = port_fdb_add,
+ .ndo_fdb_del = port_fdb_del,
.ndo_fdb_dump = port_fdb_dump,
.ndo_start_xmit = port_dropframe,