diff mbox

[net-next,2/4] ixgbe: Remove driver specific fdb handlers.

Message ID 1362093183-5938-3-git-send-email-vyasevic@redhat.com
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Vlad Yasevich Feb. 28, 2013, 11:13 p.m. UTC
Remove driver specific fdb handlers since they are the same
as the default ones.

CC: John Fastabend <john.r.fastabend@intel.com>
CC: CC: Gregory Rose <gregory.v.rose@intel.com>
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   81 -------------------------
 1 files changed, 0 insertions(+), 81 deletions(-)

Comments

Vlad Yasevich March 1, 2013, 2:35 p.m. UTC | #1
On 03/01/2013 12:54 AM, John Fastabend wrote:
> On 2/28/2013 3:13 PM, Vlad Yasevich wrote:
>> Remove driver specific fdb handlers since they are the same
>> as the default ones.
>>
>> CC: John Fastabend <john.r.fastabend@intel.com>
>> CC: CC: Gregory Rose <gregory.v.rose@intel.com>
>> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
>> ---
>>   drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   81
>> -------------------------
>>   1 files changed, 0 insertions(+), 81 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> index 68478d6..212b74e 100644
>> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> @@ -6998,84 +6998,6 @@ static int ixgbe_set_features(struct net_device
>> *netdev,
>>       return 0;
>>   }
>>
>> -static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
>> -                 struct net_device *dev,
>> -                 const unsigned char *addr,
>> -                 u16 flags)
>> -{
>
> [...]
>
>> -    if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr)) {
>> -        u32 rar_uc_entries = IXGBE_MAX_PF_MACVLANS;
>> -
>> -        if (netdev_uc_count(dev) < rar_uc_entries)
>> -            err = dev_uc_add_excl(dev, addr);
>> -        else
>> -            err = -ENOMEM;
>
> OK after talking with Greg I realized there is a problem with
> just removing the add routine.
>
> The problem with this is we lose the ability to indicate the
> hardware table is full and return ENOMEM. Although our set_rx_mode
> routine will put the device in promisc mode this won't forward
> packets from a VF to the PF in the SR-IOV case.
>
> So we either need to leave ixgbe_ndo_fdb_add() or let set_rx_mode
> return an -ENOMEM error. I believe in the first case we can still
> remove the dump and del cases.
>
> Sorry for the hassle took me a second review to catch it.

No problem.  That was the reason I left it in the first version (because
of different error handling).  I'll restore the add function.

-vlad
>
> .John

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 68478d6..212b74e 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6998,84 +6998,6 @@  static int ixgbe_set_features(struct net_device *netdev,
 	return 0;
 }
 
-static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-			     struct net_device *dev,
-			     const unsigned char *addr,
-			     u16 flags)
-{
-	struct ixgbe_adapter *adapter = netdev_priv(dev);
-	int err;
-
-	if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED))
-		return -EOPNOTSUPP;
-
-	/* Hardware does not support aging addresses so if a
-	 * ndm_state is given only allow permanent addresses
-	 */
-	if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
-		pr_info("%s: FDB only supports static addresses\n",
-			ixgbe_driver_name);
-		return -EINVAL;
-	}
-
-	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr)) {
-		u32 rar_uc_entries = IXGBE_MAX_PF_MACVLANS;
-
-		if (netdev_uc_count(dev) < rar_uc_entries)
-			err = dev_uc_add_excl(dev, addr);
-		else
-			err = -ENOMEM;
-	} else if (is_multicast_ether_addr(addr)) {
-		err = dev_mc_add_excl(dev, addr);
-	} else {
-		err = -EINVAL;
-	}
-
-	/* Only return duplicate errors if NLM_F_EXCL is set */
-	if (err == -EEXIST && !(flags & NLM_F_EXCL))
-		err = 0;
-
-	return err;
-}
-
-static int ixgbe_ndo_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
-			     struct net_device *dev,
-			     const unsigned char *addr)
-{
-	struct ixgbe_adapter *adapter = netdev_priv(dev);
-	int err = -EOPNOTSUPP;
-
-	if (ndm->ndm_state & NUD_PERMANENT) {
-		pr_info("%s: FDB only supports static addresses\n",
-			ixgbe_driver_name);
-		return -EINVAL;
-	}
-
-	if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) {
-		if (is_unicast_ether_addr(addr))
-			err = dev_uc_del(dev, addr);
-		else if (is_multicast_ether_addr(addr))
-			err = dev_mc_del(dev, addr);
-		else
-			err = -EINVAL;
-	}
-
-	return err;
-}
-
-static int ixgbe_ndo_fdb_dump(struct sk_buff *skb,
-			      struct netlink_callback *cb,
-			      struct net_device *dev,
-			      int idx)
-{
-	struct ixgbe_adapter *adapter = netdev_priv(dev);
-
-	if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)
-		idx = ndo_dflt_fdb_dump(skb, cb, dev, idx);
-
-	return idx;
-}
-
 static int ixgbe_ndo_bridge_setlink(struct net_device *dev,
 				    struct nlmsghdr *nlh)
 {
@@ -7170,9 +7092,6 @@  static const struct net_device_ops ixgbe_netdev_ops = {
 #endif /* IXGBE_FCOE */
 	.ndo_set_features = ixgbe_set_features,
 	.ndo_fix_features = ixgbe_fix_features,
-	.ndo_fdb_add		= ixgbe_ndo_fdb_add,
-	.ndo_fdb_del		= ixgbe_ndo_fdb_del,
-	.ndo_fdb_dump		= ixgbe_ndo_fdb_dump,
 	.ndo_bridge_setlink	= ixgbe_ndo_bridge_setlink,
 	.ndo_bridge_getlink	= ixgbe_ndo_bridge_getlink,
 };