* Re: mvneta: oops in __rcu_read_lock on mirabox
From: Russell King - ARM Linux @ 2013-09-16 17:14 UTC (permalink / raw)
To: Thomas Petazzoni
Cc: Willy Tarreau, Andrew Lunn, Jason Cooper, netdev, Ethan Tuttle,
Ezequiel Garcia, Gregory Clément, linux-arm-kernel
In-Reply-To: <20130916182450.639084c6@skate>
On Mon, Sep 16, 2013 at 06:24:50PM +0200, Thomas Petazzoni wrote:
> Could this be caused by bitflips in the RAM due to bad timings, or
> overheating or that kind of things?
Well, the SoC is an Armada 370, which uses Marvell's own Sheeva core.
From what I understand, this is a CPU designed entirely by Marvell, so
the interpretation of these codes may not be correct. This is made
harder to diagnose in that Marvell is soo secret with their
documentation; indeed for this CPU there is no information publically
available (there's only the product briefs).
Bad timings could certainly cause bitflips, as could poor routing of
data line D8 (eg, incorrect termination or routing causing reflections
on the data line - remember that with modern hardware, almost every
signal is a transmission line).
Marginal or noisy power supplies could also be a problem - for example,
if the impedance of the power supply connections is too great, it may
work with some patterns of use but not others.
There's soo many possibilities...
However, if the fault codes above really do equate to what's in the ARMv7
Architecture Reference Manual, I think we can rule out the routing and
RAM chips - because a cache parity error points to bit flips in the cache,
or if there is no cache parity checking implemented, it means something
is corrupting the state of the SoC - which could be due to bad power
supplies.
How do we get to the bottom of this? That's a very good question - one
which is going to be very difficult to solve. Ideally, it means working
with the manufacturer's design team to try and work out what's going on
at the board level, probably using logic analysers to capture the bus
activity leading up to the failure. Also, checking the power supplies
at the SoC too - checking that they're within correct tolerance and
checking the amount of noise on them.
I think all we can do at the moment is to wait for further reports to roll
in and see whether a better pattern emerges.
If you want to try something - and you suspect it may be heat related,
you could try putting the board inside a container, monitor the temperature
inside the container, and put it in your freezer! Just be careful of the
temperature of the other devices on the board getting too cold though -
remember, most consumer electronics is only rated for an *operating*
temperature range of 0°C to 70°C and your freezer will be something like
-20°C - so don't let the ambient temperature inside the container go
below 0°C! If the CPU is producing lots of heat though, it may keep the
container sufficiently warm that that's not a problem. The theory is
that by making the ambient 15 to 20°C cooler, you will also lower the
temperature of the hotter parts by a similar amount.
^ permalink raw reply
* [PATCH RFC net] msi: free msi_desc entry only after we've released the kobject
From: Veaceslav Falico @ 2013-09-16 17:09 UTC (permalink / raw)
To: netdev; +Cc: Veaceslav Falico, Neil Horman, Russell King, Bjorn Helgaas
Currently, we first do kobject_put(&entry->kobj) and the kfree(entry),
however kobject_put() doesn't guarantee us that it was the last reference
and that the kobj isn't used currently by someone else, so after we
kfree(entry) with the struct kobject - other users will begin using the
freed memory, instead of the actual kobject.
Fix this by using the kobject->release callback, which is called last when
the kobject is indeed not used and is cleaned up - it's msi_kobj_release(),
which can do the kfree(entry) safely (kobject_put/cleanup doesn't use the
kobj itself after ->release() was called, so we're safe).
Also, in case we've failed to create the sysfs directories - just kfree()
it - cause we don't have the kobjects attached.
CC: Neil Horman <nhorman@tuxdriver.com>
CC: Russell King <rmk+kernel@arm.linux.org.uk>
CC: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
---
Notes:
This patch is really an RFC, and I don't know for sure how to correctly
fix it, however it seems to work. Sorry if I've done something horribly
wrong, it really seems to work ok :).
I've hit the bug with the recent CONFIG_DEBUG_KOBJECT_RELEASE - it basically
delays the cleanup a bit - so that the chances are a lot higher even for
one user to hit it.
Or, maybe, it will be better to just add an kobject helper
kobject_wait_cleanup(), which will return only after it's indeed free? I'm
really not sure.
drivers/pci/msi.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index b35f93c..6eabf93 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -395,6 +395,7 @@ static void free_msi_irqs(struct pci_dev *dev)
if (list_is_last(&entry->list, &dev->msi_list))
iounmap(entry->mask_base);
}
+ list_del(&entry->list);
/*
* Its possible that we get into this path
@@ -405,10 +406,9 @@ static void free_msi_irqs(struct pci_dev *dev)
if (entry->kobj.parent) {
kobject_del(&entry->kobj);
kobject_put(&entry->kobj);
+ } else {
+ kfree(entry);
}
-
- list_del(&entry->list);
- kfree(entry);
}
}
@@ -531,6 +531,7 @@ static void msi_kobj_release(struct kobject *kobj)
struct msi_desc *entry = to_msi_desc(kobj);
pci_dev_put(entry->dev);
+ kfree(entry);
}
static struct kobj_type msi_irq_ktype = {
--
1.8.4
^ permalink raw reply related
* Re: mvneta: oops in __rcu_read_lock on mirabox
From: Willy Tarreau @ 2013-09-16 16:44 UTC (permalink / raw)
To: Ethan Tuttle
Cc: Thomas Petazzoni, Andrew Lunn, Jason Cooper, netdev,
Ezequiel Garcia, Gregory Clément, linux-arm-kernel
In-Reply-To: <20130916163937.GC3188@1wt.eu>
On Mon, Sep 16, 2013 at 06:39:37PM +0200, Willy Tarreau wrote:
> On Mon, Sep 16, 2013 at 09:35:16AM -0700, Ethan Tuttle wrote:
> > On Mon, Sep 16, 2013 at 8:51 AM, Thomas Petazzoni
> > <thomas.petazzoni@free-electrons.com> wrote:
> > > Willy, Ethan,
> > >
> > > On Mon, 16 Sep 2013 08:50:47 +0200, Willy Tarreau wrote:
> > >
> > >> I'm currently testing on 3.11.1 (which I had here) and am not getting
> > >> any issue after 50M packets. My kernel is running in thumb mode and
> > >> without SMP.
> > >>
> > >> Ethan, we'll need your config I guess.
> > >
> > > Can both of you also report the U-Boot version you're using, and the
> > > SoC revision (it's visible in the U-Boot output).
> >
> > Mine says:
> >
> > U-Boot 2009.08 (Sep 16 2012 - 22:50:06)Marvell version: 1.1.2 NQ
> > SoC: MV6710 A1
>
> I just checked on my old captures and I have the same here, with more
> details such as the CPU's revision (Rev 1) :
>
> http://1wt.eu/articles/mirabox-vs-guruplug/
BTW Ethan, I don't know if you have already opened your mirabox, but on the
link above you'll find settings for trying other frequencies for the CPU. It
could be nice to try 1 GHz with L2/DDR @500 instead of 1200/600 to see if the
issue remains or not. If it disappears, there's also a working setting with
CPU@1.2G, L2@800M and DDR@400M to help find if CPU, L2 or DDR is the culprit.
Willy
^ permalink raw reply
* Re: mvneta: oops in __rcu_read_lock on mirabox
From: Willy Tarreau @ 2013-09-16 16:39 UTC (permalink / raw)
To: Ethan Tuttle
Cc: Thomas Petazzoni, Andrew Lunn, Jason Cooper, netdev,
Ezequiel Garcia, Gregory Clément, linux-arm-kernel
In-Reply-To: <CACzLR4twTNjzU8hK3L1cYUXnEH1ydwY6jnYoOG+9vLB3-4uQ4w@mail.gmail.com>
On Mon, Sep 16, 2013 at 09:35:16AM -0700, Ethan Tuttle wrote:
> On Mon, Sep 16, 2013 at 8:51 AM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
> > Willy, Ethan,
> >
> > On Mon, 16 Sep 2013 08:50:47 +0200, Willy Tarreau wrote:
> >
> >> I'm currently testing on 3.11.1 (which I had here) and am not getting
> >> any issue after 50M packets. My kernel is running in thumb mode and
> >> without SMP.
> >>
> >> Ethan, we'll need your config I guess.
> >
> > Can both of you also report the U-Boot version you're using, and the
> > SoC revision (it's visible in the U-Boot output).
>
> Mine says:
>
> U-Boot 2009.08 (Sep 16 2012 - 22:50:06)Marvell version: 1.1.2 NQ
> SoC: MV6710 A1
I just checked on my old captures and I have the same here, with more
details such as the CPU's revision (Rev 1) :
http://1wt.eu/articles/mirabox-vs-guruplug/
Willy
^ permalink raw reply
* Re: mvneta: oops in __rcu_read_lock on mirabox
From: Ethan Tuttle @ 2013-09-16 16:35 UTC (permalink / raw)
To: Thomas Petazzoni
Cc: Willy Tarreau, Andrew Lunn, Jason Cooper, netdev, Ezequiel Garcia,
Gregory Clément, linux-arm-kernel
In-Reply-To: <20130916175152.4e013457@skate>
On Mon, Sep 16, 2013 at 8:51 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Willy, Ethan,
>
> On Mon, 16 Sep 2013 08:50:47 +0200, Willy Tarreau wrote:
>
>> I'm currently testing on 3.11.1 (which I had here) and am not getting
>> any issue after 50M packets. My kernel is running in thumb mode and
>> without SMP.
>>
>> Ethan, we'll need your config I guess.
>
> Can both of you also report the U-Boot version you're using, and the
> SoC revision (it's visible in the U-Boot output).
Mine says:
U-Boot 2009.08 (Sep 16 2012 - 22:50:06)Marvell version: 1.1.2 NQ
SoC: MV6710 A1
> Maybe Globalscale is
> shipping Mirabox with a different version of the bootloader, or some
> hardware difference, that is causing problems? (I'm just speculating
> here, but another user already reported having issues with his Mirabox,
> and Russell King analyzed the oops as very likely being hardware
> problems).
>
> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com
^ permalink raw reply
* Re: mvneta: oops in __rcu_read_lock on mirabox
From: Thomas Petazzoni @ 2013-09-16 16:24 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Willy Tarreau, Andrew Lunn, Jason Cooper, netdev, Ethan Tuttle,
Ezequiel Garcia, Gregory Clément, linux-arm-kernel
In-Reply-To: <20130916162209.GL12758@n2100.arm.linux.org.uk>
Russell,
On Mon, 16 Sep 2013 17:22:09 +0100, Russell King - ARM Linux wrote:
> One seemed to be a single bit error in an instruction inside the kernel
> image. The other was what seems to be an impossible abort.
>
> I still don't see how we could end up with a prefetch abort inside memset()
> due to the kernel domain being inaccessible, but still be able to get
> an oops out, especially when we dump out the memory for the faulting
> instruction by accessing that memory via that apparantly inaccessible
> domain while running the code which dumps that memory also under this
> apparantly inaccessible domain. If the domain containing the kernel
> really was inaccessible, the system would be completely dead.
>
> The only possibilities I can come up with for that is that abort was
> caused by something spurious happening at the hardware level causing
> corruption of the instruction TLB (corrupting the domain index stored
> in the I-TLB) or other CPU control hardware causing it to spuriously
> generate that fault.
>
> As the domain field in the page table L1 entries covers bit 8, and the
> single bit error with the instruction was also bit 8, maybe there's a
> design weakness on data line bit 8 causing marginal operation.
>
> To add to this, the abort given in this report gives an IFSR value of
> 0x409, which equates to "Synchronous parity error on memory access"
> in ARMv7. The other value (0x400) equates to "TLB conflict abort"
> which can only happen with LPAE support enabled... So this is just
> getting more weird!
Could this be caused by bitflips in the RAM due to bad timings, or
overheating or that kind of things?
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply
* Re: mvneta: oops in __rcu_read_lock on mirabox
From: Russell King - ARM Linux @ 2013-09-16 16:22 UTC (permalink / raw)
To: Thomas Petazzoni
Cc: Willy Tarreau, Andrew Lunn, Jason Cooper, netdev, Ethan Tuttle,
Ezequiel Garcia, Gregory Clément, linux-arm-kernel
In-Reply-To: <20130916175152.4e013457@skate>
On Mon, Sep 16, 2013 at 05:51:52PM +0200, Thomas Petazzoni wrote:
> Willy, Ethan,
>
> On Mon, 16 Sep 2013 08:50:47 +0200, Willy Tarreau wrote:
>
> > I'm currently testing on 3.11.1 (which I had here) and am not getting
> > any issue after 50M packets. My kernel is running in thumb mode and
> > without SMP.
> >
> > Ethan, we'll need your config I guess.
>
> Can both of you also report the U-Boot version you're using, and the
> SoC revision (it's visible in the U-Boot output). Maybe Globalscale is
> shipping Mirabox with a different version of the bootloader, or some
> hardware difference, that is causing problems? (I'm just speculating
> here, but another user already reported having issues with his Mirabox,
> and Russell King analyzed the oops as very likely being hardware
> problems).
One seemed to be a single bit error in an instruction inside the kernel
image. The other was what seems to be an impossible abort.
I still don't see how we could end up with a prefetch abort inside memset()
due to the kernel domain being inaccessible, but still be able to get
an oops out, especially when we dump out the memory for the faulting
instruction by accessing that memory via that apparantly inaccessible
domain while running the code which dumps that memory also under this
apparantly inaccessible domain. If the domain containing the kernel
really was inaccessible, the system would be completely dead.
The only possibilities I can come up with for that is that abort was
caused by something spurious happening at the hardware level causing
corruption of the instruction TLB (corrupting the domain index stored
in the I-TLB) or other CPU control hardware causing it to spuriously
generate that fault.
As the domain field in the page table L1 entries covers bit 8, and the
single bit error with the instruction was also bit 8, maybe there's a
design weakness on data line bit 8 causing marginal operation.
To add to this, the abort given in this report gives an IFSR value of
0x409, which equates to "Synchronous parity error on memory access"
in ARMv7. The other value (0x400) equates to "TLB conflict abort"
which can only happen with LPAE support enabled... So this is just
getting more weird!
^ permalink raw reply
* [PATCH 4/4] drivers: net: phy: cicada.c: clears warning Use #include <linux/io.h> instead of <asm/io.h>
From: Avinash Kumar @ 2013-09-16 16:09 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel, Avinash Kumar
clears following warnings :
WARNING: Use include <linux/io.h> instead of <asm/io.h>
WARNING: Use include <linux/uaccess.h> instead of <asm/uaccess.h>
Signed-off-by: Avinash Kumar <avi.kp.137@gmail.com>
---
drivers/net/phy/cicada.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/cicada.c b/drivers/net/phy/cicada.c
index db472ff..313a037 100644
--- a/drivers/net/phy/cicada.c
+++ b/drivers/net/phy/cicada.c
@@ -30,9 +30,9 @@
#include <linux/ethtool.h>
#include <linux/phy.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/irq.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
/* Cicada Extended Control Register 1 */
#define MII_CIS8201_EXT_CON1 0x17
--
1.7.10.4
^ permalink raw reply related
* Fw: [Bug 61441] New: Network stop working ( (bnx2): transmit queue 0 timed out)
From: Stephen Hemminger @ 2013-09-16 15:53 UTC (permalink / raw)
To: Michael Chan; +Cc: netdev
Begin forwarded message:
Date: Mon, 16 Sep 2013 03:58:45 -0700
From: "bugzilla-daemon@bugzilla.kernel.org" <bugzilla-daemon@bugzilla.kernel.org>
To: "stephen@networkplumber.org" <stephen@networkplumber.org>
Subject: [Bug 61441] New: Network stop working ( (bnx2): transmit queue 0 timed out)
https://bugzilla.kernel.org/show_bug.cgi?id=61441
Bug ID: 61441
Summary: Network stop working ( (bnx2): transmit queue 0 timed
out)
Product: Networking
Version: 2.5
Kernel Version: 2.6.32.61
Hardware: x86-64
OS: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: IPV4
Assignee: shemminger@linux-foundation.org
Reporter: javibarroso@gmail.com
Regression: No
Hello,
Do you have any hint to solve this problem ?
We have a NAS server (openfiler) with the latest 2.6.32 (.61) available kernel
compiled. Every 1/2 days the server stop serving.
The next message is show in messages:
Uhhuh. NMI received for unknown reason b1 on CPU 0.
You have some hardware problem, likely on the PCI bus.
Dazed and confused, but trying to continue
------------[ cut here ]------------
WARNING: at /usr/src/linux-2.6.32.61/net/sched/sch_generic.c:261
dev_watchdog+0x247/0x260()
Hardware name: ProLiant BL460c G1
NETDEV WATCHDOG: eth0 (bnx2): transmit queue 0 timed out
Modules linked in: autofs4 nfsd lockd nfs_acl auth_rpcgss sunrpc exportfs fuse
8021q garp stp llc bonding ipv6 dm_round_robin dm_multipath ext4 jbd2 dm_mirror
dm_region_hash dm_log dm_snapshot dm_mod i5000_edac edac_core i5k_amb ipmi_si
sd_mod iTCO_wdt iTCO_vendor_support bnx2 sg tg3 serio_raw hwmon ipmi_msghandler
pcspkr hpilo crc_t10dif usb_storage qla2xxx scsi_transport_fc scsi_tgt shpchp
cciss ext3 jbd mbcache radeon ttm drm_kms_helper drm i2c_algo_bit i2c_core
[last unloaded: microcode]
Pid: 0, comm: swapper Not tainted 2.6.32.61-SAE #2
Call Trace:
<IRQ> [<ffffffff81067bbb>] warn_slowpath_common+0x7b/0xc0
[<ffffffff81067c61>] warn_slowpath_fmt+0x41/0x50
[<ffffffff813f6c37>] dev_watchdog+0x247/0x260
[<ffffffff8101a1b3>] ? native_sched_clock+0x13/0x80
[<ffffffff81079d45>] ? internal_add_timer+0xb5/0x110
[<ffffffff81079e24>] ? cascade+0x84/0xb0
[<ffffffff8107a956>] run_timer_softirq+0x196/0x340
[<ffffffff81097447>] ? ktime_get+0x57/0xd0
[<ffffffff81070305>] __do_softirq+0xd5/0x200
[<ffffffff81091006>] ? hrtimer_interrupt+0x146/0x260
[<ffffffff8101424c>] call_softirq+0x1c/0x30
[<ffffffff81015bf5>] do_softirq+0x65/0xa0
[<ffffffff810700e5>] irq_exit+0x85/0x90
[<ffffffff8149c771>] smp_apic_timer_interrupt+0x71/0x9c
[<ffffffff81013c13>] apic_timer_interrupt+0x13/0x20
<EOI> [<ffffffff8101b94f>] ? mwait_idle+0x6f/0xd0
[<ffffffff8149a53a>] ? atomic_notifier_call_chain+0x1a/0x20
[<ffffffff81011e66>] ? cpu_idle+0xb6/0x110
[<ffffffff8148e7e7>] ? start_secondary+0x1fc/0x23f
---[ end trace 177d1288aad2a52a ]---
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: Chip reset did not complete
bnx2: eth0: BUG! Tx ring full when queue awake!
bnx2: Chip reset did not complete
bnx2: eth0: BUG! Tx ring full when queue awake!
bnx2: Chip reset did not complete
bnx2: eth0: BUG! Tx ring full when queue awake!
bnx2: Chip reset did not complete
bnx2: eth0: BUG! Tx ring full when queue awake!
bnx2: Chip reset did not complete
bnx2: eth0: BUG! Tx ring full when queue awake!
bnx2: Chip reset did not complete
bnx2: eth0: BUG! Tx ring full when queue awake!
bnx2: Chip reset did not complete
bnx2: eth0: BUG! Tx ring full when queue awake!
bnx2: Chip reset did not complete
bnx2: eth0: BUG! Tx ring full when queue awake!
bnx2: Chip reset did not complete
bnx2: eth0: BUG! Tx ring full when queue awake!
bnx2: Chip reset did not complete
bnx2: eth0: BUG! Tx ring full when queue awake!
bnx2: Chip reset did not complete
bnx2: eth0: BUG! Tx ring full when queue awake!
bnx2: Chip reset did not complete
bnx2: eth0: BUG! Tx ring full when queue awake!
No log is found at:
# ipmitool sel
SEL Information
Version : 1.5 (v1.5, v2 compliant)
Entries : 0
Free Space : 1024 bytes
Percent Used : 0%
Last Add Time : Not Available
Last Del Time : 08/02/2007 14:23:47
Overflow : false
Supported Cmds : None
pear in ipmi:
Can we configure bnx2 module to mitigate that BUG ?
Thank you very much
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply
* Re: mvneta: oops in __rcu_read_lock on mirabox
From: Thomas Petazzoni @ 2013-09-16 15:51 UTC (permalink / raw)
To: Willy Tarreau
Cc: Ethan Tuttle, Andrew Lunn, Jason Cooper, netdev, Ezequiel Garcia,
Gregory Clément, linux-arm-kernel
In-Reply-To: <20130916065047.GH27487@1wt.eu>
Willy, Ethan,
On Mon, 16 Sep 2013 08:50:47 +0200, Willy Tarreau wrote:
> I'm currently testing on 3.11.1 (which I had here) and am not getting
> any issue after 50M packets. My kernel is running in thumb mode and
> without SMP.
>
> Ethan, we'll need your config I guess.
Can both of you also report the U-Boot version you're using, and the
SoC revision (it's visible in the U-Boot output). Maybe Globalscale is
shipping Mirabox with a different version of the bootloader, or some
hardware difference, that is causing problems? (I'm just speculating
here, but another user already reported having issues with his Mirabox,
and Russell King analyzed the oops as very likely being hardware
problems).
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply
* Re: [PATCH v3 0/6] ipv6: Do route updating for redirect in ndisc layer
From: Duan Jiong @ 2013-09-16 14:08 UTC (permalink / raw)
To: Daniel Borkmann, Duan Jiong
Cc: davem, netdev, hannes, linux-sctp@vger.kernel.org
In-Reply-To: <5236F808.9050605@redhat.com>
于 2013/9/16 20:22, Daniel Borkmann 写道:
> On 09/16/2013 01:47 PM, Duan Jiong wrote:
>> From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
>>
>> the ip6_redirect() could be replaced with
>> ip6_redirect_no_header(), we could always use ip6_redirect()
>> for route updating in ndisc layer and use the data of the
>> redirected header option just for finding the socket to be
>> notified and then notify user in protocols' err_handler.
> If I get this right, it seems to me that this patchset actually consists of two
> different kind of changes:
>
> 1) Not notifying user space on ICMP redirects (net material)
> 2) Simplify code for updating route in ndisc layer instead of error handlers (net-next)
>
> Also, you do the *actual* change in the very last patch, which means that from
> patch 1 to 5 we're in an inconsistent and buggy state unless we also apply patch
> number 6. It should actually be the other way around, that you first do the actual
> change and then migrate users (also commit messages are quite terse).
I make the patch set on net tree, not on net-next. Maybe those
things should be done in two patch sets.
> Moreover, just looking at the SCTP part (sctp_err_lookup() function) ...
>
> /* RFC 4960, Appendix C. ICMP Handling
> *
> * ICMP6) An implementation MUST validate that the Verification Tag
> * contained in the ICMP message matches the Verification Tag of
> * the peer. If the Verification Tag is not 0 and does NOT
> * match, discard the ICMP message. If it is 0 and the ICMP
> * message contains enough bytes to verify that the chunk type is
> * an INIT chunk and that the Initiate Tag matches the tag of the
> * peer, continue with ICMP7. If the ICMP message is too short
> * or the chunk type or the Initiate Tag does not match, silently
> * discard the packet.
> */
>
> ... it seems to me that we would simply ignore such RFC requirements with
> your patch for the sctp_v6_err() part.
>
> Care to elaborate? ;-)
Sorry, i didn't notice that.
According to the RFC requirements, it suggests that we can't update
route for redirect in ndisc layer before calling into sctp_err_lookup(),
because we must verify the ICMP Message. Now maybe we update route for
redirect in ndisc layer is wrong.
Do you have any idea?
>> ---
>> Changes for v3:
>> 1.del the ICMP6_INC_STATS_BH error count, these are in fact
>> no errors.
>>
>> Changes for v2:
>> 1.handle the update of the NDISC_REDIRECT error code directly in
>> icmpv6_err_convert.
>> 2.squash some patchs into one patch.
>> 3.modify the subject of those patchs.
>>
>> Duan Jiong (6):
>> ipv6: del the statements for updating route in (dccp|tcp|sctp)_v6_err
>> ipv6: just match on ICMPV6_PKT_TOOBIG in those err_handle
>> ipv6: del statements for dealing with NDISC_REDIRECT
>> ip6tnl: move route updating for redirect to ndisc layer
>> ipv6: modify the err to 0 when dealing with NDISC_REDIRECT
>> ipv6: Do route updating for redirect in ndisc layer
>>
>> include/net/ip6_route.h | 3 ---
>> net/dccp/ipv6.c | 13 +------------
>> net/ipv6/ah6.c | 9 ++-------
>> net/ipv6/esp6.c | 9 ++-------
>> net/ipv6/icmp.c | 5 +++--
>> net/ipv6/ip6_tunnel.c | 5 -----
>> net/ipv6/ipcomp6.c | 9 ++-------
>> net/ipv6/ndisc.c | 6 ++----
>> net/ipv6/raw.c | 3 +--
>> net/ipv6/route.c | 29 ++---------------------------
>> net/ipv6/tcp_ipv6.c | 12 ++++--------
>> net/ipv6/udp.c | 2 --
>> net/sctp/input.c | 12 ------------
>> net/sctp/ipv6.c | 6 +++---
>> 14 files changed, 22 insertions(+), 101 deletions(-)
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" 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: [PATCH] net, mellanox mlx4 Fix compile warnings
From: Jack Morgenstein @ 2013-09-16 13:52 UTC (permalink / raw)
To: David Laight
Cc: Or Gerlitz, Prarit Bhargava, netdev, Doug Ledford, Amir Vadai,
Or Gerlitz
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B733A@saturn3.aculab.com>
On Mon, 16 Sep 2013 09:59:41 +0100
"David Laight" <David.Laight@ACULAB.COM> wrote:
> > In any event, this change cannot hurt.
>
> It could hide a real 'used but not initialised' error later on...
>
> David
In this case, it doesn't. If cq_res_start_move_to returns 0, the "cq"
pointer points to the desired cq object. In all instances where the cq
object is not found, you get an error return, and the cq pointer in the
caller is never de-referenced.
Therefore, the compiler warning is a false positive, and the
"uninitialized_var" is just a workaround to satisfy the compiler.
Same for the SRQ case.
-Jack
^ permalink raw reply
* Re: [PATCH v3 0/6] ipv6: Do route updating for redirect in ndisc layer
From: Duan Jiong @ 2013-09-16 12:41 UTC (permalink / raw)
To: Duan Jiong, davem; +Cc: netdev, hannes
In-Reply-To: <5236EFEB.60106@cn.fujitsu.com>
davem,
please just ignore this patch set this time, i
find some errors in patch 2/6, and i'm so sorry for
this.
thanks,
Duan
于 2013/9/16 19:47, Duan Jiong 写道:
> From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
>
> the ip6_redirect() could be replaced with
> ip6_redirect_no_header(), we could always use ip6_redirect()
> for route updating in ndisc layer and use the data of the
> redirected header option just for finding the socket to be
> notified and then notify user in protocols' err_handler.
>
> ---
> Changes for v3:
> 1.del the ICMP6_INC_STATS_BH error count, these are in fact
> no errors.
>
> Changes for v2:
> 1.handle the update of the NDISC_REDIRECT error code directly in
> icmpv6_err_convert.
> 2.squash some patchs into one patch.
> 3.modify the subject of those patchs.
>
> Duan Jiong (6):
> ipv6: del the statements for updating route in (dccp|tcp|sctp)_v6_err
> ipv6: just match on ICMPV6_PKT_TOOBIG in those err_handle
> ipv6: del statements for dealing with NDISC_REDIRECT
> ip6tnl: move route updating for redirect to ndisc layer
> ipv6: modify the err to 0 when dealing with NDISC_REDIRECT
> ipv6: Do route updating for redirect in ndisc layer
>
> include/net/ip6_route.h | 3 ---
> net/dccp/ipv6.c | 13 +------------
> net/ipv6/ah6.c | 9 ++-------
> net/ipv6/esp6.c | 9 ++-------
> net/ipv6/icmp.c | 5 +++--
> net/ipv6/ip6_tunnel.c | 5 -----
> net/ipv6/ipcomp6.c | 9 ++-------
> net/ipv6/ndisc.c | 6 ++----
> net/ipv6/raw.c | 3 +--
> net/ipv6/route.c | 29 ++---------------------------
> net/ipv6/tcp_ipv6.c | 12 ++++--------
> net/ipv6/udp.c | 2 --
> net/sctp/input.c | 12 ------------
> net/sctp/ipv6.c | 6 +++---
> 14 files changed, 22 insertions(+), 101 deletions(-)
>
^ permalink raw reply
* Re: usbnet transmit path problems
From: Ming Lei @ 2013-09-16 12:38 UTC (permalink / raw)
To: Oliver Neukum; +Cc: David Laight, Network Development, linux-usb
In-Reply-To: <1379319193.15916.1.camel-B2T3B9s34ElbnMAlSieJcQ@public.gmane.org>
On Mon, Sep 16, 2013 at 4:13 PM, Oliver Neukum <oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org> wrote:
> On Thu, 2013-09-12 at 09:56 +0800, Ming Lei wrote:
>> On Thu, Sep 12, 2013 at 12:05 AM, David Laight <David.Laight-JxhZ9S5GRejQT0dZR+AlfA@public.gmane.org> wrote:
>
>> Patches are always welcome, :-)
>
> Indeed, I think your patch, if no better alternatives come up soon,
> should be taken.
OK, will submit it later.
Thanks,
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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 1/6] ipv6: del the statements for updating route in, (dccp|tcp|sctp)_v6_err
From: Duan Jiong @ 2013-09-16 12:31 UTC (permalink / raw)
To: Duan Jiong, davem; +Cc: netdev, hannes
In-Reply-To: <5236F03F.5020407@cn.fujitsu.com>
Sorry, i forgot to add "v3" in title.
Thanks,
Duan
于 2013/9/16 19:49, Duan Jiong 写道:
> Because we will do route updating for redirect in nidsc layer. And
> when dealing with redirect message, the dccp and sctp should like
> tcp return directly.
>
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
> ---
> net/dccp/ipv6.c | 10 +++-------
> net/ipv6/tcp_ipv6.c | 12 ++++--------
> net/sctp/input.c | 12 ------------
> net/sctp/ipv6.c | 6 +++---
> 4 files changed, 10 insertions(+), 30 deletions(-)
>
> diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
> index 9c61f9c..300840c 100644
> --- a/net/dccp/ipv6.c
> +++ b/net/dccp/ipv6.c
> @@ -98,6 +98,9 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
> return;
> }
>
> + if (type == NDISC_REDIRECT)
> + return;
> +
> sk = inet6_lookup(net, &dccp_hashinfo,
> &hdr->daddr, dh->dccph_dport,
> &hdr->saddr, dh->dccph_sport, inet6_iif(skb));
> @@ -130,13 +133,6 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
>
> np = inet6_sk(sk);
>
> - if (type == NDISC_REDIRECT) {
> - struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie);
> -
> - if (dst)
> - dst->ops->redirect(dst, sk, skb);
> - }
> -
> if (type == ICMPV6_PKT_TOOBIG) {
> struct dst_entry *dst = NULL;
>
> diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
> index 5c71501..d3ca8a4 100644
> --- a/net/ipv6/tcp_ipv6.c
> +++ b/net/ipv6/tcp_ipv6.c
> @@ -346,6 +346,10 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
> __u32 seq;
> struct net *net = dev_net(skb->dev);
>
> +
> + if (type == NDISC_REDIRECT)
> + return;
> +
> sk = inet6_lookup(net, &tcp_hashinfo, &hdr->daddr,
> th->dest, &hdr->saddr, th->source, skb->dev->ifindex);
>
> @@ -382,14 +386,6 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
>
> np = inet6_sk(sk);
>
> - if (type == NDISC_REDIRECT) {
> - struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie);
> -
> - if (dst)
> - dst->ops->redirect(dst, sk, skb);
> - goto out;
> - }
> -
> if (type == ICMPV6_PKT_TOOBIG) {
> /* We are not interested in TCP_LISTEN and open_requests
> * (SYN-ACKs send out by Linux are always <576bytes so
> diff --git a/net/sctp/input.c b/net/sctp/input.c
> index 5f20686..0d2d4b7 100644
> --- a/net/sctp/input.c
> +++ b/net/sctp/input.c
> @@ -413,18 +413,6 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc,
> sctp_retransmit(&asoc->outqueue, t, SCTP_RTXR_PMTUD);
> }
>
> -void sctp_icmp_redirect(struct sock *sk, struct sctp_transport *t,
> - struct sk_buff *skb)
> -{
> - struct dst_entry *dst;
> -
> - if (!t)
> - return;
> - dst = sctp_transport_dst_check(t);
> - if (dst)
> - dst->ops->redirect(dst, sk, skb);
> -}
> -
> /*
> * SCTP Implementer's Guide, 2.37 ICMP handling procedures
> *
> diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
> index da613ce..ee12d87 100644
> --- a/net/sctp/ipv6.c
> +++ b/net/sctp/ipv6.c
> @@ -151,6 +151,9 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
> int err;
> struct net *net = dev_net(skb->dev);
>
> + if (type == NDISC_REDIRECT)
> + return;
> +
> idev = in6_dev_get(skb->dev);
>
> /* Fix up skb to look at the embedded net header. */
> @@ -181,9 +184,6 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
> goto out_unlock;
> }
> break;
> - case NDISC_REDIRECT:
> - sctp_icmp_redirect(sk, transport, skb);
> - break;
> default:
> break;
> }
^ permalink raw reply
* Re: [PATCH v3 0/6] ipv6: Do route updating for redirect in ndisc layer
From: Daniel Borkmann @ 2013-09-16 12:22 UTC (permalink / raw)
To: Duan Jiong; +Cc: davem, netdev, hannes, linux-sctp@vger.kernel.org
In-Reply-To: <5236EFEB.60106@cn.fujitsu.com>
On 09/16/2013 01:47 PM, Duan Jiong wrote:
> From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
>
> the ip6_redirect() could be replaced with
> ip6_redirect_no_header(), we could always use ip6_redirect()
> for route updating in ndisc layer and use the data of the
> redirected header option just for finding the socket to be
> notified and then notify user in protocols' err_handler.
If I get this right, it seems to me that this patchset actually consists of two
different kind of changes:
1) Not notifying user space on ICMP redirects (net material)
2) Simplify code for updating route in ndisc layer instead of error handlers (net-next)
Also, you do the *actual* change in the very last patch, which means that from
patch 1 to 5 we're in an inconsistent and buggy state unless we also apply patch
number 6. It should actually be the other way around, that you first do the actual
change and then migrate users (also commit messages are quite terse).
Moreover, just looking at the SCTP part (sctp_err_lookup() function) ...
/* RFC 4960, Appendix C. ICMP Handling
*
* ICMP6) An implementation MUST validate that the Verification Tag
* contained in the ICMP message matches the Verification Tag of
* the peer. If the Verification Tag is not 0 and does NOT
* match, discard the ICMP message. If it is 0 and the ICMP
* message contains enough bytes to verify that the chunk type is
* an INIT chunk and that the Initiate Tag matches the tag of the
* peer, continue with ICMP7. If the ICMP message is too short
* or the chunk type or the Initiate Tag does not match, silently
* discard the packet.
*/
... it seems to me that we would simply ignore such RFC requirements with
your patch for the sctp_v6_err() part.
Care to elaborate? ;-)
> ---
> Changes for v3:
> 1.del the ICMP6_INC_STATS_BH error count, these are in fact
> no errors.
>
> Changes for v2:
> 1.handle the update of the NDISC_REDIRECT error code directly in
> icmpv6_err_convert.
> 2.squash some patchs into one patch.
> 3.modify the subject of those patchs.
>
> Duan Jiong (6):
> ipv6: del the statements for updating route in (dccp|tcp|sctp)_v6_err
> ipv6: just match on ICMPV6_PKT_TOOBIG in those err_handle
> ipv6: del statements for dealing with NDISC_REDIRECT
> ip6tnl: move route updating for redirect to ndisc layer
> ipv6: modify the err to 0 when dealing with NDISC_REDIRECT
> ipv6: Do route updating for redirect in ndisc layer
>
> include/net/ip6_route.h | 3 ---
> net/dccp/ipv6.c | 13 +------------
> net/ipv6/ah6.c | 9 ++-------
> net/ipv6/esp6.c | 9 ++-------
> net/ipv6/icmp.c | 5 +++--
> net/ipv6/ip6_tunnel.c | 5 -----
> net/ipv6/ipcomp6.c | 9 ++-------
> net/ipv6/ndisc.c | 6 ++----
> net/ipv6/raw.c | 3 +--
> net/ipv6/route.c | 29 ++---------------------------
> net/ipv6/tcp_ipv6.c | 12 ++++--------
> net/ipv6/udp.c | 2 --
> net/sctp/input.c | 12 ------------
> net/sctp/ipv6.c | 6 +++---
> 14 files changed, 22 insertions(+), 101 deletions(-)
>
^ permalink raw reply
* Re: [PATCH] net, mellanox mlx4 Fix compile warnings
From: Prarit Bhargava @ 2013-09-16 12:14 UTC (permalink / raw)
To: David Laight
Cc: Jack Morgenstein, Or Gerlitz, netdev, Doug Ledford, Amir Vadai,
Or Gerlitz
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B733A@saturn3.aculab.com>
On 09/16/2013 04:59 AM, David Laight wrote:
>> On Sat, 14 Sep 2013 22:10:19 +0300
>> Or Gerlitz <or.gerlitz@gmail.com> wrote:
>>
>>>> + struct res_cq *uninitialized_var(cq);
>>>>
>>>> err = cq_res_start_move_to(dev, slave, cqn,
>>>> RES_CQ_ALLOCATED, &cq);
>>
>> I have no objection. However, I don't know if the compiler is being too
>> clever here or too stupid. The cq variable is initialized in
>> cq_res_start_move_to(), but the compiler is ignoring this -- or maybe
>> it is simply not assuming that cq will in fact be
>> initialized by the called procedure?
>
> Possibly cq_res_start_move_to() got inlined - and the analysis
> of the inlined code found a path where it wasn't initialised.
>
> Most likely one of the paths where the return value is non-zero.
>
>> In any event, this change cannot hurt.
>
> It could hide a real 'used but not initialised' error later on...
Hi David,
I certainly don't profess to know the code better than you do of course, but in
terms of risk we're no better in than the original code here, and it seems that
other places in the kernel the resolution has been to either init to NULL or
wrap with uninitialized_var()...
P.
^ permalink raw reply
* [PATCH v3 6/6] ipv6: Do route updating for redirect in ndisc layer
From: Duan Jiong @ 2013-09-16 11:53 UTC (permalink / raw)
To: davem; +Cc: netdev, hannes
In-Reply-To: <5236EFEB.60106@cn.fujitsu.com>
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Do the whole verification and route updating in ndisc
lay and then just call into icmpv6_notify() to notify
the upper protocols.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
include/net/ip6_route.h | 3 ---
net/ipv6/ndisc.c | 6 ++----
net/ipv6/route.c | 29 ++---------------------------
3 files changed, 4 insertions(+), 34 deletions(-)
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index f525e70..5db259e 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -133,9 +133,6 @@ extern void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu,
extern void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk,
__be32 mtu);
extern void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark);
-extern void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
- u32 mark);
-extern void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk);
struct netlink_callback;
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index f8a55ff..6bd1b41 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1368,11 +1368,9 @@ static void ndisc_redirect_rcv(struct sk_buff *skb)
if (!ndisc_parse_options(msg->opt, ndoptlen, &ndopts))
return;
- if (!ndopts.nd_opts_rh) {
- ip6_redirect_no_header(skb, dev_net(skb->dev),
- skb->dev->ifindex, 0);
+ ip6_redirect(skb, dev_net(skb->dev), skb->dev->ifindex, 0);
+ if (!ndopts.nd_opts_rh)
return;
- }
hdr = (u8 *)ndopts.nd_opts_rh;
hdr += 8;
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index c979dd9..151bd6c 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1227,27 +1227,7 @@ static struct dst_entry *ip6_route_redirect(struct net *net,
flags, __ip6_route_redirect);
}
-void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark)
-{
- const struct ipv6hdr *iph = (struct ipv6hdr *) skb->data;
- struct dst_entry *dst;
- struct flowi6 fl6;
-
- memset(&fl6, 0, sizeof(fl6));
- fl6.flowi6_oif = oif;
- fl6.flowi6_mark = mark;
- fl6.flowi6_flags = 0;
- fl6.daddr = iph->daddr;
- fl6.saddr = iph->saddr;
- fl6.flowlabel = ip6_flowinfo(iph);
-
- dst = ip6_route_redirect(net, &fl6, &ipv6_hdr(skb)->saddr);
- rt6_do_redirect(dst, NULL, skb);
- dst_release(dst);
-}
-EXPORT_SYMBOL_GPL(ip6_redirect);
-
-void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
+void ip6_redirect(struct sk_buff *skb, struct net *net, int oif,
u32 mark)
{
const struct ipv6hdr *iph = ipv6_hdr(skb);
@@ -1266,12 +1246,7 @@ void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
rt6_do_redirect(dst, NULL, skb);
dst_release(dst);
}
-
-void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk)
-{
- ip6_redirect(skb, sock_net(sk), sk->sk_bound_dev_if, sk->sk_mark);
-}
-EXPORT_SYMBOL_GPL(ip6_sk_redirect);
+EXPORT_SYMBOL_GPL(ip6_redirect);
static unsigned int ip6_default_advmss(const struct dst_entry *dst)
{
--
1.8.3.1
^ permalink raw reply related
* [PATCH v3 5/6] ipv6: modify the err to 0 when dealing with, NDISC_REDIRECT
From: Duan Jiong @ 2013-09-16 11:53 UTC (permalink / raw)
To: davem; +Cc: netdev, hannes
In-Reply-To: <5236EFEB.60106@cn.fujitsu.com>
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
when dealing with redirect message, the err shoud
be assigned to 0, not EPROTO. And del the statements
for updating route.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
net/ipv6/icmp.c | 3 +++
net/ipv6/raw.c | 3 +--
net/ipv6/udp.c | 2 --
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 4bde43c..6bcedcc 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -975,6 +975,9 @@ int icmpv6_err_convert(u8 type, u8 code, int *err)
case ICMPV6_TIME_EXCEED:
*err = EHOSTUNREACH;
break;
+ case NDISC_REDIRECT:
+ *err = 0;
+ break;
}
return fatal;
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 58916bb..baf86b8 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -335,8 +335,7 @@ static void rawv6_err(struct sock *sk, struct sk_buff *skb,
ip6_sk_update_pmtu(skb, sk, info);
harderr = (np->pmtudisc == IPV6_PMTUDISC_DO);
}
- if (type == NDISC_REDIRECT)
- ip6_sk_redirect(skb, sk);
+
if (np->recverr) {
u8 *payload = skb->data;
if (!inet->hdrincl)
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index f405815..a40b392 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -525,8 +525,6 @@ void __udp6_lib_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if (type == ICMPV6_PKT_TOOBIG)
ip6_sk_update_pmtu(skb, sk, info);
- if (type == NDISC_REDIRECT)
- ip6_sk_redirect(skb, sk);
np = inet6_sk(sk);
--
1.8.3.1
^ permalink raw reply related
* [PATCH 4/6] ip6tnl: move route updating for redirect to ndisc layer
From: Duan Jiong @ 2013-09-16 11:52 UTC (permalink / raw)
To: davem; +Cc: netdev, hannes
In-Reply-To: <5236EFEB.60106@cn.fujitsu.com>
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
In rfc2473, we can know that the tunnel ICMP redirect
message should not be reported to the source of the
original packet, so after calling ip6_tnl_err(), the
rel_msg is set to 0 in function ip4ip6_err(), and the
redirect will never be handled.
In order to deal with this, we move route updating for
redirect to ndisc layer.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
net/ipv6/ip6_tunnel.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 61355f7..3ea834b 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -576,9 +576,6 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
rel_type = ICMP_DEST_UNREACH;
rel_code = ICMP_FRAG_NEEDED;
break;
- case NDISC_REDIRECT:
- rel_type = ICMP_REDIRECT;
- rel_code = ICMP_REDIR_HOST;
default:
return 0;
}
@@ -637,8 +634,6 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
skb_dst(skb2)->ops->update_pmtu(skb_dst(skb2), NULL, skb2, rel_info);
}
- if (rel_type == ICMP_REDIRECT)
- skb_dst(skb2)->ops->redirect(skb_dst(skb2), NULL, skb2);
icmp_send(skb2, rel_type, rel_code, htonl(rel_info));
--
1.8.3.1
^ permalink raw reply related
* [PATCH v3 3/6] ipv6: del statements for dealing with NDISC_REDIRECT
From: Duan Jiong @ 2013-09-16 11:52 UTC (permalink / raw)
To: davem; +Cc: netdev, hannes
In-Reply-To: <5236EFEB.60106@cn.fujitsu.com>
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Now the route updating for redirect is done in ndisc
layer.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
net/ipv6/icmp.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index eef8d94..4bde43c 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -91,8 +91,6 @@ static void icmpv6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if (type == ICMPV6_PKT_TOOBIG)
ip6_update_pmtu(skb, net, info, 0, 0);
- else if (type == NDISC_REDIRECT)
- ip6_redirect(skb, net, skb->dev->ifindex, 0);
if (!(type & ICMPV6_INFOMSG_MASK))
if (icmp6->icmp6_type == ICMPV6_ECHO_REQUEST)
--
1.8.3.1
^ permalink raw reply related
* [PATCH v3 2/6] ipv6: just match on ICMPV6_PKT_TOOBIG in those err_handle
From: Duan Jiong @ 2013-09-16 11:51 UTC (permalink / raw)
To: davem; +Cc: netdev, hannes, linux-sctp, vyasevic, dborkman
In-Reply-To: <5236EFEB.60106@cn.fujitsu.com>
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
we don't handle NDISC_REDIRECTs here any more, and the match
on ICMPV6_DEST_UNREACH is meaningless.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
net/dccp/ipv6.c | 7 -------
net/ipv6/ah6.c | 9 ++-------
net/ipv6/esp6.c | 9 ++-------
net/ipv6/ipcomp6.c | 9 ++-------
4 files changed, 6 insertions(+), 28 deletions(-)
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 300840c..980cfba 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -91,13 +91,6 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
__u64 seq;
struct net *net = dev_net(skb->dev);
- if (skb->len < offset + sizeof(*dh) ||
- skb->len < offset + __dccp_basic_hdr_len(dh)) {
- ICMP6_INC_STATS_BH(net, __in6_dev_get(skb->dev),
- ICMP6_MIB_INERRORS);
- return;
- }
-
if (type == NDISC_REDIRECT)
return;
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 73784c3..79fb40f 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -618,19 +618,14 @@ static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
struct ip_auth_hdr *ah = (struct ip_auth_hdr*)(skb->data+offset);
struct xfrm_state *x;
- if (type != ICMPV6_DEST_UNREACH &&
- type != ICMPV6_PKT_TOOBIG &&
- type != NDISC_REDIRECT)
+ if (type != ICMPV6_PKT_TOOBIG)
return;
x = xfrm_state_lookup(net, skb->mark, (xfrm_address_t *)&iph->daddr, ah->spi, IPPROTO_AH, AF_INET6);
if (!x)
return;
- if (type == NDISC_REDIRECT)
- ip6_redirect(skb, net, skb->dev->ifindex, 0);
- else
- ip6_update_pmtu(skb, net, info, 0, 0);
+ ip6_update_pmtu(skb, net, info, 0, 0);
xfrm_state_put(x);
}
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index d3618a7..6aa64e1 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -436,9 +436,7 @@ static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
struct ip_esp_hdr *esph = (struct ip_esp_hdr *)(skb->data + offset);
struct xfrm_state *x;
- if (type != ICMPV6_DEST_UNREACH &&
- type != ICMPV6_PKT_TOOBIG &&
- type != NDISC_REDIRECT)
+ if (type != ICMPV6_PKT_TOOBIG)
return;
x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr,
@@ -446,10 +444,7 @@ static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if (!x)
return;
- if (type == NDISC_REDIRECT)
- ip6_redirect(skb, net, skb->dev->ifindex, 0);
- else
- ip6_update_pmtu(skb, net, info, 0, 0);
+ ip6_update_pmtu(skb, net, info, 0, 0);
xfrm_state_put(x);
}
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index 5636a91..e943158 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -64,9 +64,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
(struct ip_comp_hdr *)(skb->data + offset);
struct xfrm_state *x;
- if (type != ICMPV6_DEST_UNREACH &&
- type != ICMPV6_PKT_TOOBIG &&
- type != NDISC_REDIRECT)
+ if (type != ICMPV6_PKT_TOOBIG)
return;
spi = htonl(ntohs(ipcomph->cpi));
@@ -75,10 +73,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
if (!x)
return;
- if (type == NDISC_REDIRECT)
- ip6_redirect(skb, net, skb->dev->ifindex, 0);
- else
- ip6_update_pmtu(skb, net, info, 0, 0);
+ ip6_update_pmtu(skb, net, info, 0, 0);
xfrm_state_put(x);
}
--
1.8.3.1
^ permalink raw reply related
* [PATCH 1/6] ipv6: del the statements for updating route in, (dccp|tcp|sctp)_v6_err
From: Duan Jiong @ 2013-09-16 11:49 UTC (permalink / raw)
To: davem; +Cc: netdev, hannes
In-Reply-To: <5236EFEB.60106@cn.fujitsu.com>
Because we will do route updating for redirect in nidsc layer. And
when dealing with redirect message, the dccp and sctp should like
tcp return directly.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
net/dccp/ipv6.c | 10 +++-------
net/ipv6/tcp_ipv6.c | 12 ++++--------
net/sctp/input.c | 12 ------------
net/sctp/ipv6.c | 6 +++---
4 files changed, 10 insertions(+), 30 deletions(-)
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 9c61f9c..300840c 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -98,6 +98,9 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
return;
}
+ if (type == NDISC_REDIRECT)
+ return;
+
sk = inet6_lookup(net, &dccp_hashinfo,
&hdr->daddr, dh->dccph_dport,
&hdr->saddr, dh->dccph_sport, inet6_iif(skb));
@@ -130,13 +133,6 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
np = inet6_sk(sk);
- if (type == NDISC_REDIRECT) {
- struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie);
-
- if (dst)
- dst->ops->redirect(dst, sk, skb);
- }
-
if (type == ICMPV6_PKT_TOOBIG) {
struct dst_entry *dst = NULL;
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 5c71501..d3ca8a4 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -346,6 +346,10 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
__u32 seq;
struct net *net = dev_net(skb->dev);
+
+ if (type == NDISC_REDIRECT)
+ return;
+
sk = inet6_lookup(net, &tcp_hashinfo, &hdr->daddr,
th->dest, &hdr->saddr, th->source, skb->dev->ifindex);
@@ -382,14 +386,6 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
np = inet6_sk(sk);
- if (type == NDISC_REDIRECT) {
- struct dst_entry *dst = __sk_dst_check(sk, np->dst_cookie);
-
- if (dst)
- dst->ops->redirect(dst, sk, skb);
- goto out;
- }
-
if (type == ICMPV6_PKT_TOOBIG) {
/* We are not interested in TCP_LISTEN and open_requests
* (SYN-ACKs send out by Linux are always <576bytes so
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 5f20686..0d2d4b7 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -413,18 +413,6 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc,
sctp_retransmit(&asoc->outqueue, t, SCTP_RTXR_PMTUD);
}
-void sctp_icmp_redirect(struct sock *sk, struct sctp_transport *t,
- struct sk_buff *skb)
-{
- struct dst_entry *dst;
-
- if (!t)
- return;
- dst = sctp_transport_dst_check(t);
- if (dst)
- dst->ops->redirect(dst, sk, skb);
-}
-
/*
* SCTP Implementer's Guide, 2.37 ICMP handling procedures
*
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index da613ce..ee12d87 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -151,6 +151,9 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
int err;
struct net *net = dev_net(skb->dev);
+ if (type == NDISC_REDIRECT)
+ return;
+
idev = in6_dev_get(skb->dev);
/* Fix up skb to look at the embedded net header. */
@@ -181,9 +184,6 @@ static void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
goto out_unlock;
}
break;
- case NDISC_REDIRECT:
- sctp_icmp_redirect(sk, transport, skb);
- break;
default:
break;
}
--
1.8.3.1
^ permalink raw reply related
* [PATCH v3 0/6] ipv6: Do route updating for redirect in ndisc layer
From: Duan Jiong @ 2013-09-16 11:47 UTC (permalink / raw)
To: davem; +Cc: netdev, hannes
From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
the ip6_redirect() could be replaced with
ip6_redirect_no_header(), we could always use ip6_redirect()
for route updating in ndisc layer and use the data of the
redirected header option just for finding the socket to be
notified and then notify user in protocols' err_handler.
---
Changes for v3:
1.del the ICMP6_INC_STATS_BH error count, these are in fact
no errors.
Changes for v2:
1.handle the update of the NDISC_REDIRECT error code directly in
icmpv6_err_convert.
2.squash some patchs into one patch.
3.modify the subject of those patchs.
Duan Jiong (6):
ipv6: del the statements for updating route in (dccp|tcp|sctp)_v6_err
ipv6: just match on ICMPV6_PKT_TOOBIG in those err_handle
ipv6: del statements for dealing with NDISC_REDIRECT
ip6tnl: move route updating for redirect to ndisc layer
ipv6: modify the err to 0 when dealing with NDISC_REDIRECT
ipv6: Do route updating for redirect in ndisc layer
include/net/ip6_route.h | 3 ---
net/dccp/ipv6.c | 13 +------------
net/ipv6/ah6.c | 9 ++-------
net/ipv6/esp6.c | 9 ++-------
net/ipv6/icmp.c | 5 +++--
net/ipv6/ip6_tunnel.c | 5 -----
net/ipv6/ipcomp6.c | 9 ++-------
net/ipv6/ndisc.c | 6 ++----
net/ipv6/raw.c | 3 +--
net/ipv6/route.c | 29 ++---------------------------
net/ipv6/tcp_ipv6.c | 12 ++++--------
net/ipv6/udp.c | 2 --
net/sctp/input.c | 12 ------------
net/sctp/ipv6.c | 6 +++---
14 files changed, 22 insertions(+), 101 deletions(-)
--
1.8.3.1
^ permalink raw reply
* Re: [PATCH 3/3] net: usb: cdc_ether: use usb.h macros whenever possible
From: Oliver Neukum @ 2013-09-16 11:23 UTC (permalink / raw)
To: Fabio Porcedda
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1379324872-15944-4-git-send-email-fabio.porcedda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Mon, 2013-09-16 at 11:47 +0200, Fabio Porcedda wrote:
> Use USB_DEVICE_AND_INTERFACE_INFO and USB_VENDOR_AND_INTERFACE_INFO
> macros to reduce boilerplate.
>
> Signed-off-by: Fabio Porcedda <fabio.porcedda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Acked-by: Oliver Neukum <oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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
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