hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/include/linux/mlx5/qp.h
....@@ -37,7 +37,8 @@
3737 #include <linux/mlx5/driver.h>
3838
3939 #define MLX5_INVALID_LKEY 0x100
40
-#define MLX5_SIG_WQE_SIZE (MLX5_SEND_WQE_BB * 5)
40
+/* UMR (3 WQE_BB's) + SIG (3 WQE_BB's) + PSV (mem) + PSV (wire) */
41
+#define MLX5_SIG_WQE_SIZE (MLX5_SEND_WQE_BB * 8)
4142 #define MLX5_DIF_SIZE 8
4243 #define MLX5_STRIDE_BLOCK_OP 0x400
4344 #define MLX5_CPY_GRD_MASK 0xc0
....@@ -65,11 +66,13 @@
6566 MLX5_QP_OPTPAR_RETRY_COUNT = 1 << 12,
6667 MLX5_QP_OPTPAR_RNR_RETRY = 1 << 13,
6768 MLX5_QP_OPTPAR_ACK_TIMEOUT = 1 << 14,
69
+ MLX5_QP_OPTPAR_LAG_TX_AFF = 1 << 15,
6870 MLX5_QP_OPTPAR_PRI_PORT = 1 << 16,
6971 MLX5_QP_OPTPAR_SRQN = 1 << 18,
7072 MLX5_QP_OPTPAR_CQN_RCV = 1 << 19,
7173 MLX5_QP_OPTPAR_DC_HS = 1 << 20,
7274 MLX5_QP_OPTPAR_DC_KEY = 1 << 21,
75
+ MLX5_QP_OPTPAR_COUNTER_SET_ID = 1 << 25,
7376 };
7477
7578 enum mlx5_qp_state {
....@@ -202,7 +205,12 @@
202205 u8 signature;
203206 u8 rsvd[2];
204207 u8 fm_ce_se;
205
- __be32 imm;
208
+ union {
209
+ __be32 general_id;
210
+ __be32 imm;
211
+ __be32 umr_mkey;
212
+ __be32 tis_tir_num;
213
+ };
206214 };
207215
208216 #define MLX5_WQE_CTRL_DS_MASK 0x3f
....@@ -222,6 +230,11 @@
222230
223231 enum {
224232 MLX5_ETH_WQE_SVLAN = 1 << 0,
233
+ MLX5_ETH_WQE_TRAILER_HDR_OUTER_IP_ASSOC = 1 << 26,
234
+ MLX5_ETH_WQE_TRAILER_HDR_OUTER_L4_ASSOC = 1 << 27,
235
+ MLX5_ETH_WQE_TRAILER_HDR_INNER_IP_ASSOC = 3 << 26,
236
+ MLX5_ETH_WQE_TRAILER_HDR_INNER_L4_ASSOC = 1 << 28,
237
+ MLX5_ETH_WQE_INSERT_TRAILER = 1 << 30,
225238 MLX5_ETH_WQE_INSERT_VLAN = 1 << 15,
226239 };
227240
....@@ -232,6 +245,10 @@
232245 MLX5_ETH_WQE_SWP_OUTER_L4_UDP = 1 << 5,
233246 };
234247
248
+enum {
249
+ MLX5_ETH_WQE_FT_META_IPSEC = BIT(0),
250
+};
251
+
235252 struct mlx5_wqe_eth_seg {
236253 u8 swp_outer_l4_offset;
237254 u8 swp_outer_l3_offset;
....@@ -240,7 +257,7 @@
240257 u8 cs_flags;
241258 u8 swp_flags;
242259 __be16 mss;
243
- __be32 rsvd2;
260
+ __be32 flow_table_metadata;
244261 union {
245262 struct {
246263 __be16 sz;
....@@ -250,6 +267,7 @@
250267 __be16 type;
251268 __be16 vlan_tci;
252269 } insert;
270
+ __be32 trailer;
253271 };
254272 };
255273
....@@ -308,6 +326,7 @@
308326 struct mlx5_ib_ah {
309327 struct ib_ah ibah;
310328 struct mlx5_av av;
329
+ u8 xmit_port;
311330 };
312331
313332 static inline struct mlx5_ib_ah *to_mah(struct ib_ah *ibah)
....@@ -395,6 +414,7 @@
395414
396415 struct mlx5_wqe_inline_seg {
397416 __be32 byte_count;
417
+ __be32 data[];
398418 };
399419
400420 enum mlx5_sig_type {
....@@ -471,6 +491,7 @@
471491 int qpn;
472492 struct mlx5_rsc_debug *dbg;
473493 int pid;
494
+ u16 uid;
474495 };
475496
476497 struct mlx5_core_dct {
....@@ -478,122 +499,8 @@
478499 struct completion drained;
479500 };
480501
481
-struct mlx5_qp_path {
482
- u8 fl_free_ar;
483
- u8 rsvd3;
484
- __be16 pkey_index;
485
- u8 rsvd0;
486
- u8 grh_mlid;
487
- __be16 rlid;
488
- u8 ackto_lt;
489
- u8 mgid_index;
490
- u8 static_rate;
491
- u8 hop_limit;
492
- __be32 tclass_flowlabel;
493
- union {
494
- u8 rgid[16];
495
- u8 rip[16];
496
- };
497
- u8 f_dscp_ecn_prio;
498
- u8 ecn_dscp;
499
- __be16 udp_sport;
500
- u8 dci_cfi_prio_sl;
501
- u8 port;
502
- u8 rmac[6];
503
-};
504
-
505
-/* FIXME: use mlx5_ifc.h qpc */
506
-struct mlx5_qp_context {
507
- __be32 flags;
508
- __be32 flags_pd;
509
- u8 mtu_msgmax;
510
- u8 rq_size_stride;
511
- __be16 sq_crq_size;
512
- __be32 qp_counter_set_usr_page;
513
- __be32 wire_qpn;
514
- __be32 log_pg_sz_remote_qpn;
515
- struct mlx5_qp_path pri_path;
516
- struct mlx5_qp_path alt_path;
517
- __be32 params1;
518
- u8 reserved2[4];
519
- __be32 next_send_psn;
520
- __be32 cqn_send;
521
- __be32 deth_sqpn;
522
- u8 reserved3[4];
523
- __be32 last_acked_psn;
524
- __be32 ssn;
525
- __be32 params2;
526
- __be32 rnr_nextrecvpsn;
527
- __be32 xrcd;
528
- __be32 cqn_recv;
529
- __be64 db_rec_addr;
530
- __be32 qkey;
531
- __be32 rq_type_srqn;
532
- __be32 rmsn;
533
- __be16 hw_sq_wqe_counter;
534
- __be16 sw_sq_wqe_counter;
535
- __be16 hw_rcyclic_byte_counter;
536
- __be16 hw_rq_counter;
537
- __be16 sw_rcyclic_byte_counter;
538
- __be16 sw_rq_counter;
539
- u8 rsvd0[5];
540
- u8 cgs;
541
- u8 cs_req;
542
- u8 cs_res;
543
- __be64 dc_access_key;
544
- u8 rsvd1[24];
545
-};
546
-
547
-static inline struct mlx5_core_qp *__mlx5_qp_lookup(struct mlx5_core_dev *dev, u32 qpn)
548
-{
549
- return radix_tree_lookup(&dev->priv.qp_table.tree, qpn);
550
-}
551
-
552
-static inline struct mlx5_core_mkey *__mlx5_mr_lookup(struct mlx5_core_dev *dev, u32 key)
553
-{
554
- return radix_tree_lookup(&dev->priv.mkey_table.tree, key);
555
-}
556
-
557
-int mlx5_core_create_dct(struct mlx5_core_dev *dev,
558
- struct mlx5_core_dct *qp,
559
- u32 *in, int inlen);
560
-int mlx5_core_create_qp(struct mlx5_core_dev *dev,
561
- struct mlx5_core_qp *qp,
562
- u32 *in,
563
- int inlen);
564
-int mlx5_core_qp_modify(struct mlx5_core_dev *dev, u16 opcode,
565
- u32 opt_param_mask, void *qpc,
566
- struct mlx5_core_qp *qp);
567
-int mlx5_core_destroy_qp(struct mlx5_core_dev *dev,
568
- struct mlx5_core_qp *qp);
569
-int mlx5_core_destroy_dct(struct mlx5_core_dev *dev,
570
- struct mlx5_core_dct *dct);
571
-int mlx5_core_qp_query(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp,
572
- u32 *out, int outlen);
573
-int mlx5_core_dct_query(struct mlx5_core_dev *dev, struct mlx5_core_dct *dct,
574
- u32 *out, int outlen);
575
-
576
-int mlx5_core_set_delay_drop(struct mlx5_core_dev *dev,
577
- u32 timeout_usec);
578
-
579
-int mlx5_core_xrcd_alloc(struct mlx5_core_dev *dev, u32 *xrcdn);
580
-int mlx5_core_xrcd_dealloc(struct mlx5_core_dev *dev, u32 xrcdn);
581
-void mlx5_init_qp_table(struct mlx5_core_dev *dev);
582
-void mlx5_cleanup_qp_table(struct mlx5_core_dev *dev);
583502 int mlx5_debug_qp_add(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp);
584503 void mlx5_debug_qp_remove(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp);
585
-int mlx5_core_create_rq_tracked(struct mlx5_core_dev *dev, u32 *in, int inlen,
586
- struct mlx5_core_qp *rq);
587
-void mlx5_core_destroy_rq_tracked(struct mlx5_core_dev *dev,
588
- struct mlx5_core_qp *rq);
589
-int mlx5_core_create_sq_tracked(struct mlx5_core_dev *dev, u32 *in, int inlen,
590
- struct mlx5_core_qp *sq);
591
-void mlx5_core_destroy_sq_tracked(struct mlx5_core_dev *dev,
592
- struct mlx5_core_qp *sq);
593
-int mlx5_core_alloc_q_counter(struct mlx5_core_dev *dev, u16 *counter_id);
594
-int mlx5_core_dealloc_q_counter(struct mlx5_core_dev *dev, u16 counter_id);
595
-int mlx5_core_query_q_counter(struct mlx5_core_dev *dev, u16 counter_id,
596
- int reset, void *out, int out_size);
597504
598505 static inline const char *mlx5_qp_type_str(int type)
599506 {