Netdev List
 help / color / mirror / Atom feed
* WARNING: at drivers/net/e1000e/netdev.c:5221 __e1000_shutdown+0x43f/0x4c0 [e1000e]()
From: Jesper Juhl @ 2011-08-04  8:24 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev, e1000-devel

Hi

I just woke my laptop from suspend and found this in dmesg :

...
[46011.457402] e1000e: eth0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: None
[46011.457407] e1000e 0000:00:19.0: eth0: 10/100 speed: disabling TSO
[46011.457808] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[46011.465085] hub 1-1.2:1.0: USB hub found
[46011.465482] hub 1-1.2:1.0: 4 ports detected
[46011.731642] usb 1-1.2.3: new low speed USB device number 11 using ehci_hcd
[46011.823432] input: USB Mouse as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.3/1-1.2.3:1.0/input/input14
[46011.823546] generic-usb 0003:0566:4006.0005: input,hidraw0: USB HID v1.11 Mouse [USB Mouse] on usb-0000:00:1a.0-1.2.3/input0
[46011.901235] usb 1-1.2.4: new full speed USB device number 12 using ehci_hcd
[46012.017545] input: Sun USB Keyboard as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2.4/1-1.2.4:1.0/input/input15
[46012.017786] generic-usb 0003:0430:00A2.0006: input,hidraw1: USB HID v1.10 Keyboard [Sun USB Keyboard] on usb-0000:00:1a.0-1.2.4/input0
[46013.437900] e1000e 0000:00:19.0: PME# enabled
[46013.467170] e1000e 0000:00:19.0: BAR 0: set to [mem 0xf2600000-0xf261ffff] (PCI address [0xf2600000-0xf261ffff])
[46013.467182] e1000e 0000:00:19.0: BAR 1: set to [mem 0xf2625000-0xf2625fff] (PCI address [0xf2625000-0xf2625fff])
[46013.467191] e1000e 0000:00:19.0: BAR 2: set to [io  0x1820-0x183f] (PCI address [0x1820-0x183f])
[46013.467214] e1000e 0000:00:19.0: restoring config space at offset 0xf (was 0x100, writing 0x10b)
[46013.467241] e1000e 0000:00:19.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100107)
[46013.467305] e1000e 0000:00:19.0: PME# disabled
[46013.560412] e1000e 0000:00:19.0: irq 41 for MSI/MSI-X
[46013.613523] e1000e 0000:00:19.0: irq 41 for MSI/MSI-X
[46013.614823] ADDRCONF(NETDEV_UP): eth0: link is not ready
[46013.750226] e1000e 0000:00:19.0: PME# enabled
[46013.786332] e1000e 0000:00:19.0: BAR 0: set to [mem 0xf2600000-0xf261ffff] (PCI address [0xf2600000-0xf261ffff])
[46013.786344] e1000e 0000:00:19.0: BAR 1: set to [mem 0xf2625000-0xf2625fff] (PCI address [0xf2625000-0xf2625fff])
[46013.786354] e1000e 0000:00:19.0: BAR 2: set to [io  0x1820-0x183f] (PCI address [0x1820-0x183f])
[46013.786377] e1000e 0000:00:19.0: restoring config space at offset 0xf (was 0x100, writing 0x10b)
[46013.786405] e1000e 0000:00:19.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100507)
[46013.786467] e1000e 0000:00:19.0: PME# disabled
[46013.879654] e1000e 0000:00:19.0: irq 41 for MSI/MSI-X
[46013.932698] e1000e 0000:00:19.0: irq 41 for MSI/MSI-X
[46013.933919] ADDRCONF(NETDEV_UP): eth0: link is not ready
[46014.933488] ------------[ cut here ]------------
[46014.933522] WARNING: at drivers/net/e1000e/netdev.c:5221 __e1000_shutdown+0x43f/0x4c0 [e1000e]()
[46014.933526] Hardware name: 4384GJG
[46014.933529] Modules linked in: ipv6 usbhid hid uvcvideo videodev media v4l2_compat_ioctl32 snd_hda_codec_hdmi snd_hda_codec_conexant arc4 vboxnetadp vboxnetflt snd_hda_intel vboxdrv ecb i915 drm_kms_helper snd_hda_codec iwlagn snd_hwdep drm serio_raw sg sdhci_pci mac80211 firewire_ohci cfg80211 snd_pcm ehci_hcd tpm_tis usbcore sdhci cpufreq_ondemand firewire_core battery snd_timer mmc_core msr i2c_i801 tpm intel_agp pcspkr psmouse crc_itu_t acpi_cpufreq freq_table e1000e mperf intel_ips wmi i2c_algo_bit tpm_bios evdev intel_gtt i2c_core button thinkpad_acpi processor iTCO_wdt snd_page_alloc ac iTCO_vendor_support video thermal rfkill snd soundcore nvram ext4 mbcache jbd2 crc16 sr_mod cdrom sd_mod ahci libahci libata scsi_mod
[46014.933612] Pid: 29819, comm: kworker/2:1 Not tainted 2.6.39-ARCH #1
[46014.933616] Call Trace:
[46014.933628]  [<ffffffff8105b90f>] warn_slowpath_common+0x7f/0xc0
[46014.933634]  [<ffffffff8105b96a>] warn_slowpath_null+0x1a/0x20
[46014.933643]  [<ffffffffa01c4f7f>] __e1000_shutdown+0x43f/0x4c0 [e1000e]
[46014.933652]  [<ffffffff81012fc9>] ? sched_clock+0x9/0x10
[46014.933656]  [<ffffffffa01c5039>] e1000_runtime_suspend+0x39/0x50 [e1000e]
[46014.933660]  [<ffffffff8100a6cf>] ? __switch_to+0xbf/0x2f0
[46014.933665]  [<ffffffff812392dd>] pci_pm_runtime_suspend+0x4d/0x100
[46014.933667]  [<ffffffff81239290>] ? pci_legacy_suspend_late+0x100/0x100
[46014.933671]  [<ffffffff812e7d52>] rpm_callback+0x42/0x80
[46014.933674]  [<ffffffff813e4faf>] ? schedule+0x33f/0xad0
[46014.933676]  [<ffffffff812e82fa>] rpm_suspend+0x1da/0x3f0
[46014.933679]  [<ffffffff812e9380>] ? pm_schedule_suspend+0xe0/0xe0
[46014.933681]  [<ffffffff812e941a>] pm_runtime_work+0x9a/0xc0
[46014.933685]  [<ffffffff81077f6e>] process_one_work+0x11e/0x4c0
[46014.933687]  [<ffffffff810788ff>] worker_thread+0x15f/0x350
[46014.933689]  [<ffffffff810787a0>] ? manage_workers.isra.29+0x230/0x230
[46014.933694]  [<ffffffff8107d6ec>] kthread+0x8c/0xa0
[46014.933697]  [<ffffffff813e9fe4>] kernel_thread_helper+0x4/0x10
[46014.933699]  [<ffffffff8107d660>] ? kthread_worker_fn+0x190/0x190
[46014.933700]  [<ffffffff813e9fe0>] ? gs_change+0x13/0x13
[46014.933702] ---[ end trace b2e5aa34f74b5252 ]---
[46015.215367] e1000e 0000:00:19.0: PME# enabled
...

This is with a 2.6.39.3 kernel.

The laptop is a Lenovo Thinkpad T510 model 4384-GJG.

lspci -vvx has this to say about the ethernet device:

00:19.0 Ethernet controller: Intel Corporation 82577LM Gigabit Network Connection (rev 06)
        Subsystem: Lenovo Device 2153
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Interrupt: pin A routed to IRQ 41
        Region 0: Memory at f2600000 (32-bit, non-prefetchable) [size=128K]
        Region 1: Memory at f2625000 (32-bit, non-prefetchable) [size=4K]
        Region 2: I/O ports at 1820 [size=32]
        Capabilities: [c8] Power Management version 2
                Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=1 PME+
        Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
                Address: 00000000fee0f00c  Data: 415d
        Capabilities: [e0] PCI Advanced Features
                AFCap: TP+ FLR+
                AFCtrl: FLR-
                AFStatus: TP-
        Kernel driver in use: e1000e
        Kernel modules: e1000e
00: 86 80 ea 10 07 05 10 00 06 00 00 02 00 00 00 00
10: 00 00 60 f2 00 50 62 f2 21 18 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 aa 17 53 21
30: 00 00 00 00 c8 00 00 00 00 00 00 00 0b 01 00 00

The network seems to be working fine, so it's clearly not fatal.
I regularly suspend/resume this laptop and I've never seen this before 
with this or other kernels, so it's not really reproducible.

Let me know if there is other information you'd like and I'll be happy to 
provide it.

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

^ permalink raw reply

* [PATCH] macb: restore wrap bit when performing underrun cleanup
From: Tord Andersson @ 2011-08-04  8:11 UTC (permalink / raw)
  To: nicolas.ferre; +Cc: netdev, linux-kernel, Tord Andersson

When TX underrun occurs, a cleanup is performed that marks all buffers as used. As a side effect it also clears the wrap bit in the last buffer. This patch will restore the wrap bit.

Signed-off-by: Tord Andersson <tord.andersson@endian.se>
---
 drivers/net/macb.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 0fcdc25..dc4e305 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -322,6 +322,9 @@ static void macb_tx(struct macb *bp)
 		for (i = 0; i < TX_RING_SIZE; i++)
 			bp->tx_ring[i].ctrl = MACB_BIT(TX_USED);
 
+		/* Add wrap bit */
+		bp->tx_ring[TX_RING_SIZE - 1].ctrl |= MACB_BIT(TX_WRAP);
+
 		/* free transmit buffer in upper layer*/
 		for (tail = bp->tx_tail; tail != head; tail = NEXT_TX(tail)) {
 			struct ring_info *rp = &bp->tx_skb[tail];
-- 
1.5.4.3


^ permalink raw reply related

* Re: [PATCH] macb: restore wrap bit when performing underrun cleanup
From: David Miller @ 2011-08-04  8:43 UTC (permalink / raw)
  To: tord.andersson; +Cc: nicolas.ferre, netdev, linux-kernel
In-Reply-To: <1312445507-31382-1-git-send-email-tord.andersson@endian.se>

From: Tord Andersson <tord.andersson@endian.se>
Date: Thu,  4 Aug 2011 10:11:47 +0200

> When TX underrun occurs, a cleanup is performed that marks all buffers as used. As a side effect it also clears the wrap bit in the last buffer. This patch will restore the wrap bit.
> 
> Signed-off-by: Tord Andersson <tord.andersson@endian.se>

Applied.

^ permalink raw reply

* Re: [PATCH ] cdc_ncm: fixes for big-endian architecture / MIPS
From: David Miller @ 2011-08-04  8:43 UTC (permalink / raw)
  To: giuseppe
  Cc: alexey.orishko, netdev, oliver, linux-usb, gregkh, alexey.orishko
In-Reply-To: <87fwlhzjey.fsf@gnu.org>

From: Giuseppe Scrivano <giuseppe@southpole.se>
Date: Thu, 04 Aug 2011 10:10:29 +0200

> cdc_ncm: fix endianness problem.
> 
> Fix a misusage of the struct usb_cdc_notification to pass arguments to the
> usb_control_msg function.  The usb_control_msg function expects host endian
> arguments but usb_cdc_notification stores these values as little endian.
> 
> Now usb_control_msg is directly invoked with host endian values.

Applied.

^ permalink raw reply

* Re: [PATCH] macb: restore wrap bit when performing underrun cleanup
From: Nicolas Ferre @ 2011-08-04  8:58 UTC (permalink / raw)
  To: Tord Andersson, netdev; +Cc: linux-kernel
In-Reply-To: <1312445507-31382-1-git-send-email-tord.andersson@endian.se>

On 08/04/2011 09:11 AM, Tord Andersson wrote:
> When TX underrun occurs, a cleanup is performed that marks all buffers as used. As a side effect it also clears the wrap bit in the last buffer. This patch will restore the wrap bit.
>
> Signed-off-by: Tord Andersson<tord.andersson@endian.se>

Thanks for fixing this.

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> ---
>   drivers/net/macb.c |    3 +++
>   1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> index 0fcdc25..dc4e305 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -322,6 +322,9 @@ static void macb_tx(struct macb *bp)
>   		for (i = 0; i<  TX_RING_SIZE; i++)
>   			bp->tx_ring[i].ctrl = MACB_BIT(TX_USED);
>
> +		/* Add wrap bit */
> +		bp->tx_ring[TX_RING_SIZE - 1].ctrl |= MACB_BIT(TX_WRAP);
> +
>   		/* free transmit buffer in upper layer*/
>   		for (tail = bp->tx_tail; tail != head; tail = NEXT_TX(tail)) {
>   			struct ring_info *rp =&bp->tx_skb[tail];


-- 
Nicolas Ferre

^ permalink raw reply

* [PATCH] mlx4: decreasing ref count when removing mac
From: Yevgeny Petrilin @ 2011-08-04 11:05 UTC (permalink / raw)
  To: roland-DgEjT+Ai2ygdnm+yROfE0A
  Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA, yevgenyp-VPRAkNaXOzVS1MOuV/RT9w


For older FW versions, when a Mac address removed from Mac table,
we should set 0 for reference count for the corresponding Mac index.
Fixes a bug where removing Mac from the table still left that entry as
invalid.

Signed-off-by: Yevgeny Petrilin <yevgenyp-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
 drivers/net/mlx4/port.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx4/port.c b/drivers/net/mlx4/port.c
index 1f95afd..609e0ec 100644
--- a/drivers/net/mlx4/port.c
+++ b/drivers/net/mlx4/port.c
@@ -258,9 +258,12 @@ void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int qpn)
 	if (validate_index(dev, table, index))
 		goto out;
 
-	table->entries[index] = 0;
-	mlx4_set_port_mac_table(dev, port, table->entries);
-	--table->total;
+	/* Check whether this address has reference count */
+	if (!(--table->refs[index])) {
+		table->entries[index] = 0;
+		mlx4_set_port_mac_table(dev, port, table->entries);
+		--table->total;
+	}
 out:
 	mutex_unlock(&table->mutex);
 }
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: return of ip_rt_bug()
From: Julian Anastasov @ 2011-08-04 12:20 UTC (permalink / raw)
  To: Dave Jones; +Cc: netdev, Tom London
In-Reply-To: <20110802170942.GA17164@redhat.com>


	Hello,

On Tue, 2 Aug 2011, Dave Jones wrote:

> Tom (CC'd) has been hitting that ip_rt_bug() WARN_ON() since 3.0rc
> 
> Here's the latest report.
> 
> ------------[ cut here]------------
> WARNING: atnet/ipv4/route.c:1714 ip_rt_bug+0x5c/0x62()
> Hardware name: 74585FU
> Modules linked in: fuse
> ip6table_filter ip6_tables ebtable_nat ebtables ppdev parport_pc lp parport
> ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state
> nf_conntrack xt_CHECKSUM iptable_mangle tun bridge stp llc sunrpc rfcomm bnep
> usblp arc4 uvcvideo videodev media snd_usb_audio snd_usbmidi_lib snd_rawmidi
> v4l2_compat_ioctl32 iwlagn microcode i2c_i801 btusb iTCO_wdt
> iTCO_vendor_support mac80211 bluetooth snd_hda_codec_conexant cfg80211
> thinkpad_acpi snd_hda_intel snd_hda_codec rfkill snd_hwdep snd_seq
> snd_seq_device snd_pcm snd_timer snd soundcore snd_page_alloc e1000e virtio_net
> kvm_intel kvm uinput wmi i915 drm_kms_helper drm i2c_algo_bit i2c_core video[last unloaded: scsi_wait_scan]
> Pid: 5492, comm: xsane Not tainted 3.1.0-0.rc0.git12.1.fc17.x86_64 #1
> Call Trace:
>  [<ffffffff8105c5ec>] warn_slowpath_common+0x83/0x9b
>  [<ffffffff8105c61e>] warn_slowpath_null+0x1a/0x1c
>  [<ffffffff8142f485>] ip_rt_bug+0x5c/0x62
>  [<ffffffff81437091>] dst_output+0x19/0x1d
>  [<ffffffff814387c0>] ip_local_out+0x20/0x25
>  [<ffffffff81439695>] ip_send_skb+0x19/0x3e
>  [<ffffffff81455ea2>] udp_send_skb+0x239/0x29b
>  [<ffffffff8145763f>] udp_sendmsg+0x5a1/0x7d4
>  [<ffffffff813f67d5>] ? release_sock+0x35/0x155
>  [<ffffffff8143718c>] ? ip_select_ident+0x3d/0x3d
>  [<ffffffff81062703>] ? local_bh_enable_ip+0xe/0x10
>  [<ffffffff814f1231>] ? _raw_spin_unlock_bh+0x40/0x44
>  [<ffffffff813f68ec>] ? release_sock+0x14c/0x155
>  [<ffffffff8145eb58>] inet_sendmsg+0x66/0x6f
>  [<ffffffff813f1d92>] sock_sendmsg+0xe6/0x109
>  [<ffffffff8108f1c8>] ? lock_acquire+0x10f/0x13e
>  [<ffffffff8110dd34>] ? might_fault+0x5c/0xac
>  [<ffffffff8108f08c>] ? lock_release+0x1a4/0x1d1
>  [<ffffffff8110dd7d>] ? might_fault+0xa5/0xac
>  [<ffffffff813f2ad7>] ? copy_from_user+0x2f/0x31
>  [<ffffffff813f496d>] sys_sendto+0x132/0x174
>  [<ffffffff8124ef6e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
>  [<ffffffff814f80c2>] system_call_fastpath+0x16/0x1b
> ---[ end trace 0e82aef47f8d8552 ]---
> ------------[ cut here ]------------
> 
> all the traces he's hit so far seem to be caused by udp, and they all seem to be
> going from 192.168.2.5 -> 255.255.255.255
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=712632 is his full report with similar traces.

	Tom, what kind of netfilter rules do you have in
LOCAL_OUT/OUTPUT hooks? We eliminated one ip_route_input call
from net/ipv4/netfilter.c (ip_route_me_harder) but it looks like
in your kernel ip_route_input is called again from this hook.
It is interesting why only broadcasts get such input route.

	I assume 192.168.2.5 is an existing local address that
is present during the test? Any additional modules that use
ip_route_input ? Are nf_queue, IPVS, br_netfilter or tproxy used?

Regards

--
Julian Anastasov <ja@ssi.bg>

^ permalink raw reply

* [net 2/6] e1000e: remove unnecessary check for NULL pointer
From: Jeff Kirsher @ 2011-08-04 12:18 UTC (permalink / raw)
  To: davem; +Cc: Bruce Allan, netdev, gospo, sassmann, Jeff Kirsher
In-Reply-To: <1312460298-20405-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Bruce Allan <bruce.w.allan@intel.com>

The array shadow_ram is never NULL.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by:  Aaron Brown  <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/e1000e/ich8lan.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index f7a75c1..4e36978 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -2137,8 +2137,7 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
 
 	ret_val = 0;
 	for (i = 0; i < words; i++) {
-		if ((dev_spec->shadow_ram) &&
-		    (dev_spec->shadow_ram[offset+i].modified)) {
+		if (dev_spec->shadow_ram[offset+i].modified) {
 			data[i] = dev_spec->shadow_ram[offset+i].value;
 		} else {
 			ret_val = e1000_read_flash_word_ich8lan(hw,
-- 
1.7.6


^ permalink raw reply related

* [net 0/6][pull request] Intel Wired LAN Driver Update
From: Jeff Kirsher @ 2011-08-04 12:18 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann

The following series contains updates to e1000, e1000e, igb, igbvf,
ixgb and ixgbe.

The following are changes since commit d3e614577198757d5854caa912e88f2d4296479b:
  macb: restore wrap bit when performing underrun cleanup
and are available in the git repository at:
  master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net master

Bruce Allan (2):
  e1000e: remove unnecessary check for NULL pointer
  e1000e: minor re-order of #include files

Carolyn Wyborny (1):
  igb: fix WOL on second port of i350 device

Don Skidmore (1):
  ixgbe: fix __ixgbe_notify_dca() bail out code

Emil Tantilov (1):
  ixgbe: fix PHY link setup for 82599

Jesse Brandeburg (1):
  intel drivers: repair missing flush operations

 drivers/net/e1000/e1000_ethtool.c |    6 ++++++
 drivers/net/e1000/e1000_hw.c      |    3 +++
 drivers/net/e1000e/es2lan.c       |    2 ++
 drivers/net/e1000e/ethtool.c      |   11 ++++++++++-
 drivers/net/e1000e/ich8lan.c      |    7 +++++--
 drivers/net/e1000e/lib.c          |    1 +
 drivers/net/e1000e/netdev.c       |    2 +-
 drivers/net/e1000e/phy.c          |    2 ++
 drivers/net/igb/e1000_nvm.c       |    1 +
 drivers/net/igb/igb_ethtool.c     |    5 +++++
 drivers/net/igb/igb_main.c        |    4 +++-
 drivers/net/igbvf/netdev.c        |    2 ++
 drivers/net/ixgb/ixgb_ee.c        |    9 +++++++++
 drivers/net/ixgb/ixgb_hw.c        |    2 ++
 drivers/net/ixgbe/ixgbe_82599.c   |    1 +
 drivers/net/ixgbe/ixgbe_common.c  |    1 +
 drivers/net/ixgbe/ixgbe_ethtool.c |    5 +++++
 drivers/net/ixgbe/ixgbe_main.c    |    3 ++-
 drivers/net/ixgbe/ixgbe_phy.c     |    3 +++
 drivers/net/ixgbe/ixgbe_x540.c    |    1 +
 20 files changed, 65 insertions(+), 6 deletions(-)

-- 
1.7.6


^ permalink raw reply

* [net 4/6] igb: fix WOL on second port of i350 device
From: Jeff Kirsher @ 2011-08-04 12:18 UTC (permalink / raw)
  To: davem; +Cc: Carolyn Wyborny, netdev, gospo, sassmann, Jeff Kirsher
In-Reply-To: <1312460298-20405-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Carolyn Wyborny <carolyn.wyborny@intel.com>

This patch fixes a problem where WOL would fail on second port of i350
device.

Reported-by: Martin Wilck <martin.wilck@ts.fujitsu.com>
Reported-by: Stefan Assmann<sassmann@redhat.com>
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by:  Aaron Brown  <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/igb/igb_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index ae3937e..40d4c40 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -2023,7 +2023,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
 
 	if (hw->bus.func == 0)
 		hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A, 1, &eeprom_data);
-	else if (hw->mac.type == e1000_82580)
+	else if (hw->mac.type >= e1000_82580)
 		hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A +
 		                 NVM_82580_LAN_FUNC_OFFSET(hw->bus.func), 1,
 		                 &eeprom_data);
-- 
1.7.6


^ permalink raw reply related

* [net 3/6] e1000e: minor re-order of #include files
From: Jeff Kirsher @ 2011-08-04 12:18 UTC (permalink / raw)
  To: davem; +Cc: Bruce Allan, netdev, gospo, sassmann, Jeff Kirsher
In-Reply-To: <1312460298-20405-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Bruce Allan <bruce.w.allan@intel.com>

The recent commit a6b7a407 when back-ported to the out-of-tree e1000e
driver caused a compilation error on older kernels which required a
re-ordering of the #include files.  This cosmetic patch syncs the two
drivers for easier maintainability.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by:  Aaron Brown  <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/e1000e/ethtool.c |    2 +-
 drivers/net/e1000e/netdev.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index 72756e4..06d88f3 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -28,8 +28,8 @@
 
 /* ethtool support for e1000 */
 
-#include <linux/interrupt.h>
 #include <linux/netdevice.h>
+#include <linux/interrupt.h>
 #include <linux/ethtool.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 4353ad5..ab4be80 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -31,12 +31,12 @@
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/init.h>
-#include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/vmalloc.h>
 #include <linux/pagemap.h>
 #include <linux/delay.h>
 #include <linux/netdevice.h>
+#include <linux/interrupt.h>
 #include <linux/tcp.h>
 #include <linux/ipv6.h>
 #include <linux/slab.h>
-- 
1.7.6


^ permalink raw reply related

* [net 5/6] ixgbe: fix __ixgbe_notify_dca() bail out code
From: Jeff Kirsher @ 2011-08-04 12:18 UTC (permalink / raw)
  To: davem; +Cc: Don Skidmore, netdev, gospo, sassmann, Jeff Kirsher
In-Reply-To: <1312460298-20405-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Don Skidmore <donald.c.skidmore@intel.com>

The way __ixgbe_notify_dca() was currently set up it would not be
possible to add a requester. Both cases of the IXGBE_FLAG_DCA_ENABLED
bit being on and off would lead to the function exiting for a
DCA_PROVIDER_ADD.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ixgbe/ixgbe_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 26b132b..e86297b 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -1006,7 +1006,7 @@ static int __ixgbe_notify_dca(struct device *dev, void *data)
 	struct ixgbe_adapter *adapter = dev_get_drvdata(dev);
 	unsigned long event = *(unsigned long *)data;
 
-	if (!(adapter->flags & IXGBE_FLAG_DCA_ENABLED))
+	if (!(adapter->flags & IXGBE_FLAG_DCA_CAPABLE))
 		return 0;
 
 	switch (event) {
-- 
1.7.6


^ permalink raw reply related

* [net 6/6] ixgbe: fix PHY link setup for 82599
From: Jeff Kirsher @ 2011-08-04 12:18 UTC (permalink / raw)
  To: davem; +Cc: Emil Tantilov, netdev, gospo, sassmann, Jeff Kirsher
In-Reply-To: <1312460298-20405-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Emil Tantilov <emil.s.tantilov@intel.com>

Fix pointer to setup_link for 82599.

This resolves some link issues when advertising modes unsupported
by the link partner.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ixgbe/ixgbe_82599.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index 3b3dd4d..34f30ec 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -213,6 +213,7 @@ static s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw)
 	switch (hw->phy.type) {
 	case ixgbe_phy_tn:
 		phy->ops.check_link = &ixgbe_check_phy_link_tnx;
+		phy->ops.setup_link = &ixgbe_setup_phy_link_tnx;
 		phy->ops.get_firmware_version =
 		             &ixgbe_get_phy_firmware_version_tnx;
 		break;
-- 
1.7.6


^ permalink raw reply related

* [net 1/6] intel drivers: repair missing flush operations
From: Jeff Kirsher @ 2011-08-04 12:18 UTC (permalink / raw)
  To: davem; +Cc: Jesse Brandeburg, netdev, gospo, sassmann, Jeff Kirsher
In-Reply-To: <1312460298-20405-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

after review of all intel drivers, found several instances where
drivers had the incorrect pattern of:
memory mapped write();
delay();

which should always be:
memory mapped write();
write flush(); /* aka memory mapped read */
delay();

explanation:
The reason for including the flush is that writes can be held
(posted) in PCI/PCIe bridges, but the read always has to complete
synchronously and therefore has to flush all pending writes to a
device.  If a write is held and followed by a delay, the delay
means nothing because the write may not have reached hardware
(maybe even not until the next read)

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by:  Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/e1000/e1000_ethtool.c |    6 ++++++
 drivers/net/e1000/e1000_hw.c      |    3 +++
 drivers/net/e1000e/es2lan.c       |    2 ++
 drivers/net/e1000e/ethtool.c      |    9 +++++++++
 drivers/net/e1000e/ich8lan.c      |    4 ++++
 drivers/net/e1000e/lib.c          |    1 +
 drivers/net/e1000e/phy.c          |    2 ++
 drivers/net/igb/e1000_nvm.c       |    1 +
 drivers/net/igb/igb_ethtool.c     |    5 +++++
 drivers/net/igb/igb_main.c        |    2 ++
 drivers/net/igbvf/netdev.c        |    2 ++
 drivers/net/ixgb/ixgb_ee.c        |    9 +++++++++
 drivers/net/ixgb/ixgb_hw.c        |    2 ++
 drivers/net/ixgbe/ixgbe_common.c  |    1 +
 drivers/net/ixgbe/ixgbe_ethtool.c |    5 +++++
 drivers/net/ixgbe/ixgbe_main.c    |    1 +
 drivers/net/ixgbe/ixgbe_phy.c     |    3 +++
 drivers/net/ixgbe/ixgbe_x540.c    |    1 +
 18 files changed, 59 insertions(+), 0 deletions(-)

diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index c5f0f04..5548d46 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -838,6 +838,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
 
 	/* Disable all the interrupts */
 	ew32(IMC, 0xFFFFFFFF);
+	E1000_WRITE_FLUSH();
 	msleep(10);
 
 	/* Test each interrupt */
@@ -856,6 +857,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
 			adapter->test_icr = 0;
 			ew32(IMC, mask);
 			ew32(ICS, mask);
+			E1000_WRITE_FLUSH();
 			msleep(10);
 
 			if (adapter->test_icr & mask) {
@@ -873,6 +875,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
 		adapter->test_icr = 0;
 		ew32(IMS, mask);
 		ew32(ICS, mask);
+		E1000_WRITE_FLUSH();
 		msleep(10);
 
 		if (!(adapter->test_icr & mask)) {
@@ -890,6 +893,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
 			adapter->test_icr = 0;
 			ew32(IMC, ~mask & 0x00007FFF);
 			ew32(ICS, ~mask & 0x00007FFF);
+			E1000_WRITE_FLUSH();
 			msleep(10);
 
 			if (adapter->test_icr) {
@@ -901,6 +905,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
 
 	/* Disable all the interrupts */
 	ew32(IMC, 0xFFFFFFFF);
+	E1000_WRITE_FLUSH();
 	msleep(10);
 
 	/* Unhook test interrupt handler */
@@ -1394,6 +1399,7 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
 			if (unlikely(++k == txdr->count)) k = 0;
 		}
 		ew32(TDT, k);
+		E1000_WRITE_FLUSH();
 		msleep(200);
 		time = jiffies; /* set the start time for the receive */
 		good_cnt = 0;
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 1698622..8545c7a 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -446,6 +446,7 @@ s32 e1000_reset_hw(struct e1000_hw *hw)
 	/* Must reset the PHY before resetting the MAC */
 	if ((hw->mac_type == e1000_82541) || (hw->mac_type == e1000_82547)) {
 		ew32(CTRL, (ctrl | E1000_CTRL_PHY_RST));
+		E1000_WRITE_FLUSH();
 		msleep(5);
 	}
 
@@ -3752,6 +3753,7 @@ static s32 e1000_acquire_eeprom(struct e1000_hw *hw)
 		/* Clear SK and CS */
 		eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);
 		ew32(EECD, eecd);
+		E1000_WRITE_FLUSH();
 		udelay(1);
 	}
 
@@ -3824,6 +3826,7 @@ static void e1000_release_eeprom(struct e1000_hw *hw)
 		eecd &= ~E1000_EECD_SK;	/* Lower SCK */
 
 		ew32(EECD, eecd);
+		E1000_WRITE_FLUSH();
 
 		udelay(hw->eeprom.delay_usec);
 	} else if (hw->eeprom.type == e1000_eeprom_microwire) {
diff --git a/drivers/net/e1000e/es2lan.c b/drivers/net/e1000e/es2lan.c
index c0ecb2d..e4f4225 100644
--- a/drivers/net/e1000e/es2lan.c
+++ b/drivers/net/e1000e/es2lan.c
@@ -1313,6 +1313,7 @@ static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
 	kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
 	               E1000_KMRNCTRLSTA_OFFSET) | E1000_KMRNCTRLSTA_REN;
 	ew32(KMRNCTRLSTA, kmrnctrlsta);
+	e1e_flush();
 
 	udelay(2);
 
@@ -1347,6 +1348,7 @@ static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
 	kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
 	               E1000_KMRNCTRLSTA_OFFSET) | data;
 	ew32(KMRNCTRLSTA, kmrnctrlsta);
+	e1e_flush();
 
 	udelay(2);
 
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index cb1a362..72756e4 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -964,6 +964,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
 
 	/* Disable all the interrupts */
 	ew32(IMC, 0xFFFFFFFF);
+	e1e_flush();
 	usleep_range(10000, 20000);
 
 	/* Test each interrupt */
@@ -996,6 +997,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
 			adapter->test_icr = 0;
 			ew32(IMC, mask);
 			ew32(ICS, mask);
+			e1e_flush();
 			usleep_range(10000, 20000);
 
 			if (adapter->test_icr & mask) {
@@ -1014,6 +1016,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
 		adapter->test_icr = 0;
 		ew32(IMS, mask);
 		ew32(ICS, mask);
+		e1e_flush();
 		usleep_range(10000, 20000);
 
 		if (!(adapter->test_icr & mask)) {
@@ -1032,6 +1035,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
 			adapter->test_icr = 0;
 			ew32(IMC, ~mask & 0x00007FFF);
 			ew32(ICS, ~mask & 0x00007FFF);
+			e1e_flush();
 			usleep_range(10000, 20000);
 
 			if (adapter->test_icr) {
@@ -1043,6 +1047,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
 
 	/* Disable all the interrupts */
 	ew32(IMC, 0xFFFFFFFF);
+	e1e_flush();
 	usleep_range(10000, 20000);
 
 	/* Unhook test interrupt handler */
@@ -1276,6 +1281,7 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
 			     E1000_CTRL_FD);	 /* Force Duplex to FULL */
 
 		ew32(CTRL, ctrl_reg);
+		e1e_flush();
 		udelay(500);
 
 		return 0;
@@ -1418,6 +1424,7 @@ static int e1000_set_82571_fiber_loopback(struct e1000_adapter *adapter)
 	 */
 #define E1000_SERDES_LB_ON 0x410
 	ew32(SCTL, E1000_SERDES_LB_ON);
+	e1e_flush();
 	usleep_range(10000, 20000);
 
 	return 0;
@@ -1513,6 +1520,7 @@ static void e1000_loopback_cleanup(struct e1000_adapter *adapter)
 		    hw->phy.media_type == e1000_media_type_internal_serdes) {
 #define E1000_SERDES_LB_OFF 0x400
 			ew32(SCTL, E1000_SERDES_LB_OFF);
+			e1e_flush();
 			usleep_range(10000, 20000);
 			break;
 		}
@@ -1592,6 +1600,7 @@ static int e1000_run_loopback_test(struct e1000_adapter *adapter)
 				k = 0;
 		}
 		ew32(TDT, k);
+		e1e_flush();
 		msleep(200);
 		time = jiffies; /* set the start time for the receive */
 		good_cnt = 0;
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index c175212..f7a75c1 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -283,6 +283,7 @@ static void e1000_toggle_lanphypc_value_ich8lan(struct e1000_hw *hw)
 	ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE;
 	ctrl &= ~E1000_CTRL_LANPHYPC_VALUE;
 	ew32(CTRL, ctrl);
+	e1e_flush();
 	udelay(10);
 	ctrl &= ~E1000_CTRL_LANPHYPC_OVERRIDE;
 	ew32(CTRL, ctrl);
@@ -1230,9 +1231,11 @@ s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable)
 	ew32(CTRL, reg);
 
 	ew32(CTRL_EXT, ctrl_ext | E1000_CTRL_EXT_SPD_BYPS);
+	e1e_flush();
 	udelay(20);
 	ew32(CTRL, ctrl_reg);
 	ew32(CTRL_EXT, ctrl_ext);
+	e1e_flush();
 	udelay(20);
 
 out:
@@ -3090,6 +3093,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
 	ret_val = e1000_acquire_swflag_ich8lan(hw);
 	e_dbg("Issuing a global reset to ich8lan\n");
 	ew32(CTRL, (ctrl | E1000_CTRL_RST));
+	/* cannot issue a flush here because it hangs the hardware */
 	msleep(20);
 
 	if (!ret_val)
diff --git a/drivers/net/e1000e/lib.c b/drivers/net/e1000e/lib.c
index 65580b4..7898a67 100644
--- a/drivers/net/e1000e/lib.c
+++ b/drivers/net/e1000e/lib.c
@@ -1986,6 +1986,7 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
 		/* Clear SK and CS */
 		eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);
 		ew32(EECD, eecd);
+		e1e_flush();
 		udelay(1);
 
 		/*
diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c
index 2a6ee13..8666476 100644
--- a/drivers/net/e1000e/phy.c
+++ b/drivers/net/e1000e/phy.c
@@ -537,6 +537,7 @@ static s32 __e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data,
 	kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
 		       E1000_KMRNCTRLSTA_OFFSET) | E1000_KMRNCTRLSTA_REN;
 	ew32(KMRNCTRLSTA, kmrnctrlsta);
+	e1e_flush();
 
 	udelay(2);
 
@@ -609,6 +610,7 @@ static s32 __e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data,
 	kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
 		       E1000_KMRNCTRLSTA_OFFSET) | data;
 	ew32(KMRNCTRLSTA, kmrnctrlsta);
+	e1e_flush();
 
 	udelay(2);
 
diff --git a/drivers/net/igb/e1000_nvm.c b/drivers/net/igb/e1000_nvm.c
index 7dcd65c..4040712 100644
--- a/drivers/net/igb/e1000_nvm.c
+++ b/drivers/net/igb/e1000_nvm.c
@@ -285,6 +285,7 @@ static s32 igb_ready_nvm_eeprom(struct e1000_hw *hw)
 		/* Clear SK and CS */
 		eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);
 		wr32(E1000_EECD, eecd);
+		wrfl();
 		udelay(1);
 		timeout = NVM_MAX_RETRY_SPI;
 
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index ff244ce..414b022 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -1225,6 +1225,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
 
 	/* Disable all the interrupts */
 	wr32(E1000_IMC, ~0);
+	wrfl();
 	msleep(10);
 
 	/* Define all writable bits for ICS */
@@ -1268,6 +1269,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
 
 			wr32(E1000_IMC, mask);
 			wr32(E1000_ICS, mask);
+			wrfl();
 			msleep(10);
 
 			if (adapter->test_icr & mask) {
@@ -1289,6 +1291,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
 
 		wr32(E1000_IMS, mask);
 		wr32(E1000_ICS, mask);
+		wrfl();
 		msleep(10);
 
 		if (!(adapter->test_icr & mask)) {
@@ -1310,6 +1313,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
 
 			wr32(E1000_IMC, ~mask);
 			wr32(E1000_ICS, ~mask);
+			wrfl();
 			msleep(10);
 
 			if (adapter->test_icr & mask) {
@@ -1321,6 +1325,7 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
 
 	/* Disable all the interrupts */
 	wr32(E1000_IMC, ~0);
+	wrfl();
 	msleep(10);
 
 	/* Unhook test interrupt handler */
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index dc59905..ae3937e 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1052,6 +1052,7 @@ msi_only:
 		kfree(adapter->vf_data);
 		adapter->vf_data = NULL;
 		wr32(E1000_IOVCTL, E1000_IOVCTL_REUSE_VFQ);
+		wrfl();
 		msleep(100);
 		dev_info(&adapter->pdev->dev, "IOV Disabled\n");
 	}
@@ -2198,6 +2199,7 @@ static void __devexit igb_remove(struct pci_dev *pdev)
 		kfree(adapter->vf_data);
 		adapter->vf_data = NULL;
 		wr32(E1000_IOVCTL, E1000_IOVCTL_REUSE_VFQ);
+		wrfl();
 		msleep(100);
 		dev_info(&pdev->dev, "IOV Disabled\n");
 	}
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index 1330c8e..40ed066 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -1226,6 +1226,7 @@ static void igbvf_configure_tx(struct igbvf_adapter *adapter)
 	/* disable transmits */
 	txdctl = er32(TXDCTL(0));
 	ew32(TXDCTL(0), txdctl & ~E1000_TXDCTL_QUEUE_ENABLE);
+	e1e_flush();
 	msleep(10);
 
 	/* Setup the HW Tx Head and Tail descriptor pointers */
@@ -1306,6 +1307,7 @@ static void igbvf_configure_rx(struct igbvf_adapter *adapter)
 	/* disable receives */
 	rxdctl = er32(RXDCTL(0));
 	ew32(RXDCTL(0), rxdctl & ~E1000_RXDCTL_QUEUE_ENABLE);
+	e1e_flush();
 	msleep(10);
 
 	rdlen = rx_ring->count * sizeof(union e1000_adv_rx_desc);
diff --git a/drivers/net/ixgb/ixgb_ee.c b/drivers/net/ixgb/ixgb_ee.c
index c982ab9..38b362b 100644
--- a/drivers/net/ixgb/ixgb_ee.c
+++ b/drivers/net/ixgb/ixgb_ee.c
@@ -57,6 +57,7 @@ ixgb_raise_clock(struct ixgb_hw *hw,
 	 */
 	*eecd_reg = *eecd_reg | IXGB_EECD_SK;
 	IXGB_WRITE_REG(hw, EECD, *eecd_reg);
+	IXGB_WRITE_FLUSH(hw);
 	udelay(50);
 }
 
@@ -75,6 +76,7 @@ ixgb_lower_clock(struct ixgb_hw *hw,
 	 */
 	*eecd_reg = *eecd_reg & ~IXGB_EECD_SK;
 	IXGB_WRITE_REG(hw, EECD, *eecd_reg);
+	IXGB_WRITE_FLUSH(hw);
 	udelay(50);
 }
 
@@ -112,6 +114,7 @@ ixgb_shift_out_bits(struct ixgb_hw *hw,
 			eecd_reg |= IXGB_EECD_DI;
 
 		IXGB_WRITE_REG(hw, EECD, eecd_reg);
+		IXGB_WRITE_FLUSH(hw);
 
 		udelay(50);
 
@@ -206,21 +209,25 @@ ixgb_standby_eeprom(struct ixgb_hw *hw)
 	/*  Deselect EEPROM  */
 	eecd_reg &= ~(IXGB_EECD_CS | IXGB_EECD_SK);
 	IXGB_WRITE_REG(hw, EECD, eecd_reg);
+	IXGB_WRITE_FLUSH(hw);
 	udelay(50);
 
 	/*  Clock high  */
 	eecd_reg |= IXGB_EECD_SK;
 	IXGB_WRITE_REG(hw, EECD, eecd_reg);
+	IXGB_WRITE_FLUSH(hw);
 	udelay(50);
 
 	/*  Select EEPROM  */
 	eecd_reg |= IXGB_EECD_CS;
 	IXGB_WRITE_REG(hw, EECD, eecd_reg);
+	IXGB_WRITE_FLUSH(hw);
 	udelay(50);
 
 	/*  Clock low  */
 	eecd_reg &= ~IXGB_EECD_SK;
 	IXGB_WRITE_REG(hw, EECD, eecd_reg);
+	IXGB_WRITE_FLUSH(hw);
 	udelay(50);
 }
 
@@ -239,11 +246,13 @@ ixgb_clock_eeprom(struct ixgb_hw *hw)
 	/*  Rising edge of clock  */
 	eecd_reg |= IXGB_EECD_SK;
 	IXGB_WRITE_REG(hw, EECD, eecd_reg);
+	IXGB_WRITE_FLUSH(hw);
 	udelay(50);
 
 	/*  Falling edge of clock  */
 	eecd_reg &= ~IXGB_EECD_SK;
 	IXGB_WRITE_REG(hw, EECD, eecd_reg);
+	IXGB_WRITE_FLUSH(hw);
 	udelay(50);
 }
 
diff --git a/drivers/net/ixgb/ixgb_hw.c b/drivers/net/ixgb/ixgb_hw.c
index 6cb2e42..3d61a9e 100644
--- a/drivers/net/ixgb/ixgb_hw.c
+++ b/drivers/net/ixgb/ixgb_hw.c
@@ -149,6 +149,7 @@ ixgb_adapter_stop(struct ixgb_hw *hw)
 	 */
 	IXGB_WRITE_REG(hw, RCTL, IXGB_READ_REG(hw, RCTL) & ~IXGB_RCTL_RXEN);
 	IXGB_WRITE_REG(hw, TCTL, IXGB_READ_REG(hw, TCTL) & ~IXGB_TCTL_TXEN);
+	IXGB_WRITE_FLUSH(hw);
 	msleep(IXGB_DELAY_BEFORE_RESET);
 
 	/* Issue a global reset to the MAC.  This will reset the chip's
@@ -1220,6 +1221,7 @@ ixgb_optics_reset_bcm(struct ixgb_hw *hw)
 	ctrl &= ~IXGB_CTRL0_SDP2;
 	ctrl |= IXGB_CTRL0_SDP3;
 	IXGB_WRITE_REG(hw, CTRL0, ctrl);
+	IXGB_WRITE_FLUSH(hw);
 
 	/* SerDes needs extra delay */
 	msleep(IXGB_SUN_PHY_RESET_DELAY);
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c
index 777051f..fc1375f 100644
--- a/drivers/net/ixgbe/ixgbe_common.c
+++ b/drivers/net/ixgbe/ixgbe_common.c
@@ -2632,6 +2632,7 @@ s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index)
 		autoc_reg |= IXGBE_AUTOC_AN_RESTART;
 		autoc_reg |= IXGBE_AUTOC_FLU;
 		IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg);
+		IXGBE_WRITE_FLUSH(hw);
 		usleep_range(10000, 20000);
 	}
 
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index dc64955..82d4244 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -1378,6 +1378,7 @@ static int ixgbe_intr_test(struct ixgbe_adapter *adapter, u64 *data)
 
 	/* Disable all the interrupts */
 	IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, 0xFFFFFFFF);
+	IXGBE_WRITE_FLUSH(&adapter->hw);
 	usleep_range(10000, 20000);
 
 	/* Test each interrupt */
@@ -1398,6 +1399,7 @@ static int ixgbe_intr_test(struct ixgbe_adapter *adapter, u64 *data)
 			                ~mask & 0x00007FFF);
 			IXGBE_WRITE_REG(&adapter->hw, IXGBE_EICS,
 			                ~mask & 0x00007FFF);
+			IXGBE_WRITE_FLUSH(&adapter->hw);
 			usleep_range(10000, 20000);
 
 			if (adapter->test_icr & mask) {
@@ -1415,6 +1417,7 @@ static int ixgbe_intr_test(struct ixgbe_adapter *adapter, u64 *data)
 		adapter->test_icr = 0;
 		IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, mask);
 		IXGBE_WRITE_REG(&adapter->hw, IXGBE_EICS, mask);
+		IXGBE_WRITE_FLUSH(&adapter->hw);
 		usleep_range(10000, 20000);
 
 		if (!(adapter->test_icr &mask)) {
@@ -1435,6 +1438,7 @@ static int ixgbe_intr_test(struct ixgbe_adapter *adapter, u64 *data)
 			                ~mask & 0x00007FFF);
 			IXGBE_WRITE_REG(&adapter->hw, IXGBE_EICS,
 			                ~mask & 0x00007FFF);
+			IXGBE_WRITE_FLUSH(&adapter->hw);
 			usleep_range(10000, 20000);
 
 			if (adapter->test_icr) {
@@ -1446,6 +1450,7 @@ static int ixgbe_intr_test(struct ixgbe_adapter *adapter, u64 *data)
 
 	/* Disable all the interrupts */
 	IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, 0xFFFFFFFF);
+	IXGBE_WRITE_FLUSH(&adapter->hw);
 	usleep_range(10000, 20000);
 
 	/* Unhook test interrupt handler */
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 1be6175..26b132b 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -184,6 +184,7 @@ static inline void ixgbe_disable_sriov(struct ixgbe_adapter *adapter)
 	vmdctl = IXGBE_READ_REG(hw, IXGBE_VT_CTL);
 	vmdctl &= ~IXGBE_VT_CTL_POOL_MASK;
 	IXGBE_WRITE_REG(hw, IXGBE_VT_CTL, vmdctl);
+	IXGBE_WRITE_FLUSH(hw);
 
 	/* take a breather then clean up driver data */
 	msleep(100);
diff --git a/drivers/net/ixgbe/ixgbe_phy.c b/drivers/net/ixgbe/ixgbe_phy.c
index 735f686..f7ca351 100644
--- a/drivers/net/ixgbe/ixgbe_phy.c
+++ b/drivers/net/ixgbe/ixgbe_phy.c
@@ -1585,6 +1585,7 @@ static s32 ixgbe_raise_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl)
 	*i2cctl |= IXGBE_I2C_CLK_OUT;
 
 	IXGBE_WRITE_REG(hw, IXGBE_I2CCTL, *i2cctl);
+	IXGBE_WRITE_FLUSH(hw);
 
 	/* SCL rise time (1000ns) */
 	udelay(IXGBE_I2C_T_RISE);
@@ -1605,6 +1606,7 @@ static void ixgbe_lower_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl)
 	*i2cctl &= ~IXGBE_I2C_CLK_OUT;
 
 	IXGBE_WRITE_REG(hw, IXGBE_I2CCTL, *i2cctl);
+	IXGBE_WRITE_FLUSH(hw);
 
 	/* SCL fall time (300ns) */
 	udelay(IXGBE_I2C_T_FALL);
@@ -1628,6 +1630,7 @@ static s32 ixgbe_set_i2c_data(struct ixgbe_hw *hw, u32 *i2cctl, bool data)
 		*i2cctl &= ~IXGBE_I2C_DATA_OUT;
 
 	IXGBE_WRITE_REG(hw, IXGBE_I2CCTL, *i2cctl);
+	IXGBE_WRITE_FLUSH(hw);
 
 	/* Data rise/fall (1000ns/300ns) and set-up time (250ns) */
 	udelay(IXGBE_I2C_T_RISE + IXGBE_I2C_T_FALL + IXGBE_I2C_T_SU_DATA);
diff --git a/drivers/net/ixgbe/ixgbe_x540.c b/drivers/net/ixgbe/ixgbe_x540.c
index bec30ed..2696c78 100644
--- a/drivers/net/ixgbe/ixgbe_x540.c
+++ b/drivers/net/ixgbe/ixgbe_x540.c
@@ -162,6 +162,7 @@ mac_reset_top:
 	ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT);
 	ctrl_ext |= IXGBE_CTRL_EXT_PFRSTD;
 	IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, ctrl_ext);
+	IXGBE_WRITE_FLUSH(hw);
 
 	msleep(50);
 
-- 
1.7.6


^ permalink raw reply related

* [PATCH 1/3] via-velocity : update receive packets statistics.
From: Francois Romieu @ 2011-08-04 12:37 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Jon Nelson

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=14076.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Tested-by: Jon Nelson <jnelson@jamponi.net>
---

 drivers/net/via-velocity.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index deb1eca..ae66696 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -2092,6 +2092,7 @@ static int velocity_receive_frame(struct velocity_info *vptr, int idx)
 	netif_rx(skb);
 
 	stats->rx_bytes += pkt_len;
+	stats->rx_packets++;
 
 	return 0;
 }
-- 
1.7.4.4


^ permalink raw reply related

* [PATCH 2/3] via-velocity : ethtool statistics support.
From: Francois Romieu @ 2011-08-04 12:38 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Jon Nelson

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Tested-by: Jon Nelson <jnelson@jamponi.net>
---
 drivers/net/via-velocity.c |   74 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 74 insertions(+), 0 deletions(-)

diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index ae66696..27bcd3b 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -3449,6 +3449,77 @@ static int velocity_set_coalesce(struct net_device *dev,
 	return 0;
 }
 
+static const char velocity_gstrings[][ETH_GSTRING_LEN] = {
+	"rx_all",
+	"rx_ok",
+	"tx_ok",
+	"rx_error",
+	"rx_runt_ok",
+	"rx_runt_err",
+	"rx_64",
+	"tx_64",
+	"rx_65_to_127",
+	"tx_65_to_127",
+	"rx_128_to_255",
+	"tx_128_to_255",
+	"rx_256_to_511",
+	"tx_256_to_511",
+	"rx_512_to_1023",
+	"tx_512_to_1023",
+	"rx_1024_to_1518",
+	"tx_1024_to_1518",
+	"tx_ether_collisions",
+	"rx_crc_errors",
+	"rx_jumbo",
+	"tx_jumbo",
+	"rx_mac_control_frames",
+	"tx_mac_control_frames",
+	"rx_frame_alignement_errors",
+	"rx_long_ok",
+	"rx_long_err",
+	"tx_sqe_errors",
+	"rx_no_buf",
+	"rx_symbol_errors",
+	"in_range_length_errors",
+	"late_collisions"
+};
+
+static void velocity_get_strings(struct net_device *dev, u32 sset, u8 *data)
+{
+	switch (sset) {
+	case ETH_SS_STATS:
+		memcpy(data, *velocity_gstrings, sizeof(velocity_gstrings));
+		break;
+	}
+}
+
+static int velocity_get_sset_count(struct net_device *dev, int sset)
+{
+	switch (sset) {
+	case ETH_SS_STATS:
+		return ARRAY_SIZE(velocity_gstrings);
+	default:
+		return -EOPNOTSUPP;
+	}
+}
+
+static void velocity_get_ethtool_stats(struct net_device *dev,
+				       struct ethtool_stats *stats, u64 *data)
+{
+	if (netif_running(dev)) {
+		struct velocity_info *vptr = netdev_priv(dev);
+		u32 *p = vptr->mib_counter;
+		int i;
+
+		spin_lock_irq(&vptr->lock);
+		velocity_update_hw_mibs(vptr);
+		spin_unlock_irq(&vptr->lock);
+
+		for (i = 0; i < ARRAY_SIZE(velocity_gstrings); i++)
+			*data++ = *p++;
+	}
+}
+
 static const struct ethtool_ops velocity_ethtool_ops = {
 	.get_settings	=	velocity_get_settings,
 	.set_settings	=	velocity_set_settings,
@@ -3458,6 +3529,9 @@ static const struct ethtool_ops velocity_ethtool_ops = {
 	.get_msglevel	=	velocity_get_msglevel,
 	.set_msglevel	=	velocity_set_msglevel,
 	.get_link	=	velocity_get_link,
+	.get_strings		= velocity_get_strings,
+	.get_sset_count		= velocity_get_sset_count,
+	.get_ethtool_stats	= velocity_get_ethtool_stats,
 	.get_coalesce	=	velocity_get_coalesce,
 	.set_coalesce	=	velocity_set_coalesce,
 	.begin		=	velocity_ethtool_up,
-- 
1.7.4.4


^ permalink raw reply related

* [PATCH 3/3] via-velocity : cleanups.
From: Francois Romieu @ 2011-08-04 12:39 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Jon Nelson

- empty lines
- tabs / spaces
- ETHTOOL_GWOL _is_ defined
- useless cast from void *

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
---
 drivers/net/via-velocity.c |   71 +++++++++++++++----------------------------
 1 files changed, 25 insertions(+), 46 deletions(-)

diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index 27bcd3b..490ec5b 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -42,7 +42,6 @@
  *
  */
 
-
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/bitops.h>
@@ -112,7 +111,6 @@ static void mac_get_cam_mask(struct mac_regs __iomem *regs, u8 *mask)
 	BYTE_REG_BITS_SET(CAMCR_PS_MAR, CAMCR_PS1 | CAMCR_PS0, &regs->CAMCR);
 }
 
-
 /**
  *	mac_set_cam_mask	-	Set a CAM mask
  *	@regs: register block for this velocity
@@ -700,7 +698,6 @@ static int velocity_mii_read(struct mac_regs __iomem *regs, u8 index, u16 *data)
 	return 0;
 }
 
-
 /**
  *	mii_check_media_mode	-	check media state
  *	@regs: velocity registers
@@ -866,8 +863,6 @@ static u32 check_connection_type(struct mac_regs __iomem *regs)
 	return status;
 }
 
-
-
 /**
  *	velocity_set_media_mode		-	set media mode
  *	@mii_status: old MII link state
@@ -1262,6 +1257,7 @@ static void setup_queue_timers(struct velocity_info *vptr)
 		writeb(rxqueue_timer, &vptr->mac_regs->RQETMR);
 	}
 }
+
 /**
  * setup_adaptive_interrupts  -  Setup interrupt suppression
  *
@@ -1601,8 +1597,6 @@ static void velocity_free_rd_ring(struct velocity_info *vptr)
 	vptr->rx.info = NULL;
 }
 
-
-
 /**
  *	velocity_init_rd_ring	-	set up receive ring
  *	@vptr: velocity to configure
@@ -1676,7 +1670,6 @@ static void velocity_free_dma_rings(struct velocity_info *vptr)
 	pci_free_consistent(vptr->pdev, size, vptr->rx.ring, vptr->rx.pool_dma);
 }
 
-
 static int velocity_init_rings(struct velocity_info *vptr, int mtu)
 {
 	int ret;
@@ -1739,7 +1732,6 @@ static void velocity_free_tx_buf(struct velocity_info *vptr,
 	tdinfo->skb = NULL;
 }
 
-
 /*
  *	FIXME: could we merge this with velocity_free_tx_buf ?
  */
@@ -1787,7 +1779,6 @@ static void velocity_free_td_ring(struct velocity_info *vptr)
 	}
 }
 
-
 static void velocity_free_rings(struct velocity_info *vptr)
 {
 	velocity_free_td_ring(vptr);
@@ -2025,7 +2016,6 @@ static inline void velocity_iph_realign(struct velocity_info *vptr,
 	}
 }
 
-
 /**
  *	velocity_receive_frame	-	received packet processor
  *	@vptr: velocity we are handling
@@ -2097,7 +2087,6 @@ static int velocity_receive_frame(struct velocity_info *vptr, int idx)
 	return 0;
 }
 
-
 /**
  *	velocity_rx_srv		-	service RX interrupt
  *	@vptr: velocity
@@ -2405,7 +2394,6 @@ static int velocity_mii_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd
 	return 0;
 }
 
-
 /**
  *	velocity_ioctl		-	ioctl entry point
  *	@dev: network device
@@ -2620,14 +2608,13 @@ out:
 	return NETDEV_TX_OK;
 }
 
-
 static const struct net_device_ops velocity_netdev_ops = {
 	.ndo_open		= velocity_open,
 	.ndo_stop		= velocity_close,
 	.ndo_start_xmit		= velocity_xmit,
 	.ndo_get_stats		= velocity_get_stats,
 	.ndo_validate_addr	= eth_validate_addr,
-	.ndo_set_mac_address 	= eth_mac_addr,
+	.ndo_set_mac_address	= eth_mac_addr,
 	.ndo_set_multicast_list	= velocity_set_multi,
 	.ndo_change_mtu		= velocity_change_mtu,
 	.ndo_do_ioctl		= velocity_ioctl,
@@ -2718,7 +2705,6 @@ static u32 velocity_get_link(struct net_device *dev)
 	return BYTE_REG_BITS_IS_ON(PHYSR0_LINKGD, &regs->PHYSR0) ? 1 : 0;
 }
 
-
 /**
  *	velocity_found1		-	set up discovered velocity card
  *	@pdev: PCI device
@@ -2865,7 +2851,6 @@ err_free_dev:
 	goto out;
 }
 
-
 #ifdef CONFIG_PM
 /**
  *	wol_calc_crc		-	WOL CRC
@@ -3036,7 +3021,7 @@ static int velocity_suspend(struct pci_dev *pdev, pm_message_t state)
 
 	spin_lock_irqsave(&vptr->lock, flags);
 	pci_save_state(pdev);
-#ifdef ETHTOOL_GWOL
+
 	if (vptr->flags & VELOCITY_FLAGS_WOL_ENABLED) {
 		velocity_get_ip(vptr);
 		velocity_save_context(vptr, &vptr->context);
@@ -3050,9 +3035,7 @@ static int velocity_suspend(struct pci_dev *pdev, pm_message_t state)
 		pci_disable_device(pdev);
 		pci_set_power_state(pdev, pci_choose_state(pdev, state));
 	}
-#else
-	pci_set_power_state(pdev, pci_choose_state(pdev, state));
-#endif
+
 	spin_unlock_irqrestore(&vptr->lock, flags);
 	return 0;
 }
@@ -3133,13 +3116,13 @@ static int velocity_resume(struct pci_dev *pdev)
  *	uses this to handle all our card discover and plugging
  */
 static struct pci_driver velocity_driver = {
-      .name	= VELOCITY_NAME,
-      .id_table	= velocity_id_table,
-      .probe	= velocity_found1,
-      .remove	= __devexit_p(velocity_remove1),
+	.name		= VELOCITY_NAME,
+	.id_table	= velocity_id_table,
+	.probe		= velocity_found1,
+	.remove		= __devexit_p(velocity_remove1),
 #ifdef CONFIG_PM
-      .suspend	= velocity_suspend,
-      .resume	= velocity_resume,
+	.suspend	= velocity_suspend,
+	.resume		= velocity_resume,
 #endif
 };
 
@@ -3521,28 +3504,27 @@ static void velocity_get_ethtool_stats(struct net_device *dev,
 }
 
 static const struct ethtool_ops velocity_ethtool_ops = {
-	.get_settings	=	velocity_get_settings,
-	.set_settings	=	velocity_set_settings,
-	.get_drvinfo	=	velocity_get_drvinfo,
-	.get_wol	=	velocity_ethtool_get_wol,
-	.set_wol	=	velocity_ethtool_set_wol,
-	.get_msglevel	=	velocity_get_msglevel,
-	.set_msglevel	=	velocity_set_msglevel,
-	.get_link	=	velocity_get_link,
+	.get_settings		= velocity_get_settings,
+	.set_settings		= velocity_set_settings,
+	.get_drvinfo		= velocity_get_drvinfo,
+	.get_wol		= velocity_ethtool_get_wol,
+	.set_wol		= velocity_ethtool_set_wol,
+	.get_msglevel		= velocity_get_msglevel,
+	.set_msglevel		= velocity_set_msglevel,
+	.get_link		= velocity_get_link,
 	.get_strings		= velocity_get_strings,
 	.get_sset_count		= velocity_get_sset_count,
 	.get_ethtool_stats	= velocity_get_ethtool_stats,
-	.get_coalesce	=	velocity_get_coalesce,
-	.set_coalesce	=	velocity_set_coalesce,
-	.begin		=	velocity_ethtool_up,
-	.complete	=	velocity_ethtool_down
+	.get_coalesce		= velocity_get_coalesce,
+	.set_coalesce		= velocity_set_coalesce,
+	.begin			= velocity_ethtool_up,
+	.complete		= velocity_ethtool_down
 };
 
-#ifdef CONFIG_PM
-#ifdef CONFIG_INET
+#if defined(CONFIG_PM) && defined(CONFIG_INET)
 static int velocity_netdev_event(struct notifier_block *nb, unsigned long notification, void *ptr)
 {
-	struct in_ifaddr *ifa = (struct in_ifaddr *) ptr;
+	struct in_ifaddr *ifa = ptr;
 	struct net_device *dev = ifa->ifa_dev->dev;
 
 	if (dev_net(dev) == &init_net &&
@@ -3551,12 +3533,9 @@ static int velocity_netdev_event(struct notifier_block *nb, unsigned long notifi
 
 	return NOTIFY_DONE;
 }
-#endif	/* CONFIG_INET */
-#endif	/* CONFIG_PM */
 
-#if defined(CONFIG_PM) && defined(CONFIG_INET)
 static struct notifier_block velocity_inetaddr_notifier = {
-      .notifier_call	= velocity_netdev_event,
+	.notifier_call	= velocity_netdev_event,
 };
 
 static void velocity_register_notifier(void)
-- 
1.7.4.4


^ permalink raw reply related

* Re: [PATCH] mlx4: decreasing ref count when removing mac
From: Roland Dreier @ 2011-08-04 12:55 UTC (permalink / raw)
  To: Yevgeny Petrilin
  Cc: davem-fT/PcQaiUtIeIZ0/mPfg9Q, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <4E3A7CE8.4080407-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>

> For older FW versions, when a Mac address removed from Mac table,
> we should set 0 for reference count for the corresponding Mac index.
> Fixes a bug where removing Mac from the table still left that entry as
> invalid.

This fixes my problems with MTU settings with old FW.

Tested-by: Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] net: Fix security_socket_sendmsg() bypass problem.
From: Anton Blanchard @ 2011-08-04 12:56 UTC (permalink / raw)
  To: Tetsuo Handa; +Cc: davem, eparis, casey, mjt, netdev, linux-security-module
In-Reply-To: <201108040650.JIF90138.tFLHFJOSFOQMOV@I-love.SAKURA.ne.jp>


Hi,

> > [PATCH] net: Cap number of elements for recvmmsg and sendmmsg
> > 
> > To limit the amount of time we can spend in recvmmsg and sendmmsg,
> > cap the number of elements to UIO_MAXIOV (currently 1024).
> 
> Looks reasonable value. But it will return less than requested
> without setting error code. Programmers would needlessly call
> getsockopt(SO_ERROR) and get 0. Maybe -EINVAL or something is better
> than returning less than requested?

Having to call getsockopt(SO_ERROR) at all is confusing. We should
change sendmmsg to only return an error if no messages are sent. If we
do this, then the application will have already have to handle the case
where we send less messages than requested.

Returning EINVAL adds complexity to the system call that I think we
should avoid. Will send out the patches for review after some sleep.

Anton

^ permalink raw reply

* Re: return of ip_rt_bug()
From: Tom London @ 2011-08-04 13:14 UTC (permalink / raw)
  To: Julian Anastasov; +Cc: Dave Jones, netdev
In-Reply-To: <alpine.LFD.2.00.1108041422510.1495@ja.ssi.bg>

On Thu, Aug 4, 2011 at 5:20 AM, Julian Anastasov <ja@ssi.bg> wrote:
>
>        Hello,
>
> On Tue, 2 Aug 2011, Dave Jones wrote:
>
>> Tom (CC'd) has been hitting that ip_rt_bug() WARN_ON() since 3.0rc
>>
>> Here's the latest report.
>>
>> ------------[ cut here]------------
>> WARNING: atnet/ipv4/route.c:1714 ip_rt_bug+0x5c/0x62()
>> Hardware name: 74585FU
>> Modules linked in: fuse
>> ip6table_filter ip6_tables ebtable_nat ebtables ppdev parport_pc lp parport
>> ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state
>> nf_conntrack xt_CHECKSUM iptable_mangle tun bridge stp llc sunrpc rfcomm bnep
>> usblp arc4 uvcvideo videodev media snd_usb_audio snd_usbmidi_lib snd_rawmidi
>> v4l2_compat_ioctl32 iwlagn microcode i2c_i801 btusb iTCO_wdt
>> iTCO_vendor_support mac80211 bluetooth snd_hda_codec_conexant cfg80211
>> thinkpad_acpi snd_hda_intel snd_hda_codec rfkill snd_hwdep snd_seq
>> snd_seq_device snd_pcm snd_timer snd soundcore snd_page_alloc e1000e virtio_net
>> kvm_intel kvm uinput wmi i915 drm_kms_helper drm i2c_algo_bit i2c_core video[last unloaded: scsi_wait_scan]
>> Pid: 5492, comm: xsane Not tainted 3.1.0-0.rc0.git12.1.fc17.x86_64 #1
>> Call Trace:
>>  [<ffffffff8105c5ec>] warn_slowpath_common+0x83/0x9b
>>  [<ffffffff8105c61e>] warn_slowpath_null+0x1a/0x1c
>>  [<ffffffff8142f485>] ip_rt_bug+0x5c/0x62
>>  [<ffffffff81437091>] dst_output+0x19/0x1d
>>  [<ffffffff814387c0>] ip_local_out+0x20/0x25
>>  [<ffffffff81439695>] ip_send_skb+0x19/0x3e
>>  [<ffffffff81455ea2>] udp_send_skb+0x239/0x29b
>>  [<ffffffff8145763f>] udp_sendmsg+0x5a1/0x7d4
>>  [<ffffffff813f67d5>] ? release_sock+0x35/0x155
>>  [<ffffffff8143718c>] ? ip_select_ident+0x3d/0x3d
>>  [<ffffffff81062703>] ? local_bh_enable_ip+0xe/0x10
>>  [<ffffffff814f1231>] ? _raw_spin_unlock_bh+0x40/0x44
>>  [<ffffffff813f68ec>] ? release_sock+0x14c/0x155
>>  [<ffffffff8145eb58>] inet_sendmsg+0x66/0x6f
>>  [<ffffffff813f1d92>] sock_sendmsg+0xe6/0x109
>>  [<ffffffff8108f1c8>] ? lock_acquire+0x10f/0x13e
>>  [<ffffffff8110dd34>] ? might_fault+0x5c/0xac
>>  [<ffffffff8108f08c>] ? lock_release+0x1a4/0x1d1
>>  [<ffffffff8110dd7d>] ? might_fault+0xa5/0xac
>>  [<ffffffff813f2ad7>] ? copy_from_user+0x2f/0x31
>>  [<ffffffff813f496d>] sys_sendto+0x132/0x174
>>  [<ffffffff8124ef6e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
>>  [<ffffffff814f80c2>] system_call_fastpath+0x16/0x1b
>> ---[ end trace 0e82aef47f8d8552 ]---
>> ------------[ cut here ]------------
>>
>> all the traces he's hit so far seem to be caused by udp, and they all seem to be
>> going from 192.168.2.5 -> 255.255.255.255
>>
>> https://bugzilla.redhat.com/show_bug.cgi?id=712632 is his full report with similar traces.
>
>        Tom, what kind of netfilter rules do you have in
> LOCAL_OUT/OUTPUT hooks? We eliminated one ip_route_input call
> from net/ipv4/netfilter.c (ip_route_me_harder) but it looks like
> in your kernel ip_route_input is called again from this hook.
> It is interesting why only broadcasts get such input route.
>
>        I assume 192.168.2.5 is an existing local address that
> is present during the test? Any additional modules that use
> ip_route_input ? Are nf_queue, IPVS, br_netfilter or tproxy used?
>
> Regards
>
> --
> Julian Anastasov <ja@ssi.bg>
>

Here is what 'route' says:

[root@tlondon ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         tlondon         0.0.0.0         UG    0      0        0 eth0
192.168.2.0     *               255.255.255.0   U     1      0        0 eth0
192.168.122.0   *               255.255.255.0   U     0      0        0 virbr0
[root@tlondon ~]#

and 'ifconfig':

eth0      Link encap:Ethernet  HWaddr 00:1F:16:0B:56:A8
          inet addr:192.168.2.6  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::21f:16ff:fe0b:56a8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4269 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3503 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3948798 (3.7 MiB)  TX bytes:517347 (505.2 KiB)
          Interrupt:20 Memory:f2600000-f2620000

Here is what is in /etc/sysconfig/iptables:

[root@tlondon sysconfig]# cat iptables
# Generated by iptables-save v1.4.9 on Mon Jan 17 06:36:35 2011
*security
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:DNS - [0:0]
:INTERNET - [0:0]
:INTRANET - [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j CONNSECMARK --restore
-A INPUT -s 255.255.255.255/32 -j INTRANET
-A INPUT -s 127.0.0.0/8 -j INTRANET
-A INPUT -s 10.0.0.0/8 -j INTRANET
-A INPUT -s 172.16.0.0/16 -j INTRANET
-A INPUT -s 224.0.0.0/24 -j INTRANET
-A INPUT -s 192.168.0.0/16 -j INTRANET
-A INPUT -j INTERNET
-A OUTPUT -m state --state RELATED,ESTABLISHED -j CONNSECMARK --restore
-A OUTPUT -d 255.255.255.255/32 -j INTRANET
-A OUTPUT -d 127.0.0.0/8 -j INTRANET
-A OUTPUT -d 10.0.0.0/8 -j INTRANET
-A OUTPUT -d 172.16.0.0/16 -j INTRANET
-A OUTPUT -d 224.0.0.0/24 -j INTRANET
-A OUTPUT -d 192.168.0.0/16 -j INTRANET
-A OUTPUT -p udp -m udp --dport 53 -j DNS
-A OUTPUT -p tcp -m tcp --dport 53 -j DNS
-A OUTPUT -j INTERNET
-A DNS -j SECMARK --selctx system_u:object_r:dns_internet_packet_t:s0
-A DNS -j CONNSECMARK --save
-A DNS -j ACCEPT
-A INTERNET -j SECMARK --selctx system_u:object_r:internet_packet_t:s0
-A INTERNET -j CONNSECMARK --save
-A INTERNET -j ACCEPT
-A INTRANET -j SECMARK --selctx system_u:object_r:intranet_packet_t:s0
-A INTRANET -j CONNSECMARK --save
-A INTRANET -j ACCEPT
COMMIT
# Completed on Mon Jan 17 06:36:35 2011
# Generated by iptables-save v1.4.9 on Mon Jan 17 06:36:35 2011
*nat
:PREROUTING ACCEPT [35:3434]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [812:64159]
:POSTROUTING ACCEPT [810:63177]
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p tcp -j
MASQUERADE --to-ports 1024-65535
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p udp -j
MASQUERADE --to-ports 1024-65535
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -j MASQUERADE
COMMIT
# Completed on Mon Jan 17 06:36:35 2011
# Generated by iptables-save v1.4.9 on Mon Jan 17 06:36:35 2011
*mangle
:PREROUTING ACCEPT [83178:89234503]
:INPUT ACCEPT [83176:89234439]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [52780:3860973]
:POSTROUTING ACCEPT [52919:3899453]
-A POSTROUTING -o virbr0 -p udp -m udp --dport 68 -j CHECKSUM --checksum-fill
COMMIT
# Completed on Mon Jan 17 06:36:35 2011
# Generated by iptables-save v1.4.9 on Mon Jan 17 06:36:35 2011
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [52780:3860973]
-A INPUT -i virbr0 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p udp -m udp --dport 67 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 67 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 631 -j ACCEPT
-A INPUT -p udp -m state --state NEW -m udp --dport 631 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -d 192.168.122.0/24 -o virbr0 -m state --state
RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -s 192.168.122.0/24 -i virbr0 -j ACCEPT
-A FORWARD -i virbr0 -o virbr0 -j ACCEPT
-A FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -m physdev --physdev-is-bridged -j ACCEPT
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Mon Jan 17 06:36:35 2011
[root@tlondon sysconfig]#

and here is what 'iptables -L' says:

[root@tlondon ~]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:domain
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootps
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:bootps

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             192.168.122.0/24     state
RELATED,ESTABLISHED
ACCEPT     all  --  192.168.122.0/24     anywhere
ACCEPT     all  --  anywhere             anywhere
REJECT     all  --  anywhere             anywhere
reject-with icmp-port-unreachable
REJECT     all  --  anywhere             anywhere
reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
[root@tlondon ~]#

Regarding additional modules, I believe I'm running a 'stock' Fedora
Rawhide system.  Here is what 'lsmod' says:

[root@tlondon ~]# lsmod
Module                  Size  Used by
fuse                   70196  3
ip6table_filter        12815  0
ip6_tables             23088  1 ip6table_filter
ebtable_nat            12807  0
ebtables               27075  1 ebtable_nat
ipt_MASQUERADE         12880  3
iptable_nat            13383  1
nf_nat                 25795  2 ipt_MASQUERADE,iptable_nat
nf_conntrack_ipv4      14700  4 iptable_nat,nf_nat
nf_defrag_ipv4         12673  1 nf_conntrack_ipv4
xt_state               12578  1
nf_conntrack           81778  5
ipt_MASQUERADE,iptable_nat,nf_nat,nf_conntrack_ipv4,xt_state
ppdev                  13616  0
parport_pc             24112  0
xt_CHECKSUM            12549  1
lp                     22009  0
iptable_mangle         12695  1
parport                40823  3 ppdev,parport_pc,lp
tun                    19023  1
bridge                 85889  0
stp                    12946  1 bridge
llc                    14197  2 bridge,stp
rfcomm                 65661  4
bnep                   19857  2
usblp                  18206  0
arc4                   12529  2
uvcvideo               63617  0
videodev               85806  1 uvcvideo
media                  20522  2 uvcvideo,videodev
snd_usb_audio         108696  1
v4l2_compat_ioctl32    16677  1 videodev
snd_usbmidi_lib        24835  1 snd_usb_audio
snd_rawmidi            25641  1 snd_usbmidi_lib
snd_hda_codec_conexant    62115  1
snd_hda_intel          28992  3
iwlagn                370621  0
snd_hda_codec          91636  2 snd_hda_codec_conexant,snd_hda_intel
snd_hwdep              13595  2 snd_usb_audio,snd_hda_codec
snd_seq                57219  0
snd_seq_device         14173  2 snd_rawmidi,snd_seq
mac80211              282558  1 iwlagn
btusb                  20161  2
microcode              31412  0
i2c_i801               17765  0
snd_pcm                85340  4 snd_usb_audio,snd_hda_intel,snd_hda_codec
iTCO_wdt               17808  0
iTCO_vendor_support    13474  1 iTCO_wdt
cfg80211              161253  2 iwlagn,mac80211
bluetooth             215033  23 rfcomm,bnep,btusb
snd_timer              29131  2 snd_seq,snd_pcm
snd_page_alloc         14039  2 snd_hda_intel,snd_pcm
thinkpad_acpi          71386  0
rfkill                 21648  4 cfg80211,bluetooth,thinkpad_acpi
snd                    70856  19
snd_usb_audio,snd_usbmidi_lib,snd_rawmidi,snd_hda_codec_conexant,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_seq,snd_seq_device,snd_pcm,snd_timer,thinkpad_acpi
soundcore              14562  1 snd
e1000e                182622  0
virtio_net             19157  0
kvm_intel             125225  0
kvm                   348016  1 kvm_intel
uinput                 17722  0
wmi                    18697  0
i915                  403560  3
drm_kms_helper         36330  1 i915
drm                   201826  4 i915,drm_kms_helper
i2c_algo_bit           13246  1 i915
i2c_core               34077  6
videodev,i2c_i801,i915,drm_kms_helper,drm,i2c_algo_bit
video                  19174  1 i915
[root@tlondon ~]#

How else can I help?

tom
-- 
Tom London

^ permalink raw reply

* [PATCH] ucc_geth: Add SUPPORTED_MII and SUPPORTED_Autoneg
From: Joakim Tjernlund @ 2011-08-04 13:19 UTC (permalink / raw)
  To: netdev, Anton Vorontsov; +Cc: Joakim Tjernlund

The driver supports Autoneg and at least MII. Tell the PHY
that to avoid any confusion in the PHY code.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
---
 drivers/net/ucc_geth.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 06a5db3..fa00935 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -1760,10 +1760,12 @@ static int init_phy(struct net_device *dev)
 	if (priv->phy_interface == PHY_INTERFACE_MODE_SGMII)
 		uec_configure_serdes(dev);
 
-	phydev->supported &= (ADVERTISED_10baseT_Half |
-				 ADVERTISED_10baseT_Full |
-				 ADVERTISED_100baseT_Half |
-				 ADVERTISED_100baseT_Full);
+	phydev->supported &= (SUPPORTED_MII |
+			      SUPPORTED_Autoneg |
+			      ADVERTISED_10baseT_Half |
+			      ADVERTISED_10baseT_Full |
+			      ADVERTISED_100baseT_Half |
+			      ADVERTISED_100baseT_Full);
 
 	if (priv->max_speed == SPEED_1000)
 		phydev->supported |= ADVERTISED_1000baseT_Full;
-- 
1.7.3.4


^ permalink raw reply related

* Bug#631945: [Bugme-new] [Bug 39372] New: Problems with HFSC Scheduler
From: Michal Pokrywka @ 2011-08-04 13:55 UTC (permalink / raw)
  To: eric.dumazet
  Cc: kaber, soltys, akpm, netdev, bugme-daemon, hadi, lucas.bocchi,
	631945, 00bormoj, fdelawarde

From: Michal Soltys <soltys@ziu.info>
Date: Fri, 29 Jul 2011 14:29:10 +0200

>> On 11-07-22 11:58, Michal Pokrywka wrote:
>> 
>> commit b262a5da755cc6ed0cb4fba230cd9bf4037e1096 sch_sfq: fix peek()
>> implementation
>> 
>> and
>> 
>> commit 9df49f2bfe862573911a080c75a6d81113c5c81d sch_sfq: avoid giving
>> spurious NET_XMIT_CN signals
>> 
>> Reverting these patches makes HFSC work again.
>> 
>
> This one (upstream 8efa885406359af300d46910642b50ca82c0fe47) seems to be
> the culprit (does reverting only that one cures the problem ?)

Yes, indeed. Commit b262a5da755cc6ed0cb4fba230cd9bf4037e1096 is irrelevant.

Patch "sch_sfq: fix sfq_enqueue()" (provided by Eric Dumazet) applied to 2.6.39.1 fixes the problem, and hfsc+sfq works as expected.

^ permalink raw reply

* Re: [PATCH] ipv6: check for IPv4 mapped addresses when connecting IPv6 sockets
From: Vladislav Yasevich @ 2011-08-04 14:14 UTC (permalink / raw)
  To: Max Matveev; +Cc: netdev
In-Reply-To: <20110804075506.62225813270B@regina.usersys.redhat.com>

On 08/04/2011 03:42 AM, Max Matveev wrote:
> When support for binding to 'mapped INADDR_ANY (::ffff.0.0.0.0)' was added
> in 0f8d3c7ac3693d7b6c731bf2159273a59bf70e12 the rest of the code
> wasn't told so now it's possible to bind IPv6 datagram socket to
> ::ffff.0.0.0.0, connect it to another IPv4 address and it will all
> work except for getsockhame() which does not return the local address
> as expected.
> 
> To give getsockname() something to work with check for 'mapped INADDR_ANY'
> when connecting and update the in-core source addresses appropriately.
> 
> Signed-off-by: Max Matveev <makc@redhat.com>

Yes.  Good catch.

-vlad

> ---
>  net/ipv6/datagram.c |   11 +++++++++--
>  1 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
> index 1656033..d3a65a18 100644
> --- a/net/ipv6/datagram.c
> +++ b/net/ipv6/datagram.c
> @@ -33,6 +33,11 @@
>  #include <linux/errqueue.h>
>  #include <asm/uaccess.h>
>  
> +static inline int ipv6_mapped_addr_any(const struct in6_addr *a)
> +{
> +	return (ipv6_addr_v4mapped(a) && (a->s6_addr32[3] == 0));
> +}
> +
>  int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
>  {
>  	struct sockaddr_in6	*usin = (struct sockaddr_in6 *) uaddr;
> @@ -102,10 +107,12 @@ ipv4_connected:
>  
>  		ipv6_addr_set_v4mapped(inet->inet_daddr, &np->daddr);
>  
> -		if (ipv6_addr_any(&np->saddr))
> +		if (ipv6_addr_any(&np->saddr) ||
> +		    ipv6_mapped_addr_any(&np->saddr))
>  			ipv6_addr_set_v4mapped(inet->inet_saddr, &np->saddr);
>  
> -		if (ipv6_addr_any(&np->rcv_saddr)) {
> +		if (ipv6_addr_any(&np->rcv_saddr) || 
> +		    ipv6_mapped_addr_any(&np->rcv_saddr)) {
>  			ipv6_addr_set_v4mapped(inet->inet_rcv_saddr,
>  					       &np->rcv_saddr);
>  			if (sk->sk_prot->rehash)


^ permalink raw reply

* Re: strange behaviour of MC7700 with sierra_net
From: Phil Sutter @ 2011-08-04 16:38 UTC (permalink / raw)
  To: Elina Pasheva
  Cc: Rory Filer, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <8F90F944E50427428C60E12A34A309D23424BB0F25-3qf8vkpM5jTbmvMHnzRVpW3Pdy6AhKVLXbPIYa3/oNjDOqzlkpFKJg@public.gmane.org>

Hello Elina,

(Added the lists to CC again since others might benefit from the
provided information.)

On Tue, Aug 02, 2011 at 03:48:42PM -0700, Elina Pasheva wrote:
> Please note that we publish updates to sierra and sierra_net Linux drivers on Sierra Wireless Knowledge Base.
> http://www.sierrawireless.com/Support/knowledgebase.aspx
> 
> 
> Please find attached the latest published drivers (for kernel-2.6.38, but sierra_net may be ported to kernel-2.6.39 with almost no changes).
> 
> Would you please let me know if these work for you?
> 
> I have tried MC7700 device on kernel-2.6.38 with sierra v.1.7.40 and sierra_net v.3.0 Linux drivers.
> 
> Using a commercial sim card I do not see problems with sync as you described it.
> 
> Please let me know if it works better for you.

Thanks for the pointer! I've downloaded the DirectIP driver v3.0, which
indeed compiles against 2.6.39.2 without any changes at all. Also, the
SYNC problem is gone. Looking at the driver, it seems to be related to
the new function sierra_net_open() calling sierra_net_dosync() instead
of sierra_net_bind(). 

Other than that and the autopm-support, there are not many changes to
the driver. Are there concrete plans already when this will go mainline?

Greetings and again many thanks,
Phil
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: bonding and ifenslave version.
From: Stephen Hemminger @ 2011-08-04 16:57 UTC (permalink / raw)
  To: Nicolas de Pesloüan; +Cc: Jay Vosburgh, Andy Gospodarek, netdev
In-Reply-To: <4E3A2EBA.4040003@gmail.com>

On Thu, 04 Aug 2011 07:31:38 +0200
Nicolas de Pesloüan <nicolas.2p.debian@gmail.com> wrote:

> Le 03/08/2011 23:33, Stephen Hemminger a écrit :
> > On Wed, 03 Aug 2011 22:38:03 +0200
> > Nicolas de Pesloüan<nicolas.2p.debian@gmail.com>  wrote:
> <snip>
> >> At least, we can:
> >> - update the bonding documentation to clarify that ifenslave is deprecated (and move most ifenslave
> >> related stuffs at the end of the documentation);
> >> - possibly issue a warning when the API is used, suggesting to use sysfs instead.
> >>
> >> I can take care of the documentation update if appropriate.
> >>
> >> 	Nicolas.
> >
> > Or I could just put a shell script that does the same thing in iproute.
> 
> You mean, to replace ifenslave (from ifenslave.c) by a shell script by the same name that gives 
> users the same command-line interface but use sysfs instead of the ioctl API internally?
> 
> I had this in mind two years ago, in a private conversation while changing the ifenslave package on 
> Debian.
> 
> But chance exist that those who expect ifenslave to work would like to disable sysfs support if not 
> used. I assume that totally disabling sysfs at compile time would reduce the size of the kernel far 
> more that disabling the ioctl API. So, for those doing embedded things, this may makes sens to have 
> an ifenslave version that doesn't rely on sysfs.
> 
> Or do you mean, to replace ifenslave (.c) by a shell script that use netlink internally? Are all the 
> bonding options available through netlink? I remember many conversation about using netlink for 
> bonding setup, but don't remember seeing that in the actual code.

The sysfs interface is the least desirable.
The ifenslave script would just call 'ip link'


^ 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