[Patch v4 22/22] CIFS: SMBD: Add SMBDirect debug counters

2017-10-01 Thread Long Li
From: Long Li Export SMBDirect debug counters to /proc/fs/cifs/DebugData. Those are used for debugging, troubleshooting and profiling. Signed-off-by: Long Li --- fs/cifs/cifs_debug.c | 87 1 file changed, 87 insertions(+) diff --git a/fs

[Patch v4 09/22] CIFS: SMBD: Implement function to destroy a SMBDirect connection

2017-10-01 Thread Long Li
From: Long Li Add function to tear down a SMBDirect connection. This is used by upper layer to free all SMBDirect connection and transport resources. Signed-off-by: Long Li --- fs/cifs/smbdirect.c | 16 fs/cifs/smbdirect.h | 3 +++ 2 files changed, 19 insertions(+) diff

[Patch v4 19/22] CIFS: SMBD: Add parameter rdata to smb2_new_read_req

2017-10-01 Thread Long Li
From: Long Li This patch is for preparing upper layer for doing SMB read via RDMA write. When we assemble the SMB read packet header, we need to know the I/O layout if this request is to use a RDMA write. rdata has all the information we need for memory registration. Add rdata

[Patch v4 00/22] CIFS: Implement SMBDirect

2017-10-01 Thread Long Li
From: Long Li <lon...@microsoft.com> Starting with SMB2 dialect 3.0, Microsoft introduced SMBDirect transport protocol for transferring upper layer (SMB2) payload over RDMA via Infiniband, RoCE or iWARP. The prococol is published in [MS-SMBD] (https://msdn.microsoft.com/en-us/library/hh

[Patch v4 00/22] CIFS: Implement SMBDirect

2017-10-01 Thread Long Li
From: Long Li Starting with SMB2 dialect 3.0, Microsoft introduced SMBDirect transport protocol for transferring upper layer (SMB2) payload over RDMA via Infiniband, RoCE or iWARP. The prococol is published in [MS-SMBD] (https://msdn.microsoft.com/en-us/library/hh536346.aspx). Patch v2 added

[Patch v4 13/22] CIFS: SMBD: Upper layer receives data via RDMA receive

2017-10-01 Thread Long Li
From: Long Li <lon...@microsoft.com> With SMBDirect connected, use it for receiving data via RDMA receive. Signed-off-by: Long Li <lon...@microsoft.com> --- fs/cifs/connect.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/cifs/connect.c b/fs/cifs/con

[Patch v4 13/22] CIFS: SMBD: Upper layer receives data via RDMA receive

2017-10-01 Thread Long Li
From: Long Li With SMBDirect connected, use it for receiving data via RDMA receive. Signed-off-by: Long Li --- fs/cifs/connect.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 1a9f22f..8026682 100644 --- a/fs/cifs/connect.c

[Patch v4 17/22] CIFS: SMBD: Implement RDMA memory registration

2017-10-01 Thread Long Li
From: Long Li <lon...@microsoft.com> Memory registration is used for transferring payload via RDMA read or write. After I/O is done, memory registrations are recovered and reused. This process can be time consuming and is done in a work queue. Signed-off-by: Long Li <lon...@micr

[Patch v4 17/22] CIFS: SMBD: Implement RDMA memory registration

2017-10-01 Thread Long Li
From: Long Li Memory registration is used for transferring payload via RDMA read or write. After I/O is done, memory registrations are recovered and reused. This process can be time consuming and is done in a work queue. Signed-off-by: Long Li --- fs/cifs/smbdirect.c | 428

[Patch v4 15/22] CIFS: SMBD: Upper layer sends data via RDMA send

2017-10-01 Thread Long Li
From: Long Li <lon...@microsoft.com> With SMBDirect connected, use it for sending data via RDMA send. Signed-off-by: Long Li <lon...@microsoft.com> --- fs/cifs/transport.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 7efb

[Patch v4 20/22] CIFS: SMBD: Read correct returned data length for RDMA write (SMB read) I/O

2017-10-01 Thread Long Li
From: Long Li <lon...@microsoft.com> This patch is for preparing upper layer for doing SMB read via RDMA write. When RDMA write is used for SMB read, the returned data length is in DataRemaining in the response packet. Reading it properly by adding a parameter to specifiy where the returne

[Patch v4 15/22] CIFS: SMBD: Upper layer sends data via RDMA send

2017-10-01 Thread Long Li
From: Long Li With SMBDirect connected, use it for sending data via RDMA send. Signed-off-by: Long Li --- fs/cifs/transport.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 7efbab0..3a9b5a0 100644 --- a/fs/cifs/transport.c +++ b/fs

[Patch v4 20/22] CIFS: SMBD: Read correct returned data length for RDMA write (SMB read) I/O

2017-10-01 Thread Long Li
From: Long Li This patch is for preparing upper layer for doing SMB read via RDMA write. When RDMA write is used for SMB read, the returned data length is in DataRemaining in the response packet. Reading it properly by adding a parameter to specifiy where the returned data length is. Signed

[Patch v4 18/22] CIFS: SMBD: Upper layer performs SMB write via RDMA read through memory registration

2017-10-01 Thread Long Li
From: Long Li <lon...@microsoft.com> When sending I/O, if size is larger than rdma_readwrite_threshold we prepare to send SMB write packet for a RDMA read via memory registration. The actual I/O is done by remote peer through local RDMA hardware. Modify the relevant fields in the

[Patch v4 18/22] CIFS: SMBD: Upper layer performs SMB write via RDMA read through memory registration

2017-10-01 Thread Long Li
From: Long Li When sending I/O, if size is larger than rdma_readwrite_threshold we prepare to send SMB write packet for a RDMA read via memory registration. The actual I/O is done by remote peer through local RDMA hardware. Modify the relevant fields in the packet accordingly, and append

RE: [Patch v2 00/19] CIFS: Implement SMBDirect

2017-09-05 Thread Long Li
> Hey Long, how do I request a CIFS RDMA mount from the Linux client? Is > there a mount.cifs option? If so, where can I get the mount.cifs code that > enables this? Or is there some other way? You can use "-o rdma" in the mount option to connect to RDMA. For example: "mount.cifs -o

RE: [Patch v2 00/19] CIFS: Implement SMBDirect

2017-09-05 Thread Long Li
> Hey Long, how do I request a CIFS RDMA mount from the Linux client? Is > there a mount.cifs option? If so, where can I get the mount.cifs code that > enables this? Or is there some other way? You can use "-o rdma" in the mount option to connect to RDMA. For example: "mount.cifs -o

RE: [PATCH] storvsc: fix memory leak on ring buffer busy

2017-08-30 Thread Long Li
> Long, > > >> Which kernel version is this patch aimed at? > > > > Martin, thanks for pointing this out. This should also go to stable > > trees. > > The reason I asked is that it didn't apply to neither fixes, nor for-next. > > I applied it to 4.13/scsi-fixes by hand and added a stable tag.

RE: [PATCH] storvsc: fix memory leak on ring buffer busy

2017-08-30 Thread Long Li
> Long, > > >> Which kernel version is this patch aimed at? > > > > Martin, thanks for pointing this out. This should also go to stable > > trees. > > The reason I asked is that it didn't apply to neither fixes, nor for-next. > > I applied it to 4.13/scsi-fixes by hand and added a stable tag.

RE: [Patch v3 00/19] CIFS: Implement SMB Direct

2017-08-30 Thread Long Li
> -Original Message- > From: Long Li [mailto:lon...@exchange.microsoft.com] > Sent: Tuesday, August 29, 2017 12:29 PM > To: Steve French <sfre...@samba.org>; linux-c...@vger.kernel.org; samba- > techni...@lists.samba.org; linux-kernel@vger.kernel.org; linux- &

RE: [Patch v3 00/19] CIFS: Implement SMB Direct

2017-08-30 Thread Long Li
> -Original Message- > From: Long Li [mailto:lon...@exchange.microsoft.com] > Sent: Tuesday, August 29, 2017 12:29 PM > To: Steve French ; linux-c...@vger.kernel.org; samba- > techni...@lists.samba.org; linux-kernel@vger.kernel.org; linux- > r...@vger.kernel.org; Chris

RE: [Patch v3 02/19] CIFS: SMBD: Add SMBDirect protocol and transport constants

2017-08-30 Thread Long Li
> -Original Message- > From: Pavel Shilovsky [mailto:piastr...@gmail.com] > Sent: Wednesday, August 30, 2017 11:19 AM > To: Long Li <lon...@microsoft.com> > Cc: Steve French <sfre...@samba.org>; linux-cifs c...@vger.kernel.org>; samba-technical <samba-tec

RE: [Patch v3 02/19] CIFS: SMBD: Add SMBDirect protocol and transport constants

2017-08-30 Thread Long Li
> -Original Message- > From: Pavel Shilovsky [mailto:piastr...@gmail.com] > Sent: Wednesday, August 30, 2017 11:19 AM > To: Long Li > Cc: Steve French ; linux-cifs c...@vger.kernel.org>; samba-technical ; > Kernel Mailing List ; linux- > r...@vger.kernel.org;

RE: [[PATCH v1] 15/37] [CIFS] SMBD: Post a SMBD data transfer message with data payload

2017-08-30 Thread Long Li
> -Original Message- > From: Christoph Hellwig [mailto:h...@infradead.org] > Sent: Wednesday, August 30, 2017 1:52 AM > To: Long Li <lon...@microsoft.com> > Cc: Christoph Hellwig <h...@infradead.org>; Steve French > <sfre...@samba.org>; linux-c

RE: [[PATCH v1] 15/37] [CIFS] SMBD: Post a SMBD data transfer message with data payload

2017-08-30 Thread Long Li
> -Original Message- > From: Christoph Hellwig [mailto:h...@infradead.org] > Sent: Wednesday, August 30, 2017 1:52 AM > To: Long Li > Cc: Christoph Hellwig ; Steve French > ; linux-c...@vger.kernel.org; samba- > techni...@lists.samba.org; linux-kernel@vger.ker

RE: [PATCH] storvsc: fix memory leak on ring buffer busy

2017-08-29 Thread Long Li
> -Original Message- > From: Martin K. Petersen [mailto:martin.peter...@oracle.com] > Sent: Tuesday, August 29, 2017 6:31 PM > To: Long Li <lon...@microsoft.com> > Cc: KY Srinivasan <k...@microsoft.com>; Haiyang Zhang > <haiya...@microsoft.com>

RE: [PATCH] storvsc: fix memory leak on ring buffer busy

2017-08-29 Thread Long Li
> -Original Message- > From: Martin K. Petersen [mailto:martin.peter...@oracle.com] > Sent: Tuesday, August 29, 2017 6:31 PM > To: Long Li > Cc: KY Srinivasan ; Haiyang Zhang > ; James E . J . Bottomley > ; de...@linuxdriverproject.org; linux- > s...@vger.

RE: [[PATCH v1] 05/37] [CIFS] SMBD: Implement API for upper layer to create SMBD transport and establish RDMA connection

2017-08-29 Thread Long Li
> -Original Message- > From: Tom Talpey > Sent: Monday, August 14, 2017 12:55 PM > To: Long Li <lon...@microsoft.com>; Steve French <sfre...@samba.org>; > linux-c...@vger.kernel.org; samba-techni...@lists.samba.org; linux- > ker...@vger.kernel.org; linux-

RE: [[PATCH v1] 05/37] [CIFS] SMBD: Implement API for upper layer to create SMBD transport and establish RDMA connection

2017-08-29 Thread Long Li
> -Original Message- > From: Tom Talpey > Sent: Monday, August 14, 2017 12:55 PM > To: Long Li ; Steve French ; > linux-c...@vger.kernel.org; samba-techni...@lists.samba.org; linux- > ker...@vger.kernel.org; linux-r...@vger.kernel.org > Subject: RE: [[PATCH v

RE: [[PATCH v1] 18/37] [CIFS] SMBD: Implement API for upper layer to send data

2017-08-29 Thread Long Li
> -Original Message- > From: Tom Talpey > Sent: Monday, August 14, 2017 1:44 PM > To: Long Li <lon...@microsoft.com>; Steve French <sfre...@samba.org>; > linux-c...@vger.kernel.org; samba-techni...@lists.samba.org; linux- > ker...@vger.kernel.org; linux-r...

RE: [[PATCH v1] 18/37] [CIFS] SMBD: Implement API for upper layer to send data

2017-08-29 Thread Long Li
> -Original Message- > From: Tom Talpey > Sent: Monday, August 14, 2017 1:44 PM > To: Long Li ; Steve French ; > linux-c...@vger.kernel.org; samba-techni...@lists.samba.org; linux- > ker...@vger.kernel.org; linux-r...@vger.kernel.org > Subject: RE: [[PATCH v

RE: [[PATCH v1] 15/37] [CIFS] SMBD: Post a SMBD data transfer message with data payload

2017-08-29 Thread Long Li
> -Original Message- > From: Christoph Hellwig [mailto:h...@infradead.org] > Sent: Sunday, August 13, 2017 3:24 AM > To: Long Li <lon...@microsoft.com> > Cc: Steve French <sfre...@samba.org>; linux-c...@vger.kernel.org; samba- > techni...@lists.samba.org; linu

RE: [[PATCH v1] 15/37] [CIFS] SMBD: Post a SMBD data transfer message with data payload

2017-08-29 Thread Long Li
> -Original Message- > From: Christoph Hellwig [mailto:h...@infradead.org] > Sent: Sunday, August 13, 2017 3:24 AM > To: Long Li > Cc: Steve French ; linux-c...@vger.kernel.org; samba- > techni...@lists.samba.org; linux-kernel@vger.kernel.org; Long Li > > Subjec

RE: [Patch v3 11/19] CIFS: SMBD: Define memory registration for I/O data

2017-08-29 Thread Long Li
> -Original Message- > From: Pavel Shilovsky [mailto:piastr...@gmail.com] > Sent: Tuesday, August 29, 2017 5:49 PM > To: Long Li <lon...@microsoft.com> > Cc: Steve French <sfre...@samba.org>; linux-cifs c...@vger.kernel.org>; samba-technical <samba-tec

RE: [Patch v3 11/19] CIFS: SMBD: Define memory registration for I/O data

2017-08-29 Thread Long Li
> -Original Message- > From: Pavel Shilovsky [mailto:piastr...@gmail.com] > Sent: Tuesday, August 29, 2017 5:49 PM > To: Long Li > Cc: Steve French ; linux-cifs c...@vger.kernel.org>; samba-technical ; > Kernel Mailing List ; linux- > r...@vger.kernel.org;

RE: [Patch v3 12/19] CIFS: SMBD: Fix the definition for SMB2_CHANNEL_RDMA_V1_INVALIDATE

2017-08-29 Thread Long Li
> -Original Message- > From: Pavel Shilovsky [mailto:piastr...@gmail.com] > Sent: Tuesday, August 29, 2017 5:50 PM > To: Long Li <lon...@microsoft.com> > Cc: Steve French <sfre...@samba.org>; linux-cifs c...@vger.kernel.org>; samba-technical <samba-tec

RE: [Patch v3 12/19] CIFS: SMBD: Fix the definition for SMB2_CHANNEL_RDMA_V1_INVALIDATE

2017-08-29 Thread Long Li
> -Original Message- > From: Pavel Shilovsky [mailto:piastr...@gmail.com] > Sent: Tuesday, August 29, 2017 5:50 PM > To: Long Li > Cc: Steve French ; linux-cifs c...@vger.kernel.org>; samba-technical ; > Kernel Mailing List ; linux- > r...@vger.kernel.org;

RE: [Patch v3 06/19] CIFS: SMBD: Reconnect to SMBDirect session

2017-08-29 Thread Long Li
> -Original Message- > From: Pavel Shilovsky [mailto:piastr...@gmail.com] > Sent: Tuesday, August 29, 2017 4:15 PM > To: Long Li <lon...@microsoft.com> > Cc: Steve French <sfre...@samba.org>; linux-cifs c...@vger.kernel.org>; samba-technical <samba-tec

RE: [Patch v3 06/19] CIFS: SMBD: Reconnect to SMBDirect session

2017-08-29 Thread Long Li
> -Original Message- > From: Pavel Shilovsky [mailto:piastr...@gmail.com] > Sent: Tuesday, August 29, 2017 4:15 PM > To: Long Li > Cc: Steve French ; linux-cifs c...@vger.kernel.org>; samba-technical ; > Kernel Mailing List ; linux- > r...@vger.kernel.org;

RE: [Patch v3 04/19] CIFS: SMBD: Add SMBDirect transport to SMB connection and Makefile

2017-08-29 Thread Long Li
> -Original Message- > From: Pavel Shilovsky [mailto:piastr...@gmail.com] > Sent: Tuesday, August 29, 2017 4:12 PM > To: Long Li <lon...@microsoft.com> > Cc: Steve French <sfre...@samba.org>; linux-cifs c...@vger.kernel.org>; samba-technical <samba-tec

RE: [Patch v3 04/19] CIFS: SMBD: Add SMBDirect transport to SMB connection and Makefile

2017-08-29 Thread Long Li
> -Original Message- > From: Pavel Shilovsky [mailto:piastr...@gmail.com] > Sent: Tuesday, August 29, 2017 4:12 PM > To: Long Li > Cc: Steve French ; linux-cifs c...@vger.kernel.org>; samba-technical ; > Kernel Mailing List ; linux- > r...@vger.kernel.org; Christ

RE: [Patch v3 02/19] CIFS: SMBD: Add SMBDirect protocol and transport constants

2017-08-29 Thread Long Li
> -Original Message- > From: Pavel Shilovsky [mailto:piastr...@gmail.com] > Sent: Tuesday, August 29, 2017 3:45 PM > To: Long Li <lon...@microsoft.com> > Cc: Steve French <sfre...@samba.org>; linux-cifs c...@vger.kernel.org>; samba-technical <samba-tec

RE: [Patch v3 02/19] CIFS: SMBD: Add SMBDirect protocol and transport constants

2017-08-29 Thread Long Li
> -Original Message- > From: Pavel Shilovsky [mailto:piastr...@gmail.com] > Sent: Tuesday, August 29, 2017 3:45 PM > To: Long Li > Cc: Steve French ; linux-cifs c...@vger.kernel.org>; samba-technical ; > Kernel Mailing List ; linux- > r...@vger.kernel.org; Christ

RE: [Patch v3 01/19] CIFS: Add rdma mount option

2017-08-29 Thread Long Li
> -Original Message- > From: Pavel Shilovsky [mailto:piastr...@gmail.com] > Sent: Tuesday, August 29, 2017 3:37 PM > To: Long Li <lon...@microsoft.com> > Cc: Steve French <sfre...@samba.org>; linux-cifs c...@vger.kernel.org>; samba-technical <samba-tec

RE: [Patch v3 01/19] CIFS: Add rdma mount option

2017-08-29 Thread Long Li
> -Original Message- > From: Pavel Shilovsky [mailto:piastr...@gmail.com] > Sent: Tuesday, August 29, 2017 3:37 PM > To: Long Li > Cc: Steve French ; linux-cifs c...@vger.kernel.org>; samba-technical ; > Kernel Mailing List ; linux- > r...@vger.kernel.org;

[Patch v3 03/19] CIFS: SMBD: Implement SMBDirect transport

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> Add code to implement SMBDirect transport and protocol. 1. Add transport APIs in the header file. Upper layer code uses transport through the APIs. Those include: Connection management: smbd_get_connection smbd_reconnect smbd_destroy Transfer p

[Patch v3 03/19] CIFS: SMBD: Implement SMBDirect transport

2017-08-29 Thread Long Li
From: Long Li Add code to implement SMBDirect transport and protocol. 1. Add transport APIs in the header file. Upper layer code uses transport through the APIs. Those include: Connection management: smbd_get_connection smbd_reconnect smbd_destroy Transfer payload through RDMA send/recv

[Patch v3 06/19] CIFS: SMBD: Reconnect to SMBDirect session

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> Do a reconnect on SMBDirect when it is used as the connection. Reconnect can happen for many reasons and it's mostly the decision of upper layer SMB2 not SMBDirect. Signed-off-by: Long Li <lon...@microsoft.com> --- fs/cifs/connect.c | 6 ++

[Patch v3 06/19] CIFS: SMBD: Reconnect to SMBDirect session

2017-08-29 Thread Long Li
From: Long Li Do a reconnect on SMBDirect when it is used as the connection. Reconnect can happen for many reasons and it's mostly the decision of upper layer SMB2 not SMBDirect. Signed-off-by: Long Li --- fs/cifs/connect.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff

[Patch v3 01/19] CIFS: Add rdma mount option

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> Add "rdma" to CIFS mount options to connect to SMB Direct. Add checks to validate this is used on SMB 3.X dialects. To connect to SMBDirect, use "mount.cifs -o rdma,vers=3.x". At the time of this patch, 3.x can be 3.0, 3.02 or 3.1.

[Patch v3 01/19] CIFS: Add rdma mount option

2017-08-29 Thread Long Li
From: Long Li Add "rdma" to CIFS mount options to connect to SMB Direct. Add checks to validate this is used on SMB 3.X dialects. To connect to SMBDirect, use "mount.cifs -o rdma,vers=3.x". At the time of this patch, 3.x can be 3.0, 3.02 or 3.1.1. Signed-off-by: L

[Patch v3 05/19] CIFS: SMBD: Connect to SMBDirect session

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> When "rdma" is specified in the mount option, CIFS attempts to connect to SMBDirect instead of TCP socket. Signed-off-by: Long Li <lon...@microsoft.com> --- fs/cifs/connect.c | 15 +++ 1 file changed, 15 insertions(+)

[Patch v3 05/19] CIFS: SMBD: Connect to SMBDirect session

2017-08-29 Thread Long Li
From: Long Li When "rdma" is specified in the mount option, CIFS attempts to connect to SMBDirect instead of TCP socket. Signed-off-by: Long Li --- fs/cifs/connect.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c ind

[Patch v3 10/19] CIFS: SMBD: Send data through SMBDirect

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> With SMBDirect connected, use it for sending data via RDMA send. Signed-off-by: Long Li <lon...@microsoft.com> --- fs/cifs/transport.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index ba62

[Patch v3 10/19] CIFS: SMBD: Send data through SMBDirect

2017-08-29 Thread Long Li
From: Long Li With SMBDirect connected, use it for sending data via RDMA send. Signed-off-by: Long Li --- fs/cifs/transport.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index ba62aaf..bddb699 100644 --- a/fs/cifs/transport.c +++ b/fs

[Patch v3 12/19] CIFS: SMBD: Fix the definition for SMB2_CHANNEL_RDMA_V1_INVALIDATE

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> The channel value for requesting server remote invalidating local memory registration should be 0x0002 Signed-off-by: Long Li <lon...@microsoft.com> --- fs/cifs/smb2pdu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

[Patch v3 12/19] CIFS: SMBD: Fix the definition for SMB2_CHANNEL_RDMA_V1_INVALIDATE

2017-08-29 Thread Long Li
From: Long Li The channel value for requesting server remote invalidating local memory registration should be 0x0002 Signed-off-by: Long Li --- fs/cifs/smb2pdu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index 18700fd

[Patch v3 07/19] CIFS: SMBD: Destroy SMBDirect session on shutdown or umount

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> When CIFS wants to umount, call shutdown on transport when SMBDirect is used. Signed-off-by: Long Li <lon...@microsoft.com> --- fs/cifs/connect.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c i

[Patch v3 07/19] CIFS: SMBD: Destroy SMBDirect session on shutdown or umount

2017-08-29 Thread Long Li
From: Long Li When CIFS wants to umount, call shutdown on transport when SMBDirect is used. Signed-off-by: Long Li --- fs/cifs/connect.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 341a3fd..4f62337 100644 --- a/fs/cifs/connect.c +++ b

[Patch v3 13/19] CIFS: SMBD: Implement SMB write via RDMA read through memory registration

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> When sending I/O, if size is larger than rdma_readwrite_threshold we prepare to send SMB write packet for a RDMA read via memory registration. The actual I/O is done by remote peer through local RDMA hardware. Modify the relevant fields in the

[Patch v3 13/19] CIFS: SMBD: Implement SMB write via RDMA read through memory registration

2017-08-29 Thread Long Li
From: Long Li When sending I/O, if size is larger than rdma_readwrite_threshold we prepare to send SMB write packet for a RDMA read via memory registration. The actual I/O is done by remote peer through local RDMA hardware. Modify the relevant fields in the packet accordingly, and append

[Patch v3 08/19] CIFS: SMBD: Set SMBDirect maximum read or write size for I/O

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> When connecting over SMBDirect, the transport negotiates its maximum I/O sizes with the server and determines how to choose to do RDMA send/recv vs read/write. Expose these maximum I/O sizes to upper layer so we will get the correct sized payloads. Sign

[Patch v3 08/19] CIFS: SMBD: Set SMBDirect maximum read or write size for I/O

2017-08-29 Thread Long Li
From: Long Li When connecting over SMBDirect, the transport negotiates its maximum I/O sizes with the server and determines how to choose to do RDMA send/recv vs read/write. Expose these maximum I/O sizes to upper layer so we will get the correct sized payloads. Signed-off-by: Long Li --- fs

[Patch v3 14/19] CIFS: SMBD: Deregister memory on finishing SMB write

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> On write I/O finish, deregister the memory region if this was for a RDMA read. If remote invalidation is not used, the call to smbd_deregister_mr will do local invalidation and possibly wait. Memory region is normally deregistered in MID callback a

[Patch v3 14/19] CIFS: SMBD: Deregister memory on finishing SMB write

2017-08-29 Thread Long Li
From: Long Li On write I/O finish, deregister the memory region if this was for a RDMA read. If remote invalidation is not used, the call to smbd_deregister_mr will do local invalidation and possibly wait. Memory region is normally deregistered in MID callback as soon as it's used

[Patch v3 02/19] CIFS: SMBD: Add SMBDirect protocol and transport constants

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> To prepare for protocol implementation, add constants and user-configurable values in the SMBDirect protocol. Signed-off-by: Long Li <lon...@microsoft.com> --- fs/cifs/smbdirect.c | 78 ++

[Patch v3 02/19] CIFS: SMBD: Add SMBDirect protocol and transport constants

2017-08-29 Thread Long Li
From: Long Li To prepare for protocol implementation, add constants and user-configurable values in the SMBDirect protocol. Signed-off-by: Long Li --- fs/cifs/smbdirect.c | 78 + fs/cifs/smbdirect.h | 20 ++ 2 files changed, 98

[Patch v3 11/19] CIFS: SMBD: Define memory registration for I/O data

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> To prepare for RDMA read/write using memory registration, add memory registartion pointers to upper layer data I/O context. Signed-off-by: Long Li <lon...@microsoft.com> --- fs/cifs/cifsglob.h | 2 ++ 1 file changed, 2 insertions(+) diff --g

[Patch v3 11/19] CIFS: SMBD: Define memory registration for I/O data

2017-08-29 Thread Long Li
From: Long Li To prepare for RDMA read/write using memory registration, add memory registartion pointers to upper layer data I/O context. Signed-off-by: Long Li --- fs/cifs/cifsglob.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index dc5404d

[Patch v3 15/19] CIFS: SMBD: Add parameter rdata to smb2_new_read_req

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> When we assemble the SMB read packet header, we need to know the I/O layout if this request is to use a RDMA write. rdata has all the information we need for memory registration. Add rdata to smb2_new_read_req. Signed-off-by: Long Li <lon...@micr

[Patch v3 15/19] CIFS: SMBD: Add parameter rdata to smb2_new_read_req

2017-08-29 Thread Long Li
From: Long Li When we assemble the SMB read packet header, we need to know the I/O layout if this request is to use a RDMA write. rdata has all the information we need for memory registration. Add rdata to smb2_new_read_req. Signed-off-by: Long Li --- fs/cifs/smb2pdu.c | 14 +- 1

[Patch v3 17/19] CIFS: SMBD: Implement SMB read via RDMA write through memory registration

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> If I/O size is larger than rdma_readwrite_threshold, use RDMA write for SMB read by specifying channel SMB2_CHANNEL_RDMA_V1 or SMB2_CHANNEL_RDMA_V1_INVALIDATE in the SMB packet, depending on SMB dialect used. Append a smbd_buffer_descriptor_v1 to t

[Patch v3 17/19] CIFS: SMBD: Implement SMB read via RDMA write through memory registration

2017-08-29 Thread Long Li
From: Long Li If I/O size is larger than rdma_readwrite_threshold, use RDMA write for SMB read by specifying channel SMB2_CHANNEL_RDMA_V1 or SMB2_CHANNEL_RDMA_V1_INVALIDATE in the SMB packet, depending on SMB dialect used. Append a smbd_buffer_descriptor_v1 to the end of the SMB packet and fill

[Patch v3 00/19] CIFS: Implement SMB Direct

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> Starting with SMB2 dialect 3.0, Microsoft introduced SMBDirect transport protocol for transferring upper layer (SMB2) payload over RDMA via Infiniband, RoCE or iWARP. The prococol is published in [MS-SMBD] (https://msdn.microsoft.com/en-us/library/hh

[Patch v3 00/19] CIFS: Implement SMB Direct

2017-08-29 Thread Long Li
From: Long Li Starting with SMB2 dialect 3.0, Microsoft introduced SMBDirect transport protocol for transferring upper layer (SMB2) payload over RDMA via Infiniband, RoCE or iWARP. The prococol is published in [MS-SMBD] (https://msdn.microsoft.com/en-us/library/hh536346.aspx). Patch v2 added

[Patch v3 09/19] CIFS: SMBD: Receive data from SMBDirect

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> With SMBDirect connected, use it for receiving data via RDMA recv. Signed-off-by: Long Li <lon...@microsoft.com> --- fs/cifs/connect.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c i

[Patch v3 09/19] CIFS: SMBD: Receive data from SMBDirect

2017-08-29 Thread Long Li
From: Long Li With SMBDirect connected, use it for receiving data via RDMA recv. Signed-off-by: Long Li --- fs/cifs/connect.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 4f62337..29f384f 100644 --- a/fs/cifs/connect.c

[Patch v3 18/19] CIFS: SMBD: Deregister memory when finishing SMB read

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> When SMB read is finished, deregister the memory regions if RDMA write is used for this SMB read. smbd_deregister_mr may need to do local invalidation and sleep, if server remote invalidation is not used. There are situations where the MID may not be c

[Patch v3 18/19] CIFS: SMBD: Deregister memory when finishing SMB read

2017-08-29 Thread Long Li
From: Long Li When SMB read is finished, deregister the memory regions if RDMA write is used for this SMB read. smbd_deregister_mr may need to do local invalidation and sleep, if server remote invalidation is not used. There are situations where the MID may not be created on I/O failure, under

RE: [Patch v2 00/19] CIFS: Implement SMBDirect

2017-08-29 Thread Long Li
> -Original Message- > From: Roland Dreier [mailto:rol...@purestorage.com] > Sent: Tuesday, August 29, 2017 11:21 AM > To: Long Li <lon...@microsoft.com> > Cc: Steve French <sfre...@samba.org>; linux-c...@vger.kernel.org; samba- > techni...@lists

RE: [Patch v2 00/19] CIFS: Implement SMBDirect

2017-08-29 Thread Long Li
> -Original Message- > From: Roland Dreier [mailto:rol...@purestorage.com] > Sent: Tuesday, August 29, 2017 11:21 AM > To: Long Li > Cc: Steve French ; linux-c...@vger.kernel.org; samba- > techni...@lists.samba.org; LKML ; linux- > r...@vger.kernel.org; Christoph

[Patch v3 04/19] CIFS: SMBD: Add SMBDirect transport to SMB connection and Makefile

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> Add SMBDirect as an optional connection to the SMB session structure in CIFS. When SMB session is connected through SMBDirect, upper layer uses this connection to carry payloads. With the transport code hooked up to upper layer, add SMBDirect code to Ma

[Patch v3 04/19] CIFS: SMBD: Add SMBDirect transport to SMB connection and Makefile

2017-08-29 Thread Long Li
From: Long Li Add SMBDirect as an optional connection to the SMB session structure in CIFS. When SMB session is connected through SMBDirect, upper layer uses this connection to carry payloads. With the transport code hooked up to upper layer, add SMBDirect code to Makefile. Signed-off-by: Long

[Patch v3 19/19] CIFS: SMBD: Add SMBDirect debug counters

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> Export SMBDirect debug counters to /proc/fs/cifs/DebugData. Those are used for debugging, troubleshooting and profiling. Signed-off-by: Long Li <lon...@microsoft.com> --- fs/cifs/cifs_debug.c | 82

[Patch v3 19/19] CIFS: SMBD: Add SMBDirect debug counters

2017-08-29 Thread Long Li
From: Long Li Export SMBDirect debug counters to /proc/fs/cifs/DebugData. Those are used for debugging, troubleshooting and profiling. Signed-off-by: Long Li --- fs/cifs/cifs_debug.c | 82 1 file changed, 82 insertions(+) diff --git a/fs

[Patch v3 16/19] CIFS: SMBD: Read correct returned data length for RDMA write (SMB read) I/O

2017-08-29 Thread Long Li
From: Long Li <lon...@microsoft.com> When RDMA write is used for SMB read, the returned data length is in DataRemaining in the response packet. Reading it properly by adding a parameter to specifiy where the returned data length is. Signed-off-by: Long Li <lon...@microsoft.com>

[Patch v3 16/19] CIFS: SMBD: Read correct returned data length for RDMA write (SMB read) I/O

2017-08-29 Thread Long Li
From: Long Li When RDMA write is used for SMB read, the returned data length is in DataRemaining in the response packet. Reading it properly by adding a parameter to specifiy where the returned data length is. Signed-off-by: Long Li --- fs/cifs/cifsglob.h | 10 -- fs/cifs/cifssmb.c

RE: [Patch v2 00/19] CIFS: Implement SMBDirect

2017-08-29 Thread Long Li
> -Original Message- > From: samba-technical [mailto:samba-technical-boun...@lists.samba.org] > On Behalf Of Long Li via samba-technical > Sent: Monday, August 21, 2017 1:24 PM > To: Steve Wise <sw...@opengridcomputing.com>; 'Steve French' > <

RE: [Patch v2 00/19] CIFS: Implement SMBDirect

2017-08-29 Thread Long Li
> -Original Message- > From: samba-technical [mailto:samba-technical-boun...@lists.samba.org] > On Behalf Of Long Li via samba-technical > Sent: Monday, August 21, 2017 1:24 PM > To: Steve Wise ; 'Steve French' > ; linux-c...@vger.kernel.org; samba- > techni...@l

[PATCH] storvsc: fix memory leak on ring buffer busy

2017-08-28 Thread Long Li
From: Long Li <lon...@microsoft.com> When storvsc is sending I/O to Hyper-v, it may allocate a bigger buffer descriptor for large data payload that can't fit into a pre-allocated buffer descriptor. This bigger buffer is freed on return path. If I/O request to Hyper-v fails due to ring

[PATCH] storvsc: fix memory leak on ring buffer busy

2017-08-28 Thread Long Li
From: Long Li When storvsc is sending I/O to Hyper-v, it may allocate a bigger buffer descriptor for large data payload that can't fit into a pre-allocated buffer descriptor. This bigger buffer is freed on return path. If I/O request to Hyper-v fails due to ring buffer busy, the storvsc

RE: [Patch v2 13/19] CIFS: SMBD: Use registered memory RDMA read for SMB write

2017-08-23 Thread Long Li
> -Original Message- > From: Leon Romanovsky [mailto:l...@kernel.org] > Sent: Wednesday, August 23, 2017 12:02 PM > To: Long Li <lon...@microsoft.com> > Cc: Steve French <sfre...@samba.org>; linux-c...@vger.kernel.org; samba- > techni...@lists.samba.org

RE: [Patch v2 13/19] CIFS: SMBD: Use registered memory RDMA read for SMB write

2017-08-23 Thread Long Li
> -Original Message- > From: Leon Romanovsky [mailto:l...@kernel.org] > Sent: Wednesday, August 23, 2017 12:02 PM > To: Long Li > Cc: Steve French ; linux-c...@vger.kernel.org; samba- > techni...@lists.samba.org; linux-kernel@vger.kernel.org; linux- > r...@vger.

RE: [Patch v2 13/19] CIFS: SMBD: Use registered memory RDMA read for SMB write

2017-08-23 Thread Long Li
> -Original Message- > From: Leon Romanovsky [mailto:l...@kernel.org] > Sent: Wednesday, August 23, 2017 6:52 AM > To: Long Li <lon...@microsoft.com> > Cc: Steve French <sfre...@samba.org>; linux-c...@vger.kernel.org; samba- > techni...@lists.samba.org

RE: [Patch v2 13/19] CIFS: SMBD: Use registered memory RDMA read for SMB write

2017-08-23 Thread Long Li
> -Original Message- > From: Leon Romanovsky [mailto:l...@kernel.org] > Sent: Wednesday, August 23, 2017 6:52 AM > To: Long Li > Cc: Steve French ; linux-c...@vger.kernel.org; samba- > techni...@lists.samba.org; linux-kernel@vger.kernel.org; linux- > r...@vger.

RE: [PATCH] storvsc: do not assume SG list is continuous when doing bounce buffers (for 4.1 stable only)

2017-08-22 Thread Long Li
> Wouldn't it make sense to backport the changes to set the virt_boundary > (which probably still is the SG_GAPS flag in such an old kernel)? We can make storvsc use SG_GAPS. But the following patch is missing in 4.1 stable block layer to make this work on some I/O situations. Backporting is

RE: [PATCH] storvsc: do not assume SG list is continuous when doing bounce buffers (for 4.1 stable only)

2017-08-22 Thread Long Li
> Wouldn't it make sense to backport the changes to set the virt_boundary > (which probably still is the SG_GAPS flag in such an old kernel)? We can make storvsc use SG_GAPS. But the following patch is missing in 4.1 stable block layer to make this work on some I/O situations. Backporting is

[PATCH] storvsc: do not assume SG list is continuous when doing bounce buffers (for 4.1 stable only)

2017-08-21 Thread Long Li
From: Long Li <lon...@microsoft.com> This patch is for linux-stable 4.1 branch only. storvsc checks the SG list for gaps before passing them to Hyper-v device. If there are gaps, data is copied to a bounce buffer and a continuous data buffer is passed to Hyper-V. The check on gaps assu

[PATCH] storvsc: do not assume SG list is continuous when doing bounce buffers (for 4.1 stable only)

2017-08-21 Thread Long Li
From: Long Li This patch is for linux-stable 4.1 branch only. storvsc checks the SG list for gaps before passing them to Hyper-v device. If there are gaps, data is copied to a bounce buffer and a continuous data buffer is passed to Hyper-V. The check on gaps assumes SG list is continuous

RE: [Patch v2 00/19] CIFS: Implement SMBDirect

2017-08-21 Thread Long Li
> > > Hey Long, > > > > > > What testing have you done with this on the various rdma transports? > > > Does it work over IB, RoCE, and iWARP providers? > > > > Hi Steve, > > > > Currently all the tests have been done over Infiniband. We haven't > > tested on > RoCE > > or iWARP, but planned to do

<    2   3   4   5   6   7   8   9   10   11   >