.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ |
---|
1 | 2 | /* QLogic qed NIC Driver |
---|
2 | 3 | * 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. |
---|
31 | 5 | */ |
---|
32 | 6 | |
---|
33 | 7 | #ifndef __ETH_COMMON__ |
---|
.. | .. |
---|
38 | 12 | /********************/ |
---|
39 | 13 | |
---|
40 | 14 | #define ETH_HSI_VER_MAJOR 3 |
---|
41 | | -#define ETH_HSI_VER_MINOR 10 |
---|
| 15 | +#define ETH_HSI_VER_MINOR 11 |
---|
42 | 16 | |
---|
43 | | -#define ETH_HSI_VER_NO_PKT_LEN_TUNN 5 |
---|
| 17 | +#define ETH_HSI_VER_NO_PKT_LEN_TUNN 5 |
---|
| 18 | +/* Maximum number of pinned L2 connections (CIDs) */ |
---|
| 19 | +#define ETH_PINNED_CONN_MAX_NUM 32 |
---|
44 | 20 | |
---|
45 | 21 | #define ETH_CACHE_LINE_SIZE 64 |
---|
46 | 22 | #define ETH_RX_CQE_GAP 32 |
---|
.. | .. |
---|
61 | 37 | #define ETH_TX_MIN_BDS_PER_TUNN_IPV6_WITH_EXT_PKT 3 |
---|
62 | 38 | #define ETH_TX_MIN_BDS_PER_IPV6_WITH_EXT_PKT 2 |
---|
63 | 39 | #define ETH_TX_MIN_BDS_PER_PKT_W_LOOPBACK_MODE 2 |
---|
| 40 | +#define ETH_TX_MIN_BDS_PER_PKT_W_VPORT_FORWARDING 4 |
---|
64 | 41 | #define ETH_TX_MAX_NON_LSO_PKT_LEN (9700 - (4 + 4 + 12 + 8)) |
---|
65 | 42 | #define ETH_TX_MAX_LSO_HDR_BYTES 510 |
---|
66 | 43 | #define ETH_TX_LSO_WINDOW_BDS_NUM (18 - 1) |
---|
.. | .. |
---|
75 | 52 | #define ETH_NUM_STATISTIC_COUNTERS_QUAD_VF_ZONE \ |
---|
76 | 53 | (ETH_NUM_STATISTIC_COUNTERS - 3 * MAX_NUM_VFS / 4) |
---|
77 | 54 | |
---|
78 | | -/* Maximum number of buffers, used for RX packet placement */ |
---|
79 | 55 | #define ETH_RX_MAX_BUFF_PER_PKT 5 |
---|
80 | | -#define ETH_RX_BD_THRESHOLD 12 |
---|
| 56 | +#define ETH_RX_BD_THRESHOLD 16 |
---|
81 | 57 | |
---|
82 | 58 | /* Num of MAC/VLAN filters */ |
---|
83 | 59 | #define ETH_NUM_MAC_FILTERS 512 |
---|
.. | .. |
---|
96 | 72 | #define ETH_RSS_ENGINE_NUM_BB 127 |
---|
97 | 73 | |
---|
98 | 74 | /* TPA constants */ |
---|
99 | | -#define ETH_TPA_MAX_AGGS_NUM 64 |
---|
100 | | -#define ETH_TPA_CQE_START_LEN_LIST_SIZE ETH_RX_MAX_BUFF_PER_PKT |
---|
101 | | -#define ETH_TPA_CQE_CONT_LEN_LIST_SIZE 6 |
---|
102 | | -#define ETH_TPA_CQE_END_LEN_LIST_SIZE 4 |
---|
| 75 | +#define ETH_TPA_MAX_AGGS_NUM 64 |
---|
| 76 | +#define ETH_TPA_CQE_START_BW_LEN_LIST_SIZE 2 |
---|
| 77 | +#define ETH_TPA_CQE_CONT_LEN_LIST_SIZE 6 |
---|
| 78 | +#define ETH_TPA_CQE_END_LEN_LIST_SIZE 4 |
---|
103 | 79 | |
---|
104 | 80 | /* Control frame check constants */ |
---|
105 | | -#define ETH_CTL_FRAME_ETH_TYPE_NUM 4 |
---|
| 81 | +#define ETH_CTL_FRAME_ETH_TYPE_NUM 4 |
---|
106 | 82 | |
---|
107 | 83 | /* GFS constants */ |
---|
108 | 84 | #define ETH_GFT_TRASHCAN_VPORT 0x1FF /* GFT drop flow vport number */ |
---|
109 | 85 | |
---|
110 | 86 | /* Destination port mode */ |
---|
111 | | -enum dest_port_mode { |
---|
112 | | - DEST_PORT_PHY, |
---|
113 | | - DEST_PORT_LOOPBACK, |
---|
114 | | - DEST_PORT_PHY_LOOPBACK, |
---|
115 | | - DEST_PORT_DROP, |
---|
116 | | - MAX_DEST_PORT_MODE |
---|
| 87 | +enum dst_port_mode { |
---|
| 88 | + DST_PORT_PHY, |
---|
| 89 | + DST_PORT_LOOPBACK, |
---|
| 90 | + DST_PORT_PHY_LOOPBACK, |
---|
| 91 | + DST_PORT_DROP, |
---|
| 92 | + MAX_DST_PORT_MODE |
---|
117 | 93 | }; |
---|
118 | 94 | |
---|
119 | 95 | /* Ethernet address type */ |
---|
.. | .. |
---|
167 | 143 | #define ETH_TX_DATA_2ND_BD_TUNN_INNER_L2_HDR_SIZE_W_SHIFT 0 |
---|
168 | 144 | #define ETH_TX_DATA_2ND_BD_TUNN_INNER_ETH_TYPE_MASK 0x3 |
---|
169 | 145 | #define ETH_TX_DATA_2ND_BD_TUNN_INNER_ETH_TYPE_SHIFT 4 |
---|
170 | | -#define ETH_TX_DATA_2ND_BD_DEST_PORT_MODE_MASK 0x3 |
---|
171 | | -#define ETH_TX_DATA_2ND_BD_DEST_PORT_MODE_SHIFT 6 |
---|
| 146 | +#define ETH_TX_DATA_2ND_BD_DST_PORT_MODE_MASK 0x3 |
---|
| 147 | +#define ETH_TX_DATA_2ND_BD_DST_PORT_MODE_SHIFT 6 |
---|
172 | 148 | #define ETH_TX_DATA_2ND_BD_START_BD_MASK 0x1 |
---|
173 | 149 | #define ETH_TX_DATA_2ND_BD_START_BD_SHIFT 8 |
---|
174 | 150 | #define ETH_TX_DATA_2ND_BD_TUNN_TYPE_MASK 0x3 |
---|
.. | .. |
---|
244 | 220 | struct eth_tunnel_parsing_flags tunnel_pars_flags; |
---|
245 | 221 | u8 bd_num; |
---|
246 | 222 | u8 reserved; |
---|
247 | | - __le16 flow_id; |
---|
248 | | - u8 reserved1[11]; |
---|
| 223 | + __le16 reserved2; |
---|
| 224 | + __le32 flow_id_or_resource_id; |
---|
| 225 | + u8 reserved1[7]; |
---|
249 | 226 | struct eth_pmd_flow_flags pmd_flags; |
---|
250 | 227 | }; |
---|
251 | 228 | |
---|
.. | .. |
---|
296 | 273 | struct eth_tunnel_parsing_flags tunnel_pars_flags; |
---|
297 | 274 | u8 tpa_agg_index; |
---|
298 | 275 | u8 header_len; |
---|
299 | | - __le16 ext_bd_len_list[ETH_TPA_CQE_START_LEN_LIST_SIZE]; |
---|
300 | | - __le16 flow_id; |
---|
301 | | - u8 reserved; |
---|
| 276 | + __le16 bw_ext_bd_len_list[ETH_TPA_CQE_START_BW_LEN_LIST_SIZE]; |
---|
| 277 | + __le16 reserved2; |
---|
| 278 | + __le32 flow_id_or_resource_id; |
---|
| 279 | + u8 reserved[3]; |
---|
302 | 280 | struct eth_pmd_flow_flags pmd_flags; |
---|
303 | 281 | }; |
---|
304 | 282 | |
---|
.. | .. |
---|
407 | 385 | struct eth_tx_data_3rd_bd data; |
---|
408 | 386 | }; |
---|
409 | 387 | |
---|
| 388 | +/* The parsing information data for the forth tx bd of a given packet. */ |
---|
| 389 | +struct eth_tx_data_4th_bd { |
---|
| 390 | + u8 dst_vport_id; |
---|
| 391 | + u8 reserved4; |
---|
| 392 | + __le16 bitfields; |
---|
| 393 | +#define ETH_TX_DATA_4TH_BD_DST_VPORT_ID_VALID_MASK 0x1 |
---|
| 394 | +#define ETH_TX_DATA_4TH_BD_DST_VPORT_ID_VALID_SHIFT 0 |
---|
| 395 | +#define ETH_TX_DATA_4TH_BD_RESERVED1_MASK 0x7F |
---|
| 396 | +#define ETH_TX_DATA_4TH_BD_RESERVED1_SHIFT 1 |
---|
| 397 | +#define ETH_TX_DATA_4TH_BD_START_BD_MASK 0x1 |
---|
| 398 | +#define ETH_TX_DATA_4TH_BD_START_BD_SHIFT 8 |
---|
| 399 | +#define ETH_TX_DATA_4TH_BD_RESERVED2_MASK 0x7F |
---|
| 400 | +#define ETH_TX_DATA_4TH_BD_RESERVED2_SHIFT 9 |
---|
| 401 | + __le16 reserved3; |
---|
| 402 | +}; |
---|
| 403 | + |
---|
| 404 | +/* The forth tx bd of a given packet */ |
---|
| 405 | +struct eth_tx_4th_bd { |
---|
| 406 | + struct regpair addr; /* Single continuous buffer */ |
---|
| 407 | + __le16 nbytes; /* Number of bytes in this BD */ |
---|
| 408 | + struct eth_tx_data_4th_bd data; /* Parsing information data */ |
---|
| 409 | +}; |
---|
| 410 | + |
---|
410 | 411 | /* Complementary information for the regular tx bd of a given packet */ |
---|
411 | 412 | struct eth_tx_data_bd { |
---|
412 | 413 | __le16 reserved0; |
---|
.. | .. |
---|
431 | 432 | struct eth_tx_1st_bd first_bd; |
---|
432 | 433 | struct eth_tx_2nd_bd second_bd; |
---|
433 | 434 | struct eth_tx_3rd_bd third_bd; |
---|
| 435 | + struct eth_tx_4th_bd fourth_bd; |
---|
434 | 436 | struct eth_tx_bd reg_bd; |
---|
435 | 437 | }; |
---|
436 | 438 | |
---|
.. | .. |
---|
443 | 445 | MAX_ETH_TX_TUNN_TYPE |
---|
444 | 446 | }; |
---|
445 | 447 | |
---|
| 448 | +/* Mstorm Queue Zone */ |
---|
| 449 | +struct mstorm_eth_queue_zone { |
---|
| 450 | + struct eth_rx_prod_data rx_producers; |
---|
| 451 | + __le32 reserved[3]; |
---|
| 452 | +}; |
---|
| 453 | + |
---|
446 | 454 | /* Ystorm Queue Zone */ |
---|
447 | 455 | struct xstorm_eth_queue_zone { |
---|
448 | 456 | struct coalescing_timeset int_coalescing_timeset; |
---|