]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
smb: client: make use of smbdirect_connection_recv_io_refill_work()
authorStefan Metzmacher <metze@samba.org>
Thu, 18 Sep 2025 19:39:25 +0000 (21:39 +0200)
committerSteve French <stfrench@microsoft.com>
Thu, 16 Apr 2026 02:58:21 +0000 (21:58 -0500)
commit73ec624781cd7a43a2dbad8c7d40133703089224
treea16fd41781de7a372d494879e9c16c24bddc88f7
parent26003faa7d477eed4ceb5b5b49e4eb4a77bf2f6f
smb: client: make use of smbdirect_connection_recv_io_refill_work()

This is basically a copy of smbd_post_send_credits(), but
there are several improvements compared to the existing function:

  We calculate the number of missing posted buffers by getting the
  difference between recv_io.credits.target and recv_io.posted.count.

  Instead of the difference between recv_io.credits.target
  and recv_io.credits.count, because recv_io.credits.count is
  only updated once a message is send to the peer.

  It was not really a problem before, because we have
  a fixed number smbdirect_recv_io buffers, so the
  loop terminated when smbdirect_connection_get_recv_io()
  returns NULL.

  But using recv_io.posted.count makes it easier to
  understand.

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: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smbdirect.c