From: Henrique Carvalho <henrique.carvalho@suse.com>
To: Stefan Metzmacher <metze@samba.org>
Cc: linux-cifs@vger.kernel.org, samba-technical@lists.samba.org,
Steve French <smfrench@gmail.com>, Tom Talpey <tom@talpey.com>,
Long Li <longli@microsoft.com>,
Namjae Jeon <linkinjeon@kernel.org>,
David Howells <dhowells@redhat.com>
Subject: Re: [PATCH 1/8] smb: smbdirect: change smbdirect_socket_parameters.{initiator_depth,responder_resources} to __u16
Date: Fri, 10 Apr 2026 18:02:28 -0300 [thread overview]
Message-ID: <ev3jzzcrkusc5s2rld5vn7myfc2oyamzsdnbh2jki7yodt7t56@is2n4webgeq5> (raw)
In-Reply-To: <a72f02560aadca368b8f136d635ff5144b690517.1775571957.git.metze@samba.org>
Acked-by: Henrique Carvalho <henrique.carvalho@suse.com>
On Tue, Apr 07, 2026 at 04:46:27PM +0200, Stefan Metzmacher wrote:
> 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: Henrique Carvalho <henrique.carvalho@suse.com>
> Cc: linux-cifs@vger.kernel.org
> Cc: samba-technical@lists.samba.org
> Signed-off-by: Stefan Metzmacher <metze@samba.org>
> ---
> fs/smb/common/smbdirect/smbdirect.h | 4 ++--
> fs/smb/common/smbdirect/smbdirect_socket.c | 5 +++++
> 2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/fs/smb/common/smbdirect/smbdirect.h b/fs/smb/common/smbdirect/smbdirect.h
> index e70a21eb57f0..8fbffe3eb845 100644
> --- a/fs/smb/common/smbdirect/smbdirect.h
> +++ b/fs/smb/common/smbdirect/smbdirect.h
> @@ -32,8 +32,8 @@ struct smbdirect_socket_parameters {
> __u32 resolve_route_timeout_msec;
> __u32 rdma_connect_timeout_msec;
> __u32 negotiate_timeout_msec;
> - __u8 initiator_depth;
> - __u8 responder_resources;
> + __u16 initiator_depth; /* limited to U8_MAX */
> + __u16 responder_resources; /* limited to U8_MAX */
> __u16 recv_credit_max;
> __u16 send_credit_target;
> __u32 max_send_size;
> diff --git a/fs/smb/common/smbdirect/smbdirect_socket.c b/fs/smb/common/smbdirect/smbdirect_socket.c
> index 1e3b361728cc..4003753bea26 100644
> --- a/fs/smb/common/smbdirect/smbdirect_socket.c
> +++ b/fs/smb/common/smbdirect/smbdirect_socket.c
> @@ -166,6 +166,11 @@ int smbdirect_socket_set_initial_parameters(struct smbdirect_socket *sc,
> if (sp->flags & ~SMBDIRECT_FLAG_PORT_RANGE_MASK)
> return -EINVAL;
>
> + if (sp->initiator_depth > U8_MAX)
> + return -EINVAL;
> + if (sp->responder_resources > U8_MAX)
> + return -EINVAL;
> +
> if (sp->flags & SMBDIRECT_FLAG_PORT_RANGE_ONLY_IB &&
> sp->flags & SMBDIRECT_FLAG_PORT_RANGE_ONLY_IW)
> return -EINVAL;
> --
> 2.43.0
>
next prev parent reply other threads:[~2026-04-10 21:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-07 14:46 [PATCH 0/8] smb: add kernel internal IPPROTO_SMBDIRECT Stefan Metzmacher
2026-04-07 14:46 ` [PATCH 1/8] smb: smbdirect: change smbdirect_socket_parameters.{initiator_depth,responder_resources} to __u16 Stefan Metzmacher
2026-04-10 21:02 ` Henrique Carvalho [this message]
2026-04-07 14:46 ` [PATCH 2/8] smb: smbdirect: fix copyright header of smbdirect.h Stefan Metzmacher
2026-04-07 14:46 ` [PATCH 3/8] smb: smbdirect: fix the logic in smbdirect_socket_destroy_sync() without an error Stefan Metzmacher
2026-04-07 14:46 ` [PATCH 4/8] smb: smbdirect: let smbdirect_connection_deregister_mr_io unlock while waiting Stefan Metzmacher
2026-04-07 14:46 ` [PATCH 5/8] net: define IPPROTO_SMBDIRECT and SOL_SMBDIRECT constants Stefan Metzmacher
2026-04-07 14:46 ` [PATCH 6/8] smb: smbdirect: add in kernel only support for IPPROTO_SMBDIRECT Stefan Metzmacher
2026-04-08 1:04 ` Kuniyuki Iwashima
2026-04-07 14:46 ` [PATCH 7/8] smb: client: make use of IPPROTO_SMBDIRECT sockets Stefan Metzmacher
2026-04-07 14:46 ` [PATCH 8/8] smb: server: " Stefan Metzmacher
2026-04-07 21:18 ` [PATCH 0/8] smb: add kernel internal IPPROTO_SMBDIRECT Steve French
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ev3jzzcrkusc5s2rld5vn7myfc2oyamzsdnbh2jki7yodt7t56@is2n4webgeq5 \
--to=henrique.carvalho@suse.com \
--cc=dhowells@redhat.com \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=metze@samba.org \
--cc=samba-technical@lists.samba.org \
--cc=smfrench@gmail.com \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).