.. | .. |
---|
1 | | -/* |
---|
2 | | - * Copyright (C) 2015-2018 Netronome Systems, Inc. |
---|
3 | | - * |
---|
4 | | - * This software is dual licensed under the GNU General License Version 2, |
---|
5 | | - * June 1991 as shown in the file COPYING in the top-level directory of this |
---|
6 | | - * source tree or the BSD 2-Clause License provided below. You have the |
---|
7 | | - * option to license this software under the complete terms of either license. |
---|
8 | | - * |
---|
9 | | - * The BSD 2-Clause License: |
---|
10 | | - * |
---|
11 | | - * Redistribution and use in source and binary forms, with or |
---|
12 | | - * without modification, are permitted provided that the following |
---|
13 | | - * conditions are met: |
---|
14 | | - * |
---|
15 | | - * 1. Redistributions of source code must retain the above |
---|
16 | | - * copyright notice, this list of conditions and the following |
---|
17 | | - * disclaimer. |
---|
18 | | - * |
---|
19 | | - * 2. Redistributions in binary form must reproduce the above |
---|
20 | | - * copyright notice, this list of conditions and the following |
---|
21 | | - * disclaimer in the documentation and/or other materials |
---|
22 | | - * provided with the distribution. |
---|
23 | | - * |
---|
24 | | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
---|
25 | | - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
---|
26 | | - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
---|
27 | | - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
---|
28 | | - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
---|
29 | | - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
---|
30 | | - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
---|
31 | | - * SOFTWARE. |
---|
32 | | - */ |
---|
| 1 | +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ |
---|
| 2 | +/* Copyright (C) 2015-2018 Netronome Systems, Inc. */ |
---|
33 | 3 | |
---|
34 | 4 | /* |
---|
35 | 5 | * nfp_net_ctrl.h |
---|
.. | .. |
---|
74 | 44 | #define NFP_NET_META_MARK 2 |
---|
75 | 45 | #define NFP_NET_META_PORTID 5 |
---|
76 | 46 | #define NFP_NET_META_CSUM 6 /* checksum complete type */ |
---|
| 47 | +#define NFP_NET_META_CONN_HANDLE 7 |
---|
| 48 | +#define NFP_NET_META_RESYNC_INFO 8 /* RX resync info request */ |
---|
77 | 49 | |
---|
78 | 50 | #define NFP_META_PORT_ID_CTRL ~0U |
---|
79 | 51 | |
---|
.. | .. |
---|
134 | 106 | #define NFP_NET_CFG_CTRL_RINGPRIO (0x1 << 19) /* Ring priorities */ |
---|
135 | 107 | #define NFP_NET_CFG_CTRL_MSIXAUTO (0x1 << 20) /* MSI-X auto-masking */ |
---|
136 | 108 | #define NFP_NET_CFG_CTRL_TXRWB (0x1 << 21) /* Write-back of TX ring*/ |
---|
137 | | -#define NFP_NET_CFG_CTRL_L2SWITCH (0x1 << 22) /* L2 Switch */ |
---|
138 | | -#define NFP_NET_CFG_CTRL_L2SWITCH_LOCAL (0x1 << 23) /* Switch to local */ |
---|
139 | 109 | #define NFP_NET_CFG_CTRL_VXLAN (0x1 << 24) /* VXLAN tunnel support */ |
---|
140 | 110 | #define NFP_NET_CFG_CTRL_NVGRE (0x1 << 25) /* NVGRE tunnel support */ |
---|
141 | 111 | #define NFP_NET_CFG_CTRL_BPF (0x1 << 27) /* BPF offload capable */ |
---|
.. | .. |
---|
160 | 130 | #define NFP_NET_CFG_UPDATE_TXRPRIO (0x1 << 3) /* TX Ring prio change */ |
---|
161 | 131 | #define NFP_NET_CFG_UPDATE_RXRPRIO (0x1 << 4) /* RX Ring prio change */ |
---|
162 | 132 | #define NFP_NET_CFG_UPDATE_MSIX (0x1 << 5) /* MSI-X change */ |
---|
163 | | -#define NFP_NET_CFG_UPDATE_L2SWITCH (0x1 << 6) /* Switch changes */ |
---|
164 | 133 | #define NFP_NET_CFG_UPDATE_RESET (0x1 << 7) /* Update due to FLR */ |
---|
165 | 134 | #define NFP_NET_CFG_UPDATE_IRQMOD (0x1 << 8) /* IRQ mod change */ |
---|
166 | 135 | #define NFP_NET_CFG_UPDATE_VXLAN (0x1 << 9) /* VXLAN port change */ |
---|
.. | .. |
---|
168 | 137 | #define NFP_NET_CFG_UPDATE_MACADDR (0x1 << 11) /* MAC address change */ |
---|
169 | 138 | #define NFP_NET_CFG_UPDATE_MBOX (0x1 << 12) /* Mailbox update */ |
---|
170 | 139 | #define NFP_NET_CFG_UPDATE_VF (0x1 << 13) /* VF settings change */ |
---|
| 140 | +#define NFP_NET_CFG_UPDATE_CRYPTO (0x1 << 14) /* Crypto on/off */ |
---|
171 | 141 | #define NFP_NET_CFG_UPDATE_ERR (0x1 << 31) /* A error occurred */ |
---|
172 | 142 | #define NFP_NET_CFG_TXRS_ENABLE 0x0008 |
---|
173 | 143 | #define NFP_NET_CFG_RXRS_ENABLE 0x0010 |
---|
.. | .. |
---|
264 | 234 | * %NFP_NET_CFG_BPF_ADDR: DMA address of the buffer with JITed BPF code |
---|
265 | 235 | */ |
---|
266 | 236 | #define NFP_NET_CFG_BPF_ABI 0x0080 |
---|
267 | | -#define NFP_NET_BPF_ABI 2 |
---|
268 | 237 | #define NFP_NET_CFG_BPF_CAP 0x0081 |
---|
269 | 238 | #define NFP_NET_BPF_CAP_RELO (1 << 0) /* seamless reload */ |
---|
270 | 239 | #define NFP_NET_CFG_BPF_MAX_LEN 0x0082 |
---|
.. | .. |
---|
423 | 392 | #define NFP_NET_CFG_MBOX_SIMPLE_CMD 0x0 |
---|
424 | 393 | #define NFP_NET_CFG_MBOX_SIMPLE_RET 0x4 |
---|
425 | 394 | #define NFP_NET_CFG_MBOX_SIMPLE_VAL 0x8 |
---|
426 | | -#define NFP_NET_CFG_MBOX_SIMPLE_LEN 12 |
---|
427 | 395 | |
---|
428 | 396 | #define NFP_NET_CFG_MBOX_CMD_CTAG_FILTER_ADD 1 |
---|
429 | 397 | #define NFP_NET_CFG_MBOX_CMD_CTAG_FILTER_KILL 2 |
---|
| 398 | + |
---|
| 399 | +#define NFP_NET_CFG_MBOX_CMD_PCI_DSCP_PRIOMAP_SET 5 |
---|
| 400 | +#define NFP_NET_CFG_MBOX_CMD_TLV_CMSG 6 |
---|
430 | 401 | |
---|
431 | 402 | /** |
---|
432 | 403 | * VLAN filtering using general use mailbox |
---|
.. | .. |
---|
489 | 460 | * %NFP_NET_CFG_TLV_TYPE_MBOX: |
---|
490 | 461 | * Variable, mailbox area. Overwrites the default location which is |
---|
491 | 462 | * %NFP_NET_CFG_MBOX_BASE and length %NFP_NET_CFG_MBOX_VAL_MAX_SZ. |
---|
| 463 | + * |
---|
| 464 | + * %NFP_NET_CFG_TLV_TYPE_EXPERIMENTAL0: |
---|
| 465 | + * %NFP_NET_CFG_TLV_TYPE_EXPERIMENTAL1: |
---|
| 466 | + * Variable, experimental IDs. IDs designated for internal development and |
---|
| 467 | + * experiments before a stable TLV ID has been allocated to a feature. Should |
---|
| 468 | + * never be present in production firmware. |
---|
| 469 | + * |
---|
| 470 | + * %NFP_NET_CFG_TLV_TYPE_REPR_CAP: |
---|
| 471 | + * Single word, equivalent of %NFP_NET_CFG_CAP for representors, features which |
---|
| 472 | + * can be used on representors. |
---|
| 473 | + * |
---|
| 474 | + * %NFP_NET_CFG_TLV_TYPE_MBOX_CMSG_TYPES: |
---|
| 475 | + * Variable, bitmap of control message types supported by the mailbox handler. |
---|
| 476 | + * Bit 0 corresponds to message type 0, bit 1 to 1, etc. Control messages are |
---|
| 477 | + * encapsulated into simple TLVs, with an end TLV and written to the Mailbox. |
---|
| 478 | + * |
---|
| 479 | + * %NFP_NET_CFG_TLV_TYPE_CRYPTO_OPS: |
---|
| 480 | + * 8 words, bitmaps of supported and enabled crypto operations. |
---|
| 481 | + * First 16B (4 words) contains a bitmap of supported crypto operations, |
---|
| 482 | + * and next 16B contain the enabled operations. |
---|
| 483 | + * This capability is made obsolete by ones with better sync methods. |
---|
| 484 | + * |
---|
| 485 | + * %NFP_NET_CFG_TLV_TYPE_VNIC_STATS: |
---|
| 486 | + * Variable, per-vNIC statistics, data should be 8B aligned (FW should insert |
---|
| 487 | + * zero-length RESERVED TLV to pad). |
---|
| 488 | + * TLV data has two sections. First is an array of statistics' IDs (2B each). |
---|
| 489 | + * Second 8B statistics themselves. Statistics are 8B aligned, meaning there |
---|
| 490 | + * may be a padding between sections. |
---|
| 491 | + * Number of statistics can be determined as floor(tlv.length / (2 + 8)). |
---|
| 492 | + * This TLV overwrites %NFP_NET_CFG_STATS_* values (statistics in this TLV |
---|
| 493 | + * duplicate the old ones, so driver should be careful not to unnecessarily |
---|
| 494 | + * render both). |
---|
| 495 | + * |
---|
| 496 | + * %NFP_NET_CFG_TLV_TYPE_CRYPTO_OPS_RX_SCAN: |
---|
| 497 | + * Same as %NFP_NET_CFG_TLV_TYPE_CRYPTO_OPS, but crypto TLS does stream scan |
---|
| 498 | + * RX sync, rather than kernel-assisted sync. |
---|
492 | 499 | */ |
---|
493 | 500 | #define NFP_NET_CFG_TLV_TYPE_UNKNOWN 0 |
---|
494 | 501 | #define NFP_NET_CFG_TLV_TYPE_RESERVED 1 |
---|
495 | 502 | #define NFP_NET_CFG_TLV_TYPE_END 2 |
---|
496 | 503 | #define NFP_NET_CFG_TLV_TYPE_ME_FREQ 3 |
---|
497 | 504 | #define NFP_NET_CFG_TLV_TYPE_MBOX 4 |
---|
| 505 | +#define NFP_NET_CFG_TLV_TYPE_EXPERIMENTAL0 5 |
---|
| 506 | +#define NFP_NET_CFG_TLV_TYPE_EXPERIMENTAL1 6 |
---|
| 507 | +#define NFP_NET_CFG_TLV_TYPE_REPR_CAP 7 |
---|
| 508 | +#define NFP_NET_CFG_TLV_TYPE_MBOX_CMSG_TYPES 10 |
---|
| 509 | +#define NFP_NET_CFG_TLV_TYPE_CRYPTO_OPS 11 /* see crypto/fw.h */ |
---|
| 510 | +#define NFP_NET_CFG_TLV_TYPE_VNIC_STATS 12 |
---|
| 511 | +#define NFP_NET_CFG_TLV_TYPE_CRYPTO_OPS_RX_SCAN 13 |
---|
498 | 512 | |
---|
499 | 513 | struct device; |
---|
500 | 514 | |
---|
.. | .. |
---|
503 | 517 | * @me_freq_mhz: ME clock_freq (MHz) |
---|
504 | 518 | * @mbox_off: vNIC mailbox area offset |
---|
505 | 519 | * @mbox_len: vNIC mailbox area length |
---|
| 520 | + * @repr_cap: capabilities for representors |
---|
| 521 | + * @mbox_cmsg_types: cmsgs which can be passed through the mailbox |
---|
| 522 | + * @crypto_ops: supported crypto operations |
---|
| 523 | + * @crypto_enable_off: offset of crypto ops enable region |
---|
| 524 | + * @vnic_stats_off: offset of vNIC stats area |
---|
| 525 | + * @vnic_stats_cnt: number of vNIC stats |
---|
| 526 | + * @tls_resync_ss: TLS resync will be performed via stream scan |
---|
506 | 527 | */ |
---|
507 | 528 | struct nfp_net_tlv_caps { |
---|
508 | 529 | u32 me_freq_mhz; |
---|
509 | 530 | unsigned int mbox_off; |
---|
510 | 531 | unsigned int mbox_len; |
---|
| 532 | + u32 repr_cap; |
---|
| 533 | + u32 mbox_cmsg_types; |
---|
| 534 | + u32 crypto_ops; |
---|
| 535 | + unsigned int crypto_enable_off; |
---|
| 536 | + unsigned int vnic_stats_off; |
---|
| 537 | + unsigned int vnic_stats_cnt; |
---|
| 538 | + unsigned int tls_resync_ss:1; |
---|
511 | 539 | }; |
---|
512 | 540 | |
---|
513 | 541 | int nfp_net_tlv_caps_parse(struct device *dev, u8 __iomem *ctrl_mem, |
---|
514 | 542 | struct nfp_net_tlv_caps *caps); |
---|
515 | | - |
---|
516 | | -static inline bool nfp_net_has_mbox(struct nfp_net_tlv_caps *caps) |
---|
517 | | -{ |
---|
518 | | - return caps->mbox_len >= NFP_NET_CFG_MBOX_SIMPLE_LEN; |
---|
519 | | -} |
---|
520 | | - |
---|
521 | 543 | #endif /* _NFP_NET_CTRL_H_ */ |
---|