3535
3636#include <linux/types.h>
3737#include <rdma/ib_verbs.h>
38+ #include <linux/mlx5/mlx5_ifc.h>
3839
3940#if defined(__LITTLE_ENDIAN )
4041#define MLX5_SET_HOST_ENDIANNESS 0
7071 << __mlx5_dw_bit_off(typ, fld))); \
7172} while (0)
7273
74+ #define MLX5_SET_TO_ONES (typ , p , fld ) do { \
75+ BUILD_BUG_ON(__mlx5_st_sz_bits(typ) % 32); \
76+ *((__be32 *)(p) + __mlx5_dw_off(typ, fld)) = \
77+ cpu_to_be32((be32_to_cpu(*((__be32 *)(p) + __mlx5_dw_off(typ, fld))) & \
78+ (~__mlx5_dw_mask(typ, fld))) | ((__mlx5_mask(typ, fld)) \
79+ << __mlx5_dw_bit_off(typ, fld))); \
80+ } while (0)
81+
7382#define MLX5_GET (typ , p , fld ) ((be32_to_cpu(*((__be32 *)(p) +\
7483__mlx5_dw_off(typ, fld))) >> __mlx5_dw_bit_off(typ, fld)) & \
7584__mlx5_mask(typ, fld))
@@ -264,6 +273,7 @@ enum {
264273 MLX5_OPCODE_RDMA_WRITE_IMM = 0x09 ,
265274 MLX5_OPCODE_SEND = 0x0a ,
266275 MLX5_OPCODE_SEND_IMM = 0x0b ,
276+ MLX5_OPCODE_LSO = 0x0e ,
267277 MLX5_OPCODE_RDMA_READ = 0x10 ,
268278 MLX5_OPCODE_ATOMIC_CS = 0x11 ,
269279 MLX5_OPCODE_ATOMIC_FA = 0x12 ,
@@ -541,6 +551,10 @@ struct mlx5_cmd_prot_block {
541551 u8 sig ;
542552};
543553
554+ enum {
555+ MLX5_CQE_SYND_FLUSHED_IN_ERROR = 5 ,
556+ };
557+
544558struct mlx5_err_cqe {
545559 u8 rsvd0 [32 ];
546560 __be32 srqn ;
@@ -554,13 +568,22 @@ struct mlx5_err_cqe {
554568};
555569
556570struct mlx5_cqe64 {
557- u8 rsvd0 [17 ];
571+ u8 rsvd0 [4 ];
572+ u8 lro_tcppsh_abort_dupack ;
573+ u8 lro_min_ttl ;
574+ __be16 lro_tcp_win ;
575+ __be32 lro_ack_seq_num ;
576+ __be32 rss_hash_result ;
577+ u8 rss_hash_type ;
558578 u8 ml_path ;
559- u8 rsvd20 [4 ];
579+ u8 rsvd20 [2 ];
580+ __be16 check_sum ;
560581 __be16 slid ;
561582 __be32 flags_rqpn ;
562- u8 rsvd28 [4 ];
563- __be32 srqn ;
583+ u8 hds_ip_ext ;
584+ u8 l4_hdr_type_etc ;
585+ __be16 vlan_info ;
586+ __be32 srqn ; /* [31:24]: lro_num_seg, [23:0]: srqn */
564587 __be32 imm_inval_pkey ;
565588 u8 rsvd40 [4 ];
566589 __be32 byte_cnt ;
@@ -571,6 +594,40 @@ struct mlx5_cqe64 {
571594 u8 op_own ;
572595};
573596
597+ static inline int get_cqe_lro_tcppsh (struct mlx5_cqe64 * cqe )
598+ {
599+ return (cqe -> lro_tcppsh_abort_dupack >> 6 ) & 1 ;
600+ }
601+
602+ static inline u8 get_cqe_l4_hdr_type (struct mlx5_cqe64 * cqe )
603+ {
604+ return (cqe -> l4_hdr_type_etc >> 4 ) & 0x7 ;
605+ }
606+
607+ static inline int cqe_has_vlan (struct mlx5_cqe64 * cqe )
608+ {
609+ return !!(cqe -> l4_hdr_type_etc & 0x1 );
610+ }
611+
612+ enum {
613+ CQE_L4_HDR_TYPE_NONE = 0x0 ,
614+ CQE_L4_HDR_TYPE_TCP_NO_ACK = 0x1 ,
615+ CQE_L4_HDR_TYPE_UDP = 0x2 ,
616+ CQE_L4_HDR_TYPE_TCP_ACK_NO_DATA = 0x3 ,
617+ CQE_L4_HDR_TYPE_TCP_ACK_AND_DATA = 0x4 ,
618+ };
619+
620+ enum {
621+ CQE_RSS_HTYPE_IP = 0x3 << 6 ,
622+ CQE_RSS_HTYPE_L4 = 0x3 << 2 ,
623+ };
624+
625+ enum {
626+ CQE_L2_OK = 1 << 0 ,
627+ CQE_L3_OK = 1 << 1 ,
628+ CQE_L4_OK = 1 << 2 ,
629+ };
630+
574631struct mlx5_sig_err_cqe {
575632 u8 rsvd0 [16 ];
576633 __be32 expected_trans_sig ;
@@ -996,4 +1053,52 @@ struct mlx5_destroy_psv_out {
9961053 u8 rsvd [8 ];
9971054};
9981055
1056+ #define MLX5_CMD_OP_MAX 0x920
1057+
1058+ enum {
1059+ VPORT_STATE_DOWN = 0x0 ,
1060+ VPORT_STATE_UP = 0x1 ,
1061+ };
1062+
1063+ enum {
1064+ MLX5_L3_PROT_TYPE_IPV4 = 0 ,
1065+ MLX5_L3_PROT_TYPE_IPV6 = 1 ,
1066+ };
1067+
1068+ enum {
1069+ MLX5_L4_PROT_TYPE_TCP = 0 ,
1070+ MLX5_L4_PROT_TYPE_UDP = 1 ,
1071+ };
1072+
1073+ enum {
1074+ MLX5_HASH_FIELD_SEL_SRC_IP = 1 << 0 ,
1075+ MLX5_HASH_FIELD_SEL_DST_IP = 1 << 1 ,
1076+ MLX5_HASH_FIELD_SEL_L4_SPORT = 1 << 2 ,
1077+ MLX5_HASH_FIELD_SEL_L4_DPORT = 1 << 3 ,
1078+ MLX5_HASH_FIELD_SEL_IPSEC_SPI = 1 << 4 ,
1079+ };
1080+
1081+ enum {
1082+ MLX5_MATCH_OUTER_HEADERS = 1 << 0 ,
1083+ MLX5_MATCH_MISC_PARAMETERS = 1 << 1 ,
1084+ MLX5_MATCH_INNER_HEADERS = 1 << 2 ,
1085+
1086+ };
1087+
1088+ enum {
1089+ MLX5_FLOW_TABLE_TYPE_NIC_RCV = 0 ,
1090+ MLX5_FLOW_TABLE_TYPE_ESWITCH = 4 ,
1091+ };
1092+
1093+ enum {
1094+ MLX5_FLOW_CONTEXT_DEST_TYPE_VPORT = 0 ,
1095+ MLX5_FLOW_CONTEXT_DEST_TYPE_FLOW_TABLE = 1 ,
1096+ MLX5_FLOW_CONTEXT_DEST_TYPE_TIR = 2 ,
1097+ };
1098+
1099+ enum {
1100+ MLX5_RQC_RQ_TYPE_MEMORY_RQ_INLINE = 0x0 ,
1101+ MLX5_RQC_RQ_TYPE_MEMORY_RQ_RPM = 0x1 ,
1102+ };
1103+
9991104#endif /* MLX5_DEVICE_H */
0 commit comments