netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] Provide default fdb operation to allow mac filter setting
@ 2013-02-28 23:12 Vlad Yasevich
  2013-02-28 23:13 ` [PATCH net-next 1/4] net: generic fdb support for drivers without ndo_fdb_<op> Vlad Yasevich
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Vlad Yasevich @ 2013-02-28 23:12 UTC (permalink / raw)
  To: netdev; +Cc: john.r.fastabend, Vlad Yasevich

This is a short series that now allows mac filter programming on any
card that support IFF_UNICAST_FLT by using the existing FDB interface.

Some existing drivers that had FDB functionality usually supported
it only in SR-IOV mode.  Since that's not always enabled, and
we want to take advantage of IFF_UNICAST_FLT support, these drivers
have been converted to call the default handler when not in SRIOV mode.

Changes since RFC:
 - Removed ixgbe and mlx versions of fdb calls as recommened.
 - Added qlogic patch to use default calls when module parameter is
   not turned on.

Vlad Yasevich (4):
  net: generic fdb support for drivers without ndo_fdb_<op>
  ixgbe: Remove driver specific fdb handlers.
  mlx4: Remove driver specific fdb handlers.
  qlcnic: Use generic fdb handler when driver options are not enabled.

 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c    |   81 ----------------------
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c   |   76 --------------------
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |   21 ++----
 include/linux/rtnetlink.h                        |    9 +++
 net/core/rtnetlink.c                             |   81 ++++++++++++++++++++--
 5 files changed, 90 insertions(+), 178 deletions(-)

-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH net-next 1/4] net: generic fdb support for drivers without ndo_fdb_<op>
  2013-02-28 23:12 [PATCH net-next 0/4] Provide default fdb operation to allow mac filter setting Vlad Yasevich
@ 2013-02-28 23:13 ` Vlad Yasevich
  2013-02-28 23:13 ` [PATCH net-next 2/4] ixgbe: Remove driver specific fdb handlers Vlad Yasevich
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Vlad Yasevich @ 2013-02-28 23:13 UTC (permalink / raw)
  To: netdev; +Cc: john.r.fastabend, Vlad Yasevich

If the driver does not support the ndo_op use the generic
handler for it. This should work in the majority of cases.
Eventually the fdb_dflt_add call gets translated into a
__dev_set_rx_mode() call which should handle hardware
support for filtering via the IFF_UNICAST_FLT flag.

Namely IFF_UNICAST_FLT indicates if the hardware can do
unicast address filtering. If no support is available
the device is put into promisc mode.

CC: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
---
 include/linux/rtnetlink.h |    9 +++++
 net/core/rtnetlink.c      |   81 +++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 84 insertions(+), 6 deletions(-)

diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 489dd7bb..f28544b 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -69,6 +69,15 @@ extern int ndo_dflt_fdb_dump(struct sk_buff *skb,
 			     struct netlink_callback *cb,
 			     struct net_device *dev,
 			     int idx);
+extern int ndo_dflt_fdb_add(struct ndmsg *ndm,
+			    struct nlattr *tb[],
+			    struct net_device *dev,
+			    const unsigned char *addr,
+			     u16 flags);
+extern int ndo_dflt_fdb_del(struct ndmsg *ndm,
+			    struct nlattr *tb[],
+			    struct net_device *dev,
+			    const unsigned char *addr);
 
 extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
 				   struct net_device *dev, u16 mode);
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index d8aa20f..56b0038 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2049,6 +2049,38 @@ errout:
 	rtnl_set_sk_err(net, RTNLGRP_NEIGH, err);
 }
 
+/**
+ * ndo_dflt_fdb_add - default netdevice operation to add an FDB entry
+ */
+int ndo_dflt_fdb_add(struct ndmsg *ndm,
+		     struct nlattr *tb[],
+		     struct net_device *dev,
+		     const unsigned char *addr,
+		     u16 flags)
+{
+	int err = -EINVAL;
+
+	/* If aging addresses are supported device will need to
+	 * implement its own handler for this.
+	 */
+	if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
+		pr_info("%s: FDB only supports static addresses\n", dev->name);
+		return err;
+	}
+
+	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))
+		err = dev_uc_add_excl(dev, addr);
+	else if (is_multicast_ether_addr(addr))
+		err = dev_mc_add_excl(dev, addr);
+
+	/* Only return duplicate errors if NLM_F_EXCL is set */
+	if (err == -EEXIST && !(flags & NLM_F_EXCL))
+		err = 0;
+
+	return err;
+}
+EXPORT_SYMBOL(ndo_dflt_fdb_add);
+
 static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
 {
 	struct net *net = sock_net(skb->sk);
@@ -2101,10 +2133,13 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
 	}
 
 	/* Embedded bridge, macvlan, and any other device support */
-	if ((ndm->ndm_flags & NTF_SELF) && dev->netdev_ops->ndo_fdb_add) {
-		err = dev->netdev_ops->ndo_fdb_add(ndm, tb,
-						   dev, addr,
-						   nlh->nlmsg_flags);
+	if ((ndm->ndm_flags & NTF_SELF)) {
+		if (dev->netdev_ops->ndo_fdb_add)
+			err = dev->netdev_ops->ndo_fdb_add(ndm, tb, dev, addr,
+							   nlh->nlmsg_flags);
+		else
+			err = ndo_dflt_fdb_add(ndm, tb, dev, addr,
+					       nlh->nlmsg_flags);
 
 		if (!err) {
 			rtnl_fdb_notify(dev, addr, RTM_NEWNEIGH);
@@ -2115,6 +2150,35 @@ out:
 	return err;
 }
 
+/**
+ * ndo_dflt_fdb_del - default netdevice operation to delete an FDB entry
+ */
+int ndo_dflt_fdb_del(struct ndmsg *ndm,
+		     struct nlattr *tb[],
+		     struct net_device *dev,
+		     const unsigned char *addr)
+{
+	int err = -EOPNOTSUPP;
+
+	/* If aging addresses are supported device will need to
+	 * implement its own handler for this.
+	 */
+	if (ndm->ndm_state & NUD_PERMANENT) {
+		pr_info("%s: FDB only supports static addresses\n", dev->name);
+		return -EINVAL;
+	}
+
+	if (is_unicast_ether_addr(addr) || is_link_local_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;
+}
+EXPORT_SYMBOL(ndo_dflt_fdb_del);
+
 static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
 {
 	struct net *net = sock_net(skb->sk);
@@ -2172,8 +2236,11 @@ static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
 	}
 
 	/* Embedded bridge, macvlan, and any other device support */
-	if ((ndm->ndm_flags & NTF_SELF) && dev->netdev_ops->ndo_fdb_del) {
-		err = dev->netdev_ops->ndo_fdb_del(ndm, tb, dev, addr);
+	if (ndm->ndm_flags & NTF_SELF) {
+		if (dev->netdev_ops->ndo_fdb_del)
+			err = dev->netdev_ops->ndo_fdb_del(ndm, tb, dev, addr);
+		else
+			err = ndo_dflt_fdb_del(ndm, tb, dev, addr);
 
 		if (!err) {
 			rtnl_fdb_notify(dev, addr, RTM_DELNEIGH);
@@ -2258,6 +2325,8 @@ static int rtnl_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb)
 
 		if (dev->netdev_ops->ndo_fdb_dump)
 			idx = dev->netdev_ops->ndo_fdb_dump(skb, cb, dev, idx);
+		else
+			ndo_dflt_fdb_dump(skb, cb, dev, idx);
 	}
 	rcu_read_unlock();
 
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next 2/4] ixgbe: Remove driver specific fdb handlers.
  2013-02-28 23:12 [PATCH net-next 0/4] Provide default fdb operation to allow mac filter setting Vlad Yasevich
  2013-02-28 23:13 ` [PATCH net-next 1/4] net: generic fdb support for drivers without ndo_fdb_<op> Vlad Yasevich
@ 2013-02-28 23:13 ` Vlad Yasevich
       [not found]   ` <51304296.8080106@intel.com>
  2013-02-28 23:13 ` [PATCH net-next 3/4] mlx4: " Vlad Yasevich
  2013-02-28 23:13 ` [PATCH net-next 4/4] qlcnic: Use generic fdb handler when driver options are not enabled Vlad Yasevich
  3 siblings, 1 reply; 7+ messages in thread
From: Vlad Yasevich @ 2013-02-28 23:13 UTC (permalink / raw)
  To: netdev; +Cc: john.r.fastabend, Vlad Yasevich, CC: Gregory Rose

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)
-{
-	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,
 };
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next 3/4] mlx4: Remove driver specific fdb handlers.
  2013-02-28 23:12 [PATCH net-next 0/4] Provide default fdb operation to allow mac filter setting Vlad Yasevich
  2013-02-28 23:13 ` [PATCH net-next 1/4] net: generic fdb support for drivers without ndo_fdb_<op> Vlad Yasevich
  2013-02-28 23:13 ` [PATCH net-next 2/4] ixgbe: Remove driver specific fdb handlers Vlad Yasevich
@ 2013-02-28 23:13 ` Vlad Yasevich
  2013-02-28 23:13 ` [PATCH net-next 4/4] qlcnic: Use generic fdb handler when driver options are not enabled Vlad Yasevich
  3 siblings, 0 replies; 7+ messages in thread
From: Vlad Yasevich @ 2013-02-28 23:13 UTC (permalink / raw)
  To: netdev; +Cc: john.r.fastabend, Vlad Yasevich, Amir Vadai, Yan Burman

Remove driver specific fdb hadlers since they are the same as
the default ones.

CC: Amir Vadai <amirv@mellanox.com>
CC: Yan Burman <yanb@mellanox.com>
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c |   76 ------------------------
 1 files changed, 0 insertions(+), 76 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index 5385474..5c1bb44 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1925,79 +1925,6 @@ static int mlx4_en_set_features(struct net_device *netdev,
 
 }
 
-static int mlx4_en_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
-			   struct net_device *dev,
-			   const unsigned char *addr, u16 flags)
-{
-	struct mlx4_en_priv *priv = netdev_priv(dev);
-	struct mlx4_dev *mdev = priv->mdev->dev;
-	int err;
-
-	if (!mlx4_is_mfunc(mdev))
-		return -EOPNOTSUPP;
-
-	/* Hardware does not support aging addresses, allow only
-	 * permanent addresses if ndm_state is given
-	 */
-	if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
-		en_info(priv, "Add FDB only supports static addresses\n");
-		return -EINVAL;
-	}
-
-	if (is_unicast_ether_addr(addr) || is_link_local_ether_addr(addr))
-		err = dev_uc_add_excl(dev, addr);
-	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 mlx4_en_fdb_del(struct ndmsg *ndm,
-			   struct nlattr *tb[],
-			   struct net_device *dev,
-			   const unsigned char *addr)
-{
-	struct mlx4_en_priv *priv = netdev_priv(dev);
-	struct mlx4_dev *mdev = priv->mdev->dev;
-	int err;
-
-	if (!mlx4_is_mfunc(mdev))
-		return -EOPNOTSUPP;
-
-	if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
-		en_info(priv, "Del FDB only supports static addresses\n");
-		return -EINVAL;
-	}
-
-	if (is_unicast_ether_addr(addr) || is_link_local_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 mlx4_en_fdb_dump(struct sk_buff *skb,
-			    struct netlink_callback *cb,
-			    struct net_device *dev, int idx)
-{
-	struct mlx4_en_priv *priv = netdev_priv(dev);
-	struct mlx4_dev *mdev = priv->mdev->dev;
-
-	if (mlx4_is_mfunc(mdev))
-		idx = ndo_dflt_fdb_dump(skb, cb, dev, idx);
-
-	return idx;
-}
-
 static const struct net_device_ops mlx4_netdev_ops = {
 	.ndo_open		= mlx4_en_open,
 	.ndo_stop		= mlx4_en_close,
@@ -2019,9 +1946,6 @@ static const struct net_device_ops mlx4_netdev_ops = {
 #ifdef CONFIG_RFS_ACCEL
 	.ndo_rx_flow_steer	= mlx4_en_filter_rfs,
 #endif
-	.ndo_fdb_add		= mlx4_en_fdb_add,
-	.ndo_fdb_del		= mlx4_en_fdb_del,
-	.ndo_fdb_dump		= mlx4_en_fdb_dump,
 };
 
 int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next 4/4] qlcnic: Use generic fdb handler when driver options are not enabled.
  2013-02-28 23:12 [PATCH net-next 0/4] Provide default fdb operation to allow mac filter setting Vlad Yasevich
                   ` (2 preceding siblings ...)
  2013-02-28 23:13 ` [PATCH net-next 3/4] mlx4: " Vlad Yasevich
@ 2013-02-28 23:13 ` Vlad Yasevich
  2013-02-28 23:35   ` Jitendra Kalsaria
  3 siblings, 1 reply; 7+ messages in thread
From: Vlad Yasevich @ 2013-02-28 23:13 UTC (permalink / raw)
  To: netdev
  Cc: john.r.fastabend, Vlad Yasevich, Jitendra Kalsaria, Sony Chacko,
	linux-driver

Allow qlcnic to use the generic fdb handler when the driver options
are not enabled.   Untill the driver is fully fixed, this allows
the use of the FDB interface with qlogic driver, but simply puts
the driver into promisc mode since the driver currently does not
support IFF_UNICAST_FLT.

CC: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
CC: Sony Chacko <sony.chacko@qlogic.com>
CC: linux-driver@qlogic.com
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 5d5fd06..d8dbf29 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -253,11 +253,8 @@ static int qlcnic_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
 	struct qlcnic_adapter *adapter = netdev_priv(netdev);
 	int err = -EOPNOTSUPP;
 
-	if (!adapter->fdb_mac_learn) {
-		pr_info("%s: Driver mac learn is enabled, FDB operation not allowed\n",
-			__func__);
-		return err;
-	}
+	if (!adapter->fdb_mac_learn)
+		return ndo_dflt_fdb_del(ndm, tb, netdev, addr);
 
 	if (adapter->flags & QLCNIC_ESWITCH_ENABLED) {
 		if (is_unicast_ether_addr(addr))
@@ -277,11 +274,8 @@ static int qlcnic_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
 	struct qlcnic_adapter *adapter = netdev_priv(netdev);
 	int err = 0;
 
-	if (!adapter->fdb_mac_learn) {
-		pr_info("%s: Driver mac learn is enabled, FDB operation not allowed\n",
-			__func__);
-		return -EOPNOTSUPP;
-	}
+	if (!adapter->fdb_mac_learn)
+		return ndo_dflt_fdb_add(ndm, tb, netdev, addr, flags);
 
 	if (!(adapter->flags & QLCNIC_ESWITCH_ENABLED)) {
 		pr_info("%s: FDB e-switch is not enabled\n", __func__);
@@ -306,11 +300,8 @@ static int qlcnic_fdb_dump(struct sk_buff *skb, struct netlink_callback *ncb,
 {
 	struct qlcnic_adapter *adapter = netdev_priv(netdev);
 
-	if (!adapter->fdb_mac_learn) {
-		pr_info("%s: Driver mac learn is enabled, FDB operation not allowed\n",
-			__func__);
-		return -EOPNOTSUPP;
-	}
+	if (!adapter->fdb_mac_learn)
+		return ndo_dflt_fdb_dump(skb, ncb, netdev, idx);
 
 	if (adapter->flags & QLCNIC_ESWITCH_ENABLED)
 		idx = ndo_dflt_fdb_dump(skb, ncb, netdev, idx);
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 4/4] qlcnic: Use generic fdb handler when driver options are not enabled.
  2013-02-28 23:13 ` [PATCH net-next 4/4] qlcnic: Use generic fdb handler when driver options are not enabled Vlad Yasevich
@ 2013-02-28 23:35   ` Jitendra Kalsaria
  0 siblings, 0 replies; 7+ messages in thread
From: Jitendra Kalsaria @ 2013-02-28 23:35 UTC (permalink / raw)
  To: Vlad Yasevich, netdev
  Cc: john.r.fastabend, Sony Chacko, Dept-Eng Linux Driver



On 2/28/13 3:13 PM, "Vlad Yasevich" <vyasevic@redhat.com> wrote:

>Allow qlcnic to use the generic fdb handler when the driver options
>are not enabled.   Untill the driver is fully fixed, this allows
>the use of the FDB interface with qlogic driver, but simply puts
>the driver into promisc mode since the driver currently does not
>support IFF_UNICAST_FLT.
>
>CC: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
>CC: Sony Chacko <sony.chacko@qlogic.com>
>CC: linux-driver@qlogic.com
>Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
>---
>drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |   21
>++++++---------------
>1 files changed, 6 insertions(+), 15 deletions(-)

Thanks! Soon will add support for IFF_UNICAST_FLT

Acked-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 2/4] ixgbe: Remove driver specific fdb handlers.
       [not found]   ` <51304296.8080106@intel.com>
@ 2013-03-01 14:35     ` Vlad Yasevich
  0 siblings, 0 replies; 7+ messages in thread
From: Vlad Yasevich @ 2013-03-01 14:35 UTC (permalink / raw)
  To: John Fastabend; +Cc: netdev, Gregory Rose

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-03-01 14:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-28 23:12 [PATCH net-next 0/4] Provide default fdb operation to allow mac filter setting Vlad Yasevich
2013-02-28 23:13 ` [PATCH net-next 1/4] net: generic fdb support for drivers without ndo_fdb_<op> Vlad Yasevich
2013-02-28 23:13 ` [PATCH net-next 2/4] ixgbe: Remove driver specific fdb handlers Vlad Yasevich
     [not found]   ` <51304296.8080106@intel.com>
2013-03-01 14:35     ` Vlad Yasevich
2013-02-28 23:13 ` [PATCH net-next 3/4] mlx4: " Vlad Yasevich
2013-02-28 23:13 ` [PATCH net-next 4/4] qlcnic: Use generic fdb handler when driver options are not enabled Vlad Yasevich
2013-02-28 23:35   ` Jitendra Kalsaria

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).