hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
kernel/include/linux/qed/qed_rdma_if.h
....@@ -1,34 +1,9 @@
1
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
12 /* QLogic qed NIC Driver
23 * Copyright (c) 2015-2017 QLogic Corporation
3
- *
4
- * This software is available to you under a choice of one of two
5
- * licenses. You may choose to be licensed under the terms of the GNU
6
- * General Public License (GPL) Version 2, available from the file
7
- * COPYING in the main directory of this source tree, or the
8
- * OpenIB.org BSD license below:
9
- *
10
- * Redistribution and use in source and binary forms, with or
11
- * without modification, are permitted provided that the following
12
- * conditions are met:
13
- *
14
- * - Redistributions of source code must retain the above
15
- * copyright notice, this list of conditions and the following
16
- * disclaimer.
17
- *
18
- * - Redistributions in binary form must reproduce the above
19
- * copyright notice, this list of conditions and the following
20
- * disclaimer in the documentation and /or other materials
21
- * provided with the distribution.
22
- *
23
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
- * SOFTWARE.
4
+ * Copyright (c) 2019-2020 Marvell International Ltd.
315 */
6
+
327 #ifndef _QED_RDMA_IF_H
338 #define _QED_RDMA_IF_H
349 #include <linux/types.h>
....@@ -38,15 +13,6 @@
3813 #include <linux/qed/qed_if.h>
3914 #include <linux/qed/qed_ll2_if.h>
4015 #include <linux/qed/rdma_common.h>
41
-
42
-enum qed_roce_ll2_tx_dest {
43
- /* Light L2 TX Destination to the Network */
44
- QED_ROCE_LL2_TX_DEST_NW,
45
-
46
- /* Light L2 TX Destination to the Loopback */
47
- QED_ROCE_LL2_TX_DEST_LB,
48
- QED_ROCE_LL2_TX_DEST_MAX
49
-};
5016
5117 #define QED_RDMA_MAX_CNQ_SIZE (0xFFFF)
5218
....@@ -60,6 +26,13 @@
6026 QED_ROCE_QP_STATE_SQD,
6127 QED_ROCE_QP_STATE_ERR,
6228 QED_ROCE_QP_STATE_SQE
29
+};
30
+
31
+enum qed_rdma_qp_type {
32
+ QED_RDMA_QP_TYPE_RC,
33
+ QED_RDMA_QP_TYPE_XRC_INI,
34
+ QED_RDMA_QP_TYPE_XRC_TGT,
35
+ QED_RDMA_QP_TYPE_INVAL = 0xffff,
6336 };
6437
6538 enum qed_rdma_tid_type {
....@@ -100,7 +73,6 @@
10073 u64 max_mr_size;
10174 u32 max_cqe;
10275 u32 max_mw;
103
- u32 max_fmr;
10476 u32 max_mr_mw_fmr_pbl;
10577 u64 max_mr_mw_fmr_size;
10678 u32 max_pd;
....@@ -234,7 +206,7 @@
234206
235207 struct qed_rdma_add_user_out_params {
236208 u16 dpi;
237
- u64 dpi_addr;
209
+ void __iomem *dpi_addr;
238210 u64 dpi_phys_addr;
239211 u32 dpi_size;
240212 u16 wid_count;
....@@ -270,10 +242,8 @@
270242 bool pbl_two_level;
271243 u8 pbl_page_size_log;
272244 u8 page_size_log;
273
- u32 fbo;
274245 u64 length;
275246 u64 vaddr;
276
- bool zbva;
277247 bool phy_mr;
278248 bool dma_mr;
279249
....@@ -300,6 +270,12 @@
300270 u16 num_pages;
301271 u16 pd_id;
302272 u16 page_size;
273
+
274
+ /* XRC related only */
275
+ bool reserved_key_en;
276
+ bool is_xrc;
277
+ u32 cq_cid;
278
+ u16 xrcd_id;
303279 };
304280
305281 struct qed_rdma_destroy_cq_in_params {
....@@ -328,7 +304,12 @@
328304 u16 rq_num_pages;
329305 u64 rq_pbl_ptr;
330306 u16 srq_id;
307
+ u16 xrcd_id;
331308 u8 stats_queue;
309
+ enum qed_rdma_qp_type qp_type;
310
+ u8 flags;
311
+#define QED_ROCE_EDPM_MODE_MASK 0x1
312
+#define QED_ROCE_EDPM_MODE_SHIFT 0
332313 };
333314
334315 struct qed_rdma_create_qp_out_params {
....@@ -438,11 +419,13 @@
438419
439420 struct qed_rdma_destroy_srq_in_params {
440421 u16 srq_id;
422
+ bool is_xrc;
441423 };
442424
443425 struct qed_rdma_modify_srq_in_params {
444426 u32 wqe_limit;
445427 u16 srq_id;
428
+ bool is_xrc;
446429 };
447430
448431 struct qed_rdma_stats_out_params {
....@@ -581,7 +564,7 @@
581564 int n_seg;
582565 struct qed_roce_ll2_buffer payload[RDMA_MAX_SGE_PER_SQ_WQE];
583566 int roce_mode;
584
- enum qed_roce_ll2_tx_dest tx_dest;
567
+ enum qed_ll2_tx_dest tx_dest;
585568 };
586569
587570 enum qed_rdma_type {
....@@ -620,6 +603,8 @@
620603 int (*rdma_set_rdma_int)(struct qed_dev *cdev, u16 cnt);
621604 int (*rdma_alloc_pd)(void *rdma_cxt, u16 *pd);
622605 void (*rdma_dealloc_pd)(void *rdma_cxt, u16 pd);
606
+ int (*rdma_alloc_xrcd)(void *rdma_cxt, u16 *xrcd);
607
+ void (*rdma_dealloc_xrcd)(void *rdma_cxt, u16 xrcd);
623608 int (*rdma_create_cq)(void *rdma_cxt,
624609 struct qed_rdma_create_cq_in_params *params,
625610 u16 *icid);
....@@ -679,6 +664,8 @@
679664 int (*ll2_set_mac_filter)(struct qed_dev *cdev,
680665 u8 *old_mac_address, u8 *new_mac_address);
681666
667
+ int (*iwarp_set_engine_affin)(struct qed_dev *cdev, bool b_reset);
668
+
682669 int (*iwarp_connect)(void *rdma_cxt,
683670 struct qed_iwarp_connect_in *iparams,
684671 struct qed_iwarp_connect_out *oparams);