net/mlx5: separate DevX commands interface
[dpdk.git] / drivers / net / mlx5 / mlx5_prm.h
index c17ba66..8a67025 100644 (file)
@@ -99,6 +99,9 @@
  * in tx burst routine at the moment of freeing multiple mbufs.
  */
 #define MLX5_EMPW_MAX_PACKETS MLX5_TX_COMP_THRESH
+#define MLX5_MPW_MAX_PACKETS 6
+#define MLX5_MPW_INLINE_MAX_PACKETS 2
+
 /*
  * Default packet length threshold to be inlined with
  * ordinary SEND. Inlining saves the MR key search
 /* Default mark value used when none is provided. */
 #define MLX5_FLOW_MARK_DEFAULT 0xffffff
 
+/* Default mark mask for metadata legacy mode. */
+#define MLX5_FLOW_MARK_MASK 0xffffff
+
 /* Maximum number of DS in WQE. Limited by 6-bit field. */
 #define MLX5_DSEG_MAX 63
 
@@ -354,12 +360,14 @@ struct mlx5_cqe {
        uint16_t hdr_type_etc;
        uint16_t vlan_info;
        uint8_t lro_num_seg;
-       uint8_t rsvd3[11];
+       uint8_t rsvd3[3];
+       uint32_t flow_table_metadata;
+       uint8_t rsvd4[4];
        uint32_t byte_cnt;
        uint64_t timestamp;
        uint32_t sop_drop_qpn;
        uint16_t wqe_counter;
-       uint8_t rsvd4;
+       uint8_t rsvd5;
        uint8_t op_own;
 };
 
@@ -674,7 +682,11 @@ struct mlx5_ifc_fte_match_set_misc3_bits {
        u8 icmp_code[0x8];
        u8 icmpv6_type[0x8];
        u8 icmpv6_code[0x8];
-       u8 reserved_at_1a0[0xe0];
+       u8 reserved_at_120[0x20];
+       u8 gtpu_teid[0x20];
+       u8 gtpu_msg_type[0x08];
+       u8 gtpu_msg_flags[0x08];
+       u8 reserved_at_170[0x90];
 };
 
 /* Flow matcher. */
@@ -1188,7 +1200,9 @@ struct mlx5_ifc_qos_cap_bits {
        u8 reserved_at_8[0x8];
        u8 log_max_flow_meter[0x8];
        u8 flow_meter_reg_id[0x8];
-       u8 reserved_at_25[0x20];
+       u8 reserved_at_25[0x8];
+       u8 flow_meter_reg_share[0x1];
+       u8 reserved_at_2e[0x17];
        u8 packet_pacing_max_rate[0x20];
        u8 packet_pacing_min_rate[0x20];
        u8 reserved_at_80[0x10];
@@ -1227,7 +1241,9 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_bits {
        u8 swp[0x1];
        u8 swp_csum[0x1];
        u8 swp_lso[0x1];
-       u8 reserved_at_23[0xd];
+       u8 reserved_at_23[0x8];
+       u8 tunnel_stateless_gtp[0x1];
+       u8 reserved_at_25[0x4];
        u8 max_vxlan_udp_ports[0x8];
        u8 reserved_at_38[0x6];
        u8 max_geneve_opt_len[0x1];
@@ -1740,6 +1756,38 @@ struct mlx5_ifc_create_sq_in_bits {
        struct mlx5_ifc_sqc_bits ctx;
 };
 
+enum {
+       MLX5_FLOW_METER_OBJ_MODIFY_FIELD_ACTIVE = (1ULL << 0),
+       MLX5_FLOW_METER_OBJ_MODIFY_FIELD_CBS = (1ULL << 1),
+       MLX5_FLOW_METER_OBJ_MODIFY_FIELD_CIR = (1ULL << 2),
+       MLX5_FLOW_METER_OBJ_MODIFY_FIELD_EBS = (1ULL << 3),
+       MLX5_FLOW_METER_OBJ_MODIFY_FIELD_EIR = (1ULL << 4),
+};
+
+struct mlx5_ifc_flow_meter_parameters_bits {
+       u8         valid[0x1];                  // 00h
+       u8         bucket_overflow[0x1];
+       u8         start_color[0x2];
+       u8         both_buckets_on_green[0x1];
+       u8         meter_mode[0x2];
+       u8         reserved_at_1[0x19];
+       u8         reserved_at_2[0x20]; //04h
+       u8         reserved_at_3[0x3];
+       u8         cbs_exponent[0x5];           // 08h
+       u8         cbs_mantissa[0x8];
+       u8         reserved_at_4[0x3];
+       u8         cir_exponent[0x5];
+       u8         cir_mantissa[0x8];
+       u8         reserved_at_5[0x20];         // 0Ch
+       u8         reserved_at_6[0x3];
+       u8         ebs_exponent[0x5];           // 10h
+       u8         ebs_mantissa[0x8];
+       u8         reserved_at_7[0x3];
+       u8         eir_exponent[0x5];
+       u8         eir_mantissa[0x8];
+       u8         reserved_at_8[0x60];         // 14h-1Ch
+};
+
 /* CQE format mask. */
 #define MLX5E_CQE_FORMAT_MASK 0xc
 
@@ -1763,6 +1811,22 @@ struct mlx5_mini_cqe8 {
        uint32_t byte_cnt;
 };
 
+/* srTCM PRM flow meter parameters. */
+enum {
+       MLX5_FLOW_COLOR_RED = 0,
+       MLX5_FLOW_COLOR_YELLOW,
+       MLX5_FLOW_COLOR_GREEN,
+       MLX5_FLOW_COLOR_UNDEFINED,
+};
+
+/* Maximum value of srTCM metering parameters. */
+#define MLX5_SRTCM_CBS_MAX (0xFF * (1ULL << 0x1F))
+#define MLX5_SRTCM_CIR_MAX (8 * (1ULL << 30) * 0xFF)
+#define MLX5_SRTCM_EBS_MAX 0
+
+/* The bits meter color use. */
+#define MLX5_MTR_COLOR_BITS 8
+
 /**
  * Convert a user mark to flow mark.
  *