* [net-next PATCH] net: codel: Avoid undefined behavior from signed overflow
From: Jesper Dangaard Brouer @ 2013-10-30 17:23 UTC (permalink / raw)
To: netdev; +Cc: Eric Dumazet, Paul E. McKenney, Dave Taht, Jesper Dangaard Brouer
From: Jesper Dangaard Brouer <netoptimizer@brouer.com>
As described in commit 5a581b367 (jiffies: Avoid undefined
behavior from signed overflow), according to the C standard
3.4.3p3, overflow of a signed integer results in undefined
behavior.
To fix this, do as the above commit, and do an unsigned
subtraction, and interpreting the result as a signed
two's-complement number. This is based on the theory from
RFC 1982 and is nicely described in wikipedia here:
https://en.wikipedia.org/wiki/Serial_number_arithmetic#General_Solution
A side-note, I have seen practical issues with the previous logic
when dealing with 16-bit, on a 64-bit machine (gcc version
4.4.5). This were 32-bit, which I have not observed issues with.
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Jesper Dangaard Brouer <netoptimizer@brouer.com>
---
include/net/codel.h | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/net/codel.h b/include/net/codel.h
index 389cf62..700fcdf 100644
--- a/include/net/codel.h
+++ b/include/net/codel.h
@@ -72,10 +72,10 @@ static inline codel_time_t codel_get_time(void)
return ns >> CODEL_SHIFT;
}
-#define codel_time_after(a, b) ((s32)(a) - (s32)(b) > 0)
-#define codel_time_after_eq(a, b) ((s32)(a) - (s32)(b) >= 0)
-#define codel_time_before(a, b) ((s32)(a) - (s32)(b) < 0)
-#define codel_time_before_eq(a, b) ((s32)(a) - (s32)(b) <= 0)
+#define codel_time_after(a, b) ((s32)((a) - (b)) > 0)
+#define codel_time_after_eq(a, b) ((s32)((a) - (b)) >= 0)
+#define codel_time_before(a, b) ((s32)((a) - (b)) < 0)
+#define codel_time_before_eq(a, b) ((s32)((a) - (b)) <= 0)
/* Qdiscs using codel plugin must use codel_skb_cb in their own cb[] */
struct codel_skb_cb {
^ permalink raw reply related
* Re: [PATCH 1/4 net-next] net: phy: add Generic Netlink Ethernet switch configuration API
From: Lennert Buytenhek @ 2013-10-30 17:34 UTC (permalink / raw)
To: Jamal Hadi Salim, Felix Fietkau
Cc: Florian Fainelli, Neil Horman, John Fastabend, netdev,
David Miller, Sascha Hauer, John Crispin, Jonas Gorski,
Gary Thomas, Vlad Yasevich, Stephen Hemminger, Chris Healy
In-Reply-To: <20131030172756.GM8570@wantstofly.org>
On Wed, Oct 30, 2013 at 06:27:56PM +0100, Lennert Buytenhek wrote:
> > >This means that all per-port netdevs will be dummy ports which don't
> > >include the data path.
>
> And I think that's fine.
>
> Look, even if you're not going to address data traffic to individual
> ports on your switch chip, there's still a plethora of per-port
> operations that you want to be able to do: administratively setting
> the link state on ports up and down, controlling autonegotiation and
> other PHY settings on individual ports, etc.
>
> You can either let the administrator do this with the standard ifconfig
> / ip link / ethtool tools, or you can make up a parallel API and
> corresponding set of userland tools to duplicate most of the existing
> functionality -- I know which option I prefer.
>
> Presenting each switch port as an individual Linux netdevice to the OS
> is an orthogonal decision to actually using those netdevices for data
> traffic, and conflating the two by arguing that you need special tools
> to do per-port operations for the sole reason that your switch chip
> cannot address individual ports is a rather confused argument.
Forgot to add: there's a patch for net/dsa that adds exactly such an
option. We called it 'unmanaged' mode, and it doesn't enable packet
tagging on the CPU<->switch chip interface, so that data only ever
flows over a single network interface ("eth0"), while the other
("dummy") network interfaces ("port1", "port2", etc) are used for
setting link state with ip link, setting PHY settings with ethtool,
getting ethtool statistics, etc, with 100% unmodified userland tools.
This patch is currently buried inside a vendor tree, but I'd be happy
to dig it out and submit it.
^ permalink raw reply
* Re: [PATCH 1/4 net-next] net: phy: add Generic Netlink Ethernet switch configuration API
From: Lennert Buytenhek @ 2013-10-30 17:27 UTC (permalink / raw)
To: Jamal Hadi Salim, Felix Fietkau
Cc: Florian Fainelli, Neil Horman, John Fastabend, netdev,
David Miller, Sascha Hauer, John Crispin, Jonas Gorski,
Gary Thomas, Vlad Yasevich, Stephen Hemminger, Chris Healy
In-Reply-To: <526EEAE9.6090508@mojatatu.com>
I didn't follow the rest of this thread, but..
On Mon, Oct 28, 2013 at 06:53:29PM -0400, Jamal Hadi Salim wrote:
> >That question does not make any sense to me. Aside from low level
> >control frames like pause frames for flow control, the switch has no
> >need to send packets to the CPU port on its own.
..a lot of people want to be able to do Spanning Tree, LLDP, 802.1x,
you name it, on their routers and access points, and that requires
that your CPU can send/receive packets to/from individual ports on
your switch chip. In a lot of markets, your product is a non-starter
if it can't provide any or all of the above. Excluding this entire
class of use cases _by software design_ is somewhat myopic and stupid.
(It's a different thing if your switch chip is dumb and can't actually
address individual ports, but then there's still no reason to impose
the same restrictions on your software design.)
> >DSA does this, and last time I looked, it pushes *all* bridge traffic
> >through the CPU, making it completely unusable for slower embedded CPUs.
>
> [...]
>
> >If I remember correctly, adding support 'bridge acceleration' was left
> >as an exercise for the reader and never actually implemented.
This patch does exactly that:
http://patchwork.ozlabs.org/patch/16578/
This patch is in production use in a couple of million DSL gateways,
as well as in a bunch of airplane in-flight entertainment systems, so
by all means I would say that it works rather well.
If there is renewed interest in having such functionality upstream,
I would be happy to update the patch and submit it for inclusion.
> >Sure, this could be fixed somehow, but even then the model and
> >assumptions that DSA is built on simply don't work for some of the
> >dumber switches that we support.
What model and assumptions would those be?
> >One of the currently very common switches in many embedded devices is
> >the RTL8366/RTL8367. It has some flexibility when it comes to
> >configuring VLANs, and it's one of the few ones where you can configure
> >a forwarding table for a VLAN (which spans multiple ports), which allows
> >software bridging between multiple VLANs.
> >However, what this switch does *not* support is adding a header/trailer
> >to packets to indicate the originating port.
The ingress/egress port doesn't _have_ to be conveyed in the data
packets themselves.
>From a quick look at the RTL8366 datasheet, you can control the
egress port by creating a temporary MAC address table entry (this
seems to work both for unicast and multicast packets).
Admittedly, I didn't have a very thorough look at the datasheet,
but it also mentions the Spanning Tree protocol, and contains this
remark related to receiving BPDUs: "The CPU port should carry the
ingress port number of the receiving BPDU.". If this switch chip
can't do per-port addressing, how can it actually ever speak STP
at all? Is the datasheet just lying about this?
> >This means that all per-port netdevs will be dummy ports which don't
> >include the data path.
And I think that's fine.
Look, even if you're not going to address data traffic to individual
ports on your switch chip, there's still a plethora of per-port
operations that you want to be able to do: administratively setting
the link state on ports up and down, controlling autonegotiation and
other PHY settings on individual ports, etc.
You can either let the administrator do this with the standard ifconfig
/ ip link / ethtool tools, or you can make up a parallel API and
corresponding set of userland tools to duplicate most of the existing
functionality -- I know which option I prefer.
Presenting each switch port as an individual Linux netdevice to the OS
is an orthogonal decision to actually using those netdevices for data
traffic, and conflating the two by arguing that you need special tools
to do per-port operations for the sole reason that your switch chip
cannot address individual ports is a rather confused argument.
> My view is that netdevs are still valuable even if only they get
> used for control path. Like you said earlier - you can still pull
> stats, flow control messages still make it through etc. They provide
> you
> the consistent api to configure the switch above, ex:
> If i was to use the FDB api for this switch as long as i can
> abstract it in software as a bridge, I could send it a switch config
> via its ops which says:
> "I am giving you this entry with vland 400 for port 2, but i want you to
> send it to the hardware not to your local entry"
Fully agreed on this.
> >So let's say you have a configuration where you're using VLAN ID 4 on
> >port 1, and you want to bridge it to VLAN ID 400 on port 2.
> >
> >Sounds easy enough, you can easily create a bridge that spans port1.4
> >and port2.400. Except, this particular switch (like pretty much any
> >other switch supported by swconfig) isn't actually able to handle such a
> >configuration on its own.
Neither can DSA switch chips.
You can always find things that Linux can do that your switch chip
cannot (e.g. stateful firewalling between ports), and that isn't much
of an argument for or against anything.
> >With swconfig, you create two VLANs: VLAN 4, containing CPU and port1;
> >VLAN 400, containing CPU and port2. You then create a software bridge
> >between eth0.4 and eth0.400 (assuming eth0 is the NIC connected to the
> >switch).
With DSA, you would bridge between port1.4 and port2.400. I'm still
not sure what your argument is arguing for or against.
> >In a different scenario, the code would also have to detect
> >configurations that the switch isn't able to handle, e.g.: bridging
> >port1.4 to eth1 and port2.4 to eth2.
> >Such a configuration wouldn't work at all with such a switch, because
> >the CPU isn't able to tell apart traffic from port1 and port2, and
> >there's no way to tell the switch that port1.4 and port2.4 should not be
> >connected to each other, but both should go to the CPU.
And it's quite easy to detect what your switch chip can do and offload
that part to the hardware, and keep doing the rest in software.
> >Trying to make all of these cases work in the code will make the whole
> >thing a lot more difficult to deal with and maintain. It will also make
> >it much harder for the user to figure out, what configurations work, and
> >what configurations don't.
It's actually quite easy, and certainly a lot less total effort than
forcing all of your users to learn a new set of userland tools (unless
you're not aiming to ever have a lot of users, that is..).
thanks,
Lennert
^ permalink raw reply
* Re: [PATCH v2 net-next] net: introduce gro_frag_list_enable sysctl
From: Jerry Chu @ 2013-10-30 17:39 UTC (permalink / raw)
To: Herbert Xu
Cc: Eric Dumazet, David Miller, Christoph Paasch,
netdev@vger.kernel.org, Michael Dalton
In-Reply-To: <20131030044212.GA3364@gondor.apana.org.au>
On Tue, Oct 29, 2013 at 9:42 PM, Herbert Xu <herbert@gondor.apana.org.au> wrote:
>
> On Tue, Oct 29, 2013 at 09:34:41PM -0700, Eric Dumazet wrote:
> >
> > What matters ?
> >
> > GRO ?
>
> What matters is that you should not treat the forwarding case
> separately from the host case.
>
> For virtualisation the host case looks exactly like the forwarding
> case.
Not sure I agree - there are two different "forwarding" cases - forwarding
to another physical NIC (to go out to the wire hence need to do GSO),
and (for virtualization) forwarding to a virtual NIC and consumed internally
(e.g., VM). For the latter we should strive to push GSO pkts all the way
to the VM stack w/o breaking them up. So for virtualization GRO is all
goodness but not sure about the regular forwarding path. (From the
perf perspective it boils down to if the cost of GSO/GRO will offset
the benefit of GRO. Sure if one manages to get the cost close to zero
than there is not reason to leave GRO always on. But it's still a big if for
now.)
Best,
Jerry
>
>
> IOW, if having a 64KB packet matters for the host, then it matters
> for forwarding as well.
>
> > Before my patch, GRO packets were 17 MSS, and nobody complained packets
> > were too small, so what are you saying exactly ?
>
> I'm not criticsing your mega-GRO patch at all. That one is great
> and means that we'll get aggregated packets up to 64K. What we need
> to do is just to patch up the GSO code so that it can handle these
> mega-packets properly.
>
> Cheers,
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH 1/4 net-next] net: phy: add Generic Netlink Ethernet switch configuration API
From: John Fastabend @ 2013-10-30 17:56 UTC (permalink / raw)
To: Lennert Buytenhek
Cc: Jamal Hadi Salim, Felix Fietkau, Florian Fainelli, Neil Horman,
netdev, David Miller, Sascha Hauer, John Crispin, Jonas Gorski,
Gary Thomas, Vlad Yasevich, Stephen Hemminger, Chris Healy
In-Reply-To: <20131030173416.GA32234@wantstofly.org>
On 10/30/2013 10:34 AM, Lennert Buytenhek wrote:
> On Wed, Oct 30, 2013 at 06:27:56PM +0100, Lennert Buytenhek wrote:
>
>>>> This means that all per-port netdevs will be dummy ports which don't
>>>> include the data path.
>>
>> And I think that's fine.
>>
>> Look, even if you're not going to address data traffic to individual
>> ports on your switch chip, there's still a plethora of per-port
>> operations that you want to be able to do: administratively setting
>> the link state on ports up and down, controlling autonegotiation and
>> other PHY settings on individual ports, etc.
>>
>> You can either let the administrator do this with the standard ifconfig
>> / ip link / ethtool tools, or you can make up a parallel API and
>> corresponding set of userland tools to duplicate most of the existing
>> functionality -- I know which option I prefer.
>>
>> Presenting each switch port as an individual Linux netdevice to the OS
>> is an orthogonal decision to actually using those netdevices for data
>> traffic, and conflating the two by arguing that you need special tools
>> to do per-port operations for the sole reason that your switch chip
>> cannot address individual ports is a rather confused argument.
>
> Forgot to add: there's a patch for net/dsa that adds exactly such an
> option. We called it 'unmanaged' mode, and it doesn't enable packet
> tagging on the CPU<->switch chip interface, so that data only ever
> flows over a single network interface ("eth0"), while the other
> ("dummy") network interfaces ("port1", "port2", etc) are used for
> setting link state with ip link, setting PHY settings with ethtool,
> getting ethtool statistics, etc, with 100% unmodified userland tools.
> This patch is currently buried inside a vendor tree, but I'd be happy
> to dig it out and submit it.
>
A "dummy" network interface is something I've been thinking about
for SR-IOV as well. In the SR-IOV case we have an embedded bridge
in the hardware but the virtual functions may be direct assigned
to a guest and not visible to the host.
It would be easier to manage the ports and assign them to different
bridge/QOS objects (OVS, bridge, nftables) if the ports were visible
and manageable in the host even though there is no data path. Today
we special ndo ops that only work for VFs but this is a bit clumsy
and gets more clumsy as the nic switch becomes more like a real switch.
.John
^ permalink raw reply
* Re: [PATCH 1/4 net-next] net: phy: add Generic Netlink Ethernet switch configuration API
From: John Fastabend @ 2013-10-30 17:56 UTC (permalink / raw)
To: Lennert Buytenhek
Cc: Jamal Hadi Salim, Felix Fietkau, Florian Fainelli, Neil Horman,
netdev, David Miller, Sascha Hauer, John Crispin, Jonas Gorski,
Gary Thomas, Vlad Yasevich, Stephen Hemminger, Chris Healy
In-Reply-To: <20131030173416.GA32234@wantstofly.org>
On 10/30/2013 10:34 AM, Lennert Buytenhek wrote:
> On Wed, Oct 30, 2013 at 06:27:56PM +0100, Lennert Buytenhek wrote:
>
>>>> This means that all per-port netdevs will be dummy ports which don't
>>>> include the data path.
>>
>> And I think that's fine.
>>
>> Look, even if you're not going to address data traffic to individual
>> ports on your switch chip, there's still a plethora of per-port
>> operations that you want to be able to do: administratively setting
>> the link state on ports up and down, controlling autonegotiation and
>> other PHY settings on individual ports, etc.
>>
>> You can either let the administrator do this with the standard ifconfig
>> / ip link / ethtool tools, or you can make up a parallel API and
>> corresponding set of userland tools to duplicate most of the existing
>> functionality -- I know which option I prefer.
>>
>> Presenting each switch port as an individual Linux netdevice to the OS
>> is an orthogonal decision to actually using those netdevices for data
>> traffic, and conflating the two by arguing that you need special tools
>> to do per-port operations for the sole reason that your switch chip
>> cannot address individual ports is a rather confused argument.
>
> Forgot to add: there's a patch for net/dsa that adds exactly such an
> option. We called it 'unmanaged' mode, and it doesn't enable packet
> tagging on the CPU<->switch chip interface, so that data only ever
> flows over a single network interface ("eth0"), while the other
> ("dummy") network interfaces ("port1", "port2", etc) are used for
> setting link state with ip link, setting PHY settings with ethtool,
> getting ethtool statistics, etc, with 100% unmodified userland tools.
> This patch is currently buried inside a vendor tree, but I'd be happy
> to dig it out and submit it.
>
A "dummy" network interface is something I've been thinking about
for SR-IOV nics as well. In the SR-IOV case we have an embedded bridge
in the hardware but the virtual functions may be direct assigned
to a guest and not visible to the host.
It would be easier to manage the ports and assign them to different
bridge/QOS objects (OVS, bridge, nftables) if the ports were visible
and manageable in the host even though there is no data path. Today
we special ndo ops that only work for VFs but this is a bit clumsy
and gets more clumsy as the nic switch becomes more like a real switch.
.John
^ permalink raw reply
* Re: [net-next PATCH] net: codel: Avoid undefined behavior from signed overflow
From: Eric Dumazet @ 2013-10-30 18:01 UTC (permalink / raw)
To: Jesper Dangaard Brouer; +Cc: netdev, Paul E. McKenney, Dave Taht
In-Reply-To: <20131030172341.19203.93490.stgit@dragon>
On Wed, 2013-10-30 at 18:23 +0100, Jesper Dangaard Brouer wrote:
> From: Jesper Dangaard Brouer <netoptimizer@brouer.com>
>
> As described in commit 5a581b367 (jiffies: Avoid undefined
> behavior from signed overflow), according to the C standard
> 3.4.3p3, overflow of a signed integer results in undefined
> behavior.
>
> To fix this, do as the above commit, and do an unsigned
> subtraction, and interpreting the result as a signed
> two's-complement number. This is based on the theory from
> RFC 1982 and is nicely described in wikipedia here:
> https://en.wikipedia.org/wiki/Serial_number_arithmetic#General_Solution
>
> A side-note, I have seen practical issues with the previous logic
> when dealing with 16-bit, on a 64-bit machine (gcc version
> 4.4.5). This were 32-bit, which I have not observed issues with.
>
> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Signed-off-by: Jesper Dangaard Brouer <netoptimizer@brouer.com>
> ---
>
> include/net/codel.h | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/include/net/codel.h b/include/net/codel.h
> index 389cf62..700fcdf 100644
> --- a/include/net/codel.h
> +++ b/include/net/codel.h
> @@ -72,10 +72,10 @@ static inline codel_time_t codel_get_time(void)
> return ns >> CODEL_SHIFT;
> }
>
> -#define codel_time_after(a, b) ((s32)(a) - (s32)(b) > 0)
> -#define codel_time_after_eq(a, b) ((s32)(a) - (s32)(b) >= 0)
> -#define codel_time_before(a, b) ((s32)(a) - (s32)(b) < 0)
> -#define codel_time_before_eq(a, b) ((s32)(a) - (s32)(b) <= 0)
> +#define codel_time_after(a, b) ((s32)((a) - (b)) > 0)
> +#define codel_time_after_eq(a, b) ((s32)((a) - (b)) >= 0)
> +#define codel_time_before(a, b) ((s32)((a) - (b)) < 0)
> +#define codel_time_before_eq(a, b) ((s32)((a) - (b)) <= 0)
>
I see nothing enforcing an unsigned subtraction as claimed in your
changelog.
a / b could be signed.
Paul commit 5a581b367b5 was OK because of existing typecheck(unsigned
long, ....)
^ permalink raw reply
* Re: [BUG 3.12.rc4] Oops: unable to handle kernel paging request during shutdown
From: Pablo Neira Ayuso @ 2013-10-30 18:04 UTC (permalink / raw)
To: Linus Torvalds
Cc: Thomas Gleixner, Patrick McHardy, Jozsef Kadlecsik, David Miller,
Knut Petersen, Ingo Molnar, Paul McKenney,
Frédéric Weisbecker, Greg KH, linux-kernel,
Network Development, netfilter-devel
In-Reply-To: <CA+55aFxuVpDo3LvmG9j-Hu7sENLTcsB6_CY2TA4mE-k+CuTeGg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2059 bytes --]
On Sun, Oct 27, 2013 at 08:39:47PM +0000, Linus Torvalds wrote:
> On Sun, Oct 27, 2013 at 8:20 PM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > Appended is a warning I get with DEBUG_TIMER_OBJECTS. Seems to be a
> > device-mapper issue.
>
> .. and here's another one. This time it looks like nf_conntrack_free()
> is freeing something that has a delayed work in it (again, likely an
> embedded 'struct kobject'). Looks like it is the
>
> kmem_cache_destroy(net->ct.nf_conntrack_cachep);
>
> that triggers this. Which probably means that there are still slab
> entries on that slab cache or something, but I didn't dig any deeper..
>
> David? Patrick? Pablo? Jozsef? Any ideas? This was immediately preceded by
>
> [ 1136.316280] kobject: 'nf_conntrack_ffff8800b74d0000'
> (ffff8801196fac78): kobject_uevent_env
> [ 1136.316287] kobject: 'nf_conntrack_ffff8800b74d0000'
> (ffff8801196fac78): fill_kobj_path: path =
> '/kernel/slab/nf_conntrack_ffff8800b74d0000'
> [ 1136.316331] kobject: 'nf_conntrack_ffff8800b74d0000'
> (ffff8801196fac78): kobject_release, parent (null) (delayed)
>
> and I think it's that delayed "kobject_release()" that triggers this.
>
> Notice that kobject_release() can be delayed *without* the magic
> kobject debugging option by simply having a reference count on it from
> some external source. So this particular issue is probably triggered
> by my extra debug options in this case (I'm running with all those
> nasty "try to find bad object freeing" options, and doing module
> unloading etc), but can happen without it (it's just very hard to
> trigger in practice without the debug options).
nf_conntrack_free() is decrementing our object counter (net->ct.count)
before releasing the object. That counter is used in the
nf_conntrack_cleanup_net_list path to check if it's time to
kmem_cache_destroy our cache of conntrack objects. I think we have a
race there that should be easier to trigger (although still hard) with
CONFIG_DEBUG_OBJECTS_FREE as object releases become slowier.
[-- Attachment #2: linus.patch --]
[-- Type: text/x-diff, Size: 528 bytes --]
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 5d892fe..d60cf16 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -764,9 +764,10 @@ void nf_conntrack_free(struct nf_conn *ct)
struct net *net = nf_ct_net(ct);
nf_ct_ext_destroy(ct);
- atomic_dec(&net->ct.count);
nf_ct_ext_free(ct);
kmem_cache_free(net->ct.nf_conntrack_cachep, ct);
+ smp_mb__before_atomic_dec();
+ atomic_dec(&net->ct.count);
}
EXPORT_SYMBOL_GPL(nf_conntrack_free);
^ permalink raw reply related
* Re: [PATCH v2 net-next] net: introduce gro_frag_list_enable sysctl
From: Vlad Yasevich @ 2013-10-30 18:09 UTC (permalink / raw)
To: Jerry Chu, Herbert Xu
Cc: Eric Dumazet, David Miller, Christoph Paasch,
netdev@vger.kernel.org, Michael Dalton
In-Reply-To: <CAPshTCg8j-y6fGfh0tRMir34-Lzy77qyzibvwjMSMpR0Rr1rsA@mail.gmail.com>
On 10/30/2013 01:39 PM, Jerry Chu wrote:
> On Tue, Oct 29, 2013 at 9:42 PM, Herbert Xu <herbert@gondor.apana.org.au> wrote:
>>
>> On Tue, Oct 29, 2013 at 09:34:41PM -0700, Eric Dumazet wrote:
>>>
>>> What matters ?
>>>
>>> GRO ?
>>
>> What matters is that you should not treat the forwarding case
>> separately from the host case.
>>
>> For virtualisation the host case looks exactly like the forwarding
>> case.
>
>
> Not sure I agree - there are two different "forwarding" cases - forwarding
> to another physical NIC (to go out to the wire hence need to do GSO),
> and (for virtualization) forwarding to a virtual NIC and consumed internally
> (e.g., VM).
I don't think you can really differentiate these 2 case. VM are
very commonly used as routers/forwarders. In some cases, to get
better throughput, VFs are assigned to the VMs as the externally
facing ports. So, you still end up forwarding to another physical
NIC.
-vlad
> For the latter we should strive to push GSO pkts all the way
> to the VM stack w/o breaking them up. So for virtualization GRO is all
> goodness but not sure about the regular forwarding path. (From the
> perf perspective it boils down to if the cost of GSO/GRO will offset
> the benefit of GRO. Sure if one manages to get the cost close to zero
> than there is not reason to leave GRO always on. But it's still a big if for
> now.)
>
> Best,
>
> Jerry
>
>>
>>
>> IOW, if having a 64KB packet matters for the host, then it matters
>> for forwarding as well.
>>
>>> Before my patch, GRO packets were 17 MSS, and nobody complained packets
>>> were too small, so what are you saying exactly ?
>>
>> I'm not criticsing your mega-GRO patch at all. That one is great
>> and means that we'll get aggregated packets up to 64K. What we need
>> to do is just to patch up the GSO code so that it can handle these
>> mega-packets properly.
>>
>> Cheers,
>> --
>> Email: Herbert Xu <herbert@gondor.apana.org.au>
>> Home Page: http://gondor.apana.org.au/~herbert/
>> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [gpio:for-next 67/67] pch_gbe_main.c:undefined reference to `devm_gpio_request_one'
From: Linus Walleij @ 2013-10-30 18:21 UTC (permalink / raw)
To: David Cohen
Cc: Darren Hart, David S. Miller, netdev@vger.kernel.org,
Fengguang Wu, Alexandre Courbot, linux-gpio@vger.kernel.org
In-Reply-To: <526CA546.7040406@linux.intel.com>
On Sat, Oct 26, 2013 at 10:31 PM, David Cohen
<david.a.cohen@linux.intel.com> wrote:
> Maybe if GPIOLIB has the static inline stubs returning -ENODEV we could
> use a patch similar to the one attached here.
I've added stubs returning -EINVAL just like all siblings there, if you
like to have this changed, send a patch changing it to -ENODEV
and this patch on top as 2/2 please.
Yours,
Linus Walleij
^ permalink raw reply
* Re: [PATCH] [trivial]doc:net: Fix typo in Documentation/networking
From: Randy Dunlap @ 2013-10-30 18:22 UTC (permalink / raw)
To: Masanari Iida, trivial, linux-kenrel, netdev
In-Reply-To: <1383119175-1963-1-git-send-email-standby24x7@gmail.com>
On 10/30/13 00:46, Masanari Iida wrote:
> Correct spelling typo in Documentation/networking
>
> Signed-off-by: Masanari Iida <standby24x7@gmail.com>
> ---
> Documentation/networking/dccp.txt | 4 ++--
> Documentation/networking/e100.txt | 2 +-
> Documentation/networking/ieee802154.txt | 4 ++--
> Documentation/networking/l2tp.txt | 2 +-
> Documentation/networking/netdev-FAQ.txt | 2 +-
> Documentation/networking/netlink_mmap.txt | 6 +++---
> Documentation/networking/operstates.txt | 2 +-
> Documentation/networking/rxrpc.txt | 2 +-
> Documentation/networking/stmmac.txt | 8 ++++----
> Documentation/networking/vortex.txt | 4 ++--
> Documentation/networking/x25-iface.txt | 2 +-
> 11 files changed, 19 insertions(+), 19 deletions(-)
> diff --git a/Documentation/networking/ieee802154.txt b/Documentation/networking/ieee802154.txt
> index 09eb573..98c8b2b 100644
> --- a/Documentation/networking/ieee802154.txt
> +++ b/Documentation/networking/ieee802154.txt
> @@ -66,7 +66,7 @@ net_device, with .type = ARPHRD_IEEE802154. Data is exchanged with socket family
> code via plain sk_buffs. On skb reception skb->cb must contain additional
> info as described in the struct ieee802154_mac_cb. During packet transmission
> the skb->cb is used to provide additional data to device's header_ops->create
> -function. Be aware, that this data can be overriden later (when socket code
> +function. Be aware, that this data can be overridden later (when socket code
fwiw, I would drop the comma above...
> submits skb to qdisc), so if you need something from that cb later, you should
> store info in the skb->data on your own.
>
> diff --git a/Documentation/networking/operstates.txt b/Documentation/networking/operstates.txt
> index 9769457..c40f4bb 100644
> --- a/Documentation/networking/operstates.txt
> +++ b/Documentation/networking/operstates.txt
> @@ -89,7 +89,7 @@ packets. The name 'carrier' and the inversion are historical, think of
> it as lower layer.
>
> Note that for certain kind of soft-devices, which are not managing any
> -real hardware, there is possible to set this bit from userpsace.
> +real hardware, there is possible to set this bit from userspace.
it is possible
> One should use TVL IFLA_CARRIER to do so.
>
> netif_carrier_ok() can be used to query that bit.
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Thanks.
--
~Randy
^ permalink raw reply
* Fw: [Bug 64081] New: mdiobus_read fail and return -110 when called from get_phy_id r6040: 0000:00:08.0 failed to register MII bus
From: Stephen Hemminger @ 2013-10-30 18:23 UTC (permalink / raw)
To: netdev
Begin forwarded message:
Date: Wed, 30 Oct 2013 11:10:47 -0700
From: "bugzilla-daemon@bugzilla.kernel.org" <bugzilla-daemon@bugzilla.kernel.org>
To: "stephen@networkplumber.org" <stephen@networkplumber.org>
Subject: [Bug 64081] New: mdiobus_read fail and return -110 when called from get_phy_id r6040: 0000:00:08.0 failed to register MII bus
https://bugzilla.kernel.org/show_bug.cgi?id=64081
Bug ID: 64081
Summary: mdiobus_read fail and return -110 when called from
get_phy_id r6040: 0000:00:08.0 failed to register MII
bus
Product: Networking
Version: 2.5
Kernel Version: 3.10.17
Hardware: All
OS: Linux
Tree: Mainline
Status: NEW
Severity: blocking
Priority: P1
Component: Other
Assignee: shemminger@linux-foundation.org
Reporter: nils.koehler@ibt-interfaces.de
Regression: No
I have tracked down an issue I have to get the device driver r6040.c to run on
Kernel 3.10.17.
It fails called get_phy_id.
In fails sometimes randomly on a phy id between 0 and 31.
the chance to get the error is 50% in my case after insmod r6040.ko
The error is caused by the following function:
int mdiobus_read(struct mii_bus *bus, int addr, u32 regnum)
{
int retval;
BUG_ON(in_interrupt());
mutex_lock(&bus->mdio_lock);
retval = bus->read(bus, addr, regnum);
mutex_unlock(&bus->mdio_lock);
printk(KERN_INFO "IBT Debug 1 mdiobus_read retval:%d addr:%d
regnum:%d\n",retval,addr,regnum);
return retval;
}
EXPORT_SYMBOL(mdiobus_read);
I have added a debug trace and in case of failure retval returns -110
This cause a break in get_phy_id flow and driver init fully fails because it
returns the an -EIO
I saw that the real existing phy id 1 in my case always was propper detected
but the feeding loop try to init up to 31 Phy's and mostly one of them fail.
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply
* Re: Fw: [Bug 64081] New: mdiobus_read fail and return -110 when called from get_phy_id r6040: 0000:00:08.0 failed to register MII bus
From: Florian Fainelli @ 2013-10-30 18:33 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20131030112348.58ceec8a@nehalam.linuxnetplumber.net>
2013/10/30 Stephen Hemminger <stephen@networkplumber.org>:
>
>
> Begin forwarded message:
>
> Date: Wed, 30 Oct 2013 11:10:47 -0700
> From: "bugzilla-daemon@bugzilla.kernel.org" <bugzilla-daemon@bugzilla.kernel.org>
> To: "stephen@networkplumber.org" <stephen@networkplumber.org>
> Subject: [Bug 64081] New: mdiobus_read fail and return -110 when called from get_phy_id r6040: 0000:00:08.0 failed to register MII bus
Thanks Stephen, investigating with the reporter of the bug.
--
Florian
^ permalink raw reply
* [RESEND] [PATCH] Fix tc stats when using -batch mode
From: Nigel Kukard @ 2013-10-30 18:44 UTC (permalink / raw)
To: netdev
There are two global variables in tc/tc_class.c:
__u32 filter_qdisc;
__u32 filter_classid;
These are not re-initialized for each line received in -batch mode:
class show dev eth0 parent 1: classid 1:1
class show dev eth0 parent 1: classid 1:1
Error: duplicate "classid": "1:1" is the second value.
This patch fixes the issue by initializing the two globals when we
enter print_class().
Signed-off-by: Nigel Kukard <nkukard@lbsd.net>
---
tc/tc_class.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tc/tc_class.c b/tc/tc_class.c
index 9d4eea5..8043448 100644
--- a/tc/tc_class.c
+++ b/tc/tc_class.c
@@ -241,6 +241,9 @@ int tc_class_list(int argc, char **argv)
t.tcm_family = AF_UNSPEC;
memset(d, 0, sizeof(d));
+ filter_qdisc = 0;
+ filter_classid = 0;
+
while (argc > 0) {
if (strcmp(*argv, "dev") == 0) {
NEXT_ARG();
--
1.8.4.rc3
^ permalink raw reply related
* Re: [PATCH 1/2] sh_eth: check platform data pointer
From: Sergei Shtylyov @ 2013-10-30 19:55 UTC (permalink / raw)
To: netdev, David Miller; +Cc: nobuhiro.iwamatsu.yj, linux-sh
In-Reply-To: <201308310423.30322.sergei.shtylyov@cogentembedded.com>
Hello.
On 08/31/2013 04:23 AM, Sergei Shtylyov wrote:
> Check the platform data pointer before dereferencing it and error out of the
> probe() method if it's NULL.
> This has additional effect of preventing kernel oops with outdated platform data
> containing zero PHY address instead (such as on SolutionEngine7710).
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> ---
> This patch is against Dave's 'net-next.git' repo.
> drivers/net/ethernet/renesas/sh_eth.c | 6 ++++++
> 1 file changed, 6 insertions(+)
> Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
> ===================================================================
> --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
> +++ net-next/drivers/net/ethernet/renesas/sh_eth.c
> @@ -2653,6 +2653,12 @@ static int sh_eth_drv_probe(struct platf
> pm_runtime_enable(&pdev->dev);
> pm_runtime_resume(&pdev->dev);
>
> + if (!pd) {
> + dev_err(&pdev->dev, "no platform data\n");
> + ret = -EINVAL;
> + goto out_release;
> + }
> +
> /* get PHY ID */
> mdp->phy_id = pd->phy;
> mdp->phy_interface = pd->phy_interface;
David, could you please merge this patch? It has a value of its own,
regardless of the device tree support in patch 2 (which got bloked).
WBR, Sergei
^ permalink raw reply
* Re: [PATCH 29/51] DMA-API: ata: pata_octeon_cf: convert to use dma_coerce_mask_and_coherent()
From: Geert Uytterhoeven @ 2013-10-30 19:08 UTC (permalink / raw)
To: Russell King
Cc: alsa-devel, linux-doc, Linux MMC List,
Linux Fbdev development list, linux-nvme,
linux-ide@vger.kernel.org, driverdevel, linux-samsung-soc, scsi,
e1000-devel, Linux-Next, b43-dev, Linux Media Mailing List,
devicetree, DRI Development, linux-tegra,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Solarflare linux maintainers, netdev@vger.kernel.org
In-Reply-To: <E1VMmAk-0007iq-IU@rmk-PC.arm.linux.org.uk>
On Thu, Sep 19, 2013 at 11:54 PM, Russell King
<rmk+kernel@arm.linux.org.uk> wrote:
> diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
> index c51bbb9..6231d43 100644
> --- a/drivers/ata/pata_octeon_cf.c
> +++ b/drivers/ata/pata_octeon_cf.c
> @@ -1014,8 +1014,9 @@ static int octeon_cf_probe(struct platform_device *pdev)
> }
> cf_port->c0 = ap->ioaddr.ctl_addr;
>
> - pdev->dev.coherent_dma_mask = DMA_BIT_MASK(64);
> - pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
> + rv = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
> + if (rv)
> + return ret;
return rv;
http://kisskb.ellerman.id.au/kisskb/buildresult/9959184/
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: [PATCH v2 net-next] net: introduce gro_frag_list_enable sysctl
From: David Miller @ 2013-10-30 19:12 UTC (permalink / raw)
To: hkchu; +Cc: herbert, eric.dumazet, christoph.paasch, netdev, mwdalton
In-Reply-To: <CAPshTCg8j-y6fGfh0tRMir34-Lzy77qyzibvwjMSMpR0Rr1rsA@mail.gmail.com>
From: Jerry Chu <hkchu@google.com>
Date: Wed, 30 Oct 2013 10:39:00 -0700
> Not sure I agree - there are two different "forwarding" cases - forwarding
> to another physical NIC (to go out to the wire hence need to do GSO),
> and (for virtualization) forwarding to a virtual NIC and consumed internally
> (e.g., VM). For the latter we should strive to push GSO pkts all the way
> to the VM stack w/o breaking them up. So for virtualization GRO is all
> goodness but not sure about the regular forwarding path. (From the
> perf perspective it boils down to if the cost of GSO/GRO will offset
> the benefit of GRO. Sure if one manages to get the cost close to zero
> than there is not reason to leave GRO always on. But it's still a big if for
> now.)
More precisely, for the regular forwarding path it only needs to be
cheaper than N * cost routing lookup, where N is the number of real
packets contained in the GRO SKB.
^ permalink raw reply
* Re: [PATCH 1/2] sh_eth: check platform data pointer
From: David Miller @ 2013-10-30 19:16 UTC (permalink / raw)
To: sergei.shtylyov; +Cc: netdev, nobuhiro.iwamatsu.yj, linux-sh
In-Reply-To: <52716421.9080807@cogentembedded.com>
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Wed, 30 Oct 2013 22:55:13 +0300
> David, could you please merge this patch? It has a value of its own,
> regardless of the device tree support in patch 2 (which got bloked).
Then it needs to be resubmitted.
Any time a part of series is rejected or needs changes, it is entirely
dropped and no longer will I refer to it in patchwork.
To avoid any ambiguity, the submitted must then resubmit anythign he
wishes to be applied.
^ permalink raw reply
* Re: [Xen-devel] [PATCH net-next RFC 0/5] xen-netback: TX grant mapping instead of copy
From: Konrad Rzeszutek Wilk @ 2013-10-30 19:16 UTC (permalink / raw)
To: Zoltan Kiss
Cc: ian.campbell, wei.liu2, xen-devel, netdev, linux-kernel,
jonathan.davies
In-Reply-To: <1383094220-14775-1-git-send-email-zoltan.kiss@citrix.com>
On Wed, Oct 30, 2013 at 12:50:15AM +0000, Zoltan Kiss wrote:
> A long known problem of the upstream netback implementation that on the TX
> path (from guest to Dom0) it copies the whole packet from guest memory into
> Dom0. That simply became a bottleneck with 10Gb NICs, and generally it's a
> huge perfomance penalty. The classic kernel version of netback used grant
> mapping, and to get notified when the page can be unmapped, it used page
> destructors. Unfortunately that destructor is not an upstreamable solution.
> Ian Campbell's skb fragment destructor patch series
> (http://lwn.net/Articles/491522/) tried to solve this problem, however it
> seems to be very invasive on the network stack's code, and therefore haven't
> progressed very well.
> This patch series use SKBTX_DEV_ZEROCOPY flags to tell the stack it needs to
> know when the skb is freed up. That is the way KVM solved the same problem,
> and based on my initial tests it can do the same for us. Avoiding the extra
> copy boosted up TX throughput from 6.8 Gbps to 7.9 (I used a slower
> Interlagos box, both Dom0 and guest on upstream kernel, on the same NUMA node,
> running iperf 2.0.5, and the remote end was a bare metal box on the same 10Gb
> switch)
> Based on my investigations the packet get only copied if it is delivered to
> Dom0 stack, which is due to this patch:
> https://lkml.org/lkml/2012/7/20/363
> That's a bit unfortunate, but as far as I know for the huge majority this use
> case is not too important. There are a couple of things which need more
> polishing, see the FIXME comments. I will run some more extensive tests, but
> in the meantime I would like to hear comments about what I've done so far.
> I've tried to broke it down to smaller patches, with mixed results, so I
> welcome suggestions on that part as well:
> 1/5: Introduce TX grant map definitions
> 2/5: Change TX path from grant copy to mapping
> 3/5: Remove old TX grant copy definitons
> 4/5: Fix indentations
> 5/5: Change RX path for mapped SKB fragments
Odd. I don't see #5 patch patch?
>
> Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply
* Re: [PATCH net-next] net: extend net_device allocation to vmalloc()
From: Ben Hutchings @ 2013-10-30 19:16 UTC (permalink / raw)
To: Eric Dumazet
Cc: Joby Poriyath, David Miller, netdev, wei.liu2, ian.campbell,
xen-devel, andrew.bennieston, david.vrabel, malcolm.crossley
In-Reply-To: <1383145278.4857.46.camel@edumazet-glaptop.roam.corp.google.com>
On Wed, 2013-10-30 at 08:01 -0700, Eric Dumazet wrote:
[...]
> --- a/Documentation/networking/netdevices.txt
> +++ b/Documentation/networking/netdevices.txt
> @@ -10,9 +10,10 @@ network devices.
> struct net_device allocation rules
> ==================================
> Network device structures need to persist even after module is unloaded and
> -must be allocated with kmalloc. If device has registered successfully,
> -it will be freed on last use by free_netdev. This is required to handle the
> -pathologic case cleanly (example: rmmod mydriver </sys/class/net/myeth/mtu )
> +must be allocated with kmalloc() or vmalloc(). If device has registered
[...]
Well, drivers must never try to allocate and initialise struct
net_device from scratch. They always call alloc_netdev_mqs() or one of
its many wrappers. So 'must be allocated with kmalloc' was already
wrong and this sentence should be removed completely.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
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
* Re: [Xen-devel] [PATCH net-next RFC 0/5] xen-netback: TX grant mapping instead of copy
From: Konrad Rzeszutek Wilk @ 2013-10-30 19:17 UTC (permalink / raw)
To: Zoltan Kiss
Cc: ian.campbell, wei.liu2, xen-devel, netdev, linux-kernel,
jonathan.davies
In-Reply-To: <20131030191617.GB14149@phenom.dumpdata.com>
On Wed, Oct 30, 2013 at 03:16:17PM -0400, Konrad Rzeszutek Wilk wrote:
> On Wed, Oct 30, 2013 at 12:50:15AM +0000, Zoltan Kiss wrote:
> > A long known problem of the upstream netback implementation that on the TX
> > path (from guest to Dom0) it copies the whole packet from guest memory into
> > Dom0. That simply became a bottleneck with 10Gb NICs, and generally it's a
> > huge perfomance penalty. The classic kernel version of netback used grant
> > mapping, and to get notified when the page can be unmapped, it used page
> > destructors. Unfortunately that destructor is not an upstreamable solution.
> > Ian Campbell's skb fragment destructor patch series
> > (http://lwn.net/Articles/491522/) tried to solve this problem, however it
> > seems to be very invasive on the network stack's code, and therefore haven't
> > progressed very well.
> > This patch series use SKBTX_DEV_ZEROCOPY flags to tell the stack it needs to
> > know when the skb is freed up. That is the way KVM solved the same problem,
> > and based on my initial tests it can do the same for us. Avoiding the extra
> > copy boosted up TX throughput from 6.8 Gbps to 7.9 (I used a slower
> > Interlagos box, both Dom0 and guest on upstream kernel, on the same NUMA node,
> > running iperf 2.0.5, and the remote end was a bare metal box on the same 10Gb
> > switch)
> > Based on my investigations the packet get only copied if it is delivered to
> > Dom0 stack, which is due to this patch:
> > https://lkml.org/lkml/2012/7/20/363
> > That's a bit unfortunate, but as far as I know for the huge majority this use
> > case is not too important. There are a couple of things which need more
> > polishing, see the FIXME comments. I will run some more extensive tests, but
> > in the meantime I would like to hear comments about what I've done so far.
> > I've tried to broke it down to smaller patches, with mixed results, so I
> > welcome suggestions on that part as well:
> > 1/5: Introduce TX grant map definitions
> > 2/5: Change TX path from grant copy to mapping
> > 3/5: Remove old TX grant copy definitons
> > 4/5: Fix indentations
> > 5/5: Change RX path for mapped SKB fragments
>
> Odd. I don't see #5 patch patch?
Ah, you have two #4 patches:
[PATCH net-next RFC 4/5] xen-netback: Change RX path for mapped SKB fragments
[PATCH net-next RFC 4/5] xen-netback: Fix indentations
!
> >
> > Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
> >
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xen.org
> > http://lists.xen.org/xen-devel
^ permalink raw reply
* Re: [PATCH] bnx2: Use dev_kfree_skb_any() in bnx2_tx_int()
From: Cong Wang @ 2013-10-30 19:23 UTC (permalink / raw)
To: David Miller; +Cc: tdmackey, mchan, Linux Kernel Network Developers, LKML
In-Reply-To: <20131030.024003.1476890051483056287.davem@davemloft.net>
On Tue, Oct 29, 2013 at 11:40 PM, David Miller <davem@davemloft.net> wrote:
> From: Cong Wang <xiyou.wangcong@gmail.com>
> Date: Tue, 29 Oct 2013 20:50:08 -0700
>
>> Normally ->poll() is called in softirq context, while netpoll could
>> be called in any context depending on its caller.
>
> It still makes amends to make the execution context still looks
> "compatible" as far as locking et al. is concerned.
Adjusting netpoll code for IRQ context is much harder
than just calling dev_kfree_skb_any()...
What's more, we have similar change before:
commit ed79bab847d8e5a2986d8ff43c49c6fb8ee3265f
Author: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed Oct 14 14:36:43 2009 +0000
virtio_net: use dev_kfree_skb_any() in free_old_xmit_skbs()
^ permalink raw reply
* [PATCH v3] sh_eth: check platform data pointer
From: Sergei Shtylyov @ 2013-10-30 20:30 UTC (permalink / raw)
To: netdev; +Cc: nobuhiro.iwamatsu.yj, linux-sh
Check the platform data pointer before dereferencing it and error out of the
probe() method if it's NULL.
This has additional effect of preventing kernel oops with outdated platform data
containing zero PHY address instead (such as on SolutionEngine7710).
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
This patch is against David Miller's 'net-next.git' repo.
Changes in version 3:
- refreshed the patch.
Changes in version 2:
- refreshed the patch.
drivers/net/ethernet/renesas/sh_eth.c | 6 ++++++
1 file changed, 6 insertions(+)
Index: net-next/drivers/net/ethernet/renesas/sh_eth.c
===================================================================
--- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
+++ net-next/drivers/net/ethernet/renesas/sh_eth.c
@@ -2663,6 +2663,12 @@ static int sh_eth_drv_probe(struct platf
pm_runtime_enable(&pdev->dev);
pm_runtime_resume(&pdev->dev);
+ if (!pd) {
+ dev_err(&pdev->dev, "no platform data\n");
+ ret = -EINVAL;
+ goto out_release;
+ }
+
/* get PHY ID */
mdp->phy_id = pd->phy;
mdp->phy_interface = pd->phy_interface;
^ permalink raw reply
* Re: [net-next PATCH] net: codel: Avoid undefined behavior from signed overflow
From: Ben Hutchings @ 2013-10-30 19:35 UTC (permalink / raw)
To: Jesper Dangaard Brouer; +Cc: netdev, Eric Dumazet, Paul E. McKenney, Dave Taht
In-Reply-To: <20131030172341.19203.93490.stgit@dragon>
On Wed, 2013-10-30 at 18:23 +0100, Jesper Dangaard Brouer wrote:
> From: Jesper Dangaard Brouer <netoptimizer@brouer.com>
>
> As described in commit 5a581b367 (jiffies: Avoid undefined
> behavior from signed overflow), according to the C standard
> 3.4.3p3, overflow of a signed integer results in undefined
> behavior.
[...]
According to the real processors that Linux runs on, signed arithmetic
uses 2's complement representation and overflow wraps accordingly. And
we rely on that behaviour in many places, so we use
'-fno-strict-overflow' to tell gcc not to assume we avoid signed
overflow. (There is also '-fwrapv' which tells gcc to assume the
processor behaves this way, but shouldn't it already know how the target
machine works?)
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
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
* Re: [PATCH v2 net-next] net: introduce gro_frag_list_enable sysctl
From: Ben Hutchings @ 2013-10-30 19:39 UTC (permalink / raw)
To: Herbert Xu
Cc: David Miller, eric.dumazet, christoph.paasch, netdev, hkchu,
mwdalton
In-Reply-To: <20131030020543.GA1925@gondor.apana.org.au>
On Wed, 2013-10-30 at 10:05 +0800, Herbert Xu wrote:
> On Tue, Oct 29, 2013 at 10:02:53PM -0400, David Miller wrote:
> > From: Eric Dumazet <eric.dumazet@gmail.com>
> > Date: Tue, 29 Oct 2013 17:53:48 -0700
> >
> > > So should we apply the first fix to avoid the BUG_ON() ?
> >
> > Please be more specific, are you talking about splitting up
> > this patch in some way?
>
> I think Eric is referring to the patch that removes the BUG_ON
> in skb_segment and deals with the new mega-GRO packets.
>
> I think that's fine for stable, but for the long term we should
> fix it properly as these new meag-GRO packets still retain the
> existing packet boundaries and are trivially segmentable.
>
> If we are indeed able to do that, I doubt we would even need
> the sysctl patch since the GRO performance should be vastly
> superior to the non-GRO case, even for a router/bridge.
I think the change to enable mega-GRO packets should be reverted and
that change should go to stable so that the performance regression for
forwarding is also fixed.
Then it can be re-enabled, with the additional check that there are no
forwarders, in net-next.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
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
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