Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

smb: smbdirect: change smbdirect_socket_parameters.{initiator_depth,responder_resources} to __u16

We still limit this to U8_MAX as the rdma api only uses __u8
and that's also the limit for Infiniband and RoCE*,
while iWarp would be able to support larger values at
the protocol level.

As struct smbdirect_socket_parameters will be part
of the uapi for IPPROTO_SMBDIRECT in future, change it
now even if userspace sockets won't be supported yet.

Cc: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Long Li <longli@microsoft.com>
Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: David Howells <dhowells@redhat.com>
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Acked-by: Henrique Carvalho <henrique.carvalho@suse.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Steve French <stfrench@microsoft.com>

authored by

Stefan Metzmacher and committed by
Steve French
735610d0 aa43bb2c

+7 -2
+2 -2
fs/smb/common/smbdirect/smbdirect.h
··· 32 32 __u32 resolve_route_timeout_msec; 33 33 __u32 rdma_connect_timeout_msec; 34 34 __u32 negotiate_timeout_msec; 35 - __u8 initiator_depth; 36 - __u8 responder_resources; 35 + __u16 initiator_depth; /* limited to U8_MAX */ 36 + __u16 responder_resources; /* limited to U8_MAX */ 37 37 __u16 recv_credit_max; 38 38 __u16 send_credit_target; 39 39 __u32 max_send_size;
+5
fs/smb/common/smbdirect/smbdirect_socket.c
··· 166 166 if (sp->flags & ~SMBDIRECT_FLAG_PORT_RANGE_MASK) 167 167 return -EINVAL; 168 168 169 + if (sp->initiator_depth > U8_MAX) 170 + return -EINVAL; 171 + if (sp->responder_resources > U8_MAX) 172 + return -EINVAL; 173 + 169 174 if (sp->flags & SMBDIRECT_FLAG_PORT_RANGE_ONLY_IB && 170 175 sp->flags & SMBDIRECT_FLAG_PORT_RANGE_ONLY_IW) 171 176 return -EINVAL;