Merge remote-tracking branches 'asoc/fix/blackfin', 'asoc/fix/da9055', 'asoc/fix...
[firefly-linux-kernel-4.4.55.git] / include / rdma / ib_verbs.h
index 61e1935c91b121d0ba6a9e5d6f05221d15060432..6793f32ccb581f4313d052d7a228a0e7852e0973 100644 (file)
@@ -48,6 +48,7 @@
 #include <linux/rwsem.h>
 #include <linux/scatterlist.h>
 #include <linux/workqueue.h>
+#include <uapi/linux/if_ether.h>
 
 #include <linux/atomic.h>
 #include <asm/uaccess.h>
@@ -69,12 +70,14 @@ enum rdma_node_type {
        RDMA_NODE_IB_ROUTER,
        RDMA_NODE_RNIC,
        RDMA_NODE_USNIC,
+       RDMA_NODE_USNIC_UDP,
 };
 
 enum rdma_transport_type {
        RDMA_TRANSPORT_IB,
        RDMA_TRANSPORT_IWARP,
-       RDMA_TRANSPORT_USNIC
+       RDMA_TRANSPORT_USNIC,
+       RDMA_TRANSPORT_USNIC_UDP
 };
 
 enum rdma_transport_type
@@ -223,7 +226,8 @@ enum ib_port_cap_flags {
        IB_PORT_CAP_MASK_NOTICE_SUP             = 1 << 22,
        IB_PORT_BOOT_MGMT_SUP                   = 1 << 23,
        IB_PORT_LINK_LATENCY_SUP                = 1 << 24,
-       IB_PORT_CLIENT_REG_SUP                  = 1 << 25
+       IB_PORT_CLIENT_REG_SUP                  = 1 << 25,
+       IB_PORT_IP_BASED_GIDS                   = 1 << 26
 };
 
 enum ib_port_width {
@@ -472,6 +476,8 @@ struct ib_ah_attr {
        u8                      static_rate;
        u8                      ah_flags;
        u8                      port_num;
+       u8                      dmac[ETH_ALEN];
+       u16                     vlan_id;
 };
 
 enum ib_wc_status {
@@ -524,6 +530,8 @@ enum ib_wc_flags {
        IB_WC_WITH_IMM          = (1<<1),
        IB_WC_WITH_INVALIDATE   = (1<<2),
        IB_WC_IP_CSUM_OK        = (1<<3),
+       IB_WC_WITH_SMAC         = (1<<4),
+       IB_WC_WITH_VLAN         = (1<<5),
 };
 
 struct ib_wc {
@@ -544,6 +552,8 @@ struct ib_wc {
        u8                      sl;
        u8                      dlid_path_bits;
        u8                      port_num;       /* valid only for DR SMPs on switches */
+       u8                      smac[ETH_ALEN];
+       u16                     vlan_id;
 };
 
 enum ib_cq_notify_flags {
@@ -633,6 +643,7 @@ enum ib_qp_type {
 enum ib_qp_create_flags {
        IB_QP_CREATE_IPOIB_UD_LSO               = 1 << 0,
        IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK   = 1 << 1,
+       IB_QP_CREATE_NETIF_QP                   = 1 << 5,
        /* reserve bits 26-31 for low level drivers' internal use */
        IB_QP_CREATE_RESERVED_START             = 1 << 26,
        IB_QP_CREATE_RESERVED_END               = 1 << 31,
@@ -721,7 +732,11 @@ enum ib_qp_attr_mask {
        IB_QP_MAX_DEST_RD_ATOMIC        = (1<<17),
        IB_QP_PATH_MIG_STATE            = (1<<18),
        IB_QP_CAP                       = (1<<19),
-       IB_QP_DEST_QPN                  = (1<<20)
+       IB_QP_DEST_QPN                  = (1<<20),
+       IB_QP_SMAC                      = (1<<21),
+       IB_QP_ALT_SMAC                  = (1<<22),
+       IB_QP_VID                       = (1<<23),
+       IB_QP_ALT_VID                   = (1<<24),
 };
 
 enum ib_qp_state {
@@ -771,6 +786,10 @@ struct ib_qp_attr {
        u8                      rnr_retry;
        u8                      alt_port_num;
        u8                      alt_timeout;
+       u8                      smac[ETH_ALEN];
+       u8                      alt_smac[ETH_ALEN];
+       u16                     vlan_id;
+       u16                     alt_vlan_id;
 };
 
 enum ib_wr_opcode {
@@ -1099,13 +1118,14 @@ enum ib_flow_attr_type {
 enum ib_flow_spec_type {
        /* L2 headers*/
        IB_FLOW_SPEC_ETH        = 0x20,
+       IB_FLOW_SPEC_IB         = 0x22,
        /* L3 header*/
        IB_FLOW_SPEC_IPV4       = 0x30,
        /* L4 headers*/
        IB_FLOW_SPEC_TCP        = 0x40,
        IB_FLOW_SPEC_UDP        = 0x41
 };
-
+#define IB_FLOW_SPEC_LAYER_MASK        0xF0
 #define IB_FLOW_SPEC_SUPPORT_LAYERS 4
 
 /* Flow steering rule priority is set according to it's domain.
@@ -1133,6 +1153,18 @@ struct ib_flow_spec_eth {
        struct ib_flow_eth_filter mask;
 };
 
+struct ib_flow_ib_filter {
+       __be16 dlid;
+       __u8   sl;
+};
+
+struct ib_flow_spec_ib {
+       enum ib_flow_spec_type   type;
+       u16                      size;
+       struct ib_flow_ib_filter val;
+       struct ib_flow_ib_filter mask;
+};
+
 struct ib_flow_ipv4_filter {
        __be32  src_ip;
        __be32  dst_ip;
@@ -1163,6 +1195,7 @@ union ib_flow_spec {
                u16                     size;
        };
        struct ib_flow_spec_eth         eth;
+       struct ib_flow_spec_ib          ib;
        struct ib_flow_spec_ipv4        ipv4;
        struct ib_flow_spec_tcp_udp     tcp_udp;
 };
@@ -1488,6 +1521,7 @@ static inline int ib_copy_to_udata(struct ib_udata *udata, void *src, size_t len
  * @next_state: Next QP state
  * @type: QP type
  * @mask: Mask of supplied QP attributes
+ * @ll : link layer of port
  *
  * This function is a helper function that a low-level driver's
  * modify_qp method can use to validate the consumer's input.  It
@@ -1496,7 +1530,8 @@ static inline int ib_copy_to_udata(struct ib_udata *udata, void *src, size_t len
  * and that the attribute mask supplied is allowed for the transition.
  */
 int ib_modify_qp_is_ok(enum ib_qp_state cur_state, enum ib_qp_state next_state,
-                      enum ib_qp_type type, enum ib_qp_attr_mask mask);
+                      enum ib_qp_type type, enum ib_qp_attr_mask mask,
+                      enum rdma_link_layer ll);
 
 int ib_register_event_handler  (struct ib_event_handler *event_handler);
 int ib_unregister_event_handler(struct ib_event_handler *event_handler);