* Re: [PATCH] bgmac: omit the fcs
From: Eric Dumazet @ 2013-02-28 22:16 UTC (permalink / raw)
To: Rafał Miłecki; +Cc: Hauke Mehrtens, davem, netdev
In-Reply-To: <CACna6rw6MR3agrDvz0+X7ne6uSNQN0tpZupeM5c-6xy5-pvv2Q@mail.gmail.com>
On Thu, 2013-02-28 at 18:57 +0100, Rafał Miłecki wrote:
> Is this a real fix?
>
> Don't get me wrong, but it sounds a little like a workaround for some
> issue in another network layer ;)
It looks a real fix in a forwarding workload, or else MTU would need 4
extra bytes.
^ permalink raw reply
* Re: [PATCH net-next] generalize VXLAN forwarding tables
From: Eric Dumazet @ 2013-02-28 22:27 UTC (permalink / raw)
To: David L Stevens; +Cc: David Miller, Stephen Hemminger, netdev
In-Reply-To: <201302281924.r1SJN7u5024149@lab1.dls>
On Thu, 2013-02-28 at 14:23 -0500, David L Stevens wrote:
> + /* if there are multiple destinations, send copies */
> + for (rdst = rdst0->remote_next; rdst; rdst = rdst->remote_next) {
> + struct sk_buff *skb1;
> +
> + skb1 = skb_clone(skb, GFP_ATOMIC);
> + rc1 = vxlan_xmit_one(skb1, dev, rdst, did_rsc);
> + if (rc == NETDEV_TX_OK)
> + rc = rc1;
> + }
> +
> + rc1 = vxlan_xmit_one(skb, dev, rdst0, did_rsc);
> + if (rc == NETDEV_TX_OK)
> + rc = rc1;
> + return rc;
> +}
It looks like vxlan_xmit_one() will overwrite header
So skb_clone() is probably not what you wanted ?
^ permalink raw reply
* Re: [PATCH net-next] generalize VXLAN forwarding tables
From: David Stevens @ 2013-02-28 22:55 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Miller, netdev, netdev-owner, Stephen Hemminger
In-Reply-To: <1362090475.15793.51.camel@edumazet-glaptop>
netdev-owner@vger.kernel.org wrote on 02/28/2013 05:27:55 PM:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> On Thu, 2013-02-28 at 14:23 -0500, David L Stevens wrote:
>
> > + /* if there are multiple destinations, send copies */
> > + for (rdst = rdst0->remote_next; rdst; rdst = rdst->remote_next) {
> > + struct sk_buff *skb1;
> > +
> > + skb1 = skb_clone(skb, GFP_ATOMIC);
> > + rc1 = vxlan_xmit_one(skb1, dev, rdst, did_rsc);
> > + if (rc == NETDEV_TX_OK)
> > + rc = rc1;
> > + }
> > +
> > + rc1 = vxlan_xmit_one(skb, dev, rdst0, did_rsc);
> > + if (rc == NETDEV_TX_OK)
> > + rc = rc1;
> > + return rc;
> > +}
>
>
> It looks like vxlan_xmit_one() will overwrite header
>
> So skb_clone() is probably not what you wanted ?
We're only prepending encapsulation headers, and we
do skb_cow_head() for each of those in vxlan_xmit_one().
This skb should be just the original , unencapsulated
packet which is identical in all copies.
+-DLS
^ permalink raw reply
* [PATCH net-next 0/4] Provide default fdb operation to allow mac filter setting
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
* [PATCH net-next 1/4] net: generic fdb support for drivers without ndo_fdb_<op>
From: Vlad Yasevich @ 2013-02-28 23:13 UTC (permalink / raw)
To: netdev; +Cc: john.r.fastabend, Vlad Yasevich
In-Reply-To: <1362093183-5938-1-git-send-email-vyasevic@redhat.com>
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
* [PATCH net-next 2/4] ixgbe: Remove driver specific fdb handlers.
From: Vlad Yasevich @ 2013-02-28 23:13 UTC (permalink / raw)
To: netdev; +Cc: john.r.fastabend, Vlad Yasevich, CC: Gregory Rose
In-Reply-To: <1362093183-5938-1-git-send-email-vyasevic@redhat.com>
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
* [PATCH net-next 4/4] qlcnic: Use generic fdb handler when driver options are not enabled.
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
In-Reply-To: <1362093183-5938-1-git-send-email-vyasevic@redhat.com>
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
* [PATCH net-next 3/4] mlx4: Remove driver specific fdb handlers.
From: Vlad Yasevich @ 2013-02-28 23:13 UTC (permalink / raw)
To: netdev; +Cc: john.r.fastabend, Vlad Yasevich, Amir Vadai, Yan Burman
In-Reply-To: <1362093183-5938-1-git-send-email-vyasevic@redhat.com>
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
* Re: [PATCH net-next 4/4] qlcnic: Use generic fdb handler when driver options are not enabled.
From: Jitendra Kalsaria @ 2013-02-28 23:35 UTC (permalink / raw)
To: Vlad Yasevich, netdev
Cc: john.r.fastabend@intel.com, Sony Chacko, Dept-Eng Linux Driver
In-Reply-To: <1362093183-5938-5-git-send-email-vyasevic@redhat.com>
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
* Fw: LOAN OFFER APPLY NOW............
From: Elizabeth Miyank Refinace Home @ 2013-02-28 23:49 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 79 bytes --]
Do you need personal,Business Loans,Contact us with Name,Amount,Duration&Tel#
[-- Attachment #2: BORROWERS INFORMATION.rtf --]
[-- Type: application/rtf, Size: 35702 bytes --]
^ permalink raw reply
* linux-next: manual merge of the bluetooth tree with Linus' tree
From: Stephen Rothwell @ 2013-03-01 1:54 UTC (permalink / raw)
To: Gustavo Padovan
Cc: linux-next, linux-kernel, Ying Xue, David Miller, netdev,
Dean Jenkins
[-- Attachment #1: Type: text/plain, Size: 537 bytes --]
Hi Gustavo,
Today's linux-next merge of the bluetooth tree got a conflict in
net/bluetooth/rfcomm/core.c between commit 25cc4ae913a4 ("net: remove
redundant check for timer pending state before del_timer") from Linus' tree
and commit 5c87e6efd14d ("Bluetooth: Avoid rfcomm_session_timeout using
freed session") from the bluetooth tree.
I fixed it up (I just used the bluetooth tree version) and can carry the
fix as necessary (no action is required).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH 1/1 net-next] fec: net: put tx to napi poll function to fix dead lock
From: Frank Li @ 2013-03-01 3:05 UTC (permalink / raw)
To: David Miller
Cc: Frank.Li, shawn.guo, B38611, linux-arm-kernel, netdev, s.hauer
In-Reply-To: <20130228.153942.1205752844713252540.davem@davemloft.net>
2013/3/1 David Miller <davem@davemloft.net>:
> From: Frank Li <Frank.Li@freescale.com>
> Date: Thu, 28 Feb 2013 11:44:20 +0800
>
>> + int tx_pkts = fec_enet_tx(ndev);
>> +
>> + if (tx_pkts)
>> + return budget;
>
> This isn't right, you don't want to finish the NAPI poll because
> TX work was done.
>
> Ignore the TX work for poll completion purposes, see
> drivers/net/ethernet/broadcom/tg3.c:tg3_poll_work() for
> example.
I read tg3.c code. If I understand correct,
just need remove below line
if (tx_pkts)
return budget;
Is it ture?
^ permalink raw reply
* Re: [PATCH 1/1 net-next] fec: net: put tx to napi poll function to fix dead lock
From: David Miller @ 2013-03-01 3:06 UTC (permalink / raw)
To: lznuaa; +Cc: Frank.Li, shawn.guo, B38611, linux-arm-kernel, netdev, s.hauer
In-Reply-To: <CAHrpEqQk7ZeKicAZMN=d6wksEPzWO0dCvqj6n6Gj+2GLFJuRaA@mail.gmail.com>
From: Frank Li <lznuaa@gmail.com>
Date: Fri, 1 Mar 2013 11:05:57 +0800
> 2013/3/1 David Miller <davem@davemloft.net>:
>> From: Frank Li <Frank.Li@freescale.com>
>> Date: Thu, 28 Feb 2013 11:44:20 +0800
>>
>>> + int tx_pkts = fec_enet_tx(ndev);
>>> +
>>> + if (tx_pkts)
>>> + return budget;
>>
>> This isn't right, you don't want to finish the NAPI poll because
>> TX work was done.
>>
>> Ignore the TX work for poll completion purposes, see
>> drivers/net/ethernet/broadcom/tg3.c:tg3_poll_work() for
>> example.
>
> I read tg3.c code. If I understand correct,
> just need remove below line
>
> if (tx_pkts)
> return budget;
>
> Is it ture?
Yes.
^ permalink raw reply
* Re: [RFC Patch net-next] vxlan: add ipv6 support
From: Cong Wang @ 2013-03-01 3:31 UTC (permalink / raw)
To: vyasevic; +Cc: Thomas Graf, netdev, David S. Miller, Stephen Hemminger
In-Reply-To: <512FC71D.8080508@redhat.com>
On Thu, 2013-02-28 at 16:07 -0500, Vlad Yasevich wrote:
> On 02/28/2013 05:33 AM, Thomas Graf wrote:
> > On 02/28/13 at 02:01pm, Cong Wang wrote:
> >> WARNING: This is just an RFC patch, it only compiles!!
> >>
> >> This patch adds IPv6 support to vxlan device, as the new version
> >> RFC already mentioned it:
> >>
> >> http://tools.ietf.org/html/draft-mahalingam-dutt-dcops-vxlan-03
> >>
> >> I am not sure if the following trick will work:
> >>
> >> + if (nla_len(nla) == sizeof(__be32)) {
> >> + ip->ip4 = nla_get_be32(nla);
> >> + ip->proto = htons(ETH_P_IP);
> >> + }
> >> +#if IS_ENABLED(CONFIG_IPV6)
> >> + else if (nla_len(nla) == sizeof(struct in6_addr)) {
> >> + nla_memcpy(&ip->ip6, nla, sizeof(struct in6_addr));
> >> + ip->proto = htons(ETH_P_IPV6);
> >> + }
> >> +#endif
> >>
> >> otherwise we have to introduce some new netlink attributes for
> >> IPv6 addresses? Any comments?
> >
> > How about setting ndm_family to AF_INET6 and parse NDA_DST based on
> > that?
> >
>
> Not sure if you can do that without registering your own fdb netlink
> handler. rtnl_fdb_add is registered for PF_BRIDGE family.
Yeah...
>
> You could do that, or use NDA_DST similar to how neighbor table uses it.
> There the data inside of NDA_DST holds an address family and other data.
>
The data inside NDA_DST in neighbor table is the IP address used as a
key:
if (nla_put(skb, NDA_DST, neigh->tbl->key_len,
neigh->primary_key))
goto nla_put_failure;
there is not address family inside it.
Thanks.
^ permalink raw reply
* RE: [PATCH v4 1/9] rdma/cm: define native IB address
From: Hefty, Sean @ 2013-03-01 3:49 UTC (permalink / raw)
To: Hefty, Sean, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
David Miller (davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org),
Roland Dreier
In-Reply-To: <1828884A29C6694DAF28B7E6B8A8237368B99D59-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
> > Define AF_IB and sockaddr_ib to allow the rdma_cm to use native IB
> > addressing.
> >
> > Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > ---
> > include/linux/socket.h | 2 +
> > include/rdma/ib.h | 89
> ++++++++++++++++++++++++++++++++++++++++++++++++
> > 2 files changed, 91 insertions(+), 0 deletions(-)
> > create mode 100644 include/rdma/ib.h
> >
> > diff --git a/include/linux/socket.h b/include/linux/socket.h
> > index 9a546ff..17a33f7 100644
> > --- a/include/linux/socket.h
> > +++ b/include/linux/socket.h
> > @@ -167,6 +167,7 @@ struct ucred {
> > #define AF_PPPOX 24 /* PPPoX sockets */
> > #define AF_WANPIPE 25 /* Wanpipe API Sockets */
> > #define AF_LLC 26 /* Linux LLC */
> > +#define AF_IB 27 /* Native InfiniBand address */
>
> ...
>
> > diff --git a/include/rdma/ib.h b/include/rdma/ib.h
>
> ...
>
> > +struct sockaddr_ib {
> > + unsigned short int sib_family; /* AF_IB */
> > + __be16 sib_pkey;
> > + __be32 sib_flowinfo;
> > + struct ib_addr sib_addr;
> > + __be64 sib_sid;
> > + __be64 sib_sid_mask;
> > + __u64 sib_scope_id;
> > +};
>
> Dave/Roland/anyone, is there any feedback on this approach?
ping...
Seriously, there is a need to establish connections using native IB GIDs. It is preferable to add this functionality to the rdma_cm. Although the ib_cm can exchange IB CM messages based on GIDs, the rdma_cm is the only interface that provides applications with dynamic service IDs, path record queries, and usable multicast support.
The rdma_cm uses sockaddr for addressing information. The sockaddr_ib structure is defined within the RDMA tree, but I believe that the address family value belongs in socket.h. This helps to avoid any future conflicts. However, I can change the rdma_cm to use an internal enum for address values if there is an objection.
sockaddr_ib/AF_IB is usable with any IB network card. It allows an application to establish connections over IB without IBoIP being present, which is a real need. It also allows an application to use out of band mechanisms for discovering remote GIDs. Such mechanisms are needed to work through IP load balancing software and for MPI scalability.
I'm not trying to be impatient, but it's been 3 years...
- Sean
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH v2 1/1 net-next] fec: net: put tx to napi poll function to fix dead lock
From: Frank Li @ 2013-03-01 3:37 UTC (permalink / raw)
To: lznuaa, shawn.guo, B38611, davem, linux-arm-kernel, netdev
Cc: s.hauer, Frank Li
up stack ndo_start_xmit already hold lock.
fec_enet_start_xmit needn't spin lock.
stat_xmit just update fep->cur_tx
fec_enet_tx just update fep->dirty_tx
Reserve a empty bdb to check full or empty
cur_tx == dirty_tx means full
cur_tx == dirty_tx +1 means empty
So needn't is_full variable.
Fix spin lock deadlock
=================================
[ INFO: inconsistent lock state ]
3.8.0-rc5+ #107 Not tainted
---------------------------------
inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
ptp4l/615 [HC1[1]:SC0[0]:HE0:SE1] takes:
(&(&list->lock)->rlock#3){?.-...}, at: [<8042c3c4>] skb_queue_tail+0x20/0x50
{HARDIRQ-ON-W} state was registered at:
[<80067250>] mark_lock+0x154/0x4e8
[<800676f4>] mark_irqflags+0x110/0x1a4
[<80069208>] __lock_acquire+0x494/0x9c0
[<80069ce8>] lock_acquire+0x90/0xa4
[<80527ad0>] _raw_spin_lock_bh+0x44/0x54
[<804877e0>] first_packet_length+0x38/0x1f0
[<804879e4>] udp_poll+0x4c/0x5c
[<804231f8>] sock_poll+0x24/0x28
[<800d27f0>] do_poll.isra.10+0x120/0x254
[<800d36e4>] do_sys_poll+0x15c/0x1e8
[<800d3828>] sys_poll+0x60/0xc8
[<8000e780>] ret_fast_syscall+0x0/0x3c
*** DEADLOCK ***
1 lock held by ptp4l/615:
#0: (&(&fep->hw_lock)->rlock){-.-...}, at: [<80355f9c>] fec_enet_tx+0x24/0x268
stack backtrace:
Backtrace:
[<800121e0>] (dump_backtrace+0x0/0x10c) from [<80516210>] (dump_stack+0x18/0x1c)
r6:8063b1fc r5:bf38b2f8 r4:bf38b000 r3:bf38b000
[<805161f8>] (dump_stack+0x0/0x1c) from [<805189d0>] (print_usage_bug.part.34+0x164/0x1a4)
[<8051886c>] (print_usage_bug.part.34+0x0/0x1a4) from [<80518a88>] (print_usage_bug+0x78/0x88)
r8:80065664 r7:bf38b2f8 r6:00000002 r5:00000000 r4:bf38b000
[<80518a10>] (print_usage_bug+0x0/0x88) from [<80518b58>] (mark_lock_irq+0xc0/0x270)
r7:bf38b000 r6:00000002 r5:bf38b2f8 r4:00000000
[<80518a98>] (mark_lock_irq+0x0/0x270) from [<80067270>] (mark_lock+0x174/0x4e8)
[<800670fc>] (mark_lock+0x0/0x4e8) from [<80067744>] (mark_irqflags+0x160/0x1a4)
[<800675e4>] (mark_irqflags+0x0/0x1a4) from [<80069208>] (__lock_acquire+0x494/0x9c0)
r5:00000002 r4:bf38b2f8
[<80068d74>] (__lock_acquire+0x0/0x9c0) from [<80069ce8>] (lock_acquire+0x90/0xa4)
[<80069c58>] (lock_acquire+0x0/0xa4) from [<805278d8>] (_raw_spin_lock_irqsave+0x4c/0x60)
[<8052788c>] (_raw_spin_lock_irqsave+0x0/0x60) from [<8042c3c4>] (skb_queue_tail+0x20/0x50)
r6:bfbb2180 r5:bf1d0190 r4:bf1d0184
[<8042c3a4>] (skb_queue_tail+0x0/0x50) from [<8042c4cc>] (sock_queue_err_skb+0xd8/0x188)
r6:00000056 r5:bfbb2180 r4:bf1d0000 r3:00000000
[<8042c3f4>] (sock_queue_err_skb+0x0/0x188) from [<8042d15c>] (skb_tstamp_tx+0x70/0xa0)
r6:bf0dddb0 r5:bf1d0000 r4:bfbb2180 r3:00000004
[<8042d0ec>] (skb_tstamp_tx+0x0/0xa0) from [<803561d0>] (fec_enet_tx+0x258/0x268)
r6:c089d260 r5:00001c00 r4:bfbd0000
[<80355f78>] (fec_enet_tx+0x0/0x268) from [<803562cc>] (fec_enet_interrupt+0xec/0xf8)
[<803561e0>] (fec_enet_interrupt+0x0/0xf8) from [<8007d5b0>] (handle_irq_event_percpu+0x54/0x1a0)
[<8007d55c>] (handle_irq_event_percpu+0x0/0x1a0) from [<8007d740>] (handle_irq_event+0x44/0x64)
[<8007d6fc>] (handle_irq_event+0x0/0x64) from [<80080690>] (handle_fasteoi_irq+0xc4/0x15c)
r6:bf0dc000 r5:bf811290 r4:bf811240 r3:00000000
[<800805cc>] (handle_fasteoi_irq+0x0/0x15c) from [<8007ceec>] (generic_handle_irq+0x28/0x38)
r5:807130c8 r4:00000096
[<8007cec4>] (generic_handle_irq+0x0/0x38) from [<8000f16c>] (handle_IRQ+0x54/0xb4)
r4:8071d280 r3:00000180
[<8000f118>] (handle_IRQ+0x0/0xb4) from [<80008544>] (gic_handle_irq+0x30/0x64)
r8:8000e924 r7:f4000100 r6:bf0ddef8 r5:8071c974 r4:f400010c
r3:00000000
[<80008514>] (gic_handle_irq+0x0/0x64) from [<8000e2e4>] (__irq_svc+0x44/0x5c)
Exception stack(0xbf0ddef8 to 0xbf0ddf40)
Signed-off-by: Frank Li <Frank.Li@freescale.com>
---
Change from v1 to v2
* ignore TX package count in poll function
drivers/net/ethernet/freescale/fec.c | 92 +++++++++++++++++----------------
drivers/net/ethernet/freescale/fec.h | 3 -
2 files changed, 47 insertions(+), 48 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 0fe68c4..267685b 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -246,14 +246,13 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
struct bufdesc *bdp;
void *bufaddr;
unsigned short status;
- unsigned long flags;
+ unsigned int index;
if (!fep->link) {
/* Link is down or autonegotiation is in progress. */
return NETDEV_TX_BUSY;
}
- spin_lock_irqsave(&fep->hw_lock, flags);
/* Fill in a Tx ring entry */
bdp = fep->cur_tx;
@@ -264,7 +263,6 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
* This should not happen, since ndev->tbusy should be set.
*/
printk("%s: tx queue full!.\n", ndev->name);
- spin_unlock_irqrestore(&fep->hw_lock, flags);
return NETDEV_TX_BUSY;
}
@@ -280,13 +278,13 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
* 4-byte boundaries. Use bounce buffers to copy data
* and get it aligned. Ugh.
*/
+ if (fep->bufdesc_ex)
+ index = (struct bufdesc_ex *)bdp -
+ (struct bufdesc_ex *)fep->tx_bd_base;
+ else
+ index = bdp - fep->tx_bd_base;
+
if (((unsigned long) bufaddr) & FEC_ALIGNMENT) {
- unsigned int index;
- if (fep->bufdesc_ex)
- index = (struct bufdesc_ex *)bdp -
- (struct bufdesc_ex *)fep->tx_bd_base;
- else
- index = bdp - fep->tx_bd_base;
memcpy(fep->tx_bounce[index], skb->data, skb->len);
bufaddr = fep->tx_bounce[index];
}
@@ -300,10 +298,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
swap_buffer(bufaddr, skb->len);
/* Save skb pointer */
- fep->tx_skbuff[fep->skb_cur] = skb;
-
- ndev->stats.tx_bytes += skb->len;
- fep->skb_cur = (fep->skb_cur+1) & TX_RING_MOD_MASK;
+ fep->tx_skbuff[index] = skb;
/* Push the data cache so the CPM does not get stale memory
* data.
@@ -331,26 +326,22 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
ebdp->cbd_esc = BD_ENET_TX_INT;
}
}
- /* Trigger transmission start */
- writel(0, fep->hwp + FEC_X_DES_ACTIVE);
-
/* If this was the last BD in the ring, start at the beginning again. */
if (status & BD_ENET_TX_WRAP)
bdp = fep->tx_bd_base;
else
bdp = fec_enet_get_nextdesc(bdp, fep->bufdesc_ex);
- if (bdp == fep->dirty_tx) {
- fep->tx_full = 1;
+ fep->cur_tx = bdp;
+
+ if (fep->cur_tx == fep->dirty_tx)
netif_stop_queue(ndev);
- }
- fep->cur_tx = bdp;
+ /* Trigger transmission start */
+ writel(0, fep->hwp + FEC_X_DES_ACTIVE);
skb_tx_timestamp(skb);
- spin_unlock_irqrestore(&fep->hw_lock, flags);
-
return NETDEV_TX_OK;
}
@@ -406,11 +397,8 @@ fec_restart(struct net_device *ndev, int duplex)
writel((unsigned long)fep->bd_dma + sizeof(struct bufdesc)
* RX_RING_SIZE, fep->hwp + FEC_X_DES_START);
- fep->dirty_tx = fep->cur_tx = fep->tx_bd_base;
fep->cur_rx = fep->rx_bd_base;
- /* Reset SKB transmit buffers. */
- fep->skb_cur = fep->skb_dirty = 0;
for (i = 0; i <= TX_RING_MOD_MASK; i++) {
if (fep->tx_skbuff[i]) {
dev_kfree_skb_any(fep->tx_skbuff[i]);
@@ -566,27 +554,47 @@ fec_timeout(struct net_device *ndev)
netif_wake_queue(ndev);
}
-static void
+static int
fec_enet_tx(struct net_device *ndev)
{
struct fec_enet_private *fep;
struct bufdesc *bdp;
unsigned short status;
struct sk_buff *skb;
+ int pkts = 0;
+ int index = 0;
+
+ if (IS_ERR(ndev))
+ return 0;
fep = netdev_priv(ndev);
- spin_lock(&fep->hw_lock);
bdp = fep->dirty_tx;
+ /* get next bdp of dirty_tx */
+ if (bdp->cbd_sc & BD_ENET_TX_WRAP)
+ bdp = fep->tx_bd_base;
+ else
+ bdp = fec_enet_get_nextdesc(bdp, fep->bufdesc_ex);
+
while (((status = bdp->cbd_sc) & BD_ENET_TX_READY) == 0) {
- if (bdp == fep->cur_tx && fep->tx_full == 0)
+
+ /* current queue is empty */
+ if (bdp == fep->cur_tx)
break;
+ pkts++;
+
+ if (fep->bufdesc_ex)
+ index = (struct bufdesc_ex *)bdp -
+ (struct bufdesc_ex *)fep->tx_bd_base;
+ else
+ index = bdp - fep->tx_bd_base;
dma_unmap_single(&fep->pdev->dev, bdp->cbd_bufaddr,
FEC_ENET_TX_FRSIZE, DMA_TO_DEVICE);
bdp->cbd_bufaddr = 0;
- skb = fep->tx_skbuff[fep->skb_dirty];
+ skb = fep->tx_skbuff[index];
+
/* Check for errors. */
if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC |
BD_ENET_TX_RL | BD_ENET_TX_UN |
@@ -631,8 +639,9 @@ fec_enet_tx(struct net_device *ndev)
/* Free the sk buffer associated with this last transmit */
dev_kfree_skb_any(skb);
- fep->tx_skbuff[fep->skb_dirty] = NULL;
- fep->skb_dirty = (fep->skb_dirty + 1) & TX_RING_MOD_MASK;
+ fep->tx_skbuff[index] = NULL;
+
+ fep->dirty_tx = bdp;
/* Update pointer to next buffer descriptor to be transmitted */
if (status & BD_ENET_TX_WRAP)
@@ -642,14 +651,12 @@ fec_enet_tx(struct net_device *ndev)
/* Since we have freed up a buffer, the ring is no longer full
*/
- if (fep->tx_full) {
- fep->tx_full = 0;
+ if (fep->dirty_tx != fep->cur_tx) {
if (netif_queue_stopped(ndev))
netif_wake_queue(ndev);
}
}
- fep->dirty_tx = bdp;
- spin_unlock(&fep->hw_lock);
+ return pkts;
}
@@ -816,7 +823,7 @@ fec_enet_interrupt(int irq, void *dev_id)
int_events = readl(fep->hwp + FEC_IEVENT);
writel(int_events, fep->hwp + FEC_IEVENT);
- if (int_events & FEC_ENET_RXF) {
+ if (int_events & (FEC_ENET_RXF | FEC_ENET_TXF)) {
ret = IRQ_HANDLED;
/* Disable the RX interrupt */
@@ -827,15 +834,6 @@ fec_enet_interrupt(int irq, void *dev_id)
}
}
- /* Transmit OK, or non-fatal error. Update the buffer
- * descriptors. FEC handles all errors, we just discover
- * them as part of the transmit process.
- */
- if (int_events & FEC_ENET_TXF) {
- ret = IRQ_HANDLED;
- fec_enet_tx(ndev);
- }
-
if (int_events & FEC_ENET_MII) {
ret = IRQ_HANDLED;
complete(&fep->mdio_done);
@@ -851,6 +849,8 @@ static int fec_enet_rx_napi(struct napi_struct *napi, int budget)
int pkts = fec_enet_rx(ndev, budget);
struct fec_enet_private *fep = netdev_priv(ndev);
+ fec_enet_tx(ndev);
+
if (pkts < budget) {
napi_complete(napi);
writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK);
@@ -1646,6 +1646,7 @@ static int fec_enet_init(struct net_device *ndev)
/* ...and the same for transmit */
bdp = fep->tx_bd_base;
+ fep->cur_tx = bdp;
for (i = 0; i < TX_RING_SIZE; i++) {
/* Initialize the BD for every fragment in the page. */
@@ -1657,6 +1658,7 @@ static int fec_enet_init(struct net_device *ndev)
/* Set the last buffer to wrap */
bdp = fec_enet_get_prevdesc(bdp, fep->bufdesc_ex);
bdp->cbd_sc |= BD_SC_WRAP;
+ fep->dirty_tx = bdp;
fec_restart(ndev, 0);
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index 01579b8..c0f63be 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -214,8 +214,6 @@ struct fec_enet_private {
unsigned char *tx_bounce[TX_RING_SIZE];
struct sk_buff *tx_skbuff[TX_RING_SIZE];
struct sk_buff *rx_skbuff[RX_RING_SIZE];
- ushort skb_cur;
- ushort skb_dirty;
/* CPM dual port RAM relative addresses */
dma_addr_t bd_dma;
@@ -227,7 +225,6 @@ struct fec_enet_private {
/* The ring entries to be free()ed */
struct bufdesc *dirty_tx;
- uint tx_full;
/* hold while accessing the HW like ringbuffer for tx/rx but not MAC */
spinlock_t hw_lock;
--
1.7.1
^ permalink raw reply related
* [patch] NFC: llcp: cleanup underflow check
From: Dan Carpenter @ 2013-03-01 5:20 UTC (permalink / raw)
To: Lauro Ramos Venancio
Cc: Aloisio Almeida Jr, Samuel Ortiz, David S. Miller,
John W. Linville, Thierry Escande, Szymon Janc, linux-wireless,
linux-nfc, netdev, kernel-janitors
In-Reply-To: <2148581.S8tzak9aE2@uw000953>
Szymon Janc suggested I should move the lower bound check into the
caller and make it match the check for NFC_MAX_GT_LEN.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 87a6417..e50dd2c 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -74,6 +74,7 @@ struct nfc_ops {
#define NFC_TARGET_IDX_ANY -1
#define NFC_MAX_GT_LEN 48
+#define NFC_MIN_GT_LEN 3
#define NFC_ATR_RES_GT_OFFSET 15
struct nfc_target {
diff --git a/net/nfc/core.c b/net/nfc/core.c
index 6ceee8e..e2c3b6e 100644
--- a/net/nfc/core.c
+++ b/net/nfc/core.c
@@ -450,7 +450,7 @@ int nfc_set_remote_general_bytes(struct nfc_dev *dev, u8 *gb, u8 gb_len)
{
pr_debug("dev_name=%s gb_len=%d\n", dev_name(&dev->dev), gb_len);
- if (gb_len > NFC_MAX_GT_LEN)
+ if (gb_len < NFC_MIN_GT_LEN || gb_len > NFC_MAX_GT_LEN)
return -EINVAL;
return nfc_llcp_set_remote_gb(dev, gb, gb_len);
diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c
index 7f8266d..7be27fb 100644
--- a/net/nfc/llcp/llcp.c
+++ b/net/nfc/llcp/llcp.c
@@ -547,8 +547,6 @@ int nfc_llcp_set_remote_gb(struct nfc_dev *dev, u8 *gb, u8 gb_len)
pr_err("No LLCP device\n");
return -ENODEV;
}
- if (gb_len < 3)
- return -EINVAL;
memset(local->remote_gb, 0, NFC_MAX_GT_LEN);
memcpy(local->remote_gb, gb, gb_len);
^ permalink raw reply related
* [patch] sctp: use the passed in gfp flags instead GFP_KERNEL
From: Dan Carpenter @ 2013-03-01 5:27 UTC (permalink / raw)
To: Vlad Yasevich
Cc: Sridhar Samudrala, Neil Horman, David S. Miller, linux-sctp,
netdev, kernel-janitors
This patch doesn't change how the code works because in the current
kernel gfp is always GFP_KERNEL. But gfp was obviously intended
instead of GFP_KERNEL.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c
index 2b3ef03..12ed45d 100644
--- a/net/sctp/endpointola.c
+++ b/net/sctp/endpointola.c
@@ -155,7 +155,7 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
/* SCTP-AUTH extensions*/
INIT_LIST_HEAD(&ep->endpoint_shared_keys);
- null_key = sctp_auth_shkey_create(0, GFP_KERNEL);
+ null_key = sctp_auth_shkey_create(0, gfp);
if (!null_key)
goto nomem;
^ permalink raw reply related
* e1000e failed to check map error
From: Dave Jones @ 2013-03-01 5:30 UTC (permalink / raw)
To: netdev
Linus' current tree shows this shortly after boot for me..
WARNING: at lib/dma-debug.c:933 check_unmap+0x407/0x8a0()
Hardware name:
e1000e 0000:05:00.0: DMA-API: device driver failed to check map error[device address=0x000000005bd70000] [size=1376 bytes] [mapped as page]
Modules linked in:
ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_conntrack nf_conntrack ip6table_filter ip6_tables snd_emu10k1 coretemp snd_hwdep snd_util_mem snd_ac97_codec ac97_bus snd_rawmidi snd_seq snd_seq_device microcode snd_pcm pcspkr snd_page_alloc e1000e snd_timer snd soundcore ptp pps_core vhost_net tun macvtap macvlan kvm_intel kvm nfsd binfmt_misc auth_rpcgss nfs_acl lockd sunrpc btrfs libcrc32c lzo_compress zlib_deflate firewire_ohci ata_piix firewire_core sata_sil crc_itu_t radeon i2c_algo_bit hwmon drm_kms_helper ttm drm i2c_core floppy
Pid: 9, comm: rcuc/0 Not tainted 3.8.0+ #75
Call Trace:
<IRQ> [<ffffffff8104abe5>] warn_slowpath_common+0x75/0xa0
[<ffffffff8104acc6>] warn_slowpath_fmt+0x46/0x50
[<ffffffff8135caf7>] check_unmap+0x407/0x8a0
[<ffffffff8110457d>] ? call_rcu+0x1d/0x20
[<ffffffff8135d1ae>] debug_dma_unmap_page+0x5e/0x70
[<ffffffffa04552f1>] e1000_put_txbuf.isra.33+0x91/0x130 [e1000e]
[<ffffffffa045546b>] e1000_clean_tx_irq+0xdb/0x320 [e1000e]
[<ffffffffa045dbe1>] e1000e_poll+0x61/0x320 [e1000e]
[<ffffffff815677aa>] net_rx_action+0x16a/0x370
[<ffffffff81054780>] __do_softirq+0xf0/0x410
[<ffffffff816b3b3c>] call_softirq+0x1c/0x30
<EOI> [<ffffffff8100480d>] do_softirq+0x8d/0xc0
[<ffffffff81102555>] ? rcu_cpu_kthread+0x135/0x5f0
[<ffffffff81054045>] local_bh_enable+0x105/0x110
[<ffffffff81102555>] rcu_cpu_kthread+0x135/0x5f0
[<ffffffff81084730>] smpboot_thread_fn+0x170/0x2e0
[<ffffffff810845c0>] ? __smpboot_create_thread.part.2+0xe0/0xe0
[<ffffffff8107a62d>] kthread+0xed/0x100
[<ffffffff816a7062>] ? wait_for_completion+0xe2/0x110
[<ffffffff8107a540>] ? kthread_create_on_node+0x160/0x160
[<ffffffff816b279c>] ret_from_fork+0x7c/0xb0
[<ffffffff8107a540>] ? kthread_create_on_node+0x160/0x160
---[ end trace 3d84e8d9b678cf33 ]---
Mapped at:
[<ffffffff8135d269>] debug_dma_map_page+0xa9/0x150
[<ffffffffa045791c>] e1000_xmit_frame+0x69c/0xf10 [e1000e]
[<ffffffff81568cf0>] dev_hard_start_xmit+0x260/0x700
[<ffffffff8158b90e>] sch_direct_xmit+0xfe/0x2a0
[<ffffffff815693d6>] dev_queue_xmit+0x246/0x970
^ permalink raw reply
* Re: [PATCH v2 1/1 net-next] fec: net: put tx to napi poll function to fix dead lock
From: Richard Zhao @ 2013-03-01 8:30 UTC (permalink / raw)
To: Frank Li
Cc: lznuaa, Shawn Guo, B38611, davem, linux-arm-kernel, netdev,
Sascha Hauer
In-Reply-To: <1362109034-25805-1-git-send-email-Frank.Li@freescale.com>
Is it better to change title prefix to net: fec: ..... ?
Thanks
Richard
^ permalink raw reply
* Re: [PATCH v2 1/1 net-next] fec: net: put tx to napi poll function to fix dead lock
From: David Miller @ 2013-03-01 8:37 UTC (permalink / raw)
To: linuxzsc
Cc: Frank.Li, lznuaa, shawn.guo, B38611, linux-arm-kernel, netdev,
s.hauer
In-Reply-To: <CANg6MZiQTPkWDBRiZB74nVrj-QY2=Nis36fvhv1Cj+p=jzOstA@mail.gmail.com>
From: Richard Zhao <linuxzsc@gmail.com>
Date: Fri, 1 Mar 2013 16:30:05 +0800
> Is it better to change title prefix to net: fec: ..... ?
I'm aiming to put it into 'net' regardless of what title prefix he
uses :-)
^ permalink raw reply
* Re: hv_netvsc: WARNING in softirq.c
From: Richard Genoud @ 2013-03-01 8:39 UTC (permalink / raw)
To: Haiyang Zhang
Cc: KY Srinivasan, devel@linuxdriverproject.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <78fd1c1df13b449887de6e0b3505a988@DFM-DB3MBX15-06.exchange.corp.microsoft.com>
2013/2/28 Haiyang Zhang <haiyangz@microsoft.com>:
> We will look into this. And further info around the time will also be helpful.
>
> Thanks,
> - Haiyang
The only thing the admin sys could think about is a rsync process
between the windows host and ANOTHER linux guest that ends at 22h30
more or less.
(the other linux guest is a debian 6, without any HV driver)
--
for me, ck means con kolivas and not calvin klein... does it mean I'm a geek ?
^ permalink raw reply
* Re: [PATCH] n_gsm: Add Mutex to avoid race when net destroy
From: channing @ 2013-03-01 8:51 UTC (permalink / raw)
To: Jiri Slaby; +Cc: Greg Kroah-Hartman, linux-kernel, ML netdev, vincentx.pillet
In-Reply-To: <512F28FD.9030502@suse.cz>
On Thu, 2013-02-28 at 10:53 +0100, Jiri Slaby wrote:
> On 02/28/2013 06:31 AM, channing wrote:
> >
> > when gsm Net is enabled, data on dlci is transferrd by
> > gsm_mux_net_start_xmit(), while userspace may trigger
> > ioctrl to call gsm_destroy_network() during data was
> > transferring, because there is no mutex protection between
> > the two functions, following scenario may happen:
> >
> > 1) gsm_mux_net_start_xmit() calls muxnet_get(mux_net);
> > 2) gsm_destroy_network() is called from ioctrl, and it
> > will not call net_free() to release net device because
> > net device is still referred in step 1)
> > 3) continue execute step 1), gsm_mux_net_start_xmit()
> > calls muxnet_put(mux_net), and then calls net_free() to
> > release net device.
> > 4) if userspace triggers gsm_create_network() at same time
> > with net_free() in step 3). it will hit race on dlci->net.
> >
> > This patch is to add a mutex in tx function to avoid race
> > between it and destroy function.
> >
> > Signed-off-by: Chao Bi <chao.bi@intel.com>
> > Signed-off-by: Pillet Vincent <vincentx.pillet@intel.com>
> > ---
> > drivers/tty/n_gsm.c | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
> > index 4a43ef5..0ca810a 100644
> > --- a/drivers/tty/n_gsm.c
> > +++ b/drivers/tty/n_gsm.c
> > @@ -2660,6 +2660,7 @@ static int gsm_mux_net_start_xmit(struct sk_buff *skb,
> > {
> > struct gsm_mux_net *mux_net = (struct gsm_mux_net *)netdev_priv(net);
> > struct gsm_dlci *dlci = mux_net->dlci;
> > + mutex_lock(&dlci->mutex);
>
> Nack, start_xmit may be called in an atomic context -- you cannot call
> mutex.
>
> > muxnet_get(mux_net);
> >
> > skb_queue_head(&dlci->skb_list, skb);
> > @@ -2669,6 +2670,7 @@ static int gsm_mux_net_start_xmit(struct sk_buff *skb,
> > /* And tell the kernel when the last transmit started. */
> > net->trans_start = jiffies;
> > muxnet_put(mux_net);
>
> Instead the concept is broken. If this was the last reference (as
> described in your steps above), it would blow up for the same reason I
> refer to above, i.e. net_free here would call unregister_netdev which is
> not atomic. Plus it will definitely deadlock because unregister_netdev
> waits for start_xmit to finish.
>
> It should stop the queue and schedule a workqueue to lock the mutex,
> unregister the hetdev and reset dlci->net. (Or maybe just call
> muxnet_put with the lock held.)
Thanks, Jiri, you're right, I didn't notice that in validation because
DEBUG_ATOMIC_SLEEP is not enabled in my platform :( Now I'm trying to
work out the workqueue solution, when it finished I'll re-submit for
review. What do you mean by "call muxnet_put with lock held"? do you
mean to use spin lock instead of mutex?
>
> That will fix 4), but there is still a bug: what protects
> gsm_create_network to be called twice or more in a sequence thus
> re-setting dlci->net to a new and new pointer?
Yes, that's a problem, Vincent has already noticed that and has a check
in gsmtty_ioctl to avoid call net creation multi time, I thought it
might be patch for other issue so didn't put them together.
>
> > + mutex_unlock(&dlci->mutex);
> > return NETDEV_TX_OK;
> > }
>
> thanks,
^ permalink raw reply
* Re: [PATCH] n_gsm: Add Mutex to avoid race when net destroy
From: Jiri Slaby @ 2013-03-01 9:10 UTC (permalink / raw)
To: channing; +Cc: Greg Kroah-Hartman, linux-kernel, ML netdev, vincentx.pillet
In-Reply-To: <1362127915.31563.18.camel@bichao>
On 03/01/2013 09:51 AM, channing wrote:
>> It should stop the queue and schedule a workqueue to lock the mutex,
>> unregister the hetdev and reset dlci->net. (Or maybe just call
>> muxnet_put with the lock held.)
>
> Thanks, Jiri, you're right, I didn't notice that in validation because
> DEBUG_ATOMIC_SLEEP is not enabled in my platform :( Now I'm trying to
> work out the workqueue solution, when it finished I'll re-submit for
> review. What do you mean by "call muxnet_put with lock held"? do you
> mean to use spin lock instead of mutex?
No, I mean, in the newly added scheduled work, to lock the mutex and
simply call muxnet_put. That should fix it, right?
--
js
suse labs
^ permalink raw reply
* [patch net-next 0/2] team: introduce random mode
From: Jiri Pirko @ 2013-03-01 10:26 UTC (permalink / raw)
To: netdev; +Cc: davem, edumazet, fbl
Jiri Pirko (2):
team: introduce two default team_modeop functions and use them in
modes
team: introduce random mode
drivers/net/team/Kconfig | 12 ++++++
drivers/net/team/Makefile | 1 +
drivers/net/team/team.c | 19 +++++++--
drivers/net/team/team_mode_broadcast.c | 14 +------
drivers/net/team/team_mode_random.c | 71 +++++++++++++++++++++++++++++++++
drivers/net/team/team_mode_roundrobin.c | 36 ++---------------
include/linux/if_team.h | 25 +++++++++++-
7 files changed, 129 insertions(+), 49 deletions(-)
create mode 100644 drivers/net/team/team_mode_random.c
--
1.8.1.2
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox