Whamcloud - gitweb
LU-8401 lnet: remove dependency on OFED headers from lnet
[fs/lustre-release.git] / lnet / klnds / socklnd / socklnd.h
index 3ced60f..1a08293 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/if.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/kthread.h>
 #include <linux/kmod.h>
 #include <linux/list.h>
 #include <linux/mm.h>
        tcp_sendpage(sk, page, offset, size, flags)
 #endif /* HAVE_TCP_SENDPAGE_USE_SOCKET */
 
+#ifndef NETIF_F_CSUM_MASK
+# define NETIF_F_CSUM_MASK NETIF_F_ALL_CSUM
+#endif
+
 /* assume one thread for each connection type */
 #define SOCKNAL_NSCHEDS                3
 #define SOCKNAL_NSCHEDS_HIGH   (SOCKNAL_NSCHEDS << 1)
@@ -102,7 +107,7 @@ typedef struct                                  /* per scheduler state */
        struct page             *kss_rx_scratch_pgs[LNET_MAX_IOV];
 #endif
 #if !SOCKNAL_SINGLE_FRAG_TX || !SOCKNAL_SINGLE_FRAG_RX
-       struct iovec            kss_scratch_iov[LNET_MAX_IOV];
+       struct kvec             kss_scratch_iov[LNET_MAX_IOV];
 #endif
 } ksock_sched_t;
 
@@ -168,9 +173,6 @@ typedef struct
 #if SOCKNAL_VERSION_DEBUG
         int              *ksnd_protocol;        /* protocol version */
 #endif
-#if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
-       struct ctl_table_header *ksnd_sysctl;   /* sysctl interface */
-#endif
 } ksock_tunables_t;
 
 typedef struct
@@ -255,12 +257,12 @@ typedef struct
 #define SOCKNAL_INIT_ALL        2
 
 /* A packet just assembled for transmission is represented by 1 or more
- * struct iovec fragments (the first frag contains the portals header),
+ * struct kvec fragments (the first frag contains the portals header),
  * followed by 0 or more lnet_kiov_t fragments.
  *
- * On the receive side, initially 1 struct iovec fragment is posted for
+ * On the receive side, initially 1 struct kvec fragment is posted for
  * receive (the header).  Once the header has been received, the payload is
- * received into either struct iovec or lnet_kiov_t fragments, depending on
+ * received into either struct kvec or lnet_kiov_t fragments, depending on
  * what the header matched or whether the message needs forwarding. */
 
 struct ksock_conn;                              /* forward ref */
@@ -275,8 +277,8 @@ typedef struct                                  /* transmit packet */
        atomic_t       tx_refcount;    /* tx reference count */
        int            tx_nob;         /* # packet bytes */
        int            tx_resid;       /* residual bytes */
-        int            tx_niov;        /* # packet iovec frags */
-        struct iovec  *tx_iov;         /* packet iovec frags */
+       int            tx_niov;        /* # packet kvec frags */
+       struct kvec  *tx_iov;         /* packet kvec frags */
         int            tx_nkiov;       /* # packet page frags */
         unsigned short tx_zc_aborted;  /* aborted ZC request */
         unsigned short tx_zc_capable:1; /* payload is large enough for ZC */
@@ -290,11 +292,11 @@ typedef struct                                  /* transmit packet */
         int            tx_desc_size;   /* size of this descriptor */
         union {
                 struct {
-                        struct iovec iov;       /* virt hdr */
-                        lnet_kiov_t  kiov[0];   /* paged payload */
+                       struct kvec iov;        /* virt hdr */
+                       lnet_kiov_t kiov[0];    /* paged payload */
                 }                  paged;
                 struct {
-                        struct iovec iov[1];    /* virt hdr + payload */
+                       struct kvec iov[1];     /* virt hdr + payload */
                 }                  virt;
         }                       tx_frags;
 } ksock_tx_t;
@@ -306,7 +308,7 @@ typedef struct                                  /* transmit packet */
 /* space for the rx frag descriptors; we either read a single contiguous
  * header, or up to LNET_MAX_IOV frags of payload of either type. */
 typedef union {
-        struct iovec     iov[LNET_MAX_IOV];
+       struct kvec     iov[LNET_MAX_IOV];
         lnet_kiov_t      kiov[LNET_MAX_IOV];
 } ksock_rxiovspace_t;
 
@@ -349,8 +351,8 @@ typedef struct ksock_conn
         __u8                  ksnc_rx_state;    /* what is being read */
         int                   ksnc_rx_nob_left; /* # bytes to next hdr/body */
         int                   ksnc_rx_nob_wanted; /* bytes actually wanted */
-        int                   ksnc_rx_niov;     /* # iovec frags */
-        struct iovec         *ksnc_rx_iov;      /* the iovec frags */
+       int                   ksnc_rx_niov;     /* # kvec frags */
+       struct kvec          *ksnc_rx_iov;      /* the kvec frags */
         int                   ksnc_rx_nkiov;    /* # page frags */
         lnet_kiov_t          *ksnc_rx_kiov;     /* the page frags */
         ksock_rxiovspace_t    ksnc_rx_iov_space;/* space for frag descriptors */
@@ -610,9 +612,9 @@ int ksocknal_startup (lnet_ni_t *ni);
 void ksocknal_shutdown (lnet_ni_t *ni);
 int ksocknal_ctl(lnet_ni_t *ni, unsigned int cmd, void *arg);
 int ksocknal_send (lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg);
-int ksocknal_recv(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg, 
-                  int delayed, unsigned int niov, 
-                  struct iovec *iov, lnet_kiov_t *kiov,
+int ksocknal_recv(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg,
+                 int delayed, unsigned int niov,
+                 struct kvec *iov, lnet_kiov_t *kiov,
                   unsigned int offset, unsigned int mlen, unsigned int rlen);
 int ksocknal_accept(lnet_ni_t *ni, struct socket *sock);
 
@@ -677,9 +679,6 @@ extern int ksocknal_lib_get_conn_tunables(ksock_conn_t *conn, int *txmem,
                                          int *rxmem, int *nagle);
 
 extern int ksocknal_tunables_init(void);
-extern void ksocknal_tunables_fini(void);
-extern int ksocknal_lib_tunables_init(void);
-extern void ksocknal_lib_tunables_fini(void);
 
 extern void ksocknal_lib_csum_tx(ksock_tx_t *tx);