Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Stefan Metzmacher <metze@samba.org>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: Tom Talpey <tom@talpey.com>,
	"linux-cifs@vger.kernel.org" <linux-cifs@vger.kernel.org>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: Re: Problem with smbdirect rw credits and initiator_depth
Date: Wed, 10 Dec 2025 17:42:12 +0100	[thread overview]
Message-ID: <86b3c222-d765-4a6c-bb79-915609fa3d27@samba.org> (raw)
In-Reply-To: <CAKYAXd__T=L9aWwOuY7Z8fJgMf404=KQ2dTpNRd3mq9dnYCxRw@mail.gmail.com>

Am 05.12.25 um 13:21 schrieb Namjae Jeon:
>>> Can you at least post the dmesg output generated by this:
>>> https://git.samba.org/?p=metze/linux/wip.git;a=commitdiff;h=7e724ebc58e986f4e101a55f4ab5e96912239918
>>> Assuming that this wasn't triggered:
>>> if (WARN_ONCE(needed > max_possible, "needed:%u > max:%u\n", needed, max_possible))
>> I didn't know you wanted it. I will share it after office.
> I have attached v2 and v3 logs. Let me know if you need something more,
>>>
>>> Did you run the bpftrace command? Did it print a lot of
>>> 'smb_direct_rdma_xmit' message over the whole time of the file copy?
>> No, I didn't check it. but I will try this.
> /mnt# bpftrace ksmbd-rdma-xmit.bt
> Attaching 1 probe...
> 
> The absence of any output after Attaching 1 probe... indicates that
> the smb_direct_rdma_xmit function has not been called ?

Assuming the client requires signing, I may found the
reason for a recv credit problem.

ksmbd uses this:

smb_direct_max_fragmented_recv_size = 1024 * 1024
smb_direct_max_receive_size = 1364;
smb_direct_receive_credit_max = 255;

In order for the client to fill the full eassembly buffer,
all our recv buffers are moved into it, which means
255 * (1364 - 24) = 341700 (0x536C4) bytes of payload,
after that we no longer able to grant and new recv credits to
the peer, which tries to send up to 1048576 (0x100000).

I found this using smbclient to download a large file
from a Windows server without using rdma offload.

So I guess you are seeing the problem when Windows
tries to copy a file to ksmbd.

For smbclient I made it work by changing
max_fragmented_recv_size to the minimum value of
131072 (0x20000), this value is smaller than
all local recv buffers 255 * (1364 - 24) = 341700 (0x536C4).

I try to find what difference we have between 6.17.9
and 6.18 tomorrow.

In the meantime you may want to test if 6.18 with
smb_direct_max_fragmented_recv_size = 131072 works
for you, or change smb_direct_receive_credit_max = 1024.

metze

  parent reply	other threads:[~2025-12-10 16:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-03 18:18 Problem with smbdirect rw credits and initiator_depth Stefan Metzmacher
2025-12-04  0:07 ` Namjae Jeon
2025-12-04  9:39   ` Stefan Metzmacher
2025-12-05  2:33     ` Namjae Jeon
2025-12-05 12:21       ` Namjae Jeon
2025-12-08 16:13         ` Stefan Metzmacher
2025-12-10 16:42         ` Stefan Metzmacher [this message]
2025-12-11 19:38           ` Stefan Metzmacher
2025-12-12  9:58             ` Stefan Metzmacher
2025-12-12 15:35               ` Stefan Metzmacher
2025-12-13  2:14                 ` Namjae Jeon
2025-12-14 22:56                   ` Stefan Metzmacher
2025-12-15 20:17                     ` Stefan Metzmacher
2025-12-16 23:59                       ` Namjae Jeon
2026-01-14 18:13                       ` Stefan Metzmacher
2026-01-15  2:01                         ` Namjae Jeon
2026-01-15  9:50                           ` Stefan Metzmacher
2026-01-16 23:08                             ` Stefan Metzmacher
2026-01-17 13:15                               ` Stefan Metzmacher
2026-01-18  8:03                                 ` Namjae Jeon
2026-01-19 17:28                                   ` Stefan Metzmacher
2026-01-19 19:17                                     ` Stefan Metzmacher
2025-12-08 16:02       ` Stefan Metzmacher
2025-12-04  9:57 ` Stefan Metzmacher

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=86b3c222-d765-4a6c-bb79-915609fa3d27@samba.org \
    --to=metze@samba.org \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --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