Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1711433

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

From Tom Talpey <ttalpey@microsoft.com>
Newsgroups linux.kernel
Subject RE: [[PATCH v1] 18/37] [CIFS] SMBD: Implement API for upper layer to send data
Date 2017-08-14 22:50 +0200
Message-ID <ueutc-n0-7@gated-at.bofh.it> (permalink)
References <ua8hz-6jk-3@gated-at.bofh.it> <ua8rg-6nd-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> -----Original Message-----
> From: linux-cifs-owner@vger.kernel.org [mailto:linux-cifs-
> owner@vger.kernel.org] On Behalf Of Long Li
> Sent: Wednesday, August 2, 2017 4:10 PM
> To: Steve French <sfrench@samba.org>; linux-cifs@vger.kernel.org; samba-
> technical@lists.samba.org; linux-kernel@vger.kernel.org
> Cc: Long Li <longli@microsoft.com>
> Subject: [[PATCH v1] 18/37] [CIFS] SMBD: Implement API for upper layer to
> send data
> 
> +/*
> + * Write data to transport
> + * Each rqst is transported as a SMBDirect payload
> + * rqst: the data to write
> + * return value: 0 if successfully write, otherwise error code
> + */
> +int cifs_rdma_write(struct cifs_rdma_info *info, struct smb_rqst *rqst)
> +{

!!!
This is a VERY confusing name. It is not sending an RDMA Write, which will
confuse any RDMA-enlightened reader. It's performing an RDMA Send, so
that name is perhaps one possibility. 

> +       if (info->transport_status != CIFS_RDMA_CONNECTED) {
> +               log_cifs_write("disconnected returning -EIO\n");
> +               return -EIO;
> +       }

Isn't this optimizing the error case? There's no guarantee it's still connected by
the time the following request construction occurs. Why not just proceed without
the check? 

> +       /* Strip the first 4 bytes MS-SMB2 section 2.1
> +        * they are used only for TCP transport */
> +       iov[0].iov_base = (char*)rqst->rq_iov[0].iov_base + 4;
> +       iov[0].iov_len = rqst->rq_iov[0].iov_len - 4;
> +       buflen += iov[0].iov_len;

Ok, that layering choice in the cifs.ko client code needs to be corrected. After all,
it will need to be RDMA-aware to build the SMB3 read/write channel structures.
And, the code in cifs_post_send_data() is allocating and building a structure that
could have been accounted for much earlier, avoiding the extra overhead.

That change could happen later, the hack is mostly ok for now. But something
needs to be said in a comment.
 
Tom.

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

RE: [[PATCH v1] 18/37] [CIFS] SMBD: Implement API for upper layer to  send data Tom Talpey <ttalpey@microsoft.com> - 2017-08-14 22:50 +0200
  RE: [[PATCH v1] 18/37] [CIFS] SMBD: Implement API for upper layer to  send data Long Li <longli@microsoft.com> - 2017-08-20 01:50 +0200

csiph-web