* [RFC][PATCH] iproute: Faster ip link add, set and delete
From: Eric W. Biederman @ 2013-03-22 22:23 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, Serge Hallyn, Benoit Lourdelet
Because ip link add, set, and delete map the interface name to the
interface index by dumping all of the interfaces before performing
their respective commands. Operations that should be constant time
slow down when lots of network interfaces are in use. Resulting
in O(N^2) time to work with O(N) devices.
Make the work that iproute does constant time by passing the interface
name to the kernel instead.
In small scale testing on my system this shows dramatic performance
increases of ip link add from 120s to just 11s to add 5000 network
devices. And from longer than I cared to wait to just 58s to delete
all of those interfaces again.
Cc: Serge Hallyn <serge.hallyn@ubuntu.com>
Reported-by: Benoit Lourdelet <blourdel@juniper.net>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
I think I am bungling the case where people specify an ifindex as ifNNNN
but does anyone care?
ip/iplink.c | 19 +------------------
1 files changed, 1 insertions(+), 18 deletions(-)
diff --git a/ip/iplink.c b/ip/iplink.c
index ad33611..6dffbf0 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -533,8 +533,6 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
}
}
- ll_init_map(&rth);
-
if (!(flags & NLM_F_CREATE)) {
if (!dev) {
fprintf(stderr, "Not enough information: \"dev\" "
@@ -542,27 +540,12 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
exit(-1);
}
- req.i.ifi_index = ll_name_to_index(dev);
- if (req.i.ifi_index == 0) {
- fprintf(stderr, "Cannot find device \"%s\"\n", dev);
- return -1;
- }
+ name = dev;
} else {
/* Allow "ip link add dev" and "ip link add name" */
if (!name)
name = dev;
- if (link) {
- int ifindex;
-
- ifindex = ll_name_to_index(link);
- if (ifindex == 0) {
- fprintf(stderr, "Cannot find device \"%s\"\n",
- link);
- return -1;
- }
- addattr_l(&req.n, sizeof(req), IFLA_LINK, &ifindex, 4);
- }
}
if (name) {
--
1.7.5.4
^ permalink raw reply related
* Re: [PATCH] net: Add support for handling queueing in hardware
From: Theodore Ts'o @ 2013-03-22 22:08 UTC (permalink / raw)
To: Ben Collins; +Cc: David Miller, afleming, linux-kernel, netdev
In-Reply-To: <9AEAD974-4549-475A-AE15-C92523CD2466@gmail.com>
On Fri, Mar 22, 2013 at 11:39:20AM -0400, Ben Collins wrote:
>
> If your company had hardware going to production, you'd want it supported in mainline too, I suspect.
And if companies told their hardware partners that they will drop use
of their hardware in future products unless they get their !@#@S
drivers upstream, I'd bet they'd change their engineering priorities
so they would work on it, instead of foisting this work on their
customers.
I've seen this work in enterprise computing, where the RFP had
requirements for upstream drivers (i.e., if you want your 10gig
ethernet NIC to be used in HP or IBM's servers, get the darned thing
upstream!). The trick is making it clear that selection of components
depends not just on an OSS driver, but an OSS driver which has been
accepted upstream (which also helps from a quality-of-code
requirement).
I've been waiting for this to start happening in the consumer
electronics/embedded world, but it's been slow coming,
unfortunately....
- Ted
^ permalink raw reply
* Re: [git pull] firewire net: resource management improvements
From: Stefan Richter @ 2013-03-22 21:21 UTC (permalink / raw)
To: David Miller; +Cc: yoshfuji, linux1394-devel, netdev
In-Reply-To: <20130322.103501.1681106916245750016.davem@davemloft.net>
On Mar 22 David Miller wrote:
> From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
> Date: Fri, 22 Mar 2013 12:34:23 +0900
>
> > would you consider pulling this one to net-next, please?
> > I can prepare rebased tree, if you want.
>
> So the firewire maintainers are OK with these changes?
The firewire maintainers (that is me, myself, and I) have reviewed these
changes, signed off on them, committed them to linux1394.git at
kernel.org, and on top of that are OK with them and with their being
routed through net-next, indeed. :-)
--
Stefan Richter
-=====-===-= --== =-==-
http://arcgraph.de/sr/
^ permalink raw reply
* [PATCH net-next] dsa: add device tree bindings to register DSA switches
From: Florian Fainelli @ 2013-03-22 20:50 UTC (permalink / raw)
To: davem, devicetree-discuss, rob.herring, grant.likely,
thomas.petazzoni, gregory.clement, jason, Lennert Buytenhek,
netdev, Andrew Lunn, linux-arm-kernel
This patch adds support for registering DSA switches using Device Tree
bindings. Note that we support programming the switch routing table even
though no in-tree user seems to require it. I tested this on Armada 370
with a Marvell 88E6172 (not supported by mainline yet).
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
Documentation/devicetree/bindings/net/dsa/dsa.txt | 91 ++++++++
net/dsa/dsa.c | 233 ++++++++++++++++++++-
2 files changed, 319 insertions(+), 5 deletions(-)
create mode 100644 Documentation/devicetree/bindings/net/dsa/dsa.txt
diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.txt b/Documentation/devicetree/bindings/net/dsa/dsa.txt
new file mode 100644
index 0000000..db92f55
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/dsa/dsa.txt
@@ -0,0 +1,91 @@
+Marvell Distributed Switch Architecture Device Tree Bindings
+------------------------------------------------------------
+
+Required properties:
+- compatible : Should be "marvell,dsa"
+- #address-cells : Must be 2, first cell is the address on the MDIO bus
+ and second cell is the address in the switch tree.
+ Second cell is used only when cascading/chaining.
+- #size-cells : Must be 0
+- dsa,ethernet : Should be a phandle to a valid Ethernet device node
+- dsa,mii-bus : Should be a phandle to a valid MDIO bus device node
+
+Optionnal properties:
+- interrupts : property with a value describing the switch
+ interrupt number (not supported by the driver)
+
+A DSA node can contain multiple switch chips which are therefore child nodes of
+the parent DSA node. The maximum number of allowed child nodes is 4
+(DSA_MAX_SWITCHES).
+Each of these switch child nodes should have the following required properties:
+
+- reg : Describes the switch address on the MII bus
+- #address-cells : Must be 1
+- #size-cells : Must be 0
+
+A switch may have multiple "port" children nodes
+
+Each port children node must have the following mandatory properties:
+- reg : Describes the port address in the switch
+- label : Describes the label associated with this port, special
+ labels are "cpu" to indicate a CPU port and "dsa" to
+ indicate an uplink/downlink port.
+
+Note that a port labelled "dsa" will imply checking for the uplink phandle
+described below.
+
+Optionnal property:
+- link : Should be a phandle to another switch's DSA port.
+ This property is only used when switches are being
+ chained/cascaded together.
+
+Example:
+
+ dsa@0 {
+ compatible = "marvell,dsa";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ interrupts = <10>;
+ dsa,ethernet = <ðernet0>;
+ dsa,mii-bus = <&mii_bus0>;
+
+ switch@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <16 0>; /* MDIO address 16, switch 0 in tree */
+
+ port@0 {
+ reg = <0>;
+ label = "lan1";
+ };
+
+ port@1 {
+ reg = <1>;
+ label = "lan2";
+ };
+
+ port@5 {
+ reg = <5>;
+ label = "cpu";
+ };
+
+ switch0uplink: port@6 {
+ reg = <6>;
+ label = "dsa";
+ link = <&switch1uplink>;
+ };
+ };
+
+ switch@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <17 1>; /* MDIO address 17, switch 1 in tree */
+
+ switch1uplink: port@0 {
+ reg = <0>;
+ label = "dsa";
+ link = <&switch0uplink>;
+ };
+ };
+ };
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 2bc62ea..908bc11 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -1,6 +1,7 @@
/*
* net/dsa/dsa.c - Hardware switch handling
* Copyright (c) 2008-2009 Marvell Semiconductor
+ * Copyright (c) 2013 Florian Fainelli <florian@openwrt.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,6 +15,9 @@
#include <linux/slab.h>
#include <linux/module.h>
#include <net/dsa.h>
+#include <linux/of.h>
+#include <linux/of_mdio.h>
+#include <linux/of_platform.h>
#include "dsa_priv.h"
char dsa_driver_version[] = "0.1";
@@ -287,34 +291,239 @@ static struct net_device *dev_to_net_device(struct device *dev)
return NULL;
}
+#ifdef CONFIG_OF
+static int dsa_of_setup_routing_table(struct dsa_platform_data *pd,
+ struct dsa_chip_data *cd,
+ int chip_index,
+ struct device_node *link)
+{
+ int ret;
+ const __be32 *reg;
+ int link_port_addr;
+ int link_sw_addr;
+ struct device_node *parent_sw;
+ int len;
+
+ parent_sw = of_get_parent(link);
+ if (!parent_sw)
+ return -EINVAL;
+
+ reg = of_get_property(parent_sw, "reg", &len);
+ if (!reg || (len != sizeof(*reg) * 2))
+ return -EINVAL;
+
+ link_sw_addr = be32_to_cpup(reg + 1);
+
+ if (link_sw_addr >= pd->nr_chips)
+ return -EINVAL;
+
+ /* First time routing table allocation */
+ if (!cd->rtable) {
+ cd->rtable = kmalloc(pd->nr_chips * sizeof(s8), GFP_KERNEL);
+ if (!cd->rtable)
+ return -ENOMEM;
+
+ /* default to no valid uplink/downlink */
+ memset(cd->rtable, -1, pd->nr_chips * sizeof(s8));
+ }
+
+ reg = of_get_property(link, "reg", NULL);
+ if (!reg) {
+ ret = -EINVAL;
+ goto out;
+ }
+
+ link_port_addr = be32_to_cpup(reg);
+
+ cd->rtable[link_sw_addr] = link_port_addr;
+
+ return 0;
+out:
+ kfree(cd->rtable);
+ return ret;
+}
+
+static int dsa_of_probe(struct platform_device *pdev)
+{
+ struct device_node *np = pdev->dev.of_node;
+ struct device_node *child, *mdio, *ethernet, *port, *link;
+ struct mii_bus *mdio_bus;
+ struct platform_device *ethernet_dev;
+ struct dsa_platform_data *pd;
+ struct dsa_chip_data *cd;
+ const char *port_name;
+ int chip_index, port_index;
+ const unsigned int *sw_addr, *port_reg;
+ int ret, i;
+
+ mdio = of_parse_phandle(np, "dsa,mii-bus", 0);
+ if (!mdio)
+ return -EINVAL;
+
+ mdio_bus = of_mdio_find_bus(mdio);
+ if (!mdio_bus)
+ return -EINVAL;
+
+ ethernet = of_parse_phandle(np, "dsa,ethernet", 0);
+ if (!ethernet)
+ return -EINVAL;
+
+ ethernet_dev = of_find_device_by_node(ethernet);
+ if (!ethernet_dev)
+ return -ENODEV;
+
+ pd = kzalloc(sizeof(*pd), GFP_KERNEL);
+ if (!pd)
+ return -ENOMEM;
+
+ pdev->dev.platform_data = pd;
+ pd->netdev = ðernet_dev->dev;
+ pd->nr_chips = of_get_child_count(np);
+ if (pd->nr_chips > DSA_MAX_SWITCHES)
+ pd->nr_chips = DSA_MAX_SWITCHES;
+
+ pd->chip = kzalloc(pd->nr_chips * sizeof(struct dsa_chip_data),
+ GFP_KERNEL);
+ if (!pd->chip) {
+ ret = -ENOMEM;
+ goto out_free;
+ }
+
+ chip_index = 0;
+ for_each_available_child_of_node(np, child) {
+ cd = &pd->chip[chip_index];
+
+ cd->mii_bus = &mdio_bus->dev;
+
+ sw_addr = of_get_property(child, "reg", NULL);
+ if (!sw_addr)
+ continue;
+
+ cd->sw_addr = be32_to_cpup(sw_addr);
+ if (cd->sw_addr > PHY_MAX_ADDR)
+ continue;
+
+ for_each_available_child_of_node(child, port) {
+ port_reg = of_get_property(port, "reg", NULL);
+ if (!port_reg)
+ continue;
+
+ port_index = be32_to_cpup(port_reg);
+
+ port_name = of_get_property(port, "label", NULL);
+ if (!port_name)
+ continue;
+
+ cd->port_names[port_index] = kstrdup(port_name,
+ GFP_KERNEL);
+ if (!cd->port_names[port_index]) {
+ ret = -ENOMEM;
+ goto out_free_chip;
+ }
+
+ link = of_parse_phandle(port, "link", 0);
+
+ if (!strcmp(port_name, "dsa") && link &&
+ pd->nr_chips > 1) {
+ ret = dsa_of_setup_routing_table(pd, cd,
+ chip_index, link);
+ if (ret)
+ goto out_free_chip;
+ }
+
+ if (port_index == DSA_MAX_PORTS)
+ break;
+ }
+ }
+
+ return 0;
+
+out_free_chip:
+ for (i = 0; i < pd->nr_chips; i++) {
+ port_index = 0;
+ while (pd->chip[i].port_names &&
+ pd->chip[i].port_names[++port_index])
+ kfree(pd->chip[i].port_names[port_index]);
+ kfree(pd->chip[i].rtable);
+ }
+ kfree(pd->chip);
+out_free:
+ kfree(pd);
+ pdev->dev.platform_data = NULL;
+ return ret;
+}
+
+static void dsa_of_remove(struct platform_device *pdev)
+{
+ struct dsa_platform_data *pd = pdev->dev.platform_data;
+ int i;
+ int port_index;
+
+ if (!pdev->dev.of_node)
+ return;
+
+ for (i = 0; i < pd->nr_chips; i++) {
+ port_index = 0;
+ while (pd->chip[i].port_names &&
+ pd->chip[i].port_names[++port_index])
+ kfree(pd->chip[i].port_names[port_index]);
+ kfree(pd->chip[i].rtable);
+ }
+
+ kfree(pd->chip);
+ kfree(pd);
+}
+#else
+static inline int dsa_of_probe(struct platform_device *pdev)
+{
+ return 0;
+}
+
+static inline void dsa_of_remove(struct platform_device *pdev)
+{
+}
+#endif
+
static int dsa_probe(struct platform_device *pdev)
{
static int dsa_version_printed;
struct dsa_platform_data *pd = pdev->dev.platform_data;
struct net_device *dev;
struct dsa_switch_tree *dst;
- int i;
+ int i, ret;
if (!dsa_version_printed++)
printk(KERN_NOTICE "Distributed Switch Architecture "
"driver version %s\n", dsa_driver_version);
+ if (pdev->dev.of_node) {
+ ret = dsa_of_probe(pdev);
+ if (ret)
+ return ret;
+
+ pd = pdev->dev.platform_data;
+ }
+
if (pd == NULL || pd->netdev == NULL)
return -EINVAL;
dev = dev_to_net_device(pd->netdev);
- if (dev == NULL)
- return -EINVAL;
+ if (dev == NULL) {
+ ret = -EINVAL;
+ goto out;
+ }
if (dev->dsa_ptr != NULL) {
dev_put(dev);
- return -EEXIST;
+ ret = -EEXIST;
+ goto out;
}
dst = kzalloc(sizeof(*dst), GFP_KERNEL);
if (dst == NULL) {
dev_put(dev);
- return -ENOMEM;
+ ret = -ENOMEM;
+ goto out;
}
platform_set_drvdata(pdev, dst);
@@ -366,6 +575,11 @@ static int dsa_probe(struct platform_device *pdev)
}
return 0;
+
+out:
+ dsa_of_remove(pdev);
+
+ return ret;
}
static int dsa_remove(struct platform_device *pdev)
@@ -385,6 +599,8 @@ static int dsa_remove(struct platform_device *pdev)
dsa_switch_destroy(ds);
}
+ dsa_of_remove(pdev);
+
return 0;
}
@@ -392,6 +608,12 @@ static void dsa_shutdown(struct platform_device *pdev)
{
}
+static const struct of_device_id dsa_of_match_table[] = {
+ { .compatible = "marvell,dsa", },
+ {}
+};
+MODULE_DEVICE_TABLE(of, dsa_of_match_table);
+
static struct platform_driver dsa_driver = {
.probe = dsa_probe,
.remove = dsa_remove,
@@ -399,6 +621,7 @@ static struct platform_driver dsa_driver = {
.driver = {
.name = "dsa",
.owner = THIS_MODULE,
+ .of_match_table = dsa_of_match_table,
},
};
--
1.7.10.4
^ permalink raw reply related
* [PATCH] SUNRPC/cache: add module_put() on error path in cache_open()
From: Alexey Khoroshilov @ 2013-03-22 20:36 UTC (permalink / raw)
To: J. Bruce Fields, Trond Myklebust
Cc: Alexey Khoroshilov, linux-nfs, netdev, linux-kernel, ldv-project
If kmalloc() fails in cache_open(), module cd->owner left locked.
The patch adds module_put(cd->owner) on this path.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
net/sunrpc/cache.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 25d58e76..1d3c514 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -986,8 +986,10 @@ static int cache_open(struct inode *inode, struct file *filp,
nonseekable_open(inode, filp);
if (filp->f_mode & FMODE_READ) {
rp = kmalloc(sizeof(*rp), GFP_KERNEL);
- if (!rp)
+ if (!rp) {
+ module_put(cd->owner);
return -ENOMEM;
+ }
rp->offset = 0;
rp->q.reader = 1;
atomic_inc(&cd->readers);
--
1.7.9.5
^ permalink raw reply related
* [PATCH] brcmsmac: Remove unused macro SI_MSG
From: Joe Perches @ 2013-03-22 20:00 UTC (permalink / raw)
To: Arend van Spriel
Cc: Brett Rudley, Arend van Spriel, Franky (Zhenhui) Lin,
Hante Meuleman, John W. Linville, linux-wireless,
brcm80211-dev-list, netdev, linux-kernel
commit 6236dc2e2 ("brcmsmac: remove some redundant chip common workarounds")
removed the last uses.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/wireless/brcm80211/brcmsmac/aiutils.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
index f0888a9..e4fd1ee 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
@@ -318,12 +318,6 @@
#define IS_SIM(chippkg) \
((chippkg == HDLSIM_PKG_ID) || (chippkg == HWSIM_PKG_ID))
-#ifdef DEBUG
-#define SI_MSG(fmt, ...) pr_debug(fmt, ##__VA_ARGS__)
-#else
-#define SI_MSG(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
-#endif /* DEBUG */
-
#define GOODCOREADDR(x, b) \
(((x) >= (b)) && ((x) < ((b) + SI_MAXCORES * SI_CORE_SIZE)) && \
IS_ALIGNED((x), SI_CORE_SIZE))
--
1.8.1.2.459.gbcd45b4.dirty
^ permalink raw reply related
* Re: [PATCH v3 1/1 net-next] net: fec: put tx to napi poll function to fix dead lock
From: Fabio Estevam @ 2013-03-22 19:00 UTC (permalink / raw)
To: Shawn Guo
Cc: Frank Li, B38611, netdev, s.hauer, lznuaa, davem,
linux-arm-kernel
In-Reply-To: <20130320114824.GA6088@S2101-09.ap.freescale.net>
On Wed, Mar 20, 2013 at 8:48 AM, Shawn Guo <shawn.guo@linaro.org> wrote:
> Frank,
>
> I'm running v3.9-rc3 image with NFS on imx6q, and seeing system fail
> to resume back. The resume seems being stopped by fec driver. If you
> wait long enough, you might see the repeated "eth0: tx queue full!."
> error message.
On mx28, only reverting this patch does not solve the suspend/resume issue.
^ permalink raw reply
* Re: [patch -next] l2tp: calling the ref() instead of deref()
From: David Miller @ 2013-03-22 18:39 UTC (permalink / raw)
To: dan.carpenter
Cc: jchapman, tparkin, edumazet, netdev, kernel-janitors, kbuild
In-Reply-To: <20130322183314.GA23163@longonot.mountain>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Fri, 22 Mar 2013 21:33:15 +0300
> This is a cut and paste typo. We call ->ref() a second time instead
> of ->deref().
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied, thanks Dan.
^ permalink raw reply
* [patch -next] l2tp: calling the ref() instead of deref()
From: Dan Carpenter @ 2013-03-22 18:33 UTC (permalink / raw)
To: David S. Miller
Cc: James Chapman, Tom Parkin, Eric Dumazet, netdev, kernel-janitors,
kbuild
This is a cut and paste typo. We call ->ref() a second time instead
of ->deref().
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Only needed in linux-next.
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 8aecf5d..6984c3a 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1777,7 +1777,7 @@ int l2tp_session_delete(struct l2tp_session *session)
if (session->session_close != NULL)
(*session->session_close)(session);
if (session->deref)
- (*session->ref)(session);
+ (*session->deref)(session);
l2tp_session_dec_refcount(session);
return 0;
}
^ permalink raw reply related
* Re: NULL pointer deref, selinux_socket_unix_may_send+0x34/0x90
From: Paul Moore @ 2013-03-22 18:24 UTC (permalink / raw)
To: Ján Stanček; +Cc: netdev, eparis, sds
In-Reply-To: <CAMpz-8aJyEgesAYLgB3EPSCevDG5KcH+9S-sJUfBOnA0m_Ky1g@mail.gmail.com>
On Friday, March 22, 2013 05:52:37 PM Ján Stanček wrote:
> Paul,
>
> I applied your patch on top of 3.9-rc3 and ran v2 of reproducer. It
> hit the issue almost instantly:
Okay, thanks for trying it ... let me see what I can do.
--
paul moore
www.paul-moore.com
^ permalink raw reply
* [PATCH net-next 2/2] ipv6: implement RFC3168 5.3 (ecn protection) for ipv6 fragmentation handling
From: Hannes Frederic Sowa @ 2013-03-22 18:24 UTC (permalink / raw)
To: netdev; +Cc: eric.dumazet, jbrouer, yoshfuji
Hello!
After patch 1 got accepted to net-next I will also send a patch to
netfilter-devel to make the corresponding changes to the netfilter
reassembly logic.
Thanks,
Hannes
-- >8 --
[PATCH 2/2] ipv6: implement RFC3168 5.3 (ecn protection) for ipv6 fragmentation handling
This patch also ensures that INET_ECN_CE is propagated if one fragment
had the codepoint set.
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jesper Dangaard Brouer <jbrouer@redhat.com>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
include/net/ipv6.h | 2 ++
net/ipv6/reassembly.c | 23 +++++++++++++++++++++--
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 42ef6ab..0810aa5 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -478,6 +478,7 @@ struct ip6_create_arg {
u32 user;
const struct in6_addr *src;
const struct in6_addr *dst;
+ u8 ecn;
};
void ip6_frag_init(struct inet_frag_queue *q, void *a);
@@ -497,6 +498,7 @@ struct frag_queue {
int iif;
unsigned int csum;
__u16 nhoffset;
+ u8 ecn;
};
void ip6_expire_frag_queue(struct net *net, struct frag_queue *fq,
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 196ab93..e6e44ce 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -58,6 +58,7 @@
#include <net/ndisc.h>
#include <net/addrconf.h>
#include <net/inet_frag.h>
+#include <net/inet_ecn.h>
struct ip6frag_skb_cb
{
@@ -67,6 +68,10 @@ struct ip6frag_skb_cb
#define FRAG6_CB(skb) ((struct ip6frag_skb_cb*)((skb)->cb))
+static inline u8 ip6_frag_ecn(const struct ipv6hdr *ipv6h)
+{
+ return 1 << (ipv6_get_dsfield(ipv6h) & INET_ECN_MASK);
+}
static struct inet_frags ip6_frags;
@@ -119,6 +124,7 @@ void ip6_frag_init(struct inet_frag_queue *q, void *a)
fq->user = arg->user;
fq->saddr = *arg->src;
fq->daddr = *arg->dst;
+ fq->ecn = arg->ecn;
}
EXPORT_SYMBOL(ip6_frag_init);
@@ -173,7 +179,8 @@ static void ip6_frag_expire(unsigned long data)
}
static __inline__ struct frag_queue *
-fq_find(struct net *net, __be32 id, const struct in6_addr *src, const struct in6_addr *dst)
+fq_find(struct net *net, __be32 id, const struct in6_addr *src,
+ const struct in6_addr *dst, u8 ecn)
{
struct inet_frag_queue *q;
struct ip6_create_arg arg;
@@ -183,6 +190,7 @@ fq_find(struct net *net, __be32 id, const struct in6_addr *src, const struct in6
arg.user = IP6_DEFRAG_LOCAL_DELIVER;
arg.src = src;
arg.dst = dst;
+ arg.ecn = ecn;
read_lock(&ip6_frags.lock);
hash = inet6_hash_frag(id, src, dst, ip6_frags.rnd);
@@ -202,6 +210,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
struct net_device *dev;
int offset, end;
struct net *net = dev_net(skb_dst(skb)->dev);
+ u8 ecn;
if (fq->q.last_in & INET_FRAG_COMPLETE)
goto err;
@@ -219,6 +228,8 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
return -1;
}
+ ecn = ip6_frag_ecn(ipv6_hdr(skb));
+
if (skb->ip_summed == CHECKSUM_COMPLETE) {
const unsigned char *nh = skb_network_header(skb);
skb->csum = csum_sub(skb->csum,
@@ -319,6 +330,7 @@ found:
}
fq->q.stamp = skb->tstamp;
fq->q.meat += skb->len;
+ fq->ecn |= ecn;
add_frag_mem_limit(&fq->q, skb->truesize);
/* The first fragment.
@@ -362,9 +374,14 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
int payload_len;
unsigned int nhoff;
int sum_truesize;
+ u8 ecn;
inet_frag_kill(&fq->q, &ip6_frags);
+ ecn = ip_frag_ecn_table[fq->ecn];
+ if (unlikely(ecn == 0xff))
+ goto out_fail;
+
/* Make the one we just received the head. */
if (prev) {
head = prev->next;
@@ -463,6 +480,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
head->dev = dev;
head->tstamp = fq->q.stamp;
ipv6_hdr(head)->payload_len = htons(payload_len);
+ ipv6_change_dsfield(ipv6_hdr(head), 0xff, ecn);
IP6CB(head)->nhoff = nhoff;
/* Yes, and fold redundant checksum back. 8) */
@@ -526,7 +544,8 @@ static int ipv6_frag_rcv(struct sk_buff *skb)
IP6_ADD_STATS_BH(net, ip6_dst_idev(skb_dst(skb)),
IPSTATS_MIB_REASMFAILS, evicted);
- fq = fq_find(net, fhdr->identification, &hdr->saddr, &hdr->daddr);
+ fq = fq_find(net, fhdr->identification, &hdr->saddr, &hdr->daddr,
+ ip6_frag_ecn(hdr));
if (fq != NULL) {
int ret;
--
1.8.1.4
^ permalink raw reply related
* [PATCH net-next 1/2] inet: generalize ipv4-only RFC3168 5.3 ecn fragmentation handling for future use by ipv6
From: Hannes Frederic Sowa @ 2013-03-22 18:24 UTC (permalink / raw)
To: netdev; +Cc: eric.dumazet, jbrouer, yoshfuji
This patch just moves some code arround to make the ip4_frag_ecn_table
and IPFRAG_ECN_* constants accessible from the other reassembly engines. I
also renamed ip4_frag_ecn_table to ip_frag_ecn_table.
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jesper Dangaard Brouer <jbrouer@redhat.com>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
include/net/inet_frag.h | 12 ++++++++++++
net/ipv4/inet_fragment.c | 22 ++++++++++++++++++++++
net/ipv4/ip_fragment.c | 31 +------------------------------
3 files changed, 35 insertions(+), 30 deletions(-)
diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h
index 0a1dcc2..64b4e7d 100644
--- a/include/net/inet_frag.h
+++ b/include/net/inet_frag.h
@@ -153,4 +153,16 @@ static inline void inet_frag_lru_add(struct netns_frags *nf,
list_add_tail(&q->lru_list, &nf->lru_list);
spin_unlock(&nf->lru_lock);
}
+
+/* RFC 3168 support :
+ * We want to check ECN values of all fragments, do detect invalid combinations.
+ * In ipq->ecn, we store the OR value of each ip4_frag_ecn() fragment value.
+ */
+#define IPFRAG_ECN_NOT_ECT 0x01 /* one frag had ECN_NOT_ECT */
+#define IPFRAG_ECN_ECT_1 0x02 /* one frag had ECN_ECT_1 */
+#define IPFRAG_ECN_ECT_0 0x04 /* one frag had ECN_ECT_0 */
+#define IPFRAG_ECN_CE 0x08 /* one frag had ECN_CE */
+
+extern const u8 ip_frag_ecn_table[16];
+
#endif
diff --git a/net/ipv4/inet_fragment.c b/net/ipv4/inet_fragment.c
index f4fd23d..2bff045 100644
--- a/net/ipv4/inet_fragment.c
+++ b/net/ipv4/inet_fragment.c
@@ -23,6 +23,28 @@
#include <net/sock.h>
#include <net/inet_frag.h>
+#include <net/inet_ecn.h>
+
+/* Given the OR values of all fragments, apply RFC 3168 5.3 requirements
+ * Value : 0xff if frame should be dropped.
+ * 0 or INET_ECN_CE value, to be ORed in to final iph->tos field
+ */
+const u8 ip_frag_ecn_table[16] = {
+ /* at least one fragment had CE, and others ECT_0 or ECT_1 */
+ [IPFRAG_ECN_CE | IPFRAG_ECN_ECT_0] = INET_ECN_CE,
+ [IPFRAG_ECN_CE | IPFRAG_ECN_ECT_1] = INET_ECN_CE,
+ [IPFRAG_ECN_CE | IPFRAG_ECN_ECT_0 | IPFRAG_ECN_ECT_1] = INET_ECN_CE,
+
+ /* invalid combinations : drop frame */
+ [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_CE] = 0xff,
+ [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_ECT_0] = 0xff,
+ [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_ECT_1] = 0xff,
+ [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_ECT_0 | IPFRAG_ECN_ECT_1] = 0xff,
+ [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_CE | IPFRAG_ECN_ECT_0] = 0xff,
+ [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_CE | IPFRAG_ECN_ECT_1] = 0xff,
+ [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_CE | IPFRAG_ECN_ECT_0 | IPFRAG_ECN_ECT_1] = 0xff,
+};
+EXPORT_SYMBOL(ip_frag_ecn_table);
static void inet_frag_secret_rebuild(unsigned long dummy)
{
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index a6445b8..9385206 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -79,40 +79,11 @@ struct ipq {
struct inet_peer *peer;
};
-/* RFC 3168 support :
- * We want to check ECN values of all fragments, do detect invalid combinations.
- * In ipq->ecn, we store the OR value of each ip4_frag_ecn() fragment value.
- */
-#define IPFRAG_ECN_NOT_ECT 0x01 /* one frag had ECN_NOT_ECT */
-#define IPFRAG_ECN_ECT_1 0x02 /* one frag had ECN_ECT_1 */
-#define IPFRAG_ECN_ECT_0 0x04 /* one frag had ECN_ECT_0 */
-#define IPFRAG_ECN_CE 0x08 /* one frag had ECN_CE */
-
static inline u8 ip4_frag_ecn(u8 tos)
{
return 1 << (tos & INET_ECN_MASK);
}
-/* Given the OR values of all fragments, apply RFC 3168 5.3 requirements
- * Value : 0xff if frame should be dropped.
- * 0 or INET_ECN_CE value, to be ORed in to final iph->tos field
- */
-static const u8 ip4_frag_ecn_table[16] = {
- /* at least one fragment had CE, and others ECT_0 or ECT_1 */
- [IPFRAG_ECN_CE | IPFRAG_ECN_ECT_0] = INET_ECN_CE,
- [IPFRAG_ECN_CE | IPFRAG_ECN_ECT_1] = INET_ECN_CE,
- [IPFRAG_ECN_CE | IPFRAG_ECN_ECT_0 | IPFRAG_ECN_ECT_1] = INET_ECN_CE,
-
- /* invalid combinations : drop frame */
- [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_CE] = 0xff,
- [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_ECT_0] = 0xff,
- [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_ECT_1] = 0xff,
- [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_ECT_0 | IPFRAG_ECN_ECT_1] = 0xff,
- [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_CE | IPFRAG_ECN_ECT_0] = 0xff,
- [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_CE | IPFRAG_ECN_ECT_1] = 0xff,
- [IPFRAG_ECN_NOT_ECT | IPFRAG_ECN_CE | IPFRAG_ECN_ECT_0 | IPFRAG_ECN_ECT_1] = 0xff,
-};
-
static struct inet_frags ip4_frags;
int ip_frag_nqueues(struct net *net)
@@ -551,7 +522,7 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
ipq_kill(qp);
- ecn = ip4_frag_ecn_table[qp->ecn];
+ ecn = ip_frag_ecn_table[qp->ecn];
if (unlikely(ecn == 0xff)) {
err = -EINVAL;
goto out_fail;
--
1.8.1.4
^ permalink raw reply related
* Re: [BUG] bisected: PandaBoard smsc95xx ethernet driver error from USB timeout
From: Frank Rowand @ 2013-03-22 18:23 UTC (permalink / raw)
To: Mats Liljegren
Cc: Alan Stern, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
balbi@ti.com, netdev@vger.kernel.org
In-Reply-To: <20130322100329.GH29378@enea.se>
On 03/22/13 03:03, Mats Liljegren wrote:
> Frank Rowand wrote:
>> On 03/21/13 07:41, Alan Stern wrote:
>>> On Wed, 20 Mar 2013, Frank Rowand wrote:
>>>
>>>> Hi All,
>>>>
>>>> Not quite sure quite where the problem is (USB, OMAP, smsc95xx driver, other???),
>>>> so casting the nets wide...
>>>>
>>>> The PandaBoard frequently fails to boot with an eth0 error when mounting
>>>> the root file system via NFS (ethernet driver fails due to a USB timeout;
>>>> no ethernet means NFS won't work). A typical set of error messages is:
>>>>
>>>> [ 3.264373] smsc95xx 1-1.1:1.0: usb_probe_interface
>>>> [ 3.269500] smsc95xx 1-1.1:1.0: usb_probe_interface - got id
>>>> [ 3.275543] smsc95xx v1.0.4
>>>> [ 8.078674] smsc95xx 1-1.1:1.0: eth0: register 'smsc95xx' at usb-ehci-omap.0-1.1, smsc95xx USB 2.0 Ethernet, 82:b9:1d:fa:67:0d
>>>> [ 8.091003] hub 1-1:1.0: state 7 ports 5 chg 0000 evt 0002
>>>> [ 13.509918] usb 1-1.1: swapper/0 timed out on ep0out len=0/4
>>>> [ 13.515869] smsc95xx 1-1.1:1.0: eth0: Failed to write register index 0x00000108
>>>> [ 13.523559] smsc95xx 1-1.1:1.0: eth0: Failed to write ADDRL: -110
>>>> [ 13.529998] IP-Config: Failed to open eth0
>>>>
>>>> I have bisected this to:
>>>>
>>>> commit 18aafe64d75d0e27dae206cacf4171e4e485d285
>>>> Author: Alan Stern <stern@rowland.harvard.edu>
>>>> Date: Wed Jul 11 11:23:04 2012 -0400
>>>>
>>>> USB: EHCI: use hrtimer for the I/O watchdog
>>>
>>> I don't understand how that commit could cause a timeout unless there
>>> are at least two other bugs present in your system.
>>>
>>>> Note that to compile this version of the kernel, an additional fix must
>>>> also be applied:
>>>>
>>>> commit ba5952e0711b14d8d4fe172671f8aa6091ace3ee
>>>> Author: Ming Lei <ming.lei@canonical.com>
>>>> Date: Fri Jul 13 17:25:24 2012 +0800
>>>>
>>>> USB: ehci-omap: fix compile failure(v1)
>>>>
>>>> The symptom can be worked around by retrying the USB access if a timeout
>>>> occurs. This is clearly _not_ the fix, just a hack that I used to
>>>> investigate the problem:
>>>>
>>>> http://article.gmane.org/gmane.linux.rt.user/9773
>>>>
>>>> My kernel configuration is:
>>>>
>>>> arch/arm/configs/omap2plus_defconfig
>>>>
>>>> plus to get the ethernet driver I add:
>>>>
>>>> CONFIG_USB_EHCI_HCD
>>>> CONFIG_USB_NET_SMSC95XX
>>>>
>>>> I found the problem on 3.6.11, but have not replicated it on 3.9-rcX
>>>> yet because my config fails to build on 3.9-rc1 and 3.9-rc2. I'll try
>>>> to work on that issue tomorrow.
>>>
>>> Let me know how it works out.
>>
>> My PandaBoard builds fail on 3.9-rcX due to ARM multiplatform issues.
>> Either there is something I need to change about the way I build it,
>> or it is broken (that is a side issue). My simple expedient was to
>> hack around multiplatform, and just make it build (patch below if
>> anyone else wants a _temporary_ hack).
>
> I have built 3.9-RC2 for PandaBoard ES and the only problem I have seen is
> that you need to add "LOADADDR=0x80008000" when building uImage target.
Yes, that is essentially what my hack patch does. The result of my patch
is that arch/arm/boot/Makefile is invoked with MACHINE="arch/arm/mach-omap2"
so that at the top of the makefile, the "include $(srctree)/$(MACHINE)/Makefile.boot"
which pulls in the proper values for addresses.
-Frank
^ permalink raw reply
* ACHTUNG FRIEND!
From: WERNER ERICH ZELLER @ 2013-03-21 23:57 UTC (permalink / raw)
--
Eure Eminenz, das ist das dritte Mal, dass ich schreibe Ihnen bin, ich
bete nur du es dieses Mal! Ich bin Barrister Werner Erich Zeller des
Vereinigten Königreichs und ich schreibe auf Ihre 100% aufrichtiges
Interesse und Partnerschaft bei der Wiederherstellung der Höhe von 15
Mio. (EURO) Privatbank, die früher zu einem späten Kunde von mir, die,
ohne einem bestimmten Nest weitergegeben gehörten zu suchen Angehörigen
und Empfänger. Wie für die Rechtmäßigkeit und Echtheit, lassen Sie das zu
mir, ich werde es als Rechtsanwalt rechtlich 100% Griff! Wir stehen beide
zu 50% des 15 Mio. (EURO) jeweils als Partner profitieren. Schicken Sie
mir eine private E-Mail für die Details: wernererichzeller@yahoo.com und
Telefon: +447024090820
Bitte zurück zu mir sofort!
Werner Erich Zeller (Attorney)
^ permalink raw reply
* Re: [PATCH 3/3] net/macb: make clk_enable atomic
From: Fabio Estevam @ 2013-03-22 17:38 UTC (permalink / raw)
To: Steffen Trumtrar; +Cc: netdev, Nicolas Ferre
In-Reply-To: <1363973615-17863-3-git-send-email-s.trumtrar@pengutronix.de>
On Fri, Mar 22, 2013 at 2:33 PM, Steffen Trumtrar
<s.trumtrar@pengutronix.de> wrote:
> Use clk_prepare_enable to be safe on SMP systems.
Wouldn't you have to use clk_disable_unprepare() now?
^ permalink raw reply
* [PATCH 2/3] net/macb: force endian_swp_pkt_en to off
From: Steffen Trumtrar @ 2013-03-22 17:33 UTC (permalink / raw)
To: netdev; +Cc: Steffen Trumtrar, Nicolas Ferre
In-Reply-To: <1363973615-17863-1-git-send-email-s.trumtrar@pengutronix.de>
The core has a bit for swapping packet data endianism.
Reset default from Cadence is off. Xilinx however, who uses this core on the
Zynq SoCs, opted for on.
Force it to off. This shouldn't change the behaviour for current users of the
macb, but enables usage on Zynq devices.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
---
drivers/net/ethernet/cadence/macb.c | 1 +
drivers/net/ethernet/cadence/macb.h | 2 ++
2 files changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 817835e..71e766b 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1057,6 +1057,7 @@ static void macb_configure_dma(struct macb *bp)
dmacfg |= GEM_BF(RXBS, RX_BUFFER_SIZE / 64);
dmacfg |= GEM_BF(FBLDO, 16);
dmacfg |= GEM_BIT(TXPBMS) | GEM_BF(RXBMS, -1L);
+ dmacfg &= ~GEM_BIT(ENDIA);
gem_writel(bp, DMACFG, dmacfg);
}
}
diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h
index 570908b..993d703 100644
--- a/drivers/net/ethernet/cadence/macb.h
+++ b/drivers/net/ethernet/cadence/macb.h
@@ -173,6 +173,8 @@
/* Bitfields in DMACFG. */
#define GEM_FBLDO_OFFSET 0
#define GEM_FBLDO_SIZE 5
+#define GEM_ENDIA_OFFSET 7
+#define GEM_ENDIA_SIZE 1
#define GEM_RXBMS_OFFSET 8
#define GEM_RXBMS_SIZE 2
#define GEM_TXPBMS_OFFSET 10
--
1.8.2.rc2
^ permalink raw reply related
* [PATCH 3/3] net/macb: make clk_enable atomic
From: Steffen Trumtrar @ 2013-03-22 17:33 UTC (permalink / raw)
To: netdev; +Cc: Steffen Trumtrar, Nicolas Ferre
In-Reply-To: <1363973615-17863-1-git-send-email-s.trumtrar@pengutronix.de>
Use clk_prepare_enable to be safe on SMP systems.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
---
drivers/net/ethernet/cadence/macb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 71e766b..733b3fc 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1561,14 +1561,14 @@ static int __init macb_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "failed to get macb_clk\n");
goto err_out_free_dev;
}
- clk_enable(bp->pclk);
+ clk_prepare_enable(bp->pclk);
bp->hclk = clk_get(&pdev->dev, "hclk");
if (IS_ERR(bp->hclk)) {
dev_err(&pdev->dev, "failed to get hclk\n");
goto err_out_put_pclk;
}
- clk_enable(bp->hclk);
+ clk_prepare_enable(bp->hclk);
bp->regs = ioremap(regs->start, resource_size(regs));
if (!bp->regs) {
--
1.8.2.rc2
^ permalink raw reply related
* [PATCH 1/3] net/macb: clear tx/rx completion flags in ISR
From: Steffen Trumtrar @ 2013-03-22 17:33 UTC (permalink / raw)
To: netdev; +Cc: Steffen Trumtrar, Nicolas Ferre
At least in the cadence IP core on the Xilinx Zynq SoC the TCOMP/RCOMP flags
are not auto-cleaned. As these flags are evaluated, they need to be cleaned.
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
---
drivers/net/ethernet/cadence/macb.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 7903943..817835e 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -485,6 +485,8 @@ static void macb_tx_interrupt(struct macb *bp)
status = macb_readl(bp, TSR);
macb_writel(bp, TSR, status);
+ macb_writel(bp, ISR, MACB_BIT(TCOMP));
+
netdev_vdbg(bp->dev, "macb_tx_interrupt status = 0x%03lx\n",
(unsigned long)status);
@@ -736,6 +738,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
* now.
*/
macb_writel(bp, IDR, MACB_RX_INT_FLAGS);
+ macb_writel(bp, ISR, MACB_BIT(RCOMP));
if (napi_schedule_prep(&bp->napi)) {
netdev_vdbg(bp->dev, "scheduling RX softirq\n");
--
1.8.2.rc2
^ permalink raw reply related
* Re: [PATCH net-next 1/2] ip_gre: increase inner ip header ID during segmentation
From: Pravin Shelar @ 2013-03-22 17:12 UTC (permalink / raw)
To: Cong Wang; +Cc: netdev, Eric Dumazet, David S. Miller
In-Reply-To: <1363948292-9902-1-git-send-email-amwang@redhat.com>
On Fri, Mar 22, 2013 at 3:31 AM, Cong Wang <amwang@redhat.com> wrote:
> From: Cong Wang <amwang@redhat.com>
>
> According to the previous discussion [1] on netdev list, DaveM insists
> we should increase the IP header ID for each segmented packets.
> This patch fixes it.
>
Outer IP header ids are incremented in inet_gso_segment for GRE. So it
is already done. In any case I don't think we should increment
IP-Identification in GRE handler, This is layering violation.
This breaks GRE with IPV6 payload.
> Cc: Pravin B Shelar <pshelar@nicira.com>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>
>
> 1. http://marc.info/?t=136384172700001&r=1&w=2
>
> ---
> net/ipv4/gre.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/net/ipv4/gre.c b/net/ipv4/gre.c
> index 7a4c710..e20631c 100644
> --- a/net/ipv4/gre.c
> +++ b/net/ipv4/gre.c
> @@ -125,8 +125,9 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
> netdev_features_t enc_features;
> int ghl = GRE_HEADER_SECTION;
> struct gre_base_hdr *greh;
> + struct iphdr *iph;
> int mac_len = skb->mac_len;
> - int tnl_hlen;
> + int tnl_hlen, id;
> bool csum;
>
> if (unlikely(skb_shinfo(skb)->gso_type &
> @@ -170,6 +171,8 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
> skb_set_network_header(skb, skb_inner_network_offset(skb));
> skb->mac_len = skb_inner_network_offset(skb);
>
> + iph = ip_hdr(skb);
> + id = ntohs(iph->id);
> /* segment inner packet. */
> enc_features = skb->dev->hw_enc_features & netif_skb_features(skb);
> segs = skb_mac_gso_segment(skb, enc_features);
> @@ -179,6 +182,8 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
> skb = segs;
> tnl_hlen = skb_tnl_header_len(skb);
> do {
> + iph = (struct iphdr *)skb->data;
> + iph->id = htons(id++);
> __skb_push(skb, ghl);
> if (csum) {
> __be32 *pcsum;
> --
> 1.7.7.6
>
^ permalink raw reply
* Re: [PATCH net-next] ioat/dca: Update DCA BIOS workarounds to use TAINT_FIRMWARE_WORKAROUND
From: David Miller @ 2013-03-22 16:56 UTC (permalink / raw)
To: alexander.h.duyck
Cc: netdev, bhutchings, gospo, david.woodhouse, sassmann,
jeffrey.t.kirsher
In-Reply-To: <20130322155407.14605.67885.stgit@ahduyck-cp1.jf.intel.com>
From: Alexander Duyck <alexander.h.duyck@intel.com>
Date: Fri, 22 Mar 2013 09:01:59 -0700
> This patch is meant to be a follow-up for a patch originally submitted under
> the title "ioat: Do not enable DCA if tag map is invalid". It was brought to
> my attention that the preferred approach for BIOS workarounds is to set the
> taint flag for TAINT_FIRMWARE_WORKAROUND for systems that require BIOS
> workarounds.
>
> This change makes it so that the DCA workarounds for broken BIOSes will now
> use WARN_TAINT_ONCE(1, TAINT_FIRMWARE_WORKAROUND, ...) instead of just
> printing a message via dev_err.
>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Applied, thanks Alex.
^ permalink raw reply
* Re: NULL pointer deref, selinux_socket_unix_may_send+0x34/0x90
From: Ján Stanček @ 2013-03-22 16:52 UTC (permalink / raw)
To: Paul Moore; +Cc: netdev, eparis, sds
In-Reply-To: <3405435.XFBqjMtCVW@sifl>
Paul,
I applied your patch on top of 3.9-rc3 and ran v2 of reproducer. It
hit the issue
almost instantly:
[ 249.316283] BUG: unable to handle kernel NULL pointer dereference
at 0000000000000250
[ 249.325044] IP: [<ffffffff812a2d04>] selinux_socket_unix_may_send+0x34/0x90
[ 249.332829] PGD 80a8e5067 PUD 803048067 PMD 0
[ 249.337821] Oops: 0000 [#1] SMP
[ 249.453113] CPU 22
[ 249.455262] Pid: 6928, comm: a.out Tainted: GF
3.9.0-rc3+ #1 Intel Corporation W2600CR/W2600CR
[ 249.466132] RIP: 0010:[<ffffffff812a2d04>] [<ffffffff812a2d04>]
selinux_socket_unix_may_send+0x34/0x90
[ 249.476632] RSP: 0018:ffff880826569ab8 EFLAGS: 00010246
[ 249.482551] RAX: ffff880417ee4100 RBX: ffff880826569be8 RCX: 0000000000000007
[ 249.490511] RDX: 0000000000000000 RSI: ffff880828f77d00 RDI: ffff880826569ad8
[ 249.498472] RBP: ffff880826569b18 R08: ffff880424ada080 R09: 0000000000000000
[ 249.506434] R10: ffff880826569a38 R11: 000000000000000f R12: ffff880417ee4100
[ 249.514395] R13: 7fffffffffffffff R14: ffff880424ada080 R15: ffff880424ada370
[ 249.522355] FS: 00007f6d44abf740(0000) GS:ffff88042f7c0000(0000)
knlGS:0000000000000000
[ 249.531383] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 249.537792] CR2: 0000000000000250 CR3: 0000000800ffa000 CR4: 00000000000407e0
[ 249.545755] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 249.553716] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 249.561678] Process a.out (pid: 6928, threadinfo ffff880826568000,
task ffff880825d999a0)
[ 249.570802] Stack:
[ 249.573046] ffff880424ada002 ffff880427c5bc00 ffff880417ee4100
ffff880424ada080
[ 249.581339] ffff880424ada080 000000000000000a ffff880826569af8
ffffffff8129ef36
[ 249.589637] ffff880826569b28 ffffffff81529747 ffff880826569be8
0000000011f46a34
[ 249.597933] Call Trace:
[ 249.600666] [<ffffffff8129ef36>] ? security_sock_rcv_skb+0x16/0x20
[ 249.607661] [<ffffffff81529747>] ? sk_filter+0x37/0xd0
[ 249.613491] [<ffffffff8129ef16>] security_unix_may_send+0x16/0x20
[ 249.620390] [<ffffffff815b697d>] unix_dgram_sendmsg+0x48d/0x640
[ 249.627094] [<ffffffff814fd9c0>] sock_sendmsg+0xb0/0xe0
[ 249.633024] [<ffffffff812adee7>] ? ebitmap_cpy+0x47/0xd0
[ 249.639048] [<ffffffff814ff55c>] __sys_sendmsg+0x3ac/0x3c0
[ 249.645267] [<ffffffff811a3357>] ? do_sync_write+0xa7/0xe0
[ 249.651487] [<ffffffff811e31fb>] ? fsnotify+0x24b/0x340
[ 249.657416] [<ffffffff815013c9>] sys_sendmsg+0x49/0x90
[ 249.663249] [<ffffffff81630bd9>] system_call_fastpath+0x16/0x1b
[ 249.669949] Code: 00 00 45 31 c9 48 89 e5 48 83 ec 60 48 8b 56 20
65 48 8b 04 25 28 00 00 00 48 89 45 f8 31 c0 48 8b 47 20 48 8d 7d c0
c6 45 a0 02 <48> 8b b2 50 02 00 00 4c 8b 80 50 02 00 00 31 c0 f3 48 ab
48 89
Regards,
Jan
On Fri, Mar 22, 2013 at 5:24 PM, Paul Moore <paul@paul-moore.com> wrote:
> On Friday, March 22, 2013 04:48:32 PM Ján Stanček wrote:
>> Hi Paul,
>>
>> thanks for reply, I'll try your patch and let you know.
>
> Great, thanks.
>
>> I'm not certain about cause either, but patch I sent in last email
>> makes it go away, so maybe that can help in some way.
>
> At the very least you've found a way to reproduce the problem and your patch
> furthers my belief that we've got a race condition somewhere - all very
> helpful! It may also turn out that your patch is the "right" solution, I'd
> just like to better understand why we are seeing the race in the first place.
>
>> I made a v2 of the reproducer (attached), which triggers the issue a lot
>> faster on 2 systems I tried (32 CPU and 4 CPU systems) - just in couple of
>> seconds.
>
> Excellent, while I don't have a 32 cpu system handy, I do have a 4 cpu system
> that I can play with. Thanks again.
>
> -Paul
>
> --
> paul moore
> www.paul-moore.com
>
^ permalink raw reply
* Re: [PATCH net-next] decnet: Move rtm_dn_policy to dn_route to make it available if !CONFIG_DECNET_ROUTER
From: David Miller @ 2013-03-22 16:52 UTC (permalink / raw)
To: tgraf; +Cc: netdev
In-Reply-To: <20130322165029.GB19293@casper.infradead.org>
From: Thomas Graf <tgraf@suug.ch>
Date: Fri, 22 Mar 2013 16:50:29 +0000
> Otherwise build fails with CONFIG_DECNET && !CONFIG_DECNET_ROUTER
>
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Thomas Graf <tgraf@suug.ch>
Applied, thanks Thomas.
^ permalink raw reply
* [PATCH net-next] decnet: Move rtm_dn_policy to dn_route to make it available if !CONFIG_DECNET_ROUTER
From: Thomas Graf @ 2013-03-22 16:50 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20130322.103135.962113441677649820.davem@davemloft.net>
Otherwise build fails with CONFIG_DECNET && !CONFIG_DECNET_ROUTER
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
---
net/decnet/dn_fib.c | 14 --------------
net/decnet/dn_route.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
index f093059..57dc159 100644
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -489,20 +489,6 @@ void dn_fib_select_multipath(const struct flowidn *fld, struct dn_fib_res *res)
spin_unlock_bh(&dn_fib_multipath_lock);
}
-const struct nla_policy rtm_dn_policy[RTA_MAX + 1] = {
- [RTA_DST] = { .type = NLA_U16 },
- [RTA_SRC] = { .type = NLA_U16 },
- [RTA_IIF] = { .type = NLA_U32 },
- [RTA_OIF] = { .type = NLA_U32 },
- [RTA_GATEWAY] = { .type = NLA_U16 },
- [RTA_PRIORITY] = { .type = NLA_U32 },
- [RTA_PREFSRC] = { .type = NLA_U16 },
- [RTA_METRICS] = { .type = NLA_NESTED },
- [RTA_MULTIPATH] = { .type = NLA_NESTED },
- [RTA_TABLE] = { .type = NLA_U32 },
- [RTA_MARK] = { .type = NLA_U32 },
-};
-
static inline u32 rtm_get_table(struct nlattr *attrs[], u8 table)
{
if (attrs[RTA_TABLE])
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
index 5904429..fe32388 100644
--- a/net/decnet/dn_route.c
+++ b/net/decnet/dn_route.c
@@ -1613,6 +1613,20 @@ errout:
return -EMSGSIZE;
}
+const struct nla_policy rtm_dn_policy[RTA_MAX + 1] = {
+ [RTA_DST] = { .type = NLA_U16 },
+ [RTA_SRC] = { .type = NLA_U16 },
+ [RTA_IIF] = { .type = NLA_U32 },
+ [RTA_OIF] = { .type = NLA_U32 },
+ [RTA_GATEWAY] = { .type = NLA_U16 },
+ [RTA_PRIORITY] = { .type = NLA_U32 },
+ [RTA_PREFSRC] = { .type = NLA_U16 },
+ [RTA_METRICS] = { .type = NLA_NESTED },
+ [RTA_MULTIPATH] = { .type = NLA_NESTED },
+ [RTA_TABLE] = { .type = NLA_U32 },
+ [RTA_MARK] = { .type = NLA_U32 },
+};
+
/*
* This is called by both endnodes and routers now.
*/
^ permalink raw reply related
* Re: [PATCH net-next 0/5] qlcnic: bug fixes and log enhancement
From: David Miller @ 2013-03-22 16:47 UTC (permalink / raw)
To: shahed.shaikh; +Cc: netdev, Dept_NX_Linux_NIC_Driver
In-Reply-To: <1363967877-16812-1-git-send-email-shahed.shaikh@qlogic.com>
From: Shahed Shaikh <shahed.shaikh@qlogic.com>
Date: Fri, 22 Mar 2013 11:57:52 -0400
> Please apply to net-next.
Series applied, thanks.
^ permalink raw reply
* [PATCH iproute2 v3] libnetlink: check flag NLM_F_DUMP_INTR during dumps
From: Nicolas Dichtel @ 2013-03-22 16:34 UTC (permalink / raw)
To: eric.dumazet; +Cc: shemminger, netdev, tgraf, Nicolas Dichtel
In-Reply-To: <1363967372.4431.71.camel@edumazet-glaptop>
When this flag is set, it means that dump was interrupted and result may be
inconsistent.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
v3: display the warning only once
v2: do not stop the dump, only display a warning
lib/libnetlink.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index f262959..04201cd 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -194,6 +194,7 @@ int rtnl_dump_filter_l(struct rtnl_handle *rth,
.msg_iovlen = 1,
};
char buf[16384];
+ int dump_intr = 0;
iov.iov_base = buf;
while (1) {
@@ -230,6 +231,9 @@ int rtnl_dump_filter_l(struct rtnl_handle *rth,
h->nlmsg_seq != rth->dump)
goto skip_it;
+ if (h->nlmsg_flags & NLM_F_DUMP_INTR)
+ dump_intr = 1;
+
if (h->nlmsg_type == NLMSG_DONE) {
found_done = 1;
break; /* process next filter */
@@ -254,8 +258,12 @@ skip_it:
}
}
- if (found_done)
+ if (found_done) {
+ if (dump_intr)
+ fprintf(stderr,
+ "Dump was interrupted and may be inconsistent.\n");
return 0;
+ }
if (msg.msg_flags & MSG_TRUNC) {
fprintf(stderr, "Message truncated\n");
--
1.8.0.1
^ permalink raw reply related
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