Bob Copeland [Tue, 1 Sep 2009 22:12:11 +0000 (18:12 -0400)]
cfg80211: fix looping soft lockup in find_ie()
The find_ie() function uses a size_t for the len parameter, and
directly uses len as a loop variable. If any received packets
are malformed, it is possible for the decrease of len to overflow,
and since the result is unsigned, the loop will not terminate.
Change it to a signed int so the loop conditional works for
negative values.
This fixes the following soft lockup:
[38573.102007] BUG: soft lockup - CPU#0 stuck for 61s! [phy0:2230]
[38573.102007] Modules linked in: aes_i586 aes_generic fuse af_packet ipt_REJECT xt_tcpudp nf_conntrack_ipv4 nf_defrag_ipv4 xt_state iptable_filter ip_tables x_tables acpi_cpufreq binfmt_misc dm_mirror dm_region_hash dm_log dm_multipath dm_mod kvm_intel kvm uinput i915 arc4 ecb drm snd_hda_codec_idt ath5k snd_hda_intel hid_apple mac80211 usbhid appletouch snd_hda_codec snd_pcm ath cfg80211 snd_timer i2c_algo_bit ohci1394 video snd processor ieee1394 rfkill ehci_hcd sg sky2 backlight snd_page_alloc uhci_hcd joydev output ac thermal button battery sr_mod applesmc cdrom input_polldev evdev unix [last unloaded: scsi_wait_scan]
[38573.102007] irq event stamp:
2547724535
[38573.102007] hardirqs last enabled at (
2547724534): [<
c1002ffc>] restore_all_notrace+0x0/0x18
[38573.102007] hardirqs last disabled at (
2547724535): [<
c10038f4>] apic_timer_interrupt+0x28/0x34
[38573.102007] softirqs last enabled at (
92950144): [<
c103ab48>] __do_softirq+0x108/0x210
[38573.102007] softirqs last disabled at (
92950274): [<
c1348e74>] _spin_lock_bh+0x14/0x80
[38573.102007]
[38573.102007] Pid: 2230, comm: phy0 Tainted: G W (2.6.31-rc7-wl #8) MacBook1,1
[38573.102007] EIP: 0060:[<
f8ea2d50>] EFLAGS:
00010292 CPU: 0
[38573.102007] EIP is at cmp_ies+0x30/0x180 [cfg80211]
[38573.102007] EAX:
00000082 EBX:
00000000 ECX:
ffffffc1 EDX:
d8efd014
[38573.102007] ESI:
ffffff7c EDI:
0000004d EBP:
eee2dc50 ESP:
eee2dc3c
[38573.102007] DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
[38573.102007] CR0:
8005003b CR2:
d8efd014 CR3:
01694000 CR4:
000026d0
[38573.102007] DR0:
00000000 DR1:
00000000 DR2:
00000000 DR3:
00000000
[38573.102007] DR6:
ffff0ff0 DR7:
00000400
[38573.102007] Call Trace:
[38573.102007] [<
f8ea2f8d>] cmp_bss+0xed/0x100 [cfg80211]
[38573.102007] [<
f8ea33e4>] cfg80211_bss_update+0x84/0x410 [cfg80211]
[38573.102007] [<
f8ea3884>] cfg80211_inform_bss_frame+0x114/0x180 [cfg80211]
[38573.102007] [<
f97255ff>] ieee80211_bss_info_update+0x4f/0x180 [mac80211]
[38573.102007] [<
f972b118>] ieee80211_rx_bss_info+0x88/0xf0 [mac80211]
[38573.102007] [<
f9739297>] ? ieee802_11_parse_elems+0x27/0x30 [mac80211]
[38573.102007] [<
f972b224>] ieee80211_rx_mgmt_probe_resp+0xa4/0x1c0 [mac80211]
[38573.102007] [<
f972bc59>] ieee80211_sta_rx_queued_mgmt+0x919/0xc50 [mac80211]
[38573.102007] [<
c1009707>] ? sched_clock+0x27/0xa0
[38573.102007] [<
c1009707>] ? sched_clock+0x27/0xa0
[38573.102007] [<
c105ffd0>] ? mark_held_locks+0x60/0x80
[38573.102007] [<
c1348be5>] ? _spin_unlock_irqrestore+0x55/0x70
[38573.102007] [<
c134baa5>] ? sub_preempt_count+0x85/0xc0
[38573.102007] [<
c1348bce>] ? _spin_unlock_irqrestore+0x3e/0x70
[38573.102007] [<
c12c1c0f>] ? skb_dequeue+0x4f/0x70
[38573.102007] [<
f972c021>] ieee80211_sta_work+0x91/0xb80 [mac80211]
[38573.102007] [<
c1009707>] ? sched_clock+0x27/0xa0
[38573.102007] [<
c134baa5>] ? sub_preempt_count+0x85/0xc0
[38573.102007] [<
c10479af>] worker_thread+0x18f/0x320
[38573.102007] [<
c104794e>] ? worker_thread+0x12e/0x320
[38573.102007] [<
c1348be5>] ? _spin_unlock_irqrestore+0x55/0x70
[38573.102007] [<
f972bf90>] ? ieee80211_sta_work+0x0/0xb80 [mac80211]
[38573.102007] [<
c104cbb0>] ? autoremove_wake_function+0x0/0x50
[38573.102007] [<
c1047820>] ? worker_thread+0x0/0x320
[38573.102007] [<
c104c854>] kthread+0x84/0x90
[38573.102007] [<
c104c7d0>] ? kthread+0x0/0x90
[38573.102007] [<
c1003ab7>] kernel_thread_helper+0x7/0x10
Cc: stable@kernel.org
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Luis R. Rodriguez [Tue, 1 Sep 2009 15:22:46 +0000 (08:22 -0700)]
wireless: remove mac80211 rate selection extra menu
We can just display this upon enabling mac80211 with an
'if MAC80211 != n' check.
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Luis R. Rodriguez [Tue, 1 Sep 2009 15:22:43 +0000 (08:22 -0700)]
wireless: update reg debug kconfig entry
Refer to the wireless wiki for more information.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Luis R. Rodriguez [Tue, 1 Sep 2009 15:22:40 +0000 (08:22 -0700)]
wireless: update top level wireless driver entry
Change it to a menuconfig to give it some documentation, to
refer users to our wireless wiki for extra resources and
documentation. It seems our wiki is still obscure to some.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Samuel Ortiz [Tue, 1 Sep 2009 13:14:06 +0000 (15:14 +0200)]
iwmc3200wifi: Add a last_fw_err debugfs entry
In order to check what was the last fw error we got accross resets, we add
this debugfs entry. It displays the complete ASSERT information.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Samuel Ortiz [Tue, 1 Sep 2009 13:14:05 +0000 (15:14 +0200)]
iwmc3200wifi: Handle UMAC stalls and UMAC assert properly
When UMAC stalls or asserts, we want to reset the device. But when we're
associated, the current reset worker will end up calling
cfg80211_connect_result() with the cfg80211 sme layer knowing that we're
reassociating. That ends up with some ugly warnings.
With this patch we're telling the upper layer that we've roamed if
reassociation succeeds, and that we're disconnected if it fails.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Samuel Ortiz [Tue, 1 Sep 2009 13:14:04 +0000 (15:14 +0200)]
iwmc3200wifi: New initial LMAC calibration
The LMAC calibration API got broken mostly by having a configuration bitmap
being different than the result one.
This patch tries to address that issue by correctly running calibrations with
the newest firmwares, and keeping a backward compatibility fallback path for
older firmwares, where the configuration and result bitmaps were identical.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Zhu Yi [Tue, 1 Sep 2009 13:14:03 +0000 (15:14 +0200)]
iwmc3200wifi: fix misuse of le16_to_cpu
Also mark some functions static.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Zhu Yi [Tue, 1 Sep 2009 13:14:02 +0000 (15:14 +0200)]
iwmc3200wifi: add disconnect work
When the driver receives "connection terminated" event from device,
it could be caused by 2 reasons: the firmware is roaming or the
connection is lost (AP disappears). For the former, an association
complete event is supposed to come within 3 seconds. For the latter,
the driver won't receive any event except the connection terminated.
So we kick a delayed work (5*HZ) when we receive the connection
terminated event. It will be canceled if it turns out to be a roaming
event later. Otherwise we notify SME and userspace the disconnection.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Zhu Yi [Tue, 1 Sep 2009 13:14:01 +0000 (15:14 +0200)]
iwmc3200wifi: use cfg80211_roamed to send roam event
The device sends connection terminated and [re]association success
(or failure) events when roaming occours. The patch uses
cfg80211_roamed instead of cfg80211_connect_result to notify SME
for roaming.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Samuel Ortiz [Tue, 1 Sep 2009 13:14:00 +0000 (15:14 +0200)]
iwmc3200wifi: Fix sparse warning
iwm_cfg80211_get_station() should be static.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Samuel Ortiz [Tue, 1 Sep 2009 13:13:59 +0000 (15:13 +0200)]
iwmc3200wifi: Set WEP key from connect
When connect is called with the LEGACY_PSK authentication type set, and a
proper sme->key, we need to set the WEP key straight after setting the
profile otherwise the authentication will never start.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Zhu Yi [Tue, 1 Sep 2009 13:13:58 +0000 (15:13 +0200)]
iwmc3200wifi: invalidate profile when necessary before connect
If cfg80211 requests to connect when we have already had an active
profile, invalidate the current profile first before sending a new
profile to UMAC.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jussi Kivilinna [Tue, 1 Sep 2009 12:33:11 +0000 (15:33 +0300)]
rndis_wlan: remove 'select WIRELESS_EXT' in Kconfig
Since rndis_wlan is now converted to cfg80211, WIRELESS_EXT isn't
required anymore.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jussi Kivilinna [Tue, 1 Sep 2009 12:33:06 +0000 (15:33 +0300)]
rndis_wlan: fix sparse endianess warnings
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jussi Kivilinna [Tue, 1 Sep 2009 12:33:00 +0000 (15:33 +0300)]
rndis_wlan: cleanup
- remove double newlines between functions
- remove commented out function (rndis_set_config_parameter_u32())
- coding style fix in rndis_set_config_parameter_str()
- add comment banners between function sections
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Jussi Kivilinna [Tue, 1 Sep 2009 12:32:55 +0000 (15:32 +0300)]
rndis_wlan: use bool for on/off switches
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Vasanthakumar Thiagarajan [Tue, 1 Sep 2009 12:16:33 +0000 (17:46 +0530)]
ath9k: Call spin_lock_bh() on btcoex_lock
As generic hw timer interrupt handler is moved to tasklet,
we no more need to call spin_lock_irqsave().
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Vasanthakumar Thiagarajan [Tue, 1 Sep 2009 12:16:32 +0000 (17:46 +0530)]
ath9k: Move generic hw timer intr handler to bottom-half
There is no point handling this in hard irq, move it to
tasklet.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 26 Aug 2009 16:13:17 +0000 (18:13 +0200)]
rfkill: relicense header file
This header file is copied into userspace tools that
need not be GPLv2 licensed, make that easier.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: Iñaky Pérez-González <inaky@linux.intel.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Acked-by: Michael Buesch <mb@bu3sch.de>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Vasanthakumar Thiagarajan [Mon, 31 Aug 2009 12:18:36 +0000 (17:48 +0530)]
ath9k: Do an AHB reset before doing RTC reset
Doing an RTC reset when DMA is active may corrupt memory,
make sure no DMA is active at this moment by doing an
AHB reset.
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Randy Dunlap [Sun, 30 Aug 2009 20:22:57 +0000 (13:22 -0700)]
ipw2200: fix kconfig dependencies
Fix kconfig dependencies for ipw2x00 drivers, fixes build errors:
ERROR: "wiphy_free" [drivers/net/wireless/ipw2x00/libipw.ko] undefined!
ERROR: "wiphy_unregister" [drivers/net/wireless/ipw2x00/libipw.ko] undefined!
ERROR: "wiphy_new" [drivers/net/wireless/ipw2x00/libipw.ko] undefined!
ERROR: "cfg80211_wext_giwname" [drivers/net/wireless/ipw2x00/ipw2200.ko] undefined!
ERROR: "wiphy_register" [drivers/net/wireless/ipw2x00/ipw2200.ko] undefined!
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ivo van Doorn [Sat, 29 Aug 2009 18:30:45 +0000 (20:30 +0200)]
rt2x00: Reorganize padding & L2 padding
The old function rt2x00queue_payload_align() handled
both adding and removing L2 padding and some basic
frame alignment. The entire function was being abused
because it had multiple functions and the header length
argument was somtimes used to align the header instead
of the payload.
Additionally there was a bug when inserting L2 padding
that only the payload was aligned but not the header. This
happens when the header wasn't aligned properly by mac80211,
but rt2x00lib only moves the payload.
A secondary problem was that when removing L2 padding during
TXdone or RX the skb wasn't resized to the proper size.
Split the function into seperate functions each handling
its task as it should.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ivo van Doorn [Sat, 29 Aug 2009 17:10:14 +0000 (19:10 +0200)]
rt2x00: Fix TX status reporting
Not all values of the TX status enumeration were
covered during updating of the TX statistics. This
could lead to wrong bitrate tuning but also wrong
behavior in tools like hostapd.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gábor Stefanik [Fri, 28 Aug 2009 20:36:02 +0000 (22:36 +0200)]
b43: LP-PHY: Fix TX gain tables
The rev1 2GHz and rev2 5GHz gain tables were incorrectly documented
on the specs originally. Update these gaintables to match the cor-
rected specs.
Signed-off-by: Gábor Stefanik <netroller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gábor Stefanik [Fri, 28 Aug 2009 20:34:21 +0000 (22:34 +0200)]
b43: Fix typo in modparam_btcoex description
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gábor Stefanik [Fri, 28 Aug 2009 20:32:17 +0000 (22:32 +0200)]
b43: Add myself to module authors & to LP-PHY file copyright notices
Also mark the LP-PHY driver "802.11a/g" instead of "802.11g",
as LP-PHY is capable of both 2GHz and 5GHz operation.
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gábor Stefanik [Fri, 28 Aug 2009 19:37:00 +0000 (21:37 +0200)]
b43: Refactor and update antenna diversity for A/G-PHY
-Make use of the b43_phy_set/mask/maskset helpers.
-Fix a few errors in the code.
-Make the code more readable.
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reinette Chatre [Fri, 28 Aug 2009 16:58:50 +0000 (09:58 -0700)]
iwl3945: reduce debug noise when default debug flags used
Significant literature suggests users use debug flags 0x43fff - this causes
the debug flags to be set that causes information to be printed for every
received frame - including beacons. In the best case it fills up the logs,
at worst it slows driver down and causes failures due to timeouts.
In the RX handler, print debugging only if user requested RX debugging.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reinette Chatre [Fri, 28 Aug 2009 16:44:49 +0000 (09:44 -0700)]
iwlwifi: fix situation in which debug message is printed
3945 does not have update_chain_flags defined and because if this we always
see the debug message that does not apply to it. Add a check to be specific
about what is actually happening.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 28 Aug 2009 16:44:48 +0000 (09:44 -0700)]
iwlwifi: use sleep interval succession
Some concerns were raised about the automatic adjustment
of sleep intervals to all the same, potentially high,
value, and I can imagine the hardware behaving better
when we don't ask too much of it.
So let's convert to use a succession of sleep levels
when requesting to go to deeper sleeps (which can only
happen with large DTIM intervals), using the succession
values from power level three, which have the benefit of
also having been tested extensively already.
As a result, the automatic sleep level adjustment will
now be mostly equivalent to power level three, except
for the RX/TX timeouts and possibly using smaller sleep
vectors to account for networking latency.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Daniel C Halperin [Fri, 28 Aug 2009 16:44:47 +0000 (09:44 -0700)]
iwlwifi: use iwl_hwrate_get_mac80211_idx where appropriate
For HT packets, mac80211 expects the rate_idx to be an MCS number, which is the
lower byte of rate_n_flags. However, iwl_hwrate_to_plcp_idx takes the MCS
number and reduces it down to the range 0-8 (6 to 60 Mbps), removing the bits
that signify multiply streams, HT40 Duplicate mode, or unequal modulation.
This version is used for various internal purposes through the driver.
Add the function iwl_hwrate_get_mac80211_idx, an alternate version which takes
the rate and the band and returns the mac80211 index (MCS, for HT packets, and
PLCP rate, for legacy packets).
Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Daniel C Halperin [Fri, 28 Aug 2009 16:44:46 +0000 (09:44 -0700)]
iwlwifi: remove incorrect uses of ieee80211_get_tx_rate to prevent TX stall
Refactor and correct rate selection for outgoing transmitted
packets.
First, note that HT rates in the mac80211 rate table do not provide valid
indices when ieee80211_get_tx_rate is called; the check to see if we could to
abort a transmission early in iwl_tx_skb() would thus occasionally read invalid
memory and occasionally stall transmission (if the erroneous byte was 0xff).
We remove that code; the check wasn't valid anyway.
Second, iwl_tx_cmd_build_rate() also called ieee80211_get_tx_rate to be used
for sending management packets, which do not use the uCode station table. This
patch refactors that function and adds comments to enhance legibility, replaces
the call to ieee80211_get_tx_rate() with a direct lookup, and adds error
handling in case the table entry is invalid.
Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Daniel C Halperin [Fri, 28 Aug 2009 16:44:45 +0000 (09:44 -0700)]
iwlwifi: remove 60 Mbps from sband bitrates table
ieee80211_supported_band is supposed to only contain legacy rates in the
bitrates table (HT rates go in the ieee80211_sta_ht_cap substruct). Make
iwlwifi driver obey this restriction by removing the 60 Mbps rate. Also, clean
up a few pieces of other code that formerly relied on 60 Mbps being in
sband->bitrates.
Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Joe Perches [Tue, 25 Aug 2009 08:52:00 +0000 (08:52 +0000)]
s2io: Generate complete messages using single line DBG_PRINTs
Single line log messages should be emitted by a single call
where possible.
Converted multiple calls to DBG_PRINT to single call form.
Removed "s2io:" preface from DBG_PRINTs.
The DBG_PRINT macro now emits a log level and is surrounded by
a do {...} while (0)
All s2io log output is now prefaced with KBUILD_MODNAME ": "
via pr_fmt.
The DBG_PRINT macro should probably be converted to use the
dev_<level> form eventually.
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Perches [Mon, 24 Aug 2009 17:29:48 +0000 (17:29 +0000)]
s2io.c: Convert skipped nic->config.tx_cfg[i]. to tx_cfg->
Missed doing the conversion in earlier patch.
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Perches [Mon, 24 Aug 2009 17:29:47 +0000 (17:29 +0000)]
s2io.c: Standardize statistics accessors
Regularize the declaration and uses of
struct config_param *config = &sp->config;
struct mac_info *mac_control = &sp->mac_control;
and use
struct stat_block *stats = mac_control->stats_info;
struct swStat *swstats = &stats->sw_stat;
struct xpakStat *xstats = &stats->xpak_stat;
and convert the longish uses like
nic->mac_control.stats_info->sw_stat.<foo>
to
swstats-><foo>
etc.
This also makes the statistics code marginally smaller
and presumably faster.
Old:
$ size s2io.o
text data bss dec hex filename
114289 516 33360 148165 242c5 s2io.o
New:
$ size s2io.o
text data bss dec hex filename
114097 516 33360 147973 24205 s2io.o
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Perches [Mon, 24 Aug 2009 17:29:46 +0000 (17:29 +0000)]
s2io.c: fix spelling explaination
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Perches [Mon, 24 Aug 2009 17:29:45 +0000 (17:29 +0000)]
s2io.c: convert printks to pr_<level>
Fixed trivial typo as well
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Perches [Mon, 24 Aug 2009 17:29:44 +0000 (17:29 +0000)]
s2io.c: Make more conforming to normal kernel style
Still has a few long lines.
checkpatch was:
total: 263 errors, 53 warnings, 8751 lines checked
is:
total: 4 errors, 35 warnings, 8767 lines checked
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Perches [Mon, 24 Aug 2009 17:29:43 +0000 (17:29 +0000)]
s2io.c: use kzalloc
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Perches [Mon, 24 Aug 2009 17:29:42 +0000 (17:29 +0000)]
s2io.c: Use calculated size in kmallocs
Use consistent style. Don't calculate the kmalloc size multiple times
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Perches [Mon, 24 Aug 2009 17:29:41 +0000 (17:29 +0000)]
s2io.c: Shorten code line length by using intermediate pointers
Repeated variable use and line wrapping is hard to read.
Use temp variables instead of direct references.
struct fifo_info *fifo = &mac_control->fifos[i];
struct ring_info *ring = &mac_control->rings[i];
struct tx_fifo_config *tx_cfg = &config->tx_cfg[i];
struct rx_ring_config *rx_cfg = &config->rx_cfg[i];
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Perches [Mon, 24 Aug 2009 17:29:40 +0000 (17:29 +0000)]
s2io.c: Use const for strings
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Krishna Kumar [Mon, 31 Aug 2009 05:20:28 +0000 (22:20 -0700)]
pkt_sched: Fix resource limiting in pfifo_fast
pfifo_fast_enqueue has this check:
if (skb_queue_len(list) < qdisc_dev(qdisc)->tx_queue_len) {
which allows each band to enqueue upto tx_queue_len skbs for a
total of 3*tx_queue_len skbs. I am not sure if this was the
intention of limiting in qdisc.
Patch compiled and 32 simultaneous netperf testing ran fine. Also:
# tc -s qdisc show dev eth2
qdisc pfifo_fast 0: root bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
Sent
16835026752 bytes 373116 pkt (dropped 0, overlimits 0 requeues 25)
rate 0bit 0pps backlog 0b 0p requeues 25
Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Krishna Kumar [Sat, 29 Aug 2009 20:21:36 +0000 (20:21 +0000)]
net: convert remaining non-symbolic return values in dev_queue_xmit
Patch compiled and 32 simultaneous netperf testing ran fine.
Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Krishna Kumar [Sat, 29 Aug 2009 20:21:21 +0000 (20:21 +0000)]
netdevice: Consolidate to use existing macros where available.
Patch compiled and 32 simultaneous netperf testing ran fine.
Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Oliver Hartkopp [Sat, 29 Aug 2009 06:45:09 +0000 (06:45 +0000)]
can: use correct NET_RX_ return values
Dropped skb's should be documented by an appropriate return value.
Use the correct NET_RX_DROP and NET_RX_SUCCESS values for that reason.
Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
roel kluin [Thu, 20 Aug 2009 04:04:40 +0000 (04:04 +0000)]
WAN: bit and/or confusion
Fix the tests that check whether Frame* bits are not set
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Anton Vorontsov [Thu, 27 Aug 2009 07:35:57 +0000 (07:35 +0000)]
ucc_geth: Implement suspend/resume and Wake-On-LAN support
This patch implements suspend/resume and WOL support for UCC Ethernet
driver.
We support two wake up events: wake on PHY/link changes and wake
on magic packet.
In some CPUs (like MPC8569) QE shuts down during sleep, so magic packet
detection is unusable, and also on resume we should fully reinitialize
UCC structures.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Anton Vorontsov [Thu, 27 Aug 2009 07:35:56 +0000 (07:35 +0000)]
ucc_geth: Remove UGETH_MAGIC_PACKET Kconfig symbol and code
This patch removes currently unused UGETH_MAGIC_PACKET Kconfig symbol
and code, i.e. magic_packet_detection_{enable,disable} functions.
The two functions each contain just two steps that we'll place into
suspend/resume code path under CONFIG_PM.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Anton Vorontsov [Thu, 27 Aug 2009 07:35:54 +0000 (07:35 +0000)]
ucc_geth: Factor out MAC initialization steps into a call
This patch factors out MAC initialization into ucc_geth_init_mac()
function that we'll use for suspend/resume.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Anton Vorontsov [Thu, 27 Aug 2009 07:35:50 +0000 (07:35 +0000)]
powerpc/qe: Implement qe_alive_during_sleep() helper function
In some CPUs (i.e. MPC8569) QE shuts down completely during sleep,
drivers may want to know that to reinitialize registers and buffer
descriptors.
This patch implements qe_alive_during_sleep() helper function, so far
it just checks if MPC8569-compatible power management controller is
present, which is a sign that QE turns off during sleep.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Anton Vorontsov [Thu, 27 Aug 2009 07:35:47 +0000 (07:35 +0000)]
ucc_geth: Fix NULL pointer dereference in uec_get_ethtool_stats()
In commit
3e73fc9a12679a546284d597c1f19165792d0b83 ("ucc_geth: Fix IO
memory (un)mapping code") I fixed ug_regs IO memory leak by properly
freeing the allocated memory. But ethtool_stats() callback doesn't
check for ug_regs being NULL, and that causes following oops if
'ethtool -S' is executed on a closed eth device:
Unable to handle kernel paging request for data at address 0x00000180
Faulting instruction address: 0xc0208228
Oops: Kernel access of bad area, sig: 11 [#1]
...
NIP [
c0208228] uec_get_ethtool_stats+0x38/0x140
LR [
c02559a0] ethtool_get_stats+0xf8/0x23c
Call Trace:
[
ef87bcd0] [
c025597c] ethtool_get_stats+0xd4/0x23c (unreliable)
[
ef87bd00] [
c025706c] dev_ethtool+0xfe8/0x11bc
[
ef87be00] [
c0252b5c] dev_ioctl+0x454/0x6a8
...
---[ end trace
77fff1162a9586b0 ]---
Segmentation fault
This patch fixes the issue.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 31 Aug 2009 04:30:39 +0000 (21:30 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/holtmann/bluetooth-next-2.6
Matt Carlson [Fri, 28 Aug 2009 14:03:44 +0000 (14:03 +0000)]
tg3: Update version to 3.101
This patch updates the tg3 version to 3.101.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Fri, 28 Aug 2009 14:03:21 +0000 (14:03 +0000)]
tg3: Move per-int tx members to a per-int struct
This patch moves the tx_prod, tx_cons, tx_pending, tx_ring, and
tx_buffers transmit ring device members to a per-interrupt structure.
It also adds a new transmit producer mailbox member (prodmbox) and
converts the code to use it rather than a preprocessor constant.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Fri, 28 Aug 2009 14:03:01 +0000 (14:03 +0000)]
tg3: Move per-int rx members to per-int struct
This patch moves the rx_rcb, rx_rcb_mapping, and rx_rcb_ptr return ring
device members to a per-interrupt structure. It also adds a new return
ring consumer mailbox register member (consmbox) and converts the code
to use it rather than a preprocessor constant.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Fri, 28 Aug 2009 14:02:40 +0000 (14:02 +0000)]
tg3: Move general int members to a per-int struct
This patch moves the last_tag, last_tag_irq, and hw_status device
members to a per-interrupt structure. It also adds a new interrupt
mailbox member (int_mbox) and converts the code to use it rather than a
direct preprocessor constant.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Fri, 28 Aug 2009 14:02:18 +0000 (14:02 +0000)]
tg3: Convert napi handlers to use tnapi
This patch converts the napi interrupt handler functions to accept and
use tg3_napi structures.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Fri, 28 Aug 2009 14:01:57 +0000 (14:01 +0000)]
tg3: Convert ISR parameter to tnapi
This patch migrates the ISR parameter from struct net_device to struct
tg3_napi. Checkpatch complains about the existence of the preexisting
IRQF_SAMPLE_RANDOM flag. I've opted to keep this patch conservative and
let it continue to exist until the flag gets officially purged from the
kernel.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Fri, 28 Aug 2009 14:01:37 +0000 (14:01 +0000)]
tg3: Move napi to per-int struct
This patch creates a per-interrupt data structure, moves the napi
member over, and creates a tg3 pointer back to the device structure.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Fri, 28 Aug 2009 14:01:15 +0000 (14:01 +0000)]
tg3: Cleanup interrupt setup / teardown
Later patches will be adding MSIX support, which will complicate
interrupt initialization. This patch prepares for the integration by
breaking out the interrupt setup and teardown code into separate
functions and cleaning up the error return paths.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Fri, 28 Aug 2009 14:00:55 +0000 (14:00 +0000)]
tg3: Use ext rx bds
The 5717 only uses extended buffer descriptors for the jumbo producer
ring. Extended buffer descriptors are available on all devices that
support a separate jumbo producer ring so make the change universal.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Fri, 28 Aug 2009 14:00:25 +0000 (14:00 +0000)]
tg3: Create a new prodring_set structure
This patch migrates most of the rx producer ring variables to a new
tg3_rx_prodring_set structure and modifies the code accordingly.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Fri, 28 Aug 2009 13:59:57 +0000 (13:59 +0000)]
tg3: Create rx producer ring setup routines
Later patches are going to complicate the ring initialization routines.
This patch breaks out the setup and teardown of the rx producer rings
into separate functions to make the code more readable.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Fri, 28 Aug 2009 13:58:46 +0000 (13:58 +0000)]
tg3: Clarify rx buffer relationships
This patch attempts to document the various rx buffer sizes used by the
driver and how they relate to each other.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Fri, 28 Aug 2009 13:58:24 +0000 (13:58 +0000)]
tg3: Move the JUMBO_CAPABLE and SUPPORT_MSI flags
This patch moves where the jumbo capable and msi support flags are
located. This is prep work for the addition of msix support flags.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Fri, 28 Aug 2009 13:57:12 +0000 (13:57 +0000)]
tg3: Break out mini producer ring handling
This patch separates the code that sets up the mini producer ring from
the code that sets up the jumbo producer rings. The 5717 asic rev
devices do not have a mini ring, but do have a jumbo frame
implementation similar to the 5704 and previous devices.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Fri, 28 Aug 2009 12:29:16 +0000 (12:29 +0000)]
tg3: Reformat NVRAM case statements
This patch fixes up the NVRAM detection switch statements to conform
to the kernel coding style.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Fri, 28 Aug 2009 12:28:45 +0000 (12:28 +0000)]
tg3: Add new 5785 10/100 only device ID
This patch adds a new device ID for those 5785 devices that will only
use 10/100 phys.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Matt Carlson [Fri, 28 Aug 2009 12:27:50 +0000 (12:27 +0000)]
tg3: Delay mdio bus init until fw finishes
The device firmware uses the MDIO bus during early setup. If the driver
modifies the MDIO bus configuration while it is in use by the firmware,
any number of bad things can happen. This patch delays MDIO setup until
after the firmware posts its magic signature, signifying initialization
is complete.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
roel kluin [Thu, 27 Aug 2009 02:03:15 +0000 (02:03 +0000)]
tipc: fix test of bearer_priority range in tipc_register_media()
For the bearer_priority to be less than TIPC_MIN_LINK_PRI and greater than
TIPC_MAX_LINK_PRI is logically impossible.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexey Dobriyan [Fri, 28 Aug 2009 09:57:21 +0000 (09:57 +0000)]
can: switch to seq_file
create_proc_read_entry() is going to be removed soon.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Yoshihiro Shimoda [Thu, 27 Aug 2009 23:25:03 +0000 (23:25 +0000)]
net: sh_eth: add value of ether_link pin in platform_data
The method of ETHER_LINK pin is board dependence.
This patch adding paramters are:
- no_ether_link : If set to 1, do not use ETHER_LINK
- ether_link_active_low : If set to 1, ETHER_LINK is active low.
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Rajashekhara, Sudhakar [Wed, 19 Aug 2009 10:39:55 +0000 (10:39 +0000)]
TI DaVinci EMAC: delay DaVinci EMAC initialization
On TI's DA850/OMAP-L138 EVM, MAC address is stored in SPI
flash which is accessed using MTD interface.
This patch delays the initialization of DaVinci EMAC driver
by changing module_init to late_initcall. This helps SPI and
MTD drivers to get initialized before EMAC thereby enabling
EMAC driver to read the MAC address while booting and use it.
Tested with NFS on DM644x, DM6467, DA830/OMAP-L137 and
DA850/OMAP-L138 EVMs.
Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Reviewed-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Krzysztof Halasa [Wed, 19 Aug 2009 23:56:20 +0000 (23:56 +0000)]
WAN/LMC: Fix type_trans().
Fix lmc_proto_type() invocation.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Perches [Mon, 17 Aug 2009 12:29:44 +0000 (12:29 +0000)]
lib/vsprintf.c: Add "%pI6c" - print pointer as compressed ipv6 address
Signed-off-by: Joe Perches <joe@perches.com>
Tested-by: Jens Rosenboom <jens@mcbone.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
John Dykstra [Wed, 19 Aug 2009 09:47:41 +0000 (09:47 +0000)]
tcp: Remove redundant copy of MD5 authentication key
Remove the copy of the MD5 authentication key from tcp_check_req().
This key has already been copied by tcp_v4_syn_recv_sock() or
tcp_v6_syn_recv_sock().
Signed-off-by: John Dykstra <john.dykstra1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Krishna Kumar [Tue, 18 Aug 2009 21:55:59 +0000 (21:55 +0000)]
Speed-up pfifo_fast lookup using a private bitmap
Maintain a per-qdisc bitmap for pfifo_fast giving availability
of skbs for each band. This allows faster lookup for a skb when
there are no high priority skbs. Also, it helps in (rare) cases
when there are no skbs on the list, where an immediate lookup is
faster than iterating through the three bands.
Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David Ward [Sat, 29 Aug 2009 07:04:09 +0000 (00:04 -0700)]
ipv6: Update Neighbor Cache when IPv6 RA is received on a router
When processing a received IPv6 Router Advertisement, the kernel
creates or updates an IPv6 Neighbor Cache entry for the sender --
but presently this does not occur if IPv6 forwarding is enabled
(net.ipv6.conf.*.forwarding = 1), or if IPv6 Router Advertisements
are not accepted (net.ipv6.conf.*.accept_ra = 0), because in these
cases processing of the Router Advertisement has already halted.
This patch allows the Neighbor Cache to be updated in these cases,
while still avoiding any modification to routes or link parameters.
This continues to satisfy RFC 4861, since any entry created in the
Neighbor Cache as the result of a received Router Advertisement is
still placed in the STALE state.
Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Michael Chan [Sat, 29 Aug 2009 07:02:46 +0000 (00:02 -0700)]
bnx2: Update firmware to 5.0.0.j3.
- Better small packet receive performance.
- Better handling of Flow control on 5709.
- Fixed iSCSI TMP ABORT TASK problem.
- Added iSCSI TCP timestamp option.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Octavian Purdila [Sat, 29 Aug 2009 07:00:35 +0000 (00:00 -0700)]
tcp: fix premature termination of FIN_WAIT2 time-wait sockets
There is a race condition in the time-wait sockets code that can lead
to premature termination of FIN_WAIT2 and, subsequently, to RST
generation when the FIN,ACK from the peer finally arrives:
Time TCP header
0.000000 30755 > http [SYN] Seq=0 Win=2920 Len=0 MSS=1460 TSV=282912 TSER=0
0.000008 http > 30755 aSYN, ACK] Seq=0 Ack=1 Win=2896 Len=0 MSS=1460 TSV=...
0.136899 HEAD /1b.html?n1Lg=v1 HTTP/1.0 [Packet size limited during capture]
0.136934 HTTP/1.0 200 OK [Packet size limited during capture]
0.136945 http > 30755 [FIN, ACK] Seq=187 Ack=207 Win=2690 Len=0 TSV=270521...
0.136974 30755 > http [ACK] Seq=207 Ack=187 Win=2734 Len=0 TSV=283049 TSER=...
0.177983 30755 > http [ACK] Seq=207 Ack=188 Win=2733 Len=0 TSV=283089 TSER=...
0.238618 30755 > http [FIN, ACK] Seq=207 Ack=188 Win=2733 Len=0 TSV=283151...
0.238625 http > 30755 [RST] Seq=188 Win=0 Len=0
Say twdr->slot = 1 and we are running inet_twdr_hangman and in this
instance inet_twdr_do_twkill_work returns 1. At that point we will
mark slot 1 and schedule inet_twdr_twkill_work. We will also make
twdr->slot = 2.
Next, a connection is closed and tcp_time_wait(TCP_FIN_WAIT2, timeo)
is called which will create a new FIN_WAIT2 time-wait socket and will
place it in the last to be reached slot, i.e. twdr->slot = 1.
At this point say inet_twdr_twkill_work will run which will start
destroying the time-wait sockets in slot 1, including the just added
TCP_FIN_WAIT2 one.
To avoid this issue we increment the slot only if all entries in the
slot have been purged.
This change may delay the slots cleanup by a time-wait death row
period but only if the worker thread didn't had the time to run/purge
the current slot in the next period (6 seconds with default sysctl
settings). However, on such a busy system even without this change we
would probably see delays...
Signed-off-by: Octavian Purdila <opurdila@ixiacom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jens Låås [Sat, 29 Aug 2009 06:57:15 +0000 (23:57 -0700)]
fib_trie: resize rework
Here is rework and cleanup of the resize function.
Some bugs we had. We were using ->parent when we should use
node_parent(). Also we used ->parent which is not assigned by
inflate in inflate loop.
Also a fix to set thresholds to power 2 to fit halve
and double strategy.
max_resize is renamed to max_work which better indicates
it's function.
Reaching max_work is not an error, so warning is removed.
max_work only limits amount of work done per resize.
(limits CPU-usage, outstanding memory etc).
The clean-up makes it relatively easy to add fixed sized
root-nodes if we would like to decrease the memory pressure
on routers with large routing tables and dynamic routing.
If we'll need that...
Its been tested with 280k routes.
Work done together with Robert Olsson.
Signed-off-by: Jens Låås <jens.laas@its.uu.se>
Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
Sascha Hlusiak [Sat, 29 Aug 2009 06:53:53 +0000 (23:53 -0700)]
sit: allow ip fragmentation when using nopmtudisc to fix package loss
if tunnel parameters have frag_off set to IP_DF, pmtudisc on the ipv4 link
will be performed by deriving the mtu from the ipv4 link and setting the
DF-Flag of the encapsulating IPv4 Header. If fragmentation is needed on the
way, the IPv4 pmtu gets adjusted, the ipv6 package will be resent eventually,
using the new and lower mtu and everyone is happy.
If the frag_off parameter is unset, the mtu for the tunnel will be derived
from the tunnel device or the ipv6 pmtu, which might be higher than the ipv4
pmtu. In that case we must allow the fragmentation of the IPv4 packet because
the IPv6 mtu wouldn't 'learn' from the adjusted IPv4 pmtu, resulting in
frequent icmp_frag_needed and package loss on the IPv6 layer.
This patch allows fragmentation when tunnel was created with parameter
nopmtudisc, like in ipip/gre tunnels.
Signed-off-by: Sascha Hlusiak <contact@saschahlusiak.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Sat, 29 Aug 2009 06:52:01 +0000 (23:52 -0700)]
net: ip_rt_send_redirect() optimization
While doing some forwarding benchmarks, I noticed
ip_rt_send_redirect() is rather expensive, even if send_redirects is
false for the device.
Fix is to avoid two atomic ops, we dont really need to take a
reference on in_dev
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Sat, 29 Aug 2009 06:48:54 +0000 (23:48 -0700)]
tcp: keepalive cleanups
Introduce keepalive_probes(tp) helper, and use it, like
keepalive_time_when(tp) and keepalive_intvl_when(tp)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Michael Chan [Wed, 26 Aug 2009 09:49:23 +0000 (09:49 +0000)]
cnic: Put uio init in separate function.
This will allow the 10G iSCSI code to reuse the function.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Michael Chan [Wed, 26 Aug 2009 09:49:22 +0000 (09:49 +0000)]
cnic: Put rx/tx ring allocation in separate function.
This will allow the 10G iSCSI code to reuse the function.
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Sat, 29 Aug 2009 06:45:21 +0000 (23:45 -0700)]
ipv4: af_inet.c cleanups
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Alexey Dobriyan [Sat, 29 Aug 2009 06:34:43 +0000 (23:34 -0700)]
pktgen: use proc_create_data()
It looks like after rename device proc entry is unusable,
because of no ->read_proc or ->proc_fops.
And create_proc_entry() is deprecated.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Hemminger [Thu, 27 Aug 2009 13:55:20 +0000 (13:55 +0000)]
pktgen: increase version
Increase module version, and cleanup module info.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Hemminger [Thu, 27 Aug 2009 13:55:19 +0000 (13:55 +0000)]
pktgen: cleanup checkpatch warnings
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Hemminger [Thu, 27 Aug 2009 13:55:18 +0000 (13:55 +0000)]
pktgen: use common idle routine
Simpler to have one place that spins and accounts for delays,
this will also make the last packet be detected faster for more
repeatable timing.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Hemminger [Sat, 29 Aug 2009 06:41:29 +0000 (23:41 -0700)]
pktgen: spin using hrtimer
This changes how the pktgen thread spins/waits between
packets if delay is configured. It uses a high res timer to
wait for time to arrive.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Hemminger [Thu, 27 Aug 2009 13:55:16 +0000 (13:55 +0000)]
pktgen: convert to use ktime_t
The kernel ktime_t is a nice generic infrastructure for mananging
high resolution times, as is done in pktgen.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Hemminger [Thu, 27 Aug 2009 13:55:15 +0000 (13:55 +0000)]
pktgen: avoid calling gettimeofday
If not using delay then no need to update next_tx after
each packet sent. This allows pktgen to send faster especially
on systems with slower clock sources.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Hemminger [Thu, 27 Aug 2009 13:55:14 +0000 (13:55 +0000)]
pktgen: reorganize transmit loop
Handle standard (and non-standard) return values in a switch.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Hemminger [Thu, 27 Aug 2009 13:55:13 +0000 (13:55 +0000)]
pktgen: use netdev_alloc_skb
netdev_alloc_skb is NUMA node aware.
Also, don't exhaust atomic emergency pool. Don't want pktgen
to cause OOM behaviour.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Hemminger [Thu, 27 Aug 2009 13:55:12 +0000 (13:55 +0000)]
pktgen: cleanup clone count test
The if statement to test for "should a new packet be used"
can be simplified.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>