From: Vlad Yasevich <vyasevic@redhat.com>
To: netdev@vger.kernel.org
Cc: john.r.fastabend@intel.com, davem@davemloft.net,
Vlad Yasevich <vyasevic@redhat.com>
Subject: [RFC PATCH 2/3] ixgbe: Use default fdb handlers when not in VF mode.
Date: Wed, 27 Feb 2013 12:46:03 -0500 [thread overview]
Message-ID: <1361987164-15280-3-git-send-email-vyasevic@redhat.com> (raw)
In-Reply-To: <1361987164-15280-1-git-send-email-vyasevic@redhat.com>
Allow the use of ndo_dflt_fdb_<add|del|dump> when the
adapter does not have VF configured. This allows for
IFF_UNICAST_FLT support and allows VF handling to potentially
do something different.
CC: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 26 ++++++++++--------------
1 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 68478d6..0ae2525 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[],
int err;
if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED))
- return -EOPNOTSUPP;
+ return ndo_dflt_fdb_add(ndm, tb, dev, addr, flags);
/* Hardware does not support aging addresses so if a
* ndm_state is given only allow permanent addresses
@@ -7045,20 +7045,21 @@ static int ixgbe_ndo_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
struct ixgbe_adapter *adapter = netdev_priv(dev);
int err = -EOPNOTSUPP;
+ if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED))
+ return ndo_dflt_fdb_del(ndm, tb, dev, addr);
+
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;
- }
+ 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;
}
@@ -7068,12 +7069,7 @@ static int ixgbe_ndo_fdb_dump(struct sk_buff *skb,
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;
+ return ndo_dflt_fdb_dump(skb, cb, dev, idx);
}
static int ixgbe_ndo_bridge_setlink(struct net_device *dev,
--
1.7.7.6
next prev parent reply other threads:[~2013-02-27 17:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-27 17:46 [RFC PATCH 0/3] Provide default fdb operation to allow mac filter Vlad Yasevich
2013-02-27 17:46 ` [RFC PATCH 1/3] net: generic fdb support for drivers without ndo_fdb_<op> Vlad Yasevich
2013-02-27 17:46 ` Vlad Yasevich [this message]
2013-02-28 4:26 ` [RFC PATCH 2/3] ixgbe: Use default fdb handlers when not in VF mode John Fastabend
2013-02-28 14:46 ` Vlad Yasevich
2013-02-27 17:46 ` [RFC PATCH 3/3] mlx4: Use default fdb handlers when not multifunction Vlad Yasevich
2013-02-28 4:27 ` John Fastabend
[not found] ` <CAJZOPZLcphuZEXR+jhT35=qtOq9bfxWzWEokN6UrMorciCvvsA@mail.gmail.com>
2013-02-28 12:32 ` Yan Burman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1361987164-15280-3-git-send-email-vyasevic@redhat.com \
--to=vyasevic@redhat.com \
--cc=davem@davemloft.net \
--cc=john.r.fastabend@intel.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).