0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef _GVE_DESC_DQO_H_
0010 #define _GVE_DESC_DQO_H_
0011
0012 #include <linux/build_bug.h>
0013
0014 #define GVE_TX_MAX_HDR_SIZE_DQO 255
0015 #define GVE_TX_MIN_TSO_MSS_DQO 88
0016
0017 #ifndef __LITTLE_ENDIAN_BITFIELD
0018 #error "Only little endian supported"
0019 #endif
0020
0021
0022 struct gve_tx_pkt_desc_dqo {
0023 __le64 buf_addr;
0024
0025
0026 u8 dtype: 5;
0027
0028
0029 u8 end_of_packet: 1;
0030 u8 checksum_offload_enable: 1;
0031
0032
0033 u8 report_event: 1;
0034 u8 reserved0;
0035 __le16 reserved1;
0036
0037
0038
0039 __le16 compl_tag;
0040 u16 buf_size: 14;
0041 u16 reserved2: 2;
0042 } __packed;
0043 static_assert(sizeof(struct gve_tx_pkt_desc_dqo) == 16);
0044
0045 #define GVE_TX_PKT_DESC_DTYPE_DQO 0xc
0046 #define GVE_TX_MAX_BUF_SIZE_DQO ((16 * 1024) - 1)
0047
0048
0049 #define GVE_TX_MAX_DATA_DESCS 10
0050
0051
0052 #define GVE_TX_MIN_DESC_PREVENT_CACHE_OVERLAP 4
0053
0054
0055
0056
0057
0058 #define GVE_TX_MIN_RE_INTERVAL 32
0059
0060 struct gve_tx_context_cmd_dtype {
0061 u8 dtype: 5;
0062 u8 tso: 1;
0063 u8 reserved1: 2;
0064
0065 u8 reserved2;
0066 };
0067
0068 static_assert(sizeof(struct gve_tx_context_cmd_dtype) == 2);
0069
0070
0071
0072
0073
0074 struct gve_tx_tso_context_desc_dqo {
0075
0076 u32 tso_total_len: 24;
0077 u32 flex10: 8;
0078
0079
0080 u16 mss: 14;
0081 u16 reserved: 2;
0082
0083 u8 header_len;
0084 u8 flex11;
0085 struct gve_tx_context_cmd_dtype cmd_dtype;
0086 u8 flex0;
0087 u8 flex5;
0088 u8 flex6;
0089 u8 flex7;
0090 u8 flex8;
0091 u8 flex9;
0092 } __packed;
0093 static_assert(sizeof(struct gve_tx_tso_context_desc_dqo) == 16);
0094
0095 #define GVE_TX_TSO_CTX_DESC_DTYPE_DQO 0x5
0096
0097
0098 struct gve_tx_general_context_desc_dqo {
0099 u8 flex4;
0100 u8 flex5;
0101 u8 flex6;
0102 u8 flex7;
0103 u8 flex8;
0104 u8 flex9;
0105 u8 flex10;
0106 u8 flex11;
0107 struct gve_tx_context_cmd_dtype cmd_dtype;
0108 u16 reserved;
0109 u8 flex0;
0110 u8 flex1;
0111 u8 flex2;
0112 u8 flex3;
0113 } __packed;
0114 static_assert(sizeof(struct gve_tx_general_context_desc_dqo) == 16);
0115
0116 #define GVE_TX_GENERAL_CTX_DESC_DTYPE_DQO 0x4
0117
0118
0119
0120
0121 struct gve_tx_metadata_dqo {
0122 union {
0123 struct {
0124 u8 version;
0125
0126
0127
0128
0129
0130
0131
0132 u16 path_hash: 15;
0133
0134
0135
0136
0137 u16 rehash_event: 1;
0138 } __packed;
0139 u8 bytes[12];
0140 };
0141 } __packed;
0142 static_assert(sizeof(struct gve_tx_metadata_dqo) == 12);
0143
0144 #define GVE_TX_METADATA_VERSION_DQO 0
0145
0146
0147 struct gve_tx_compl_desc {
0148
0149
0150
0151 u16 id: 11;
0152
0153
0154 u16 type: 3;
0155 u16 reserved0: 1;
0156
0157
0158 u16 generation: 1;
0159 union {
0160
0161
0162
0163 __le16 tx_head;
0164
0165
0166
0167
0168 __le16 completion_tag;
0169 };
0170 __le32 reserved1;
0171 } __packed;
0172 static_assert(sizeof(struct gve_tx_compl_desc) == 8);
0173
0174 #define GVE_COMPL_TYPE_DQO_PKT 0x2
0175 #define GVE_COMPL_TYPE_DQO_DESC 0x4
0176 #define GVE_COMPL_TYPE_DQO_MISS 0x1
0177 #define GVE_COMPL_TYPE_DQO_REINJECTION 0x3
0178
0179
0180 struct gve_rx_desc_dqo {
0181 __le16 buf_id;
0182 __le16 reserved0;
0183 __le32 reserved1;
0184 __le64 buf_addr;
0185 __le64 header_buf_addr;
0186 __le64 reserved2;
0187 } __packed;
0188 static_assert(sizeof(struct gve_rx_desc_dqo) == 32);
0189
0190
0191 struct gve_rx_compl_desc_dqo {
0192
0193 u8 rxdid: 4;
0194 u8 reserved0: 4;
0195
0196
0197 u8 loopback: 1;
0198
0199
0200
0201 u8 ipv6_ex_add: 1;
0202
0203 u8 rx_error: 1;
0204 u8 reserved1: 5;
0205
0206 u16 packet_type: 10;
0207 u16 ip_hdr_err: 1;
0208 u16 udp_len_err: 1;
0209 u16 raw_cs_invalid: 1;
0210 u16 reserved2: 3;
0211
0212 u16 packet_len: 14;
0213
0214 u16 generation: 1;
0215
0216 u16 buffer_queue_id: 1;
0217
0218 u16 header_len: 10;
0219 u16 rsc: 1;
0220 u16 split_header: 1;
0221 u16 reserved3: 4;
0222
0223 u8 descriptor_done: 1;
0224 u8 end_of_packet: 1;
0225 u8 header_buffer_overflow: 1;
0226 u8 l3_l4_processed: 1;
0227 u8 csum_ip_err: 1;
0228 u8 csum_l4_err: 1;
0229 u8 csum_external_ip_err: 1;
0230 u8 csum_external_udp_err: 1;
0231
0232 u8 status_error1;
0233
0234 __le16 reserved5;
0235 __le16 buf_id;
0236
0237 union {
0238
0239 __le16 raw_cs;
0240
0241 __le16 rsc_seg_len;
0242 };
0243 __le32 hash;
0244 __le32 reserved6;
0245 __le64 reserved7;
0246 } __packed;
0247
0248 static_assert(sizeof(struct gve_rx_compl_desc_dqo) == 32);
0249
0250
0251
0252
0253
0254 #define GVE_RX_BUF_THRESH_DQO 32
0255
0256 #endif