forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h
....@@ -1,35 +1,5 @@
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. */
333
344 /*
355 * nfp_net_ctrl.h
....@@ -74,6 +44,8 @@
7444 #define NFP_NET_META_MARK 2
7545 #define NFP_NET_META_PORTID 5
7646 #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 */
7749
7850 #define NFP_META_PORT_ID_CTRL ~0U
7951
....@@ -134,8 +106,6 @@
134106 #define NFP_NET_CFG_CTRL_RINGPRIO (0x1 << 19) /* Ring priorities */
135107 #define NFP_NET_CFG_CTRL_MSIXAUTO (0x1 << 20) /* MSI-X auto-masking */
136108 #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 */
139109 #define NFP_NET_CFG_CTRL_VXLAN (0x1 << 24) /* VXLAN tunnel support */
140110 #define NFP_NET_CFG_CTRL_NVGRE (0x1 << 25) /* NVGRE tunnel support */
141111 #define NFP_NET_CFG_CTRL_BPF (0x1 << 27) /* BPF offload capable */
....@@ -160,7 +130,6 @@
160130 #define NFP_NET_CFG_UPDATE_TXRPRIO (0x1 << 3) /* TX Ring prio change */
161131 #define NFP_NET_CFG_UPDATE_RXRPRIO (0x1 << 4) /* RX Ring prio change */
162132 #define NFP_NET_CFG_UPDATE_MSIX (0x1 << 5) /* MSI-X change */
163
-#define NFP_NET_CFG_UPDATE_L2SWITCH (0x1 << 6) /* Switch changes */
164133 #define NFP_NET_CFG_UPDATE_RESET (0x1 << 7) /* Update due to FLR */
165134 #define NFP_NET_CFG_UPDATE_IRQMOD (0x1 << 8) /* IRQ mod change */
166135 #define NFP_NET_CFG_UPDATE_VXLAN (0x1 << 9) /* VXLAN port change */
....@@ -168,6 +137,7 @@
168137 #define NFP_NET_CFG_UPDATE_MACADDR (0x1 << 11) /* MAC address change */
169138 #define NFP_NET_CFG_UPDATE_MBOX (0x1 << 12) /* Mailbox update */
170139 #define NFP_NET_CFG_UPDATE_VF (0x1 << 13) /* VF settings change */
140
+#define NFP_NET_CFG_UPDATE_CRYPTO (0x1 << 14) /* Crypto on/off */
171141 #define NFP_NET_CFG_UPDATE_ERR (0x1 << 31) /* A error occurred */
172142 #define NFP_NET_CFG_TXRS_ENABLE 0x0008
173143 #define NFP_NET_CFG_RXRS_ENABLE 0x0010
....@@ -264,7 +234,6 @@
264234 * %NFP_NET_CFG_BPF_ADDR: DMA address of the buffer with JITed BPF code
265235 */
266236 #define NFP_NET_CFG_BPF_ABI 0x0080
267
-#define NFP_NET_BPF_ABI 2
268237 #define NFP_NET_CFG_BPF_CAP 0x0081
269238 #define NFP_NET_BPF_CAP_RELO (1 << 0) /* seamless reload */
270239 #define NFP_NET_CFG_BPF_MAX_LEN 0x0082
....@@ -423,10 +392,12 @@
423392 #define NFP_NET_CFG_MBOX_SIMPLE_CMD 0x0
424393 #define NFP_NET_CFG_MBOX_SIMPLE_RET 0x4
425394 #define NFP_NET_CFG_MBOX_SIMPLE_VAL 0x8
426
-#define NFP_NET_CFG_MBOX_SIMPLE_LEN 12
427395
428396 #define NFP_NET_CFG_MBOX_CMD_CTAG_FILTER_ADD 1
429397 #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
430401
431402 /**
432403 * VLAN filtering using general use mailbox
....@@ -489,12 +460,55 @@
489460 * %NFP_NET_CFG_TLV_TYPE_MBOX:
490461 * Variable, mailbox area. Overwrites the default location which is
491462 * %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.
492499 */
493500 #define NFP_NET_CFG_TLV_TYPE_UNKNOWN 0
494501 #define NFP_NET_CFG_TLV_TYPE_RESERVED 1
495502 #define NFP_NET_CFG_TLV_TYPE_END 2
496503 #define NFP_NET_CFG_TLV_TYPE_ME_FREQ 3
497504 #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
498512
499513 struct device;
500514
....@@ -503,19 +517,27 @@
503517 * @me_freq_mhz: ME clock_freq (MHz)
504518 * @mbox_off: vNIC mailbox area offset
505519 * @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
506527 */
507528 struct nfp_net_tlv_caps {
508529 u32 me_freq_mhz;
509530 unsigned int mbox_off;
510531 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;
511539 };
512540
513541 int nfp_net_tlv_caps_parse(struct device *dev, u8 __iomem *ctrl_mem,
514542 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
-
521543 #endif /* _NFP_NET_CTRL_H_ */