* Re: [PATCH v2] net: Fix napi_gro_frags vs netpoll path
From: David Miller @ 2010-08-05 20:22 UTC (permalink / raw)
To: jarkao2; +Cc: netdev, herbert, xiaohui.xin
In-Reply-To: <20100805111911.GB19965@ff.dom.local>
From: Jarek Poplawski <jarkao2@gmail.com>
Date: Thu, 5 Aug 2010 11:19:11 +0000
> Slight changelog and subject fixes only, sorry.
>
> Jarek P.
> ------------------>
>
> The netpoll_rx_on() check in __napi_gro_receive() skips part of the
> "common" GRO_NORMAL path, especially "pull:" in dev_gro_receive(),
> where at least eth header should be copied for entirely paged skbs.
>
> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Applied, with Herbert's ACK to v1.
^ permalink raw reply
* [PATCH 16/42] net/ipv6/netfilter: Adjust confusing if indentation
From: Julia Lawall @ 2010-08-05 20:21 UTC (permalink / raw)
To: Patrick McHardy, David S. Miller, Alexey Kuznetsov,
Pekka Savola (ipv6), James Morris <jmorris@
From: Julia Lawall <julia@diku.dk>
Indent the branch of an if.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r disable braces4@
position p1,p2;
statement S1,S2;
@@
(
if (...) { ... }
|
if (...) S1@p1 S2@p2
)
@script:python@
p1 << r.p1;
p2 << r.p2;
@@
if (p1[0].column == p2[0].column):
cocci.print_main("branch",p1)
cocci.print_secs("after",p2)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
index 1df3c8b..befccff 100644
--- a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
@@ -192,7 +192,7 @@ icmpv6_error(struct net *net, struct nf_conn *tmpl,
icmp6h = skb_header_pointer(skb, dataoff, sizeof(_ih), &_ih);
if (icmp6h == NULL) {
if (LOG_INVALID(net, IPPROTO_ICMPV6))
- nf_log_packet(PF_INET6, 0, skb, NULL, NULL, NULL,
+ nf_log_packet(PF_INET6, 0, skb, NULL, NULL, NULL,
"nf_ct_icmpv6: short packet ");
return -NF_ACCEPT;
}
^ permalink raw reply related
* Re: [patch] isdn: fix information leak
From: David Miller @ 2010-08-05 20:21 UTC (permalink / raw)
To: error27; +Cc: isdn, netdev, kernel-janitors
In-Reply-To: <20100805093806.GF9031@bicker>
From: Dan Carpenter <error27@gmail.com>
Date: Thu, 5 Aug 2010 11:38:06 +0200
> The main motivation of this patch changing strcpy() to strlcpy().
> We strcpy() to copy a 48 byte buffers into a 49 byte buffers. So at
> best the last byte has leaked information, or maybe there is an
> overflow? Anyway, this patch closes the information leaks by zeroing
> the memory and the calls to strlcpy() prevent overflows.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] usbnet: remove noisy and hardly useful printk
From: David Miller @ 2010-08-05 20:21 UTC (permalink / raw)
To: christian.samsel; +Cc: netdev, dhollis
In-Reply-To: <1280996076-19708-1-git-send-email-christian.samsel@rwth-aachen.de>
From: Christian Samsel <christian.samsel@rwth-aachen.de>
Date: Thu, 05 Aug 2010 10:14:36 +0200
> With turned on hspa modem (Dell 5530 internal card) and activated usb auto
> suspend, my system gets up 100 "usbnet_resume has delayed data" per
> minute. I didnt noticed any pathological behaviour, so just drop
> this message. if any objections, please at least change it to _DEBUG.
>
> Signed-off-by: Christian Samsel <christian.samsel@rwth-aachen.de>
I agree, and I'll apply this, thanks.
^ permalink raw reply
* [PATCH 8/42] drivers/net/ixgbe: Adjust confusing if indentation
From: Julia Lawall @ 2010-08-05 20:19 UTC (permalink / raw)
To: Jeff Kirsher, Jesse Brandeburg, Bruce Allan, Alex Duyck, PJ
From: Julia Lawall <julia@diku.dk>
Both ifs and assignments to autoc seem similar enough that they are both
put in the if branch indicated by their indentation.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r disable braces4@
position p1,p2;
statement S1,S2;
@@
(
if (...) { ... }
|
if (...) S1@p1 S2@p2
)
@script:python@
p1 << r.p1;
p2 << r.p2;
@@
if (p1[0].column == p2[0].column):
cocci.print_main("branch",p1)
cocci.print_secs("after",p2)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
This changes the semantics and might be the wrong fix. Not tested.
drivers/net/ixgbe/ixgbe_82599.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index 3e06a61..a5fcdce 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -766,12 +766,13 @@ s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw,
link_mode == IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII) {
/* Set KX4/KX/KR support according to speed requested */
autoc &= ~(IXGBE_AUTOC_KX4_KX_SUPP_MASK | IXGBE_AUTOC_KR_SUPP);
- if (speed & IXGBE_LINK_SPEED_10GB_FULL)
+ if (speed & IXGBE_LINK_SPEED_10GB_FULL) {
if (orig_autoc & IXGBE_AUTOC_KX4_SUPP)
autoc |= IXGBE_AUTOC_KX4_SUPP;
if ((orig_autoc & IXGBE_AUTOC_KR_SUPP) &&
(hw->phy.smart_speed_active == false))
autoc |= IXGBE_AUTOC_KR_SUPP;
+ }
if (speed & IXGBE_LINK_SPEED_1GB_FULL)
autoc |= IXGBE_AUTOC_KX_SUPP;
} else if ((pma_pmd_1g == IXGBE_AUTOC_1G_SFI) &&
^ permalink raw reply related
* [PATCH 7/42] net/atm: Adjust confusing if indentation
From: Julia Lawall @ 2010-08-05 20:19 UTC (permalink / raw)
To: David S. Miller, linux-kernel, netdev, kernel-janitors
From: Julia Lawall <julia@diku.dk>
Outdent the code following an if.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r disable braces4@
position p1,p2;
statement S1,S2;
@@
(
if (...) { ... }
|
if (...) S1@p1 S2@p2
)
@script:python@
p1 << r.p1;
p2 << r.p2;
@@
if (p1[0].column == p2[0].column):
cocci.print_main("branch",p1)
cocci.print_secs("after",p2)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
net/atm/common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/atm/common.c b/net/atm/common.c
index 940404a..1b9c52a 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -792,7 +792,7 @@ int vcc_getsockopt(struct socket *sock, int level, int optname,
default:
if (level == SOL_SOCKET)
return -EINVAL;
- break;
+ break;
}
if (!vcc->dev || !vcc->dev->ops->getsockopt)
return -EINVAL;
^ permalink raw reply related
* [PATCH 1/42] drivers/net/wan: Adjust confusing if indentation
From: Julia Lawall @ 2010-08-05 20:17 UTC (permalink / raw)
To: Krzysztof Halasa, netdev, linux-kernel, kernel-janitors
From: Julia Lawall <julia@diku.dk>
Indent the branch of an if.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r disable braces4@
position p1,p2;
statement S1,S2;
@@
(
if (...) { ... }
|
if (...) S1@p1 S2@p2
)
@script:python@
p1 << r.p1;
p2 << r.p2;
@@
if (p1[0].column == p2[0].column):
cocci.print_main("branch",p1)
cocci.print_secs("after",p2)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/net/wan/c101.c | 2 +-
drivers/net/wan/n2.c | 2 +-
drivers/net/wan/pci200syn.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c
index 0bd898c..4ac85a0 100644
--- a/drivers/net/wan/c101.c
+++ b/drivers/net/wan/c101.c
@@ -264,7 +264,7 @@ static int c101_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
new_line.clock_type != CLOCK_TXFROMRX &&
new_line.clock_type != CLOCK_INT &&
new_line.clock_type != CLOCK_TXINT)
- return -EINVAL; /* No such clock setting */
+ return -EINVAL; /* No such clock setting */
if (new_line.loopback != 0 && new_line.loopback != 1)
return -EINVAL;
diff --git a/drivers/net/wan/n2.c b/drivers/net/wan/n2.c
index 5394b51..7a3720f 100644
--- a/drivers/net/wan/n2.c
+++ b/drivers/net/wan/n2.c
@@ -282,7 +282,7 @@ static int n2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
new_line.clock_type != CLOCK_TXFROMRX &&
new_line.clock_type != CLOCK_INT &&
new_line.clock_type != CLOCK_TXINT)
- return -EINVAL; /* No such clock setting */
+ return -EINVAL; /* No such clock setting */
if (new_line.loopback != 0 && new_line.loopback != 1)
return -EINVAL;
diff --git a/drivers/net/wan/pci200syn.c b/drivers/net/wan/pci200syn.c
index e2cff64..fd73759 100644
--- a/drivers/net/wan/pci200syn.c
+++ b/drivers/net/wan/pci200syn.c
@@ -220,7 +220,7 @@ static int pci200_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
new_line.clock_type != CLOCK_TXFROMRX &&
new_line.clock_type != CLOCK_INT &&
new_line.clock_type != CLOCK_TXINT)
- return -EINVAL; /* No such clock setting */
+ return -EINVAL; /* No such clock setting */
if (new_line.loopback != 0 && new_line.loopback != 1)
return -EINVAL;
^ permalink raw reply related
* Re: NET_NS: unregister_netdevice: waiting for lo to become free (adding ipv6 address to interface)
From: David Miller @ 2010-08-05 20:11 UTC (permalink / raw)
To: ebiederm; +Cc: lkml20100708, greg, netdev, linux-kernel, adobriyan, kaber
In-Reply-To: <m1bp9g7ry0.fsf@fess.ebiederm.org>
From: ebiederm@xmission.com (Eric W. Biederman)
Date: Thu, 05 Aug 2010 12:57:59 -0700
> I wonder what has changed with ipv6 recently.
There was a recent fix to the IGMP snooping code we have in
the bridging layer, if parsing of an ipv6 IGMP packet failed
we'd leak the packet (and thus references to whatever device
it referenced).
commit 6d1d1d398cb7db7a12c5d652d50f85355345234f
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu Jul 29 01:12:31 2010 +0000
bridge: Fix skb leak when multicast parsing fails on TX
On the bridge TX path we're leaking an skb when br_multicast_rcv
returns an error.
Reported-by: David Lamparter <equinox@diac24.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 4cec805..f49bcd9 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -48,8 +48,10 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
rcu_read_lock();
if (is_multicast_ether_addr(dest)) {
- if (br_multicast_rcv(br, NULL, skb))
+ if (br_multicast_rcv(br, NULL, skb)) {
+ kfree_skb(skb);
goto out;
+ }
mdst = br_mdb_get(br, skb);
if (mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb))
^ permalink raw reply related
* [PATCH RFC] vhost: max s/g to match qemu
From: Michael S. Tsirkin @ 2010-08-05 20:03 UTC (permalink / raw)
To: Michael S. Tsirkin, Aristeu Rozanski, Juan Quintela, Herbert Xu,
David S. Miller
qemu supports up to UIO_MAXIOV s/g so we have to match that.
Apparently windows guests rely on this (more precisely,
they want to fill all of vq with s/g entries of a single
descriptor).
Allocate indirect and log arrays dynamically to avoid
using too much contigious memory.
hdr array is used to store the virtio header.
Since each iovec entry has >= 1 byte length, we never need
more than header length entries to store the header.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
This fixes Red Hat bugzilla 619002.
Dave, I'll queue this through the vhost tree so there's no
need for you to apply this.
Labeling RFC to make this explicit.
drivers/vhost/vhost.c | 32 ++++++++++++++++++++++++++++++--
drivers/vhost/vhost.h | 17 ++++++++---------
2 files changed, 38 insertions(+), 11 deletions(-)
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index e519950..b21a5e5 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -123,10 +123,31 @@ static void vhost_vq_reset(struct vhost_dev *dev,
vq->log_ctx = NULL;
}
+/* Helper to allocate iovec buffers for all vqs. */
+static long vhost_dev_alloc_iovecs(struct vhost_dev *dev)
+{
+ int i;
+ for (i = 0; i < dev->nvqs; ++i) {
+ dev->vqs[i].indirect = kmalloc(GFP_KERNEL, UIO_MAXIOV *
+ sizeof *dev->vqs[i].indirect);
+ dev->vqs[i].log = kmalloc(GFP_KERNEL, UIO_MAXIOV *
+ sizeof *dev->vqs[i].log);
+ if (!dev->vqs[i].indirect || !dev->vqs[i].log)
+ goto err_nomem;
+ }
+ return 0;
+err_nomem:
+ for (; i >= 0; --i) {
+ kfree(dev->vqs[i].indirect);
+ kfree(dev->vqs[i].log);
+ }
+ return -ENOMEM;
+}
+
long vhost_dev_init(struct vhost_dev *dev,
struct vhost_virtqueue *vqs, int nvqs)
{
- int i;
+ int i, ret;
dev->vqs = vqs;
dev->nvqs = nvqs;
mutex_init(&dev->mutex);
@@ -136,6 +157,10 @@ long vhost_dev_init(struct vhost_dev *dev,
dev->mm = NULL;
dev->wq = NULL;
+ ret = vhost_dev_alloc_iovecs(dev);
+ if (ret)
+ return ret;
+
for (i = 0; i < dev->nvqs; ++i) {
dev->vqs[i].dev = dev;
mutex_init(&dev->vqs[i].mutex);
@@ -222,6 +247,9 @@ void vhost_dev_cleanup(struct vhost_dev *dev)
if (dev->vqs[i].call)
fput(dev->vqs[i].call);
vhost_vq_reset(dev, dev->vqs + i);
+
+ kfree(dev->vqs[i].indirect);
+ kfree(dev->vqs[i].log);
}
if (dev->log_ctx)
eventfd_ctx_put(dev->log_ctx);
@@ -824,7 +852,7 @@ static int get_indirect(struct vhost_dev *dev, struct vhost_virtqueue *vq,
}
ret = translate_desc(dev, indirect->addr, indirect->len, vq->indirect,
- ARRAY_SIZE(vq->indirect));
+ UIO_MAXIOV);
if (unlikely(ret < 0)) {
vq_err(vq, "Translation failure %d in indirect.\n", ret);
return ret;
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
index 19f4334..61b1a6e 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -12,14 +12,10 @@
#include <linux/uio.h>
#include <linux/virtio_config.h>
#include <linux/virtio_ring.h>
+#include <linux/virtio_net.h>
struct vhost_device;
-enum {
- /* Enough place for all fragments, head, and virtio net header. */
- VHOST_NET_MAX_SG = MAX_SKB_FRAGS + 2,
-};
-
/* Poll a file (eventfd or socket) */
/* Note: there's nothing vhost specific about this structure. */
struct vhost_poll {
@@ -83,9 +79,12 @@ struct vhost_virtqueue {
bool log_used;
u64 log_addr;
- struct iovec indirect[VHOST_NET_MAX_SG];
- struct iovec iov[VHOST_NET_MAX_SG];
- struct iovec hdr[VHOST_NET_MAX_SG];
+ struct iovec iov[UIO_MAXIOV];
+ /* hdr is used to store the virtio header.
+ * Since each iovec entry has >= 1 byte length, we never need more than
+ * header length entries to store the header. */
+ struct iovec hdr[sizeof(struct virtio_net_hdr_mrg_rxbuf)];
+ struct iovec *indirect;
size_t hdr_size;
/* We use a kind of RCU to access private pointer.
* All readers access it from workqueue, which makes it possible to
@@ -97,7 +96,7 @@ struct vhost_virtqueue {
void *private_data;
/* Log write descriptors */
void __user *log_base;
- struct vhost_log log[VHOST_NET_MAX_SG];
+ struct vhost_log *log;
};
struct vhost_dev {
--
1.7.2.rc0.14.g41c1c
^ permalink raw reply related
* Re: null pointer at cls_api.c
From: David Miller @ 2010-08-05 20:07 UTC (permalink / raw)
To: franchoze; +Cc: netdev
In-Reply-To: <282881281036255@web101.yandex.ru>
From: Franchoze Eric <franchoze@yandex.ru>
Date: Thu, 05 Aug 2010 23:24:15 +0400
> @@ -255,6 +255,11 @@ replay:
> kfree(tp);
> goto errout;
> }
> +
> + if (!tp || !tp->ops) {
> + err = -ENOENT;
> + goto errout;
> + }
> tp->ops = tp_ops;
> tp->protocol = protocol;
> tp->prio = nprio ? : TC_H_MAJ(tcf_auto_prio(*back));
>
This patch makes no sense.
We check for "tp" being non-NULL in the code block about the if() block you're
adding these checks to.
And tp->ops of course might be NULL here, and that's perfectly fine,
as we're about to assign "tp_ops" to it.
Looking at your backtrace I think perhaps your crash is elsewhere.
^ permalink raw reply
* Re: [PATCH] cfg80211: support sysfs namespaces
From: Johannes Berg @ 2010-08-05 20:05 UTC (permalink / raw)
To: Eric W. Biederman; +Cc: John Linville, linux-wireless, netdev
In-Reply-To: <m1wrs47shi.fsf-+imSwln9KH6u2/kzUuoCbdi2O/JbrIOy@public.gmane.org>
On Thu, 2010-08-05 at 12:46 -0700, Eric W. Biederman wrote:
> Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org> writes:
>
> > From: Johannes Berg <johannes.berg-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> >
> > Enable using network namespaces with
> > wireless devices even when sysfs is
> > enabled using the same infrastructure
> > that was built for netdevs.
>
> Acked-by: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
>
> This looks reasonable. I assume you have tested this and it is
> working now?
Yes, I tested it. Was missing the no-op device_rename() at first, but
now it works.
johannes
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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
* Re: NET_NS: unregister_netdevice: waiting for lo to become free (adding ipv6 address to interface)
From: Eric W. Biederman @ 2010-08-05 19:57 UTC (permalink / raw)
To: Michael Leun
Cc: Greg KH, netdev, davem, linux-kernel, Alexey Dobriyan,
Patrick McHardy
In-Reply-To: <20100805134707.0442a7b1@xenia.leun.net>
Michael Leun <lkml20100708@newton.leun.net> writes:
> On Thu, 05 Aug 2010 02:51:29 -0700
> ebiederm@xmission.com (Eric W. Biederman) wrote:
>
>> >> > Jul 10 20:02:36 doris kernel: unregister_netdevice: waiting for
>> >> > lo to become free. Usage count = 3 [repeated]
>> >>
>> >> How many times?
>> >
>> > Unfortunately looks like indefinitely. Never watched longer so far
>> > (rebooted soon), but I'm seeing this message now repeated every 10
>> > secs for ~10 minutes on a idle system.
>>
>> Ugh. A real bug then. These can be a pain to track down and fix. I
>> think the last one of these I tracked down took a couple of weeks. I
>> will start digging in when I get back from vacation.
>
> OK, fortunately (hopefully) you have not put to much time onto that so
> far - because everything I told about usage of tun and difference
> between ssh and openvpn is complete nonsense.
>
> I happen to have an script in that openvpn config, which puts an ipv6
> address on the vpn device.
>
> Putting an ipv6 address on a device seems to be the trigger:
>
> OrigNS > # ip link add type veth
> OrigNS > # ip link set dev veth0 up
> OrigNS > # unshare -n /bin/bash
> NewNS > # echo $$
> <SomePID>
> OrigNS > # ip link set dev veth1 netns <SomePID> # this, of course is on a different terminal
> NewNS > # ip link set dev veth1 up
> NewNS > # ip -6 addr add dev veth1 fd50:dead:beef::1/64
> NewNS > # exit
>
> Yields
>
> kernel: unregister_netdevice: waiting for veth1 to become free. Usage count = 3
>
> Oh - its veth1 this time, not lo - add an "ip link set up dev lo" in the above scenario just after the unshare, and you get the message with lo.
>
> One might ask, if
>
>> # unshare -n /bin/bash
>> # ip link set up dev lo
>> # ip -6 addr add dev veth1 fd50:dead:beef::1/64
>> # exit
>
> also does the trick, so I tried it - and it does NOT.
>
> In the above scenario, not setting veth0 and veth1 up also makes it not happen. Only setting veth1 up also is not enough (seems to need to be "really up" what as you shurely know with veth is only the case when both sides are up).
>
> I hope, this makes it somewhat easier to track that down.
What puzzles me is that on a slightly patched 2.6.32 (so sysfs works)
and I am doing very similar things (openvpn tunnels, ipv6 to the
network as a whole etc), and I am not seeing the infinite
unregister_netdevice: messages you are talking about.
When a network device is removed most references to it are redirected
to the loopback device so a normal network device should not see the
worst of the problems. That is why lo showed up.
In that context I'm a bit surprised you managed trigger a problem on veth1.
I wonder what has changed with ipv6 recently.
Eric
^ permalink raw reply
* RE: [PATCH] [Bug 16494] NFS client over TCP hangs due to packet loss
From: Trond Myklebust @ 2010-08-05 19:50 UTC (permalink / raw)
To: Andy Chittenden
Cc: 'Andrew Morton', 'David Miller',
kuznet-v/Mj1YrvjDBInbfyfbPRSQ, pekkas-UjJjq++bwZ7HOG6cAo2yLw,
jmorris-gx6/JNMH7DfYtjvyW6yDsg, yoshfuji-VfPWfsRibaP+Ru+s062T9g,
kaber-dcUjhNyLwpNeoWH0uzbU5w, eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w,
William.Allen.Simpson-Re5JQEeQqe8AvxtiuMwx3w,
gilad-f4XOiQkOAtcdH0auuBZGHA,
ilpo.jarvinen-pxSi+dnQzZMxHbG02/KK1g,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-nfs-u79uwXL29TY76Z2rM5mHXA, 'J. Bruce Fields',
'Neil Brown', 'Chuck Lever',
'Benny Halevy', 'Alexandros Batsakis',
'Joe Perches'
In-Reply-To: <4c5ad0d6.42ecd80a.47d7.0dfc-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org>
On Thu, 2010-08-05 at 15:55 +0100, Andy Chittenden wrote:
> > On 2010-08-03 10:11, Andrew Morton wrote:
> > > (cc linux-nfs)
> > >
> > > On Tue, 03 Aug 2010 01:21:44 -0700 (PDT) David
> > Miller<davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> wrote:
> > >
> > >> From: "Andy Chittenden"<andyc.bluearc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > >> Date: Tue, 3 Aug 2010 09:14:31 +0100
> > >>
> > >>> I don't know whether this patch is the correct fix or not but it
> > enables the
> > >>> NFS client to recover.
> > >>>
> > >>> Kernel version: 2.6.34.1 and 2.6.32.
> > >>>
> > >>> Fixes<https://bugzilla.kernel.org/show_bug.cgi?id=16494>. It clears
> > down
> > >>> any previous shutdown attempts so that reconnects on a socket
> > that's been
> > >>> shutdown leave the socket in a usable state (otherwise
> > tcp_sendmsg() returns
> > >>> -EPIPE).
> > >>
> > >> If the SunRPC code wants to close a TCP socket then use it again,
> > >> it should disconnect by doing a connect() with sa_family ==
> > AF_UNSPEC
> >
> > There is code to do that in the SunRPC code in xs_abort_connection()
> > but
> > that's conditionally called from xs_tcp_reuse_connection():
> >
> > static void xs_tcp_reuse_connection(struct rpc_xprt *xprt, struct
> > sock_xprt *transport)
> > {
> > unsigned int state = transport->inet->sk_state;
> >
> > if (state == TCP_CLOSE && transport->sock->state ==
> > SS_UNCONNECTED)
> > return;
> > if ((1 << state) & (TCPF_ESTABLISHED|TCPF_SYN_SENT))
> > return;
> > xs_abort_connection(xprt, transport);
> > }
> >
> > That's changed since 2.6.26 where it unconditionally did the connect()
> > with sa_family == AF_UNSPEC. FWIW we cannot reproduce this problem with
> > 2.6.26.
>
> The problem is fixed with this patch which also prints out that sk_shutdown
> can be non-zero on entry to xs_tcp_reuse_connection:
>
> # diff -up /home/company/software/src/linux-2.6.34.2/net/sunrpc/xprtsock.c
> net/sunrpc/xprtsock.c
> --- /home/company/software/src/linux-2.6.34.2/net/sunrpc/xprtsock.c
> 2010-08-02 18:30:51.000000000 +0100
> +++ net/sunrpc/xprtsock.c 2010-08-05 12:21:11.000000000 +0100
> @@ -1322,10 +1322,11 @@ static void xs_tcp_state_change(struct s
> if (!(xprt = xprt_from_sock(sk)))
> goto out;
> dprintk("RPC: xs_tcp_state_change client %p...\n", xprt);
> - dprintk("RPC: state %x conn %d dead %d zapped %d\n",
> + dprintk("RPC: state %x conn %d dead %d zapped %d sk_shutdown
> %d\n",
> sk->sk_state, xprt_connected(xprt),
> sock_flag(sk, SOCK_DEAD),
> - sock_flag(sk, SOCK_ZAPPED));
> + sock_flag(sk, SOCK_ZAPPED),
> + sk->sk_shutdown);
>
> switch (sk->sk_state) {
> case TCP_ESTABLISHED:
> @@ -1796,10 +1797,18 @@ static void xs_tcp_reuse_connection(stru
> {
> unsigned int state = transport->inet->sk_state;
>
> - if (state == TCP_CLOSE && transport->sock->state == SS_UNCONNECTED)
> - return;
> - if ((1 << state) & (TCPF_ESTABLISHED|TCPF_SYN_SENT))
> - return;
> + if (state == TCP_CLOSE && transport->sock->state == SS_UNCONNECTED)
> {
> + if (transport->inet->sk_shutdown == 0)
> + return;
> + printk("%s: TCP_CLOSEd and sk_shutdown set to %d\n",
> + __func__, transport->inet->sk_shutdown);
> + }
> + if ((1 << state) & (TCPF_ESTABLISHED|TCPF_SYN_SENT)) {
> + if (transport->inet->sk_shutdown == 0)
> + return;
> + printk("%s: sk_shutdown set to %d\n",
> + __func__, transport->inet->sk_shutdown);
> + }
> xs_abort_connection(xprt, transport);
> }
>
> Signed-off-by: Andy Chittenden <andyc.bluearc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> dmesg displays:
>
> [ 2840.896043] xs_tcp_reuse_connection: TCP_CLOSEd and sk_shutdown set to 2
>
> so previously the code was attempting to reuse the connection but wasn't
> aborting it and thus didn't clear down sk_shutdown.
Hi Andy,
I note that you are adding in two new printk()s. Why should they be
printk(), and not dprintk()? Are you trying to report an exception that
the user needs to be aware of, or is this only debugging info that we'll
want to turn off under normal operation?
Also, it might be useful to add a comment to the code here to remind us
what the 'sk_shutdown == 0' case corresponds to as far as the socket
state is concerned, so that the casual reader can see why we shouldn't
reset the connection.
Cheers
Trond
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" 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
* Re: [PATCH] cfg80211: support sysfs namespaces
From: Eric W. Biederman @ 2010-08-05 19:46 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, linux-wireless, netdev
In-Reply-To: <1281023115.4058.11.camel@jlt3.sipsolutions.net>
Johannes Berg <johannes@sipsolutions.net> writes:
> From: Johannes Berg <johannes.berg@intel.com>
>
> Enable using network namespaces with
> wireless devices even when sysfs is
> enabled using the same infrastructure
> that was built for netdevs.
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
This looks reasonable. I assume you have tested this and it is
working now?
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
> NB: This generates a harmless gcc warning, I submitted
> a patch to fix it here:
> http://thread.gmane.org/gmane.linux.kernel/1019330
>
> include/linux/netdevice.h | 2 ++
> net/core/net-sysfs.c | 3 ++-
> net/wireless/core.c | 7 ++++++-
> net/wireless/sysfs.c | 9 +++++++++
> 4 files changed, 19 insertions(+), 2 deletions(-)
>
> --- wireless-testing.orig/net/core/net-sysfs.c 2010-08-05 17:33:47.000000000 +0200
> +++ wireless-testing/net/core/net-sysfs.c 2010-08-05 17:38:27.000000000 +0200
> @@ -789,12 +789,13 @@ static const void *net_netlink_ns(struct
> return sock_net(sk);
> }
>
> -static struct kobj_ns_type_operations net_ns_type_operations = {
> +struct kobj_ns_type_operations net_ns_type_operations = {
> .type = KOBJ_NS_TYPE_NET,
> .current_ns = net_current_ns,
> .netlink_ns = net_netlink_ns,
> .initial_ns = net_initial_ns,
> };
> +EXPORT_SYMBOL_GPL(net_ns_type_operations);
>
> static void net_kobj_ns_exit(struct net *net)
> {
> --- wireless-testing.orig/net/wireless/sysfs.c 2010-08-05 17:33:47.000000000 +0200
> +++ wireless-testing/net/wireless/sysfs.c 2010-08-05 17:39:11.000000000 +0200
> @@ -110,6 +110,13 @@ static int wiphy_resume(struct device *d
> return ret;
> }
>
> +static const void *wiphy_namespace(struct device *d)
> +{
> + struct wiphy *wiphy = container_of(d, struct wiphy, dev);
> +
> + return wiphy_net(wiphy);
> +}
> +
> struct class ieee80211_class = {
> .name = "ieee80211",
> .owner = THIS_MODULE,
> @@ -120,6 +127,8 @@ struct class ieee80211_class = {
> #endif
> .suspend = wiphy_suspend,
> .resume = wiphy_resume,
> + .ns_type = &net_ns_type_operations,
> + .namespace = wiphy_namespace,
> };
>
> int wiphy_sysfs_init(void)
> --- wireless-testing.orig/net/wireless/core.c 2010-08-05 17:33:47.000000000 +0200
> +++ wireless-testing/net/wireless/core.c 2010-08-05 17:38:27.000000000 +0200
> @@ -253,11 +253,16 @@ int cfg80211_switch_netns(struct cfg8021
> WARN_ON(err);
> wdev->netdev->features |= NETIF_F_NETNS_LOCAL;
> }
> +
> + return err;
> }
>
> wiphy_net_set(&rdev->wiphy, net);
>
> - return err;
> + err = device_rename(&rdev->wiphy.dev, dev_name(&rdev->wiphy.dev));
> + WARN_ON(err);
> +
> + return 0;
> }
>
> static void cfg80211_rfkill_poll(struct rfkill *rfkill, void *data)
> --- wireless-testing.orig/include/linux/netdevice.h 2010-08-05 17:13:50.000000000 +0200
> +++ wireless-testing/include/linux/netdevice.h 2010-08-05 17:39:02.000000000 +0200
> @@ -2171,6 +2171,8 @@ extern void dev_seq_stop(struct seq_file
> extern int netdev_class_create_file(struct class_attribute *class_attr);
> extern void netdev_class_remove_file(struct class_attribute *class_attr);
>
> +extern struct kobj_ns_type_operations net_ns_type_operations;
> +
> extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len);
>
> extern void linkwatch_run_queue(void);
^ permalink raw reply
* Re: [net 0/2] Clean up netfilter cache on xmit-to-self.
From: Ben Greear @ 2010-08-05 19:29 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20100805.115850.58405719.davem@davemloft.net>
On 08/05/2010 11:58 AM, David Miller wrote:
> From: Ben Greear<greearb@candelatech.com>
> Date: Thu, 05 Aug 2010 11:43:37 -0700
>
>> On 07/25/2010 10:01 PM, David Miller wrote:
>>> From: David Miller<davem@davemloft.net>
>>> Date: Sun, 25 Jul 2010 21:59:12 -0700 (PDT)
>>>
>>>> From: Ben Greear<greearb@candelatech.com>
>>>> Date: Thu, 22 Jul 2010 12:54:46 -0700
>>>>
>>>>> These patches are against 2.6.34.1. The first one may be
>>>>> worth submitting to stable. The second one is less critical
>>>>> and should probably just go in the development tree.
>>>>
>>>> I'll apply the first one to net-2.6 and queue up for -stable
>>
>> As far as I can tell, this didn't make it into -stable yet?
>
> It's sitting in my queue, I will send it out once 2.6.35 has been out
> for about 1 week more just to double make sure there aren't any
> unwanted side effects.
>
> I never submit changes to -stable immediately unless the change is
> painfully obvious and has no possible unwanted side effects. I always
> wait a week or even more sometimes.
Ok, no problem. I just wanted to make sure it hadn't been lost.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* null pointer at cls_api.c
From: Franchoze Eric @ 2010-08-05 19:24 UTC (permalink / raw)
To: netdev
Hello, can somebody follow up with approriate fix for that bug? It's reproducible on the latest 2.6.32.17 kernel with Centos5 user land.
Script to reproduce is bellow. I did quick fix for that to show where is the issue.
Thanks.
--- net/sched/cls_api.c_orig 2010-08-05 10:46:01.000000000 -0700
+++ net/sched/cls_api.c 2010-08-05 12:03:01.000000000 -0700
@@ -255,6 +255,11 @@ replay:
kfree(tp);
goto errout;
}
+
+ if (!tp || !tp->ops) {
+ err = -ENOENT;
+ goto errout;
+ }
tp->ops = tp_ops;
tp->protocol = protocol;
tp->prio = nprio ? : TC_H_MAJ(tcf_auto_prio(*back));
#!/bin/bash
DEV=tun1
SPEED="100kbit"
ISPEED="10Mbit"
tc qdisc del dev $DEV root
tc qdisc add dev $DEV root handle 1: htb default 1
tc class add dev $DEV parent 1: classid 1:1 htb rate ${ISPEED}
tc class add dev $DEV parent 1:1 classid 1:2 htb rate ${SPEED} ceil ${SPEED} prio 0
tc qdisc add dev $DEV parent 1:2 handle 2: sfq perturb 10
tc filter add dev $DEV parent 2: protocol ip u32 match ip dport 80 0xffff flowid 2:1
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<(null)>] (null)
PGD 81ca27067 PUD 825b8e067 PMD 0
Oops: 0010 [#1] PREEMPT SMP
last sysfs file: /sys/class/misc/watchdog/dev
CPU 7
Modules linked in: wdt_pci sc520_wdt pcwd_pci i6300esb hpwdt cls_u32 sch_sfq sch_htb lockd sunrpc xt_connlimit xt_MARK iptable_mangle ipt_REDIRECT iptable_nat nf_nat tun ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack xt_tcpudp iptable_filter ip_tables x_tables dm_mirror dm_multipath scsi_dh sbs sbshc power_meter hwmon battery ac tpm_tis serio_raw rtc_cmos rtc_core rtc_lib tpm tpm_bios button tg3 firmware_class libphy amd64_edac_mod edac_core i2c_piix4 i2c_core dm_region_hash dm_log dm_mod sata_svw libata cciss sd_mod scsi_mod ext3 jbd
Pid: 4807, comm: tc Not tainted 2.6.32.17-af #1 ProLiant DL165 G6
RIP: 0010:[<0000000000000000>] [<(null)>] (null)
RSP: 0018:ffff880823547880 EFLAGS: 00010286
RAX: ffffffffa0292b80 RBX: ffff88082484f700 RCX: ffff880823547898
RDX: 0000000000020001 RSI: 0000000000000000 RDI: ffff88082568e000
RBP: ffff8808235478d8 R08: ffff880427c00040 R09: 0000000000000000
R10: 0000000000000000 R11: ffff88082484f7c0 R12: ffff88082546603c
R13: ffff88081ca8f440 R14: ffff88082484f7c0 R15: ffff880823547908
FS: 00007fb0ca8186e0(0000) GS:ffff880436440000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 00000008259ec000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process tc (pid: 4807, threadinfo ffff880823546000, task ffff880824b68800)
Stack:
ffffffffa0299836 ffff8808235478c8 0000000000000000 0000000000000000
<0> ffff88081ca8f440 ffff88082546603c ffff88081ca8f440 ffff88082546603c
<0> 0000000080000800 ffff88082484f700 0000000000000000 ffff880823547998
Call Trace:
[<ffffffffa0299836>] ? u32_set_parms+0xca/0x14f [cls_u32]
[<ffffffffa0299e49>] u32_change+0x316/0x3bd [cls_u32]
[<ffffffffa0299696>] ? kzalloc+0xf/0x11 [cls_u32]
[<ffffffff8126f9e1>] tc_ctl_tfilter+0x505/0x5f6
[<ffffffff810d4fbd>] ? ____cache_alloc+0x1d/0x223
[<ffffffff81262377>] rtnetlink_rcv_msg+0x1c3/0x1e2
[<ffffffff812621b4>] ? rtnetlink_rcv_msg+0x0/0x1e2
[<ffffffff81273273>] netlink_rcv_skb+0x3e/0x8d
[<ffffffff812620aa>] rtnetlink_rcv+0x20/0x29
[<ffffffff812730e8>] netlink_unicast+0xed/0x154
[<ffffffff8127464b>] netlink_sendmsg+0x245/0x258
[<ffffffff812730f8>] ? netlink_unicast+0xfd/0x154
[<ffffffff81248ffc>] __sock_sendmsg+0x59/0x62
[<ffffffff8124988e>] sock_sendmsg+0xc7/0xe0
[<ffffffff810604bb>] ? autoremove_wake_function+0x0/0x38
[<ffffffff810604bb>] ? autoremove_wake_function+0x0/0x38
[<ffffffff8124a345>] ? move_addr_to_kernel+0x40/0x49
[<ffffffff8125254b>] ? verify_iovec+0x4f/0x94
[<ffffffff81249a85>] sys_sendmsg+0x1de/0x24d
[<ffffffff810ae914>] ? lru_cache_add_lru+0x38/0x3d
[<ffffffff810c6468>] ? page_add_new_anon_rmap+0x3a/0x49
[<ffffffff810bee8f>] ? handle_mm_fault+0x5e8/0x602
[<ffffffff8100bb6b>] system_call_fastpath+0x16/0x1b
Code: Bad RIP value.
RIP [<(null)>] (null)
RSP <ffff880823547880>
CR2: 0000000000000000
---[ end trace 62c007c0b888891e ]---
^ permalink raw reply
* [PATCH] ethtool: Provide a default implementation of ethtool_ops::get_drvinfo
From: Ben Hutchings @ 2010-08-05 19:20 UTC (permalink / raw)
To: David Miller; +Cc: rusty, netdev, mst, izumi.taku
In-Reply-To: <20100804.215424.200345652.davem@davemloft.net>
The driver name and bus address for a net_device can normally be found
through the driver model now. Instead of requiring drivers to provide
this information redundantly through the ethtool_ops::get_drvinfo
operation, use the driver model to do so if the driver does not define
the operation. Since ETHTOOL_GDRVINFO no longer requires the driver
to implement any operations, do not require net_device::ethtool_ops to
be set either.
Remove implementations of get_drvinfo and ethtool_ops that provide
only this information.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
On Wed, 2010-08-04 at 21:54 -0700, David Miller wrote:
> From: Ben Hutchings <bhutchings@solarflare.com>
> Date: Thu, 05 Aug 2010 04:47:21 +0100
>
> > On Thu, 2010-08-05 at 13:02 +0930, Rusty Russell wrote:
> >> I often use "ethtool -i" command to check what driver controls the
> >> ehternet device. But because current virtio_net driver doesn't
> >> support "ethtool -i", it becomes the following:
> >>
> >> # ethtool -i eth3
> >> Cannot get driver information: Operation not supported
> >>
> >> This patch simply adds the "ethtool -i" support. The following is the
> >> result when using the virtio_net driver with my patch applied to.
> >>
> >> # ethtool -i eth3
> >> driver: virtio_net
> >> version: N/A
> >> firmware-version: N/A
> >> bus-info: virtio0
> >>
> >> Personally, "-i" is one of the most frequently-used option, and most
> >> network drivers support "ethtool -i", so I think virtio_net also
> >> should do.
> > [...]
> >
> > This information is already available generically through sysfs:
> > basename $(readlink /sys/class/net/eth3/device)
> > basename $(readlink /sys/class/net/eth3/device/driver)
> >
> > Given that, we should either recommend that people use that method
> > instead, or we should add an equivalent default implementation of the
> > get_drvinfo operation.
>
> We've had ethtool for nearly a decade, it's a standard facility and
> it's only wise to have all drivers implement as much of the API as
> possible.
>
> As such I've applied Rusty's patch and I will apply any patch which
> makes a driver more fully provide support for all ethtool facilities.
Here's a patch that should do that for a whole bunch of drivers at once. :-)
This is compile-tested on i386, and I tested that it DTRT if I then
remove the ethtool_ops from sfc. There are a few PowerPC-specific
drivers affected that I have not even compile-tested.
I didn't see the previous patch in your public tree, so I applied it
locally before making this patch.
Ben.
drivers/firewire/net.c | 13 -------------
drivers/ieee1394/eth1394.c | 16 ----------------
drivers/net/bmac.c | 7 -------
drivers/net/fec_mpc52xx.c | 6 ------
drivers/net/pasemi_mac_ethtool.c | 16 ----------------
drivers/net/pcmcia/3c574_cs.c | 13 -------------
drivers/net/pcmcia/axnet_cs.c | 13 -------------
drivers/net/pcmcia/ibmtr_cs.c | 13 -------------
drivers/net/pcmcia/pcnet_cs.c | 16 ----------------
drivers/net/sc92031.c | 11 -----------
drivers/net/tulip/xircom_cb.c | 15 ---------------
drivers/net/usb/hso.c | 9 ---------
drivers/net/usb/kaweth.c | 9 ---------
drivers/net/virtio_net.c | 14 --------------
drivers/net/wireless/ray_cs.c | 16 ----------------
drivers/net/wireless/wl3501_cs.c | 18 ------------------
net/core/ethtool.c | 33 +++++++++++++++++++++++----------
17 files changed, 23 insertions(+), 215 deletions(-)
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index 7142eee..277efb3 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -8,7 +8,6 @@
#include <linux/bug.h>
#include <linux/device.h>
-#include <linux/ethtool.h>
#include <linux/firewire.h>
#include <linux/firewire-constants.h>
#include <linux/highmem.h>
@@ -1359,17 +1358,6 @@ static int fwnet_change_mtu(struct net_device *net, int new_mtu)
return 0;
}
-static void fwnet_get_drvinfo(struct net_device *net,
- struct ethtool_drvinfo *info)
-{
- strcpy(info->driver, KBUILD_MODNAME);
- strcpy(info->bus_info, "ieee1394");
-}
-
-static const struct ethtool_ops fwnet_ethtool_ops = {
- .get_drvinfo = fwnet_get_drvinfo,
-};
-
static const struct net_device_ops fwnet_netdev_ops = {
.ndo_open = fwnet_open,
.ndo_stop = fwnet_stop,
@@ -1388,7 +1376,6 @@ static void fwnet_init_dev(struct net_device *net)
net->hard_header_len = FWNET_HLEN;
net->type = ARPHRD_IEEE1394;
net->tx_queue_len = 10;
- SET_ETHTOOL_OPS(net, &fwnet_ethtool_ops);
}
/* caller must hold fwnet_device_mutex */
diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c
index a4e9dcb..62ab09e 100644
--- a/drivers/ieee1394/eth1394.c
+++ b/drivers/ieee1394/eth1394.c
@@ -58,7 +58,6 @@
#include <linux/tcp.h>
#include <linux/skbuff.h>
#include <linux/bitops.h>
-#include <linux/ethtool.h>
#include <asm/uaccess.h>
#include <asm/delay.h>
#include <asm/unaligned.h>
@@ -173,8 +172,6 @@ static netdev_tx_t ether1394_tx(struct sk_buff *skb,
struct net_device *dev);
static void ether1394_iso(struct hpsb_iso *iso);
-static const struct ethtool_ops ethtool_ops;
-
static int ether1394_write(struct hpsb_host *host, int srcid, int destid,
quadlet_t *data, u64 addr, size_t len, u16 flags);
static void ether1394_add_host(struct hpsb_host *host);
@@ -525,8 +522,6 @@ static void ether1394_init_dev(struct net_device *dev)
dev->header_ops = ðer1394_header_ops;
dev->netdev_ops = ðer1394_netdev_ops;
- SET_ETHTOOL_OPS(dev, ðtool_ops);
-
dev->watchdog_timeo = ETHER1394_TIMEOUT;
dev->flags = IFF_BROADCAST | IFF_MULTICAST;
dev->features = NETIF_F_HIGHDMA;
@@ -1698,17 +1693,6 @@ fail:
return NETDEV_TX_OK;
}
-static void ether1394_get_drvinfo(struct net_device *dev,
- struct ethtool_drvinfo *info)
-{
- strcpy(info->driver, driver_name);
- strcpy(info->bus_info, "ieee1394"); /* FIXME provide more detail? */
-}
-
-static const struct ethtool_ops ethtool_ops = {
- .get_drvinfo = ether1394_get_drvinfo
-};
-
static int __init ether1394_init_module(void)
{
int err;
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c
index 959add2..9322699 100644
--- a/drivers/net/bmac.c
+++ b/drivers/net/bmac.c
@@ -1233,15 +1233,8 @@ static void bmac_reset_and_enable(struct net_device *dev)
}
spin_unlock_irqrestore(&bp->lock, flags);
}
-static void bmac_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
-{
- struct bmac_data *bp = netdev_priv(dev);
- strcpy(info->driver, "bmac");
- strcpy(info->bus_info, dev_name(&bp->mdev->ofdev.dev));
-}
static const struct ethtool_ops bmac_ethtool_ops = {
- .get_drvinfo = bmac_get_drvinfo,
.get_link = ethtool_op_get_link,
};
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index d1a5b17..f04fa98 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -771,11 +771,6 @@ static void mpc52xx_fec_reset(struct net_device *dev)
/* ethtool interface */
-static void mpc52xx_fec_get_drvinfo(struct net_device *dev,
- struct ethtool_drvinfo *info)
-{
- strcpy(info->driver, DRIVER_NAME);
-}
static int mpc52xx_fec_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
@@ -810,7 +805,6 @@ static void mpc52xx_fec_set_msglevel(struct net_device *dev, u32 level)
}
static const struct ethtool_ops mpc52xx_fec_ethtool_ops = {
- .get_drvinfo = mpc52xx_fec_get_drvinfo,
.get_settings = mpc52xx_fec_get_settings,
.set_settings = mpc52xx_fec_set_settings,
.get_link = ethtool_op_get_link,
diff --git a/drivers/net/pasemi_mac_ethtool.c b/drivers/net/pasemi_mac_ethtool.c
index fefa79e..4825959 100644
--- a/drivers/net/pasemi_mac_ethtool.c
+++ b/drivers/net/pasemi_mac_ethtool.c
@@ -90,21 +90,6 @@ pasemi_mac_ethtool_set_settings(struct net_device *netdev,
return phy_ethtool_sset(phydev, cmd);
}
-static void
-pasemi_mac_ethtool_get_drvinfo(struct net_device *netdev,
- struct ethtool_drvinfo *drvinfo)
-{
- struct pasemi_mac *mac;
- mac = netdev_priv(netdev);
-
- /* clear and fill out info */
- memset(drvinfo, 0, sizeof(struct ethtool_drvinfo));
- strncpy(drvinfo->driver, "pasemi_mac", 12);
- strcpy(drvinfo->version, "N/A");
- strcpy(drvinfo->fw_version, "N/A");
- strncpy(drvinfo->bus_info, pci_name(mac->pdev), 32);
-}
-
static u32
pasemi_mac_ethtool_get_msglevel(struct net_device *netdev)
{
@@ -164,7 +149,6 @@ static void pasemi_mac_get_strings(struct net_device *netdev, u32 stringset,
const struct ethtool_ops pasemi_mac_ethtool_ops = {
.get_settings = pasemi_mac_ethtool_get_settings,
.set_settings = pasemi_mac_ethtool_set_settings,
- .get_drvinfo = pasemi_mac_ethtool_get_drvinfo,
.get_msglevel = pasemi_mac_ethtool_get_msglevel,
.set_msglevel = pasemi_mac_ethtool_set_msglevel,
.get_link = ethtool_op_get_link,
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 10ee106..3a3fa26 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -83,7 +83,6 @@ earlier 3Com products.
#include <linux/skbuff.h>
#include <linux/if_arp.h>
#include <linux/ioport.h>
-#include <linux/ethtool.h>
#include <linux/bitops.h>
#include <linux/mii.h>
@@ -239,7 +238,6 @@ static int el3_rx(struct net_device *dev, int worklimit);
static int el3_close(struct net_device *dev);
static void el3_tx_timeout(struct net_device *dev);
static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
-static const struct ethtool_ops netdev_ethtool_ops;
static void set_rx_mode(struct net_device *dev);
static void set_multicast_list(struct net_device *dev);
@@ -286,7 +284,6 @@ static int tc574_probe(struct pcmcia_device *link)
link->conf.ConfigIndex = 1;
dev->netdev_ops = &el3_netdev_ops;
- SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
dev->watchdog_timeo = TX_TIMEOUT;
return tc574_config(link);
@@ -1065,16 +1062,6 @@ static int el3_rx(struct net_device *dev, int worklimit)
return worklimit;
}
-static void netdev_get_drvinfo(struct net_device *dev,
- struct ethtool_drvinfo *info)
-{
- strcpy(info->driver, "3c574_cs");
-}
-
-static const struct ethtool_ops netdev_ethtool_ops = {
- .get_drvinfo = netdev_get_drvinfo,
-};
-
/* Provide ioctl() calls to examine the MII xcvr state. */
static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 33525bf..3003745 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -32,7 +32,6 @@
#include <linux/timer.h>
#include <linux/delay.h>
#include <linux/spinlock.h>
-#include <linux/ethtool.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/crc32.h>
@@ -87,7 +86,6 @@ static netdev_tx_t axnet_start_xmit(struct sk_buff *skb,
static struct net_device_stats *get_stats(struct net_device *dev);
static void set_multicast_list(struct net_device *dev);
static void axnet_tx_timeout(struct net_device *dev);
-static const struct ethtool_ops netdev_ethtool_ops;
static irqreturn_t ei_irq_wrapper(int irq, void *dev_id);
static void ei_watchdog(u_long arg);
static void axnet_reset_8390(struct net_device *dev);
@@ -172,7 +170,6 @@ static int axnet_probe(struct pcmcia_device *link)
dev->netdev_ops = &axnet_netdev_ops;
- SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
dev->watchdog_timeo = TX_TIMEOUT;
return axnet_config(link);
@@ -658,16 +655,6 @@ reschedule:
add_timer(&info->watchdog);
}
-static void netdev_get_drvinfo(struct net_device *dev,
- struct ethtool_drvinfo *info)
-{
- strcpy(info->driver, "axnet_cs");
-}
-
-static const struct ethtool_ops netdev_ethtool_ops = {
- .get_drvinfo = netdev_get_drvinfo,
-};
-
/*====================================================================*/
static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index 67ee985..c02ae65 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -52,7 +52,6 @@
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/module.h>
-#include <linux/ethtool.h>
#include <linux/netdevice.h>
#include <linux/trdevice.h>
#include <linux/ibmtr.h>
@@ -108,16 +107,6 @@ typedef struct ibmtr_dev_t {
struct tok_info *ti;
} ibmtr_dev_t;
-static void netdev_get_drvinfo(struct net_device *dev,
- struct ethtool_drvinfo *info)
-{
- strcpy(info->driver, "ibmtr_cs");
-}
-
-static const struct ethtool_ops netdev_ethtool_ops = {
- .get_drvinfo = netdev_get_drvinfo,
-};
-
static irqreturn_t ibmtr_interrupt(int irq, void *dev_id) {
ibmtr_dev_t *info = dev_id;
struct net_device *dev = info->dev;
@@ -161,8 +150,6 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link)
info->dev = dev;
- SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
-
return ibmtr_config(link);
} /* ibmtr_attach */
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index bfdef72..17c7c66 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -35,7 +35,6 @@
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/delay.h>
-#include <linux/ethtool.h>
#include <linux/netdevice.h>
#include <linux/log2.h>
#include <linux/etherdevice.h>
@@ -101,7 +100,6 @@ static void pcnet_release(struct pcmcia_device *link);
static int pcnet_open(struct net_device *dev);
static int pcnet_close(struct net_device *dev);
static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
-static const struct ethtool_ops netdev_ethtool_ops;
static irqreturn_t ei_irq_wrapper(int irq, void *dev_id);
static void ei_watchdog(u_long arg);
static void pcnet_reset_8390(struct net_device *dev);
@@ -632,8 +630,6 @@ static int pcnet_config(struct pcmcia_device *link)
ei_status.word16 = 1;
ei_status.reset_8390 = &pcnet_reset_8390;
- SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
-
if (info->flags & (IS_DL10019|IS_DL10022))
mii_phy_probe(dev);
@@ -1147,18 +1143,6 @@ reschedule:
/*====================================================================*/
-static void netdev_get_drvinfo(struct net_device *dev,
- struct ethtool_drvinfo *info)
-{
- strcpy(info->driver, "pcnet_cs");
-}
-
-static const struct ethtool_ops netdev_ethtool_ops = {
- .get_drvinfo = netdev_get_drvinfo,
-};
-
-/*====================================================================*/
-
static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c
index 8c4067a..31b92f5 100644
--- a/drivers/net/sc92031.c
+++ b/drivers/net/sc92031.c
@@ -1251,16 +1251,6 @@ static int sc92031_ethtool_set_settings(struct net_device *dev,
return 0;
}
-static void sc92031_ethtool_get_drvinfo(struct net_device *dev,
- struct ethtool_drvinfo *drvinfo)
-{
- struct sc92031_priv *priv = netdev_priv(dev);
- struct pci_dev *pdev = priv->pdev;
-
- strcpy(drvinfo->driver, SC92031_NAME);
- strcpy(drvinfo->bus_info, pci_name(pdev));
-}
-
static void sc92031_ethtool_get_wol(struct net_device *dev,
struct ethtool_wolinfo *wolinfo)
{
@@ -1382,7 +1372,6 @@ static void sc92031_ethtool_get_ethtool_stats(struct net_device *dev,
static const struct ethtool_ops sc92031_ethtool_ops = {
.get_settings = sc92031_ethtool_get_settings,
.set_settings = sc92031_ethtool_set_settings,
- .get_drvinfo = sc92031_ethtool_get_drvinfo,
.get_wol = sc92031_ethtool_get_wol,
.set_wol = sc92031_ethtool_set_wol,
.nway_reset = sc92031_ethtool_nway_reset,
diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c
index a439e93..5a73752 100644
--- a/drivers/net/tulip/xircom_cb.c
+++ b/drivers/net/tulip/xircom_cb.c
@@ -29,7 +29,6 @@
#include <linux/skbuff.h>
#include <linux/delay.h>
#include <linux/init.h>
-#include <linux/ethtool.h>
#include <linux/bitops.h>
#include <asm/uaccess.h>
@@ -181,19 +180,6 @@ static void print_binary(unsigned int number)
}
#endif
-static void netdev_get_drvinfo(struct net_device *dev,
- struct ethtool_drvinfo *info)
-{
- struct xircom_private *private = netdev_priv(dev);
-
- strcpy(info->driver, "xircom_cb");
- strcpy(info->bus_info, pci_name(private->pdev));
-}
-
-static const struct ethtool_ops netdev_ethtool_ops = {
- .get_drvinfo = netdev_get_drvinfo,
-};
-
static const struct net_device_ops netdev_ops = {
.ndo_open = xircom_open,
.ndo_stop = xircom_close,
@@ -279,7 +265,6 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_
setup_descriptors(private);
dev->netdev_ops = &netdev_ops;
- SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
pci_set_drvdata(pdev, dev);
if (register_netdev(dev)) {
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 6efca66..4f123f8 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -843,16 +843,7 @@ static netdev_tx_t hso_net_start_xmit(struct sk_buff *skb,
return NETDEV_TX_OK;
}
-static void hso_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info)
-{
- struct hso_net *odev = netdev_priv(net);
-
- strncpy(info->driver, driver_name, ETHTOOL_BUSINFO_LEN);
- usb_make_path(odev->parent->usb, info->bus_info, sizeof info->bus_info);
-}
-
static const struct ethtool_ops ops = {
- .get_drvinfo = hso_get_drvinfo,
.get_link = ethtool_op_get_link
};
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index 2b7b39c..5e98643 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -759,14 +759,6 @@ static int kaweth_close(struct net_device *net)
return 0;
}
-static void kaweth_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
-{
- struct kaweth_device *kaweth = netdev_priv(dev);
-
- strlcpy(info->driver, driver_name, sizeof(info->driver));
- usb_make_path(kaweth->dev, info->bus_info, sizeof (info->bus_info));
-}
-
static u32 kaweth_get_link(struct net_device *dev)
{
struct kaweth_device *kaweth = netdev_priv(dev);
@@ -775,7 +767,6 @@ static u32 kaweth_get_link(struct net_device *dev)
}
static const struct ethtool_ops ops = {
- .get_drvinfo = kaweth_get_drvinfo,
.get_link = kaweth_get_link
};
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 4598e9d..bb6b67f 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -705,19 +705,6 @@ static int virtnet_close(struct net_device *dev)
return 0;
}
-static void virtnet_get_drvinfo(struct net_device *dev,
- struct ethtool_drvinfo *drvinfo)
-{
- struct virtnet_info *vi = netdev_priv(dev);
- struct virtio_device *vdev = vi->vdev;
-
- strncpy(drvinfo->driver, KBUILD_MODNAME, ARRAY_SIZE(drvinfo->driver));
- strncpy(drvinfo->version, "N/A", ARRAY_SIZE(drvinfo->version));
- strncpy(drvinfo->fw_version, "N/A", ARRAY_SIZE(drvinfo->fw_version));
- strncpy(drvinfo->bus_info, dev_name(&vdev->dev),
- ARRAY_SIZE(drvinfo->bus_info));
-}
-
static int virtnet_set_tx_csum(struct net_device *dev, u32 data)
{
struct virtnet_info *vi = netdev_priv(dev);
@@ -830,7 +817,6 @@ static void virtnet_vlan_rx_kill_vid(struct net_device *dev, u16 vid)
}
static const struct ethtool_ops virtnet_ethtool_ops = {
- .get_drvinfo = virtnet_get_drvinfo,
.set_tx_csum = virtnet_set_tx_csum,
.set_sg = ethtool_op_set_sg,
.set_tso = ethtool_op_set_tso,
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 9c38fc3..0234800 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -43,7 +43,6 @@
#include <linux/if_arp.h>
#include <linux/ioport.h>
#include <linux/skbuff.h>
-#include <linux/ethtool.h>
#include <linux/ieee80211.h>
#include <pcmcia/cs_types.h>
@@ -81,8 +80,6 @@ static int ray_dev_config(struct net_device *dev, struct ifmap *map);
static struct net_device_stats *ray_get_stats(struct net_device *dev);
static int ray_dev_init(struct net_device *dev);
-static const struct ethtool_ops netdev_ethtool_ops;
-
static int ray_open(struct net_device *dev);
static netdev_tx_t ray_dev_start_xmit(struct sk_buff *skb,
struct net_device *dev);
@@ -335,7 +332,6 @@ static int ray_probe(struct pcmcia_device *p_dev)
/* Raylink entries in the device structure */
dev->netdev_ops = &ray_netdev_ops;
- SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
dev->wireless_handlers = &ray_handler_def;
#ifdef WIRELESS_SPY
local->wireless_data.spy_data = &local->spy_data;
@@ -1079,18 +1075,6 @@ AP to AP 1 1 dest AP src AP dest source
}
} /* end encapsulate_frame */
-/*===========================================================================*/
-
-static void netdev_get_drvinfo(struct net_device *dev,
- struct ethtool_drvinfo *info)
-{
- strcpy(info->driver, "ray_cs");
-}
-
-static const struct ethtool_ops netdev_ethtool_ops = {
- .get_drvinfo = netdev_get_drvinfo,
-};
-
/*====================================================================*/
/*------------------------------------------------------------------*/
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index 376c6b9..fda932e 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -29,7 +29,6 @@
#include <linux/delay.h>
#include <linux/types.h>
-#include <linux/ethtool.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/in.h>
@@ -89,13 +88,6 @@
static int wl3501_config(struct pcmcia_device *link);
static void wl3501_release(struct pcmcia_device *link);
-/*
- * The dev_info variable is the "key" that is used to match up this
- * device driver with appropriate cards, through the card configuration
- * database.
- */
-static dev_info_t wl3501_dev_info = "wl3501_cs";
-
static const struct {
int reg_domain;
int min, max, deflt;
@@ -1419,15 +1411,6 @@ static struct iw_statistics *wl3501_get_wireless_stats(struct net_device *dev)
return wstats;
}
-static void wl3501_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
-{
- strlcpy(info->driver, wl3501_dev_info, sizeof(info->driver));
-}
-
-static const struct ethtool_ops ops = {
- .get_drvinfo = wl3501_get_drvinfo
-};
-
/**
* wl3501_detach - deletes a driver "instance"
* @link - FILL_IN
@@ -1914,7 +1897,6 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
this->p_dev = p_dev;
dev->wireless_data = &this->wireless_data;
dev->wireless_handlers = &wl3501_handler_def;
- SET_ETHTOOL_OPS(dev, &ops);
netif_stop_queue(dev);
p_dev->priv = dev;
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 7a85367..d2c4da5 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -205,18 +205,24 @@ static noinline_for_stack int ethtool_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo info;
const struct ethtool_ops *ops = dev->ethtool_ops;
- if (!ops->get_drvinfo)
- return -EOPNOTSUPP;
-
memset(&info, 0, sizeof(info));
info.cmd = ETHTOOL_GDRVINFO;
- ops->get_drvinfo(dev, &info);
+ if (ops && ops->get_drvinfo) {
+ ops->get_drvinfo(dev, &info);
+ } else if (dev->dev.parent && dev->dev.parent->driver) {
+ strlcpy(info.bus_info, dev_name(dev->dev.parent),
+ sizeof(info.bus_info));
+ strlcpy(info.driver, dev->dev.parent->driver->name,
+ sizeof(info.driver));
+ } else {
+ return -EOPNOTSUPP;
+ }
/*
* this method of obtaining string set info is deprecated;
* Use ETHTOOL_GSSET_INFO instead.
*/
- if (ops->get_sset_count) {
+ if (ops && ops->get_sset_count) {
int rc;
rc = ops->get_sset_count(dev, ETH_SS_TEST);
@@ -229,9 +235,9 @@ static noinline_for_stack int ethtool_get_drvinfo(struct net_device *dev,
if (rc >= 0)
info.n_priv_flags = rc;
}
- if (ops->get_regs_len)
+ if (ops && ops->get_regs_len)
info.regdump_len = ops->get_regs_len(dev);
- if (ops->get_eeprom_len)
+ if (ops && ops->get_eeprom_len)
info.eedump_len = ops->get_eeprom_len(dev);
if (copy_to_user(useraddr, &info, sizeof(info)))
@@ -1402,12 +1408,19 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
if (!dev || !netif_device_present(dev))
return -ENODEV;
- if (!dev->ethtool_ops)
- return -EOPNOTSUPP;
-
if (copy_from_user(ðcmd, useraddr, sizeof(ethcmd)))
return -EFAULT;
+ if (!dev->ethtool_ops) {
+ /* ETHTOOL_GDRVINFO does not require any driver support.
+ * It is also unprivileged and does not change anything,
+ * so we can take a shortcut to it. */
+ if (ethcmd == ETHTOOL_GDRVINFO)
+ return ethtool_get_drvinfo(dev, useraddr);
+ else
+ return -EOPNOTSUPP;
+ }
+
/* Allow some commands to be done by anyone */
switch (ethcmd) {
case ETHTOOL_GDRVINFO:
--
1.6.2.5
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply related
* Re: [PATCH] Fix napi_gro_frags vs netpoll path
From: David Miller @ 2010-08-05 19:01 UTC (permalink / raw)
To: jarkao2; +Cc: herbert, netdev, xiaohui.xin
In-Reply-To: <20100805114944.GA21894@ff.dom.local>
From: Jarek Poplawski <jarkao2@gmail.com>
Date: Thu, 5 Aug 2010 11:49:44 +0000
> On Thu, Aug 05, 2010 at 07:40:59PM +0800, Herbert Xu wrote:
>> On Thu, Aug 05, 2010 at 11:03:55AM +0000, Jarek Poplawski wrote:
>> >
>> > The netpoll_rx_on() check in dev_gro_receive() skips part of the
>> > "common" GRO_NORMAL path, especially "pull:" in dev_gro_receive(),
>> > where at least eth header should be copied for entirely paged skbs.
>> >
>> > Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
>>
>> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
>
> I hope, David will use it with a nearby v2 (the changelog fixed).
I will :-)
^ permalink raw reply
* Re: [net 0/2] Clean up netfilter cache on xmit-to-self.
From: David Miller @ 2010-08-05 18:58 UTC (permalink / raw)
To: greearb; +Cc: netdev
In-Reply-To: <4C5B0659.7020105@candelatech.com>
From: Ben Greear <greearb@candelatech.com>
Date: Thu, 05 Aug 2010 11:43:37 -0700
> On 07/25/2010 10:01 PM, David Miller wrote:
>> From: David Miller<davem@davemloft.net>
>> Date: Sun, 25 Jul 2010 21:59:12 -0700 (PDT)
>>
>>> From: Ben Greear<greearb@candelatech.com>
>>> Date: Thu, 22 Jul 2010 12:54:46 -0700
>>>
>>>> These patches are against 2.6.34.1. The first one may be
>>>> worth submitting to stable. The second one is less critical
>>>> and should probably just go in the development tree.
>>>
>>> I'll apply the first one to net-2.6 and queue up for -stable
>
> As far as I can tell, this didn't make it into -stable yet?
It's sitting in my queue, I will send it out once 2.6.35 has been out
for about 1 week more just to double make sure there aren't any
unwanted side effects.
I never submit changes to -stable immediately unless the change is
painfully obvious and has no possible unwanted side effects. I always
wait a week or even more sometimes.
^ permalink raw reply
* Re:await your response
From: Mr Jeryy Ntai @ 2010-08-05 18:47 UTC (permalink / raw)
To: info
Although you might be apprehensive about my email as we have not met before, My name is Mr.Jerry Ntai, Head of Operation Mevas
Bank,Hong Kong.I have a secured business proposal in the tune of $21.5m for you to handle with me from my bank.
---- Nuova grafica e nuove funzionalità! Crea subito Gratis la tua nuova Casella di Posta Katamail
^ permalink raw reply
* Re: [net 0/2] Clean up netfilter cache on xmit-to-self.
From: Ben Greear @ 2010-08-05 18:43 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20100725.220104.59695038.davem@davemloft.net>
On 07/25/2010 10:01 PM, David Miller wrote:
> From: David Miller<davem@davemloft.net>
> Date: Sun, 25 Jul 2010 21:59:12 -0700 (PDT)
>
>> From: Ben Greear<greearb@candelatech.com>
>> Date: Thu, 22 Jul 2010 12:54:46 -0700
>>
>>> These patches are against 2.6.34.1. The first one may be
>>> worth submitting to stable. The second one is less critical
>>> and should probably just go in the development tree.
>>
>> I'll apply the first one to net-2.6 and queue up for -stable
As far as I can tell, this didn't make it into -stable yet?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* RE: Receive processing stops when dev->poll returns 1
From: Usha Srinivasan @ 2010-08-05 18:11 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev@vger.kernel.org
In-Reply-To: <20100805103715.7d720cb0@nehalam>
Stephen,
The min is inside a while loop; it is purely used to limit the number of completions that are retrieved at-a-time. The outer while loops ensuring that all the completions are handled until budget is reached or there are no completions left. Please look again at the code I sent you.
Usha
-----Original Message-----
From: Stephen Hemminger [mailto:shemminger@vyatta.com]
Sent: Thursday, August 05, 2010 1:37 PM
To: Usha Srinivasan
Cc: netdev@vger.kernel.org
Subject: Re: Receive processing stops when dev->poll returns 1
On Thu, 5 Aug 2010 11:36:26 -0500
Usha Srinivasan <usha.srinivasan@qlogic.com> wrote:
> int max = (budget - done);
> t = min(<max-supported-by-driver>, max);
> n = get-completions(comp_list);
You need to handle all completions pending in the poll, the code will
not call you back. So this min() is the problem.
--
^ permalink raw reply
* Re: [PATCH] platform: Facilitate the creation of pseduo-platform busses
From: Patrick Pannuto @ 2010-08-05 17:43 UTC (permalink / raw)
To: Magnus Damm
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-omap@vger.kernel.org, damm@opensource.se,
lethal@linux-sh.org, rjw@sisk.pl, eric.y.miao@gmail.com,
netdev@vger.kernel.org, Greg Kroah-Hartman, alan, zt.tmzt
In-Reply-To: <AANLkTimkMy6_201XNGb41e7LivkvVHMkFZWVoA-7UmBo@mail.gmail.com>
On 08/04/2010 07:32 PM, Magnus Damm wrote:
> On Thu, Aug 5, 2010 at 7:14 AM, Patrick Pannuto <ppannuto@codeaurora.org> wrote:
>> Inspiration for this comes from:
>> http://www.mail-archive.com/linux-omap@vger.kernel.org/msg31161.html
>>
>> RFC: http://lkml.org/lkml/2010/8/3/496
>> Patch is unchanged from the RFC. Reviews seemed generally positive
>> and it seemed this was desired functionality.
>
> Thanks for your patch, it's really nice to see work done in this area!
> I'd like to see something like this merged in the not so distant
> future. At this point I'm not so concerned about the details, so I'll
> restrict myself to this:
>
>> /drivers/my_driver.c
>> static struct platform_driver my_driver = {
>> .driver = {
>> .name = "my-driver",
>> .owner = THIS_MODULE,
>> .bus = &my_bus_type,
>> },
>> };
>
> I would really prefer not to have the bus type in the here. I
> understand it's needed at this point, but I wonder if it's possible to
> adjust the device<->driver matching for platform devices to allow any
> type of pseudo-platform bus_type.
>
> The reason why I'd like to avoid having the bus type in the driver is
> that I'd like to reuse the platform driver across multiple
> architectures and buses. For instance, on the SH architecture and
So would I :). That's where this was all heading eventually, I was just
originally doing it in two passes. I have some ideas for how to do this
and will try to send out a patchset either today or tomorrow.
> SH-Mobile ARM we have SoCs with SCIF hardware blocks driven by the
> sh-sci.c serial driver. The sh-sci.c platform driver supports a wide
> range of different SCI(F)(A)(B) hardware blocks, and on any given SoC
> there is a mix of SCIF blocks spread out on different buses.
>
> At this point our SH platform drivers are unaware where their driver
> instanced are located on the SoC. The I/O address and IRQs are
> assigned via struct resource and clocks are managed through clkdev. I
> believe that adding the bus type in the driver will violate this
> abstraction and make it more difficult to just instantiate a driver
> somewhere on the SoC.
>
>> /somewhere/my_device.c
>> static struct platform_device my_device = {
>> .name = "my-device",
>> .id = -1,
>> .dev.bus = &my_bus_type,
>> .dev.parent = &sub_bus_1.dev,
>> };
>
> This I don't mind at all. Actually, this is the place where the
> topology should be defined IMO.
>
Agreed.
> Cheers,
>
> / magnus
--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
^ permalink raw reply
* Re: Receive processing stops when dev->poll returns 1
From: Stephen Hemminger @ 2010-08-05 17:37 UTC (permalink / raw)
To: Usha Srinivasan; +Cc: netdev@vger.kernel.org
In-Reply-To: <7866DA1F8D2D4541B87FEE88E633ABAA2B72081FE6@MNEXMB1.qlogic.org>
On Thu, 5 Aug 2010 11:36:26 -0500
Usha Srinivasan <usha.srinivasan@qlogic.com> wrote:
> int max = (budget - done);
> t = min(<max-supported-by-driver>, max);
> n = get-completions(comp_list);
You need to handle all completions pending in the poll, the code will
not call you back. So this min() is the problem.
--
^ permalink raw reply
* Re: NET_NS: unregister_netdevice: waiting for lo to become free (after using openvpn)
From: Ben Greear @ 2010-08-05 16:57 UTC (permalink / raw)
To: Eric W. Biederman
Cc: Michael Leun, Greg KH, netdev, davem, linux-kernel,
Alexey Dobriyan, Patrick McHardy
In-Reply-To: <m1y6clz8ta.fsf_-_@fess.ebiederm.org>
On 08/05/2010 02:51 AM, Eric W. Biederman wrote:
> Michael Leun<lkml20100708@newton.leun.net> writes:
>> Unfortunately looks like indefinitely. Never watched longer so far
>> (rebooted soon), but I'm seeing this message now repeated every 10 secs
>> for ~10 minutes on a idle system.
>
> Ugh. A real bug then. These can be a pain to track down and fix. I
> think the last one of these I tracked down took a couple of weeks. I
> will start digging in when I get back from vacation.
I once spent a similar amount of time putting in debug variants that
printed info for each time a netdev was acquired and released.
Maybe a similar logic could be put into the official kernel (and
disabled by default)?
That should save effort in the long run, I'd think.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ 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