Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1742952
| From | Long Li <longli@exchange.microsoft.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [Patch v4 19/22] CIFS: SMBD: Add parameter rdata to smb2_new_read_req |
| Date | 2017-10-02 04:40 +0200 |
| Message-ID | <uvYOe-1FS-21@gated-at.bofh.it> (permalink) |
| References | <uvYOd-1FS-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Long Li <longli@microsoft.com>
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 to smb2_new_read_req.
Signed-off-by: Long Li <longli@microsoft.com>
---
fs/cifs/smb2pdu.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 6089957..7053db9 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -2351,18 +2351,21 @@ SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
*/
static int
smb2_new_read_req(void **buf, unsigned int *total_len,
- struct cifs_io_parms *io_parms, unsigned int remaining_bytes,
- int request_type)
+ struct cifs_io_parms *io_parms, struct cifs_readdata *rdata,
+ unsigned int remaining_bytes, int request_type)
{
int rc = -EACCES;
struct smb2_read_plain_req *req = NULL;
struct smb2_sync_hdr *shdr;
+ struct TCP_Server_Info *server;
rc = smb2_plain_req_init(SMB2_READ, io_parms->tcon, (void **) &req,
total_len);
if (rc)
return rc;
- if (io_parms->tcon->ses->server == NULL)
+
+ server = io_parms->tcon->ses->server;
+ if (server == NULL)
return -ECONNABORTED;
shdr = &req->sync_hdr;
@@ -2490,7 +2493,8 @@ smb2_async_readv(struct cifs_readdata *rdata)
server = io_parms.tcon->ses->server;
- rc = smb2_new_read_req((void **) &buf, &total_len, &io_parms, 0, 0);
+ rc = smb2_new_read_req(
+ (void **) &buf, &total_len, &io_parms, rdata, 0, 0);
if (rc) {
if (rc == -EAGAIN && rdata->credits) {
/* credits was reset by reconnect */
@@ -2558,7 +2562,7 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms,
struct cifs_ses *ses = io_parms->tcon->ses;
*nbytes = 0;
- rc = smb2_new_read_req((void **)&req, &total_len, io_parms, 0, 0);
+ rc = smb2_new_read_req((void **)&req, &total_len, io_parms, NULL, 0, 0);
if (rc)
return rc;
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[Patch v4 00/22] CIFS: Implement SMBDirect Long Li <longli@exchange.microsoft.com> - 2017-10-02 04:40 +0200 [Patch v4 15/22] CIFS: SMBD: Upper layer sends data via RDMA send Long Li <longli@exchange.microsoft.com> - 2017-10-02 04:40 +0200 [Patch v4 21/22] CIFS: SMBD: Upper layer performs SMB read via RDMA write through memory registration Long Li <longli@exchange.microsoft.com> - 2017-10-02 04:40 +0200 [Patch v4 09/22] CIFS: SMBD: Implement function to destroy a SMBDirect connection Long Li <longli@exchange.microsoft.com> - 2017-10-02 04:40 +0200 [Patch v4 18/22] CIFS: SMBD: Upper layer performs SMB write via RDMA read through memory registration Long Li <longli@exchange.microsoft.com> - 2017-10-02 04:40 +0200 [Patch v4 13/22] CIFS: SMBD: Upper layer receives data via RDMA receive Long Li <longli@exchange.microsoft.com> - 2017-10-02 04:40 +0200 [Patch v4 10/22] CIFS: SMBD: Upper layer destroys SMBDirect session on shutdown or umount Long Li <longli@exchange.microsoft.com> - 2017-10-02 04:40 +0200 [Patch v4 06/22] CIFS: SMBD: Upper layer connects to SMBDirect session Long Li <longli@exchange.microsoft.com> - 2017-10-02 04:40 +0200 [Patch v4 19/22] CIFS: SMBD: Add parameter rdata to smb2_new_read_req Long Li <longli@exchange.microsoft.com> - 2017-10-02 04:40 +0200 [Patch v4 17/22] CIFS: SMBD: Implement RDMA memory registration Long Li <longli@exchange.microsoft.com> - 2017-10-02 04:40 +0200
csiph-web