diff options
| author | Stefan Metzmacher <metze@samba.org> | 2025-08-11 17:53:55 +0200 |
|---|---|---|
| committer | Steve French <stfrench@microsoft.com> | 2025-09-28 18:29:49 -0500 |
| commit | 02548c477a90481c1fd0d6e7c84b4504ec2fcc12 (patch) | |
| tree | d1f338fc82b8096c60eb5360e0ef025a2b5d477e | |
| parent | b0aa92a229ab9e6de3839e06f3a8494bce5b1cd2 (diff) | |
| download | linux-02548c477a90481c1fd0d6e7c84b4504ec2fcc12.tar.gz linux-02548c477a90481c1fd0d6e7c84b4504ec2fcc12.zip | |
smb: client: queue post_recv_credits_work also if the peer raises the credit target
This is already handled in the server, but currently it done
in a very complex way there. So we do it much simpler.
Note that put_receive_buffer() will take care of it
in case data_length is 0.
Cc: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Long Li <longli@microsoft.com>
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
| -rw-r--r-- | fs/smb/client/smbdirect.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/smb/client/smbdirect.c b/fs/smb/client/smbdirect.c index 44140fb5f2ad..d8a8382624ad 100644 --- a/fs/smb/client/smbdirect.c +++ b/fs/smb/client/smbdirect.c @@ -590,6 +590,7 @@ static void recv_done(struct ib_cq *cq, struct ib_wc *wc) struct smbdirect_socket_parameters *sp = &sc->parameters; struct smbd_connection *info = container_of(sc, struct smbd_connection, socket); + int old_recv_credit_target; u32 data_offset = 0; u32 data_length = 0; u32 remaining_data_length = 0; @@ -661,6 +662,7 @@ static void recv_done(struct ib_cq *cq, struct ib_wc *wc) } atomic_dec(&info->receive_credits); + old_recv_credit_target = info->receive_credit_target; info->receive_credit_target = le16_to_cpu(data_transfer->credits_requested); if (le16_to_cpu(data_transfer->credits_granted)) { @@ -691,6 +693,9 @@ static void recv_done(struct ib_cq *cq, struct ib_wc *wc) * reassembly queue and wake up the reading thread */ if (data_length) { + if (info->receive_credit_target > old_recv_credit_target) + queue_work(info->workqueue, &info->post_send_credits_work); + enqueue_reassembly(info, response, data_length); wake_up(&sc->recv_io.reassembly.wait_queue); } else |
