]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/rdma/rdma_vt.h
Merge tag 'tty-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
[linux.git] / include / rdma / rdma_vt.h
index e32facdd9fd3d0357335e6fb86b9d012c8615117..3584d0816fcd76ca6a5b50f85b629ab8bb0cc5d5 100644 (file)
@@ -149,6 +149,10 @@ struct rvt_ibport {
 
 #define RVT_CQN_MAX 16 /* maximum length of cq name */
 
+#define RVT_SGE_COPY_MEMCPY    0
+#define RVT_SGE_COPY_CACHELESS 1
+#define RVT_SGE_COPY_ADAPTIVE  2
+
 /*
  * Things that are driver specific, module parameters in hfi1 and qib
  */
@@ -161,6 +165,9 @@ struct rvt_driver_params {
         */
        unsigned int lkey_table_size;
        unsigned int qp_table_size;
+       unsigned int sge_copy_mode;
+       unsigned int wss_threshold;
+       unsigned int wss_clean_period;
        int qpn_start;
        int qpn_inc;
        int qpn_res_start;
@@ -193,6 +200,19 @@ struct rvt_ah {
        u8 log_pmtu;
 };
 
+/* memory working set size */
+struct rvt_wss {
+       unsigned long *entries;
+       atomic_t total_count;
+       atomic_t clean_counter;
+       atomic_t clean_entry;
+
+       int threshold;
+       int num_entries;
+       long pages_mask;
+       unsigned int clean_period;
+};
+
 struct rvt_dev_info;
 struct rvt_swqe;
 struct rvt_driver_provided {
@@ -211,17 +231,18 @@ struct rvt_driver_provided {
         * version requires the s_lock not to be held. The other assumes the
         * s_lock is held.
         */
-       void (*schedule_send)(struct rvt_qp *qp);
-       void (*schedule_send_no_lock)(struct rvt_qp *qp);
+       bool (*schedule_send)(struct rvt_qp *qp);
+       bool (*schedule_send_no_lock)(struct rvt_qp *qp);
 
        /*
-        * Validate the wqe.  This needs to be done prior to inserting the
-        * wqe into the ring, but after the wqe has been set up.  Allow for
-        * driver specific work request checking by providing a callback.
-        * call_send indicates if the wqe should be posted or scheduled.
+        * Driver specific work request setup and checking.
+        * This function is allowed to perform any setup, checks, or
+        * adjustments required to the SWQE in order to be usable by
+        * underlying protocols. This includes private data structure
+        * allocations.
         */
-       int (*check_send_wqe)(struct rvt_qp *qp, struct rvt_swqe *wqe,
-                             bool *call_send);
+       int (*setup_wqe)(struct rvt_qp *qp, struct rvt_swqe *wqe,
+                        bool *call_send);
 
        /*
         * Sometimes rdmavt needs to kick the driver's send progress. That is
@@ -377,6 +398,9 @@ struct rvt_dev_info {
        /* post send table */
        const struct rvt_operation_params *post_parms;
 
+       /* opcode translation table */
+       const enum ib_wc_opcode *wc_opcode;
+
        /* Driver specific helper functions */
        struct rvt_driver_provided driver_f;
 
@@ -417,6 +441,8 @@ struct rvt_dev_info {
        u32 n_mcast_grps_allocated; /* number of mcast groups allocated */
        spinlock_t n_mcast_grps_lock;
 
+       /* Memory Working Set Size */
+       struct rvt_wss *wss;
 };
 
 /**
@@ -429,7 +455,14 @@ static inline void rvt_set_ibdev_name(struct rvt_dev_info *rdi,
                                      const char *fmt, const char *name,
                                      const int unit)
 {
-       snprintf(rdi->ibdev.name, sizeof(rdi->ibdev.name), fmt, name, unit);
+       /*
+        * FIXME: rvt and its users want to touch the ibdev before
+        * registration and have things like the name work. We don't have the
+        * infrastructure in the core to support this directly today, hack it
+        * to work by setting the name manually here.
+        */
+       dev_set_name(&rdi->ibdev.dev, fmt, name, unit);
+       strlcpy(rdi->ibdev.name, dev_name(&rdi->ibdev.dev), IB_DEVICE_NAME_MAX);
 }
 
 /**
@@ -440,7 +473,7 @@ static inline void rvt_set_ibdev_name(struct rvt_dev_info *rdi,
  */
 static inline const char *rvt_get_ibdev_name(const struct rvt_dev_info *rdi)
 {
-       return rdi->ibdev.name;
+       return dev_name(&rdi->ibdev.dev);
 }
 
 static inline struct rvt_pd *ibpd_to_rvtpd(struct ib_pd *ibpd)