Skip to content

Commit d53f4d9

Browse files
committed
Merge tag 'v7.0-rc-part1-ksmbd-and-smbdirect-fixes' of git://git.samba.org/ksmbd
Pull smb server and smbdirect updates from Steve French: - Fix tcp connection leak - Fix potential use after free when freeing multichannel - Fix locking problem in showing channel list - Locking improvement for tree connection - Fix infinite loop when signing errors - Add /proc interface for monitoring server state - Fixes to avoid mixing iWarp and InfiniBand/RoCEv1/RoCEv2 port ranges used for smbdirect - Fixes for smbdirect credit handling problems, these make the connections more reliable * tag 'v7.0-rc-part1-ksmbd-and-smbdirect-fixes' of git://git.samba.org/ksmbd: (32 commits) ksmbd: fix non-IPv6 build ksmbd: convert tree_conns_lock to rw_semaphore ksmbd: fix missing chann_lock while iterating session channel list ksmbd: add chann_lock to protect ksmbd_chann_list xarray smb: server: correct value for smb_direct_max_fragmented_recv_size smb: client: correct value for smbd_max_fragmented_recv_size smb: server: fix leak of active_num_conn in ksmbd_tcp_new_connection() ksmbd: add procfs interface for runtime monitoring and statistics ksmbd: fix infinite loop caused by next_smb2_rcv_hdr_off reset in error paths smb: server: make use of rdma_restrict_node_type() smb: client: make use of rdma_restrict_node_type() RDMA/core: introduce rdma_restrict_node_type() smb: client: let send_done handle a completion without IB_SEND_SIGNALED smb: client: let smbd_post_send_negotiate_req() use smbd_post_send() smb: client: fix last send credit problem causing disconnects smb: client: make use of smbdirect_socket.send_io.bcredits smb: client: use smbdirect_send_batch processing smb: client: introduce and use smbd_{alloc, free}_send_io() smb: client: split out smbd_ib_post_send() smb: client: port and use the wait_for_credits logic used by server ...
2 parents 2831fa8 + 8f7df60 commit d53f4d9

25 files changed

Lines changed: 1483 additions & 201 deletions

drivers/infiniband/core/cma.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,9 @@ static int cma_acquire_dev_by_src_ip(struct rdma_id_private *id_priv)
793793

794794
mutex_lock(&lock);
795795
list_for_each_entry(cma_dev, &dev_list, list) {
796+
if (id_priv->restricted_node_type != RDMA_NODE_UNSPECIFIED &&
797+
id_priv->restricted_node_type != cma_dev->device->node_type)
798+
continue;
796799
rdma_for_each_port (cma_dev->device, port) {
797800
gidp = rdma_protocol_roce(cma_dev->device, port) ?
798801
&iboe_gid : &gid;
@@ -1015,6 +1018,7 @@ __rdma_create_id(struct net *net, rdma_cm_event_handler event_handler,
10151018
return ERR_PTR(-ENOMEM);
10161019

10171020
id_priv->state = RDMA_CM_IDLE;
1021+
id_priv->restricted_node_type = RDMA_NODE_UNSPECIFIED;
10181022
id_priv->id.context = context;
10191023
id_priv->id.event_handler = event_handler;
10201024
id_priv->id.ps = ps;
@@ -4177,6 +4181,32 @@ int rdma_resolve_addr(struct rdma_cm_id *id, struct sockaddr *src_addr,
41774181
}
41784182
EXPORT_SYMBOL(rdma_resolve_addr);
41794183

4184+
int rdma_restrict_node_type(struct rdma_cm_id *id, u8 node_type)
4185+
{
4186+
struct rdma_id_private *id_priv =
4187+
container_of(id, struct rdma_id_private, id);
4188+
int ret = 0;
4189+
4190+
switch (node_type) {
4191+
case RDMA_NODE_UNSPECIFIED:
4192+
case RDMA_NODE_IB_CA:
4193+
case RDMA_NODE_RNIC:
4194+
break;
4195+
default:
4196+
return -EINVAL;
4197+
}
4198+
4199+
mutex_lock(&lock);
4200+
if (id_priv->cma_dev)
4201+
ret = -EALREADY;
4202+
else
4203+
id_priv->restricted_node_type = node_type;
4204+
mutex_unlock(&lock);
4205+
4206+
return ret;
4207+
}
4208+
EXPORT_SYMBOL(rdma_restrict_node_type);
4209+
41804210
int rdma_bind_addr(struct rdma_cm_id *id, struct sockaddr *addr)
41814211
{
41824212
struct rdma_id_private *id_priv =

drivers/infiniband/core/cma_priv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ struct rdma_id_private {
7272

7373
int internal_id;
7474
enum rdma_cm_state state;
75+
u8 restricted_node_type;
7576
spinlock_t lock;
7677
struct mutex qp_mutex;
7778

0 commit comments

Comments
 (0)