Re: [PATCH v4 net-next 08/10] net/ncsi: Support NCSI packet generation

2017-05-08 Thread Gavin Shan
On Mon, May 08, 2017 at 02:56:32AM +0200, Andrew Lunn wrote: >> I need to dig how libpcap receives packets. It's appreciated if you >> can give some hints about that. However, I don't see the benefit to >> receive packets by libpcap, could you claim? > >The base interface should already be doing it

Re: [PATCH v4 net-next 08/10] net/ncsi: Support NCSI packet generation

2017-05-07 Thread Gavin Shan
On Thu, May 04, 2017 at 02:00:35PM +0200, Andrew Lunn wrote: >On Thu, May 04, 2017 at 04:31:57PM +1000, Gavin Shan wrote: >> On Wed, May 03, 2017 at 02:52:54PM +0200, Andrew Lunn wrote: >> >On Wed, May 03, 2017 at 02:44:39PM +1000, Gavin Shan wrote: >> >> This int

Re: [PATCH v4 net-next 04/10] net/ncsi: Ethtool operation to get NCSI topology

2017-05-07 Thread Gavin Shan
On Thu, May 04, 2017 at 09:31:20AM +, David Laight wrote: >From: Gavin Shan >> Sent: 04 May 2017 07:16 >> On Wed, May 03, 2017 at 10:19:44PM -0700, Stephen Hemminger wrote: >> >On Wed, 3 May 2017 14:44:35 +1000 >> >Gavin Shan wrote: >... >> >&

Re: [PATCH v4 net-next 08/10] net/ncsi: Support NCSI packet generation

2017-05-03 Thread Gavin Shan
On Wed, May 03, 2017 at 02:52:54PM +0200, Andrew Lunn wrote: >On Wed, May 03, 2017 at 02:44:39PM +1000, Gavin Shan wrote: >> This introduces /sys/kernel/debug/ncsi/eth0/pkt. The debugfs entry >> can accept parameters to produce NCSI command packet. The received >> NCSI respons

Re: [PATCH v4 net-next 04/10] net/ncsi: Ethtool operation to get NCSI topology

2017-05-03 Thread Gavin Shan
On Wed, May 03, 2017 at 10:21:11PM -0700, Stephen Hemminger wrote: >On Wed, 3 May 2017 14:44:35 +1000 >Gavin Shan wrote: > >> +void ncsi_ethtool_register_dev(struct net_device *dev) >> +{ >> +struct ethtool_ops *ops; >> + >> +ops = (struct ethto

Re: [PATCH v4 net-next 04/10] net/ncsi: Ethtool operation to get NCSI topology

2017-05-03 Thread Gavin Shan
On Wed, May 03, 2017 at 10:19:44PM -0700, Stephen Hemminger wrote: >On Wed, 3 May 2017 14:44:35 +1000 >Gavin Shan wrote: > >> +static int ethtool_get_ncsi_channels(struct net_device *dev, >> + void __user *useraddr) > >Please don't

Re: [PATCH v4 net-next 04/10] net/ncsi: Ethtool operation to get NCSI topology

2017-05-03 Thread Gavin Shan
On Thu, May 04, 2017 at 02:49:33AM +0200, Andrew Lunn wrote: >> +void ncsi_ethtool_register_dev(struct net_device *dev) >> +{ >> +struct ethtool_ops *ops; >> + >> +ops = (struct ethtool_ops *)(dev->ethtool_ops); > >Why do you need the cast here? > >Ah, is it because net_device has: > >

Re: [PATCH v4 net-next 06/10] net/ncsi: Ethtool operation to get NCSI hw statistics

2017-05-03 Thread Gavin Shan
On Thu, May 04, 2017 at 02:34:52AM +0200, Andrew Lunn wrote: >On Thu, May 04, 2017 at 10:05:34AM +1000, Gavin Shan wrote: >> On Wed, May 03, 2017 at 09:18:23AM -0400, David Miller wrote: >> >From: Andrew Lunn >> >Date: Wed, 3 May 2017 14:47:22 +0200 >> > >

Re: [PATCH v4 net-next 06/10] net/ncsi: Ethtool operation to get NCSI hw statistics

2017-05-03 Thread Gavin Shan
On Wed, May 03, 2017 at 08:16:43PM -0400, David Miller wrote: >From: Gavin Shan >Date: Thu, 4 May 2017 10:05:34 +1000 >> On Wed, May 03, 2017 at 09:18:23AM -0400, David Miller wrote: >>>From: Andrew Lunn >>>Date: Wed, 3 May 2017 14:47:22 +0200 >>> >&g

Re: [PATCH v4 net-next 00/10] net/ncsi: Add debugging functionality

2017-05-03 Thread Gavin Shan
On Wed, May 03, 2017 at 02:58:02PM +0200, Andrew Lunn wrote: >On Wed, May 03, 2017 at 02:44:31PM +1000, Gavin Shan wrote: >> This series supports NCSI debugging infrastructure by adding several >> ethtool commands and one debugfs file. It was inspired by the reported >>

Re: [PATCH v4 net-next 00/10] net/ncsi: Add debugging functionality

2017-05-03 Thread Gavin Shan
On Wed, May 03, 2017 at 01:25:18AM -0400, David Miller wrote: > >Sorry, the net-next tree is closed right now as we are in the merge >window. > >Please resubmit this when the net-next tree opens back up. > >Thank you. > Sorry that I didn't catch the merge window. Thanks for the tip. I'll resubmit

Re: [PATCH v4 net-next 06/10] net/ncsi: Ethtool operation to get NCSI hw statistics

2017-05-03 Thread Gavin Shan
On Wed, May 03, 2017 at 09:18:23AM -0400, David Miller wrote: >From: Andrew Lunn >Date: Wed, 3 May 2017 14:47:22 +0200 > >> On Wed, May 03, 2017 at 02:44:37PM +1000, Gavin Shan wrote: >>> This adds ethtool command (ETHTOOL_GNCSISTATS) to retrieve the >>> NCSI har

[PATCH v4 net-next 05/10] net/ncsi: Ethtool operation to get NCSI channel info

2017-05-02 Thread Gavin Shan
bc84 Signed-off-by: Gavin Shan --- include/linux/ethtool.h | 2 + include/uapi/linux/ethtool.h | 151 +++ net/core/ethtool.c | 22 +++ net/ncsi/ncsi-ethtool.c | 120 ++ 4 files changed, 295

[PATCH v4 net-next 06/10] net/ncsi: Ethtool operation to get NCSI hw statistics

2017-05-02 Thread Gavin Shan
:0 pt_rx_channel_err:0 pt_rx_us_err: 0 pt_rx_os_err: 0 Signed-off-by: Gavin Shan --- include/linux/ethtool.h | 2 + include/uapi/linux/ethtool.h | 124 +++ net/core/ethtool.c | 29 ++ net/ncsi/ncsi

[PATCH v4 net-next 07/10] net/ncsi: Ethtool operation to get NCSI sw statistics

2017-05-02 Thread Gavin Shan
100 GLS 10 00 SMA 100 DBF 100 GC 002 GP 200 AEN OK TIMEOUT ERROR Signed-off-by: Gavin Shan

[PATCH v4 net-next 04/10] net/ncsi: Ethtool operation to get NCSI topology

2017-05-02 Thread Gavin Shan
the total number of NCSI channels so that userspace can allocate enough memory to convey data. Here is the example output from modified (private) ethtool: # ethtool --ncsi eth0 channels 2 channels: 0:0 Active 0:1 Signed-off-by: Gavin Shan --- include/linux/ethtool.h | 2 ++ include

[PATCH v4 net-next 03/10] net/ncsi: Enforce failover on link monitor timeout

2017-05-02 Thread Gavin Shan
ve in order for deinitialization and failover to be done. Signed-off-by: Gavin Shan --- net/ncsi/ncsi-manage.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index c71a3a5..13ad1f26 100644 --- a/net/ncsi/ncsi-manage.c +++

[PATCH v4 net-next 01/10] net/ncsi: Disable HWA mode when no channels are found

2017-05-02 Thread Gavin Shan
When there are no NCSI channels probed, HWA (Hardware Arbitration) mode is enabled. It's not correct because HWA depends on the fact: NCSI channels exist and all of them support HWA mode. This disables HWA when no channels are probed. Signed-off-by: Gavin Shan --- net/ncsi/ncsi-manage.c

[PATCH v4 net-next 02/10] net/ncsi: Properly track channel monitor timer state

2017-05-02 Thread Gavin Shan
se if needed. Reported-by: Sridevi Ramesh Signed-off-by: Gavin Shan --- net/ncsi/ncsi-manage.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index 5073e15..c71a3a5 100644 --- a/net/ncsi/ncsi-manage.c +++ b/net

[PATCH v4 net-next 09/10] net/ncsi: No error report on DP response to non-existing package

2017-05-02 Thread Gavin Shan
pplied, no error reported from DP response packets. # ethtool --ncsi eth0 swstats : RESPONSE OK TIMEOUT ERROR === DP 300 Signed-off-by: Gavin Shan --- net/ncsi/ncsi-rsp.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH v4 net-next 00/10] net/ncsi: Add debugging functionality

2017-05-02 Thread Gavin Shan
b Kicinski) v2: * Use debugfs instead of procfs (Joe Perches) Gavin Shan (10): net/ncsi: Disable HWA mode when no channels are found net/ncsi: Properly track channel monitor timer state net/ncsi: Enforce failover on link monitor timeout net/ncsi: Ethtool o

[PATCH v4 net-next 10/10] net/ncsi: Fix length of GVI response packet

2017-05-02 Thread Gavin Shan
this applied, no error reported on GVI response packets: # ethtool --ncsi eth0 swstats : RESPONSE OK TIMEOUT ERROR === GVI 200 Signed-off-by: Gavin Shan --- net/ncsi/ncsi-rsp.c | 2 +- 1 file changed, 1 insertion

[PATCH v4 net-next 08/10] net/ncsi: Support NCSI packet generation

2017-05-02 Thread Gavin Shan
cat /sys/kernel/debug/ncsi/eth0/pkt NCSI response [CIS] packet received 00 01 dd 80 00 0004 Signed-off-by: Gavin Shan --- net/ncsi/internal.h| 54 net/ncsi/ncsi-cmd.c| 1 + net/ncsi/ncsi-debug.c | 714 + net/ncsi/n

Re: [PATCH v3 net-next 5/8] net/ncsi: Dump NCSI packet statistics

2017-04-20 Thread Gavin Shan
On Thu, Apr 20, 2017 at 05:58:58PM -0700, David Miller wrote: >From: Gavin Shan >Date: Fri, 21 Apr 2017 09:38:12 +1000 > >> (1) ethtool usually dumps statistics collected by hardware, but this >> debugfs file dumps the statistics of packets seen (collected) by >>

Re: [PATCH v3 net-next 5/8] net/ncsi: Dump NCSI packet statistics

2017-04-20 Thread Gavin Shan
On Thu, Apr 20, 2017 at 05:59:27PM -0700, Florian Fainelli wrote: >On 04/20/2017 05:44 PM, Gavin Shan wrote: >> On Thu, Apr 20, 2017 at 05:26:14PM -0700, Florian Fainelli wrote: >>> On 04/20/2017 04:38 PM, Gavin Shan wrote: >>>> On Thu, Apr 20, 2017 at 01:21:

Re: [PATCH v3 net-next 5/8] net/ncsi: Dump NCSI packet statistics

2017-04-20 Thread Gavin Shan
On Thu, Apr 20, 2017 at 05:26:14PM -0700, Florian Fainelli wrote: >On 04/20/2017 04:38 PM, Gavin Shan wrote: >> On Thu, Apr 20, 2017 at 01:21:03PM -0400, David Miller wrote: >>> From: Gavin Shan >>> Date: Tue, 18 Apr 2017 16:51:32 +1000 >>> >>>> Th

Re: [PATCH v3 net-next 5/8] net/ncsi: Dump NCSI packet statistics

2017-04-20 Thread Gavin Shan
On Thu, Apr 20, 2017 at 01:21:03PM -0400, David Miller wrote: >From: Gavin Shan >Date: Tue, 18 Apr 2017 16:51:32 +1000 > >> This creates /sys/kernel/debug/ncsi//stats to dump the NCSI >> packets sent and received over all packages and channels. It's useful >> to di

[PATCH v3 net-next 3/8] net/ncsi: Enforce failover on link monitor timeout

2017-04-17 Thread Gavin Shan
ve in order for deinitialization and failover to be done. Signed-off-by: Gavin Shan --- net/ncsi/ncsi-manage.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index c71a3a5..13ad1f26 100644 --- a/net/ncsi/ncsi-manage.c +++

[PATCH v3 net-next 1/8] net/ncsi: Disable HWA mode when no channels are found

2017-04-17 Thread Gavin Shan
When there are no NCSI channels probed, HWA (Hardware Arbitration) mode is enabled. It's not correct because HWA depends on the fact: NCSI channels exist and all of them support HWA mode. This disables HWA when no channels are probed. Signed-off-by: Gavin Shan --- net/ncsi/ncsi-manage.c

[PATCH v3 net-next 8/8] net/ncsi: Fix length of GVI response packet

2017-04-17 Thread Gavin Shan
With this applied, no error reported on GVI response packets: # cat /sys/kernel/debug/ncsi/eth0/stats : RSP OK TIMEOUT ERROR === GVI 200 Signed-off-by: Gavin Shan --- net/ncsi/ncsi-rsp.c | 2 +- 1 file changed, 1

[PATCH v3 net-next 0/8] net/ncsi: Add debugging functionality

2017-04-17 Thread Gavin Shan
f's in *.c (Jakub Kicinski) v2: * Use debugfs instead of procfs (Joe Perches) Gavin Shan (8): net/ncsi: Disable HWA mode when no channels are found net/ncsi: Properly track channel monitor timer state net/ncsi: Enforce failover on link monitor timeout

[PATCH v3 net-next 2/8] net/ncsi: Properly track channel monitor timer state

2017-04-17 Thread Gavin Shan
se if needed. Reported-by: Sridevi Ramesh Signed-off-by: Gavin Shan --- net/ncsi/ncsi-manage.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index 5073e15..c71a3a5 100644 --- a/net/ncsi/ncsi-manage.c +++ b/net

[PATCH v3 net-next 7/8] net/ncsi: No error report on DP response to non-existing package

2017-04-17 Thread Gavin Shan
300 DP 300 Signed-off-by: Gavin Shan --- net/ncsi/ncsi-rsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ncsi/ncsi-rsp.c b/net/ncsi/ncsi-rsp.c index 24154fc..092f2d8 100644 --- a/net/ncsi/ncsi-rsp.c +++ b/net/ncsi/ncsi-rsp.c @@ -11

[PATCH v3 net-next 6/8] net/ncsi: Support NCSI packet generation

2017-04-17 Thread Gavin Shan
cat /sys/kernel/debug/ncsi/eth0/pkt NCSI response [CIS] packet received 00 01 dd 80 00 0004 Signed-off-by: Gavin Shan --- net/ncsi/internal.h| 43 +++ net/ncsi/ncsi-cmd.c| 1 + net/ncsi/ncsi-debug.c | 697 ++--- net/ncsi/n

[PATCH v3 net-next 4/8] net/ncsi: Add debugging infrastructurre

2017-04-17 Thread Gavin Shan
directories so far. /sys/kernel/debug/ncsi/eth0 /sys/kernel/debug/ncsi/eth0/p0 /sys/kernel/debug/ncsi/eth0/p0/c0 /sys/kernel/debug/ncsi/eth0/p0/c1 Signed-off-by: Gavin Shan --- net/ncsi/Kconfig | 9 + net/ncsi/Makefile | 1 + net/ncsi/internal.h| 45

[PATCH v3 net-next 5/8] net/ncsi: Dump NCSI packet statistics

2017-04-17 Thread Gavin Shan
02 GC 200 AEN OK TIMEOUT ERROR === Signed-off-by: Gavin Shan --- net/ncsi/internal.h| 17 net/ncsi/ncsi-aen.c| 13 ++- net/ncsi/ncsi-cmd.c| 12 ++- net/ncsi/ncsi-debu

Re: [PATCH v2 net-next 5/8] net/ncsi: Dump NCSI packet statistics

2017-04-17 Thread Gavin Shan
On Thu, Apr 13, 2017 at 07:30:45PM -0700, Joe Perches wrote: >On Thu, 2017-04-13 at 17:48 +1000, Gavin Shan wrote: >> This creates /sys/kernel/debug/ncsi//stats to dump the NCSI >> packets sent and received over all packages and channels. It's useful >> to diagnose NCSI

Re: [PATCH v2 net-next 5/8] net/ncsi: Dump NCSI packet statistics

2017-04-17 Thread Gavin Shan
On Thu, Apr 13, 2017 at 06:50:42PM -0700, Jakub Kicinski wrote: >On Thu, 13 Apr 2017 17:48:18 +1000, Gavin Shan wrote: >> This creates /sys/kernel/debug/ncsi//stats to dump the NCSI >> packets sent and received over all packages and channels. It's useful >> to diagnose

Re: [PATCH] net/ncsi: fix checksum validation in response packet

2017-04-17 Thread Gavin Shan
On Mon, Apr 17, 2017 at 01:36:19PM -0400, David Miller wrote: >From: Cédric Le Goater >Date: Fri, 14 Apr 2017 10:56:37 +0200 > >> htonl was used instead of ntohl. Surely a typo. >> >> Signed-off-by: Cédric Le Goater > >I don't think so, "checksum" is of type "u32" thus is in host byte >order. T

Re: [PATCH v2 net-next 5/8] net/ncsi: Dump NCSI packet statistics

2017-04-17 Thread Gavin Shan
On Thu, Apr 13, 2017 at 03:50:40AM -0700, Joe Perches wrote: >On Thu, 2017-04-13 at 17:48 +1000, Gavin Shan wrote: >> This creates /sys/kernel/debug/ncsi//stats to dump the NCSI >> packets sent and received over all packages and channels. It's useful >> to diagnose NCSI

Re: [PATCH v2 net-next 4/8] net/ncsi: Add debugging infrastructurre

2017-04-17 Thread Gavin Shan
On Thu, Apr 13, 2017 at 03:41:46AM -0700, Joe Perches wrote: >On Thu, 2017-04-13 at 17:48 +1000, Gavin Shan wrote: >> This creates debugfs directories as NCSI debugging infrastructure. >> With the patch applied, We will see below debugfs directories. Every >> NCSI packag

Re: [PATCH net-next 0/8] net/ncsi: Add debugging functionality

2017-04-13 Thread Gavin Shan
On Thu, Apr 13, 2017 at 12:46:32PM +1000, Gavin Shan wrote: >This series supports NCSI debugging infrastructure by adding several >procfs files. It was inspired by the reported issues: No available >package and channel are probed successfully. Obviously, we don't >have a debuggi

[PATCH v2 net-next 7/8] net/ncsi: No error report on DP response to non-existing package

2017-04-13 Thread Gavin Shan
300 DP 300 Signed-off-by: Gavin Shan --- net/ncsi/ncsi-rsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ncsi/ncsi-rsp.c b/net/ncsi/ncsi-rsp.c index 93ebe0f..095726f 100644 --- a/net/ncsi/ncsi-rsp.c +++ b/net/ncsi/ncsi-rsp.c @@ -11

[PATCH v2 net-next 1/8] net/ncsi: Disable HWA mode when no channels are found

2017-04-13 Thread Gavin Shan
When there are no NCSI channels probed, HWA (Hardware Arbitration) mode is enabled. It's not correct because HWA depends on the fact: NCSI channels exist and all of them support HWA mode. This disables HWA when no channels are probed. Signed-off-by: Gavin Shan --- net/ncsi/ncsi-manage.c

[PATCH v2 net-next 2/8] net/ncsi: Properly track channel monitor timer state

2017-04-13 Thread Gavin Shan
se if needed. Reported-by: Sridevi Ramesh Signed-off-by: Gavin Shan --- net/ncsi/ncsi-manage.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index 5073e15..c71a3a5 100644 --- a/net/ncsi/ncsi-manage.c +++ b/net

[PATCH v2 net-next 5/8] net/ncsi: Dump NCSI packet statistics

2017-04-13 Thread Gavin Shan
02 GC 200 AEN OK TIMEOUT ERROR === Signed-off-by: Gavin Shan --- net/ncsi/internal.h| 10 +++ net/ncsi/ncsi-aen.c| 15 +++- net/ncsi/ncsi-cmd.c| 18 +++- net/ncsi/ncsi-debu

[PATCH v2 net-next 8/8] net/ncsi: Fix length of GVI response packet

2017-04-13 Thread Gavin Shan
With this applied, no error reported on GVI response packets: # cat /sys/kernel/debug/ncsi/eth0/stats : RSP OK TIMEOUT ERROR === GVI 200 Signed-off-by: Gavin Shan --- net/ncsi/ncsi-rsp.c | 2 +- 1 file changed, 1

[PATCH v2 net-next 3/8] net/ncsi: Enforce failover on link monitor timeout

2017-04-13 Thread Gavin Shan
ve in order for deinitialization and failover to be done. Signed-off-by: Gavin Shan --- net/ncsi/ncsi-manage.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index c71a3a5..13ad1f26 100644 --- a/net/ncsi/ncsi-manage.c +++

[PATCH v2 net-next 6/8] net/ncsi: Support NCSI packet generation

2017-04-13 Thread Gavin Shan
cat /sys/kernel/debug/ncsi/eth0/pkt NCSI response [CIS] packet received 00 01 dd 80 00 0004 Signed-off-by: Gavin Shan --- net/ncsi/internal.h| 13 + net/ncsi/ncsi-cmd.c| 5 + net/ncsi/ncsi-debug.c | 694 ++--- net/ncsi/n

[PATCH v2 net-next 4/8] net/ncsi: Add debugging infrastructurre

2017-04-13 Thread Gavin Shan
directories so far. /sys/kernel/debug/ncsi/eth0 /sys/kernel/debug/ncsi/eth0/p0 /sys/kernel/debug/ncsi/eth0/p0/c0 /sys/kernel/debug/ncsi/eth0/p0/c1 Signed-off-by: Gavin Shan --- net/ncsi/Kconfig | 9 + net/ncsi/Makefile | 1 + net/ncsi/internal.h| 45

[PATCH v2 net-next 0/8] net/ncsi: Add debugging functionality

2017-04-13 Thread Gavin Shan
n sent and received NCSI packets; generate NCSI command packet manually. PATCH[7,8/8] fixes two issues found from the debugging functionality. Changelog = v2: * Use debugfs instead of procfs (Joe Perches). Gavin Shan (8): net/ncsi: Disable HWA mode when no channels are found net/ncsi: Prop

Re: [PATCH net-next 4/8] net/ncsi: Add debugging infrastructurre

2017-04-12 Thread Gavin Shan
On Wed, Apr 12, 2017 at 09:28:26PM -0700, Joe Perches wrote: >On Thu, 2017-04-13 at 12:46 +1000, Gavin Shan wrote: >> This creates procfs directories as NCSI debugging infrastructure. >> With the patch applied, We will see below procfs directories. Every >> NCSI packag

[PATCH net-next 4/8] net/ncsi: Add debugging infrastructurre

2017-04-12 Thread Gavin Shan
directories so far. /proc/ncsi/eth0 /proc/ncsi/eth0/p0 /proc/ncsi/eth0/p0/c0 /proc/ncsi/eth0/p0/c1 Signed-off-by: Gavin Shan --- net/ncsi/Kconfig | 9 + net/ncsi/Makefile | 1 + net/ncsi/internal.h| 45 net/ncsi/ncsi-debug.c | 95

[PATCH net-next 2/8] net/ncsi: Properly track channel monitor timer state

2017-04-12 Thread Gavin Shan
se if needed. Reported-by: Sridevi Ramesh Signed-off-by: Gavin Shan --- net/ncsi/ncsi-manage.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index 5073e15..c71a3a5 100644 --- a/net/ncsi/ncsi-manage.c +++ b/net

[PATCH net-next 3/8] net/ncsi: Enforce failover on link monitor timeout

2017-04-12 Thread Gavin Shan
ve in order for deinitialization and failover to be done. Signed-off-by: Gavin Shan --- net/ncsi/ncsi-manage.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c index c71a3a5..13ad1f26 100644 --- a/net/ncsi/ncsi-manage.c +++

[PATCH net-next 1/8] net/ncsi: Disable HWA mode when no channels are found

2017-04-12 Thread Gavin Shan
When there are no NCSI channels probed, HWA (Hardware Arbitration) mode is enabled. It's not correct because HWA depends on the fact: NCSI channels exist and all of them support HWA mode. This disables HWA when no channels are probed. Signed-off-by: Gavin Shan --- net/ncsi/ncsi-manage.c

[PATCH net-next 0/8] net/ncsi: Add debugging functionality

2017-04-12 Thread Gavin Shan
d received NCSI packets; generate NCSI command packet manually. PATCH[7,8/8] fixes two issues found from the debugging functionality. Gavin Shan (8): net/ncsi: Disable HWA mode when no channels are found net/ncsi: Properly track channel monitor timer state net/ncsi: Enforce failover on li

[PATCH net-next 6/8] net/ncsi: Support NCSI packet generation

2017-04-12 Thread Gavin Shan
pkt NCSI response [CIS] packet received 00 01 dd 80 00 0004 Signed-off-by: Gavin Shan --- net/ncsi/internal.h| 13 + net/ncsi/ncsi-cmd.c| 5 + net/ncsi/ncsi-debug.c | 693 ++--- net/ncsi/ncsi-manage.c | 3 + net/ncsi/ncsi-rs

[PATCH net-next 5/8] net/ncsi: Dump NCSI packet statistics

2017-04-12 Thread Gavin Shan
200 AEN OK TIMEOUT ERROR === Signed-off-by: Gavin Shan --- net/ncsi/internal.h| 10 +++ net/ncsi/ncsi-aen.c| 15 +++- net/ncsi/ncsi-cmd.c| 18 +++- net/ncsi/ncsi-debu

[PATCH net-next 7/8] net/ncsi: No error report on DP response to non-existing package

2017-04-12 Thread Gavin Shan
300 Signed-off-by: Gavin Shan --- net/ncsi/ncsi-rsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ncsi/ncsi-rsp.c b/net/ncsi/ncsi-rsp.c index 93ebe0f..095726f 100644 --- a/net/ncsi/ncsi-rsp.c +++ b/net/ncsi/ncsi-rsp.c @@ -118,7 +118,7 @@ static int ncsi_rsp_

[PATCH net-next 8/8] net/ncsi: Fix length of GVI response packet

2017-04-12 Thread Gavin Shan
error reported on GVI response packets: # cat /proc/ncsi/eth0/stats : RSP OK TIMEOUT ERROR === GVI 200 Signed-off-by: Gavin Shan --- net/ncsi/ncsi-rsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: [PATCH v2] PCI: lock each enable/disable num_vfs operation in sysfs

2017-01-08 Thread Gavin Shan
xgbe] > [] sriov_numvfs_store+0xdc/0x130 >... >RIP [] pci_iov_release+0x57/0x60 > >Use the existing mutex lock to protect each enable/disable operation. > >-v2: move the existing lock from protecting the config of the IOV bus >to protecting the writes to sriov_numvfs in sysfs

Re: [PATCH 2/2] PCI: lock each enable/disable num_vfs operation in sysfs

2017-01-05 Thread Gavin Shan
On Fri, Jan 06, 2017 at 12:55:08AM +, Tantilov, Emil S wrote: >>On Wed, Jan 04, 2017 at 04:00:20PM +, Tantilov, Emil S wrote: On Tue, Jan 03, 2017 at 04:48:31PM -0800, Emil Tantilov wrote: >Enabling/disabling SRIOV via sysfs by echo-ing multiple values >simultaneously: > >>>

Re: [PATCH 2/2] PCI: lock each enable/disable num_vfs operation in sysfs

2017-01-04 Thread Gavin Shan
On Wed, Jan 04, 2017 at 04:00:20PM +, Tantilov, Emil S wrote: >>On Tue, Jan 03, 2017 at 04:48:31PM -0800, Emil Tantilov wrote: >>>Enabling/disabling SRIOV via sysfs by echo-ing multiple values >>>simultaneously: >>> >>>echo 63 > /sys/class/net/ethX/device/sriov_numvfs& >>>echo 63 > /sys/class/n

Re: [PATCH 2/2] PCI: lock each enable/disable num_vfs operation in sysfs

2017-01-03 Thread Gavin Shan
On Tue, Jan 03, 2017 at 04:48:31PM -0800, Emil Tantilov wrote: >Enabling/disabling SRIOV via sysfs by echo-ing multiple values >simultaneously: > >echo 63 > /sys/class/net/ethX/device/sriov_numvfs& >echo 63 > /sys/class/net/ethX/device/sriov_numvfs > >sleep 5 > >echo 0 > /sys/class/net/ethX/device/

Re: bnx2 breaks Dell R815 BMC IPMI since 4.8

2016-11-29 Thread Gavin Shan
On Tue, Nov 29, 2016 at 07:57:51AM +0100, Brice Goglin wrote: >Hello > >My Dell PowerEdge R815 doesn't have IPMI anymore when I boot a 4.8 >kernel, the BMC doesn't even ping anymore. Its Ethernet devices are 4 of >those: > >01:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Giga

Re: [PATCH net 0/5] net/ncsi: More bug fixes

2016-10-19 Thread Gavin Shan
On Fri, Oct 14, 2016 at 01:53:29PM +1100, Gavin Shan wrote: >This series fixes 2 issues that were found during NCSI's availability >testing on BCM5718 and improves HNCDSC AEN handler: > > * PATCH[1] and PATCH[2] refactors the code so that minimal code > change is put to P

[PATCH v2 net 1/4] net/ncsi: Avoid if statements in ncsi_suspend_channel()

2016-10-19 Thread Gavin Shan
. Also, it becomes easy to add more states in the state machine without affecting current code. No logical changes introduced by this. Suggested-by: Joel Stanley Signed-off-by: Gavin Shan --- net/ncsi/ncsi-manage.c | 78 -- 1 file changed, 50

[PATCH v2 net 2/4] net/ncsi: Fix stale link state of inactive channels on failover

2016-10-19 Thread Gavin Shan
) is selected as active one as expected. Signed-off-by: Gavin Shan --- net/ncsi/internal.h| 1 + net/ncsi/ncsi-manage.c | 28 +++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/net/ncsi/internal.h b/net/ncsi/internal.h index 13290a7..eac4858 100644

[PATCH v2 net 4/4] net/ncsi: Improve HNCDSC AEN handler

2016-10-19 Thread Gavin Shan
This improves AEN handler for Host Network Controller Driver Status Change (HNCDSC): * The channel's lock should be hold when accessing its state. * Do failover when host driver isn't ready. * Configure channel when host driver becomes ready. Signed-off-by: Gavin Shan ---

[PATCH v2 net 3/4] net/ncsi: Choose hot channel as active one if necessary

2016-10-19 Thread Gavin Shan
is chosen to be active one if none of available channels in link-up state. With this, C0 is still the active one after unplugging C0's cable. LSC AEN packet received on C0 when plugging its cable back. Signed-off-by: Gavin Shan --- net/ncsi/internal.h| 1 + net/ncs

[PATCH v2 net 0/4] net/ncsi: More bug fixes

2016-10-19 Thread Gavin Shan
PATCH[v2 1]. * Avoid if/else statements in ncsi_suspend_channel() as Joel suggested. * Added comments to explain why we need retrieve last link states in ncsi_suspend_channel(). Gavin Shan (4): net/ncsi: Avoid if statements in ncsi_suspend_channel() net/ncsi: Fix stale link state o

Re: [PATCH net 4/5] net/ncsi: Choose hot channel as active one if necessary

2016-10-14 Thread Gavin Shan
On Fri, Oct 14, 2016 at 04:32:36PM +1030, Joel Stanley wrote: >On Fri, Oct 14, 2016 at 1:23 PM, Gavin Shan wrote: >> The issue was found on BCM5718 which has two NCSI channels in one >> package: C0 and C1. C0 is in link-up state while C1 is in link-down >> state. C0 is cho

Re: [PATCH net 3/5] net/ncsi: Fix stale link state of inactive channels on failover

2016-10-14 Thread Gavin Shan
On Fri, Oct 14, 2016 at 04:32:28PM +1030, Joel Stanley wrote: >On Fri, Oct 14, 2016 at 1:23 PM, Gavin Shan wrote: >> The issue was found on BCM5718 which has two NCSI channels in one >> package: C0 and C1. Both of them are connected to different LANs, >> means they are in li

Re: [PATCH net 2/5] net/ncsi: Split out logic for ncsi_dev_state_suspend_select

2016-10-14 Thread Gavin Shan
On Fri, Oct 14, 2016 at 04:32:22PM +1030, Joel Stanley wrote: >Hi Gavin, > >On Fri, Oct 14, 2016 at 1:23 PM, Gavin Shan wrote: >> This splits out the code that handles ncsi_dev_state_suspend_select >> so that we can add more code to the handler in subsequent patch. >>

[PATCH net 3/5] net/ncsi: Fix stale link state of inactive channels on failover

2016-10-13 Thread Gavin Shan
selected as active one as expected. Signed-off-by: Gavin Shan --- net/ncsi/internal.h| 1 + net/ncsi/ncsi-manage.c | 20 +++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/net/ncsi/internal.h b/net/ncsi/internal.h index 13290a7..eac4858 100644 --- a/net/ncsi

[PATCH net 2/5] net/ncsi: Split out logic for ncsi_dev_state_suspend_select

2016-10-13 Thread Gavin Shan
This splits out the code that handles ncsi_dev_state_suspend_select so that we can add more code to the handler in subsequent patch. Apart from adding a error tag to reuse the code in error path, no logical changes introduced. Signed-off-by: Gavin Shan --- net/ncsi/ncsi-manage.c | 38

[PATCH net 1/5] net/ncsi: Not fetch active package and channel again

2016-10-13 Thread Gavin Shan
In ncsi_suspend_channel(), we fetch the active package and channel to local variables for twice. It's unnecessary. This drops one of them. No functional changes introduced. Signed-off-by: Gavin Shan --- net/ncsi/ncsi-manage.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/ncsi

[PATCH net 0/5] net/ncsi: More bug fixes

2016-10-13 Thread Gavin Shan
fore doing failover. * PATCH[4] chooses the hot channel, which was ever chosen as active channel, when the available channels are all in link-down state. * PATCH[5] improves Host Network Controller Driver Status Change (HNCDSC) AEN handler Gavin Shan (5): net/ncsi: Not fetch active p

[PATCH net 5/5] net/ncsi: Improve HNCDSC AEN handler

2016-10-13 Thread Gavin Shan
This improves AEN handler for Host Network Controller Driver Status Change (HNCDSC): * The channel's lock should be hold when accessing its state. * Do failover when host driver isn't ready. * Configure channel when host driver becomes ready. Signed-off-by: Gavin Shan ---

[PATCH net 4/5] net/ncsi: Choose hot channel as active one if necessary

2016-10-13 Thread Gavin Shan
is chosen to be active one if none of available channels in link-up state. With this, C0 is still the active one after unplugging C0's cable. LSC AEN packet received on C0 when plugging its cable back. Signed-off-by: Gavin Shan --- net/ncsi/internal.h| 1 + net/ncs

[PATCH v2 net-next 6/8] net/ncsi: Rework the channel monitoring

2016-10-03 Thread Gavin Shan
annel monitoring is predefined. The channel is regarded alive if the network controller responses to one of two GLS commands or both of them in 5 seconds. Signed-off-by: Gavin Shan Reviewed-by: Joel Stanley --- net/ncsi/internal.h| 12 +--- net/ncsi/ncsi-manage.c

[PATCH v2 net-next 0/8] net/ncsi: NCSI Improvment and bug fixes

2016-10-03 Thread Gavin Shan
or will be seen. Changelog = v2: * The NCSI's lock is taken when reading or updating its state as the {READ,WRITE}_ONCE() isn't reliable. Gavin Shan (8): net/ncsi: Avoid unused-value build warning from ia64-linux-gcc net/ncsi: Introduce NCSI_RESERVED_CHANNEL net/ncsi: Don't

[PATCH v2 net-next 4/8] net/ncsi: Rework request index allocation

2016-10-03 Thread Gavin Shan
n round-robin fashion and ID#0 won't be assigned. Signed-off-by: Gavin Shan Reviewed-by: Joel Stanley --- net/ncsi/internal.h| 1 + net/ncsi/ncsi-manage.c | 17 + 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/net/ncsi/internal.h b/net/ncsi/internal.h inde

[PATCH v2 net-next 2/8] net/ncsi: Introduce NCSI_RESERVED_CHANNEL

2016-10-03 Thread Gavin Shan
This defines NCSI_RESERVED_CHANNEL as the reserved NCSI channel ID (0x1f). No logical changes introduced. Signed-off-by: Gavin Shan Reviewed-by: Joel Stanley --- net/ncsi/internal.h| 1 + net/ncsi/ncsi-manage.c | 14 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff

[PATCH v2 net-next 8/8] net/faraday: Stop NCSI device on shutdown

2016-10-03 Thread Gavin Shan
This stops NCSI device when closing the network device so that the NCSI device can be reenabled later. Signed-off-by: Gavin Shan Reviewed-by: Joel Stanley --- drivers/net/ethernet/faraday/ftgmac100.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c

[PATCH v2 net-next 5/8] net/ncsi: Allow to extend NCSI request properties

2016-10-03 Thread Gavin Shan
command argument struct. Each bit of the newly introduced field can be used for one property. No functional changes introduced. Signed-off-by: Gavin Shan Reviewed-by: Joel Stanley --- net/ncsi/internal.h| 8 +--- net/ncsi/ncsi-cmd.c| 2 +- net/ncsi/ncsi-manage.c | 19

[PATCH v2 net-next 1/8] net/ncsi: Avoid unused-value build warning from ia64-linux-gcc

2016-10-03 Thread Gavin Shan
7;xchg' xchg(&nc->state, NCSI_CHANNEL_INACTIVE); This removes the atomic access to NCSI channel's state avoid the above build warning. We have to hold the channel's lock when its state is readed or updated. No functional changes introduced. Signed-off-by: Gavin Shan Reviewed-by:

[PATCH v2 net-next 3/8] net/ncsi: Don't probe on the reserved channel ID (0x1f)

2016-10-03 Thread Gavin Shan
We needn't send CIS (Clear Initial State) command to the NCSI reserved channel (0x1f) in the enumeration. We shouldn't receive a valid response from CIS on NCSI channel 0x1f. Signed-off-by: Gavin Shan Reviewed-by: Joel Stanley --- net/ncsi/ncsi-manage.c | 4 ++-- 1 file changed, 2

[PATCH v2 net-next 7/8] net/ncsi: Introduce ncsi_stop_dev()

2016-10-03 Thread Gavin Shan
channels to inactive state; Report NCSI link down. Signed-off-by: Gavin Shan Reviewed-by: Joel Stanley --- include/net/ncsi.h | 5 + net/ncsi/ncsi-manage.c | 37 - 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/include/net/ncsi.h b

Re: [PATCH net-next 1/8] net/ncsi: Avoid unused-value build warning from ia64-linux-gcc

2016-09-29 Thread Gavin Shan
On Thu, Sep 29, 2016 at 01:54:04AM -0400, David Miller wrote: >From: Gavin Shan >Date: Thu, 29 Sep 2016 15:03:08 +1000 > >> This replaces the atomic access to NCSI channel's state with READ_ONCE() >> and WRITE_ONCE() to avoid the above build warning. We needn't

[PATCH net-next 7/8] net/ncsi: Introduce ncsi_stop_dev()

2016-09-28 Thread Gavin Shan
channels to inactive state; Report NCSI link down. Signed-off-by: Gavin Shan Reviewed-by: Joel Stanley --- include/net/ncsi.h | 5 + net/ncsi/ncsi-manage.c | 33 ++--- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/include/net/ncsi.h b

[PATCH net-next 8/8] net/faraday: Stop NCSI device on shutdown

2016-09-28 Thread Gavin Shan
This stops NCSI device when closing the network device so that the NCSI device can be reenabled later. Signed-off-by: Gavin Shan Reviewed-by: Joel Stanley --- drivers/net/ethernet/faraday/ftgmac100.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c

[PATCH net-next 0/8] net/ncsi: NCSI Improvment and bug fixes

2016-09-28 Thread Gavin Shan
8] reworks the channel monitoring to improve the code readability and its robustness. * PATCH[7/8] and PATCH[8/8] introduces ncsi_stop_dev() so that the network device can be closed and opened afterwards. No error will be seen. Gavin Shan (8): net/ncsi: Avoid unused-value build warning

[PATCH net-next 1/8] net/ncsi: Avoid unused-value build warning from ia64-linux-gcc

2016-09-28 Thread Gavin Shan
7;xchg' xchg(&nc->state, NCSI_CHANNEL_INACTIVE); This replaces the atomic access to NCSI channel's state with READ_ONCE() and WRITE_ONCE() to avoid the above build warning. We needn't hold the channel's lock when updating its state as well. No logical changes introduced.

[PATCH net-next 6/8] net/ncsi: Rework the channel monitoring

2016-09-28 Thread Gavin Shan
annel monitoring is predefined. The channel is regarded alive if the network controller responses to one of two GLS commands or both of them in 5 seconds. Signed-off-by: Gavin Shan Reviewed-by: Joel Stanley --- net/ncsi/internal.h| 12 +--- net/ncsi/ncsi-manage.c

[PATCH net-next 5/8] net/ncsi: Allow to extend NCSI request properties

2016-09-28 Thread Gavin Shan
command argument struct. Each bit of the newly introduced field can be used for one property. No functional changes introduced. Signed-off-by: Gavin Shan Reviewed-by: Joel Stanley --- net/ncsi/internal.h| 8 +--- net/ncsi/ncsi-cmd.c| 2 +- net/ncsi/ncsi-manage.c | 19

[PATCH net-next 4/8] net/ncsi: Rework request index allocation

2016-09-28 Thread Gavin Shan
n round-robin fashion and ID#0 won't be assigned. Signed-off-by: Gavin Shan Reviewed-by: Joel Stanley --- net/ncsi/internal.h| 1 + net/ncsi/ncsi-manage.c | 17 + 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/net/ncsi/internal.h b/net/ncsi/internal.h inde

[PATCH net-next 3/8] net/ncsi: Don't probe on the reserved channel ID (0x1f)

2016-09-28 Thread Gavin Shan
We needn't send CIS (Clear Initial State) command to the NCSI reserved channel (0x1f) in the enumeration. We shouldn't receive a valid response from CIS on NCSI channel 0x1f. Signed-off-by: Gavin Shan Reviewed-by: Joel Stanley --- net/ncsi/ncsi-manage.c | 4 ++-- 1 file changed, 2

[PATCH net-next 2/8] net/ncsi: Introduce NCSI_RESERVED_CHANNEL

2016-09-28 Thread Gavin Shan
This defines NCSI_RESERVED_CHANNEL as the reserved NCSI channel ID (0x1f). No logical changes introduced. Signed-off-by: Gavin Shan Reviewed-by: Joel Stanley --- net/ncsi/internal.h| 1 + net/ncsi/ncsi-manage.c | 14 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff

  1   2   >