Files
linux/fs
Stefan Metzmacher 2b41feecdf smb: smbdirect: introduce smbdirect_connection_recv_io_refill_work()
This is basically a copy of smbd_post_send_credits() in the client
and smb_direct_post_recv_credits() in the server.

There are several improvements compared to the existing functions:

1. 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.

2. In order to tell the peer about the newly posted buffer
   and grant the credits, we only trigger the send immediate
   when we're not granting only the last possible credit
   (only one credit is missing to reach the desired target).

   This is mostly a difference relative to the servers
   smb_direct_post_recv_credits() implementation,
   which should avoid useless ping pong messages.

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>
2026-04-15 21:58:19 -05:00
..
2026-01-02 13:43:41 -05:00
2025-11-28 12:42:31 +01:00
2026-04-03 16:53:50 -04:00
2026-04-05 13:53:06 -07:00
2026-04-01 12:26:07 -07:00
2025-09-01 13:08:01 +02:00
2026-01-12 16:52:09 +01:00
2026-04-14 09:30:15 +02:00
2026-01-12 16:52:09 +01:00
2026-03-23 12:41:58 +01:00