linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ksmbd: smbd: create MR pool
@ 2022-01-07  5:45 Hyunchul Lee
  2022-01-07  5:45 ` [PATCH 2/2] ksmbd: smbd: change the default maximum read/write, receive size Hyunchul Lee
  2022-01-09  2:42 ` [PATCH 1/2] ksmbd: smbd: create MR pool Namjae Jeon
  0 siblings, 2 replies; 11+ messages in thread
From: Hyunchul Lee @ 2022-01-07  5:45 UTC (permalink / raw)
  To: linux-cifs; +Cc: Namjae Jeon, Sergey Senozhatsky, Steve French, Hyunchul Lee

Create a memory region pool because rdma_rw_ctx_init()
uses memory registration if memory registration yields
better performance than using multiple SGE entries.

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
---
 fs/ksmbd/transport_rdma.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/fs/ksmbd/transport_rdma.c b/fs/ksmbd/transport_rdma.c
index 0fd706d01790..f0b17da1cac2 100644
--- a/fs/ksmbd/transport_rdma.c
+++ b/fs/ksmbd/transport_rdma.c
@@ -428,6 +428,7 @@ static void free_transport(struct smb_direct_transport *t)
 
 	if (t->qp) {
 		ib_drain_qp(t->qp);
+		ib_mr_pool_destroy(t->qp, &t->qp->rdma_mrs);
 		ib_destroy_qp(t->qp);
 	}
 
@@ -1708,7 +1709,9 @@ static int smb_direct_init_params(struct smb_direct_transport *t,
 	cap->max_send_sge = SMB_DIRECT_MAX_SEND_SGES;
 	cap->max_recv_sge = SMB_DIRECT_MAX_RECV_SGES;
 	cap->max_inline_data = 0;
-	cap->max_rdma_ctxs = 0;
+	cap->max_rdma_ctxs =
+		rdma_rw_mr_factor(device, t->cm_id->port_num, max_pages) *
+		smb_direct_max_outstanding_rw_ops;
 	return 0;
 }
 
@@ -1790,6 +1793,7 @@ static int smb_direct_create_qpair(struct smb_direct_transport *t,
 {
 	int ret;
 	struct ib_qp_init_attr qp_attr;
+	int pages_per_rw;
 
 	t->pd = ib_alloc_pd(t->cm_id->device, 0);
 	if (IS_ERR(t->pd)) {
@@ -1837,6 +1841,23 @@ static int smb_direct_create_qpair(struct smb_direct_transport *t,
 	t->qp = t->cm_id->qp;
 	t->cm_id->event_handler = smb_direct_cm_handler;
 
+	pages_per_rw = DIV_ROUND_UP(t->max_rdma_rw_size, PAGE_SIZE) + 1;
+	if (pages_per_rw > t->cm_id->device->attrs.max_sgl_rd) {
+		int pages_per_mr, mr_count;
+
+		pages_per_mr = min_t(int, pages_per_rw,
+				     t->cm_id->device->attrs.max_fast_reg_page_list_len);
+		mr_count = DIV_ROUND_UP(pages_per_rw, pages_per_mr) *
+			atomic_read(&t->rw_avail_ops);
+		ret = ib_mr_pool_init(t->qp, &t->qp->rdma_mrs, mr_count,
+				      IB_MR_TYPE_MEM_REG, pages_per_mr, 0);
+		if (ret) {
+			pr_err("failed to init mr pool count %d pages %d\n",
+			       mr_count, pages_per_mr);
+			goto err;
+		}
+	}
+
 	return 0;
 err:
 	if (t->qp) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/2] ksmbd: smbd: change the default maximum read/write, receive size
  2022-01-07  5:45 [PATCH 1/2] ksmbd: smbd: create MR pool Hyunchul Lee
@ 2022-01-07  5:45 ` Hyunchul Lee
  2022-01-09  2:43   ` Namjae Jeon
  2022-01-09  2:42 ` [PATCH 1/2] ksmbd: smbd: create MR pool Namjae Jeon
  1 sibling, 1 reply; 11+ messages in thread
From: Hyunchul Lee @ 2022-01-07  5:45 UTC (permalink / raw)
  To: linux-cifs; +Cc: Namjae Jeon, Sergey Senozhatsky, Steve French, Hyunchul Lee

Due to restriction that cannot handle multiple
buffer descriptor structures, decrease the maximum
read/write size for Windows clients.

And set the maximum fragmented receive size
in consideration of the receive queue size.

Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
---
 fs/ksmbd/transport_rdma.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/ksmbd/transport_rdma.c b/fs/ksmbd/transport_rdma.c
index f0b17da1cac2..86fd64511512 100644
--- a/fs/ksmbd/transport_rdma.c
+++ b/fs/ksmbd/transport_rdma.c
@@ -80,7 +80,7 @@ static int smb_direct_max_fragmented_recv_size = 1024 * 1024;
 /*  The maximum single-message size which can be received */
 static int smb_direct_max_receive_size = 8192;
 
-static int smb_direct_max_read_write_size = 1024 * 1024;
+static int smb_direct_max_read_write_size = 1048512;
 
 static int smb_direct_max_outstanding_rw_ops = 8;
 
@@ -1908,7 +1908,9 @@ static int smb_direct_prepare(struct ksmbd_transport *t)
 	st->max_send_size = min_t(int, st->max_send_size,
 				  le32_to_cpu(req->max_receive_size));
 	st->max_fragmented_send_size =
-			le32_to_cpu(req->max_fragmented_size);
+		le32_to_cpu(req->max_fragmented_size);
+	st->max_fragmented_recv_size =
+		(st->recv_credit_max * st->max_recv_size) / 2;
 
 	ret = smb_direct_send_negotiate_response(st, ret);
 out:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] ksmbd: smbd: create MR pool
  2022-01-07  5:45 [PATCH 1/2] ksmbd: smbd: create MR pool Hyunchul Lee
  2022-01-07  5:45 ` [PATCH 2/2] ksmbd: smbd: change the default maximum read/write, receive size Hyunchul Lee
@ 2022-01-09  2:42 ` Namjae Jeon
  1 sibling, 0 replies; 11+ messages in thread
From: Namjae Jeon @ 2022-01-09  2:42 UTC (permalink / raw)
  To: Hyunchul Lee; +Cc: linux-cifs, Sergey Senozhatsky, Steve French

2022-01-07 14:45 GMT+09:00, Hyunchul Lee <hyc.lee@gmail.com>:
> Create a memory region pool because rdma_rw_ctx_init()
> uses memory registration if memory registration yields
> better performance than using multiple SGE entries.
>
> Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] ksmbd: smbd: change the default maximum read/write, receive size
  2022-01-07  5:45 ` [PATCH 2/2] ksmbd: smbd: change the default maximum read/write, receive size Hyunchul Lee
@ 2022-01-09  2:43   ` Namjae Jeon
  2022-01-09  6:44     ` Steve French
  0 siblings, 1 reply; 11+ messages in thread
From: Namjae Jeon @ 2022-01-09  2:43 UTC (permalink / raw)
  To: Hyunchul Lee; +Cc: linux-cifs, Sergey Senozhatsky, Steve French

2022-01-07 14:45 GMT+09:00, Hyunchul Lee <hyc.lee@gmail.com>:
> Due to restriction that cannot handle multiple
> buffer descriptor structures, decrease the maximum
> read/write size for Windows clients.
>
> And set the maximum fragmented receive size
> in consideration of the receive queue size.
>
> Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] ksmbd: smbd: change the default maximum read/write, receive size
  2022-01-09  2:43   ` Namjae Jeon
@ 2022-01-09  6:44     ` Steve French
  2022-01-09 12:56       ` Namjae Jeon
  0 siblings, 1 reply; 11+ messages in thread
From: Steve French @ 2022-01-09  6:44 UTC (permalink / raw)
  To: Namjae Jeon; +Cc: Hyunchul Lee, Sergey Senozhatsky, CIFS

Do you have more detail on what the negotiated readsize/writesize
would be for Windows clients with this size? for Linux clients?

It looked like it would still be 4MB at first glance (although in
theory some Windows could do 8MB) ... I may have missed something

On Sat, Jan 8, 2022 at 8:43 PM Namjae Jeon <linkinjeon@kernel.org> wrote:
>
> 2022-01-07 14:45 GMT+09:00, Hyunchul Lee <hyc.lee@gmail.com>:
> > Due to restriction that cannot handle multiple
> > buffer descriptor structures, decrease the maximum
> > read/write size for Windows clients.
> >
> > And set the maximum fragmented receive size
> > in consideration of the receive queue size.
> >
> > Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
> Acked-by: Namjae Jeon <linkinjeon@kernel.org>



-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] ksmbd: smbd: change the default maximum read/write, receive size
  2022-01-09  6:44     ` Steve French
@ 2022-01-09 12:56       ` Namjae Jeon
  2022-01-10  1:37         ` Hyunchul Lee
  0 siblings, 1 reply; 11+ messages in thread
From: Namjae Jeon @ 2022-01-09 12:56 UTC (permalink / raw)
  To: Steve French, Hyunchul Lee; +Cc: Sergey Senozhatsky, CIFS

2022-01-09 15:44 GMT+09:00, Steve French <smfrench@gmail.com>:
> Do you have more detail on what the negotiated readsize/writesize
> would be for Windows clients with this size? for Linux clients?
Hyunchul, Please answer.

>
> It looked like it would still be 4MB at first glance (although in
> theory some Windows could do 8MB) ... I may have missed something
I understood that multiple-buffer descriptor support was required to
set a read/write size of 1MB or more. As I know, Hyunchul is currently
working on it.
It seems to be set to the smaller of max read/write size in smb-direct
negotiate and max read/write size in smb2 negotiate.

Hyunchul, I have one question more, How did you get 1048512 setting value ?
>
> On Sat, Jan 8, 2022 at 8:43 PM Namjae Jeon <linkinjeon@kernel.org> wrote:
>>
>> 2022-01-07 14:45 GMT+09:00, Hyunchul Lee <hyc.lee@gmail.com>:
>> > Due to restriction that cannot handle multiple
>> > buffer descriptor structures, decrease the maximum
>> > read/write size for Windows clients.
>> >
>> > And set the maximum fragmented receive size
>> > in consideration of the receive queue size.
>> >
>> > Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
>> Acked-by: Namjae Jeon <linkinjeon@kernel.org>
>
>
>
> --
> Thanks,
>
> Steve
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] ksmbd: smbd: change the default maximum read/write, receive size
  2022-01-09 12:56       ` Namjae Jeon
@ 2022-01-10  1:37         ` Hyunchul Lee
  2022-01-10  1:43           ` Steve French
  2022-01-17 23:33           ` Namjae Jeon
  0 siblings, 2 replies; 11+ messages in thread
From: Hyunchul Lee @ 2022-01-10  1:37 UTC (permalink / raw)
  To: Namjae Jeon; +Cc: Steve French, Sergey Senozhatsky, CIFS

2022년 1월 9일 (일) 오후 9:56, Namjae Jeon <linkinjeon@kernel.org>님이 작성:
>
> 2022-01-09 15:44 GMT+09:00, Steve French <smfrench@gmail.com>:
> > Do you have more detail on what the negotiated readsize/writesize
> > would be for Windows clients with this size? for Linux clients?
> Hyunchul, Please answer.
>

For a Linux client, if connected using smb-direct,
the size will be 1048512. But connected with multichannel,
the size will be 4MB instead of 1048512. And this causes
problems because the read/write size is bigger than 1048512.
It looks like a bug. I have to limit the ksmbd's SMB2 maximum
read/write size for a test.

For Windows clients, the actual read/write size is less than
1048512.

> >
> > It looked like it would still be 4MB at first glance (although in
> > theory some Windows could do 8MB) ... I may have missed something
> I understood that multiple-buffer descriptor support was required to
> set a read/write size of 1MB or more. As I know, Hyunchul is currently
> working on it.
> It seems to be set to the smaller of max read/write size in smb-direct
> negotiate and max read/write size in smb2 negotiate.
>
> Hyunchul, I have one question more, How did you get 1048512 setting value ?
> >

I remember when the size was 1MB, Windows clients requested read/write with
1048512 and 64.

> > On Sat, Jan 8, 2022 at 8:43 PM Namjae Jeon <linkinjeon@kernel.org> wrote:
> >>
> >> 2022-01-07 14:45 GMT+09:00, Hyunchul Lee <hyc.lee@gmail.com>:
> >> > Due to restriction that cannot handle multiple
> >> > buffer descriptor structures, decrease the maximum
> >> > read/write size for Windows clients.
> >> >
> >> > And set the maximum fragmented receive size
> >> > in consideration of the receive queue size.
> >> >
> >> > Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
> >> Acked-by: Namjae Jeon <linkinjeon@kernel.org>
> >
> >
> >
> > --
> > Thanks,
> >
> > Steve
> >



--
Thanks,
Hyunchul

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] ksmbd: smbd: change the default maximum read/write, receive size
  2022-01-10  1:37         ` Hyunchul Lee
@ 2022-01-10  1:43           ` Steve French
  2022-01-10  4:03             ` Hyunchul Lee
  2022-01-17 23:33           ` Namjae Jeon
  1 sibling, 1 reply; 11+ messages in thread
From: Steve French @ 2022-01-10  1:43 UTC (permalink / raw)
  To: Hyunchul Lee; +Cc: Namjae Jeon, Sergey Senozhatsky, CIFS

I was concerned because I saw significant improvements in large i/o
(file copy to or from the server) to Windows and Azure going to 1MB
(negotiated max read/write size), then slightly better to 2MB and
slightly better still to 4MB (was hard to show gain with 8MB in my
earlier tests though)

On Sun, Jan 9, 2022 at 7:37 PM Hyunchul Lee <hyc.lee@gmail.com> wrote:
>
> 2022년 1월 9일 (일) 오후 9:56, Namjae Jeon <linkinjeon@kernel.org>님이 작성:
> >
> > 2022-01-09 15:44 GMT+09:00, Steve French <smfrench@gmail.com>:
> > > Do you have more detail on what the negotiated readsize/writesize
> > > would be for Windows clients with this size? for Linux clients?
> > Hyunchul, Please answer.
> >
>
> For a Linux client, if connected using smb-direct,
> the size will be 1048512. But connected with multichannel,
> the size will be 4MB instead of 1048512. And this causes
> problems because the read/write size is bigger than 1048512.
> It looks like a bug. I have to limit the ksmbd's SMB2 maximum
> read/write size for a test.
>
> For Windows clients, the actual read/write size is less than
> 1048512.
>
> > >
> > > It looked like it would still be 4MB at first glance (although in
> > > theory some Windows could do 8MB) ... I may have missed something
> > I understood that multiple-buffer descriptor support was required to
> > set a read/write size of 1MB or more. As I know, Hyunchul is currently
> > working on it.
> > It seems to be set to the smaller of max read/write size in smb-direct
> > negotiate and max read/write size in smb2 negotiate.
> >
> > Hyunchul, I have one question more, How did you get 1048512 setting value ?
> > >
>
> I remember when the size was 1MB, Windows clients requested read/write with
> 1048512 and 64.
>
> > > On Sat, Jan 8, 2022 at 8:43 PM Namjae Jeon <linkinjeon@kernel.org> wrote:
> > >>
> > >> 2022-01-07 14:45 GMT+09:00, Hyunchul Lee <hyc.lee@gmail.com>:
> > >> > Due to restriction that cannot handle multiple
> > >> > buffer descriptor structures, decrease the maximum
> > >> > read/write size for Windows clients.
> > >> >
> > >> > And set the maximum fragmented receive size
> > >> > in consideration of the receive queue size.
> > >> >
> > >> > Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
> > >> Acked-by: Namjae Jeon <linkinjeon@kernel.org>
> > >
> > >
> > >
> > > --
> > > Thanks,
> > >
> > > Steve
> > >
>
>
>
> --
> Thanks,
> Hyunchul



-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] ksmbd: smbd: change the default maximum read/write, receive size
  2022-01-10  1:43           ` Steve French
@ 2022-01-10  4:03             ` Hyunchul Lee
  0 siblings, 0 replies; 11+ messages in thread
From: Hyunchul Lee @ 2022-01-10  4:03 UTC (permalink / raw)
  To: Steve French; +Cc: Namjae Jeon, Sergey Senozhatsky, CIFS

2022년 1월 10일 (월) 오전 10:43, Steve French <smfrench@gmail.com>님이 작성:
>
> I was concerned because I saw significant improvements in large i/o
> (file copy to or from the server) to Windows and Azure going to 1MB
> (negotiated max read/write size), then slightly better to 2MB and
> slightly better still to 4MB (was hard to show gain with 8MB in my
> earlier tests though)
>

This patch limits the size only when the SMB Direct protocol is used.
If handling multiple buffer descriptors is implemented, we can increase
the size.

> On Sun, Jan 9, 2022 at 7:37 PM Hyunchul Lee <hyc.lee@gmail.com> wrote:
> >
> > 2022년 1월 9일 (일) 오후 9:56, Namjae Jeon <linkinjeon@kernel.org>님이 작성:
> > >
> > > 2022-01-09 15:44 GMT+09:00, Steve French <smfrench@gmail.com>:
> > > > Do you have more detail on what the negotiated readsize/writesize
> > > > would be for Windows clients with this size? for Linux clients?
> > > Hyunchul, Please answer.
> > >
> >
> > For a Linux client, if connected using smb-direct,
> > the size will be 1048512. But connected with multichannel,
> > the size will be 4MB instead of 1048512. And this causes
> > problems because the read/write size is bigger than 1048512.
> > It looks like a bug. I have to limit the ksmbd's SMB2 maximum
> > read/write size for a test.
> >
> > For Windows clients, the actual read/write size is less than
> > 1048512.
> >
> > > >
> > > > It looked like it would still be 4MB at first glance (although in
> > > > theory some Windows could do 8MB) ... I may have missed something
> > > I understood that multiple-buffer descriptor support was required to
> > > set a read/write size of 1MB or more. As I know, Hyunchul is currently
> > > working on it.
> > > It seems to be set to the smaller of max read/write size in smb-direct
> > > negotiate and max read/write size in smb2 negotiate.
> > >
> > > Hyunchul, I have one question more, How did you get 1048512 setting value ?
> > > >
> >
> > I remember when the size was 1MB, Windows clients requested read/write with
> > 1048512 and 64.
> >
> > > > On Sat, Jan 8, 2022 at 8:43 PM Namjae Jeon <linkinjeon@kernel.org> wrote:
> > > >>
> > > >> 2022-01-07 14:45 GMT+09:00, Hyunchul Lee <hyc.lee@gmail.com>:
> > > >> > Due to restriction that cannot handle multiple
> > > >> > buffer descriptor structures, decrease the maximum
> > > >> > read/write size for Windows clients.
> > > >> >
> > > >> > And set the maximum fragmented receive size
> > > >> > in consideration of the receive queue size.
> > > >> >
> > > >> > Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
> > > >> Acked-by: Namjae Jeon <linkinjeon@kernel.org>
> > > >
> > > >
> > > >
> > > > --
> > > > Thanks,
> > > >
> > > > Steve
> > > >
> >
> >
> >
> > --
> > Thanks,
> > Hyunchul
>
>
>
> --
> Thanks,
>
> Steve



-- 
Thanks,
Hyunchul

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] ksmbd: smbd: change the default maximum read/write, receive size
  2022-01-10  1:37         ` Hyunchul Lee
  2022-01-10  1:43           ` Steve French
@ 2022-01-17 23:33           ` Namjae Jeon
  2022-01-18  6:40             ` Hyunchul Lee
  1 sibling, 1 reply; 11+ messages in thread
From: Namjae Jeon @ 2022-01-17 23:33 UTC (permalink / raw)
  To: Hyunchul Lee; +Cc: Steve French, Sergey Senozhatsky, CIFS

2022-01-10 10:37 GMT+09:00, Hyunchul Lee <hyc.lee@gmail.com>:
> 2022년 1월 9일 (일) 오후 9:56, Namjae Jeon <linkinjeon@kernel.org>님이 작성:
>>
>> 2022-01-09 15:44 GMT+09:00, Steve French <smfrench@gmail.com>:
>> > Do you have more detail on what the negotiated readsize/writesize
>> > would be for Windows clients with this size? for Linux clients?
>> Hyunchul, Please answer.
>>
>
> For a Linux client, if connected using smb-direct,
> the size will be 1048512. But connected with multichannel,
> the size will be 4MB instead of 1048512. And this causes
> problems because the read/write size is bigger than 1048512.
> It looks like a bug. I have to limit the ksmbd's SMB2 maximum
> read/write size for a test.
>
> For Windows clients, the actual read/write size is less than
> 1048512.
In the case of my Chelsio device, Need to set it to about
512K(512*1024 - 64) for it to work.
The 1048512 value seems insufficient to cover all devices. Is there
any other way to set the minimum read/write value? Calibrate this
minimum value by looking at
the device information? For example variables in ib_dev->attrs.

>
>> >
>> > It looked like it would still be 4MB at first glance (although in
>> > theory some Windows could do 8MB) ... I may have missed something
>> I understood that multiple-buffer descriptor support was required to
>> set a read/write size of 1MB or more. As I know, Hyunchul is currently
>> working on it.
>> It seems to be set to the smaller of max read/write size in smb-direct
>> negotiate and max read/write size in smb2 negotiate.
>>
>> Hyunchul, I have one question more, How did you get 1048512 setting value
>> ?
>> >
>
> I remember when the size was 1MB, Windows clients requested read/write with
> 1048512 and 64.
>
>> > On Sat, Jan 8, 2022 at 8:43 PM Namjae Jeon <linkinjeon@kernel.org>
>> > wrote:
>> >>
>> >> 2022-01-07 14:45 GMT+09:00, Hyunchul Lee <hyc.lee@gmail.com>:
>> >> > Due to restriction that cannot handle multiple
>> >> > buffer descriptor structures, decrease the maximum
>> >> > read/write size for Windows clients.
>> >> >
>> >> > And set the maximum fragmented receive size
>> >> > in consideration of the receive queue size.
>> >> >
>> >> > Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
>> >> Acked-by: Namjae Jeon <linkinjeon@kernel.org>
>> >
>> >
>> >
>> > --
>> > Thanks,
>> >
>> > Steve
>> >
>
>
>
> --
> Thanks,
> Hyunchul
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] ksmbd: smbd: change the default maximum read/write, receive size
  2022-01-17 23:33           ` Namjae Jeon
@ 2022-01-18  6:40             ` Hyunchul Lee
  0 siblings, 0 replies; 11+ messages in thread
From: Hyunchul Lee @ 2022-01-18  6:40 UTC (permalink / raw)
  To: Namjae Jeon; +Cc: Steve French, Sergey Senozhatsky, CIFS

2022년 1월 18일 (화) 오전 8:33, Namjae Jeon <linkinjeon@kernel.org>님이 작성:
>
> 2022-01-10 10:37 GMT+09:00, Hyunchul Lee <hyc.lee@gmail.com>:
> > 2022년 1월 9일 (일) 오후 9:56, Namjae Jeon <linkinjeon@kernel.org>님이 작성:
> >>
> >> 2022-01-09 15:44 GMT+09:00, Steve French <smfrench@gmail.com>:
> >> > Do you have more detail on what the negotiated readsize/writesize
> >> > would be for Windows clients with this size? for Linux clients?
> >> Hyunchul, Please answer.
> >>
> >
> > For a Linux client, if connected using smb-direct,
> > the size will be 1048512. But connected with multichannel,
> > the size will be 4MB instead of 1048512. And this causes
> > problems because the read/write size is bigger than 1048512.
> > It looks like a bug. I have to limit the ksmbd's SMB2 maximum
> > read/write size for a test.
> >
> > For Windows clients, the actual read/write size is less than
> > 1048512.
> In the case of my Chelsio device, Need to set it to about
> 512K(512*1024 - 64) for it to work.
> The 1048512 value seems insufficient to cover all devices. Is there
> any other way to set the minimum read/write value? Calibrate this
> minimum value by looking at
> the device information? For example variables in ib_dev->attrs.
>

Let me check it. But I think multiple buffer descriptors caused
this problem. because of a client's device limitation, a client
seems to send a read/write request with multiple buffer descriptors
for sending 1048512 bytes.

To check this assumption, can you tell me the buffer descriptors'
content when the default read/write size is 1048512?

> >
> >> >
> >> > It looked like it would still be 4MB at first glance (although in
> >> > theory some Windows could do 8MB) ... I may have missed something
> >> I understood that multiple-buffer descriptor support was required to
> >> set a read/write size of 1MB or more. As I know, Hyunchul is currently
> >> working on it.
> >> It seems to be set to the smaller of max read/write size in smb-direct
> >> negotiate and max read/write size in smb2 negotiate.
> >>
> >> Hyunchul, I have one question more, How did you get 1048512 setting value
> >> ?
> >> >
> >
> > I remember when the size was 1MB, Windows clients requested read/write with
> > 1048512 and 64.
> >
> >> > On Sat, Jan 8, 2022 at 8:43 PM Namjae Jeon <linkinjeon@kernel.org>
> >> > wrote:
> >> >>
> >> >> 2022-01-07 14:45 GMT+09:00, Hyunchul Lee <hyc.lee@gmail.com>:
> >> >> > Due to restriction that cannot handle multiple
> >> >> > buffer descriptor structures, decrease the maximum
> >> >> > read/write size for Windows clients.
> >> >> >
> >> >> > And set the maximum fragmented receive size
> >> >> > in consideration of the receive queue size.
> >> >> >
> >> >> > Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
> >> >> Acked-by: Namjae Jeon <linkinjeon@kernel.org>
> >> >
> >> >
> >> >
> >> > --
> >> > Thanks,
> >> >
> >> > Steve
> >> >
> >
> >
> >
> > --
> > Thanks,
> > Hyunchul
> >



-- 
Thanks,
Hyunchul

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-01-18  6:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-07  5:45 [PATCH 1/2] ksmbd: smbd: create MR pool Hyunchul Lee
2022-01-07  5:45 ` [PATCH 2/2] ksmbd: smbd: change the default maximum read/write, receive size Hyunchul Lee
2022-01-09  2:43   ` Namjae Jeon
2022-01-09  6:44     ` Steve French
2022-01-09 12:56       ` Namjae Jeon
2022-01-10  1:37         ` Hyunchul Lee
2022-01-10  1:43           ` Steve French
2022-01-10  4:03             ` Hyunchul Lee
2022-01-17 23:33           ` Namjae Jeon
2022-01-18  6:40             ` Hyunchul Lee
2022-01-09  2:42 ` [PATCH 1/2] ksmbd: smbd: create MR pool Namjae Jeon

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 NNTP newsgroup(s).