hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/infiniband/hw/hfi1/common.h
....@@ -1,5 +1,5 @@
11 /*
2
- * Copyright(c) 2015, 2016 Intel Corporation.
2
+ * Copyright(c) 2015 - 2020 Intel Corporation.
33 *
44 * This file is provided under a dual BSD/GPLv2 license. When using or
55 * redistributing this file, you may do so under either license.
....@@ -72,13 +72,6 @@
7272 * compilation unit
7373 */
7474
75
-/*
76
- * If a packet's QP[23:16] bits match this value, then it is
77
- * a PSM packet and the hardware will expect a KDETH header
78
- * following the BTH.
79
- */
80
-#define DEFAULT_KDETH_QP 0x80
81
-
8275 /* driver/hw feature set bitmask */
8376 #define HFI1_CAP_USER_SHIFT 24
8477 #define HFI1_CAP_MASK ((1UL << HFI1_CAP_USER_SHIFT) - 1)
....@@ -136,18 +129,22 @@
136129 HFI1_CAP_ALLOW_PERM_JKEY | \
137130 HFI1_CAP_STATIC_RATE_CTRL | \
138131 HFI1_CAP_PRINT_UNIMPL | \
139
- HFI1_CAP_TID_UNMAP)
132
+ HFI1_CAP_TID_UNMAP | \
133
+ HFI1_CAP_OPFN)
140134 /*
141135 * A set of capability bits that are "global" and are not allowed to be
142136 * set in the user bitmask.
143137 */
144138 #define HFI1_CAP_RESERVED_MASK ((HFI1_CAP_SDMA | \
145
- HFI1_CAP_USE_SDMA_HEAD | \
146
- HFI1_CAP_EXTENDED_PSN | \
147
- HFI1_CAP_PRINT_UNIMPL | \
148
- HFI1_CAP_NO_INTEGRITY | \
149
- HFI1_CAP_PKEY_CHECK) << \
150
- HFI1_CAP_USER_SHIFT)
139
+ HFI1_CAP_USE_SDMA_HEAD | \
140
+ HFI1_CAP_EXTENDED_PSN | \
141
+ HFI1_CAP_PRINT_UNIMPL | \
142
+ HFI1_CAP_NO_INTEGRITY | \
143
+ HFI1_CAP_PKEY_CHECK | \
144
+ HFI1_CAP_TID_RDMA | \
145
+ HFI1_CAP_OPFN | \
146
+ HFI1_CAP_AIP) << \
147
+ HFI1_CAP_USER_SHIFT)
151148 /*
152149 * Set of capabilities that need to be enabled for kernel context in
153150 * order to be allowed for user contexts, as well.
....@@ -163,6 +160,7 @@
163160 HFI1_CAP_PKEY_CHECK | \
164161 HFI1_CAP_MULTI_PKT_EGR | \
165162 HFI1_CAP_EXTENDED_PSN | \
163
+ HFI1_CAP_AIP | \
166164 ((HFI1_CAP_HDRSUPP | \
167165 HFI1_CAP_MULTI_PKT_EGR | \
168166 HFI1_CAP_STATIC_RATE_CTRL | \
....@@ -283,7 +281,7 @@
283281 #define RHF_TID_ERR (0x1ull << 59)
284282 #define RHF_LEN_ERR (0x1ull << 60)
285283 #define RHF_ECC_ERR (0x1ull << 61)
286
-#define RHF_VCRC_ERR (0x1ull << 62)
284
+#define RHF_RESERVED (0x1ull << 62)
287285 #define RHF_ICRC_ERR (0x1ull << 63)
288286
289287 #define RHF_ERROR_SMASK 0xffe0000000000000ull /* bits 63:53 */
....@@ -320,6 +318,9 @@
320318 /* RHF receive type error - bypass packet errors */
321319 #define RHF_RTE_BYPASS_NO_ERR 0x0
322320
321
+/* MAX RcvSEQ */
322
+#define RHF_MAX_SEQ 13
323
+
323324 /* IB - LRH header constants */
324325 #define HFI1_LRH_GRH 0x0003 /* 1. word of IB LRH - next header: GRH */
325326 #define HFI1_LRH_BTH 0x0002 /* 1. word of IB LRH - next header: BTH */
....@@ -337,6 +338,10 @@
337338
338339 #define HFI1_PSM_IOC_BASE_SEQ 0x0
339340
341
+/* Number of BTH.PSN bits used for sequence number in expected rcvs */
342
+#define HFI1_KDETH_BTH_SEQ_SHIFT 11
343
+#define HFI1_KDETH_BTH_SEQ_MASK (BIT(HFI1_KDETH_BTH_SEQ_SHIFT) - 1)
344
+
340345 static inline __u64 rhf_to_cpu(const __le32 *rbuf)
341346 {
342347 return __le64_to_cpu(*((__le64 *)rbuf));