.. | .. |
---|
1 | 1 | /* |
---|
2 | | - * Copyright(c) 2015, 2016 Intel Corporation. |
---|
| 2 | + * Copyright(c) 2015 - 2020 Intel Corporation. |
---|
3 | 3 | * |
---|
4 | 4 | * This file is provided under a dual BSD/GPLv2 license. When using or |
---|
5 | 5 | * redistributing this file, you may do so under either license. |
---|
.. | .. |
---|
72 | 72 | * compilation unit |
---|
73 | 73 | */ |
---|
74 | 74 | |
---|
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 | | - |
---|
82 | 75 | /* driver/hw feature set bitmask */ |
---|
83 | 76 | #define HFI1_CAP_USER_SHIFT 24 |
---|
84 | 77 | #define HFI1_CAP_MASK ((1UL << HFI1_CAP_USER_SHIFT) - 1) |
---|
.. | .. |
---|
136 | 129 | HFI1_CAP_ALLOW_PERM_JKEY | \ |
---|
137 | 130 | HFI1_CAP_STATIC_RATE_CTRL | \ |
---|
138 | 131 | HFI1_CAP_PRINT_UNIMPL | \ |
---|
139 | | - HFI1_CAP_TID_UNMAP) |
---|
| 132 | + HFI1_CAP_TID_UNMAP | \ |
---|
| 133 | + HFI1_CAP_OPFN) |
---|
140 | 134 | /* |
---|
141 | 135 | * A set of capability bits that are "global" and are not allowed to be |
---|
142 | 136 | * set in the user bitmask. |
---|
143 | 137 | */ |
---|
144 | 138 | #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) |
---|
151 | 148 | /* |
---|
152 | 149 | * Set of capabilities that need to be enabled for kernel context in |
---|
153 | 150 | * order to be allowed for user contexts, as well. |
---|
.. | .. |
---|
163 | 160 | HFI1_CAP_PKEY_CHECK | \ |
---|
164 | 161 | HFI1_CAP_MULTI_PKT_EGR | \ |
---|
165 | 162 | HFI1_CAP_EXTENDED_PSN | \ |
---|
| 163 | + HFI1_CAP_AIP | \ |
---|
166 | 164 | ((HFI1_CAP_HDRSUPP | \ |
---|
167 | 165 | HFI1_CAP_MULTI_PKT_EGR | \ |
---|
168 | 166 | HFI1_CAP_STATIC_RATE_CTRL | \ |
---|
.. | .. |
---|
283 | 281 | #define RHF_TID_ERR (0x1ull << 59) |
---|
284 | 282 | #define RHF_LEN_ERR (0x1ull << 60) |
---|
285 | 283 | #define RHF_ECC_ERR (0x1ull << 61) |
---|
286 | | -#define RHF_VCRC_ERR (0x1ull << 62) |
---|
| 284 | +#define RHF_RESERVED (0x1ull << 62) |
---|
287 | 285 | #define RHF_ICRC_ERR (0x1ull << 63) |
---|
288 | 286 | |
---|
289 | 287 | #define RHF_ERROR_SMASK 0xffe0000000000000ull /* bits 63:53 */ |
---|
.. | .. |
---|
320 | 318 | /* RHF receive type error - bypass packet errors */ |
---|
321 | 319 | #define RHF_RTE_BYPASS_NO_ERR 0x0 |
---|
322 | 320 | |
---|
| 321 | +/* MAX RcvSEQ */ |
---|
| 322 | +#define RHF_MAX_SEQ 13 |
---|
| 323 | + |
---|
323 | 324 | /* IB - LRH header constants */ |
---|
324 | 325 | #define HFI1_LRH_GRH 0x0003 /* 1. word of IB LRH - next header: GRH */ |
---|
325 | 326 | #define HFI1_LRH_BTH 0x0002 /* 1. word of IB LRH - next header: BTH */ |
---|
.. | .. |
---|
337 | 338 | |
---|
338 | 339 | #define HFI1_PSM_IOC_BASE_SEQ 0x0 |
---|
339 | 340 | |
---|
| 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 | + |
---|
340 | 345 | static inline __u64 rhf_to_cpu(const __le32 *rbuf) |
---|
341 | 346 | { |
---|
342 | 347 | return __le64_to_cpu(*((__le64 *)rbuf)); |
---|