aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2014-11-20 19:30:02 -0500
committerDavid S. Miller <davem@davemloft.net>2014-11-22 16:56:27 -0500
commit2f90ade661b3bdcde08e50c02c564e139300e263 (patch)
treeaa20a48ca9346d9b56ea299df06a6afaed100284 /drivers/net/ethernet/intel
parent1459143386c5d868c87903b8d433a52cffcf3e66 (diff)
i40e: enable fdb add code, remove unused code
The original FDB code submission wasn't correct and the code wasn't enabled. This removes some dead code (can use the common kernel code for fdb_del and fdb_dump) and correctly enables the fdb_add function pointer. The fdb_add functionality is important to i40e because it is needed for a workaround to allow bridges to work correctly on the i40e hardware. Reported-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Acked-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c71
1 files changed, 8 insertions, 63 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 3913329998bf..7262077ad547 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -7526,18 +7526,18 @@ static int i40e_get_phys_port_id(struct net_device *netdev,
7526 return 0; 7526 return 0;
7527} 7527}
7528 7528
7529#ifdef HAVE_FDB_OPS 7529/**
7530#ifdef USE_CONST_DEV_UC_CHAR 7530 * i40e_ndo_fdb_add - add an entry to the hardware database
7531 * @ndm: the input from the stack
7532 * @tb: pointer to array of nladdr (unused)
7533 * @dev: the net device pointer
7534 * @addr: the MAC address entry being added
7535 * @flags: instructions from stack about fdb operation
7536 */
7531static int i40e_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], 7537static int i40e_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
7532 struct net_device *dev, 7538 struct net_device *dev,
7533 const unsigned char *addr, 7539 const unsigned char *addr,
7534 u16 flags) 7540 u16 flags)
7535#else
7536static int i40e_ndo_fdb_add(struct ndmsg *ndm,
7537 struct net_device *dev,
7538 unsigned char *addr,
7539 u16 flags)
7540#endif
7541{ 7541{
7542 struct i40e_netdev_priv *np = netdev_priv(dev); 7542 struct i40e_netdev_priv *np = netdev_priv(dev);
7543 struct i40e_pf *pf = np->vsi->back; 7543 struct i40e_pf *pf = np->vsi->back;
@@ -7568,55 +7568,6 @@ static int i40e_ndo_fdb_add(struct ndmsg *ndm,
7568 return err; 7568 return err;
7569} 7569}
7570 7570
7571#ifndef USE_DEFAULT_FDB_DEL_DUMP
7572#ifdef USE_CONST_DEV_UC_CHAR
7573static int i40e_ndo_fdb_del(struct ndmsg *ndm,
7574 struct net_device *dev,
7575 const unsigned char *addr)
7576#else
7577static int i40e_ndo_fdb_del(struct ndmsg *ndm,
7578 struct net_device *dev,
7579 unsigned char *addr)
7580#endif
7581{
7582 struct i40e_netdev_priv *np = netdev_priv(dev);
7583 struct i40e_pf *pf = np->vsi->back;
7584 int err = -EOPNOTSUPP;
7585
7586 if (ndm->ndm_state & NUD_PERMANENT) {
7587 netdev_info(dev, "FDB only supports static addresses\n");
7588 return -EINVAL;
7589 }
7590
7591 if (pf->flags & I40E_FLAG_SRIOV_ENABLED) {
7592 if (is_unicast_ether_addr(addr))
7593 err = dev_uc_del(dev, addr);
7594 else if (is_multicast_ether_addr(addr))
7595 err = dev_mc_del(dev, addr);
7596 else
7597 err = -EINVAL;
7598 }
7599
7600 return err;
7601}
7602
7603static int i40e_ndo_fdb_dump(struct sk_buff *skb,
7604 struct netlink_callback *cb,
7605 struct net_device *dev,
7606 struct net_device *filter_dev,
7607 int idx)
7608{
7609 struct i40e_netdev_priv *np = netdev_priv(dev);
7610 struct i40e_pf *pf = np->vsi->back;
7611
7612 if (pf->flags & I40E_FLAG_SRIOV_ENABLED)
7613 idx = ndo_dflt_fdb_dump(skb, cb, dev, filter_dev, idx);
7614
7615 return idx;
7616}
7617
7618#endif /* USE_DEFAULT_FDB_DEL_DUMP */
7619#endif /* HAVE_FDB_OPS */
7620static const struct net_device_ops i40e_netdev_ops = { 7571static const struct net_device_ops i40e_netdev_ops = {
7621 .ndo_open = i40e_open, 7572 .ndo_open = i40e_open,
7622 .ndo_stop = i40e_close, 7573 .ndo_stop = i40e_close,
@@ -7650,13 +7601,7 @@ static const struct net_device_ops i40e_netdev_ops = {
7650 .ndo_del_vxlan_port = i40e_del_vxlan_port, 7601 .ndo_del_vxlan_port = i40e_del_vxlan_port,
7651#endif 7602#endif
7652 .ndo_get_phys_port_id = i40e_get_phys_port_id, 7603 .ndo_get_phys_port_id = i40e_get_phys_port_id,
7653#ifdef HAVE_FDB_OPS
7654 .ndo_fdb_add = i40e_ndo_fdb_add, 7604 .ndo_fdb_add = i40e_ndo_fdb_add,
7655#ifndef USE_DEFAULT_FDB_DEL_DUMP
7656 .ndo_fdb_del = i40e_ndo_fdb_del,
7657 .ndo_fdb_dump = i40e_ndo_fdb_dump,
7658#endif
7659#endif
7660}; 7605};
7661 7606
7662/** 7607/**