Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] forcedeth: Do not use legacy PCI power management
From: David Miller @ 2011-01-10  0:20 UTC (permalink / raw)
  To: rjw; +Cc: netdev, linux-kernel, linux-pm
In-Reply-To: <201101072212.05449.rjw@sisk.pl>

From: "Rafael J. Wysocki" <rjw@sisk.pl>
Date: Fri, 7 Jan 2011 22:12:05 +0100

> Subject: forcedeth: Do not use legacy PCI power management (v2)
> 
> The forcedeth driver uses the legacy PCI power management, so it has
> to do PCI-specific things in its ->suspend() and ->resume() callbacks
> and some of them are not done correctly.
> 
> Convert forcedeth to the new PCI power management framework and make
> it let the PCI subsystem take care of all the PCI-specific aspects of
> device handling during system power transitions.
> 
> Tested with nVidia Corporation MCP55 Ethernet (rev a2).
> 
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

Applied, thanks.

^ permalink raw reply

* Re: net-next-2.6 [PATCH 0/3] dccp: several sequence-number validation fixes
From: David Miller @ 2011-01-10  0:17 UTC (permalink / raw)
  To: gerrit; +Cc: dccp, netdev
In-Reply-To: <1294400130-5604-1-git-send-email-gerrit@erg.abdn.ac.uk>

From: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Date: Fri,  7 Jan 2011 12:35:27 +0100

> Hi Dave,
> 
> please find attached 3 bug fixes which recently came up on dccp@vger.
> 
>  Patch #1: fixes a bug which wrongly classified sequence-invalid packets. 
>  Patch #2: fixes a bug in updating the Greatest Sequence number Received (GSR).
>  Patch #3: fixes an inconsistency in setting the sequence window on 32/64 bit.
> 
> I have also placed this in into a fresh (today's) copy of net-next-2.6, on
> 
>     git://eden-feed.erg.abdn.ac.uk/net-next-2.6        [subtree 'dccp']

Pulled, thanks a lot Gerrit.

^ permalink raw reply

* Re: [PATCH 2/2] sky2: convert to new VLAN model (v0.2)
From: David Miller @ 2011-01-09 23:54 UTC (permalink / raw)
  To: jesse; +Cc: shemminger, netdev
In-Reply-To: <AANLkTimyfSJwgcDOQK2hpWdJ08CNCerLM=0+NBA6+VZd@mail.gmail.com>

From: Jesse Gross <jesse@nicira.com>
Date: Sun, 9 Jan 2011 11:13:31 -0500

> On Fri, Jan 7, 2011 at 11:13 PM, Stephen Hemminger
> <shemminger@vyatta.com> wrote:
>> This converts sky2 to new VLAN offload flags control via ethtool.
>> It also allows for transmit offload of vlan tagged frames which
>> was not possible before.
>>
>> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>>
>> ---
>> Changed the setting of vlan_features in this version to keep
>> non-offload settings (GRO|HIGHDMA) even if vlan offload is not
>> enabled.
> 
> Thanks Stephen.
> 
> Reviewed-by: Jesse Gross <jesse@nicira.com>

Applied, thanks everyone.

^ permalink raw reply

* Re: [PATCH 1/2] sky2: fix limited auto negotiation
From: David Miller @ 2011-01-09 23:53 UTC (permalink / raw)
  To: shemminger; +Cc: m.hariri, netdev
In-Reply-To: <20110106204036.1e45e982@nehalam>

From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Thu, 6 Jan 2011 20:40:36 -0800

> The sky2 driver would always try all possible supported speeds even
> if the user only asked for a limited set of speed/duplex combinations.
> 
> Reported-by: Mohsen Hariri <m.hariri@gmail.com>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-2.6 5/5] bnx2x: Update version to 1.60.01-1
From: David Miller @ 2011-01-09 23:50 UTC (permalink / raw)
  To: vladz; +Cc: netdev, eilong
In-Reply-To: <1294575646.31551.20.camel@lb-tlvb-vladz>

From: "Vladislav Zolotarov" <vladz@broadcom.com>
Date: Sun, 9 Jan 2011 14:20:46 +0200

> Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

You made these patches against net-2.6 which was inactive for nearly
a full week as we were largely into the merge window.

I applied these, but since the version number of the driver is now
1.62.x I skipped this last patch.

^ permalink raw reply

* Re: [PATCH net-2.6 4/5] bnx2x: Fix the race on bp->stats_pending.
From: David Miller @ 2011-01-09 23:49 UTC (permalink / raw)
  To: vladz; +Cc: netdev, eilong
In-Reply-To: <1294575634.31551.18.camel@lb-tlvb-vladz>

From: "Vladislav Zolotarov" <vladz@broadcom.com>
Date: Sun, 9 Jan 2011 14:20:34 +0200

> Fix the race on bp->stats_pending between the timer and a LINK_UP event
> handler.
> 
> Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-2.6 3/5] bnx2x: Move to D0 before clearing MSI/MSI-X configuration.
From: David Miller @ 2011-01-09 23:49 UTC (permalink / raw)
  To: vladz; +Cc: netdev, eilong
In-Reply-To: <1294575619.31551.17.camel@lb-tlvb-vladz>

From: "Vladislav Zolotarov" <vladz@broadcom.com>
Date: Sun, 9 Jan 2011 14:20:19 +0200

> Move to D0 before clearing MSI/MSI-X configuration. Otherwise MSI/MSI-X
> won't be cleared.
> 
> Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-2.6 2/5] bnx2x: registers dump fixes
From: David Miller @ 2011-01-09 23:49 UTC (permalink / raw)
  To: vladz; +Cc: netdev, eilong
In-Reply-To: <1294575604.31551.16.camel@lb-tlvb-vladz>

From: "Vladislav Zolotarov" <vladz@broadcom.com>
Date: Sun, 9 Jan 2011 14:20:04 +0200

> Fixes in registers dump:
>         - Properly calculate dump length for 57712.
>         - Prevent HW blocks parity attentions when dumping registers in order to
> prevent false parity errors handling.
>         - Update the bnx2x_dump.h file: old one had a few bugs that could cause
> fatal HW error as a result of a registers dump.
> 
> Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied.

^ permalink raw reply

* Re: [PATCH net-2.6 1/5] bnx2x: Don't prevent RSS configuration in INT#x and MSI interrupt modes.
From: David Miller @ 2011-01-09 23:49 UTC (permalink / raw)
  To: vladz; +Cc: netdev, eilong
In-Reply-To: <1294575580.31551.12.camel@lb-tlvb-vladz>

From: "Vladislav Zolotarov" <vladz@broadcom.com>
Date: Sun, 9 Jan 2011 14:19:40 +0200

> Don't prevent RSS configuration in INT#x and MSI interrupt modes. Otherwise
> Rx hash key won't be available.
> 
> Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied.

^ permalink raw reply

* Re: [PATCH] hamradio: Resolve memory leak due to missing firmware release in add_mcs()
From: David Miller @ 2011-01-09 23:46 UTC (permalink / raw)
  To: jj; +Cc: linux-kernel, netdev, linux-hams, jpr, frible, sailer
In-Reply-To: <alpine.LNX.2.00.1101062146430.13988@swampdragon.chaosbits.net>

From: Jesper Juhl <jj@chaosbits.net>
Date: Thu, 6 Jan 2011 21:50:29 +0100 (CET)

> 
> Failure to release_firmware() in drivers/net/hamradio/yam.c::add_mcs() 
> causes memory leak.
> This patch should fix it.
> 
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>

Applied.

^ permalink raw reply

* Re: [PATCH v2] Madge Ambassador ATM Adapter driver: Always release_firmware() in ucode_init() and don't leak memory.
From: David Miller @ 2011-01-09 23:46 UTC (permalink / raw)
  To: jj; +Cc: chas, linux-atm-general, netdev, linux-kernel
In-Reply-To: <alpine.LNX.2.00.1101092229160.633@swampdragon.chaosbits.net>

From: Jesper Juhl <jj@chaosbits.net>
Date: Sun, 9 Jan 2011 22:32:38 +0100 (CET)

> Failure to call release_firmware() will result in memory leak in
> drivers/atm/ambassador.c::ucode_init().
> This patch makes sure we always call release_firmware() when needed, 
> thus removing the leak(s).
> 
> Yes, I know checkpatch complains about this patch, but it was either that 
> or completely mess up the existing style, so I opted to use the existing 
> style and live with the checkpatch related flak.
> 
> 
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>

Applied.

^ permalink raw reply

* Re: [PATCH v4 00/10] net/fec: add dual fec support for i.MX28
From: David Miller @ 2011-01-09 23:44 UTC (permalink / raw)
  To: shawn.guo
  Cc: gerg, baruch, eric, bryan.wu, r64343, B32542, u.kleine-koenig, lw,
	w.sang, s.hauer, jamie, jamie, netdev, linux-arm-kernel
In-Reply-To: <1294297998-26930-1-git-send-email-shawn.guo@freescale.com>

From: Shawn Guo <shawn.guo@freescale.com>
Date: Thu, 6 Jan 2011 15:13:08 +0800

> This patch series is to add dual fec support for mx28, which is
> a mxs-based soc. Some code changes related to the following commits
> are also made in this patch set for some reasons.
> 
>  e6b043d512fa8d9a3801bf5d72bfa3b8fc3b3cc8
>  netdev/fec.c: add phylib supporting to enable carrier detection (v2)
> 
>  e3fe8558c7fc182972c3d947d88744482111f304
>  net/fec: fix pm to survive to suspend/resume
> 
> It's been tested on mx28 evk and mx51 babbage. For mx28, it has
> to work against the tree
> 
>  git://git.pengutronix.de/git/imx/linux-2.6.git imx-for-2.6.38
> 
> plus patch
> 
>  [PATCH v4] ARM: mxs: Change duart device to use amba-pl011
> 
> The 3 patches below preceding with * have changes since v3, and
> the detailed change log can be found in individual patch.

I've applied all of the "net/fec:" patches (#1 to #5) to net-2.6,
please push the ARM changes via the appropriate ARM tree.

Thanks.

^ permalink raw reply

* GIT trees refreshed
From: David Miller @ 2011-01-09 23:39 UTC (permalink / raw)
  To: sparclinux; +Cc: netdev, linux-wireless, netfilter-devel


I've synchronized all of my GIT trees to be uptodate with Linus's
tree.

Right now net-2.6 and sparc-2.6 are active for bug fixes.

The "-next" trees will become active once Linus releases 2.6.38-rc1

^ permalink raw reply

* Re: [PATCH] Cleanup include/net/tcp.h include-files and coding-style
From: Ben Hutchings @ 2011-01-09 23:06 UTC (permalink / raw)
  To: christoph.paasch; +Cc: Randy Dunlap, davem, netdev, linux-kernel
In-Reply-To: <201101092333.19406.christoph.paasch@uclouvain.be>

On Sun, 2011-01-09 at 23:33 +0100, Christoph Paasch wrote:
> On Sunday, January 09, 2011 wrote Ben Hutchings:
> > The cost of repeated inclusion is minimal.  GCC's preprocessor
> > recognises when the entire content of a file is conditional on #ifndef
> > FOO and will not even open it again if FOO is defined.
> Thanks, I did not knew about that.
> 
> > If a file directly references definitions that are supposed to be
> > provided by a certain header, changing it to rely on indirect inclusion
> > of that header generally does *not* aid maintenance.
> But then, to be coherent, we would need to add the following includes (and I'm 
> even not 100% sure if it's all we need):
> 
> linux/percpu_counter.h (needed for percpu_counter_sum_positive)

Yes.

> linux/mm_types.h (needed for struct page)
> linux/aio.h (needed for struct kiocb)
> net/inet_sock.h (needed for struct ip_options)
> linux/pipe_fs_i.h (needed for struct pipe_inode_info)
> linux/poll.h (needed for struct poll_table_struct)

Or declarations of those structs.

> linux/compiler.h (needed for __percpu)
[...]

Yes.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply

* Re: [PATCH] Cleanup include/net/tcp.h include-files and coding-style
From: Christoph Paasch @ 2011-01-09 23:06 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: davem, netdev, linux-kernel
In-Reply-To: <201101092339.32378.christoph.paasch@uclouvain.be>


On Sunday, January 09, 2011 wrote Christoph Paasch:
> BTW: shouldn't linux/tcp.h include linux/dmaengine.h ? It has a reference
> to "struct dma_pinned_list"
Ups, sorry for that. The include is at line 209.

I just looked at the head of linux/tcp.h ;)

Christoph

--
Christoph Paasch
PhD Student

IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://inl.info.ucl.ac.be/mptcp
Université Catholique de Louvain

www.rollerbulls.be
--

^ permalink raw reply

* Re: linux-next: manual merge of the security-testing tree with the net tree
From: James Morris @ 2011-01-09 22:48 UTC (permalink / raw)
  To: Casey Schaufler
  Cc: Stephen Rothwell, linux-next, linux-kernel, David Miller, netdev
In-Reply-To: <4D2666D0.9060802@schaufler-ca.com>

On Thu, 6 Jan 2011, Casey Schaufler wrote:

> On 1/6/2011 4:44 PM, Stephen Rothwell wrote:
> > Hi James,
> >
> > Today's linux-next merge of the security-testing tree got a conflict in
> > security/smack/smack_lsm.c between commit
> > 3610cda53f247e176bcbb7a7cca64bc53b12acdb ("af_unix: Avoid socket->sk NULL
> > OOPS in stream connect security hooks") from the net tree and commit
> > b4e0d5f0791bd6dd12a1c1edea0340969c7c1f90 ("Smack: UDS revision") from the
> > security-testing tree.
> >
> > I fixed it up (I think - see below) and can carry the fix as necessary.
> 
> The change looks like it addresses the change in interface. Thank you.

Thanks, applied.


-- 
James Morris
<jmorris@namei.org>

^ permalink raw reply

* Re: [PATCH] Cleanup include/net/tcp.h include-files and coding-style
From: Christoph Paasch @ 2011-01-09 22:39 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: davem, netdev, linux-kernel
In-Reply-To: <20110109223033.GA9485@p183.telecom.by>


On Sunday, January 09, 2011 wrote Alexey Dobriyan:
> DMA stuff "dereferenced" in tcp_prequeue_init().
Well, as far as I can see, tcp_prequeue_init only accesses the ucopy-fields of 
tcp_sock, which are defined in linux/tcp.h.

BTW: shouldn't linux/tcp.h include linux/dmaengine.h ? It has a reference to 
"struct dma_pinned_list"

Christoph
--
Christoph Paasch
PhD Student

IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://inl.info.ucl.ac.be/mptcp
Université Catholique de Louvain

www.rollerbulls.be
--

^ permalink raw reply

* Re: [PATCH] Cleanup include/net/tcp.h include-files and coding-style
From: Christoph Paasch @ 2011-01-09 22:33 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Randy Dunlap, davem, netdev, linux-kernel
In-Reply-To: <1294610141.2823.31.camel@localhost>


On Sunday, January 09, 2011 wrote Ben Hutchings:
> The cost of repeated inclusion is minimal.  GCC's preprocessor
> recognises when the entire content of a file is conditional on #ifndef
> FOO and will not even open it again if FOO is defined.
Thanks, I did not knew about that.

> If a file directly references definitions that are supposed to be
> provided by a certain header, changing it to rely on indirect inclusion
> of that header generally does *not* aid maintenance.
But then, to be coherent, we would need to add the following includes (and I'm 
even not 100% sure if it's all we need):

linux/percpu_counter.h (needed for percpu_counter_sum_positive)
linux/mm_types.h (needed for struct page)
linux/aio.h (needed for struct kiocb)
net/inet_sock.h (needed for struct ip_options)
linux/pipe_fs_i.h (needed for struct pipe_inode_info)
linux/poll.h (needed for struct poll_table_struct)
linux/compiler.h (needed for __percpu)

IMO there should be a clear rule for the inclusion of files.

Personally I think it's best to include as few files as possible. Because I 
think, that this reduces the risk of including a file, whose structs/functions 
aren't even referenced (it's easier to manually check if one include out of 10 
is useless, than checking it for 50).

But ok, there may be other stronger reasons for the opposite.
What are the reasons for including these files?

Regards,
Christoph

--
Christoph Paasch
PhD Student

IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://inl.info.ucl.ac.be/mptcp
Université Catholique de Louvain

www.rollerbulls.be
--

^ permalink raw reply

* Re: panic in tg3 driver
From: Stephen Clark @ 2011-01-09 22:30 UTC (permalink / raw)
  To: Linux Kernel Network Developers; +Cc: Michael Chan, Matt Carlson
In-Reply-To: <4D2334B5.1060408@earthlink.net>

On 01/04/2011 09:54 AM, Stephen Clark wrote:
> Hello,
>
>
> The hardware is an Acrosser AR-M0898B micro box.
>  lspci
> 00:00.0 Host bridge: VIA Technologies, Inc. CN700/VN800/P4M800CE/Pro
> Host Bridge
> 00:00.1 Host bridge: VIA Technologies, Inc. CN700/VN800/P4M800CE/Pro
> Host Bridge
> 00:00.2 Host bridge: VIA Technologies, Inc. CN700/VN800/P4M800CE/Pro
> Host Bridge
> 00:00.3 Host bridge: VIA Technologies, Inc. PT890 Host Bridge
> 00:00.4 Host bridge: VIA Technologies, Inc. CN700/VN800/P4M800CE/Pro
> Host Bridge
> 00:00.7 Host bridge: VIA Technologies, Inc. CN700/VN800/P4M800CE/Pro
> Host Bridge
> 00:01.0 PCI bridge: VIA Technologies, Inc. VT8237/VX700 PCI Bridge
> 00:0f.0 IDE interface: VIA Technologies, Inc. VT8251 Serial ATA
> Controller (rev
> 20)
> 00:0f.1 IDE interface: VIA Technologies, Inc.
> VT82C586A/B/VT82C686/A/B/VT823x/A/
> C PIPC Bus Master IDE (rev 07)
> 00:10.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1
> Controller
>  (rev 91)
> 00:10.1 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1
> Controller
>  (rev 91)
> 00:10.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1
> Controller
>  (rev 91)
> 00:10.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1
> Controller
>  (rev 91)
> 00:10.4 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 90)
> 00:11.0 ISA bridge: VIA Technologies, Inc. VT8251 PCI to ISA Bridge
> 00:11.7 Host bridge: VIA Technologies, Inc. VT8251 Ultra VLINK Controller
> 00:13.0 Host bridge: VIA Technologies, Inc. VT8251 Host Bridge
> 00:13.1 PCI bridge: VIA Technologies, Inc. VT8251 PCI to PCI Bridge
> 02:08.0 Ethernet controller: Broadcom Corporation BCM4401 100Base-T
> (rev 02)
> 02:09.0 Ethernet controller: Broadcom Corporation BCM4401 100Base-T
> (rev 02)
> 80:00.0 PCI bridge: VIA Technologies, Inc. VT8251 PCIE Root Port
> 80:00.1 PCI bridge: VIA Technologies, Inc. VT8251 PCIE Root Port
> 81:00.0 Ethernet controller: Broadcom Corporation NetLink BCM5906M
> Fast Ethernet
>  PCI Express (rev 02)
> 82:00.0 Ethernet controller: Broadcom Corporation NetLink BCM5906M
> Fast Ethernet
>  PCI Express (rev 02)
>
> Kernel 2.6.36-2.el5.elrepo on an i686
>
> When I try to ifconfig either of the BCM5906M ports the system panics.
>
> Ideas, fixes ?
>
> [root@Z1010 ~]# modprobe tg3
> [root@Z1010 ~]# ifconfig eth2 2.2.2.2/24
> ------------[ cut here ]------------
> kernel BUG at drivers/net/tg3.c:4365!
> invalid opcode: 0000 [#1] PREEMPT SMP
> last sysfs file: /sys/class/net/eth3/address
> Modules linked in: tg3 xt_tcpudp ipt_LOG xt_limit xt_state
> iptable_mangle af_ke]
>
> Pid: 20303, comm: kworker/0:2 Not tainted 2.6.36-2.el5.elrepo #1
> CN700-8251/
> EIP: 0060:[<e1c62f19>] EFLAGS: 00010202 CPU: 0
> EIP is at tg3_tx_recover+0x1e/0x53 [tg3]
> EAX: deece4c0 EBX: dfa9c000 ECX: deece4c0 EDX: ffffffff
> ESI: deece4c0 EDI: deece500 EBP: c1801f38 ESP: c1801f30
>  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
> Process kworker/0:2 (pid: 20303, ti=c1801000 task=df0105d0
> task.ti=dee62000)
> Stack:
>  dfa9c000 00000000 c1801f6c e1c630be c1801f6c deece4c0 00000840 00000000
> <0> df251cc0 00000005 00000000 df979800 deece500 deece4c0 00000040
> c1801f94
> <0> e1c661e5 00000000 00000040 c1801f88 e09df1d2 00000000 deece500
> dfab4000
> Call Trace:
>  [<e1c630be>] ? tg3_tx+0x157/0x1a2 [tg3]
>  [<e1c661e5>] ? tg3_poll_work+0x2b/0x10b [tg3]
>  [<e09df1d2>] ? ssb_write32+0x11/0x14 [b44]
>  [<e1c662f9>] ? tg3_poll+0x34/0x9a [tg3]
>  [<c0674058>] ? net_rx_action+0x7e/0x11c
>  [<c04409c9>] ? __do_softirq+0x85/0x10c
>  [<c0440944>] ? __do_softirq+0x0/0x10c
> <IRQ>
>  [<c04404ef>] ? _local_bh_enable_ip+0x68/0x87
>  [<c044051b>] ? local_bh_enable_ip+0xd/0xf
>  [<c046593b>] ? __raw_spin_unlock_bh+0x1c/0x1e
>  [<c06fa4f2>] ? _raw_spin_unlock_bh+0xd/0xf
>  [<e1c6281f>] ? spin_unlock_bh+0xd/0xf [tg3]
>  [<e1c62cbe>] ? tg3_full_unlock+0x10/0x12 [tg3]
>  [<e1c664c7>] ? tg3_reset_task+0xd7/0xe3 [tg3]
>  [<c044ec37>] ? process_one_work+0x10b/0x1bc
>  [<e1c663f0>] ? tg3_reset_task+0x0/0xe3 [tg3]
>  [<c044fd41>] ? worker_thread+0x77/0xf9
>  [<c0453048>] ? kthread+0x60/0x65
>  [<c044fcca>] ? worker_thread+0x0/0xf9
>  [<c0452fe8>] ? kthread+0x0/0x65
>  [<c040337e>] ? kernel_thread_helper+0x6/0x10
> Code: f0 e8 88 ff ff ff 8d 65 f8 5b 5e 5d c3 55 89 e5 56 53 0f 1f 44
> 00 00 f6 8
> EIP: [<e1c62f19>] tg3_tx_recover+0x1e/0x53 [tg3] SS:ESP 0068:c1801f30
> ---[ end trace 82381e9b93e397ad ]---
> Kernel panic - not syncing: Fatal exception in interrupt
> Pid: 20303, comm: kworker/0:2 Tainted: G      D
> 2.6.36-2.el5.elrepo #1
> Call Trace:
>  [<c043b3cd>] panic+0x62/0x15d
>  [<c06fb7d1>] oops_end+0x99/0xa8
>  [<e1c62f19>] ? tg3_tx_recover+0x1e/0x53 [tg3]
>  [<c0405a62>] die+0x58/0x5e
>
> Thanks,
> Steve
>
Additonal info I compiled the latest kernel 2.6.37-rc8+ and still have the problem.
Also boot with noapic I see this in the dmesg log and interrupts are increasing 
like crazy:
tg3.c:v3.115 (October 14, 2010)
tg3 0000:81:00.0: PCI INT A -> Link[LNKA] -> GSI 10 (level, low) -> IRQ 10
tg3 0000:81:00.0: setting latency timer to 64
tg3 0000:81:00.0: PCI: Disallowing DAC for device
tg3 0000:81:00.0: eth2: Tigon3 [partno(BCM95906) rev c002] (PCI Express) MAC add
ress 00:02:b6:36:d1:39
tg3 0000:81:00.0: eth2: attached PHY is 5906 (10/100Base-TX Ethernet) (WireSpeed
[0])
tg3 0000:81:00.0: eth2: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] TSOcap[1]
tg3 0000:81:00.0: eth2: dma_rwctrl[76180000] dma_mask[32-bit]
tg3 0000:82:00.0: PCI INT A -> Link[LNKA] -> GSI 10 (level, low) -> IRQ 10
tg3 0000:82:00.0: setting latency timer to 64
tg3 0000:82:00.0: PCI: Disallowing DAC for device
tg3 0000:82:00.0: eth3: Tigon3 [partno(BCM95906) rev c002] (PCI Express) MAC add
ress 00:02:b6:36:d1:3a
tg3 0000:82:00.0: eth3: attached PHY is 5906 (10/100Base-TX Ethernet) (WireSpeed
[0])
tg3 0000:82:00.0: eth3: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] TSOcap[1]
tg3 0000:82:00.0: eth3: dma_rwctrl[76180000] dma_mask[32-bit]
tg3 0000:81:00.0: irq 40 for MSI/MSI-X
tg3 0000:81:00.0: eth2: No interrupt was generated using MSI. Switching to INTx
mode. Please report this failure to the PCI maintainer and include system chipse
t information
ADDRCONF(NETDEV_UP): eth2: link is not ready
[root@Z1010 ~]# cat /proc/interrupts
            CPU0
   0:        162    XT-PIC-XT-PIC    timer
   1:          2    XT-PIC-XT-PIC    i8042
   2:          0    XT-PIC-XT-PIC    cascade
   3:          1    XT-PIC-XT-PIC
   4:       4863    XT-PIC-XT-PIC    serial
   6:          2    XT-PIC-XT-PIC    floppy
   7:          5    XT-PIC-XT-PIC    ehci_hcd:usb1, uhci_hcd:usb3
   8:          0    XT-PIC-XT-PIC    rtc0
   9:          0    XT-PIC-XT-PIC    acpi
  10:    2334234    XT-PIC-XT-PIC    uhci_hcd:usb2, eth0, eth2

[root@Z1010 ~]# cat /proc/interrupts |grep eth2
  10:   18388914    XT-PIC-XT-PIC    uhci_hcd:usb2, eth0, eth2
[root@Z1010 ~]# cat /proc/interrupts |grep eth2
  10:   18901627    XT-PIC-XT-PIC    uhci_hcd:usb2, eth0, eth2

-- 

"They that give up essential liberty to obtain temporary safety,
deserve neither liberty nor safety."  (Ben Franklin)

"The course of history shows that as a government grows, liberty
decreases."  (Thomas Jefferson)




^ permalink raw reply

* Re: [PATCH] Cleanup include/net/tcp.h include-files and coding-style
From: Alexey Dobriyan @ 2011-01-09 22:30 UTC (permalink / raw)
  To: Christoph Paasch; +Cc: davem, netdev, linux-kernel
In-Reply-To: <1294606534-28522-1-git-send-email-christoph.paasch@uclouvain.be>

On Sun, Jan 09, 2011 at 09:55:34PM +0100, Christoph Paasch wrote:
> This patch reviews the include-files of net/tcp.h
> Several #include where redundant. Some where not directly needed by
> net/tcp.h
> 
> Files, including net/tcp.h where also including some the *.h-files that
> net/tcp.h is already including. Thus, in these files the inclusion of
> the *.h file is unnecessary.
> 
> Redundant includes in net/tcp.h:
> 
> linux/list.h --- included by linux/textsearch.h which is included by
>                  linux/skbuff.h
> linux/slab.h --- included by linux/crypto.h
> linux/cache.h --- included by linux/skbuff.h
> linux/skbuff.h --- included by net/sock.h
> linux/kref.h --- included by linux/kobject.h, which is  included by
>                  linux/device.h, which is included by
>                  linux/dmaengine.h, which is included by
>                  linux/skbuff.h
> net/inet_connection_sock.h --- included by net/inet_hashtables.h
> net/checksum.h --- included by net/sock.h
> net/request_sock.h --- included by net/inet_connection_sock.h
> net/sock.h --- included by net/request_sock.h
> net/snmp.h --- included by net/ip.h
> net/dst.h --- included by net/sock.h
> linux/seq_file.h --- included by net/neighbour.h, which is included by
>                      net/dst.h
> 
> Include-files not directly needed by net/tcp.h:
> 
> linux/percpu.h
> linux/dmaengine.h

DMA stuff "dereferenced" in tcp_prequeue_init().

> net/tcp_states.h
> net/inet_ecn.h

NAK

Where is the logic?

include/net/tcp.h _does_ use kref, so it needs kref.h
include/net/tcp.h _does_ use list_head, so it needs list.h

and so on.

^ permalink raw reply

* Re: [PATCH] Cleanup include/net/tcp.h include-files and coding-style
From: Ben Hutchings @ 2011-01-09 21:55 UTC (permalink / raw)
  To: christoph.paasch; +Cc: Randy Dunlap, davem, netdev, linux-kernel
In-Reply-To: <201101092232.19171.christoph.paasch@uclouvain.be>

On Sun, 2011-01-09 at 22:32 +0100, Christoph Paasch wrote:
> Hello,
> 
> On Sunday, January 09, 2011 wrote Randy Dunlap:
> > On Sun,  9 Jan 2011 21:55:34 +0100 Christoph Paasch wrote:
> > If there is something in net/tcp.h that uses data or functions from
> > <linux/list.h>, then <linux/list.h> should be #included in net/tcp.h,
> > whether some other file pulls it in indirectly or not.
> > 
> > etc. etc. etc.
> Why?
> 
> IMHO I think that it increases compile-time.
> Ok, here in that case it only increases it slightly (probably it isn't even 
> measurable).

The cost of repeated inclusion is minimal.  GCC's preprocessor
recognises when the entire content of a file is conditional on #ifndef
FOO and will not even open it again if FOO is defined.

>  But, if *all* the files would be more strict in including, I'm 
> sure that it would make a difference.
> The less files you include, the faster the compilation will be.
> 
> In net/tcp.h there were even 4 unnecessary included files.
> 
> And, then we would also need to include:
> net/net_namespace.h (for struct net)
> 
> Also, I think that it makes the code more readable and also easier to 
> maintain. The more files we include, the bigger the chance is that we will end 
> up with plenty of files unnecessarily included, and thus the compile-time will 
> explode.

If a file directly references definitions that are supposed to be
provided by a certain header, changing it to rely on indirect inclusion
of that header generally does *not* aid maintenance.

(There are some cases where you should rely on indirect inclusion, such
as where <linux/foo.h> includes <asm/foo.h>.)

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply

* [PATCH][RFC] Allow to use adler32 for SCTP
From: Holger Hans Peter Freyther @ 2011-01-09 21:36 UTC (permalink / raw)
  To: netdev

[-- Attachment #1: Type: text/plain, Size: 782 bytes --]

Hi,

with OpenBSC I have to connect to some equipment that is configured to use
adler32 as the checksum. I wonder if something a long the lines of this patch
is acceptable? It adds a module parameter that globally allows to use adler32
and then there is a sockopt to enable adler32 on a per process basis. For the
receive path I have to decode both checksums.

I could probably just use the code to disable checksums for rx but I will need
to generate them on tx to make the other equipment accept these.

regards
	holger

PS: While adding my field to struct sctp_sock I saw that there are quite some
holes (on both ia32,x86_64) in the struct and that one can save 16byte by
re-ordering. I am not sure how to and if to benchmark such a change. Does it
make sense to re-order those?

[-- Attachment #2: 0001-sctp-Allow-to-use-adler32-as-checksum-for-old-equipm.patch --]
[-- Type: text/x-patch, Size: 11572 bytes --]

>From bc332df3e078e4ddac93415a4e11de018604537a Mon Sep 17 00:00:00 2001
From: Holger Hans Peter Freyther <zecke@selfish.org>
Date: Sun, 9 Jan 2011 21:18:04 +0100
Subject: [PATCH] sctp: Allow to use adler32 as checksum for old equipment

Make it possible to use adler32 for outgoing packets. For
incoming packets add an option to determine the crc32 and
adler32. Discard the packet if the socket was not using the
adler32 checksum.

Signed-off-by: Holger Hans Peter Freyther <zecke@selfish.org>
---
 include/net/sctp/checksum.h |   35 ++++++++++++++++++++++++++++++++
 include/net/sctp/structs.h  |    6 +++++
 include/net/sctp/user.h     |    1 +
 net/sctp/input.c            |   46 +++++++++++++++++++++++++++++++++++++++---
 net/sctp/output.c           |   17 +++++++++++++--
 net/sctp/protocol.c         |    3 ++
 net/sctp/socket.c           |   23 +++++++++++++++++++++
 7 files changed, 124 insertions(+), 7 deletions(-)

diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h
index befc8d2..9111f52 100644
--- a/include/net/sctp/checksum.h
+++ b/include/net/sctp/checksum.h
@@ -1,6 +1,7 @@
 /* SCTP kernel reference Implementation
  * Copyright (c) 1999-2001 Motorola, Inc.
  * Copyright (c) 2001-2003 International Business Machines, Corp.
+ * Copyright (c) 2011 Holger Hans Peter Freyther
  *
  * This file is part of the SCTP kernel reference Implementation
  *
@@ -34,6 +35,7 @@
  *    Dinakaran Joseph
  *    Jon Grimm <jgrimm@us.ibm.com>
  *    Sridhar Samudrala <sri@us.ibm.com>
+ *    Holger Hans Peter Freyther <holger@freyther.de>
  *
  * Rewritten to use libcrc32c by:
  *    Vlad Yasevich <vladislav.yasevich@hp.com>
@@ -45,6 +47,7 @@
 #include <linux/types.h>
 #include <net/sctp/sctp.h>
 #include <linux/crc32c.h>
+#include <linux/zutil.h>
 
 static inline __u32 sctp_crc32c(__u32 crc, u8 *buffer, u16 length)
 {
@@ -81,3 +84,35 @@ static inline __le32 sctp_end_cksum(__be32 crc32)
 {
 	return cpu_to_le32(~crc32);
 }
+
+static inline __u32 sctp_start_cksum_adler(__u8 *buffer, __u16 length)
+{
+	__u32 adler = 1;
+	__u8  zero[sizeof(__u32)] = {0};
+
+	/* Optimize this routine to be SCTP specific, knowing how
+	 * to skip the checksum field of the SCTP header.
+	 */
+
+	/* Calculate adler32 up to the checksum. */
+	adler = zlib_adler32(adler, buffer,
+				sizeof(struct sctphdr) -sizeof(__u32));
+
+	/* Skip checksum field of the header. */
+	adler = zlib_adler32(adler, zero, sizeof(__u32));
+
+	/* Calculate the rest of the adler32. */
+	adler = zlib_adler32(adler, &buffer[sizeof(struct sctphdr)],
+				length - sizeof(struct sctphdr));
+	return adler;
+}
+
+static inline __u32 sctp_update_cksum_adler(__u8 *buffer, __u16 len, __u32 a32)
+{
+	return zlib_adler32(a32, buffer, len);
+}
+
+static inline __u32 sctp_end_cksum_adler(__u32 a32)
+{
+	return htonl(a32);
+}
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index cc9185c..d44eb7a 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -236,6 +236,9 @@ extern struct sctp_globals {
 	 * bits is an indicator of when to send and window update SACK.
 	 */
 	int rwnd_update_shift;
+
+	/* Allow Adler32 as Checksum fallback */
+	int allow_adler32;
 } sctp_globals;
 
 #define sctp_rto_initial		(sctp_globals.rto_initial)
@@ -271,6 +274,7 @@ extern struct sctp_globals {
 #define sctp_auth_enable		(sctp_globals.auth_enable)
 #define sctp_checksum_disable		(sctp_globals.checksum_disable)
 #define sctp_rwnd_upd_shift		(sctp_globals.rwnd_update_shift)
+#define sctp_allow_adler32_csum		(sctp_globals.allow_adler32)
 
 /* SCTP Socket type: UDP or TCP style. */
 typedef enum {
@@ -338,6 +342,8 @@ struct sctp_sock {
 	__u32 adaptation_ind;
 	__u32 pd_point;
 
+	__u8 cksum_adler;
+
 	atomic_t pd_mode;
 	/* Receive to here while partial delivery is in effect. */
 	struct sk_buff_head pd_lobby;
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 2b2769c..427da93 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -103,6 +103,7 @@ typedef __s32 sctp_assoc_t;
 #define SCTP_GET_LOCAL_ADDRS	109		/* Get all local addresss. */
 #define SCTP_SOCKOPT_CONNECTX	110		/* CONNECTX requests. */
 #define SCTP_SOCKOPT_CONNECTX3	111	/* CONNECTX requests (updated) */
+#define SCTP_COMPAT_ADLER_CRC	112	/* User ADLER32 for the checksum. */
 
 /*
  * 5.2.1 SCTP Initiation Structure (SCTP_INIT)
diff --git a/net/sctp/input.c b/net/sctp/input.c
index ea21924..471e048 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -5,6 +5,7 @@
  * Copyright (c) 2001 Intel Corp.
  * Copyright (c) 2001 Nokia, Inc.
  * Copyright (c) 2001 La Monte H.P. Yarroll
+ * Copyright (c) 2011 Holger Hans Peter Freyther
  *
  * This file is part of the SCTP kernel implementation
  *
@@ -43,6 +44,7 @@
  *    Daisy Chang <daisyc@us.ibm.com>
  *    Sridhar Samudrala <sri@us.ibm.com>
  *    Ardelle Fan <ardelle.fan@intel.com>
+ *    Holger Hans Peter Freyther <holger@freyther.de>
  *
  * Any bugs reported given to us we will try to fix... any fixes shared will
  * be incorporated into the next SCTP release.
@@ -80,7 +82,7 @@ static int sctp_add_backlog(struct sock *sk, struct sk_buff *skb);
 
 
 /* Calculate the SCTP checksum of an SCTP packet.  */
-static inline int sctp_rcv_checksum(struct sk_buff *skb)
+static inline int sctp_rcv_checksum_crc32(struct sk_buff *skb)
 {
 	struct sctphdr *sh = sctp_hdr(skb);
 	__le32 cmp = sh->checksum;
@@ -102,6 +104,24 @@ static inline int sctp_rcv_checksum(struct sk_buff *skb)
 	return 0;
 }
 
+static inline int sctp_rcv_checksum_adler32(struct sk_buff *skb)
+{
+	struct sk_buff *list = skb_shinfo(skb)->frag_list;
+	struct sctphdr *sh = sctp_hdr(skb);
+	__u32 cmp = ntohl(sh->checksum);
+	__u32 val = sctp_start_cksum_adler((__u8 *)sh, skb_headlen(skb));
+
+	for (; list; list = list->next)
+		val = sctp_update_cksum_adler((__u8 *)list->data,
+						skb_headlen(list), val);
+
+	val = sctp_end_cksum_adler(val);
+
+	if (val != cmp)
+		return -1;
+	return 0;
+}
+
 struct sctp_input_cb {
 	union {
 		struct inet_skb_parm	h4;
@@ -129,6 +149,8 @@ int sctp_rcv(struct sk_buff *skb)
 	union sctp_addr dest;
 	int family;
 	struct sctp_af *af;
+	int crc32_valid = 0, adler_valid = 0;
+
 
 	if (skb->pkt_type!=PACKET_HOST)
 		goto discard_it;
@@ -144,9 +166,15 @@ int sctp_rcv(struct sk_buff *skb)
 	__skb_pull(skb, skb_transport_offset(skb));
 	if (skb->len < sizeof(struct sctphdr))
 		goto discard_it;
-	if (!sctp_checksum_disable && !skb_csum_unnecessary(skb) &&
-		  sctp_rcv_checksum(skb) < 0)
-		goto discard_it;
+
+	/* Check up to two checksums for each packet */
+	if (!sctp_checksum_disable && !skb_csum_unnecessary(skb)) {
+		crc32_valid = sctp_rcv_checksum_crc32(skb) >= 0;
+		if (!crc32_valid && sctp_allow_adler32_csum)
+			adler_valid = sctp_rcv_checksum_adler32(skb) >= 0;
+		if (!crc32_valid && !adler_valid)
+			goto discard_it;
+	}
 
 	skb_pull(skb, sizeof(struct sctphdr));
 
@@ -188,6 +216,16 @@ int sctp_rcv(struct sk_buff *skb)
 	sk = rcvr->sk;
 
 	/*
+	 * We have the sctp_sock* now and can see if adler32
+	 * fallback is implemented. If not we will have to stop
+	 * processing the packet now.
+	 */
+	if (!crc32_valid && !sctp_sk(sk)->cksum_adler)
+		goto discard_release;
+	else if (!adler_valid && sctp_sk(sk)->cksum_adler)
+		goto discard_release;
+
+	/*
 	 * If a frame arrives on an interface and the receiving socket is
 	 * bound to another interface, via SO_BINDTODEVICE, treat it as OOTB
 	 */
diff --git a/net/sctp/output.c b/net/sctp/output.c
index 60600d3..02b2f26 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -2,6 +2,7 @@
  * (C) Copyright IBM Corp. 2001, 2004
  * Copyright (c) 1999-2000 Cisco, Inc.
  * Copyright (c) 1999-2001 Motorola, Inc.
+ * Copyright (c) 2011 Holger Hans Peter Freyther
  *
  * This file is part of the SCTP kernel implementation
  *
@@ -36,6 +37,7 @@
  *    Karl Knutson          <karl@athena.chicago.il.us>
  *    Jon Grimm             <jgrimm@austin.ibm.com>
  *    Sridhar Samudrala     <sri@us.ibm.com>
+ *    Holger Freyther       <holger@freyther.de>
  *
  * Any bugs reported given to us we will try to fix... any fixes shared will
  * be incorporated into the next SCTP release.
@@ -502,12 +504,21 @@ int sctp_packet_transmit(struct sctp_packet *packet)
 	 */
 	if (!sctp_checksum_disable &&
 	    !(dst->dev->features & (NETIF_F_NO_CSUM | NETIF_F_SCTP_CSUM))) {
-		__u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
-
 		/* 3) Put the resultant value into the checksum field in the
 		 *    common header, and leave the rest of the bits unchanged.
 		 */
-		sh->checksum = sctp_end_cksum(crc32);
+		__u32 crc32;
+
+		if (sctp_sk(sk)->cksum_adler && sctp_allow_adler32_csum) {
+			crc32 = sctp_start_cksum_adler((__u8 *)sh,
+							cksum_buf_len);
+			crc32 = sctp_end_cksum_adler(crc32);
+		} else {
+			crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len);
+			crc32 = sctp_end_cksum(crc32);
+		}
+
+		sh->checksum = crc32;
 	} else {
 		if (dst->dev->features & NETIF_F_SCTP_CSUM) {
 			/* no need to seed psuedo checksum for SCTP */
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index e58f947..f078ef6 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1397,4 +1397,7 @@ MODULE_AUTHOR("Linux Kernel SCTP developers <lksctp-developers@lists.sourceforge
 MODULE_DESCRIPTION("Support for the SCTP protocol (RFC2960)");
 module_param_named(no_checksums, sctp_checksum_disable, bool, 0644);
 MODULE_PARM_DESC(no_checksums, "Disable checksums computing and verification");
+module_param_named(adler_checksums, sctp_allow_adler32_csum, bool, 0644);
+MODULE_PARM_DESC(adler_checksums,
+		"Allow to use adler32 checksums for historic reasons.");
 MODULE_LICENSE("GPL");
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index a09b0dd..e47e39e 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -5,6 +5,7 @@
  * Copyright (c) 2001-2003 Intel Corp.
  * Copyright (c) 2001-2002 Nokia, Inc.
  * Copyright (c) 2001 La Monte H.P. Yarroll
+ * Copyright (c) 2011 Holger Hans Peter Freyther
  *
  * This file is part of the SCTP kernel implementation
  *
@@ -52,6 +53,7 @@
  *    Ryan Layer	    <rmlayer@us.ibm.com>
  *    Anup Pemmaiah         <pemmaiah@cc.usu.edu>
  *    Kevin Gao             <kevin.gao@intel.com>
+ *    Holger Freyther       <holger@freyther.de>
  *
  * Any bugs reported given to us we will try to fix... any fixes shared will
  * be incorporated into the next SCTP release.
@@ -3343,6 +3345,23 @@ static int sctp_setsockopt_del_key(struct sock *sk,
 
 }
 
+static int sctp_setsockopt_adler_crc(struct sock *sk,
+					char __user *optval,
+					int optlen)
+{
+	int val;
+
+	if (optlen < sizeof(int))
+		return -EINVAL;
+	if (get_user(val, (int __user *)optval))
+		return -EFAULT;
+	if (!sctp_allow_adler32_csum)
+		return -EACCES;
+
+	sctp_sk(sk)->cksum_adler = 1;
+	return 0;
+}
+
 
 /* API 6.2 setsockopt(), getsockopt()
  *
@@ -3490,6 +3509,9 @@ SCTP_STATIC int sctp_setsockopt(struct sock *sk, int level, int optname,
 	case SCTP_AUTH_DELETE_KEY:
 		retval = sctp_setsockopt_del_key(sk, optval, optlen);
 		break;
+	case SCTP_COMPAT_ADLER_CRC:
+		retval = sctp_setsockopt_adler_crc(sk, optval, optlen);
+		break;
 	default:
 		retval = -ENOPROTOOPT;
 		break;
@@ -6490,6 +6512,7 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
 	pp = sctp_sk(oldsk)->bind_hash;
 	sk_add_bind_node(newsk, &pp->owner);
 	sctp_sk(newsk)->bind_hash = pp;
+	sctp_sk(newsk)->cksum_adler = sctp_sk(oldsk)->cksum_adler;
 	inet_sk(newsk)->inet_num = inet_sk(oldsk)->inet_num;
 	sctp_spin_unlock(&head->lock);
 	sctp_local_bh_enable();
-- 
1.7.3.4


^ permalink raw reply related

* [PATCH v2] Madge Ambassador ATM Adapter driver: Always release_firmware() in ucode_init() and don't leak memory.
From: Jesper Juhl @ 2011-01-09 21:32 UTC (permalink / raw)
  To: chas williams - CONTRACTOR; +Cc: linux-atm-general, netdev, linux-kernel
In-Reply-To: <20110107100239.28032e5d@thirdoffive.cmf.nrl.navy.mil>

On Fri, 7 Jan 2011, chas williams - CONTRACTOR wrote:

> instead of duplicating the same section again and again, could you
> write something like:
> 
> 	errmsg = "no start record";
> 	goto fail;
> 
> 	...
> 
> 	errmsg = "record to long"
> 	goto fail;
> 
> 	.... whatever ...
> 
> 	return 0;
> 
> fail:
> 	release_firmware(fw)
> 	PRINTK(KERN_ERR, "Bad microcode data (%s)\n", errmsg);
> 	return -EINVAL;
> }
> 

Sure, we can do that instead.

Failure to call release_firmware() will result in memory leak in
drivers/atm/ambassador.c::ucode_init().
This patch makes sure we always call release_firmware() when needed, 
thus removing the leak(s).

Yes, I know checkpatch complains about this patch, but it was either that 
or completely mess up the existing style, so I opted to use the existing 
style and live with the checkpatch related flak.


Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 ambassador.c |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

  compile tested only.

diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index ffe9b65..9f47e86 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -1926,8 +1926,9 @@ static int __devinit ucode_init (loader_block * lb, amb_dev * dev) {
   const struct firmware *fw;
   unsigned long start_address;
   const struct ihex_binrec *rec;
+  const char *errmsg = 0;
   int res;
-  
+
   res = request_ihex_firmware(&fw, "atmsar11.fw", &dev->pci_dev->dev);
   if (res) {
     PRINTK (KERN_ERR, "Cannot load microcode data");
@@ -1937,8 +1938,8 @@ static int __devinit ucode_init (loader_block * lb, amb_dev * dev) {
   /* First record contains just the start address */
   rec = (const struct ihex_binrec *)fw->data;
   if (be16_to_cpu(rec->len) != sizeof(__be32) || be32_to_cpu(rec->addr)) {
-    PRINTK (KERN_ERR, "Bad microcode data (no start record)");
-    return -EINVAL;
+    errmsg = "no start record";
+    goto fail;
   }
   start_address = be32_to_cpup((__be32 *)rec->data);
 
@@ -1950,12 +1951,12 @@ static int __devinit ucode_init (loader_block * lb, amb_dev * dev) {
     PRINTD (DBG_LOAD, "starting region (%x, %u)", be32_to_cpu(rec->addr),
 	    be16_to_cpu(rec->len));
     if (be16_to_cpu(rec->len) > 4 * MAX_TRANSFER_DATA) {
-	    PRINTK (KERN_ERR, "Bad microcode data (record too long)");
-	    return -EINVAL;
+	    errmsg = "record too long";
+	    goto fail;
     }
     if (be16_to_cpu(rec->len) & 3) {
-	    PRINTK (KERN_ERR, "Bad microcode data (odd number of bytes)");
-	    return -EINVAL;
+	    errmsg = "odd number of bytes";
+	    goto fail;
     }
     res = loader_write(lb, dev, rec);
     if (res)
@@ -1970,6 +1971,10 @@ static int __devinit ucode_init (loader_block * lb, amb_dev * dev) {
     res = loader_start(lb, dev, start_address);
 
   return res;
+fail:
+  release_firmware(fw);
+  PRINTK(KERN_ERR, "Bad microcode data (%s)", errmsg);
+  return -EINVAL;
 }
 
 /********** give adapter parameters **********/



-- 
Jesper Juhl <jj@chaosbits.net>            http://www.chaosbits.net/
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please.

^ permalink raw reply related

* Re: [PATCH] Cleanup include/net/tcp.h include-files and coding-style
From: Christoph Paasch @ 2011-01-09 21:32 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: davem, netdev, linux-kernel
In-Reply-To: <20110109130608.5c7bb4b0.rdunlap@xenotime.net>

Hello,

On Sunday, January 09, 2011 wrote Randy Dunlap:
> On Sun,  9 Jan 2011 21:55:34 +0100 Christoph Paasch wrote:
> If there is something in net/tcp.h that uses data or functions from
> <linux/list.h>, then <linux/list.h> should be #included in net/tcp.h,
> whether some other file pulls it in indirectly or not.
> 
> etc. etc. etc.
Why?

IMHO I think that it increases compile-time.
Ok, here in that case it only increases it slightly (probably it isn't even 
measurable). But, if *all* the files would be more strict in including, I'm 
sure that it would make a difference.
The less files you include, the faster the compilation will be.

In net/tcp.h there were even 4 unnecessary included files.

And, then we would also need to include:
net/net_namespace.h (for struct net)

Also, I think that it makes the code more readable and also easier to 
maintain. The more files we include, the bigger the chance is that we will end 
up with plenty of files unnecessarily included, and thus the compile-time will 
explode.

Regards,
Christoph

--
Christoph Paasch
PhD Student

IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://inl.info.ucl.ac.be/mptcp
Université Catholique de Louvain

www.rollerbulls.be
--

^ permalink raw reply

* Re: [PATCH] netfilter:  fix  race in conntrack between dump_table and destroy
From: Pablo Neira Ayuso @ 2011-01-09 21:32 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Eric Dumazet, Patrick McHardy, Paul E. McKenney, netdev,
	netfilter-devel
In-Reply-To: <20101126135101.4e4b97cc@nehalam>

On 26/11/10 22:51, Stephen Hemminger wrote:
> The netlink interface to dump the connection tracking table has a race
> when entries are deleted at the same time. A customer reported a crash 
> and the backtrace showed thatctnetlink_dump_table was running while a 
> conntrack entry wasbeing destroyed.
> (see https://bugzilla.vyatta.com/show_bug.cgi?id=6402).
> 
> According to RCU documentation, when using hlist_nulls the reader
> must handle the case of seeing a deleted entry and not proceed
> further down the linked list.  The old code would continue
> which caused the scan to walk into the free list. 
> 
> This patch uses locking (rather than RCU) for this operation which
> is guaranteed safe, and no longer requires getting reference while
> doing dump operation.

I have put this in my tree:

http://1984.lsi.us.es/git/?p=net-2.6/.git;a=summary

I'll pass it to David for -stable inclusion.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox