Whamcloud - gitweb
LU-13004 net: discard LNET_MD_IOVEC 74/36974/6
authorMr NeilBrown <neilb@suse.de>
Thu, 21 Nov 2019 04:26:04 +0000 (15:26 +1100)
committerOleg Drokin <green@whamcloud.com>
Tue, 31 Mar 2020 07:00:20 +0000 (07:00 +0000)
This flag is now never set, so discard it.  lnet_md memory descriptors
are either a single virtual address, or a list of bvec.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I9b2280f801108e5d9fc718c90c83692042991f12
Reviewed-on: https://review.whamcloud.com/36974
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/include/lnet/lib-lnet.h
lnet/include/uapi/linux/lnet/lnet-types.h
lnet/lnet/lib-md.c
lustre/ptlrpc/pers.c

index c7ec6d1..d01439c 100644 (file)
@@ -223,8 +223,7 @@ lnet_md_alloc(struct lnet_md *umd)
                niov = umd->length;
                size = offsetof(struct lnet_libmd, md_iov.kiov[niov]);
        } else {
-               niov = ((umd->options & LNET_MD_IOVEC) != 0) ?
-                      umd->length : 1;
+               niov = 1;
                size = offsetof(struct lnet_libmd, md_iov.iov[niov]);
        }
 
index 3134f38..e488e7d 100644 (file)
@@ -407,11 +407,6 @@ struct lnet_md {
         * the number of entries in the array. The length can't be bigger
         * than LNET_MAX_IOV. The struct bio_vec is used to describe page-based
         * fragments that are not necessarily mapped in virtal memory.
-        * - LNET_MD_IOVEC bit set: The start field points to the starting
-        * address of an array of struct kvec and the length field specifies
-        * the number of entries in the array. The length can't be bigger
-        * than LNET_MAX_IOV. The struct kvec is used to describe fragments
-        * that have virtual addresses.
         * - Otherwise: The memory region is contiguous. The start field
         * specifies the starting address for the memory region and the
         * length field specifies its length.
@@ -466,14 +461,12 @@ struct lnet_md {
         *   The data sent in the REPLY serves as an implicit acknowledgment.
         * - LNET_MD_KIOV: The start and length fields specify an array of
         *   struct bio_vec.
-        * - LNET_MD_IOVEC: The start and length fields specify an array of
-        *   struct iovec.
         * - LNET_MD_MAX_SIZE: The max_size field is valid.
         * - LNET_MD_BULK_HANDLE: The bulk_handle field is valid.
         *
         * Note:
-        * - LNET_MD_KIOV or LNET_MD_IOVEC allows for a scatter/gather
-        *   capability for memory descriptors. They can't be both set.
+        * - LNET_MD_KIOV allows for a scatter/gather capability for memory
+        *   descriptors.
         * - When LNET_MD_MAX_SIZE is set, the total length of the memory
         *   region (i.e. sum of all fragment lengths) must not be less than
         *   \a max_size.
@@ -523,7 +516,7 @@ struct lnet_md {
 /** See struct lnet_md::options. */
 #define LNET_MD_ACK_DISABLE         (1 << 5)
 /** See struct lnet_md::options. */
-#define LNET_MD_IOVEC               (1 << 6)
+/* deprecated #define LNET_MD_IOVEC  (1 << 6) */
 /** See struct lnet_md::options. */
 #define LNET_MD_MAX_SIZE            (1 << 7)
 /** See struct lnet_md::options. */
index b7b0939..46b9c5c 100644 (file)
@@ -208,31 +208,7 @@ lnet_md_build(struct lnet_libmd *lmd, struct lnet_md *umd, int unlink)
        lmd->md_flags = (unlink == LNET_UNLINK) ? LNET_MD_FLAG_AUTO_UNLINK : 0;
        lmd->md_bulk_handle = umd->bulk_handle;
 
-       if ((umd->options & LNET_MD_IOVEC) != 0) {
-
-               if ((umd->options & LNET_MD_KIOV) != 0) /* Can't specify both */
-                       return -EINVAL;
-
-               lmd->md_niov = niov = umd->length;
-               memcpy(lmd->md_iov.iov, umd->start,
-                      niov * sizeof(lmd->md_iov.iov[0]));
-
-               for (i = 0; i < (int)niov; i++) {
-                       /* We take the base address on trust */
-                       if (lmd->md_iov.iov[i].iov_len <= 0) /* invalid length */
-                               return -EINVAL;
-
-                       total_length += lmd->md_iov.iov[i].iov_len;
-               }
-
-               lmd->md_length = total_length;
-
-               if ((umd->options & LNET_MD_MAX_SIZE) != 0 && /* max size used */
-                   (umd->max_size < 0 ||
-                    umd->max_size > total_length)) // illegal max_size
-                       return -EINVAL;
-
-       } else if ((umd->options & LNET_MD_KIOV) != 0) {
+       if ((umd->options & LNET_MD_KIOV) != 0) {
                lmd->md_niov = niov = umd->length;
                memcpy(lmd->md_iov.kiov, umd->start,
                       niov * sizeof(lmd->md_iov.kiov[0]));
@@ -308,7 +284,7 @@ lnet_md_deconstruct(struct lnet_libmd *lmd, struct lnet_md *umd)
         * and that's all.
         */
        umd->start = lmd->md_start;
-       umd->length = ((lmd->md_options & (LNET_MD_IOVEC | LNET_MD_KIOV)) == 0) ?
+       umd->length = ((lmd->md_options & LNET_MD_KIOV) == 0) ?
                      lmd->md_length : lmd->md_niov;
        umd->threshold = lmd->md_threshold;
        umd->max_size = lmd->md_max_size;
@@ -325,7 +301,7 @@ lnet_md_validate(struct lnet_md *umd)
                return -EINVAL;
        }
 
-       if ((umd->options & (LNET_MD_KIOV | LNET_MD_IOVEC)) != 0 &&
+       if ((umd->options & LNET_MD_KIOV) &&
            umd->length > LNET_MAX_IOV) {
                CERROR("Invalid option: too many fragments %u, %d max\n",
                       umd->length, LNET_MAX_IOV);
index 4566d88..7183e37 100644 (file)
@@ -48,8 +48,7 @@ void ptlrpc_fill_bulk_md(struct lnet_md *md, struct ptlrpc_bulk_desc *desc,
 
        LASSERT(mdidx < desc->bd_md_max_brw);
        LASSERT(desc->bd_iov_count <= PTLRPC_MAX_BRW_PAGES);
-       LASSERT(!(md->options & (LNET_MD_IOVEC | LNET_MD_KIOV |
-                                LNET_MD_PHYS)));
+       LASSERT(!(md->options & (LNET_MD_KIOV | LNET_MD_PHYS)));
 
        md->length = max(0, desc->bd_iov_count - mdidx * LNET_MAX_IOV);
        md->length = min_t(unsigned int, LNET_MAX_IOV, md->length);