cifs: smbd: Dump SMB packet when configured
authorLong Li <longli@microsoft.com>
Tue, 17 Apr 2018 19:17:10 +0000 (12:17 -0700)
committerSteve French <smfrench@gmail.com>
Fri, 20 Apr 2018 17:18:28 +0000 (12:18 -0500)
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>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
fs/cifs/smbdirect.c

index d611ed0..87817dd 100644 (file)
@@ -1028,7 +1028,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,
@@ -2139,6 +2139,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 "