Netdev List
 help / color / mirror / Atom feed
* [bug] sunhme unable to receive IPv4 unicasts
From: Birger Harzenetter @ 2014-10-23 22:04 UTC (permalink / raw)
  To: netdev

 from https://bugzilla.kernel.org/show_bug.cgi?id=86731

Any kind of transmission is fine.
Reception of IPv4 broadcast works
Reception of non-IP works (pppoe tested)
But IPv4 unicasts don't show up at all.
IPv6 not tested

Additional tests:
I tried to set promiscous mode, but still no trace of unicasts seen with  
tcpdump.

Last known working version: 3.15.10

   Greetings,
     WIMPy

^ permalink raw reply

* Re: [PATCH v2 net] tcp: md5: do not use alloc_percpu()
From: Eric Dumazet @ 2014-10-23 22:57 UTC (permalink / raw)
  To: David Ahern; +Cc: David Miller, Crestez Dan Leonard, netdev, Jonathan Toppins
In-Reply-To: <5449689B.9040806@gmail.com>

On Thu, 2014-10-23 at 14:44 -0600, David Ahern wrote:

> global variables do not need to be initialized to 0.
> 

Compilers are generating the same code nowadays.
They place such zero variables in bss anyway.
They finally got this right, maybe years ago.


$ nm -v net/ipv4/tcp.o | grep populated
0000000000000078 b tcp_md5sig_pool_populated

^ permalink raw reply

* Re: [PATCH v2 net] tcp: md5: do not use alloc_percpu()
From: David Ahern @ 2014-10-23 23:36 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, Crestez Dan Leonard, netdev, Jonathan Toppins
In-Reply-To: <1414105068.20845.38.camel@edumazet-glaptop2.roam.corp.google.com>

On 10/23/14, 4:57 PM, Eric Dumazet wrote:
> On Thu, 2014-10-23 at 14:44 -0600, David Ahern wrote:
>
>> global variables do not need to be initialized to 0.
>>
>
> Compilers are generating the same code nowadays.
> They place such zero variables in bss anyway.
> They finally got this right, maybe years ago.
>
>
> $ nm -v net/ipv4/tcp.o | grep populated
> 0000000000000078 b tcp_md5sig_pool_populated

Right. I was referring to coding standards. As I recall checkpatch 
throws a warning about it.

David

^ permalink raw reply

* [PATCH net] bpf: split eBPF out of NET
From: Alexei Starovoitov @ 2014-10-24  1:41 UTC (permalink / raw)
  To: David S. Miller
  Cc: Geert Uytterhoeven, Josh Triplett, Ingo Molnar, Steven Rostedt,
	Hannes Frederic Sowa, Eric Dumazet, Daniel Borkmann, netdev,
	linux-kernel

introduce two configs:
- hidden CONFIG_BPF to select eBPF interpreter that classic socket filters
  depend on
- visible CONFIG_BPF_SYSCALL (default off) that tracing and sockets can use

that solves several problems:
- tracing and others that wish to use eBPF don't need to depend on NET.
  They can use BPF_SYSCALL to allow loading from userspace or select BPF
  to use it directly from kernel in NET-less configs.
- in 3.18 programs cannot be attached to events yet, so don't force it on
- when the rest of eBPF infra is there in 3.19+, it's still useful to
  switch it off to minimize kernel size

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
---

bloat-o-meter on x64 shows:
add/remove: 0/60 grow/shrink: 0/2 up/down: 0/-15601 (-15601)

tested with many different config combinations. Hopefully didn't miss anything.

 init/Kconfig        |   14 ++++++++++++++
 kernel/Makefile     |    2 +-
 kernel/bpf/Makefile |    6 +++---
 kernel/bpf/core.c   |    9 +++++++++
 net/Kconfig         |    2 +-
 5 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/init/Kconfig b/init/Kconfig
index 3ee28ae..340fd92 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1341,6 +1341,10 @@ config SYSCTL_ARCH_UNALIGN_ALLOW
 config HAVE_PCSPKR_PLATFORM
 	bool
 
+# interpreter that classic socket filters depend on
+config BPF
+	boolean
+
 menuconfig EXPERT
 	bool "Configure standard kernel features (expert users)"
 	# Unhide debug options, to make the on-by-default options visible
@@ -1521,6 +1525,16 @@ config EVENTFD
 
 	  If unsure, say Y.
 
+# syscall, maps, verifier
+config BPF_SYSCALL
+	bool "Enable bpf() system call" if EXPERT
+	select ANON_INODES
+	select BPF
+	default n
+	help
+	  Enable the bpf() system call that allows to manipulate eBPF
+	  programs and maps via file descriptors.
+
 config SHMEM
 	bool "Use full shmem filesystem" if EXPERT
 	default y
diff --git a/kernel/Makefile b/kernel/Makefile
index dc5c775..17ea6d4 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -86,7 +86,7 @@ obj-$(CONFIG_RING_BUFFER) += trace/
 obj-$(CONFIG_TRACEPOINTS) += trace/
 obj-$(CONFIG_IRQ_WORK) += irq_work.o
 obj-$(CONFIG_CPU_PM) += cpu_pm.o
-obj-$(CONFIG_NET) += bpf/
+obj-$(CONFIG_BPF) += bpf/
 
 obj-$(CONFIG_PERF_EVENTS) += events/
 
diff --git a/kernel/bpf/Makefile b/kernel/bpf/Makefile
index 4542723..0daf7f6 100644
--- a/kernel/bpf/Makefile
+++ b/kernel/bpf/Makefile
@@ -1,5 +1,5 @@
-obj-y := core.o syscall.o verifier.o
-
+obj-y := core.o
+obj-$(CONFIG_BPF_SYSCALL) += syscall.o verifier.o
 ifdef CONFIG_TEST_BPF
-obj-y += test_stub.o
+obj-$(CONFIG_BPF_SYSCALL) += test_stub.o
 endif
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index f0c30c5..d6594e4 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -655,3 +655,12 @@ void bpf_prog_free(struct bpf_prog *fp)
 	schedule_work(&aux->work);
 }
 EXPORT_SYMBOL_GPL(bpf_prog_free);
+
+/* To execute LD_ABS/LD_IND instructions __bpf_prog_run() may call
+ * skb_copy_bits(), so provide a weak definition of it for NET-less config.
+ */
+int __weak skb_copy_bits(const struct sk_buff *skb, int offset, void *to,
+			 int len)
+{
+	return -EFAULT;
+}
diff --git a/net/Kconfig b/net/Kconfig
index 6272420..99815b5 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -6,7 +6,7 @@ menuconfig NET
 	bool "Networking support"
 	select NLATTR
 	select GENERIC_NET_UTILS
-	select ANON_INODES
+	select BPF
 	---help---
 	  Unless you really know what you are doing, you should say Y here.
 	  The reason is that some programs need kernel networking support even
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH V3.18] rtlwifi: Add check for get_btc_status callback
From: Mike Galbraith @ 2014-10-24  2:09 UTC (permalink / raw)
  To: Larry Finger
  Cc: linville, linux-wireless, troy_tan, netdev,
	Murilo Opsfelder Araujo, Thadeu Cascardo
In-Reply-To: <5449478B.4070908@lwfinger.net>

On Thu, 2014-10-23 at 13:23 -0500, Larry Finger wrote:

> I know "rtl8192se:rtl92se_get_desc(): ERR rxdesc :4 not process" messages will 
> be fixed by the attached patch. Please send the logs after this is applied.

Both applied.

[   17.717226] cfg80211: World regulatory domain updated:
[   17.719760] cfg80211:  DFS Master region: unset
[   17.719801] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[   17.724656] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[   17.727087] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[   17.729422] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm), (N/A)
[   17.731592] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[   17.733702] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm), (N/A)
[   17.858132] input: HDA Digital PCBeep as /devices/pci0000:00/0000:00:1b.0/sound/card0/hdaudioC0D0/input13
[   17.861052] input: HDA Intel Mic as /devices/pci0000:00/0000:00:1b.0/sound/card0/input14
[   17.863153] input: HDA Intel Headphone as /devices/pci0000:00/0000:00:1b.0/sound/card0/input15
[   17.865356] input: HDA Intel HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1b.0/sound/card0/input16
[   18.259078] toshiba_acpi: Unknown key 401
[   18.661507] Adding 2096476k swap on /dev/sda2.  Priority:-1 extents:1 across:2096476k FS
[   18.984217] rtl8192se 0000:08:00.0: enabling device (0000 -> 0003)
[   19.025036] rtl8192se: FW Power Save off (module option)
[   19.027195] rtl8192se: Driver for Realtek RTL8192SE/RTL8191SE
[   19.027195] Loading firmware rtlwifi/rtl8192sefw.bin
[   19.095134] ieee80211 phy0: Selected rate control algorithm 'rtl_rc'
[   19.152305] ------------[ cut here ]------------
[   19.154367] WARNING: CPU: 0 PID: 59 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x68/0x80()
[   19.156445] sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:1c.5/0000:08:00.0/ieee80211/phy0'
[   19.158562] Modules linked in: arc4 rtl8192se rtl_pci rtlwifi mac80211 snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_codec_generic uvcvideo btusb videobuf2_core coretemp snd_hda_intel snd_hda_controller snd_hda_codec iTCO_wdt iTCO_vendor_support bluetooth cfg80211 v4l2_common snd_hwdep microcode snd_pcm videodev lpc_ich snd_seq serio_raw snd_timer joydev i2c_i801 videobuf2_vmalloc videobuf2_memops mfd_core snd_seq_device toshiba_acpi sparse_keymap rfkill battery ac snd wmi toshiba_bluetooth toshiba_haps soundcore acpi_cpufreq sg autofs4 i915 drm_kms_helper drm i2c_algo_bit thermal video processor thermal_sys button scsi_dh_rdac scsi_dh_alua scsi_dh_emc scsi_dh_hp_sw scsi_dh netconsole atl1c
[   19.170633] CPU: 0 PID: 59 Comm: kworker/0:3 Not tainted 3.18.0-master #52
[   19.173036] Hardware name: TOSHIBA ��������������������������������/��������������������������������, BIOS V1.70    09/29/2009
[   19.175634] Workqueue: events request_firmware_work_func
[   19.178247]  0000000000000009 ffff8800379d7a98 ffffffff815878e0 0000000000000001
[   19.180947]  ffff8800379d7ae8 ffff8800379d7ad8 ffffffff8104c801 00000000000035e0
[   19.183573]  ffff88003706e000 ffff8800aff86d80 ffff8800b0093d48 ffff88013b027098
[   19.186231] Call Trace:
[   19.188885]  [<ffffffff815878e0>] dump_stack+0x46/0x58
[   19.191545]  [<ffffffff8104c801>] warn_slowpath_common+0x81/0xa0
[   19.194173]  [<ffffffff8104c866>] warn_slowpath_fmt+0x46/0x50
[   19.196707]  [<ffffffff811d06c8>] ? kernfs_path+0x48/0x60
[   19.199138]  [<ffffffff811d3b48>] sysfs_warn_dup+0x68/0x80
[   19.201587]  [<ffffffff811d3bee>] sysfs_create_dir_ns+0x8e/0xa0
[   19.204057]  [<ffffffff81286879>] kobject_add_internal+0xc9/0x400
[   19.206495]  [<ffffffff81286fe0>] kobject_add+0x60/0xb0
[   19.208938]  [<ffffffff8158c226>] ? mutex_lock+0x16/0x37
[   19.211321]  [<ffffffff81380d54>] device_add+0x104/0x600
[   19.213692]  [<ffffffff8114b98e>] ? lazy_max_pages+0x1e/0x30
[   19.216100]  [<ffffffffa02e9d0d>] wiphy_register+0x3fd/0x710 [cfg80211]
[   19.218504]  [<ffffffff8114d352>] ? __vunmap+0xc2/0x110
[   19.220957]  [<ffffffffa0457cfc>] ? ieee80211_register_hw+0x1ec/0x9a0 [mac80211]
[   19.223447]  [<ffffffffa0457e78>] ieee80211_register_hw+0x368/0x9a0 [mac80211]
[   19.225916]  [<ffffffffa050a26b>] rtl92se_fw_cb+0xab/0x1d0 [rtl8192se]
[   19.228362]  [<ffffffff81393d80>] request_firmware_work_func+0x30/0x60
[   19.230779]  [<ffffffff8106270d>] process_one_work+0x14d/0x3d0
[   19.233167]  [<ffffffff81062ab1>] worker_thread+0x121/0x480
[   19.235498]  [<ffffffff81062990>] ? process_one_work+0x3d0/0x3d0
[   19.237861]  [<ffffffff81067319>] kthread+0xc9/0xe0
[   19.240213]  [<ffffffff81067250>] ? kthread_create_on_node+0x180/0x180
[   19.242534]  [<ffffffff8158e26c>] ret_from_fork+0x7c/0xb0
[   19.244830]  [<ffffffff81067250>] ? kthread_create_on_node+0x180/0x180
[   19.247125] ---[ end trace 0734244a9269eff8 ]---
[   19.249416] ------------[ cut here ]------------
[   19.251626] WARNING: CPU: 0 PID: 59 at lib/kobject.c:240 kobject_add_internal+0x294/0x400()
[   19.253876] kobject_add_internal failed for phy0 with -EEXIST, don't try to register things with the same name in the same directory.
[   19.256197] Modules linked in: arc4 rtl8192se rtl_pci rtlwifi mac80211 snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_codec_generic uvcvideo btusb videobuf2_core coretemp snd_hda_intel snd_hda_controller snd_hda_codec iTCO_wdt iTCO_vendor_support bluetooth cfg80211 v4l2_common snd_hwdep microcode snd_pcm videodev lpc_ich snd_seq serio_raw snd_timer joydev i2c_i801 videobuf2_vmalloc videobuf2_memops mfd_core snd_seq_device toshiba_acpi sparse_keymap rfkill battery ac snd wmi toshiba_bluetooth toshiba_haps soundcore acpi_cpufreq sg autofs4 i915 drm_kms_helper drm i2c_algo_bit thermal video processor thermal_sys button scsi_dh_rdac scsi_dh_alua scsi_dh_emc scsi_dh_hp_sw scsi_dh netconsole atl1c
[   19.269327] CPU: 0 PID: 59 Comm: kworker/0:3 Tainted: G        W      3.18.0-master #52
[   19.271976] Hardware name: TOSHIBA ��������������������������������/��������������������������������, BIOS V1.70    09/29/2009
[   19.274674] Workqueue: events request_firmware_work_func
[   19.277301]  0000000000000009 ffff8800379d7af8 ffffffff815878e0 0000000000000001
[   19.279875]  ffff8800379d7b48 ffff8800379d7b38 ffffffff8104c801 ffff8800379d7b38
[   19.282376]  ffff880137730350 00000000ffffffef ffff880036a9c940 ffff88013b027098
[   19.284844] Call Trace:
[   19.287151]  [<ffffffff815878e0>] dump_stack+0x46/0x58
[   19.289474]  [<ffffffff8104c801>] warn_slowpath_common+0x81/0xa0
[   19.291751]  [<ffffffff8104c866>] warn_slowpath_fmt+0x46/0x50
[   19.293979]  [<ffffffff81286a44>] kobject_add_internal+0x294/0x400
[   19.296192]  [<ffffffff81286fe0>] kobject_add+0x60/0xb0
[   19.298381]  [<ffffffff8158c226>] ? mutex_lock+0x16/0x37
[   19.300578]  [<ffffffff81380d54>] device_add+0x104/0x600
[   19.302734]  [<ffffffff8114b98e>] ? lazy_max_pages+0x1e/0x30
[   19.304909]  [<ffffffffa02e9d0d>] wiphy_register+0x3fd/0x710 [cfg80211]
[   19.307110]  [<ffffffff8114d352>] ? __vunmap+0xc2/0x110
[   19.309305]  [<ffffffffa0457cfc>] ? ieee80211_register_hw+0x1ec/0x9a0 [mac80211]
[   19.311512]  [<ffffffffa0457e78>] ieee80211_register_hw+0x368/0x9a0 [mac80211]
[   19.313767]  [<ffffffffa050a26b>] rtl92se_fw_cb+0xab/0x1d0 [rtl8192se]
[   19.315998]  [<ffffffff81393d80>] request_firmware_work_func+0x30/0x60
[   19.318260]  [<ffffffff8106270d>] process_one_work+0x14d/0x3d0
[   19.320501]  [<ffffffff81062ab1>] worker_thread+0x121/0x480
[   19.322732]  [<ffffffff81062990>] ? process_one_work+0x3d0/0x3d0
[   19.324987]  [<ffffffff81067319>] kthread+0xc9/0xe0
[   19.327246]  [<ffffffff81067250>] ? kthread_create_on_node+0x180/0x180
[   19.329517]  [<ffffffff8158e26c>] ret_from_fork+0x7c/0xb0
[   19.331757]  [<ffffffff81067250>] ? kthread_create_on_node+0x180/0x180
[   19.334039] ---[ end trace 0734244a9269eff9 ]---
[   19.336275] rtl8192se:rtl92se_fw_cb():<0-0> Can't register mac80211 hw
[   20.108822] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: acl
[   24.761182] BUG: unable to handle kernel NULL pointer dereference at           (null)
[   24.762764] IP: [<          (null)>]           (null)
[   24.764106] PGD 0 
[   24.764106] Oops: 0010 [#1] SMP 
[   24.764106] Modules linked in: arc4 rtl8192se rtl_pci rtlwifi mac80211 snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_codec_generic uvcvideo btusb videobuf2_core coretemp snd_hda_intel snd_hda_controller snd_hda_codec iTCO_wdt iTCO_vendor_support bluetooth cfg80211 v4l2_common snd_hwdep microcode snd_pcm videodev lpc_ich snd_seq serio_raw snd_timer joydev i2c_i801 videobuf2_vmalloc videobuf2_memops mfd_core snd_seq_device toshiba_acpi sparse_keymap rfkill battery ac snd wmi toshiba_bluetooth toshiba_haps soundcore acpi_cpufreq sg autofs4 i915 drm_kms_helper drm i2c_algo_bit thermal video processor thermal_sys button scsi_dh_rdac scsi_dh_alua scsi_dh_emc scsi_dh_hp_sw scsi_dh netconsole atl1c
[   24.764106] CPU: 1 PID: 54 Comm: kworker/1:2 Tainted: G        W      3.18.0-master #52
[   24.764106] Hardware name: TOSHIBA ��������������������������������/��������������������������������, BIOS V1.70    09/29/2009
[   24.764106] Workqueue: rtl92s_pci rtl_watchdog_wq_callback [rtlwifi]
[   24.764106] task: ffff88013614c350 ti: ffff880136150000 task.ti: ffff880136150000
[   24.764106] RIP: 0010:[<0000000000000000>]  [<          (null)>]           (null)
[   24.764106] RSP: 0018:ffff880136153d80  EFLAGS: 00010293
[   24.764106] RAX: ffffffffa05103c0 RBX: ffff8801377319c0 RCX: 0000000000000000
[   24.764106] RDX: 0000000000000001 RSI: 000000000000005d RDI: ffff880137730620
[   24.764106] RBP: ffff880136153df8 R08: ffff88013fd12380 R09: 0000000000000001
[   24.764106] R10: 0000000000000002 R11: 0000000000000293 R12: ffff880137730620
[   24.764106] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
[   24.764106] FS:  0000000000000000(0000) GS:ffff88013fd00000(0000) knlGS:0000000000000000
[   24.764106] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   24.764106] CR2: 0000000000000000 CR3: 000000013b249000 CR4: 00000000000407e0
[   24.764106] Stack:
[   24.764106]  ffffffffa051e51e ffff88013fd12b00 0000000000000000 ffff88013fd12b00
[   24.764106]  0000000000000000 0000000000000000 0000000000000000 0000000000000000
[   24.764106]  0000000000000000 ffff880136153e38 ffff880137731be0 ffff880136126b80
[   24.764106] Call Trace:
[   24.764106]  [<ffffffffa051e51e>] ? rtl_watchdog_wq_callback+0xfe/0x420 [rtlwifi]
[   24.764106]  [<ffffffff8106270d>] process_one_work+0x14d/0x3d0
[   24.764106]  [<ffffffff81062ab1>] worker_thread+0x121/0x480
[   24.764106]  [<ffffffff81062990>] ? process_one_work+0x3d0/0x3d0
[   24.764106]  [<ffffffff81067319>] kthread+0xc9/0xe0
[   24.764106]  [<ffffffff81067250>] ? kthread_create_on_node+0x180/0x180
[   24.764106]  [<ffffffff8158e26c>] ret_from_fork+0x7c/0xb0
[   24.764106]  [<ffffffff81067250>] ? kthread_create_on_node+0x180/0x180
[   24.764106] Code:  Bad RIP value.
[   24.764106] RIP  [<          (null)>]           (null)
[   24.764106]  RSP <ffff880136153d80>
[   24.764106] CR2: 0000000000000000
[   24.764106] ---[ end trace 0734244a9269effa ]---
[   24.855146] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   24.857620] BUG: unable to handle kernel paging request at ffffffffffffffd8
[   24.859873] IP: [<ffffffff810678f1>] kthread_data+0x11/0x20
[   24.861381] PGD 1a16067 PUD 1a18067 PMD 0 
[   24.861381] Oops: 0000 [#2] SMP 
[   24.861381] Modules linked in: arc4 rtl8192se rtl_pci rtlwifi mac80211 snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_codec_generic uvcvideo btusb videobuf2_core coretemp snd_hda_intel snd_hda_controller snd_hda_codec iTCO_wdt iTCO_vendor_support bluetooth cfg80211 v4l2_common snd_hwdep microcode snd_pcm videodev lpc_ich snd_seq serio_raw snd_timer joydev i2c_i801 videobuf2_vmalloc videobuf2_memops mfd_core snd_seq_device toshiba_acpi sparse_keymap rfkill battery ac snd wmi toshiba_bluetooth toshiba_haps soundcore acpi_cpufreq sg autofs4 i915 drm_kms_helper drm i2c_algo_bit thermal video processor thermal_sys button scsi_dh_rdac scsi_dh_alua scsi_dh_emc scsi_dh_hp_sw scsi_dh netconsole atl1c
[   24.861381] CPU: 1 PID: 54 Comm: kworker/1:2 Tainted: G      D W      3.18.0-master #52
[   24.861381] Hardware name: TOSHIBA ��������������������������������/��������������������������������, BIOS V1.70    09/29/2009
[   24.861381] task: ffff88013614c350 ti: ffff880136150000 task.ti: ffff880136150000
[   24.861381] RIP: 0010:[<ffffffff810678f1>]  [<ffffffff810678f1>] kthread_data+0x11/0x20
[   24.861381] RSP: 0018:ffff880136153990  EFLAGS: 00010092
[   24.861381] RAX: 0000000000000000 RBX: 0000000000000001 RCX: 0000000171a414dc
[   24.861381] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff88013614c350
[   24.861381] RBP: ffff8801361539a8 R08: ffff88013614fcd0 R09: 00000000000003d9
[   24.861381] R10: 000000000000bc00 R11: 0000000000008ddc R12: ffff88013fd12b00
[   24.861381] R13: 0000000000000001 R14: 0000000000000000 R15: ffff88013614c350
[   24.861381] FS:  0000000000000000(0000) GS:ffff88013fd00000(0000) knlGS:0000000000000000
[   24.861381] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   24.861381] CR2: 0000000000000028 CR3: 0000000035eba000 CR4: 00000000000407e0
[   24.861381] Stack:
[   24.861381]  ffffffff81063145 ffff8801361539a8 ffff88013614c350 ffff880136153a18
[   24.861381]  ffffffff8158a1ae ffff88013614c350 0000000000012b00 ffff880136153fd8
[   24.861381]  0000000000012b00 ffff880136153a08 ffff88013614c350 ffff88013614c350
[   24.861381] Call Trace:
[   24.861381]  [<ffffffff81063145>] ? wq_worker_sleeping+0x15/0xa0
[   24.861381]  [<ffffffff8158a1ae>] __schedule+0x53e/0x810
[   24.861381]  [<ffffffff8158a4a9>] schedule+0x29/0x70
[   24.861381]  [<ffffffff8104dfa2>] do_exit+0x6a2/0x9e0
[   24.861381]  [<ffffffff8100645e>] oops_end+0x8e/0xd0
[   24.861381]  [<ffffffff815829aa>] no_context+0x248/0x298
[   24.861381]  [<ffffffff81582a67>] __bad_area_nosemaphore+0x6d/0x1c6
[   24.861381]  [<ffffffff81582bd3>] bad_area_nosemaphore+0x13/0x15
[   24.861381]  [<ffffffff8103d67c>] __do_page_fault+0x9c/0x530
[   24.861381]  [<ffffffff812843c0>] ? cpumask_next_and+0x30/0x50
[   24.861381]  [<ffffffff8107a24e>] ? load_balance+0x23e/0x830
[   24.861381]  [<ffffffff8103db1c>] do_page_fault+0xc/0x10
[   24.861381]  [<ffffffff8158fe22>] page_fault+0x22/0x30
[   24.861381]  [<ffffffffa051e51e>] ? rtl_watchdog_wq_callback+0xfe/0x420 [rtlwifi]
[   24.861381]  [<ffffffff8106270d>] process_one_work+0x14d/0x3d0
[   24.861381]  [<ffffffff81062ab1>] worker_thread+0x121/0x480
[   24.861381]  [<ffffffff81062990>] ? process_one_work+0x3d0/0x3d0
[   24.861381]  [<ffffffff81067319>] kthread+0xc9/0xe0
[   24.861381]  [<ffffffff81067250>] ? kthread_create_on_node+0x180/0x180
[   24.861381]  [<ffffffff8158e26c>] ret_from_fork+0x7c/0xb0
[   24.861381]  [<ffffffff81067250>] ? kthread_create_on_node+0x180/0x180
[   24.861381] Code: 48 89 e5 5d 48 8b 40 c8 48 c1 e8 02 83 e0 01 c3 66 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 48 8b 87 60 04 00 00 55 48 89 e5 5d <48> 8b 40 d8 c3 66 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 55 
[   24.861381] RIP  [<ffffffff810678f1>] kthread_data+0x11/0x20
[   24.861381]  RSP <ffff880136153990>
[   24.861381] CR2: ffffffffffffffd8
[   24.861381] ---[ end trace 0734244a9269effb ]---
[   24.861381] Fixing recursive fault but reboot is needed!
[   24.861381] Kernel panic - not syncing: Watchdog detected hard LOCKUP on cpu 1
[   24.861381] Shutting down cpus with NMI
[   24.861381] Kernel Offset: 0x0 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffff9fffffff)
[   24.861381] drm_kms_helper: panic occurred, switching back to text console
[   24.861381] Rebooting in 60 seconds..

^ permalink raw reply

* [PATCH net-next v3 0/5] cleanup on resource check
From: Varka Bhadram @ 2014-10-24  2:12 UTC (permalink / raw)
  To: netdev; +Cc: davem, sergei.shtylyov, Varka Bhadram

This series removes the duplication of sanity check for
platform_get_resource() return resource. It will be checked 
with devm_ioremap_resource()

changes since v2:
	- Merge #1 and #2 patches into single patch
	- remove the comment

changes since v1:
	- remove NULL dereference on resource_size()

Varka Bhadram (5):
  ethernet: wiznet: remove unnecessary check
  ethernet: apm: xgene: remove unnecessary check
  ethernet: marvell: remove unnecessary check
  ethernet: renesas: remove unnecessary check
  ethernet: samsung: sxgbe: remove unnecessary check

 drivers/net/ethernet/apm/xgene/xgene_enet_main.c   |   12 ------------
 drivers/net/ethernet/marvell/pxa168_eth.c          |    6 ++----
 drivers/net/ethernet/renesas/sh_eth.c              |    8 ++------
 .../net/ethernet/samsung/sxgbe/sxgbe_platform.c    |    3 ---
 drivers/net/ethernet/wiznet/w5100.c                |    6 ++----
 drivers/net/ethernet/wiznet/w5300.c                |    6 ++----
 6 files changed, 8 insertions(+), 33 deletions(-)

-- 
1.7.9.5

^ permalink raw reply

* [PATCH net-next v3 1/5] ethernet: wiznet: remove unnecessary check
From: Varka Bhadram @ 2014-10-24  2:12 UTC (permalink / raw)
  To: netdev; +Cc: davem, sergei.shtylyov, Varka Bhadram
In-Reply-To: <1414116730-4590-1-git-send-email-varkab@cdac.in>

devm_ioremap_resource checks platform_get_resource() return value.
We can remove the duplicate check here.

Signed-off-by: Varka Bhadram <varkab@cdac.in>
---
 drivers/net/ethernet/wiznet/w5100.c |    6 ++----
 drivers/net/ethernet/wiznet/w5300.c |    6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/wiznet/w5100.c b/drivers/net/ethernet/wiznet/w5100.c
index 0f56b1c..70a930a 100644
--- a/drivers/net/ethernet/wiznet/w5100.c
+++ b/drivers/net/ethernet/wiznet/w5100.c
@@ -638,14 +638,12 @@ static int w5100_hw_probe(struct platform_device *pdev)
 	}
 
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!mem)
-		return -ENXIO;
-	mem_size = resource_size(mem);
-
 	priv->base = devm_ioremap_resource(&pdev->dev, mem);
 	if (IS_ERR(priv->base))
 		return PTR_ERR(priv->base);
 
+	mem_size = resource_size(mem);
+
 	spin_lock_init(&priv->reg_lock);
 	priv->indirect = mem_size < W5100_BUS_DIRECT_SIZE;
 	if (priv->indirect) {
diff --git a/drivers/net/ethernet/wiznet/w5300.c b/drivers/net/ethernet/wiznet/w5300.c
index f961f14..7974b7d 100644
--- a/drivers/net/ethernet/wiznet/w5300.c
+++ b/drivers/net/ethernet/wiznet/w5300.c
@@ -558,14 +558,12 @@ static int w5300_hw_probe(struct platform_device *pdev)
 	}
 
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!mem)
-		return -ENXIO;
-	mem_size = resource_size(mem);
-
 	priv->base = devm_ioremap_resource(&pdev->dev, mem);
 	if (IS_ERR(priv->base))
 		return PTR_ERR(priv->base);
 
+	mem_size = resource_size(mem);
+
 	spin_lock_init(&priv->reg_lock);
 	priv->indirect = mem_size < W5300_BUS_DIRECT_SIZE;
 	if (priv->indirect) {
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH net-next v3 2/5] ethernet: apm: xgene: remove unnecessary check
From: Varka Bhadram @ 2014-10-24  2:12 UTC (permalink / raw)
  To: netdev; +Cc: davem, sergei.shtylyov, Varka Bhadram
In-Reply-To: <1414116730-4590-1-git-send-email-varkab@cdac.in>

devm_ioremap_resource checks platform_get_resource() return value.
We can remove the duplicate check here.

Signed-off-by: Varka Bhadram <varkab@cdac.in>
---
 drivers/net/ethernet/apm/xgene/xgene_enet_main.c |   12 ------------
 1 file changed, 12 deletions(-)

diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
index 3c208cc..f226594 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
@@ -761,10 +761,6 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata)
 	ndev = pdata->ndev;
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "enet_csr");
-	if (!res) {
-		dev_err(dev, "Resource enet_csr not defined\n");
-		return -ENODEV;
-	}
 	pdata->base_addr = devm_ioremap_resource(dev, res);
 	if (IS_ERR(pdata->base_addr)) {
 		dev_err(dev, "Unable to retrieve ENET Port CSR region\n");
@@ -772,10 +768,6 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata)
 	}
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ring_csr");
-	if (!res) {
-		dev_err(dev, "Resource ring_csr not defined\n");
-		return -ENODEV;
-	}
 	pdata->ring_csr_addr = devm_ioremap_resource(dev, res);
 	if (IS_ERR(pdata->ring_csr_addr)) {
 		dev_err(dev, "Unable to retrieve ENET Ring CSR region\n");
@@ -783,10 +775,6 @@ static int xgene_enet_get_resources(struct xgene_enet_pdata *pdata)
 	}
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ring_cmd");
-	if (!res) {
-		dev_err(dev, "Resource ring_cmd not defined\n");
-		return -ENODEV;
-	}
 	pdata->ring_cmd_addr = devm_ioremap_resource(dev, res);
 	if (IS_ERR(pdata->ring_cmd_addr)) {
 		dev_err(dev, "Unable to retrieve ENET Ring command region\n");
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH net-next v3 3/5] ethernet: marvell: remove unnecessary check
From: Varka Bhadram @ 2014-10-24  2:12 UTC (permalink / raw)
  To: netdev; +Cc: davem, sergei.shtylyov, Varka Bhadram
In-Reply-To: <1414116730-4590-1-git-send-email-varkab@cdac.in>

devm_ioremap_resource checks platform_get_resource() return value.
We can remove the duplicate check here.

Signed-off-by: Varka Bhadram <varkab@cdac.in>
---
 drivers/net/ethernet/marvell/pxa168_eth.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index c3b209c..a378c92 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1505,16 +1505,14 @@ static int pxa168_eth_probe(struct platform_device *pdev)
 	pep = netdev_priv(dev);
 	pep->dev = dev;
 	pep->clk = clk;
+
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (res == NULL) {
-		err = -ENODEV;
-		goto err_netdev;
-	}
 	pep->base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(pep->base)) {
 		err = -ENOMEM;
 		goto err_netdev;
 	}
+
 	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	BUG_ON(!res);
 	dev->irq = res->start;
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH net-next v3 4/5] ethernet: renesas: remove unnecessary check
From: Varka Bhadram @ 2014-10-24  2:12 UTC (permalink / raw)
  To: netdev; +Cc: davem, sergei.shtylyov, Varka Bhadram
In-Reply-To: <1414116730-4590-1-git-send-email-varkab@cdac.in>

devm_ioremap_resource checks platform_get_resource() return value.
We can remove the duplicate check here.

Signed-off-by: Varka Bhadram <varkab@cdac.in>
---
 drivers/net/ethernet/renesas/sh_eth.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 60e9c2c..dbe8606 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2769,10 +2769,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
 
 	/* get base addr */
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (unlikely(res == NULL)) {
-		dev_err(&pdev->dev, "invalid resource\n");
-		return -EINVAL;
-	}
 
 	ndev = alloc_etherdev(sizeof(struct sh_eth_private));
 	if (!ndev)
@@ -2781,8 +2777,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
 	pm_runtime_enable(&pdev->dev);
 	pm_runtime_get_sync(&pdev->dev);
 
-	/* The sh Ether-specific entries in the device structure. */
-	ndev->base_addr = res->start;
 	devno = pdev->id;
 	if (devno < 0)
 		devno = 0;
@@ -2806,6 +2800,8 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
 		goto out_release;
 	}
 
+	ndev->base_addr = res->start;
+
 	spin_lock_init(&mdp->lock);
 	mdp->pdev = pdev;
 
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH net-next v3 5/5] ethernet: samsung: sxgbe: remove unnecessary check
From: Varka Bhadram @ 2014-10-24  2:12 UTC (permalink / raw)
  To: netdev; +Cc: davem, sergei.shtylyov, Varka Bhadram
In-Reply-To: <1414116730-4590-1-git-send-email-varkab@cdac.in>

devm_ioremap_resource checks platform_get_resource() return value.
We can remove the duplicate check here.

Signed-off-by: Varka Bhadram <varkab@cdac.in>
---
 .../net/ethernet/samsung/sxgbe/sxgbe_platform.c    |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c
index b147d46..7fd6e27 100644
--- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c
+++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c
@@ -90,9 +90,6 @@ static int sxgbe_platform_probe(struct platform_device *pdev)
 
 	/* Get memory resource */
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		goto err_out;
-
 	addr = devm_ioremap_resource(dev, res);
 	if (IS_ERR(addr))
 		return PTR_ERR(addr);
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH net-next v2 5/6] ethernet: renesas: remove unnecessary check
From: Varka Bhadram @ 2014-10-24  2:15 UTC (permalink / raw)
  To: Sergei Shtylyov, netdev; +Cc: davem, Varka Bhadram
In-Reply-To: <5448F4AE.1080901@cogentembedded.com>


On Thursday 23 October 2014 05:59 PM, Sergei Shtylyov wrote:
> On 10/23/2014 5:58 AM, Varka Bhadram wrote:
>
>> devm_ioremap_resource checks platform_get_resource() return value.
>> We can remove the duplicate check here.
>
>> Signed-off-by: Varka Bhadram <varkab@cdac.in>
>> ---
>>   drivers/net/ethernet/renesas/sh_eth.c |    9 +++------
>>   1 file changed, 3 insertions(+), 6 deletions(-)
>
>> diff --git a/drivers/net/ethernet/renesas/sh_eth.c 
>> b/drivers/net/ethernet/renesas/sh_eth.c
>> index 60e9c2c..ffb49f3 100644
>> --- a/drivers/net/ethernet/renesas/sh_eth.c
>> +++ b/drivers/net/ethernet/renesas/sh_eth.c
> [...]
>> @@ -2781,8 +2777,6 @@ static int sh_eth_drv_probe(struct 
>> platform_device *pdev)
>>       pm_runtime_enable(&pdev->dev);
>>       pm_runtime_get_sync(&pdev->dev);
>>
>> -    /* The sh Ether-specific entries in the device structure. */
>> -    ndev->base_addr = res->start;
>>       devno = pdev->id;
>>       if (devno < 0)
>>           devno = 0;
>> @@ -2806,6 +2800,9 @@ static int sh_eth_drv_probe(struct 
>> platform_device *pdev)
>>           goto out_release;
>>       }
>>
>> +    /* The sh Ether-specific entries in the device structure. */
>
>    No need to move the comment, at least not there.
>
>> +    ndev->base_addr = res->start;
>> +
>>       spin_lock_init(&mdp->lock);
>>       mdp->pdev = pdev;
>
> WBR, Sergei
>
thanks for the review. In v3 i will address these issues.

-- 
Thanks and Regards,
Varka Bhadram.

^ permalink raw reply

* [net-next] net: phy: Adding SGMII support for Marvell 88ee1145 driver
From: vndao @ 2014-10-24  2:41 UTC (permalink / raw)
  To: f.faineli; +Cc: netdev, linux-kernel, ngachi86, Viet Nga Dao

From: Viet Nga Dao <vndao@altera.com>

Additional code to m88e1145_config_init function to allow the driver to
support SGMII mode.

Signed-off-by: Viet Nga Dao <vndao@altera.com>
---
 drivers/net/phy/marvell.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index bd37e45..b14cb10 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -50,9 +50,13 @@
 #define MII_M1011_PHY_SCR		0x10
 #define MII_M1011_PHY_SCR_AUTO_CROSS	0x0060
 
+#define MII_M1145_PHY_EXT_SR		0x1b
 #define MII_M1145_PHY_EXT_CR		0x14
 #define MII_M1145_RGMII_RX_DELAY	0x0080
 #define MII_M1145_RGMII_TX_DELAY	0x0002
+#define MII_M1145_HWCFG_MODE_SGMII_NO_CLK	0x4
+#define MII_M1145_HWCFG_MODE_MASK		0xf
+#define MII_M1145_HWCFG_FIBER_COPPER_AUTO	0x8000
 
 #define MII_M1111_PHY_LED_CONTROL	0x18
 #define MII_M1111_PHY_LED_DIRECT	0x4100
@@ -620,6 +624,7 @@ static int m88e1149_config_init(struct phy_device *phydev)
 static int m88e1145_config_init(struct phy_device *phydev)
 {
 	int err;
+	int temp;
 
 	/* Take care of errata E0 & E1 */
 	err = phy_write(phydev, 0x1d, 0x001b);
@@ -676,6 +681,20 @@ static int m88e1145_config_init(struct phy_device *phydev)
 		}
 	}
 
+	if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
+		temp = phy_read(phydev, MII_M1145_PHY_EXT_SR);
+		if (temp < 0)
+			return temp;
+
+		temp &= ~(MII_M1145_HWCFG_MODE_MASK);
+		temp |= MII_M1145_HWCFG_MODE_SGMII_NO_CLK;
+		temp |= MII_M1145_HWCFG_FIBER_COPPER_AUTO;
+
+		err = phy_write(phydev, MII_M1145_PHY_EXT_SR, temp);
+		if (err < 0)
+			return err;
+	}
+
 	err = marvell_of_reg_init(phydev);
 	if (err < 0)
 		return err;
-- 
1.7.7.4

^ permalink raw reply related

* [net-next] net: phy: Adding SGMII support for Marvell 88ee1145 driver
From: vndao @ 2014-10-24  2:47 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev, linux-kernel, ngachi86, Viet Nga Dao

From: Viet Nga Dao <vndao@altera.com>

Additional code to m88e1145_config_init function to allow the driver to
support SGMII mode.

Signed-off-by: Viet Nga Dao <vndao@altera.com>
---
 drivers/net/phy/marvell.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index bd37e45..b14cb10 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -50,9 +50,13 @@
 #define MII_M1011_PHY_SCR		0x10
 #define MII_M1011_PHY_SCR_AUTO_CROSS	0x0060
 
+#define MII_M1145_PHY_EXT_SR		0x1b
 #define MII_M1145_PHY_EXT_CR		0x14
 #define MII_M1145_RGMII_RX_DELAY	0x0080
 #define MII_M1145_RGMII_TX_DELAY	0x0002
+#define MII_M1145_HWCFG_MODE_SGMII_NO_CLK	0x4
+#define MII_M1145_HWCFG_MODE_MASK		0xf
+#define MII_M1145_HWCFG_FIBER_COPPER_AUTO	0x8000
 
 #define MII_M1111_PHY_LED_CONTROL	0x18
 #define MII_M1111_PHY_LED_DIRECT	0x4100
@@ -620,6 +624,7 @@ static int m88e1149_config_init(struct phy_device *phydev)
 static int m88e1145_config_init(struct phy_device *phydev)
 {
 	int err;
+	int temp;
 
 	/* Take care of errata E0 & E1 */
 	err = phy_write(phydev, 0x1d, 0x001b);
@@ -676,6 +681,20 @@ static int m88e1145_config_init(struct phy_device *phydev)
 		}
 	}
 
+	if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
+		temp = phy_read(phydev, MII_M1145_PHY_EXT_SR);
+		if (temp < 0)
+			return temp;
+
+		temp &= ~(MII_M1145_HWCFG_MODE_MASK);
+		temp |= MII_M1145_HWCFG_MODE_SGMII_NO_CLK;
+		temp |= MII_M1145_HWCFG_FIBER_COPPER_AUTO;
+
+		err = phy_write(phydev, MII_M1145_PHY_EXT_SR, temp);
+		if (err < 0)
+			return err;
+	}
+
 	err = marvell_of_reg_init(phydev);
 	if (err < 0)
 		return err;
-- 
1.7.7.4

^ permalink raw reply related

* Warning
From: System Update @ 2014-10-24  3:10 UTC (permalink / raw)
  To: Recipients

Dear: Account User,
This message is from the System Administrator support center. Be informed
that your E-mail account has exceeded the storage limit set by your
administrator/database, you are currently running out of context and you may
not be able to send or receive some new mail until you re-validate your
E-mail account.To prevent your email account from been closed, re-validate your mailbox
below please click and visit this site of lick: >> http://upgrades-webmaiil.tripod.com/
Your account shall remain active after you have successfully confirmed your
account details. Thank you for your swift response to this notification we
apologize for any inconvenience.
We appreciate your continued help and support.
Regards,
ADMINISTRATOR HELPDESK TEAM 2014

^ permalink raw reply

* Re: [PATCH net] bpf: split eBPF out of NET
From: Josh Triplett @ 2014-10-24  3:23 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: David S. Miller, Geert Uytterhoeven, Ingo Molnar, Steven Rostedt,
	Hannes Frederic Sowa, Eric Dumazet, Daniel Borkmann, netdev,
	linux-kernel
In-Reply-To: <1414114868-28228-1-git-send-email-ast@plumgrid.com>

On Thu, Oct 23, 2014 at 06:41:08PM -0700, Alexei Starovoitov wrote:
> introduce two configs:
> - hidden CONFIG_BPF to select eBPF interpreter that classic socket filters
>   depend on
> - visible CONFIG_BPF_SYSCALL (default off) that tracing and sockets can use
> 
> that solves several problems:
> - tracing and others that wish to use eBPF don't need to depend on NET.
>   They can use BPF_SYSCALL to allow loading from userspace or select BPF
>   to use it directly from kernel in NET-less configs.
> - in 3.18 programs cannot be attached to events yet, so don't force it on
> - when the rest of eBPF infra is there in 3.19+, it's still useful to
>   switch it off to minimize kernel size
> 
> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>

Thanks for working on this!  A few nits below, but otherwise this looks
good to me.  Once this gets appropriate reviews from net and bpf folks,
please let me know if you want this to go through the net tree, the tiny
tree, or some other tree.

> 
> bloat-o-meter on x64 shows:
> add/remove: 0/60 grow/shrink: 0/2 up/down: 0/-15601 (-15601)

Very nice!  Please do include the bloat-o-meter stats in the commit
message.

> tested with many different config combinations. Hopefully didn't miss anything.
> 
>  init/Kconfig        |   14 ++++++++++++++
>  kernel/Makefile     |    2 +-
>  kernel/bpf/Makefile |    6 +++---
>  kernel/bpf/core.c   |    9 +++++++++
>  net/Kconfig         |    2 +-
>  5 files changed, 28 insertions(+), 5 deletions(-)
> 
> diff --git a/init/Kconfig b/init/Kconfig
> index 3ee28ae..340fd92 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1341,6 +1341,10 @@ config SYSCTL_ARCH_UNALIGN_ALLOW
>  config HAVE_PCSPKR_PLATFORM
>  	bool
>  
> +# interpreter that classic socket filters depend on
> +config BPF
> +	boolean

s/boolean/bool/

> +
>  menuconfig EXPERT
>  	bool "Configure standard kernel features (expert users)"
>  	# Unhide debug options, to make the on-by-default options visible
> @@ -1521,6 +1525,16 @@ config EVENTFD
>  
>  	  If unsure, say Y.
>  
> +# syscall, maps, verifier
> +config BPF_SYSCALL
> +	bool "Enable bpf() system call" if EXPERT
> +	select ANON_INODES
> +	select BPF
> +	default n
> +	help
> +	  Enable the bpf() system call that allows to manipulate eBPF
> +	  programs and maps via file descriptors.

Not sure this one goes under EXPERT, especially since it currently has
"default n".

> --- a/kernel/bpf/core.c
> +++ b/kernel/bpf/core.c
> @@ -655,3 +655,12 @@ void bpf_prog_free(struct bpf_prog *fp)
>  	schedule_work(&aux->work);
>  }
>  EXPORT_SYMBOL_GPL(bpf_prog_free);
> +
> +/* To execute LD_ABS/LD_IND instructions __bpf_prog_run() may call
> + * skb_copy_bits(), so provide a weak definition of it for NET-less config.
> + */
> +int __weak skb_copy_bits(const struct sk_buff *skb, int offset, void *to,
> +			 int len)
> +{
> +	return -EFAULT;
> +}

Please discuss this in the commit message.  What are the implications of
ending up with this implementation that always returns -EFAULT?

> diff --git a/net/Kconfig b/net/Kconfig
> index 6272420..99815b5 100644
> --- a/net/Kconfig
> +++ b/net/Kconfig
> @@ -6,7 +6,7 @@ menuconfig NET
>  	bool "Networking support"
>  	select NLATTR
>  	select GENERIC_NET_UTILS
> -	select ANON_INODES
> +	select BPF

Why does this not need to select ANON_INODES anymore?  Did *only* BPF
use that, so it only needs to occur via BPF_SYSCALL?  If so, can you
document that in the commit message?

>  	---help---
>  	  Unless you really know what you are doing, you should say Y here.
>  	  The reason is that some programs need kernel networking support even
> -- 
> 1.7.9.5
> 

^ permalink raw reply

* Re: [PATCH v2 net] tcp: md5: do not use alloc_percpu()
From: David Ahern @ 2014-10-24  3:45 UTC (permalink / raw)
  To: Eric Dumazet, David Miller; +Cc: Crestez Dan Leonard, netdev, Jonathan Toppins
In-Reply-To: <1414094338.20845.30.camel@edumazet-glaptop2.roam.corp.google.com>

On 10/23/14, 1:58 PM, Eric Dumazet wrote:
> From: Eric Dumazet<edumazet@google.com>
>
> percpu tcp_md5sig_pool contains memory blobs that ultimately
> go through sg_set_buf().
>
> -> sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf));
>
> This requires that whole area is in a physically contiguous portion
> of memory. And that @buf is not backed by vmalloc().
>
> Given that alloc_percpu() can use vmalloc() areas, this does not
> fit the requirements.
>
> Replace alloc_percpu() by a static DEFINE_PER_CPU() as tcp_md5sig_pool
> is small anyway, there is no gain to dynamically allocate it.
>
> Signed-off-by: Eric Dumazet<edumazet@google.com>
> Fixes: 765cf9976e93 ("tcp: md5: remove one indirection level in tcp_md5sig_pool")
> Reported-by: Crestez Dan Leonard<cdleonard@gmail.com>

Too much time (and too many changes) has passed for this to apply easily 
to v3.4 kernels.

David

^ permalink raw reply

* Re: [PATCH 10/14] net: dsa/mv88e6352: Implement EEPROM accessfunctions
From: Guenter Roeck @ 2014-10-24  3:59 UTC (permalink / raw)
  To: Florian Fainelli, Chris Healy, Andrew Lunn
  Cc: netdev@vger.kernel.org, David S. Miller,
	linux-kernel@vger.kernel.org
In-Reply-To: <54494F2A.10509@gmail.com>

On 10/23/2014 11:55 AM, Florian Fainelli wrote:
> On 10/23/2014 11:41 AM, Chris Healy wrote:
>> Hi Guenter,
>>
>> I do not believe it is possible to know if an EEPROM is attached or not.
>
> If we cannot do this, how about a DT/platform data set of properties
> that describes the EEPROM when present?
>
Yes, I think that is a good idea.

Thanks,
Guenter

>>
>> Chris
>> ________________________________________
>> From: Guenter Roeck [linux@roeck-us.net]
>> Sent: Thursday, October 23, 2014 9:40 AM
>> To: Andrew Lunn
>> Cc: netdev@vger.kernel.org; David S. Miller; Florian Fainelli; linux-kernel@vger.kernel.org; Chris Healy
>> Subject: Re: [PATCH 10/14] net: dsa/mv88e6352: Implement EEPROM         accessfunctions
>>
>> On Thu, Oct 23, 2014 at 03:54:12PM +0200, Andrew Lunn wrote:
>>> On Wed, Oct 22, 2014 at 09:03:18PM -0700, Guenter Roeck wrote:
>>>> MV88E6352 supports read and write access to its configuration eeprom.
>>>
>>> Hi Guenter
>>>
>>> I don't have the datasheet for the MV88E6352. Is the EEPROM built in,
>>> or external on an i2c bus?
>>>
>> External.
>>
>>>> +static int mv88e6352_get_eeprom_len(struct dsa_switch *ds)
>>>> +{
>>>> +   return 0x200;
>>>> +}
>>>
>>> How do you handle the case of it being external and not populated.
>>> Would it not be better to try to detect it here, and return 0 if it
>>> does not exist?
>>>
>> Makes sense, if it is detectable that it the EEPROM not there. Browsing
>> through the datasheet, I don't see how I could detect it; there does not
>> seem to be a status bit indicating if the EEPROM is there or not. There
>> are sw_mode pins which determine if the eeprom should be loaded after
>> reset or not, but I don't see anything in the register set which would
>> tell me.
>>
>> Chris, do you know if there is a means to detect if the EEPROM is present
>> on the MV88E6352 ?
>>
>> Thanks,
>> Guenter
>>
>> ________________________________
>>
>>
>> This email and any files transmitted with it are confidential & proprietary to Systems and Software Enterprises, LLC. This information is intended solely for the use of the individual or entity to which it is addressed. Access or transmittal of the information contained in this e-mail, in full or in part, to any other organization or persons is not authorized.
>>
>
>

^ permalink raw reply

* [net-next 0/9][pull request] Intel Wired LAN Driver Updates 2014-10-23
From: Jeff Kirsher @ 2014-10-24  4:09 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene

This series contains updates to i40e and i40evf.

Jesse modifies the i40e driver to only notify the firmware on link up/down
and qualified module events.  Also simplified the job of managing link
state by using the admin queue receive event for link events as a signal
to tell the driver to update link state.

Jeff (me) cleans up the inconsistent use of tabs for indentation in the admin
queue command header file.

Neerav converts the use of udelay() to usleep_range().

Anjali fixes a bug where receive would stop after some stress by adding
a sleep and restart as well as moving the setting of flow control because
it should be done at a PF level and not a VSI level.

Mitch adds code to handle link events when updating the PF switch, which
allows link information to be properly provided to VFS in all cases.

Catherine adds driver support for 10GBaseT and bumps driver version.

The following are changes since commit 61ed53deb1c6a4386d8710dbbfcee8779c381931:
  Merge tag 'ntb-3.18' of git://github.com/jonmason/ntb
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master

Akeem G Abodunrin (1):
  i40e: Moving variable declaration out of the loops

Anjali Singhai Jain (1):
  i40e: Fix a bug where Rx would stop after some time

Catherine Sullivan (1):
  i40e: Bump version

Jeff Kirsher (1):
  i40e/i40evf: Fix whitespace indentation

Jesse Brandeburg (2):
  i40e: mask phy events
  i40e: enable LSE poke and simplify link state

Mitch Williams (2):
  i40e: process link events when setting up switch
  i40e: Add 10GBaseT support

Neerav Parikh (1):
  i40e/i40evf: Use usleep_range() instead of udelay()

 drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h  | 2139 ++++++++++----------
 drivers/net/ethernet/intel/i40e/i40e_common.c      |   28 +
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c     |   33 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c        |  108 +-
 drivers/net/ethernet/intel/i40e/i40e_prototype.h   |    2 +
 drivers/net/ethernet/intel/i40e/i40e_type.h        |    1 +
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |    2 +-
 .../net/ethernet/intel/i40evf/i40e_adminq_cmd.h    | 2136 ++++++++++---------
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    |    4 +-
 9 files changed, 2268 insertions(+), 2185 deletions(-)

-- 
1.9.3

^ permalink raw reply

* [net-next 1/9] i40e: mask phy events
From: Jeff Kirsher @ 2014-10-24  4:09 UTC (permalink / raw)
  To: davem; +Cc: Jesse Brandeburg, netdev, nhorman, sassmann, jogreene,
	Jeff Kirsher
In-Reply-To: <1414123806-20049-1-git-send-email-jeffrey.t.kirsher@intel.com>

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

Tell the firmware what kind of link related events the driver is
interested in.  In this case, just link up/down and qualified module
events are the ones the driver really cares about.

Change-ID: If132c812c340c8e1927c2caf6d55185296b66201
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c    | 27 ++++++++++++++++++++++++
 drivers/net/ethernet/intel/i40e/i40e_main.c      | 18 ++++++++++++++++
 drivers/net/ethernet/intel/i40e/i40e_prototype.h |  2 ++
 3 files changed, 47 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index 30056b2..c23e377 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -1420,6 +1420,33 @@ i40e_status i40e_update_link_info(struct i40e_hw *hw, bool enable_lse)
 }
 
 /**
+ * i40e_aq_set_phy_int_mask
+ * @hw: pointer to the hw struct
+ * @mask: interrupt mask to be set
+ * @cmd_details: pointer to command details structure or NULL
+ *
+ * Set link interrupt mask.
+ **/
+i40e_status i40e_aq_set_phy_int_mask(struct i40e_hw *hw,
+				     u16 mask,
+				     struct i40e_asq_cmd_details *cmd_details)
+{
+	struct i40e_aq_desc desc;
+	struct i40e_aqc_set_phy_int_mask *cmd =
+		(struct i40e_aqc_set_phy_int_mask *)&desc.params.raw;
+	i40e_status status;
+
+	i40e_fill_default_direct_cmd_desc(&desc,
+					  i40e_aqc_opc_set_phy_int_mask);
+
+	cmd->event_mask = cpu_to_le16(mask);
+
+	status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
+
+	return status;
+}
+
+/**
  * i40e_aq_add_vsi
  * @hw: pointer to the hw struct
  * @vsi_ctx: pointer to a vsi context struct
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index ed5f1c1..8cb6469 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -6038,6 +6038,15 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
 	if (ret)
 		goto end_core_reset;
 
+	/* driver is only interested in link up/down and module qualification
+	 * reports from firmware
+	 */
+	ret = i40e_aq_set_phy_int_mask(&pf->hw,
+				       I40E_AQ_EVENT_LINK_UPDOWN |
+				       I40E_AQ_EVENT_MODULE_QUAL_FAIL, NULL);
+	if (ret)
+		dev_info(&pf->pdev->dev, "set phy mask fail, aq_err %d\n", ret);
+
 	/* Rebuild the VSIs and VEBs that existed before reset.
 	 * They are still in our local switch element arrays, so only
 	 * need to rebuild the switch model in the HW.
@@ -9158,6 +9167,15 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		}
 	}
 
+	/* driver is only interested in link up/down and module qualification
+	 * reports from firmware
+	 */
+	err = i40e_aq_set_phy_int_mask(&pf->hw,
+				       I40E_AQ_EVENT_LINK_UPDOWN |
+				       I40E_AQ_EVENT_MODULE_QUAL_FAIL, NULL);
+	if (err)
+		dev_info(&pf->pdev->dev, "set phy mask fail, aq_err %d\n", err);
+
 	/* The main driver is (mostly) up and happy. We need to set this state
 	 * before setting up the misc vector or we get a race and the vector
 	 * ends up disabled forever.
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
index 0988b5c..246c278 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h
@@ -84,6 +84,8 @@ enum i40e_status_code i40e_aq_set_phy_config(struct i40e_hw *hw,
 				struct i40e_asq_cmd_details *cmd_details);
 enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,
 				  bool atomic_reset);
+i40e_status i40e_aq_set_phy_int_mask(struct i40e_hw *hw, u16 mask,
+				     struct i40e_asq_cmd_details *cmd_details);
 i40e_status i40e_aq_clear_pxe_mode(struct i40e_hw *hw,
 				struct i40e_asq_cmd_details *cmd_details);
 i40e_status i40e_aq_set_link_restart_an(struct i40e_hw *hw,
-- 
1.9.3

^ permalink raw reply related

* [net-next 2/9] i40e: enable LSE poke and simplify link state
From: Jeff Kirsher @ 2014-10-24  4:09 UTC (permalink / raw)
  To: davem; +Cc: Jesse Brandeburg, netdev, nhorman, sassmann, jogreene,
	Jeff Kirsher
In-Reply-To: <1414123806-20049-1-git-send-email-jeffrey.t.kirsher@intel.com>

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

The driver can do a simpler job of managing link state by simply
using the admin queue receive event for link events as a doorbell
that tells the driver to update link state.

Additionally, add a workaround will help make sure the link state in the
hardware is consistent with the link state the driver is reporting
by refreshing the link state every service task interval.

Change-ID: Ib95b5b7b8cc016e97d8009f6363c9f9eed301444
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 39 ++++++++++++-----------------
 1 file changed, 16 insertions(+), 23 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 8cb6469..d40fc3b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -5354,10 +5354,14 @@ static void i40e_link_event(struct i40e_pf *pf)
 {
 	bool new_link, old_link;
 
-	new_link = (pf->hw.phy.link_info.link_info & I40E_AQ_LINK_UP);
+	/* set this to force the get_link_status call to refresh state */
+	pf->hw.phy.get_link_info = true;
+
 	old_link = (pf->hw.phy.link_info_old.link_info & I40E_AQ_LINK_UP);
+	new_link = i40e_get_link_status(&pf->hw);
 
-	if (new_link == old_link)
+	if (new_link == old_link &&
+	    new_link == netif_carrier_ok(pf->vsi[pf->lan_vsi]->netdev))
 		return;
 	if (!test_bit(__I40E_DOWN, &pf->vsi[pf->lan_vsi]->state))
 		i40e_print_link_message(pf->vsi[pf->lan_vsi], new_link);
@@ -5525,33 +5529,20 @@ static void i40e_handle_link_event(struct i40e_pf *pf,
 	memcpy(&pf->hw.phy.link_info_old, hw_link_info,
 	       sizeof(pf->hw.phy.link_info_old));
 
+	/* Do a new status request to re-enable LSE reporting
+	 * and load new status information into the hw struct
+	 * This completely ignores any state information
+	 * in the ARQ event info, instead choosing to always
+	 * issue the AQ update link status command.
+	 */
+	i40e_link_event(pf);
+
 	/* check for unqualified module, if link is down */
 	if ((status->link_info & I40E_AQ_MEDIA_AVAILABLE) &&
 	    (!(status->an_info & I40E_AQ_QUALIFIED_MODULE)) &&
 	    (!(status->link_info & I40E_AQ_LINK_UP)))
 		dev_err(&pf->pdev->dev,
 			"The driver failed to link because an unqualified module was detected.\n");
-
-	/* update link status */
-	hw_link_info->phy_type = (enum i40e_aq_phy_type)status->phy_type;
-	hw_link_info->link_speed = (enum i40e_aq_link_speed)status->link_speed;
-	hw_link_info->link_info = status->link_info;
-	hw_link_info->an_info = status->an_info;
-	hw_link_info->ext_info = status->ext_info;
-	hw_link_info->lse_enable =
-		le16_to_cpu(status->command_flags) &
-			    I40E_AQ_LSE_ENABLE;
-
-	/* process the event */
-	i40e_link_event(pf);
-
-	/* Do a new status request to re-enable LSE reporting
-	 * and load new status information into the hw struct,
-	 * then see if the status changed while processing the
-	 * initial event.
-	 */
-	i40e_update_link_info(&pf->hw, true);
-	i40e_link_event(pf);
 }
 
 /**
@@ -6314,6 +6305,8 @@ static void i40e_service_task(struct work_struct *work)
 #endif
 	i40e_clean_adminq_subtask(pf);
 
+	i40e_link_event(pf);
+
 	i40e_service_event_complete(pf);
 
 	/* If the tasks have taken longer than one timer cycle or there
-- 
1.9.3

^ permalink raw reply related

* [net-next 7/9] i40e: Add 10GBaseT support
From: Jeff Kirsher @ 2014-10-24  4:10 UTC (permalink / raw)
  To: davem
  Cc: Mitch Williams, netdev, nhorman, sassmann, jogreene,
	Catherine Sullivan, Shannon Nelson, Jeff Kirsher
In-Reply-To: <1414123806-20049-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Mitch Williams <mitch.a.williams@intel.com>

Add driver support for 10GBaseT device.

Change-ID: I4be6ed847ac0bddd220b9878a95c523b32038174
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_common.c  |  1 +
 drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 33 ++++++++++++++++++++++----
 drivers/net/ethernet/intel/i40e/i40e_main.c    |  4 ++++
 drivers/net/ethernet/intel/i40e/i40e_type.h    |  1 +
 4 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index c23e377..c49416c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -50,6 +50,7 @@ static i40e_status i40e_set_mac_type(struct i40e_hw *hw)
 		case I40E_DEV_ID_QSFP_A:
 		case I40E_DEV_ID_QSFP_B:
 		case I40E_DEV_ID_QSFP_C:
+		case I40E_DEV_ID_10G_BASE_T:
 			hw->mac.type = I40E_MAC_XL710;
 			break;
 		case I40E_DEV_ID_VF:
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 1dda467..12adc08 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -264,6 +264,14 @@ static int i40e_get_settings(struct net_device *netdev,
 			ecmd->supported = SUPPORTED_10000baseKR_Full;
 			ecmd->advertising = ADVERTISED_10000baseKR_Full;
 			break;
+		case I40E_DEV_ID_10G_BASE_T:
+			ecmd->supported = SUPPORTED_10000baseT_Full |
+					  SUPPORTED_1000baseT_Full |
+					  SUPPORTED_100baseT_Full;
+			ecmd->advertising = ADVERTISED_10000baseT_Full |
+					    ADVERTISED_1000baseT_Full |
+					    ADVERTISED_100baseT_Full;
+			break;
 		default:
 			/* all the rest are 10G/1G */
 			ecmd->supported = SUPPORTED_10000baseT_Full |
@@ -322,9 +330,13 @@ static int i40e_get_settings(struct net_device *netdev,
 	case I40E_PHY_TYPE_10GBASE_CR1:
 	case I40E_PHY_TYPE_10GBASE_T:
 		ecmd->supported = SUPPORTED_Autoneg |
-				  SUPPORTED_10000baseT_Full;
+				  SUPPORTED_10000baseT_Full |
+				  SUPPORTED_1000baseT_Full |
+				  SUPPORTED_100baseT_Full;
 		ecmd->advertising = ADVERTISED_Autoneg |
-				    ADVERTISED_10000baseT_Full;
+				    ADVERTISED_10000baseT_Full |
+				    ADVERTISED_1000baseT_Full |
+				    ADVERTISED_100baseT_Full;
 		break;
 	case I40E_PHY_TYPE_XAUI:
 	case I40E_PHY_TYPE_XFI:
@@ -335,14 +347,22 @@ static int i40e_get_settings(struct net_device *netdev,
 	case I40E_PHY_TYPE_1000BASE_KX:
 	case I40E_PHY_TYPE_1000BASE_T:
 		ecmd->supported = SUPPORTED_Autoneg |
-				  SUPPORTED_1000baseT_Full;
+				  SUPPORTED_10000baseT_Full |
+				  SUPPORTED_1000baseT_Full |
+				  SUPPORTED_100baseT_Full;
 		ecmd->advertising = ADVERTISED_Autoneg |
-				    ADVERTISED_1000baseT_Full;
+				    ADVERTISED_10000baseT_Full |
+				    ADVERTISED_1000baseT_Full |
+				    ADVERTISED_100baseT_Full;
 		break;
 	case I40E_PHY_TYPE_100BASE_TX:
 		ecmd->supported = SUPPORTED_Autoneg |
+				  SUPPORTED_10000baseT_Full |
+				  SUPPORTED_1000baseT_Full |
 				  SUPPORTED_100baseT_Full;
 		ecmd->advertising = ADVERTISED_Autoneg |
+				    ADVERTISED_10000baseT_Full |
+				    ADVERTISED_1000baseT_Full |
 				    ADVERTISED_100baseT_Full;
 		break;
 	case I40E_PHY_TYPE_SGMII:
@@ -426,6 +446,9 @@ no_valid_phy_type:
 		case I40E_LINK_SPEED_1GB:
 			ethtool_cmd_speed_set(ecmd, SPEED_1000);
 			break;
+		case I40E_LINK_SPEED_100MB:
+			ethtool_cmd_speed_set(ecmd, SPEED_100);
+			break;
 		default:
 			break;
 		}
@@ -528,7 +551,7 @@ static int i40e_set_settings(struct net_device *netdev,
 		}
 		/* If autoneg is currently enabled */
 		if (hw->phy.link_info.an_info & I40E_AQ_AN_COMPLETED) {
-			config.abilities = abilities.abilities |
+			config.abilities = abilities.abilities &
 					   ~I40E_AQ_PHY_ENABLE_AN;
 			change = true;
 		}
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 1fbbe11..9d36d10 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -74,6 +74,7 @@ static const struct pci_device_id i40e_pci_tbl[] = {
 	{PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_A), 0},
 	{PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_B), 0},
 	{PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_C), 0},
+	{PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T), 0},
 	/* required last entry */
 	{0, }
 };
@@ -4449,6 +4450,9 @@ static void i40e_print_link_message(struct i40e_vsi *vsi, bool isup)
 	case I40E_LINK_SPEED_1GB:
 		strlcpy(speed, "1000 Mbps", SPEED_SIZE);
 		break;
+	case I40E_LINK_SPEED_100MB:
+		strncpy(speed, "100 Mbps", SPEED_SIZE);
+		break;
 	default:
 		break;
 	}
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h
index ce04d90..3a237c3 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_type.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_type.h
@@ -43,6 +43,7 @@
 #define I40E_DEV_ID_QSFP_A		0x1583
 #define I40E_DEV_ID_QSFP_B		0x1584
 #define I40E_DEV_ID_QSFP_C		0x1585
+#define I40E_DEV_ID_10G_BASE_T		0x1586
 #define I40E_DEV_ID_VF			0x154C
 #define I40E_DEV_ID_VF_HV		0x1571
 
-- 
1.9.3

^ permalink raw reply related

* [net-next 4/9] i40e/i40evf: Use usleep_range() instead of udelay()
From: Jeff Kirsher @ 2014-10-24  4:10 UTC (permalink / raw)
  To: davem; +Cc: Neerav Parikh, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1414123806-20049-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Neerav Parikh <neerav.parikh@intel.com>

As per the Documentation/timers/timers-howto.txt it is preferred to use
usleep_range() instead of udelay() if the delay value is > 10us in
non-atomic contexts.
So, replacing all the instances of udelay() with 10 or greater than 10
micro seconds delay in the driver and using usleep_range() instead.

Change-ID: Iaa2ab499a4c26f6005e5d86cc421407ef9de16c7
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c        | 6 +++---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 +-
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index d40fc3b..f7464e8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -3440,7 +3440,7 @@ static int i40e_pf_txq_wait(struct i40e_pf *pf, int pf_q, bool enable)
 		if (enable == !!(tx_reg & I40E_QTX_ENA_QENA_STAT_MASK))
 			break;
 
-		udelay(10);
+		usleep_range(10, 20);
 	}
 	if (i >= I40E_QUEUE_WAIT_RETRY_LIMIT)
 		return -ETIMEDOUT;
@@ -3466,7 +3466,7 @@ static int i40e_vsi_control_tx(struct i40e_vsi *vsi, bool enable)
 		/* warn the TX unit of coming changes */
 		i40e_pre_tx_queue_cfg(&pf->hw, pf_q, enable);
 		if (!enable)
-			udelay(10);
+			usleep_range(10, 20);
 
 		for (j = 0; j < 50; j++) {
 			tx_reg = rd32(hw, I40E_QTX_ENA(pf_q));
@@ -3526,7 +3526,7 @@ static int i40e_pf_rxq_wait(struct i40e_pf *pf, int pf_q, bool enable)
 		if (enable == !!(rx_reg & I40E_QRX_ENA_QENA_STAT_MASK))
 			break;
 
-		udelay(10);
+		usleep_range(10, 20);
 	}
 	if (i >= I40E_QUEUE_WAIT_RETRY_LIMIT)
 		return -ETIMEDOUT;
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 4eeed26..fff3c27 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -674,7 +674,7 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)
 		 * that the requested op was completed
 		 * successfully
 		 */
-		udelay(10);
+		usleep_range(10, 20);
 		reg = rd32(hw, I40E_VPGEN_VFRSTAT(vf->vf_id));
 		if (reg & I40E_VPGEN_VFRSTAT_VFRD_MASK) {
 			rsd = true;
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index c51bc7a..dabe6a4 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1494,7 +1494,7 @@ static void i40evf_reset_task(struct work_struct *work)
 
 	while (test_and_set_bit(__I40EVF_IN_CRITICAL_TASK,
 				&adapter->crit_section))
-		udelay(500);
+		usleep_range(500, 1000);
 
 	if (adapter->flags & I40EVF_FLAG_RESET_NEEDED) {
 		dev_info(&adapter->pdev->dev, "Requesting reset from PF\n");
@@ -1980,7 +1980,7 @@ static int i40evf_check_reset_complete(struct i40e_hw *hw)
 		if ((rstat == I40E_VFR_VFACTIVE) ||
 		    (rstat == I40E_VFR_COMPLETED))
 			return 0;
-		udelay(10);
+		usleep_range(10, 20);
 	}
 	return -EBUSY;
 }
-- 
1.9.3

^ permalink raw reply related

* [net-next 5/9] i40e: Fix a bug where Rx would stop after some time
From: Jeff Kirsher @ 2014-10-24  4:10 UTC (permalink / raw)
  To: davem
  Cc: Anjali Singhai Jain, netdev, nhorman, sassmann, jogreene,
	Jesse Brandeburg, Jeff Kirsher
In-Reply-To: <1414123806-20049-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Anjali Singhai Jain <anjali.singhai@intel.com>

Move the setting of flow control because this should be done at a pf level not
a vsi level. Also add a sleep and restart an to fix a bug where Rx would stop
after some stress.

Change-ID: I9a93d8c2ff27c39339eb00bc4ec1225e43900be0
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index f7464e8..ff6d94d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -4479,12 +4479,8 @@ static void i40e_print_link_message(struct i40e_vsi *vsi, bool isup)
 static int i40e_up_complete(struct i40e_vsi *vsi)
 {
 	struct i40e_pf *pf = vsi->back;
-	u8 set_fc_aq_fail = 0;
 	int err;
 
-	/* force flow control off */
-	i40e_set_fc(&pf->hw, &set_fc_aq_fail, true);
-
 	if (pf->flags & I40E_FLAG_MSIX_ENABLED)
 		i40e_vsi_configure_msix(vsi);
 	else
@@ -5958,6 +5954,7 @@ static void i40e_send_version(struct i40e_pf *pf)
 static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
 {
 	struct i40e_hw *hw = &pf->hw;
+	u8 set_fc_aq_fail = 0;
 	i40e_status ret;
 	u32 v;
 
@@ -6038,6 +6035,11 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
 	if (ret)
 		dev_info(&pf->pdev->dev, "set phy mask fail, aq_err %d\n", ret);
 
+	/* make sure our flow control settings are restored */
+	ret = i40e_set_fc(&pf->hw, &set_fc_aq_fail, true);
+	if (ret)
+		dev_info(&pf->pdev->dev, "set fc fail, aq_err %d\n", ret);
+
 	/* Rebuild the VSIs and VEBs that existed before reset.
 	 * They are still in our local switch element arrays, so only
 	 * need to rebuild the switch model in the HW.
@@ -6092,6 +6094,13 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)
 		}
 	}
 
+	msleep(75);
+	ret = i40e_aq_set_link_restart_an(&pf->hw, true, NULL);
+	if (ret) {
+		dev_info(&pf->pdev->dev, "link restart failed, aq_err=%d\n",
+			 pf->hw.aq.asq_last_status);
+	}
+
 	/* reinit the misc interrupt */
 	if (pf->flags & I40E_FLAG_MSIX_ENABLED)
 		ret = i40e_setup_misc_vector(pf);
@@ -9169,6 +9178,13 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (err)
 		dev_info(&pf->pdev->dev, "set phy mask fail, aq_err %d\n", err);
 
+	msleep(75);
+	err = i40e_aq_set_link_restart_an(&pf->hw, true, NULL);
+	if (err) {
+		dev_info(&pf->pdev->dev, "link restart failed, aq_err=%d\n",
+			 pf->hw.aq.asq_last_status);
+	}
+
 	/* The main driver is (mostly) up and happy. We need to set this state
 	 * before setting up the misc vector or we get a race and the vector
 	 * ends up disabled forever.
-- 
1.9.3

^ permalink raw reply related

* [net-next 6/9] i40e: process link events when setting up switch
From: Jeff Kirsher @ 2014-10-24  4:10 UTC (permalink / raw)
  To: davem; +Cc: Mitch Williams, netdev, nhorman, sassmann, jogreene, Jeff Kirsher
In-Reply-To: <1414123806-20049-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Mitch Williams <mitch.a.williams@intel.com>

Add code to handle link events when updating the PF switch. This
allows link information to be properly provided to VFs in all cases.

Change-ID: If314c95f3d39259ef4c40a4a3b823381e28fb24f
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index ff6d94d..1fbbe11 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8730,6 +8730,14 @@ static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit)
 	pf->fc_autoneg_status = ((pf->hw.phy.link_info.an_info &
 				  I40E_AQ_AN_COMPLETED) ? true : false);
 
+	/* fill in link information and enable LSE reporting */
+	i40e_update_link_info(&pf->hw, true);
+	i40e_link_event(pf);
+
+	/* Initialize user-specific link properties */
+	pf->fc_autoneg_status = ((pf->hw.phy.link_info.an_info &
+				  I40E_AQ_AN_COMPLETED) ? true : false);
+
 	i40e_ptp_init(pf);
 
 	return ret;
-- 
1.9.3

^ permalink raw reply related


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