diff options
author | Vlad Yasevich <vyasevic@redhat.com> | 2013-03-06 10:39:43 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-07 15:29:45 -0500 |
commit | faaf02d24ce393032e9b60128cce529d09f7190e (patch) | |
tree | 2499bd09add80865efd86e5db666a17f9959512d | |
parent | 090096bf3db1c281ddd034573260045888a68fea (diff) |
ixgbe: Make use of the default fdb handlers.
For fdb_add, use the default handler in the non-SRIOV case.
For the other fdb handlers, just remove them and use the
default ones.
CC: John Fastabend <john.r.fastabend@intel.com>
Acked-By: John Fastabend <john.r.fastabend@intel.com>
CC: CC: Gregory Rose <gregory.v.rose@intel.com>
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index db5611ae407e..e56a3d169e30 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -7007,7 +7007,7 @@ static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], | |||
7007 | int err; | 7007 | int err; |
7008 | 7008 | ||
7009 | if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)) | 7009 | if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)) |
7010 | return -EOPNOTSUPP; | 7010 | return ndo_dflt_fdb_add(ndm, tb, dev, addr, flags); |
7011 | 7011 | ||
7012 | /* Hardware does not support aging addresses so if a | 7012 | /* Hardware does not support aging addresses so if a |
7013 | * ndm_state is given only allow permanent addresses | 7013 | * ndm_state is given only allow permanent addresses |
@@ -7038,44 +7038,6 @@ static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], | |||
7038 | return err; | 7038 | return err; |
7039 | } | 7039 | } |
7040 | 7040 | ||
7041 | static int ixgbe_ndo_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], | ||
7042 | struct net_device *dev, | ||
7043 | const unsigned char *addr) | ||
7044 | { | ||
7045 | struct ixgbe_adapter *adapter = netdev_priv(dev); | ||
7046 | int err = -EOPNOTSUPP; | ||
7047 | |||
7048 | if (ndm->ndm_state & NUD_PERMANENT) { | ||
7049 | pr_info("%s: FDB only supports static addresses\n", | ||
7050 | ixgbe_driver_name); | ||
7051 | return -EINVAL; | ||
7052 | } | ||
7053 | |||
7054 | if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) { | ||
7055 | if (is_unicast_ether_addr(addr)) | ||
7056 | err = dev_uc_del(dev, addr); | ||
7057 | else if (is_multicast_ether_addr(addr)) | ||
7058 | err = dev_mc_del(dev, addr); | ||
7059 | else | ||
7060 | err = -EINVAL; | ||
7061 | } | ||
7062 | |||
7063 | return err; | ||
7064 | } | ||
7065 | |||
7066 | static int ixgbe_ndo_fdb_dump(struct sk_buff *skb, | ||
7067 | struct netlink_callback *cb, | ||
7068 | struct net_device *dev, | ||
7069 | int idx) | ||
7070 | { | ||
7071 | struct ixgbe_adapter *adapter = netdev_priv(dev); | ||
7072 | |||
7073 | if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) | ||
7074 | idx = ndo_dflt_fdb_dump(skb, cb, dev, idx); | ||
7075 | |||
7076 | return idx; | ||
7077 | } | ||
7078 | |||
7079 | static int ixgbe_ndo_bridge_setlink(struct net_device *dev, | 7041 | static int ixgbe_ndo_bridge_setlink(struct net_device *dev, |
7080 | struct nlmsghdr *nlh) | 7042 | struct nlmsghdr *nlh) |
7081 | { | 7043 | { |
@@ -7171,8 +7133,6 @@ static const struct net_device_ops ixgbe_netdev_ops = { | |||
7171 | .ndo_set_features = ixgbe_set_features, | 7133 | .ndo_set_features = ixgbe_set_features, |
7172 | .ndo_fix_features = ixgbe_fix_features, | 7134 | .ndo_fix_features = ixgbe_fix_features, |
7173 | .ndo_fdb_add = ixgbe_ndo_fdb_add, | 7135 | .ndo_fdb_add = ixgbe_ndo_fdb_add, |
7174 | .ndo_fdb_del = ixgbe_ndo_fdb_del, | ||
7175 | .ndo_fdb_dump = ixgbe_ndo_fdb_dump, | ||
7176 | .ndo_bridge_setlink = ixgbe_ndo_bridge_setlink, | 7136 | .ndo_bridge_setlink = ixgbe_ndo_bridge_setlink, |
7177 | .ndo_bridge_getlink = ixgbe_ndo_bridge_getlink, | 7137 | .ndo_bridge_getlink = ixgbe_ndo_bridge_getlink, |
7178 | }; | 7138 | }; |