[PATCH net 1/1] net/smc: Prevent kernel-infoleak in __smc_diag_dump()

2020-08-20 Thread Ursula Braun
: 4b1b7d3b30a6 ("net/smc: add SMC-D diag support") Suggested-by: Dan Carpenter Signed-off-by: Peilin Ye Signed-off-by: Ursula Braun --- net/smc/smc_diag.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/net/smc/smc_diag.c b/net/smc/smc_diag.c index e1

Re: [Linux-kernel-mentees] [PATCH net] net/smc: Prevent kernel-infoleak in __smc_diag_dump()

2020-08-03 Thread Ursula Braun
On 8/1/20 9:44 PM, Peilin Ye wrote: > __smc_diag_dump() is potentially copying uninitialized kernel stack memory > into socket buffers, since the compiler may leave a 4-byte hole near the > beginning of `struct smcd_diag_dmbinfo`. Fix it by initializing `dinfo` > with memset(). > > Cc: sta...@v

Re: [PATCH 8/8] net/iucv: Use the new device_to_pm() helper to access struct dev_pm_ops

2020-05-26 Thread Ursula Braun
On 5/25/20 8:26 PM, Krzysztof Wilczyński wrote: > Use the new device_to_pm() helper to access Power Management callbacs > (struct dev_pm_ops) for a particular device (struct device_driver). > > No functional change intended. > > Signed-off-by: Krzysztof Wilczyński pm support is going to be r

[PATCH net 1/1] MAINTAINERS: another add of Karsten Graul for S390 networking

2020-05-14 Thread Ursula Braun
Complete adding of Karsten as maintainer for all S390 networking parts in the kernel. Cc: Julian Wiedmann Acked-by: Julian Wiedmann Signed-off-by: Ursula Braun --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 85894787825e..391e7eea6a3e 100644

[PATCH net 1/2] s390/ism: fix error return code in ism_probe()

2020-05-13 Thread Ursula Braun
un Signed-off-by: Ursula Braun --- drivers/s390/net/ism_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/s390/net/ism_drv.c b/drivers/s390/net/ism_drv.c index c75112ee7b97..c7fade836d83 100644 --- a/drivers/s390/net/ism_drv.c +++ b/drivers/s390/net/ism_drv.c

[PATCH net 0/2] s390/net: updates 2020-05-13

2020-05-13 Thread Ursula Braun
Dave, please apply the fix from Wei Yongjun to netdev's net tree and add Karsten Graul as co-maintainer for drivers/s390/net. Thanks, Ursula Ursula Braun (1): MAINTAINERS: add Karsten Graul as S390 NETWORK DRIVERS maintainer Wei Yongjun (1): s390/ism: fix error return code in ism_

[PATCH net 2/2] MAINTAINERS: add Karsten Graul as S390 NETWORK DRIVERS maintainer

2020-05-13 Thread Ursula Braun
Add Karsten as additional maintainer for drivers/s390/net . One of his focal points is the ism driver. Cc: Julian Wiedmann Acked-by: Julian Wiedmann Signed-off-by: Ursula Braun --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 88bf36ab2b22

[PATCH net 1/2] net/smc: hold conns_lock before calling smc_lgr_register_conn()

2019-06-26 Thread Ursula Braun
longer active, smc_ib_port_event_work() will call smc_port_terminate(), which in turn will call __smc_lgr_terminate() on every link group of this device. So conns_lock is required here. Signed-off-by: Huaping Zhou Signed-off-by: Ursula Braun --- net/smc/smc_core.c | 3 +++ 1 file changed, 3

[PATCH net 2/2] net/smc: Fix error path in smc_init

2019-06-26 Thread Ursula Braun
From: YueHaibing If register_pernet_subsys success in smc_init, we should cleanup it in case any other error. Fixes: 64e28b52c7a6 (net/smc: add pnet table namespace support") Signed-off-by: YueHaibing Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 5 - 1 file changed, 4 inser

[PATCH net 0/2] net/smc: fixes 2019-06-26

2019-06-26 Thread Ursula Braun
Dave, here are 2 small smc fixes for the net tree. Thanks, Ursula Huaping Zhou (1): net/smc: hold conns_lock before calling smc_lgr_register_conn() YueHaibing (1): net/smc: Fix error path in smc_init net/smc/af_smc.c | 5 - net/smc/smc_core.c | 3 +++ 2 files changed, 7 insertions(+

Re: [PATCH] net/smc: Fix error path in smc_init

2019-05-14 Thread Ursula Braun
On 5/14/19 8:39 AM, YueHaibing wrote: > If register_pernet_subsys success in smc_init, > we should cleanup it in case any other error. > Thanks, looks good. Your patch will be part of our next patch submission. Regards, Ursula > Fixes: 64e28b52c7a6 (net/smc: add pnet table namespace support"

[PATCH net-next 5/8] net/smc: cleanup of get vlan id

2019-04-12 Thread Ursula Braun
of the vlan id failed. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 11 +-- net/smc/smc_clc.h | 1 + net/smc/smc_core.c | 4 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index b45372879a70

[PATCH net-next 6/8] net/smc: code cleanup smc_listen_work

2019-04-12 Thread Ursula Braun
smc_find_rdma_device() to make there purpose more clear. No functional changes. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 29 ++--- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index

[PATCH net-next 3/8] net/smc: check for ip prefix and subnet

2019-04-12 Thread Ursula Braun
new CLC DECLINE reason for the case when the IP prefix or subnet check fails so the reason for the failing SMC connection can be found out more easily. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 12 +--- net/smc/smc_clc.h | 1 + 2 files changed, 10

[PATCH net-next 4/8] net/smc: consolidate function parameters

2019-04-12 Thread Ursula Braun
: Ursula Braun --- net/smc/af_smc.c | 118 + net/smc/smc_clc.c | 10 ++--- net/smc/smc_clc.h | 4 +- net/smc/smc_core.c | 70 +++ net/smc/smc_core.h | 24 --- net/smc/smc_pnet.c | 47

[PATCH net-next 7/8] net/smc: improve smc_listen_work reason codes

2019-04-12 Thread Ursula Braun
cannot talk to the peer. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 95 +-- net/smc/smc_clc.h | 5 ++- 2 files changed, 54 insertions(+), 46 deletions(-) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c

[PATCH net-next 8/8] net/smc: improve smc_conn_create reason codes

2019-04-12 Thread Ursula Braun
-by: Ursula Braun --- net/smc/af_smc.c | 90 -- net/smc/smc_clc.h | 1 + net/smc/smc_core.c | 25 +-- net/smc/smc_core.h | 1 + 4 files changed, 58 insertions(+), 59 deletions(-) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c

[PATCH net-next 2/8] net/smc: fallback to TCP after connect problems

2019-04-12 Thread Ursula Braun
From: Karsten Graul Correct the CLC decline reason codes for internal problems to not have the sign bit set, negative reason codes are interpreted as not eligible for TCP fallback. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/smc_clc.h | 8 1 file changed, 4

[PATCH net-next 0/8] net/smc: patches 2019-04-12

2019-04-12 Thread Ursula Braun
/smc: check for ip prefix and subnet net/smc: consolidate function parameters net/smc: cleanup of get vlan id net/smc: code cleanup smc_listen_work net/smc: improve smc_listen_work reason codes net/smc: improve smc_conn_create reason codes Ursula Braun (1): net/smc: nonblocking connect

[PATCH net-next 1/8] net/smc: nonblocking connect rework

2019-04-12 Thread Ursula Braun
For nonblocking sockets move the kernel_connect() from the connect worker into the initial smc_connect part to return kernel_connect() errors other than -EINPROGRESS to user space. Reviewed-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 78

[PATCH net 0/5] net/smc: fixes 2019-04-11

2019-04-11 Thread Ursula Braun
From: Ursula Braun Dave, here are some fixes in different areas of the smc code for the net tree. Thanks, Ursula Kangjie Lu (1): net/smc: fix a NULL pointer dereference Karsten Graul (2): net/smc: wait for pending work before clcsock release_sock net/smc: fix return code from FLUSH

[PATCH net 4/5] net/smc: fix return code from FLUSH command

2019-04-11 Thread Ursula Braun
table namespace support") Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/smc_pnet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/smc/smc_pnet.c b/net/smc/smc_pnet.c index 8d2f6296279c..0285c7f9e79b 100644 --- a/net/smc/smc_pnet.c +++ b/net/smc/

[PATCH net 2/5] net/smc: fix a NULL pointer dereference

2019-04-11 Thread Ursula Braun
From: Kangjie Lu In case alloc_ordered_workqueue fails, the fix returns NULL to avoid NULL pointer dereference. Signed-off-by: Kangjie Lu Signed-off-by: Ursula Braun --- net/smc/smc_ism.c | 5 + 1 file changed, 5 insertions(+) diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c index

[PATCH net 3/5] net/smc: propagate file from SMC to TCP socket

2019-04-11 Thread Ursula Braun
TCP socket. Propagating field "file" from the SMC socket to the internal TCP socket fixes the issue. Reviewed-by: Karsten Graul Signed-off-by: Ursula Braun --- include/net/sock.h | 6 -- net/smc/af_smc.c | 38 -- 2 files changed, 28 inserti

[PATCH net 1/5] net/smc: wait for pending work before clcsock release_sock

2019-04-11 Thread Ursula Braun
hold before the new helper smc_clcsock_release() is invoked. And before the smc_listen_work starts working check if the parent listen socket is still valid, otherwise stop the work early. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/af_smc.c| 14 -- net/smc

[PATCH net 5/5] net/smc: move unhash before release of clcsock

2019-04-11 Thread Ursula Braun
k is released. This avoids a potential use-after-free in smc_diag_dump(). Reviewed-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index d2a0d15f809c..6f869ef49b32 1

[PATCH net-next 1/1] net/smc: allow pnetid-less configuration

2019-02-28 Thread Ursula Braun
Without hardware pnetid support there must currently be a pnet table configured to determine the IB device port to be used for SMC RDMA traffic. This patch enables a setup without pnet table, if the used handshake interface belongs already to a RoCE port. Signed-off-by: Ursula Braun --- net/smc

[PATCH net-next 1/6] net/smc: cleanup for smcr_tx_sndbuf_nonempty

2019-02-21 Thread Ursula Braun
Use local variable pflags from the beginning of function smcr_tx_sndbuf_nonempty Signed-off-by: Ursula Braun --- net/smc/smc_tx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/smc/smc_tx.c b/net/smc/smc_tx.c index a3bff08ff8c8..f0de323d15d6 100644 --- a/net/smc

[PATCH net-next 2/6] s390/net: convert pnetids to ascii

2019-02-21 Thread Ursula Braun
From: Hans Wippel Pnetids are retrieved from the underlying hardware as EBCDIC. This patch converts pnetids to ASCII. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun --- arch/s390/net/pnet.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/s390/net/pnet.c b/arch/s390/net

[PATCH net-next 4/6] net/smc: add smcd support to the pnet table

2019-02-21 Thread Ursula Braun
From: Hans Wippel Currently, users can only set pnetids for netdevs and ib devices in the pnet table. This patch adds support for smcd devices to the pnet table. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun --- include/net/smc.h | 1 + net/smc/smc_pnet.c | 87

[PATCH net-next 0/6] net/smc: patches 2019-02-21

2019-02-21 Thread Ursula Braun
namespace support net/smc: allow PCI IDs as ib device names in the pnet table Ursula Braun (1): net/smc: cleanup for smcr_tx_sndbuf_nonempty arch/s390/net/pnet.c | 3 + include/net/smc.h| 1 + net/smc/af_smc.c | 28 +++ net/smc/smc_ib.c | 1 - net/smc/smc_ib.h | 2 + net

[PATCH net-next 3/6] net/smc: rework pnet table

2019-02-21 Thread Ursula Braun
entries are only used for netdevs. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun --- net/smc/smc_ib.c | 1 - net/smc/smc_ib.h | 2 + net/smc/smc_pnet.c | 439 ++--- net/smc/smc_pnet.h | 1 - 4 files changed, 249 insertions(+), 194

[PATCH net-next 5/6] net/smc: add pnet table namespace support

2019-02-21 Thread Ursula Braun
. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun --- net/smc/af_smc.c| 28 ++ net/smc/smc_netns.h | 20 net/smc/smc_pnet.c | 145 net/smc/smc_pnet.h | 12 + 4 files changed, 162 insertions(+), 43 deletions

[PATCH net-next 6/6] net/smc: allow PCI IDs as ib device names in the pnet table

2019-02-21 Thread Ursula Braun
From: Hans Wippel SMC-D devices are identified by their PCI IDs in the pnet table. In order to make usage of the pnet table more consistent for users, this patch adds this form of identification for ib devices as well. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun --- net/smc

[PATCH net 1/1] net/smc: fix smc_poll in SMC_INIT state

2019-02-21 Thread Ursula Braun
-zero values for the urg states. Reviewed-by: Karsten Graul Fixes: de8474eb9d50 ("net/smc: urgent data support") Signed-off-by: Ursula Braun --- net/smc/smc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/smc/smc.h b/net/smc/smc.h index 5721416d0605..ad

[PATCH net-next 0/7] net/smc: patches 2019-02-12

2019-02-12 Thread Ursula Braun
smc_lgr_free_work() net/smc: check port_idx of ib event, update handled events Ursula Braun (1): MAINTAINERS: add Karsten as SMC maintainer MAINTAINERS| 1 + net/smc/smc_cdc.c | 29 - net/smc/smc_core.c | 6 ++ net/smc/smc_ib.c | 24

[PATCH net-next 1/7] net/smc: reset cursor update required flag

2019-02-12 Thread Ursula Braun
From: Karsten Graul When an updated rx_cursor_confirmed field was sent to the peer then reset the cons_curs_upd_req flag. And remove the duplicate reset and cursor update in smc_tx_consumer_update(). Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/smc_cdc.c | 5

[PATCH net-next 6/7] net/smc: check port_idx of ib event

2019-02-12 Thread Ursula Braun
QP_FATAL event instead of an DEVICE_FATAL event in the qp handler. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/smc_ib.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/net/smc/smc_ib.c b/net/smc/smc_ib.c index 76487a16934e

[PATCH net-next 7/7] MAINTAINERS: add Karsten as SMC maintainer

2019-02-12 Thread Ursula Braun
Add Karsten as additional maintainer for Shared Memory Communications (SMC) Sockets. Acked-by: Karsten Graul Signed-off-by: Ursula Braun --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 604bca2fc05d..f3af5cde6456 100644 --- a/MAINTAINERS +++ b

[PATCH net-next 4/7] net/smc: reduce amount of status updates to peer

2019-02-12 Thread Ursula Braun
together into one if clause. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/smc_cdc.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/net/smc/smc_cdc.c b/net/smc/smc_cdc.c index 780b36c69292..28bbdb04bc35 100644 --- a/net/smc/smc_cdc.c

[PATCH net-next 2/7] net/smc: move wake up of close waiter

2019-02-12 Thread Ursula Braun
From: Karsten Graul Move the call to smc_close_wake_tx_prepared() (which wakes up a possibly waiting close processing that might wait for 'all data sent') to smc_tx_sndbuf_nonempty() (which is the main function to send data). Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun

[PATCH net-next 5/7] net/smc: check connections in smc_lgr_free_work

2019-02-12 Thread Ursula Braun
From: Karsten Graul Remove the shortcut that smc_lgr_free() would skip the check for existing connections when the link group is not in the link group list. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/smc_core.c | 6 ++ 1 file changed, 2 insertions(+), 4

[PATCH net-next 3/7] net/smc: no delay for free tx buffer wait

2019-02-12 Thread Ursula Braun
free buffers. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/smc_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/smc/smc_tx.c b/net/smc/smc_tx.c index dd10a913b38e..a3bff08ff8c8 100644 --- a/net/smc/smc_tx.c +++ b/net/smc/smc_tx.c @@ -28,7 +28,7

[PATCH net-next 5/7] net/smc: use client and server LGR pending locks for SMC-R

2019-02-07 Thread Ursula Braun
case of SMC-R, there are two types of LGRs (client and server LGRs) which can be protected by separate locks. So, this patch splits the LGR pending lock into two separate locks for client and server to avoid the locking issue for SMC-R. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun

[PATCH net-next 7/7] net/smc: original socket family in inet_sock_diag

2019-02-07 Thread Ursula Braun
se message from SMC sock_diag response. This patch restores the original behaviour and sends AF_SMC as value of the diag_family field. Fixes: ed75986f4aae ("net/smc: ipv6 support for smc_diag.c") Reported-by: Eugene Syromiatnikov Signed-off-by: Karsten Graul Signed-off-by: Ursula

[PATCH net-next 0/7] net/smc: patches 2019-02-07

2019-02-07 Thread Ursula Braun
pending lock earlier for SMC-D net/smc: use client and server LGR pending locks for SMC-R Karsten Graul (2): net/smc: move code to clear the conn->lgr field net/smc: original socket family in inet_sock_diag Ursula Braun (3): s390/net: move pnet constants net/smc: postpone release

[PATCH net-next 1/7] s390/net: move pnet constants

2019-02-07 Thread Ursula Braun
There is no need to define these PNETID related constants in the pnet.h file, since they are just used locally within pnet.c. Just code cleanup, no functional change. Signed-off-by: Ursula Braun --- arch/s390/include/asm/pnet.h | 8 arch/s390/net/pnet.c | 8 2 files

[PATCH net-next 2/7] net/smc: postpone release of clcsock

2019-02-07 Thread Ursula Braun
peer has not yet signalled socket closing. Signed-off-by: Ursula Braun --- net/smc/af_smc.c| 33 + net/smc/smc_close.c | 7 ++- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 369870b0ef79

[PATCH net-next 3/7] net/smc: use smc_curs_copy() for SMC-D

2019-02-07 Thread Ursula Braun
SMC already provides a wrapper for atomic64 calls to be architecture independent. Use this wrapper for SMC-D as well. Reported-by: Jens Remus Signed-off-by: Ursula Braun --- net/smc/smc_cdc.h | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/smc/smc_cdc.h b/net

[PATCH net-next 6/7] net/smc: move code to clear the conn->lgr field

2019-02-07 Thread Ursula Braun
From: Karsten Graul The lgr field of an smc_connection is set in smc_conn_create() and should be cleared in smc_conn_free() for consistency reasons, so move the responsible code. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/smc_core.c | 5 +++-- 1 file changed, 3

[PATCH net-next 4/7] net/smc: unlock LGR pending lock earlier for SMC-D

2019-02-07 Thread Ursula Braun
case of SMC-D, the LGR pending lock is not needed while smc_listen_work() is waiting for the CLC confirm message. So, this patch releases the lock earlier for SMC-D to avoid the locking issue. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 14 +- 1 file

[PATCH net 1/1] net/smc: fix byte_order for rx_curs_confirmed

2019-02-07 Thread Ursula Braun
The recent change in the rx_curs_confirmed assignment disregards byte order, which causes problems on little endian architectures. This patch fixes it. Fixes: b8649efad879 ("net/smc: fix sender_free computation") (net-tree) Signed-off-by: Ursula Braun --- net/smc/smc_cdc.c | 4 +--

[PATCH net 2/4] net/smc: fix sender_free computation

2019-02-04 Thread Ursula Braun
Signed-off-by: Ursula Braun --- net/smc/smc_cdc.c | 5 +++-- net/smc/smc_cdc.h | 26 +- net/smc/smc_tx.c | 3 ++- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/net/smc/smc_cdc.c b/net/smc/smc_cdc.c index b80ef104ab4e..a712c9f8699b 100644 --- a/net/smc

[PATCH net 4/4] net/smc: correct state change for peer closing

2019-02-04 Thread Ursula Braun
accept queue in state SMC_APPCLOSEWAIT1. The socket reaches state SMC_CLOSED once being accepted and closed with smc_release(). Signed-off-by: Ursula Braun --- net/smc/smc_close.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/net/smc/smc_close.c b/net/smc

[PATCH net 0/4] net/smc: fixes 2019-02-04

2019-02-04 Thread Ursula Braun
Dave, here are more fixes in the smc code for the net tree: Patch 1 fixes an IB-related problem with SMCR. Patch 2 fixes a cursor problem for one-way traffic. Patch 3 fixes a problem with RMB-reusage. Patch 4 fixes a closing issue. Thanks, Ursula Ursula Braun (4): net/smc: preallocated memory

[PATCH net 3/4] net/smc: delete rkey first before switching to unused

2019-02-04 Thread Ursula Braun
Once RMBs are flagged as unused they are candidates for reuse. Thus the LLC DELETE RKEY operaton should be made before flagging the RMB as unused. Fixes: c7674c001b11 ("net/smc: unregister rkeys of unused buffer") Signed-off-by: Ursula Braun --- net/smc/smc_core.c | 2 +- 1 file

[PATCH net 1/4] net/smc: preallocated memory for rdma work requests

2019-02-04 Thread Ursula Braun
. The storage is allocated, once a link (and thus a queue pair) is established. Signed-off-by: Ursula Braun --- net/smc/smc_cdc.c | 11 +++ net/smc/smc_cdc.h | 8 +++- net/smc/smc_core.h | 20 net/smc/smc_llc.c | 3 ++- net/smc/smc_tx.c | 44

[PATCH net 0/9] net/smc: fixes 2019-01-30

2019-01-30 Thread Ursula Braun
uffer space when data was already sent net/smc: recvmsg and splice_read should return 0 after shutdown net/smc: do not wait under send_lock net/smc: call smc_cdc_msg_send() under send_lock net/smc: use device link provided in qp_context net/smc: fix use of variable in cleared area Ursula Bra

[PATCH net 3/9] net/smc: prevent races between smc_lgr_terminate() and smc_conn_free()

2019-01-30 Thread Ursula Braun
() or smc_conn_free() still access it in parallel. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/smc_core.c | 4 1 file changed, 4 insertions(+) diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index 35c1cdc93e1c..097c798983ca 100644 --- a/net/smc/smc_core.c +++ b

[PATCH net 7/9] net/smc: call smc_cdc_msg_send() under send_lock

2019-01-30 Thread Ursula Braun
From: Karsten Graul Call smc_cdc_msg_send() under the connection send_lock to make sure all send operations for one connection are serialized. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/smc_cdc.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[PATCH net 9/9] net/smc: fix use of variable in cleared area

2019-01-30 Thread Ursula Braun
From: Karsten Graul Do not use pend->idx as index for the arrays because its value is located in the cleared area. Use the existing local variable instead. Without this fix the wrong area might be cleared. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/smc_wr.c

[PATCH net 8/9] net/smc: use device link provided in qp_context

2019-01-30 Thread Ursula Braun
, derive it from there. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/smc_ib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/smc/smc_ib.c b/net/smc/smc_ib.c index e519ef29c0ff..76487a16934e 100644 --- a/net/smc/smc_ib.c +++ b/net/smc

[PATCH net 1/9] net/smc: fix another sizeof to int comparison

2019-01-30 Thread Ursula Braun
Comparing an int to a size, which is unsigned, causes the int to become unsigned, giving the wrong result. kernel_sendmsg can return a negative error code. Signed-off-by: Ursula Braun --- net/smc/smc_clc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/smc/smc_clc.c b

[PATCH net 2/9] net/smc: allow 16 byte pnetids in netlink policy

2019-01-30 Thread Ursula Braun
From: Hans Wippel Currently, users can only send pnetids with a maximum length of 15 bytes over the SMC netlink interface although the maximum pnetid length is 16 bytes. This patch changes the SMC netlink policy to accept 16 byte pnetids. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun

[PATCH net 4/9] net/smc: don't wait for send buffer space when data was already sent

2019-01-30 Thread Ursula Braun
buffer space when needed. During this wait the user space program was blocked in the sendmsg() call and hence not able to receive incoming data. When both sides were in such a situation then the connection stalled forever. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc

[PATCH net 6/9] net/smc: do not wait under send_lock

2019-01-30 Thread Ursula Braun
From: Karsten Graul smc_cdc_get_free_slot() might wait for free transfer buffers when using SMC-R. This wait should not be done under the send_lock, which is a spin_lock. This fixes a cpu loop in parallel threads waiting for the send_lock. Signed-off-by: Karsten Graul Signed-off-by: Ursula

[PATCH net 5/9] net/smc: recvmsg and splice_read should return 0 after shutdown

2019-01-30 Thread Ursula Braun
From: Karsten Graul When a socket was connected and is now shut down for read, return 0 to indicate end of data in recvmsg and splice_read (like TCP) and do not return ENOTCONN. This behavior is required by the socket api. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc

Re: [Patch net] smc: move unhash as early as possible in smc_release()

2019-01-07 Thread Ursula Braun
this could cause a use-after-free as >> reported by syzbot. >> >> Reported-and-tested-by: syzbot+fbd1e5476e4c94c7b...@syzkaller.appspotmail.com >> Fixes: 51f1de79ad8e ("net/smc: replace sock_put worker by socket >> refcounting") >> Cc: Ursula Brau

Re: general protection fault in __smc_diag_dump

2019-01-07 Thread Ursula Braun
On 01/02/2019 12:29 PM, Eric Dumazet wrote: > > > On 01/02/2019 02:41 AM, syzbot wrote: >> Hello, >> >> syzbot found the following crash on: >> >> HEAD commit:    28e8c4bc8eb4 Merge tag 'rtc-4.21' of git://git.kernel.org/.. >> git tree:   upstream >> console output: https://syzkaller.appsp

Re: [PATCH v2] net/smc: fix TCP fallback socket release

2018-12-18 Thread Ursula Braun
On 12/18/2018 08:03 AM, Myungho Jung wrote: > On Mon, Dec 17, 2018 at 03:58:58PM +0100, Ursula Braun wrote: >> > > Hi Ursula, > > Thank you for your suggestion. I have a question on your comment. > >> >> On 12/17/2018 06:21 AM, Myungho Jung wrot

Re: [PATCH v2] net/smc: fix TCP fallback socket release

2018-12-17 Thread Ursula Braun
On 12/17/2018 06:21 AM, Myungho Jung wrote: > clcsock can be released while kernel_accept() references it in TCP > listen worker. Also, clcsock needs to wake up before released if TCP > fallback is used and the clcsock is blocked by accept. Add a lock to > safely release clcsock and call kernel_

[PATCH net-next 09/10] net/smc: add infrastructure to send delete rkey messages

2018-11-22 Thread Ursula Braun
From: Karsten Graul Add the infrastructure to send LLC messages of type DELETE RKEY to unregister a shared memory region at the peer. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/smc_core.h | 3 +++ net/smc/smc_llc.c | 53

[PATCH net-next 08/10] net/smc: avoid a delay by waiting for nothing

2018-11-22 Thread Ursula Braun
From: Karsten Graul When a send failed then don't start to wait for a response in smc_llc_do_confirm_rkey. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/smc_llc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/smc/smc_llc.c b/ne

[PATCH net-next 10/10] net/smc: unregister rkeys of unused buffer

2018-11-22 Thread Ursula Braun
used and unregistered when they are no longer used by a connection. Signed-off-by: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 22 +++--- net/smc/smc_core.c | 7 ++- net/smc/smc_core.h | 2 +- 3 files changed, 18 insertions(+), 13 deletions(-) diff

[PATCH net-next 06/10] net/smc: short wait for late smc_clc_wait_msg

2018-11-22 Thread Ursula Braun
After sending one of the initial LLC messages CONFIRM LINK or ADD LINK, there is already a wait for the LLC response. It does not make sense to wait another long time for a CLC DECLINE. Thus this patch introduces a shorter wait time for these cases. Signed-off-by: Ursula Braun --- net/smc

[PATCH net-next 03/10] net/smc: remove sock_error detour in clc-functions

2018-11-22 Thread Ursula Braun
There is no need to store the return value in sk_err, if it is afterwards cleared again with sock_error(). This patch sets the return value directly. Just cleanup, no functional change. Signed-off-by: Ursula Braun --- net/smc/smc_clc.c | 18 +- 1 file changed, 5 insertions

[PATCH net-next 05/10] net/smc: no link delete for a never active link

2018-11-22 Thread Ursula Braun
If a link is terminated that has never reached the active state, there is no need to trigger an LLC DELETE LINK. Signed-off-by: Ursula Braun --- net/smc/smc_core.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index 4812ca30f1dc

[PATCH net-next 07/10] net/smc: cleanup listen worker mutex unlocking

2018-11-22 Thread Ursula Braun
For easier reading move the unlock of mutex smc_create_lgr_pending into smc_listen_work(), i.e. into the function the mutex has been locked. No functional change. Reported-by: Dan Carpenter Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions

[PATCH net-next 04/10] net/smc: allow fallback after clc timeouts

2018-11-22 Thread Ursula Braun
: Ursula Braun --- net/smc/af_smc.c | 8 net/smc/smc_clc.c | 9 +++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index d9b1a0e4446c..66836cfbc587 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -336,7 +336,7 @@ static int

[PATCH net-next 02/10] net/smc: make smc_lgr_free() static

2018-11-22 Thread Ursula Braun
smc_lgr_free() is just called inside smc_core.c. Make it static. Just cleanup, no functional change. Signed-off-by: Ursula Braun --- net/smc/smc_core.c | 4 +++- net/smc/smc_core.h | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c

[PATCH net-next 00/10] net/smc: patches 2018-11-22

2018-11-22 Thread Ursula Braun
nothing net/smc: add infrastructure to send delete rkey messages net/smc: unregister rkeys of unused buffer Ursula Braun (7): net/smc: cleanup tcp_listen_worker initialization net/smc: make smc_lgr_free() static net/smc: remove sock_error detour in clc-functions net/smc: allow fallback after

[PATCH net-next 01/10] net/smc: cleanup tcp_listen_worker initialization

2018-11-22 Thread Ursula Braun
The tcp_listen_worker is already initialized when socket is created (in smc_sock_alloc()). Get rid of the duplicate initialization in smc_listen(). No functional change. Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/smc/af_smc.c b/net

[PATCH net V4 4/5] net/smc: atomic SMCD cursor handling

2018-11-20 Thread Ursula Braun
Running uperf tests with SMCD on LPARs results in corrupted cursors. SMCD cursors should be treated atomically to fix cursor corruption. Signed-off-by: Ursula Braun --- net/smc/smc_cdc.c | 26 ++-- net/smc/smc_cdc.h | 60

[PATCH net V4 2/5] net/smc: use queue pair number when matching link group

2018-11-20 Thread Ursula Braun
: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 9 + net/smc/smc_core.c | 10 ++ net/smc/smc_core.h | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 84f67f601838..5fbaf1901571 100644 --- a/net/smc

[PATCH net V4 0/5] net/smc: fixes 2018-11-12

2018-11-20 Thread Ursula Braun
ion in smc_release net/smc: add SMC-D shutdown signal Karsten Graul (1): net/smc: use queue pair number when matching link group Ursula Braun (2): net/smc: atomic SMCD cursor handling net/smc: use after free fix in smc_wr_tx_put_slot() net/smc/af_smc.c | 11 ++ net/smc/smc_cdc.c

[PATCH net V4 5/5] net/smc: use after free fix in smc_wr_tx_put_slot()

2018-11-20 Thread Ursula Braun
From: Ursula Braun In smc_wr_tx_put_slot() field pend->idx is used after being cleared. That means always idx 0 is cleared in the wr_tx_mask. This results in a broken administration of available WR send payload buffers. Signed-off-by: Ursula Braun --- net/smc/smc_wr.c | 4 +++- 1 file chan

[PATCH net V4 1/5] net/smc: abort CLC connection in smc_release

2018-11-20 Thread Ursula Braun
CLC connection when the respective non-blocking SMC socket is released to avoid waiting on socket operations or timeouts. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index

[PATCH net V4 3/5] net/smc: add SMC-D shutdown signal

2018-11-20 Thread Ursula Braun
From: Hans Wippel When a SMC-D link group is freed, a shutdown signal should be sent to the peer to indicate that the link group is invalid. This patch adds the shutdown signal to the SMC code. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun --- net/smc/smc_core.c | 10 -- net

[PATCH net V3 4/5] net/smc: atomic SMCD cursor handling

2018-11-16 Thread Ursula Braun
Running uperf tests with SMCD on LPARs results in corrupted cursors. SMCD cursors should be treated atomically to fix cursor corruption. Signed-off-by: Ursula Braun --- net/smc/smc_cdc.c | 24 +-- net/smc/smc_cdc.h | 58

[PATCH net V3 3/5] net/smc: add SMC-D shutdown signal

2018-11-16 Thread Ursula Braun
From: Hans Wippel When a SMC-D link group is freed, a shutdown signal should be sent to the peer to indicate that the link group is invalid. This patch adds the shutdown signal to the SMC code. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun --- net/smc/smc_core.c | 10 -- net

[PATCH net V3 0/5] net/smc: fixes 2018-11-12

2018-11-16 Thread Ursula Braun
"net/smc: atomic SMCD cursor handling", but get rid of __packed for struct smcd_cdc_msg Thanks, Ursula Hans Wippel (2): net/smc: abort CLC connection in smc_release net/smc: add SMC-D shutdown signal Karsten Graul (1): net/smc: use queue pair number when matching link group U

[PATCH net V3 5/5] net/smc: use after free fix in smc_wr_tx_put_slot()

2018-11-16 Thread Ursula Braun
From: Ursula Braun In smc_wr_tx_put_slot() field pend->idx is used after being cleared. That means always idx 0 is cleared in the wr_tx_mask. This results in a broken administration of available WR send payload buffers. Signed-off-by: Ursula Braun --- net/smc/smc_wr.c | 4 +++- 1 file chan

[PATCH net V3 2/5] net/smc: use queue pair number when matching link group

2018-11-16 Thread Ursula Braun
: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 9 + net/smc/smc_core.c | 10 ++ net/smc/smc_core.h | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 84f67f601838..5fbaf1901571 100644 --- a/net/smc

[PATCH net V3 1/5] net/smc: abort CLC connection in smc_release

2018-11-16 Thread Ursula Braun
CLC connection when the respective non-blocking SMC socket is released to avoid waiting on socket operations or timeouts. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index

[PATCH net V2 2/5] net/smc: use queue pair number when matching link group

2018-11-15 Thread Ursula Braun
: Karsten Graul Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 9 + net/smc/smc_core.c | 10 ++ net/smc/smc_core.h | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 84f67f601838..5fbaf1901571 100644 --- a/net/smc

[PATCH net V2 1/5] net/smc: abort CLC connection in smc_release

2018-11-15 Thread Ursula Braun
CLC connection when the respective non-blocking SMC socket is released to avoid waiting on socket operations or timeouts. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun --- net/smc/af_smc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index

[PATCH net V2 3/5] net/smc: add SMC-D shutdown signal

2018-11-15 Thread Ursula Braun
From: Hans Wippel When a SMC-D link group is freed, a shutdown signal should be sent to the peer to indicate that the link group is invalid. This patch adds the shutdown signal to the SMC code. Signed-off-by: Hans Wippel Signed-off-by: Ursula Braun --- net/smc/smc_core.c | 10 -- net

[PATCH net V2 5/5] net/smc: use after free fix in smc_wr_tx_put_slot()

2018-11-15 Thread Ursula Braun
From: Ursula Braun In smc_wr_tx_put_slot() field pend->idx is used after being cleared. That means always idx 0 is cleared in the wr_tx_mask. This results in a broken administration of available WR send payload buffers. Signed-off-by: Ursula Braun --- net/smc/smc_wr.c | 4 +++- 1 file chan

[PATCH net V2 4/5] net/smc: atomic SMCD cursor handling

2018-11-15 Thread Ursula Braun
Running uperf tests with SMCD on LPARs results in corrupted cursors. SMCD cursors should be treated atomically to fix cursor corruption. Signed-off-by: Ursula Braun --- net/smc/smc_cdc.c | 24 ++-- net/smc/smc_cdc.h | 56

[PATCH net V2 0/5] net/smc: fixes 2018-11-12

2018-11-15 Thread Ursula Braun
From: Ursula Braun Dave, here is V2 of some net/smc fixes in different areas for the net tree. v1->v2: do not define 8-byte alignment for union smcd_cdc_cursor in patch 4/5 "net/smc: atomic SMCD cursor handling" Thanks, Ursula Hans Wippel (2): net/smc: abort CLC

  1   2   3   4   5   6   7   >