tools, bpftool: Remove two unused variables.
[linux-2.6-microblaze.git] / include / rdma / ib_verbs.h
index 97658d7..9bf6c31 100644 (file)
@@ -138,10 +138,9 @@ union ib_gid {
 extern union ib_gid zgid;
 
 enum ib_gid_type {
-       /* If link layer is Ethernet, this is RoCE V1 */
-       IB_GID_TYPE_IB        = 0,
-       IB_GID_TYPE_ROCE      = 0,
-       IB_GID_TYPE_ROCE_UDP_ENCAP = 1,
+       IB_GID_TYPE_IB = IB_UVERBS_GID_TYPE_IB,
+       IB_GID_TYPE_ROCE = IB_UVERBS_GID_TYPE_ROCE_V1,
+       IB_GID_TYPE_ROCE_UDP_ENCAP = IB_UVERBS_GID_TYPE_ROCE_V2,
        IB_GID_TYPE_SIZE
 };
 
@@ -180,7 +179,7 @@ rdma_node_get_transport(unsigned int node_type);
 
 enum rdma_network_type {
        RDMA_NETWORK_IB,
-       RDMA_NETWORK_ROCE_V1 = RDMA_NETWORK_IB,
+       RDMA_NETWORK_ROCE_V1,
        RDMA_NETWORK_IPV4,
        RDMA_NETWORK_IPV6
 };
@@ -190,9 +189,10 @@ static inline enum ib_gid_type ib_network_to_gid_type(enum rdma_network_type net
        if (network_type == RDMA_NETWORK_IPV4 ||
            network_type == RDMA_NETWORK_IPV6)
                return IB_GID_TYPE_ROCE_UDP_ENCAP;
-
-       /* IB_GID_TYPE_IB same as RDMA_NETWORK_ROCE_V1 */
-       return IB_GID_TYPE_IB;
+       else if (network_type == RDMA_NETWORK_ROCE_V1)
+               return IB_GID_TYPE_ROCE;
+       else
+               return IB_GID_TYPE_IB;
 }
 
 static inline enum rdma_network_type
@@ -201,6 +201,9 @@ rdma_gid_attr_network_type(const struct ib_gid_attr *attr)
        if (attr->gid_type == IB_GID_TYPE_IB)
                return RDMA_NETWORK_IB;
 
+       if (attr->gid_type == IB_GID_TYPE_ROCE)
+               return RDMA_NETWORK_ROCE_V1;
+
        if (ipv6_addr_v4mapped((struct in6_addr *)&attr->gid))
                return RDMA_NETWORK_IPV4;
        else
@@ -535,7 +538,8 @@ enum ib_port_speed {
        IB_SPEED_FDR10  = 8,
        IB_SPEED_FDR    = 16,
        IB_SPEED_EDR    = 32,
-       IB_SPEED_HDR    = 64
+       IB_SPEED_HDR    = 64,
+       IB_SPEED_NDR    = 128,
 };
 
 /**
@@ -669,7 +673,7 @@ struct ib_port_attr {
        u8                      subnet_timeout;
        u8                      init_type_reply;
        u8                      active_width;
-       u                     active_speed;
+       u16                     active_speed;
        u8                      phys_state;
        u16                     port_cap_flags2;
 };
@@ -952,13 +956,14 @@ enum ib_wc_status {
 const char *__attribute_const__ ib_wc_status_msg(enum ib_wc_status status);
 
 enum ib_wc_opcode {
-       IB_WC_SEND,
-       IB_WC_RDMA_WRITE,
-       IB_WC_RDMA_READ,
-       IB_WC_COMP_SWAP,
-       IB_WC_FETCH_ADD,
-       IB_WC_LSO,
-       IB_WC_LOCAL_INV,
+       IB_WC_SEND = IB_UVERBS_WC_SEND,
+       IB_WC_RDMA_WRITE = IB_UVERBS_WC_RDMA_WRITE,
+       IB_WC_RDMA_READ = IB_UVERBS_WC_RDMA_READ,
+       IB_WC_COMP_SWAP = IB_UVERBS_WC_COMP_SWAP,
+       IB_WC_FETCH_ADD = IB_UVERBS_WC_FETCH_ADD,
+       IB_WC_BIND_MW = IB_UVERBS_WC_BIND_MW,
+       IB_WC_LOCAL_INV = IB_UVERBS_WC_LOCAL_INV,
+       IB_WC_LSO = IB_UVERBS_WC_TSO,
        IB_WC_REG_MR,
        IB_WC_MASKED_COMP_SWAP,
        IB_WC_MASKED_FETCH_ADD,
@@ -1291,6 +1296,7 @@ enum ib_wr_opcode {
        IB_WR_RDMA_READ = IB_UVERBS_WR_RDMA_READ,
        IB_WR_ATOMIC_CMP_AND_SWP = IB_UVERBS_WR_ATOMIC_CMP_AND_SWP,
        IB_WR_ATOMIC_FETCH_AND_ADD = IB_UVERBS_WR_ATOMIC_FETCH_AND_ADD,
+       IB_WR_BIND_MW = IB_UVERBS_WR_BIND_MW,
        IB_WR_LSO = IB_UVERBS_WR_TSO,
        IB_WR_SEND_WITH_INV = IB_UVERBS_WR_SEND_WITH_INV,
        IB_WR_RDMA_READ_WITH_INV = IB_UVERBS_WR_RDMA_READ_WITH_INV,
@@ -1474,12 +1480,6 @@ struct ib_rdmacg_object {
 struct ib_ucontext {
        struct ib_device       *device;
        struct ib_uverbs_file  *ufile;
-       /*
-        * 'closing' can be read by the driver only during a destroy callback,
-        * it is set when we are closing the file descriptor and indicates
-        * that mm_sem may be locked.
-        */
-       bool closing;
 
        bool cleanup_retryable;
 
@@ -2446,8 +2446,7 @@ struct ib_device_ops {
                         unsigned int *sg_offset);
        int (*check_mr_status)(struct ib_mr *mr, u32 check_mask,
                               struct ib_mr_status *mr_status);
-       struct ib_mw *(*alloc_mw)(struct ib_pd *pd, enum ib_mw_type type,
-                                 struct ib_udata *udata);
+       int (*alloc_mw)(struct ib_mw *mw, struct ib_udata *udata);
        int (*dealloc_mw)(struct ib_mw *mw);
        int (*attach_mcast)(struct ib_qp *qp, union ib_gid *gid, u16 lid);
        int (*detach_mcast)(struct ib_qp *qp, union ib_gid *gid, u16 lid);
@@ -2483,10 +2482,9 @@ struct ib_device_ops {
        int (*destroy_wq)(struct ib_wq *wq, struct ib_udata *udata);
        int (*modify_wq)(struct ib_wq *wq, struct ib_wq_attr *attr,
                         u32 wq_attr_mask, struct ib_udata *udata);
-       struct ib_rwq_ind_table *(*create_rwq_ind_table)(
-               struct ib_device *device,
-               struct ib_rwq_ind_table_init_attr *init_attr,
-               struct ib_udata *udata);
+       int (*create_rwq_ind_table)(struct ib_rwq_ind_table *ib_rwq_ind_table,
+                                   struct ib_rwq_ind_table_init_attr *init_attr,
+                                   struct ib_udata *udata);
        int (*destroy_rwq_ind_table)(struct ib_rwq_ind_table *wq_ind_table);
        struct ib_dm *(*alloc_dm)(struct ib_device *device,
                                  struct ib_ucontext *context,
@@ -2608,7 +2606,9 @@ struct ib_device_ops {
        DECLARE_RDMA_OBJ_SIZE(ib_ah);
        DECLARE_RDMA_OBJ_SIZE(ib_counters);
        DECLARE_RDMA_OBJ_SIZE(ib_cq);
+       DECLARE_RDMA_OBJ_SIZE(ib_mw);
        DECLARE_RDMA_OBJ_SIZE(ib_pd);
+       DECLARE_RDMA_OBJ_SIZE(ib_rwq_ind_table);
        DECLARE_RDMA_OBJ_SIZE(ib_srq);
        DECLARE_RDMA_OBJ_SIZE(ib_ucontext);
        DECLARE_RDMA_OBJ_SIZE(ib_xrcd);
@@ -2782,7 +2782,8 @@ void ib_dealloc_device(struct ib_device *device);
 
 void ib_get_device_fw_str(struct ib_device *device, char *str);
 
-int ib_register_device(struct ib_device *device, const char *name);
+int ib_register_device(struct ib_device *device, const char *name,
+                      struct device *dma_device);
 void ib_unregister_device(struct ib_device *device);
 void ib_unregister_driver(enum rdma_driver_id driver_id);
 void ib_unregister_device_and_put(struct ib_device *device);
@@ -4295,7 +4296,6 @@ struct ib_wq *ib_create_wq(struct ib_pd *pd,
 int ib_destroy_wq_user(struct ib_wq *wq, struct ib_udata *udata);
 int ib_modify_wq(struct ib_wq *wq, struct ib_wq_attr *attr,
                 u32 wq_attr_mask);
-int ib_destroy_rwq_ind_table(struct ib_rwq_ind_table *wq_ind_table);
 
 int ib_map_mr_sg(struct ib_mr *mr, struct scatterlist *sg, int sg_nents,
                 unsigned int *sg_offset, unsigned int page_size);
@@ -4323,7 +4323,7 @@ void ib_drain_rq(struct ib_qp *qp);
 void ib_drain_sq(struct ib_qp *qp);
 void ib_drain_qp(struct ib_qp *qp);
 
-int ib_get_eth_speed(struct ib_device *dev, u8 port_num, u8 *speed, u8 *width);
+int ib_get_eth_speed(struct ib_device *dev, u8 port_num, u16 *speed, u8 *width);
 
 static inline u8 *rdma_ah_retrieve_dmac(struct rdma_ah_attr *attr)
 {