IB/core: Add IPoIB UD LSO support
[safe/jmp/linux-2.6] / include / rdma / ib_verbs.h
index 4bea182..66928e9 100644 (file)
@@ -48,9 +48,9 @@
 #include <linux/kref.h>
 #include <linux/list.h>
 #include <linux/rwsem.h>
+#include <linux/scatterlist.h>
 
 #include <asm/atomic.h>
-#include <asm/scatterlist.h>
 #include <asm/uaccess.h>
 
 union ib_gid {
@@ -95,7 +95,16 @@ enum ib_device_cap_flags {
        IB_DEVICE_N_NOTIFY_CQ           = (1<<14),
        IB_DEVICE_ZERO_STAG             = (1<<15),
        IB_DEVICE_SEND_W_INV            = (1<<16),
-       IB_DEVICE_MEM_WINDOW            = (1<<17)
+       IB_DEVICE_MEM_WINDOW            = (1<<17),
+       /*
+        * Devices should set IB_DEVICE_UD_IP_SUM if they support
+        * insertion of UDP and TCP checksum on outgoing UD IPoIB
+        * messages and can verify the validity of checksum for
+        * incoming messages.  Setting this flag implies that the
+        * IPoIB driver may set NETIF_F_IP_CSUM for datagram mode.
+        */
+       IB_DEVICE_UD_IP_CSUM            = (1<<18),
+       IB_DEVICE_UD_TSO                = (1<<19),
 };
 
 enum ib_atomic_cap {
@@ -403,6 +412,7 @@ enum ib_wc_opcode {
        IB_WC_COMP_SWAP,
        IB_WC_FETCH_ADD,
        IB_WC_BIND_MW,
+       IB_WC_LSO,
 /*
  * Set value of IB_WC_RECV so consumers can test if a completion is a
  * receive by testing (opcode & IB_WC_RECV).
@@ -431,6 +441,7 @@ struct ib_wc {
        u8                      sl;
        u8                      dlid_path_bits;
        u8                      port_num;       /* valid only for DR SMPs on switches */
+       int                     csum_ok;
 };
 
 enum ib_cq_notify_flags {
@@ -486,6 +497,10 @@ enum ib_qp_type {
        IB_QPT_RAW_ETY
 };
 
+enum ib_qp_create_flags {
+       IB_QP_CREATE_IPOIB_UD_LSO       = 1 << 0,
+};
+
 struct ib_qp_init_attr {
        void                  (*event_handler)(struct ib_event *, void *);
        void                   *qp_context;
@@ -495,6 +510,7 @@ struct ib_qp_init_attr {
        struct ib_qp_cap        cap;
        enum ib_sig_type        sq_sig_type;
        enum ib_qp_type         qp_type;
+       enum ib_qp_create_flags create_flags;
        u8                      port_num; /* special QP types only */
 };
 
@@ -608,14 +624,16 @@ enum ib_wr_opcode {
        IB_WR_SEND_WITH_IMM,
        IB_WR_RDMA_READ,
        IB_WR_ATOMIC_CMP_AND_SWP,
-       IB_WR_ATOMIC_FETCH_AND_ADD
+       IB_WR_ATOMIC_FETCH_AND_ADD,
+       IB_WR_LSO
 };
 
 enum ib_send_flags {
        IB_SEND_FENCE           = 1,
        IB_SEND_SIGNALED        = (1<<1),
        IB_SEND_SOLICITED       = (1<<2),
-       IB_SEND_INLINE          = (1<<3)
+       IB_SEND_INLINE          = (1<<3),
+       IB_SEND_IP_CSUM         = (1<<4)
 };
 
 struct ib_sge {
@@ -645,6 +663,9 @@ struct ib_send_wr {
                } atomic;
                struct {
                        struct ib_ah *ah;
+                       void   *header;
+                       int     hlen;
+                       int     mss;
                        u32     remote_qpn;
                        u32     remote_qkey;
                        u16     pkey_index; /* valid for GSI only */
@@ -720,7 +741,7 @@ struct ib_uobject {
        struct ib_ucontext     *context;        /* associated user context */
        void                   *object;         /* containing object */
        struct list_head        list;           /* link to context's list */
-       u32                     id;             /* index into kernel idr */
+       int                     id;             /* index into kernel idr */
        struct kref             ref;
        struct rw_semaphore     mutex;          /* protects .live */
        int                     live;
@@ -890,8 +911,6 @@ struct ib_device {
        int                          *pkey_tbl_len;
        int                          *gid_tbl_len;
 
-       u32                           flags;
-
        int                           num_comp_vectors;
 
        struct iw_cm_verbs           *iwcm;
@@ -1026,7 +1045,7 @@ struct ib_device {
 
        struct module               *owner;
        struct class_device          class_dev;
-       struct kobject               ports_parent;
+       struct kobject               *ports_parent;
        struct list_head             port_list;
 
        enum {