Re: [PATCH V2 net] ibmvnic: Continue with reset if set link down failed

2021-04-20 Thread Lijun Pan
> On Apr 20, 2021, at 4:35 PM, Dany Madden wrote: > > When ibmvnic gets a FATAL error message from the vnicserver, it marks > the Command Respond Queue (CRQ) inactive and resets the adapter. If this > FATAL reset fails and a transmission timeout reset follows, the CRQ is > still inactive, ibmv

[PATCH net] MAINTAINERS: update

2021-04-19 Thread Lijun Pan
. Please remove yourself completely from the maintainers file. I grant you a 1 time exception on contributions to VNIC to make this change." Signed-off-by: Lijun Pan --- MAINTAINERS | 1 - 1 file changed, 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 95e6766718b0..933a6f3c2369 1006

[PATCH net] MAINTAINERS: update my email

2021-04-15 Thread Lijun Pan
Update my email and change myself to Reviewer. Signed-off-by: Lijun Pan --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 795b9941c151..ea76d35757bf 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8521,9 +8521,9 @@ F

Re: [PATCH net v2] net: core: make napi_disable more robust

2021-04-14 Thread Lijun Pan
On Wed, Apr 14, 2021 at 3:45 AM Yunsheng Lin wrote: > > On 2021/4/14 16:08, Lijun Pan wrote: > > There are chances that napi_disable can be called twice by NIC driver. > > This could generate deadlock. For example, > > the first napi_disable will spin until NAPI_STATE

[PATCH net v2] net: core: make napi_disable more robust

2021-04-14 Thread Lijun Pan
ake sure that if napi is already disabled, we exit the call early enough to avoid spinning infinitely. Fixes: bea3348eef27 ("[NET]: Make NAPI polling independent of struct net_device objects.") Signed-off-by: Lijun Pan --- v2: justify that this patch makes napi_disable more robust. n

[PATCH net 0/3] ibmvnic: correctly call NAPI APIs

2021-04-14 Thread Lijun Pan
This series correct some misuse of NAPI APIs in the driver. Lijun Pan (3): ibmvnic: avoid calling napi_disable() twice ibmvnic: remove duplicate napi_schedule call in do_reset function ibmvnic: remove duplicate napi_schedule call in open function drivers/net/ethernet/ibm/ibmvnic.c | 14

[PATCH net 1/3] ibmvnic: avoid calling napi_disable() twice

2021-04-14 Thread Lijun Pan
xes: bfc32f297337 ("ibmvnic: Move resource initialization to its own routine") Suggested-by: Thomas Falcon Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net

[PATCH net 2/3] ibmvnic: remove duplicate napi_schedule call in do_reset function

2021-04-14 Thread Lijun Pan
edule will neglect the request if napi is already scheduled. Fixes: ed651a10875f ("ibmvnic: Updated reset handling") Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/

[PATCH net 3/3] ibmvnic: remove duplicate napi_schedule call in open function

2021-04-14 Thread Lijun Pan
Remove the unnecessary napi_schedule() call in __ibmvnic_open() since interrupt_rx() calls napi_schedule_prep/__napi_schedule during every receive interrupt. Fixes: ed651a10875f ("ibmvnic: Updated reset handling") Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 5 ---

[PATCH net-next v2] ibmvnic: queue reset work in system_long_wq

2021-04-13 Thread Lijun Pan
users. So, queue the relatively slow reset job to the system_long_wq. Suggested-by: Nathan Lynch Signed-off-by: Lijun Pan --- v2: reword the commit message to justify why we do this. drivers/net/ethernet/ibm/ibmvnic.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dr

[PATCH net] ibmvnic: correctly use dev_consume/free_skb_irq

2021-04-13 Thread Lijun Pan
It is more correct to use dev_kfree_skb_irq when packets are dropped, and to use dev_consume_skb_irq when packets are consumed. Fixes: 0d973388185d ("ibmvnic: Introduce xmit_more support using batched subCRQ hcalls") Suggested-by: Thomas Falcon Signed-off-by: Lijun Pan --- d

[PATCH net-next] ibmvnic: queue reset work in system_long_wq

2021-04-13 Thread Lijun Pan
-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 3773dc97e63d..bbe45063b443 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b

[PATCH net-next v2] ibmvnic: improve failover sysfs entry

2021-04-13 Thread Lijun Pan
rc 6". Add a last resort, that is to schedule a failover reset via CRQ command. Signed-off-by: Lijun Pan --- v2: reword commit message drop v1 series' patch 2 and send this patch alone. drivers/net/ethernet/ibm/ibmvnic.c | 14 -- 1 file changed, 8 insertions(+), 6 del

Re: [PATCH net-next 2/2] ibmvnic: add sysfs entry for timeout and fatal reset

2021-04-12 Thread Lijun Pan
On Mon, Apr 12, 2021 at 1:23 PM Jakub Kicinski wrote: > > On Mon, 12 Apr 2021 02:43:30 -0500 Lijun Pan wrote: > > Add timeout and fatal reset sysfs entries so that both functions > > can be triggered manually the tested. Otherwise, you have to run > > the program for en

[PATCH net-next 2/2] ibmvnic: add sysfs entry for timeout and fatal reset

2021-04-12 Thread Lijun Pan
Add timeout and fatal reset sysfs entries so that both functions can be triggered manually the tested. Otherwise, you have to run the program for enough time and check both randomly generated resets in the long long log. Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 50

[PATCH net-next 1/2] ibmvnic: improve failover sysfs entry

2021-04-12 Thread Lijun Pan
t, that is to schedule a failover reset via CRQ command. Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index ee9bf18c597f..d44a7b5b8

[PATCH net-next 0/2] ibmvnic: sysfs changes

2021-04-12 Thread Lijun Pan
Patch 1 improves the failover sysfs entry. Patch 2 adds sysfs entry for timeout and fatal resets. Lijun Pan (2): ibmvnic: improve failover sysfs entry ibmvnic: add sysfs entry for timeout and fatal reset drivers/net/ethernet/ibm/ibmvnic.c | 56 +++--- 1 file changed

[PATCH net-next 2/2] ibmvnic: print adapter state as a string

2021-04-12 Thread Lijun Pan
The adapter state can be added or deleted over different versions of the source code. Print a string instead of a number. Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 67 ++ 1 file changed, 49 insertions(+), 18 deletions(-) diff --git a/drivers

[PATCH net-next 0/2] ibmvnic: improve error printing

2021-04-12 Thread Lijun Pan
Patch 1 prints reset reason as a string. Patch 2 prints adapter state as a string. Lijun Pan (2): ibmvnic: print reset reason as a string ibmvnic: print adapter state as a string drivers/net/ethernet/ibm/ibmvnic.c | 98 +++--- 1 file changed, 75 insertions(+), 23

[PATCH net-next 1/2] ibmvnic: print reset reason as a string

2021-04-12 Thread Lijun Pan
The reset reason can be added or deleted over different versions of the source code. Print a string instead of a number. Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 35 -- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/drivers

[PATCH net-next] ibmvnic: clean up the remaining debugfs data structures

2021-04-12 Thread Lijun Pan
Commit e704f0434ea6 ("ibmvnic: Remove debugfs support") did not clean up everything. Remove the remaining code. Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.h | 94 -- 1 file changed, 94 deletions(-) diff --git a/drivers/net/ethernet/ibm

Re: [PATCH] ibmvnic: Continue with reset if set link down failed

2021-04-05 Thread Lijun Pan
> On Apr 5, 2021, at 10:47 PM, Dany Madden wrote: > > When an adapter is going thru a reset, it maybe in an unstable state that > makes a request to set link down fail. In such a case, the adapter needs > to continue on with reset to bring itself back to a stable state. > > Fixes: ed651a10875

[PATCH net] net: core: avoid napi_disable to cause deadlock

2021-03-18 Thread Lijun Pan
ugh to avoid spinning infinitely. Fixes: bea3348eef27 ("[NET]: Make NAPI polling independent of struct net_device objects.") Signed-off-by: Lijun Pan --- net/core/dev.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/net/core/dev.c b/net/core/dev.c index

[PATCH net] ibmvnic: update MAINTAINERS

2021-03-12 Thread Lijun Pan
Tom wrote most of the driver code and his experience is valuable to us. Add him as a Reviewer so that patches will be Cc'ed and reviewed by him. Signed-off-by: Lijun Pan --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 47ae27f

Re: [RFC PATCH net] ibmvnic: complete dev->poll nicely during adapter reset

2021-03-05 Thread Lijun Pan
On Fri, Mar 5, 2021 at 12:44 PM Sukadev Bhattiprolu wrote: > > Lijun Pan [l...@linux.ibm.com] wrote: > > The reset path will call ibmvnic_cleanup->ibmvnic_napi_disable > > ->napi_disable(). This is supposed to stop the polling. > > Commit 21ecba6c48f9 ("ibmv

[RFC PATCH net] ibmvnic: complete dev->poll nicely during adapter reset

2021-03-04 Thread Lijun Pan
afterwards. Hence we call napi_complete in ibmvnic_napi_disable, which avoids the racing with resetting, and makes sure dev->poll and napi_disalbe completes before reset routine actually releases resources. Fixes: 21ecba6c48f9 ("ibmvnic: Exit polling routine correctly during adapter re

Re: [PATCH] ibmvnic: remove excessive irqsave

2021-03-04 Thread Lijun Pan
> On Mar 4, 2021, at 11:49 PM, Christophe Leroy > wrote: > > > > Le 05/03/2021 à 02:43, angkery a écrit : >> From: Junlin Yang >> ibmvnic_remove locks multiple spinlocks while disabling interrupts: >> spin_lock_irqsave(&adapter->state_lock, flags); >> spin_lock_irqsave(&adapter->rwi_lock,

[PATCH net] ibmvnic: skip send_request_unmap for timeout reset

2021-02-12 Thread Lijun Pan
uot;ibmvnic: Updated reset handling") Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 621be6d2da97..c8b0d99608d5 100644 -

[PATCH net] ibmvnic: add memory barrier to protect long term buffer

2021-02-12 Thread Lijun Pan
dma_rmb() barrier is added to load the long term buffer before copying it to socket buffer; and dma_wmb() barrier is added to update the long term buffer before it being accessed by VIOS (virtual i/o server). Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol") Signed-off-by:

[PATCH net-next] ibmvnic: substitute mb() with dma_wmb() for send_*crq* functions

2021-02-12 Thread Lijun Pan
The CRQ and subCRQ descriptors are DMA mapped, so dma_wmb(), though weaker, is good enough to protect the data structures. Signed-off-by: Lijun Pan Acked-by: Thomas Falcon --- drivers/net/ethernet/ibm/ibmvnic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net

[PATCH net-next] ibmvnic: simplify reset_long_term_buff function

2021-02-12 Thread Lijun Pan
The only thing reset_long_term_buff() should do is set buffer to zero. After doing that, it is not necessary to send_request_map again to VIOS since it actually does not change the mapping. So, keep memset function and remove all others. Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm

[PATCH net-next v2 8/8] ibmvnic: prefer strscpy over strlcpy

2021-02-10 Thread Lijun Pan
Fix this warning: WARNING: Prefer strscpy over strlcpy - see: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=v6a6g1ouzcprm...@mail.gmail.com/ Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[PATCH net-next v2 7/8] ibmvnic: remove unused spinlock_t stats_lock definition

2021-02-10 Thread Lijun Pan
stats_lock is no longer used. So remove it. Signed-off-by: Lijun Pan Reviewed-by: Saeed Mahameed --- drivers/net/ethernet/ibm/ibmvnic.c | 2 -- drivers/net/ethernet/ibm/ibmvnic.h | 1 - 2 files changed, 3 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm

[PATCH net-next v2 6/8] ibmvnic: add comments for spinlock_t definitions

2021-02-10 Thread Lijun Pan
There are several spinlock_t definitions without comments. Add them. Signed-off-by: Lijun Pan Reviewed-by: Saeed Mahameed --- drivers/net/ethernet/ibm/ibmvnic.h | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net

[PATCH net-next v2 5/8] ibmvnic: fix miscellaneous checks

2021-02-10 Thread Lijun Pan
7;}' CHECK: Please use a blank line after function/struct/union/enum declarations CHECK: Unnecessary parentheses around 'rc != H_FUNCTION' Signed-off-by: Lijun Pan Reviewed-by: Saeed Mahameed --- drivers/net/ethernet/ibm/ibmvnic.c | 17 + 1 file changed, 9 insertions

[PATCH net-next v2 4/8] ibmvnic: avoid multiple line dereference

2021-02-10 Thread Lijun Pan
Fix the following checkpatch warning: WARNING: Avoid multiple line dereference Signed-off-by: Lijun Pan Reviewed-by: Saeed Mahameed --- drivers/net/ethernet/ibm/ibmvnic.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b

[PATCH net-next v2 3/8] ibmvnic: fix braces

2021-02-10 Thread Lijun Pan
Fix the following checkpatch warning: WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Lijun Pan Reviewed-by: Saeed Mahameed --- drivers/net/ethernet/ibm/ibmvnic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ibm

[PATCH net-next v2 0/8] a set of fixes of coding style

2021-02-10 Thread Lijun Pan
This series address several coding style problems. v2: rebased on top of tree. Add the Reviewed-by tag from v1 reviews. patch 8/8 is new. Lijun Pan (8): ibmvnic: prefer 'unsigned long' over 'unsigned long int' ibmvnic: fix block comments ibmvnic: fix braces ibm

[PATCH net-next v2 1/8] ibmvnic: prefer 'unsigned long' over 'unsigned long int'

2021-02-10 Thread Lijun Pan
Fix the following checkpatch warnings: WARNING: Prefer 'unsigned long' over 'unsigned long int' as the int is unnecessary WARNING: Prefer 'long' over 'long int' as the int is unnecessary Signed-off-by: Lijun Pan Reviewed-by: Saeed Mahameed ---

[PATCH net-next v2 2/8] ibmvnic: fix block comments

2021-02-10 Thread Lijun Pan
Fix the following checkpatch warning: WARNING: networking block comments don't use an empty /* line, use /* Comment... Signed-off-by: Lijun Pan Reviewed-by: Saeed Mahameed --- drivers/net/ethernet/ibm/ibmvnic.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --

Re: [PATCH 1/1] ibmvnic: fix a race between open and reset

2021-02-10 Thread Lijun Pan
On Wed, Feb 10, 2021 at 7:44 PM Sukadev Bhattiprolu wrote: > > __ibmvnic_reset() currently reads the adapter->state before getting the > rtnl and saves that state as the "target state" for the reset. If this > read occurs when adapter is in PROBED state, the target state would be > PROBED. > > Jus

[PATCH net-next v2 0/2] rework the memory barrier for SCRQ entry

2021-01-30 Thread Lijun Pan
This series rework the memory barrier for SCRQ (Sub-Command-Response Queue) entry. v2: send to net-next. Lijun Pan (2): ibmvnic: rework to ensure SCRQ entry reads are properly ordered ibmvnic: remove unnecessary rmb() inside ibmvnic_poll drivers/net/ethernet/ibm/ibmvnic.c | 31

[PATCH net-next v2 2/2] ibmvnic: remove unnecessary rmb() inside ibmvnic_poll

2021-01-30 Thread Lijun Pan
rmb() can be removed since: 1. pending_scrq() has dma_rmb() at the function end; 2. dma_rmb(), though weaker, is enough here. Signed-off-by: Lijun Pan Acked-by: Dwip Banerjee Acked-by: Thomas Falcon Reviewed-by: Brian King --- drivers/net/ethernet/ibm/ibmvnic.c | 1 - 1 file changed, 1

[PATCH net-next v2 1/2] ibmvnic: rework to ensure SCRQ entry reads are properly ordered

2021-01-29 Thread Lijun Pan
Move the dma_rmb() between pending_scrq() and ibmvnic_next_scrq() into the end of pending_scrq() to save the duplicated code since this dma_rmb will be used 3 times. Signed-off-by: Lijun Pan Acked-by: Thomas Falcon --- drivers/net/ethernet/ibm/ibmvnic.c | 30 +++--- 1

Re: [PATCH] vio: make remove callback return void

2021-01-29 Thread Lijun Pan
r vio_bus_remove() returns > calling this unconditionally is the consistent behaviour which is > implemented here. > > Signed-off-by: Uwe Kleine-König Acked-by: Lijun Pan

[PATCH net v2] ibmvnic: device remove has higher precedence over reset

2021-01-28 Thread Lijun Pan
rg/linuxppc-dev/20210117101242.dpwayq6wdgfdz...@pengutronix.de/T/#m48f5befd96bc9842ece2a3ad14f4c27747206a53 Reported-by: Uwe Kleine-König Fixes: 7d7195a026ba ("ibmvnic: Do not process device remove during device reset") Signed-off-by: Lijun Pan --- v2: drop v1's deletion of REMOVIN

Re: [PATCH net v2] ibmvnic: Ensure that CRQ entry read are correctly ordered

2021-01-27 Thread Lijun Pan
On Wed, Jan 27, 2021 at 7:31 PM Jakub Kicinski wrote: > > On Wed, 27 Jan 2021 19:22:25 -0600 Lijun Pan wrote: > > On Wed, Jan 27, 2021 at 7:06 PM Jakub Kicinski wrote: > > > > > > On Mon, 25 Jan 2021 17:20:23 -0600 Lijun Pan wrote: > > > > Ensure

[PATCH net v3] ibmvnic: Ensure that CRQ entry read are correctly ordered

2021-01-27 Thread Lijun Pan
t;) Signed-off-by: Lijun Pan --- v3: reword the comments in the code to make it less confusing. v2: drop dma_wmb according to Jakub's opinion drivers/net/ethernet/ibm/ibmvnic.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/etherne

Re: [PATCH net v2] ibmvnic: Ensure that CRQ entry read are correctly ordered

2021-01-27 Thread Lijun Pan
On Wed, Jan 27, 2021 at 7:06 PM Jakub Kicinski wrote: > > On Mon, 25 Jan 2021 17:20:23 -0600 Lijun Pan wrote: > > Ensure that received Command-Response Queue (CRQ) entries are > > properly read in order by the driver. dma_rmb barrier has > > been added before accessi

[PATCH net v2] ibmvnic: Ensure that CRQ entry read are correctly ordered

2021-01-25 Thread Lijun Pan
t;) Signed-off-by: Lijun Pan --- v2: drop dma_wmb according to Jakub's opinion drivers/net/ethernet/ibm/ibmvnic.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 9778c83150f1..d84369bd5fc9 100644 --

Re: [PATCH net 2/3] ibmvnic: remove unnecessary rmb() inside ibmvnic_poll

2021-01-24 Thread Lijun Pan
On Sat, Jan 23, 2021 at 11:11 PM Jakub Kicinski wrote: > > On Thu, 21 Jan 2021 00:17:09 -0600 Lijun Pan wrote: > > rmb() was introduced to load rx_scrq->msgs after calling > > pending_scrq(). Now since pending_scrq() itself already > > has dma_rmb() at the en

Re: [PATCH net 1/3] ibmvnic: rework to ensure SCRQ entry reads are properly ordered

2021-01-24 Thread Lijun Pan
On Sat, Jan 23, 2021 at 11:10 PM Jakub Kicinski wrote: > > On Thu, 21 Jan 2021 00:17:08 -0600 Lijun Pan wrote: > > Move the dma_rmb() between pending_scrq() and ibmvnic_next_scrq() > > into the end of pending_scrq(), and explain why. > > Explain in detail why the dma_rmb()

Re: [PATCH net] ibmvnic: device remove has higher precedence over reset

2021-01-21 Thread Lijun Pan
> > diff --git a/drivers/net/ethernet/ibm/ibmvnic.c > > b/drivers/net/ethernet/ibm/ibmvnic.c > > index aed985e08e8a..11f28fd03057 100644 > > --- a/drivers/net/ethernet/ibm/ibmvnic.c > > +++ b/drivers/net/ethernet/ibm/ibmvnic.c > > @@ -2235,8 +2235,7 @@ static void __ibmvnic_reset(struct work_struct

Re: [PATCH net] ibmvnic: device remove has higher precedence over reset

2021-01-21 Thread Lijun Pan
On Thu, Jan 21, 2021 at 12:42 PM Dany Madden wrote: > > On 2021-01-20 22:20, Lijun Pan wrote: > > Returning -EBUSY in ibmvnic_remove() does not actually hold the > > removal procedure since driver core doesn't care for the return > > value (see __device_release_

[PATCH net 2/3] ibmvnic: remove unnecessary rmb() inside ibmvnic_poll

2021-01-20 Thread Lijun Pan
Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 8e043683610f..933e8fb71a8b 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/

[PATCH net 1/3] ibmvnic: rework to ensure SCRQ entry reads are properly ordered

2021-01-20 Thread Lijun Pan
ned-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 41 +- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 9778c83150f1..8e043683610f 100644 --- a/drivers/net/et

[PATCH net] ibmvnic: device remove has higher precedence over reset

2021-01-20 Thread Lijun Pan
Reported-by: Uwe Kleine-König Fixes: 7d7195a026ba ("ibmvnic: Do not process device remove during device reset") Signed-off-by: Lijun Pan --- v1 versus RFC: 1/ articulate why remove the REMOVING checking in __ibmvnic_reset and why keep the current checking for REMOVING in ibmvnic_re

[PATCH net 3/3] ibmvnic: Ensure that CRQ entry read/write are correctly ordered

2021-01-20 Thread Lijun Pan
written before future processing. Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol") Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/et

[PATCH net 0/3] fixes the memory barrier for SCRQ/CRQ entry

2021-01-20 Thread Lijun Pan
This series rework/fix the memory barrier for SCRQ (Sub-Command-Response Queue) and CRQ (Command-Response Queue) entries. This series does not have merge conflict with Suka's https://lists.openwall.net/netdev/2021/01/08/89 Lijun Pan (3): ibmvnic: rework to ensure SCRQ entry reads are pro

Re: [PATCH net RFC] ibmvnic: device remove has higher precedence over reset

2021-01-19 Thread Lijun Pan
On Tue, Jan 19, 2021 at 1:56 PM Uwe Kleine-König wrote: > > On Tue, Jan 19, 2021 at 01:33:13PM -0600, Lijun Pan wrote: > > Returning -EBUSY in ibmvnic_remove() does not actually hold the > > removal procedure since driver core doesn't care for the return > > value

[PATCH net RFC] ibmvnic: device remove has higher precedence over reset

2021-01-19 Thread Lijun Pan
ng device reset") Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index aed985e08e8a..11f28fd03057 100644 --- a/drivers/net/etherne

Re: [PATCH net-next 0/7] a set of fixes of coding style

2021-01-12 Thread Lijun Pan
On Tue, Jan 12, 2021 at 5:54 PM Jakub Kicinski wrote: > > On Tue, 12 Jan 2021 00:42:58 -0600 Lijun Pan wrote: > > This series address several coding style problems. > > Erm, are you sure this series will not conflict with the fixes > Sukadev is sending? Maybe one or two i

[PATCH net-next 7/7] ibmvnic: remove unused spinlock_t stats_lock definition

2021-01-11 Thread Lijun Pan
stats_lock is no longer used. So remove it. Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 2 -- drivers/net/ethernet/ibm/ibmvnic.h | 1 - 2 files changed, 3 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index f9db139f652b

[PATCH net-next 5/7] ibmvnic: fix miscellaneous checks

2021-01-11 Thread Lijun Pan
7;}' CHECK: Please use a blank line after function/struct/union/enum declarations CHECK: Unnecessary parentheses around 'rc != H_FUNCTION' Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff

[PATCH net-next 6/7] ibmvnic: add comments for spinlock_t definitions

2021-01-11 Thread Lijun Pan
There are several spinlock_t definitions without comments. Add them. Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.h | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h index

[PATCH net-next 1/7] ibmvnic: prefer 'unsigned long' over 'unsigned long int'

2021-01-11 Thread Lijun Pan
Fix the following checkpatch warnings: WARNING: Prefer 'unsigned long' over 'unsigned long int' as the int is unnecessary WARNING: Prefer 'long' over 'long int' as the int is unnecessary Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c

[PATCH net-next 4/7] ibmvnic: avoid multiple line dereference

2021-01-11 Thread Lijun Pan
Fix the following checkpatch warning: WARNING: Avoid multiple line dereference Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm

[PATCH net-next 2/7] ibmvnic: fix block comments

2021-01-11 Thread Lijun Pan
Fix the following checkpatch warning: WARNING: networking block comments don't use an empty /* line, use /* Comment... Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/etherne

[PATCH net-next 0/7] a set of fixes of coding style

2021-01-11 Thread Lijun Pan
This series address several coding style problems. Lijun Pan (7): ibmvnic: prefer 'unsigned long' over 'unsigned long int' ibmvnic: fix block comments ibmvnic: fix braces ibmvnic: avoid multiple line dereference ibmvnic: fix miscellaneous checks ibmvnic: add com

[PATCH net-next 3/7] ibmvnic: fix braces

2021-01-11 Thread Lijun Pan
Fix the following checkpatch warning: WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet

[PATCH net-next] ibmvnic: merge do_change_param_reset into do_reset

2021-01-06 Thread Lijun Pan
elf. Hence merge do_change_param_reset back into do_reset to clean up the code. Signed-off-by: Lijun Pan --- This patch was accepted into net-next as 16b5f5ce351f but was reverted in 9f32c27eb4fc to yield to other under-testing patches. Since those bug fix patches are already accepted, resubmi

Re: [PATCH] ibmvnic: fix: NULL pointer dereference.

2020-12-30 Thread Lijun Pan
scrq->irq, scrq->msgs); > return -EINVAL; > } > > If the expression is true, scrq must be a null pointer and cannot > dereference. > > Signed-off-by: YANG LI > Reported-by: Abaci > --- Acked-by: Lijun Pan

[PATCH net v2] ibmvnic: continue fatal error reset after passive init

2020-12-23 Thread Lijun Pan
_crq_queues"). With above two fixes, there are no more crashes seen as described even without the original commit, so I would like to revert the original commit. Fixes: f9c6cea0b385 ("ibmvnic: Skip fatal error reset after passive init") Signed-off-by: Lijun Pan --- v2: reword the

Re: [PATCH net] ibmvnic: continue fatal error reset after passive init

2020-12-23 Thread Lijun Pan
On Wed, Dec 23, 2020 at 10:50 AM Jakub Kicinski wrote: > > On Wed, 23 Dec 2020 02:21:09 -0600 Lijun Pan wrote: > > On Tue, Dec 22, 2020 at 8:48 PM Jakub Kicinski wrote: > > > On Sat, 19 Dec 2020 15:40:34 -0600 Lijun Pan wrote: > > > > Commit f9c6cea0b385 ("

Re: [PATCH net] ibmvnic: continue fatal error reset after passive init

2020-12-23 Thread Lijun Pan
On Tue, Dec 22, 2020 at 8:48 PM Jakub Kicinski wrote: > > On Sat, 19 Dec 2020 15:40:34 -0600 Lijun Pan wrote: > > Commit f9c6cea0b385 ("ibmvnic: Skip fatal error reset after passive init") > > says "If the passive > > CRQ initialization occurs before the

[PATCH net] ibmvnic: continue fatal error reset after passive init

2020-12-19 Thread Lijun Pan
l see similar kernel crashes. In order to completely solve this problem, we'd better continue the fatal error reset, capture the kernel crash, and try to fix it from that end. Fixes: f9c6cea0b385 ("ibmvnic: Skip fatal error reset after passive init") Signed-off-by: Lijun Pan ---

[PATCH net] ibmvnic: fix login buffer memory leak

2020-12-19 Thread Lijun Pan
if buffer is already freed. Fixes: f3ae59c0c015 ("ibmvnic: store RX and TX subCRQ handle array in ibmvnic_adapter struct") Fixes: 34f0f4e3f488 ("ibmvnic: Fix login buffer memory leaks") Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 3 +++ 1 file changed, 3

[PATCH net-next] ibmvnic: merge do_change_param_reset into do_reset

2020-12-15 Thread Lijun Pan
elf. Hence merge do_change_param_reset back into do_reset to clean up the code. Signed-off-by: Lijun Pan --- This patch was accepted into net-next as 16b5f5ce351f but was reverted in 9f32c27eb4fc to yield to other under-testing patches. Since those bug fix patches are already accepted, resubmi

[PATCH net-next v2 3/3] use __netdev_notify_peers in hyperv

2020-12-14 Thread Lijun Pan
Start to use the lockless version of netdev_notify_peers. Call the helper where notify variable used to be set true. Remove the notify bool variable and sort the variables in reverse Christmas tree order. Cc: Haiyang Zhang Signed-off-by: Lijun Pan --- v2: call the helper where notify variable

[PATCH net-next v2 0/3] lockless version of netdev_notify_peers

2020-12-14 Thread Lijun Pan
set true. Lijun Pan (3): net: core: introduce __netdev_notify_peers use __netdev_notify_peers in ibmvnic use __netdev_notify_peers in hyperv drivers/net/ethernet/ibm/ibmvnic.c | 9 +++-- drivers/net/hyperv/netvsc_drv.c| 11 --- include/linux/netdevice.h | 1 + net

[PATCH net-next v2 1/3] net: core: introduce __netdev_notify_peers

2020-12-14 Thread Lijun Pan
); After that, convert netdev_notify_peers to call the new helper. Suggested-by: Nathan Lynch Signed-off-by: Lijun Pan --- include/linux/netdevice.h | 1 + net/core/dev.c| 22 -- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/include/linux

[PATCH net-next v2 2/3] use __netdev_notify_peers in ibmvnic

2020-12-14 Thread Lijun Pan
Start to use the lockless version of netdev_notify_peers. Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index a2191392ca4f

[PATCH net-next 1/3] net: core: introduce __netdev_notify_peers

2020-12-08 Thread Lijun Pan
); After that, convert netdev_notify_peers to call the new helper. Suggested-by: Nathan Lynch Signed-off-by: Lijun Pan --- include/linux/netdevice.h | 1 + net/core/dev.c| 22 -- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/include/linux

[PATCH net-next 2/3] use __netdev_notify_peers in ibmvnic

2020-12-08 Thread Lijun Pan
Start to use the lockless version of netdev_notify_peers. Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index cb701a6c0712

[PATCH net-next 3/3] use __netdev_notify_peers in hyperv

2020-12-08 Thread Lijun Pan
Start to use the lockless version of netdev_notify_peers. Cc: Haiyang Zhang Signed-off-by: Lijun Pan --- drivers/net/hyperv/netvsc_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index

[PATCH net-next 0/3] lockless version of netdev_notify_peers

2020-12-08 Thread Lijun Pan
This series introduce the lockless version of netdev_notify_peers and then apply it to the relevant drivers. In v1, a more appropriate name __netdev_notify_peers is used; netdev_notify_peers is converted to call the new helper. Lijun Pan (3): net: core: introduce __netdev_notify_peers use

[RFC PATCH net-next 2/3] use netdev_notify_peers_locked in ibmvnic

2020-12-05 Thread Lijun Pan
Start to use the lockless version of netdev_notify_peers. Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index df589ad6f271

[RFC PATCH net-next 3/3] use netdev_notify_peers_locked in hyperv

2020-12-05 Thread Lijun Pan
Start to use the lockless version of netdev_notify_peers. Cc: Haiyang Zhang Signed-off-by: Lijun Pan --- drivers/net/hyperv/netvsc_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index

[RFC PATCH net-next 0/3] lockless version of

2020-12-05 Thread Lijun Pan
This series introduce the lockless version of netdev_notify_peers and then apply it to the relevant drivers. Lijun Pan (3): net: core: introduce netdev_notify_peers_locked use netdev_notify_peers_locked in ibmvnic use netdev_notify_peers_locked in hyperv drivers/net/ethernet/ibm/ibmvnic.c

[RFC PATCH net-next 1/3] net: core: introduce netdev_notify_peers_locked

2020-12-05 Thread Lijun Pan
); Suggested-by: Nathan Lynch Signed-off-by: Lijun Pan --- include/linux/netdevice.h | 1 + net/core/dev.c| 19 +++ 2 files changed, 20 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 964b494b0e8d..dec16d462672 100644 --- a

[PATCH net v2 3/3] ibmvnic: enhance resetting status check during module exit

2020-11-23 Thread Lijun Pan
process device remove during device reset") Signed-off-by: Lijun Pan --- v2: add fix tag drivers/net/ethernet/ibm/ibmvnic.c | 3 +-- drivers/net/ethernet/ibm/ibmvnic.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net

[PATCH net v2 2/3] ibmvnic: fix NULL pointer dereference in ibmvic_reset_crq

2020-11-23 Thread Lijun Pan
05bd20] [c018df58] worker_thread+0x78/0x520 [cd05bdb0] [c019a934] kthread+0x1c4/0x1d0 [cd05be20] [c000d5d0] ret_from_kernel_thread+0x5c/0x6c Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol") Signed-off-by: Lijun Pan --- v2: add fix tag. remove

[PATCH net v2 1/3] ibmvnic: fix NULL pointer dereference in reset_sub_crq_queues

2020-11-23 Thread Lijun Pan
+0x2cc/0x800 [c007ef7dbd20] [c018bd78] worker_thread+0x78/0x520 [c007ef7dbdb0] [c01984c4] kthread+0x1d4/0x1e0 [c007ef7dbe20] [c000cea8] ret_from_kernel_thread+0x5c/0x74 Fixes: 57a49436f4e8 ("ibmvnic: Reset sub-crqs during driver reset") Signed-off-by: L

[PATCH net v2 0/3] ibmvnic: null pointer dereference

2020-11-23 Thread Lijun Pan
as a set since they are independent of 1-11. 15 to be sent to net-next. This series come from 12/15 13/15 14/15 of v1's "ibmvnic: assorted bug fixes". Lijun Pan (3): ibmvnic: fix NULL pointer dereference in reset_sub_crq_queues ibmvnic: fix NULL pointer dereference in ibmvic

[PATCH net 12/15] ibmvnic: fix NULL pointer dereference in reset_sub_crq_queues

2020-11-20 Thread Lijun Pan
+0x2cc/0x800 [c007ef7dbd20] [c018bd78] worker_thread+0x78/0x520 [c007ef7dbdb0] [c01984c4] kthread+0x1d4/0x1e0 [c007ef7dbe20] [c000cea8] ret_from_kernel_thread+0x5c/0x74 Signed-off-by: Lijun Pan --- drivers/net/ethernet/ibm/ibmvnic.c | 7 +++ 1 file chan

[PATCH net 09/15] ibmvnic: send_login should check for crq errors

2020-11-20 Thread Lijun Pan
From: Dany Madden send_login() does not check for the result of ibmvnic_send_crq() of the login request. This results in the driver needlessly retrying the login 10 times even when CRQ is no longer active. Check the return code and give up in case of errors in sending the CRQ. The only time we w

[PATCH net 15/15] ibmvnic: add some debugs

2020-11-20 Thread Lijun Pan
From: Sukadev Bhattiprolu We sometimes run into situations where a soft/hard reset of the adapter takes a long time or fails to complete. Having additional messages that include important adapter state info will hopefully help understand what is happening, reduce the guess work and minimize reque

[PATCH net 14/15] ibmvnic: enhance resetting status check during module exit

2020-11-20 Thread Lijun Pan
Based on the discussion with Sukadev Bhattiprolu and Dany Madden, we believe that checking adapter->resetting bit is preferred since RESETTING state flag is not as strict as resetting bit. RESETTING state flag is removed since it is verbose now. Signed-off-by: Lijun Pan --- drivers/net/ether

[PATCH net 11/15] ibmvnic: reduce wait for completion time

2020-11-20 Thread Lijun Pan
From: Dany Madden Reduce the wait time for Command Response Queue response from 30 seconds to 20 seconds, as recommended by VIOS and Power Hypervisor teams. Signed-off-by: Dany Madden --- drivers/net/ethernet/ibm/ibmvnic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH net 10/15] ibmvnic: no reset timeout for 5 seconds after reset

2020-11-20 Thread Lijun Pan
From: Dany Madden Reset timeout is going off right after adapter reset. This patch ensures that timeout is scheduled if it has been 5 seconds since the last reset. 5 seconds is the default watchdog timeout. Signed-off-by: Dany Madden --- drivers/net/ethernet/ibm/ibmvnic.c | 11 +-- dri

  1   2   >