xref: /dpdk/drivers/common/nfp/nfp_common_ctrl.h (revision 66df893f2fefc50fb6a53a0cfcaa8aed4461442b)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2023 Corigine, Inc.
3  * All rights reserved.
4  */
5 
6 #ifndef __NFP_COMMON_CTRL_H__
7 #define __NFP_COMMON_CTRL_H__
8 
9 /*
10  * Configuration BAR size.
11  *
12  * On the NFP6000, due to THB-350, the configuration BAR is 32K in size.
13  */
14 #define NFP_NET_CFG_BAR_SZ_32K          (32 * 1024)
15 #define NFP_NET_CFG_BAR_SZ_8K           (8 * 1024)
16 #define NFP_NET_CFG_BAR_SZ_MIN          NFP_NET_CFG_BAR_SZ_8K
17 
18 /*
19  * Configuration sriov VF.
20  * The configuration memory begins with a mailbox region for communication with
21  * the firmware followed by individual VF entries.
22  */
23 #define NFP_NET_VF_CFG_SZ               16
24 #define NFP_NET_VF_CFG_MB_SZ            16
25 
26 /* VF config mailbox */
27 #define NFP_NET_VF_CFG_MB               0x0
28 #define NFP_NET_VF_CFG_MB_CAP           0x0
29 #define   NFP_NET_VF_CFG_MB_CAP_QUEUE_CONFIG      (0x1 << 7)
30 #define   NFP_NET_VF_CFG_MB_CAP_SPLIT             (0x1 << 8)
31 #define NFP_NET_VF_CFG_MB_RET           0x2
32 #define NFP_NET_VF_CFG_MB_UPD           0x4
33 #define   NFP_NET_VF_CFG_MB_UPD_QUEUE_CONFIG      (0x1 << 7)
34 #define   NFP_NET_VF_CFG_MB_UPD_SPLIT             (0x1 << 8)
35 #define NFP_NET_VF_CFG_MB_VF_CNT        0x6
36 #define NFP_NET_VF_CFG_MB_VF_NUM        0x7
37 
38 /*
39  * @NFP_NET_TXR_MAX:         Maximum number of TX rings
40  * @NFP_NET_TXR_MASK:        Mask for TX rings
41  * @NFP_NET_RXR_MAX:         Maximum number of RX rings
42  * @NFP_NET_RXR_MASK:        Mask for RX rings
43  */
44 #define NFP_NET_TXR_MAX                 64
45 #define NFP_NET_TXR_MASK                (NFP_NET_TXR_MAX - 1)
46 #define NFP_NET_RXR_MAX                 64
47 #define NFP_NET_RXR_MASK                (NFP_NET_RXR_MAX - 1)
48 
49 /*
50  * Read/Write config words (0x0000 - 0x002c)
51  * @NFP_NET_CFG_CTRL:        Global control
52  * @NFP_NET_CFG_UPDATE:      Indicate which fields are updated
53  * @NFP_NET_CFG_TXRS_ENABLE: Bitmask of enabled TX rings
54  * @NFP_NET_CFG_RXRS_ENABLE: Bitmask of enabled RX rings
55  * @NFP_NET_CFG_MTU:         Set MTU size
56  * @NFP_NET_CFG_FLBUFSZ:     Set freelist buffer size (must be larger than MTU)
57  * @NFP_NET_CFG_EXN:         MSI-X table entry for exceptions
58  * @NFP_NET_CFG_LSC:         MSI-X table entry for link state changes
59  * @NFP_NET_CFG_MACADDR:     MAC address
60  *
61  * TODO:
62  * - define Error details in UPDATE
63  */
64 #define NFP_NET_CFG_CTRL                0x0000
65 #define   NFP_NET_CFG_CTRL_ENABLE         (0x1 <<  0) /* Global enable */
66 #define   NFP_NET_CFG_CTRL_PROMISC        (0x1 <<  1) /* Enable Promisc mode */
67 #define   NFP_NET_CFG_CTRL_L2BC           (0x1 <<  2) /* Allow L2 Broadcast */
68 #define   NFP_NET_CFG_CTRL_L2MC           (0x1 <<  3) /* Allow L2 Multicast */
69 #define   NFP_NET_CFG_CTRL_RXCSUM         (0x1 <<  4) /* Enable RX Checksum */
70 #define   NFP_NET_CFG_CTRL_TXCSUM         (0x1 <<  5) /* Enable TX Checksum */
71 #define   NFP_NET_CFG_CTRL_RXVLAN         (0x1 <<  6) /* Enable VLAN strip */
72 #define   NFP_NET_CFG_CTRL_TXVLAN         (0x1 <<  7) /* Enable VLAN insert */
73 #define   NFP_NET_CFG_CTRL_SCATTER        (0x1 <<  8) /* Scatter DMA */
74 #define   NFP_NET_CFG_CTRL_GATHER         (0x1 <<  9) /* Gather DMA */
75 #define   NFP_NET_CFG_CTRL_LSO            (0x1 << 10) /* LSO/TSO */
76 #define   NFP_NET_CFG_CTRL_RXQINQ         (0x1 << 13) /* Enable QINQ strip */
77 #define   NFP_NET_CFG_CTRL_RXVLAN_V2      (0x1 << 15) /* Enable VLAN strip with metadata */
78 #define   NFP_NET_CFG_CTRL_RINGCFG        (0x1 << 16) /* Ring runtime changes */
79 #define   NFP_NET_CFG_CTRL_RSS            (0x1 << 17) /* RSS */
80 #define   NFP_NET_CFG_CTRL_IRQMOD         (0x1 << 18) /* Interrupt moderation */
81 #define   NFP_NET_CFG_CTRL_RINGPRIO       (0x1 << 19) /* Ring priorities */
82 #define   NFP_NET_CFG_CTRL_MSIXAUTO       (0x1 << 20) /* MSI-X auto-masking */
83 #define   NFP_NET_CFG_CTRL_TXRWB          (0x1 << 21) /* Write-back of TX ring */
84 #define   NFP_NET_CFG_CTRL_L2SWITCH       (0x1 << 22) /* L2 Switch */
85 #define   NFP_NET_CFG_CTRL_TXVLAN_V2      (0x1 << 23) /* Enable VLAN insert with metadata */
86 #define   NFP_NET_CFG_CTRL_VXLAN          (0x1 << 24) /* Enable VXLAN */
87 #define   NFP_NET_CFG_CTRL_NVGRE          (0x1 << 25) /* Enable NVGRE */
88 #define   NFP_NET_CFG_CTRL_MSIX_TX_OFF    (0x1 << 26) /* Disable MSIX for TX */
89 #define   NFP_NET_CFG_CTRL_LSO2           (0x1 << 28) /* LSO/TSO (version 2) */
90 #define   NFP_NET_CFG_CTRL_RSS2           (0x1 << 29) /* RSS (version 2) */
91 #define   NFP_NET_CFG_CTRL_CSUM_COMPLETE  (0x1 << 30) /* Checksum complete */
92 #define   NFP_NET_CFG_CTRL_LIVE_ADDR      (0x1U << 31) /* Live MAC addr change */
93 #define NFP_NET_CFG_UPDATE              0x0004
94 #define   NFP_NET_CFG_UPDATE_GEN          (0x1 <<  0) /* General update */
95 #define   NFP_NET_CFG_UPDATE_RING         (0x1 <<  1) /* Ring config change */
96 #define   NFP_NET_CFG_UPDATE_RSS          (0x1 <<  2) /* RSS config change */
97 #define   NFP_NET_CFG_UPDATE_TXRPRIO      (0x1 <<  3) /* TX Ring prio change */
98 #define   NFP_NET_CFG_UPDATE_RXRPRIO      (0x1 <<  4) /* RX Ring prio change */
99 #define   NFP_NET_CFG_UPDATE_MSIX         (0x1 <<  5) /* MSI-X change */
100 #define   NFP_NET_CFG_UPDATE_L2SWITCH     (0x1 <<  6) /* Switch changes */
101 #define   NFP_NET_CFG_UPDATE_RESET        (0x1 <<  7) /* Update due to FLR */
102 #define   NFP_NET_CFG_UPDATE_IRQMOD       (0x1 <<  8) /* IRQ mod change */
103 #define   NFP_NET_CFG_UPDATE_VXLAN        (0x1 <<  9) /* VXLAN port change */
104 #define   NFP_NET_CFG_UPDATE_MACADDR      (0x1 << 11) /* MAC address change */
105 #define   NFP_NET_CFG_UPDATE_MBOX         (0x1 << 12) /* Mailbox update */
106 #define   NFP_NET_CFG_UPDATE_VF           (0x1 << 13) /* VF settings change */
107 #define   NFP_NET_CFG_UPDATE_ERR          (0x1U << 31) /* A error occurred */
108 #define NFP_NET_CFG_TXRS_ENABLE         0x0008
109 #define NFP_NET_CFG_RXRS_ENABLE         0x0010
110 #define NFP_NET_CFG_MTU                 0x0018
111 #define NFP_NET_CFG_FLBUFSZ             0x001c
112 #define NFP_NET_CFG_EXN                 0x001f
113 #define NFP_NET_CFG_LSC                 0x0020
114 #define NFP_NET_CFG_MACADDR             0x0024
115 
116 #define NFP_NET_CFG_CTRL_LSO_ANY (NFP_NET_CFG_CTRL_LSO | NFP_NET_CFG_CTRL_LSO2)
117 #define NFP_NET_CFG_CTRL_RSS_ANY (NFP_NET_CFG_CTRL_RSS | NFP_NET_CFG_CTRL_RSS2)
118 
119 #define NFP_NET_CFG_CTRL_CHAIN_META (NFP_NET_CFG_CTRL_RSS2 | \
120 					NFP_NET_CFG_CTRL_CSUM_COMPLETE)
121 
122 /* Version number helper defines */
123 struct nfp_net_fw_ver {
124 	uint8_t minor;
125 	uint8_t major;
126 	/**
127 	 * BIT0: class, refer NFP_NET_CFG_VERSION_CLASS_*
128 	 * BIT[7:1]: reserved
129 	 */
130 	uint8_t class;
131 	/**
132 	 * This byte can be extended for more use.
133 	 * BIT0: NFD dp type, refer NFP_NET_CFG_VERSION_DP_NFDx
134 	 * BIT[7:1]: reserved
135 	 */
136 	uint8_t extend;
137 };
138 
139 /*
140  * Read-only words (0x0030 - 0x0050):
141  * @NFP_NET_CFG_VERSION:     Firmware version number
142  * @NFP_NET_CFG_STS:         Status
143  * @NFP_NET_CFG_CAP:         Capabilities (same bits as @NFP_NET_CFG_CTRL)
144  * @NFP_NET_MAX_TXRINGS:     Maximum number of TX rings
145  * @NFP_NET_MAX_RXRINGS:     Maximum number of RX rings
146  * @NFP_NET_MAX_MTU:         Maximum support MTU
147  * @NFP_NET_CFG_START_TXQ:   Start Queue Control Queue to use for TX (PF only)
148  * @NFP_NET_CFG_START_RXQ:   Start Queue Control Queue to use for RX (PF only)
149  *
150  * TODO:
151  * - define more STS bits
152  */
153 #define NFP_NET_CFG_VERSION             0x0030
154 #define   NFP_NET_CFG_VERSION_DP_NFD3   0
155 #define   NFP_NET_CFG_VERSION_DP_NFDK   1
156 #define   NFP_NET_CFG_VERSION_CLASS_GENERIC    0
157 #define   NFP_NET_CFG_VERSION_CLASS_NO_EMEM    1
158 #define NFP_NET_CFG_STS                 0x0034
159 #define   NFP_NET_CFG_STS_LINK            (0x1 << 0) /* Link up or down */
160 /* Link rate */
161 #define   NFP_NET_CFG_STS_LINK_RATE_SHIFT 1
162 #define   NFP_NET_CFG_STS_LINK_RATE_MASK  0xF
163 #define   NFP_NET_CFG_STS_LINK_RATE_UNSUPPORTED   0
164 #define   NFP_NET_CFG_STS_LINK_RATE_UNKNOWN       1
165 #define   NFP_NET_CFG_STS_LINK_RATE_1G            2
166 #define   NFP_NET_CFG_STS_LINK_RATE_10G           3
167 #define   NFP_NET_CFG_STS_LINK_RATE_25G           4
168 #define   NFP_NET_CFG_STS_LINK_RATE_40G           5
169 #define   NFP_NET_CFG_STS_LINK_RATE_50G           6
170 #define   NFP_NET_CFG_STS_LINK_RATE_100G          7
171 
172 /*
173  * NSP Link rate is a 16-bit word. It is no longer determined by
174  * firmware, instead it is read from the nfp_eth_table of the
175  * associated pf_dev and written to the NFP_NET_CFG_STS_NSP_LINK_RATE
176  * address by the PMD each time the port is reconfigured.
177  */
178 #define NFP_NET_CFG_STS_NSP_LINK_RATE   0x0036
179 
180 #define NFP_NET_CFG_CAP                 0x0038
181 #define NFP_NET_CFG_MAX_TXRINGS         0x003c
182 #define NFP_NET_CFG_MAX_RXRINGS         0x0040
183 #define NFP_NET_CFG_MAX_MTU             0x0044
184 /* Next two words are being used by VFs for solving THB350 issue */
185 #define NFP_NET_CFG_START_TXQ           0x0048
186 #define NFP_NET_CFG_START_RXQ           0x004c
187 
188 /*
189  * NFP6000/NFP4000 - Prepend configuration
190  */
191 #define NFP_NET_CFG_RX_OFFSET           0x0050
192 #define NFP_NET_CFG_RX_OFFSET_DYNAMIC          0    /* Prepend mode */
193 
194 /* Start anchor of the TLV area */
195 #define NFP_NET_CFG_TLV_BASE            0x0058
196 
197 #define NFP_NET_CFG_VXLAN_PORT          0x0060
198 #define NFP_NET_CFG_VXLAN_SZ            0x0008
199 
200 /* Offload definitions */
201 #define NFP_NET_N_VXLAN_PORTS  (NFP_NET_CFG_VXLAN_SZ / sizeof(uint16_t))
202 
203 /*
204  * 3 words reserved for extended ctrl words (0x0098 - 0x00a4)
205  * 3 words reserved for extended cap words (0x00a4 - 0x00b0)
206  * Currently only one word is used, can be extended in future.
207  */
208 #define NFP_NET_CFG_CTRL_WORD1          0x0098
209 #define NFP_NET_CFG_CTRL_PKT_TYPE         (0x1 << 0)
210 #define NFP_NET_CFG_CTRL_IPSEC            (0x1 << 1) /**< IPsec offload */
211 #define NFP_NET_CFG_CTRL_MCAST_FILTER     (0x1 << 2) /**< Multicast Filter */
212 #define NFP_NET_CFG_CTRL_IPSEC_SM_LOOKUP  (0x1 << 3) /**< SA short match lookup */
213 #define NFP_NET_CFG_CTRL_IPSEC_LM_LOOKUP  (0x1 << 4) /**< SA long match lookup */
214 #define NFP_NET_CFG_CTRL_MULTI_PF         (0x1 << 5)
215 #define NFP_NET_CFG_CTRL_FLOW_STEER       (0x1 << 8) /**< Flow Steering */
216 #define NFP_NET_CFG_CTRL_VIRTIO           (0x1 << 10) /**< Virtio offload */
217 #define NFP_NET_CFG_CTRL_IN_ORDER         (0x1 << 11) /**< Virtio in-order flag */
218 #define NFP_NET_CFG_CTRL_LM_RELAY         (0x1 << 12) /**< Virtio live migration relay start */
219 #define NFP_NET_CFG_CTRL_NOTIFY_DATA      (0x1 << 13) /**< Virtio notification data flag */
220 #define NFP_NET_CFG_CTRL_SWLM             (0x1 << 14) /**< Virtio SW live migration enable */
221 #define NFP_NET_CFG_CTRL_USO              (0x1 << 16) /**< UDP segmentation offload */
222 
223 #define NFP_NET_CFG_CAP_WORD1           0x00a4
224 
225 #define NFP_NET_CFG_TX_USED_INDEX       0x00b0
226 #define NFP_NET_CFG_RX_USED_INDEX       0x00b4
227 
228 /* 16B reserved for future use (0x00b0 - 0x00c0). */
229 #define NFP_NET_CFG_MAX_FS_CAP          0x00b8
230 
231 /*
232  * RSS configuration (0x0100 - 0x01ac):
233  * Used only when NFP_NET_CFG_CTRL_RSS_ANY is enabled
234  * @NFP_NET_CFG_RSS_CFG:     RSS configuration word
235  * @NFP_NET_CFG_RSS_KEY:     RSS "secret" key
236  * @NFP_NET_CFG_RSS_ITBL:    RSS indirection table
237  */
238 #define NFP_NET_CFG_RSS_BASE            0x0100
239 #define NFP_NET_CFG_RSS_CTRL            NFP_NET_CFG_RSS_BASE
240 #define   NFP_NET_CFG_RSS_MASK            (0x7f)
241 #define   NFP_NET_CFG_RSS_MASK_of(_x)     ((_x) & 0x7f)
242 #define   NFP_NET_CFG_RSS_IPV4            (1 <<  8) /* RSS for IPv4 */
243 #define   NFP_NET_CFG_RSS_IPV6            (1 <<  9) /* RSS for IPv6 */
244 #define   NFP_NET_CFG_RSS_IPV4_TCP        (1 << 10) /* RSS for IPv4/TCP */
245 #define   NFP_NET_CFG_RSS_IPV4_UDP        (1 << 11) /* RSS for IPv4/UDP */
246 #define   NFP_NET_CFG_RSS_IPV6_TCP        (1 << 12) /* RSS for IPv6/TCP */
247 #define   NFP_NET_CFG_RSS_IPV6_UDP        (1 << 13) /* RSS for IPv6/UDP */
248 #define   NFP_NET_CFG_RSS_IPV4_SCTP       (1 << 14) /* RSS for IPv4/SCTP */
249 #define   NFP_NET_CFG_RSS_IPV6_SCTP       (1 << 15) /* RSS for IPv6/SCTP */
250 #define   NFP_NET_CFG_RSS_TOEPLITZ        (1 << 24) /* Use Toeplitz hash */
251 #define   NFP_NET_CFG_RSS_CRC32           (1 << 26) /* Use CRC32 hash */
252 #define NFP_NET_CFG_RSS_KEY             (NFP_NET_CFG_RSS_BASE + 0x4)
253 #define NFP_NET_CFG_RSS_KEY_SZ          0x28
254 #define NFP_NET_CFG_RSS_ITBL            (NFP_NET_CFG_RSS_BASE + 0x4 + \
255 					 NFP_NET_CFG_RSS_KEY_SZ)
256 #define NFP_NET_CFG_RSS_ITBL_SZ         0x80
257 
258 /*
259  * TX ring configuration (0x200 - 0x800)
260  * @NFP_NET_CFG_TXR_BASE:    Base offset for TX ring configuration
261  * @NFP_NET_CFG_TXR_ADDR:    Per TX ring DMA address (8B entries)
262  * @NFP_NET_CFG_TXR_WB_ADDR: Per TX ring write back DMA address (8B entries)
263  * @NFP_NET_CFG_TXR_SZ:      Per TX ring size (1B entries)
264  * @NFP_NET_CFG_TXR_VEC:     Per TX ring MSI-X table entry (1B entries)
265  * @NFP_NET_CFG_TXR_PRIO:    Per TX ring priority (1B entries)
266  * @NFP_NET_CFG_TXR_IRQ_MOD: Per TX ring interrupt moderation (4B entries)
267  */
268 #define NFP_NET_CFG_TXR_BASE            0x0200
269 #define NFP_NET_CFG_TXR_ADDR(_x)        (NFP_NET_CFG_TXR_BASE + ((_x) * 0x8))
270 #define NFP_NET_CFG_TXR_WB_ADDR(_x)     (NFP_NET_CFG_TXR_BASE + 0x200 + \
271 					 ((_x) * 0x8))
272 #define NFP_NET_CFG_TXR_SZ(_x)          (NFP_NET_CFG_TXR_BASE + 0x400 + (_x))
273 #define NFP_NET_CFG_TXR_VEC(_x)         (NFP_NET_CFG_TXR_BASE + 0x440 + (_x))
274 #define NFP_NET_CFG_TXR_PRIO(_x)        (NFP_NET_CFG_TXR_BASE + 0x480 + (_x))
275 #define NFP_NET_CFG_TXR_IRQ_MOD(_x)     (NFP_NET_CFG_TXR_BASE + 0x500 + \
276 					 ((_x) * 0x4))
277 
278 /*
279  * RX ring configuration (0x0800 - 0x0c00)
280  * @NFP_NET_CFG_RXR_BASE:    Base offset for RX ring configuration
281  * @NFP_NET_CFG_RXR_ADDR:    Per TX ring DMA address (8B entries)
282  * @NFP_NET_CFG_RXR_SZ:      Per TX ring size (1B entries)
283  * @NFP_NET_CFG_RXR_VEC:     Per TX ring MSI-X table entry (1B entries)
284  * @NFP_NET_CFG_RXR_PRIO:    Per TX ring priority (1B entries)
285  * @NFP_NET_CFG_RXR_IRQ_MOD: Per TX ring interrupt moderation (4B entries)
286  */
287 #define NFP_NET_CFG_RXR_BASE            0x0800
288 #define NFP_NET_CFG_RXR_ADDR(_x)        (NFP_NET_CFG_RXR_BASE + ((_x) * 0x8))
289 #define NFP_NET_CFG_RXR_SZ(_x)          (NFP_NET_CFG_RXR_BASE + 0x200 + (_x))
290 #define NFP_NET_CFG_RXR_VEC(_x)         (NFP_NET_CFG_RXR_BASE + 0x240 + (_x))
291 #define NFP_NET_CFG_RXR_PRIO(_x)        (NFP_NET_CFG_RXR_BASE + 0x280 + (_x))
292 #define NFP_NET_CFG_RXR_IRQ_MOD(_x)     (NFP_NET_CFG_RXR_BASE + 0x300 + \
293 					 ((_x) * 0x4))
294 
295 /*
296  * Interrupt Control/Cause registers (0x0c00 - 0x0d00)
297  * These registers are only used when MSI-X auto-masking is not
298  * enabled (@NFP_NET_CFG_CTRL_MSIXAUTO not set).  The array is index
299  * by MSI-X entry and are 1B in size.  If an entry is zero, the
300  * corresponding entry is enabled.  If the FW generates an interrupt,
301  * it writes a cause into the corresponding field.  This also masks
302  * the MSI-X entry and the host driver must clear the register to
303  * re-enable the interrupt.
304  */
305 #define NFP_NET_CFG_ICR_BASE            0x0c00
306 #define NFP_NET_CFG_ICR(_x)             (NFP_NET_CFG_ICR_BASE + (_x))
307 #define   NFP_NET_CFG_ICR_UNMASKED      0x0
308 #define   NFP_NET_CFG_ICR_RXTX          0x1
309 #define   NFP_NET_CFG_ICR_LSC           0x2
310 
311 /*
312  * General device stats (0x0d00 - 0x0d90)
313  * All counters are 64bit.
314  */
315 #define NFP_NET_CFG_STATS_BASE          0x0d00
316 #define NFP_NET_CFG_STATS_RX_DISCARDS   (NFP_NET_CFG_STATS_BASE + 0x00)
317 #define NFP_NET_CFG_STATS_RX_ERRORS     (NFP_NET_CFG_STATS_BASE + 0x08)
318 #define NFP_NET_CFG_STATS_RX_OCTETS     (NFP_NET_CFG_STATS_BASE + 0x10)
319 #define NFP_NET_CFG_STATS_RX_UC_OCTETS  (NFP_NET_CFG_STATS_BASE + 0x18)
320 #define NFP_NET_CFG_STATS_RX_MC_OCTETS  (NFP_NET_CFG_STATS_BASE + 0x20)
321 #define NFP_NET_CFG_STATS_RX_BC_OCTETS  (NFP_NET_CFG_STATS_BASE + 0x28)
322 #define NFP_NET_CFG_STATS_RX_FRAMES     (NFP_NET_CFG_STATS_BASE + 0x30)
323 #define NFP_NET_CFG_STATS_RX_MC_FRAMES  (NFP_NET_CFG_STATS_BASE + 0x38)
324 #define NFP_NET_CFG_STATS_RX_BC_FRAMES  (NFP_NET_CFG_STATS_BASE + 0x40)
325 
326 #define NFP_NET_CFG_STATS_TX_DISCARDS   (NFP_NET_CFG_STATS_BASE + 0x48)
327 #define NFP_NET_CFG_STATS_TX_ERRORS     (NFP_NET_CFG_STATS_BASE + 0x50)
328 #define NFP_NET_CFG_STATS_TX_OCTETS     (NFP_NET_CFG_STATS_BASE + 0x58)
329 #define NFP_NET_CFG_STATS_TX_UC_OCTETS  (NFP_NET_CFG_STATS_BASE + 0x60)
330 #define NFP_NET_CFG_STATS_TX_MC_OCTETS  (NFP_NET_CFG_STATS_BASE + 0x68)
331 #define NFP_NET_CFG_STATS_TX_BC_OCTETS  (NFP_NET_CFG_STATS_BASE + 0x70)
332 #define NFP_NET_CFG_STATS_TX_FRAMES     (NFP_NET_CFG_STATS_BASE + 0x78)
333 #define NFP_NET_CFG_STATS_TX_MC_FRAMES  (NFP_NET_CFG_STATS_BASE + 0x80)
334 #define NFP_NET_CFG_STATS_TX_BC_FRAMES  (NFP_NET_CFG_STATS_BASE + 0x88)
335 
336 #define NFP_NET_CFG_STATS_APP0_FRAMES   (NFP_NET_CFG_STATS_BASE + 0x90)
337 #define NFP_NET_CFG_STATS_APP0_BYTES    (NFP_NET_CFG_STATS_BASE + 0x98)
338 #define NFP_NET_CFG_STATS_APP1_FRAMES   (NFP_NET_CFG_STATS_BASE + 0xa0)
339 #define NFP_NET_CFG_STATS_APP1_BYTES    (NFP_NET_CFG_STATS_BASE + 0xa8)
340 #define NFP_NET_CFG_STATS_APP2_FRAMES   (NFP_NET_CFG_STATS_BASE + 0xb0)
341 #define NFP_NET_CFG_STATS_APP2_BYTES    (NFP_NET_CFG_STATS_BASE + 0xb8)
342 #define NFP_NET_CFG_STATS_APP3_FRAMES   (NFP_NET_CFG_STATS_BASE + 0xc0)
343 #define NFP_NET_CFG_STATS_APP3_BYTES    (NFP_NET_CFG_STATS_BASE + 0xc8)
344 
345 /*
346  * Per ring stats (0x1000 - 0x1800)
347  * Options, 64bit per entry
348  * @NFP_NET_CFG_TXR_STATS:   TX ring statistics (Packet and Byte count)
349  * @NFP_NET_CFG_RXR_STATS:   RX ring statistics (Packet and Byte count)
350  */
351 #define NFP_NET_CFG_TXR_STATS_BASE      0x1000
352 #define NFP_NET_CFG_TXR_STATS(_x)       (NFP_NET_CFG_TXR_STATS_BASE + \
353 					 ((_x) * 0x10))
354 #define NFP_NET_CFG_RXR_STATS_BASE      0x1400
355 #define NFP_NET_CFG_RXR_STATS(_x)       (NFP_NET_CFG_RXR_STATS_BASE + \
356 					 ((_x) * 0x10))
357 
358 #endif /* __NFP_COMMON_CTRL_H__ */
359