Bug 6936 - BUG: warning at net/core/dev.c:1171/skb_checksum_help()
Summary: BUG: warning at net/core/dev.c:1171/skb_checksum_help()
Status: RESOLVED CODE_FIX
Alias: None
Product: Networking
Classification: Unclassified
Component: IPV4 (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Herbert Xu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-31 19:04 UTC by Pawel Staszewski
Modified: 2006-08-15 18:43 UTC (History)
0 users

See Also:
Kernel Version: 2.6.18-rc3
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description Pawel Staszewski 2006-07-31 19:04:54 UTC
Most recent kernel where this bug did not occur: 2.6.16
Distribution: Gentoo
Hardware Environment: 
lspci -v
00:00.0 Host bridge: Intel Corporation E7230 Memory Controller Hub (rev 81)
        Subsystem: Super Micro Computer Inc Unknown device 7780
        Flags: bus master, fast devsel, latency 0
        Capabilities: [e0] Vendor Specific Information

00:01.0 PCI bridge: Intel Corporation E7230 PCI Express Root Port (rev 81)
(prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0
        Bus: primary=00, secondary=01, subordinate=03, sec-latency=0
        I/O behind bridge: 00007000-00007fff
        Memory behind bridge: df100000-df2fffff
        Capabilities: [88] #0d [0000]
        Capabilities: [80] Power Management version 2
        Capabilities: [90] Message Signalled Interrupts: 64bit- Queue=0/0 Enable+
        Capabilities: [a0] Express Root Port (Slot+) IRQ 0

00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1
(rev 01) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0
        Bus: primary=00, secondary=04, subordinate=04, sec-latency=0
        Capabilities: [40] Express Root Port (Slot+) IRQ 0
        Capabilities: [80] Message Signalled Interrupts: 64bit- Queue=0/0 Enable+
        Capabilities: [90] #0d [0000]
        Capabilities: [a0] Power Management version 2

00:1c.4 PCI bridge: Intel Corporation 82801GR/GH/GHM (ICH7 Family) PCI Express
Port 5 (rev 01) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0
        Bus: primary=00, secondary=05, subordinate=05, sec-latency=0
        I/O behind bridge: 00008000-00008fff
        Memory behind bridge: df300000-df3fffff
        Capabilities: [40] Express Root Port (Slot+) IRQ 0
        Capabilities: [80] Message Signalled Interrupts: 64bit- Queue=0/0 Enable+
        Capabilities: [90] #0d [0000]
        Capabilities: [a0] Power Management version 2

00:1c.5 PCI bridge: Intel Corporation 82801GR/GH/GHM (ICH7 Family) PCI Express
Port 6 (rev 01) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0
        Bus: primary=00, secondary=06, subordinate=06, sec-latency=0
        I/O behind bridge: 00009000-00009fff
        Memory behind bridge: df400000-df4fffff
        Capabilities: [40] Express Root Port (Slot+) IRQ 0
        Capabilities: [80] Message Signalled Interrupts: 64bit- Queue=0/0 Enable+
        Capabilities: [90] #0d [0000]
        Capabilities: [a0] Power Management version 2

00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1) (prog-if 01
[Subtractive decode])
        Flags: bus master, fast devsel, latency 0
        Bus: primary=00, secondary=0a, subordinate=0a, sec-latency=32
        I/O behind bridge: 0000a000-0000afff
        Memory behind bridge: de000000-df0fffff
        Prefetchable memory behind bridge: 0000000088000000-0000000088000000
        Capabilities: [50] #0d [0000]

00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface
Bridge (rev 01)
        Subsystem: Super Micro Computer Inc Unknown device 7780
        Flags: bus master, medium devsel, latency 0
        Capabilities: [e0] Vendor Specific Information

00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller
(rev 01) (prog-if 8a [Master SecP PriP])
        Subsystem: Super Micro Computer Inc Unknown device 7780
        Flags: bus master, medium devsel, latency 0, IRQ 233
        I/O ports at <unassigned>
        I/O ports at <unassigned>
        I/O ports at <unassigned>
        I/O ports at <unassigned>
        I/O ports at 6800 [size=16]

00:1f.2 SATA controller: Intel Corporation 82801GR/GH (ICH7 Family) Serial ATA
Storage Controller AHCI (rev 01) (prog-if 01 [AHCI 1.0])
        Subsystem: Super Micro Computer Inc Unknown device 7780
        Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 58
        I/O ports at 6838 [size=8]
        I/O ports at 682c [size=4]
        I/O ports at 6830 [size=8]
        I/O ports at 6828 [size=4]
        I/O ports at 6840 [size=32]
        Memory at df700000 (32-bit, non-prefetchable) [size=1K]
        Capabilities: [80] Message Signalled Interrupts: 64bit- Queue=0/0 Enable+
        Capabilities: [70] Power Management version 2
        Capabilities: [a8] #12 [0010]

00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
        Subsystem: Super Micro Computer Inc Unknown device 7780
        Flags: medium devsel, IRQ 10
        I/O ports at 1100 [size=32]

01:00.0 PCI bridge: Intel Corporation 6700PXH PCI Express-to-PCI Bridge A (rev
09) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0
        Bus: primary=01, secondary=02, subordinate=02, sec-latency=64
        Capabilities: [44] Express PCI/PCI-X Bridge IRQ 0
        Capabilities: [5c] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
        Capabilities: [6c] Power Management version 2
        Capabilities: [d8] PCI-X bridge device

01:00.1 PIC: Intel Corporation 6700/6702PXH I/OxAPIC Interrupt Controller A (rev
09) (prog-if 20 [IO(X)-APIC])
        Subsystem: Super Micro Computer Inc Unknown device 7780
        Flags: bus master, fast devsel, latency 0
        Memory at df100000 (32-bit, non-prefetchable) [size=4K]
        Capabilities: [44] Express Endpoint IRQ 0
        Capabilities: [6c] Power Management version 2

01:00.2 PCI bridge: Intel Corporation 6700PXH PCI Express-to-PCI Bridge B (rev
09) (prog-if 00 [Normal decode])
        Flags: bus master, fast devsel, latency 0
        Bus: primary=01, secondary=03, subordinate=03, sec-latency=64
        I/O behind bridge: 00007000-00007fff
        Memory behind bridge: df200000-df2fffff
        Capabilities: [44] Express PCI/PCI-X Bridge IRQ 0
        Capabilities: [5c] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
        Capabilities: [6c] Power Management version 2
        Capabilities: [d8] PCI-X bridge device

01:00.3 PIC: Intel Corporation 6700PXH I/OxAPIC Interrupt Controller B (rev 09)
(prog-if 20 [IO(X)-APIC])
        Subsystem: Super Micro Computer Inc Unknown device 7780
        Flags: bus master, fast devsel, latency 0
        Memory at df101000 (32-bit, non-prefetchable) [size=4K]
        Capabilities: [44] Express Endpoint IRQ 0
        Capabilities: [6c] Power Management version 2

03:01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet
Controller (Fiber) (rev 01)
        Subsystem: Intel Corporation PRO/1000 MF Server Adapter
        Flags: bus master, 66MHz, medium devsel, latency 52, IRQ 225
        Memory at df200000 (64-bit, non-prefetchable) [size=128K]
        I/O ports at 7000 [size=64]
        Capabilities: [dc] Power Management version 2
        Capabilities: [e4] PCI-X non-bridge device
        Capabilities: [f0] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-

05:00.0 Ethernet controller: Intel Corporation 82573E Gigabit Ethernet
Controller (Copper) (rev 03)
        Subsystem: Super Micro Computer Inc Unknown device 108c
        Flags: bus master, fast devsel, latency 0, IRQ 66
        Memory at df300000 (32-bit, non-prefetchable) [size=128K]
        I/O ports at 8000 [size=32]
        Capabilities: [c8] Power Management version 2
        Capabilities: [d0] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable+
        Capabilities: [e0] Express Endpoint IRQ 0

06:00.0 Ethernet controller: Intel Corporation 82573E Gigabit Ethernet
Controller (Copper) (rev 03)
        Subsystem: Super Micro Computer Inc Unknown device 108c
        Flags: bus master, fast devsel, latency 0, IRQ 177
        Memory at df400000 (32-bit, non-prefetchable) [size=128K]
        I/O ports at 9000 [size=32]
        Capabilities: [c8] Power Management version 2
        Capabilities: [d0] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
        Capabilities: [e0] Express Endpoint IRQ 0

0a:04.0 VGA compatible controller: ATI Technologies Inc Rage XL (rev 27)
(prog-if 00 [VGA])
        Subsystem: ATI Technologies Inc Rage XL
        Flags: bus master, stepping, medium devsel, latency 66, IRQ 5
        Memory at de000000 (32-bit, non-prefetchable) [size=16M]
        I/O ports at a000 [size=256]
        Memory at df000000 (32-bit, non-prefetchable) [size=4K]
        [virtual] Expansion ROM at 88000000 [disabled] [size=128K]
        Capabilities: [5c] Power Management version 2

Software Environment: Bridge code + Iptables 

Problem Description:
2 mins from start:
dmesg shows:
BUG: warning at net/core/dev.c:1171/skb_checksum_help()

Call Trace:
 [<ffffffff803a4c06>] skb_checksum_help+0x5b/0x111
 [<ffffffff803a51ed>] dev_queue_xmit+0xc8/0x218
 [<ffffffff803c811f>] ip_output+0x1e9/0x22c
 [<ffffffff803c74e6>] ip_queue_xmit+0x40e/0x466
 [<ffffffff8022496c>] default_wake_function+0x0/0xe
 [<ffffffff8022496c>] default_wake_function+0x0/0xe
 [<ffffffff8039f87f>] __alloc_skb+0x70/0x11d
 [<ffffffff803d7c85>] tcp_transmit_skb+0x644/0x666
 [<ffffffff803d9255>] tcp_push_one+0xd0/0xfe
 [<ffffffff803ce831>] tcp_sendmsg+0x8bd/0xae8
 [<ffffffff8039ba43>] do_sock_write+0xa1/0xa5
 [<ffffffff8039bb8c>] sock_aio_write+0x4f/0x5e
 [<ffffffff80224a12>] __wake_up+0x36/0x4d
 [<ffffffff802680f5>] do_sync_write+0xc9/0x106
 [<ffffffff8023c2f9>] autoremove_wake_function+0x0/0x2e
 [<ffffffff8031c73f>] tty_ldisc_deref+0x65/0x77
 [<ffffffff802681f4>] vfs_write+0xc2/0x14e
 [<ffffffff80268333>] sys_write+0x45/0x6e
 [<ffffffff802098b6>] system_call+0x7e/0x83

BUG: warning at net/core/dev.c:1225/skb_gso_segment()

Call Trace:
 [<ffffffff803a4d74>] skb_gso_segment+0xb8/0x1e3
 [<ffffffff803a506c>] dev_hard_start_xmit+0x168/0x221
 [<ffffffff803a52b0>] dev_queue_xmit+0x18b/0x218
 [<ffffffff803c811f>] ip_output+0x1e9/0x22c
 [<ffffffff803c74e6>] ip_queue_xmit+0x40e/0x466
 [<ffffffff8022496c>] default_wake_function+0x0/0xe
 [<ffffffff8022496c>] default_wake_function+0x0/0xe
 [<ffffffff8039f87f>] __alloc_skb+0x70/0x11d
 [<ffffffff803d7c85>] tcp_transmit_skb+0x644/0x666
 [<ffffffff803d9255>] tcp_push_one+0xd0/0xfe
 [<ffffffff803ce831>] tcp_sendmsg+0x8bd/0xae8
 [<ffffffff8039ba43>] do_sock_write+0xa1/0xa5
 [<ffffffff8039bb8c>] sock_aio_write+0x4f/0x5e
 [<ffffffff80224a12>] __wake_up+0x36/0x4d
 [<ffffffff802680f5>] do_sync_write+0xc9/0x106
 [<ffffffff8023c2f9>] autoremove_wake_function+0x0/0x2e
 [<ffffffff8031c73f>] tty_ldisc_deref+0x65/0x77
 [<ffffffff802681f4>] vfs_write+0xc2/0x14e
 [<ffffffff80268333>] sys_write+0x45/0x6e
 [<ffffffff802098b6>] system_call+0x7e/0x83



Steps to reproduce: install kernel 2.6.18-rc3 reboot and make traffic.
Comment 1 Herbert Xu 2006-08-15 18:24:18 UTC
On Tue, Aug 15, 2006 at 11:29:59AM -0700, bugme-daemon@bugzilla.kernel.org wrote:
> http://bugzilla.kernel.org/show_bug.cgi?id=6936

It's actually a bug in the bridging code :)

[BRIDGE]: Disable SG/GSO if TX checksum is off

When the bridge recomputes features, it does not maintain the
constraint that SG/GSO must be off if TX checksum is off.
This patch adds that constraint.

On a completely unrelated note, I've also added TSO6 and TSO_ECN
feature bits if GSO is enabled on the underlying device through
the new NETIF_F_GSO_SOFTWARE macro.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 75f02d8..5d95da5 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -320,6 +320,9 @@ #define NETIF_F_GSO_ROBUST	(SKB_GSO_DODG
 #define NETIF_F_TSO_ECN		(SKB_GSO_TCP_ECN << NETIF_F_GSO_SHIFT)
 #define NETIF_F_TSO6		(SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT)
 
+	/* List of features with software fallbacks. */
+#define NETIF_F_GSO_SOFTWARE	(NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6)
+
 #define NETIF_F_GEN_CSUM	(NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
 #define NETIF_F_ALL_CSUM	(NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
 
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index f55ef68..b1211d5 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -386,12 +386,17 @@ void br_features_recompute(struct net_br
 			checksum = 0;
 
 		if (feature & NETIF_F_GSO)
-			feature |= NETIF_F_TSO;
+			feature |= NETIF_F_GSO_SOFTWARE;
 		feature |= NETIF_F_GSO;
 
 		features &= feature;
 	}
 
+	if (!(checksum & NETIF_F_ALL_CSUM))
+		features &= ~NETIF_F_SG;
+	if (!(features & NETIF_F_SG))
+		features &= ~NETIF_F_GSO_MASK;
+
 	br->dev->features = features | checksum | NETIF_F_LLTX |
 			    NETIF_F_GSO_ROBUST;
 }
Comment 2 Stephen Hemminger 2006-08-16 11:00:24 UTC
On Wed, 16 Aug 2006 11:29:00 +1000
Herbert Xu <herbert@gondor.apana.org.au> wrote:

> On Tue, Aug 15, 2006 at 11:29:59AM -0700, bugme-daemon@bugzilla.kernel.org wrote:
> > http://bugzilla.kernel.org/show_bug.cgi?id=6936
> 
> It's actually a bug in the bridging code :)
> 
> [BRIDGE]: Disable SG/GSO if TX checksum is off
> 
> When the bridge recomputes features, it does not maintain the
> constraint that SG/GSO must be off if TX checksum is off.
> This patch adds that constraint.
> 
> On a completely unrelated note, I've also added TSO6 and TSO_ECN
> feature bits if GSO is enabled on the underlying device through
> the new NETIF_F_GSO_SOFTWARE macro.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> 
> Cheers,

agree. I assume this came in with the new GSO for 2.6.18 or do we need
to fix 2.6.17 as well.

Comment 3 Herbert Xu 2006-08-16 17:08:08 UTC
On Wed, Aug 16, 2006 at 11:06:31AM -0700, Stephen Hemminger wrote:
>
> agree. I assume this came in with the new GSO for 2.6.18 or do we need
> to fix 2.6.17 as well.

I think 2.6.17 should be fine because it would only happen there if
the underlying device itself had an inconsistent configuration (TX
checksum off and SG/TSO on).

Cheers,
Comment 4 Anonymous Emailer 2006-08-17 18:16:25 UTC
Reply-To: davem@davemloft.net

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Wed, 16 Aug 2006 11:29:00 +1000

> On Tue, Aug 15, 2006 at 11:29:59AM -0700, bugme-daemon@bugzilla.kernel.org wrote:
> > http://bugzilla.kernel.org/show_bug.cgi?id=6936
> 
> It's actually a bug in the bridging code :)
> 
> [BRIDGE]: Disable SG/GSO if TX checksum is off

Applied, thanks a lot Herbert.


Note You need to log in before you can comment on or make changes to this bug.