[6/6] cifs: smbd: Dump SMB packet when configured

Message ID 20180417004918.29213-6-longli@linuxonhyperv.com
State New
Headers show
Series
  • [1/6] cifs: smbd: Check for iov length on sending the last iov
Related show

Commit Message

Long Li April 17, 2018, 12:49 a.m.
From: Long Li <longli@microsoft.com>

When sending through SMB Direct, also dump the packet in SMB send path.

Also fixed a typo in debug message.

Signed-off-by: Long Li <longli@microsoft.com>
---
 fs/cifs/smbdirect.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Greg KH April 17, 2018, 7:29 a.m. | #1
On Mon, Apr 16, 2018 at 05:49:18PM -0700, Long Li wrote:
> From: Long Li <longli@microsoft.com>
> 
> When sending through SMB Direct, also dump the packet in SMB send path.
> 
> Also fixed a typo in debug message.
> 
> Signed-off-by: Long Li <longli@microsoft.com>
> ---
>  fs/cifs/smbdirect.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c
> index f575e9a..6ff864a 100644
> --- a/fs/cifs/smbdirect.c
> +++ b/fs/cifs/smbdirect.c
> @@ -1029,7 +1029,7 @@ static int smbd_post_send(struct smbd_connection *info,
>  	for (i = 0; i < request->num_sge; i++) {
>  		log_rdma_send(INFO,
>  			"rdma_request sge[%d] addr=%llu length=%u\n",
> -			i, request->sge[0].addr, request->sge[0].length);
> +			i, request->sge[i].addr, request->sge[i].length);
>  		ib_dma_sync_single_for_device(
>  			info->id->device,
>  			request->sge[i].addr,
> @@ -2130,6 +2130,10 @@ int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst)
>  		goto done;
>  	}
>  
> +	cifs_dbg(FYI, "Sending smb (RDMA): smb_len=%u\n", buflen);
> +	for (i = 0; i < rqst->rq_nvec-1; i++)
> +		dump_smb(iov[i].iov_base, iov[i].iov_len);
> +
>  	remaining_data_length = buflen;
>  
>  	log_write(INFO, "rqst->rq_nvec=%d rqst->rq_npages=%d rq_pagesz=%d "
> -- 
> 2.7.4

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c
index f575e9a..6ff864a 100644
--- a/fs/cifs/smbdirect.c
+++ b/fs/cifs/smbdirect.c
@@ -1029,7 +1029,7 @@  static int smbd_post_send(struct smbd_connection *info,
 	for (i = 0; i < request->num_sge; i++) {
 		log_rdma_send(INFO,
 			"rdma_request sge[%d] addr=%llu length=%u\n",
-			i, request->sge[0].addr, request->sge[0].length);
+			i, request->sge[i].addr, request->sge[i].length);
 		ib_dma_sync_single_for_device(
 			info->id->device,
 			request->sge[i].addr,
@@ -2130,6 +2130,10 @@  int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst)
 		goto done;
 	}
 
+	cifs_dbg(FYI, "Sending smb (RDMA): smb_len=%u\n", buflen);
+	for (i = 0; i < rqst->rq_nvec-1; i++)
+		dump_smb(iov[i].iov_base, iov[i].iov_len);
+
 	remaining_data_length = buflen;
 
 	log_write(INFO, "rqst->rq_nvec=%d rqst->rq_npages=%d rq_pagesz=%d "