hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h
....@@ -1,16 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Huawei HiNIC PCI Express Linux driver
34 * Copyright(c) 2017 Huawei Technologies Co., Ltd
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms and conditions of the GNU General Public License,
7
- * version 2, as published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
- * for more details.
13
- *
145 */
156
167 #ifndef HINIC_HW_QP_H
....@@ -47,11 +38,14 @@
4738 #define HINIC_SQ_WQEBB_SIZE 64
4839 #define HINIC_RQ_WQEBB_SIZE 32
4940
50
-#define HINIC_SQ_PAGE_SIZE SZ_4K
51
-#define HINIC_RQ_PAGE_SIZE SZ_4K
41
+#define HINIC_SQ_PAGE_SIZE SZ_256K
42
+#define HINIC_RQ_PAGE_SIZE SZ_256K
5243
5344 #define HINIC_SQ_DEPTH SZ_4K
5445 #define HINIC_RQ_DEPTH SZ_4K
46
+
47
+#define HINIC_MAX_QUEUE_DEPTH SZ_4K
48
+#define HINIC_MIN_QUEUE_DEPTH 128
5549
5650 /* In any change to HINIC_RX_BUF_SZ, HINIC_RX_BUF_SZ_IDX must be changed */
5751 #define HINIC_RX_BUF_SZ 2048
....@@ -87,6 +81,8 @@
8781
8882 struct hinic_wq *wq;
8983
84
+ u16 qid;
85
+
9086 u32 irq;
9187 u16 msix_entry;
9288
....@@ -96,12 +92,15 @@
9692 void __iomem *db_base;
9793
9894 struct sk_buff **saved_skb;
95
+ struct hinic_debug_priv *dbg;
9996 };
10097
10198 struct hinic_rq {
10299 struct hinic_hwif *hwif;
103100
104101 struct hinic_wq *wq;
102
+
103
+ u16 qid;
105104
106105 struct cpumask affinity_mask;
107106 u32 irq;
....@@ -116,6 +115,7 @@
116115
117116 u16 *pi_virt_addr;
118117 dma_addr_t pi_dma_addr;
118
+ struct hinic_debug_priv *dbg;
119119 };
120120
121121 struct hinic_qp {
....@@ -150,6 +150,31 @@
150150
151151 int hinic_get_rq_free_wqebbs(struct hinic_rq *rq);
152152
153
+void hinic_task_set_l2hdr(struct hinic_sq_task *task, u32 len);
154
+
155
+void hinic_task_set_outter_l3(struct hinic_sq_task *task,
156
+ enum hinic_l3_offload_type l3_type,
157
+ u32 network_len);
158
+
159
+void hinic_task_set_inner_l3(struct hinic_sq_task *task,
160
+ enum hinic_l3_offload_type l3_type,
161
+ u32 network_len);
162
+
163
+void hinic_task_set_tunnel_l4(struct hinic_sq_task *task,
164
+ enum hinic_l4_tunnel_type l4_type,
165
+ u32 tunnel_len);
166
+
167
+void hinic_set_cs_inner_l4(struct hinic_sq_task *task,
168
+ u32 *queue_info,
169
+ enum hinic_l4_offload_type l4_offload,
170
+ u32 l4_len, u32 offset);
171
+
172
+void hinic_set_tso_inner_l4(struct hinic_sq_task *task,
173
+ u32 *queue_info,
174
+ enum hinic_l4_offload_type l4_offload,
175
+ u32 l4_len,
176
+ u32 offset, u32 ip_ident, u32 mss);
177
+
153178 void hinic_sq_prepare_wqe(struct hinic_sq *sq, u16 prod_idx,
154179 struct hinic_sq_wqe *wqe, struct hinic_sge *sges,
155180 int nr_sges);
....@@ -160,6 +185,8 @@
160185 struct hinic_sq_wqe *hinic_sq_get_wqe(struct hinic_sq *sq,
161186 unsigned int wqe_size, u16 *prod_idx);
162187
188
+void hinic_sq_return_wqe(struct hinic_sq *sq, unsigned int wqe_size);
189
+
163190 void hinic_sq_write_wqe(struct hinic_sq *sq, u16 prod_idx,
164191 struct hinic_sq_wqe *wqe, struct sk_buff *skb,
165192 unsigned int wqe_size);