Whamcloud - gitweb
LU-5620 ptlrpc: Add QoS for opcode in NRS-TBF
[fs/lustre-release.git] / lustre / include / lustre_net.h
index a76c426..3c1f595 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
@@ -27,7 +23,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2010, 2015, Intel Corporation.
+ * Copyright (c) 2010, 2016, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
  */
 #define PTLRPC_MAX_BRW_BITS    (LNET_MTU_BITS + PTLRPC_BULK_OPS_BITS)
 #define PTLRPC_MAX_BRW_SIZE    (1 << PTLRPC_MAX_BRW_BITS)
-#define PTLRPC_MAX_BRW_PAGES   (PTLRPC_MAX_BRW_SIZE >> PAGE_CACHE_SHIFT)
+#define PTLRPC_MAX_BRW_PAGES   (PTLRPC_MAX_BRW_SIZE >> PAGE_SHIFT)
 
 #define ONE_MB_BRW_SIZE                (1 << LNET_MTU_BITS)
 #define MD_MAX_BRW_SIZE                (1 << LNET_MTU_BITS)
-#define MD_MAX_BRW_PAGES       (MD_MAX_BRW_SIZE >> PAGE_CACHE_SHIFT)
+#define MD_MAX_BRW_PAGES       (MD_MAX_BRW_SIZE >> PAGE_SHIFT)
 #define DT_MAX_BRW_SIZE                PTLRPC_MAX_BRW_SIZE
-#define DT_MAX_BRW_PAGES       (DT_MAX_BRW_SIZE >> PAGE_CACHE_SHIFT)
+#define DT_MAX_BRW_PAGES       (DT_MAX_BRW_SIZE >> PAGE_SHIFT)
 #define OFD_MAX_BRW_SIZE       (1 << LNET_MTU_BITS)
 
 /* When PAGE_SIZE is a constant, we can check our arithmetic here with cpp! */
 #if ((PTLRPC_MAX_BRW_PAGES & (PTLRPC_MAX_BRW_PAGES - 1)) != 0)
 # error "PTLRPC_MAX_BRW_PAGES isn't a power of two"
 #endif
-#if (PTLRPC_MAX_BRW_SIZE != (PTLRPC_MAX_BRW_PAGES * PAGE_CACHE_SIZE))
-# error "PTLRPC_MAX_BRW_SIZE isn't PTLRPC_MAX_BRW_PAGES * PAGE_CACHE_SIZE"
+#if (PTLRPC_MAX_BRW_SIZE != (PTLRPC_MAX_BRW_PAGES * PAGE_SIZE))
+# error "PTLRPC_MAX_BRW_SIZE isn't PTLRPC_MAX_BRW_PAGES * PAGE_SIZE"
 #endif
 #if (PTLRPC_MAX_BRW_SIZE > LNET_MTU * PTLRPC_BULK_OPS_COUNT)
 # error "PTLRPC_MAX_BRW_SIZE too big"
   */
  /* depress threads factor for VM with small memory size */
 #define OSS_THR_FACTOR         min_t(int, 8, \
-                               NUM_CACHEPAGES >> (28 - PAGE_CACHE_SHIFT))
+                               NUM_CACHEPAGES >> (28 - PAGE_SHIFT))
 #define OSS_NTHRS_INIT         (PTLRPC_NTHRS_INIT + 1)
 #define OSS_NTHRS_BASE         64
 
@@ -1109,6 +1105,8 @@ struct ptlrpc_request {
        lnet_nid_t                       rq_self;
        /** Peer description (the other side) */
        lnet_process_id_t                rq_peer;
+       /** Descriptor for the NID from which the peer sent the request. */
+       lnet_process_id_t                rq_source;
        /**
         * service time estimate (secs)
         * If the request is not served by this time, it is marked as timed out.
@@ -1894,10 +1892,6 @@ struct ptlrpcd_ctl {
         */
        char                            pc_name[16];
        /**
-        * Environment for request interpreters to run in.
-        */
-       struct lu_env                   pc_env;
-       /**
         * CPT the thread is bound on.
         */
        int                             pc_cpt;
@@ -2088,7 +2082,8 @@ void ptlrpc_request_committed(struct ptlrpc_request *req, int force);
 void ptlrpc_init_client(int req_portal, int rep_portal, char *name,
                         struct ptlrpc_client *);
 void ptlrpc_cleanup_client(struct obd_import *imp);
-struct ptlrpc_connection *ptlrpc_uuid_to_connection(struct obd_uuid *uuid);
+struct ptlrpc_connection *ptlrpc_uuid_to_connection(struct obd_uuid *uuid,
+                                                   lnet_nid_t nid4refnet);
 
 int ptlrpc_queue_wait(struct ptlrpc_request *req);
 int ptlrpc_replay_req(struct ptlrpc_request *req);
@@ -2166,7 +2161,7 @@ static inline void ptlrpc_release_bulk_page_pin(struct ptlrpc_bulk_desc *desc)
        int i;
 
        for (i = 0; i < desc->bd_iov_count ; i++)
-               page_cache_release(BD_GET_KIOV(desc, i).kiov_page);
+               put_page(BD_GET_KIOV(desc, i).kiov_page);
 }
 
 static inline void ptlrpc_release_bulk_noop(struct ptlrpc_bulk_desc *desc)
@@ -2662,6 +2657,7 @@ void ptlrpcd_decref(void);
  * @{
  */
 const char* ll_opcode2str(__u32 opcode);
+const int ll_str2opcode(const char *ops);
 #ifdef CONFIG_PROC_FS
 void ptlrpc_lprocfs_register_obd(struct obd_device *obd);
 void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd);