aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-02-16 16:24:24 -0500
committerDavid S. Miller <davem@davemloft.net>2018-02-16 16:24:24 -0500
commita73d65b5cd1c766fc64db59d18255923d01e92db (patch)
treec1e93fca144dc3b2a84b550fcd0ac34f1db3a9f1
parent4a8864822d74b351239f6e24b3468d47dc391f7f (diff)
parentffa61202fe2972577794004f79652360b5f4ddb0 (diff)
Merge branch 'nfp-whitespace-sync-and-flower-TCP-flags'
Jakub Kicinski says: ==================== nfp: whitespace sync and flower TCP flags Whitespace cleanup from Michael and flower offload support for matching on TCP flags from Pieter. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/netronome/nfp/flower/cmsg.h11
-rw-r--r--drivers/net/ethernet/netronome/nfp/flower/main.h1
-rw-r--r--drivers/net/ethernet/netronome/nfp/flower/match.c20
-rw-r--r--drivers/net/ethernet/netronome/nfp/flower/offload.c34
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h280
5 files changed, 204 insertions, 142 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/flower/cmsg.h b/drivers/net/ethernet/netronome/nfp/flower/cmsg.h
index adfe474c2cf0..28c1cd5b823b 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/cmsg.h
+++ b/drivers/net/ethernet/netronome/nfp/flower/cmsg.h
@@ -61,6 +61,13 @@
61#define NFP_FLOWER_MASK_MPLS_BOS BIT(8) 61#define NFP_FLOWER_MASK_MPLS_BOS BIT(8)
62#define NFP_FLOWER_MASK_MPLS_Q BIT(0) 62#define NFP_FLOWER_MASK_MPLS_Q BIT(0)
63 63
64/* Compressed HW representation of TCP Flags */
65#define NFP_FL_TCP_FLAG_URG BIT(4)
66#define NFP_FL_TCP_FLAG_PSH BIT(3)
67#define NFP_FL_TCP_FLAG_RST BIT(2)
68#define NFP_FL_TCP_FLAG_SYN BIT(1)
69#define NFP_FL_TCP_FLAG_FIN BIT(0)
70
64#define NFP_FL_SC_ACT_DROP 0x80000000 71#define NFP_FL_SC_ACT_DROP 0x80000000
65#define NFP_FL_SC_ACT_USER 0x7D000000 72#define NFP_FL_SC_ACT_USER 0x7D000000
66#define NFP_FL_SC_ACT_POPV 0x6A000000 73#define NFP_FL_SC_ACT_POPV 0x6A000000
@@ -257,7 +264,7 @@ struct nfp_flower_tp_ports {
257 * 3 2 1 264 * 3 2 1
258 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 265 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
259 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 266 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
260 * | DSCP |ECN| protocol | reserved | 267 * | DSCP |ECN| protocol | ttl | flags |
261 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 268 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
262 * | ipv4_addr_src | 269 * | ipv4_addr_src |
263 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 270 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -268,7 +275,7 @@ struct nfp_flower_ipv4 {
268 u8 tos; 275 u8 tos;
269 u8 proto; 276 u8 proto;
270 u8 ttl; 277 u8 ttl;
271 u8 reserved; 278 u8 flags;
272 __be32 ipv4_src; 279 __be32 ipv4_src;
273 __be32 ipv4_dst; 280 __be32 ipv4_dst;
274}; 281};
diff --git a/drivers/net/ethernet/netronome/nfp/flower/main.h b/drivers/net/ethernet/netronome/nfp/flower/main.h
index 332ff0fdc038..c5cebf6fb1d3 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/main.h
+++ b/drivers/net/ethernet/netronome/nfp/flower/main.h
@@ -41,6 +41,7 @@
41#include <linux/time64.h> 41#include <linux/time64.h>
42#include <linux/types.h> 42#include <linux/types.h>
43#include <net/pkt_cls.h> 43#include <net/pkt_cls.h>
44#include <net/tcp.h>
44#include <linux/workqueue.h> 45#include <linux/workqueue.h>
45 46
46struct net_device; 47struct net_device;
diff --git a/drivers/net/ethernet/netronome/nfp/flower/match.c b/drivers/net/ethernet/netronome/nfp/flower/match.c
index 37c2ecae2a7a..b3bc8279d4fb 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/match.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/match.c
@@ -181,6 +181,26 @@ nfp_flower_compile_ipv4(struct nfp_flower_ipv4 *frame,
181 frame->tos = flow_ip->tos; 181 frame->tos = flow_ip->tos;
182 frame->ttl = flow_ip->ttl; 182 frame->ttl = flow_ip->ttl;
183 } 183 }
184
185 if (dissector_uses_key(flow->dissector, FLOW_DISSECTOR_KEY_TCP)) {
186 struct flow_dissector_key_tcp *tcp;
187 u32 tcp_flags;
188
189 tcp = skb_flow_dissector_target(flow->dissector,
190 FLOW_DISSECTOR_KEY_TCP, target);
191 tcp_flags = be16_to_cpu(tcp->flags);
192
193 if (tcp_flags & TCPHDR_FIN)
194 frame->flags |= NFP_FL_TCP_FLAG_FIN;
195 if (tcp_flags & TCPHDR_SYN)
196 frame->flags |= NFP_FL_TCP_FLAG_SYN;
197 if (tcp_flags & TCPHDR_RST)
198 frame->flags |= NFP_FL_TCP_FLAG_RST;
199 if (tcp_flags & TCPHDR_PSH)
200 frame->flags |= NFP_FL_TCP_FLAG_PSH;
201 if (tcp_flags & TCPHDR_URG)
202 frame->flags |= NFP_FL_TCP_FLAG_URG;
203 }
184} 204}
185 205
186static void 206static void
diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c
index eb5c13dea8f5..f3586c519805 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/offload.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c
@@ -44,11 +44,16 @@
44#include "../nfp_net.h" 44#include "../nfp_net.h"
45#include "../nfp_port.h" 45#include "../nfp_port.h"
46 46
47#define NFP_FLOWER_SUPPORTED_TCPFLAGS \
48 (TCPHDR_FIN | TCPHDR_SYN | TCPHDR_RST | \
49 TCPHDR_PSH | TCPHDR_URG)
50
47#define NFP_FLOWER_WHITELIST_DISSECTOR \ 51#define NFP_FLOWER_WHITELIST_DISSECTOR \
48 (BIT(FLOW_DISSECTOR_KEY_CONTROL) | \ 52 (BIT(FLOW_DISSECTOR_KEY_CONTROL) | \
49 BIT(FLOW_DISSECTOR_KEY_BASIC) | \ 53 BIT(FLOW_DISSECTOR_KEY_BASIC) | \
50 BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) | \ 54 BIT(FLOW_DISSECTOR_KEY_IPV4_ADDRS) | \
51 BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) | \ 55 BIT(FLOW_DISSECTOR_KEY_IPV6_ADDRS) | \
56 BIT(FLOW_DISSECTOR_KEY_TCP) | \
52 BIT(FLOW_DISSECTOR_KEY_PORTS) | \ 57 BIT(FLOW_DISSECTOR_KEY_PORTS) | \
53 BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) | \ 58 BIT(FLOW_DISSECTOR_KEY_ETH_ADDRS) | \
54 BIT(FLOW_DISSECTOR_KEY_VLAN) | \ 59 BIT(FLOW_DISSECTOR_KEY_VLAN) | \
@@ -288,6 +293,35 @@ nfp_flower_calculate_key_layers(struct nfp_app *app,
288 } 293 }
289 } 294 }
290 295
296 if (dissector_uses_key(flow->dissector, FLOW_DISSECTOR_KEY_TCP)) {
297 struct flow_dissector_key_tcp *tcp;
298 u32 tcp_flags;
299
300 tcp = skb_flow_dissector_target(flow->dissector,
301 FLOW_DISSECTOR_KEY_TCP,
302 flow->key);
303 tcp_flags = be16_to_cpu(tcp->flags);
304
305 if (tcp_flags & ~NFP_FLOWER_SUPPORTED_TCPFLAGS)
306 return -EOPNOTSUPP;
307
308 /* We only support PSH and URG flags when either
309 * FIN, SYN or RST is present as well.
310 */
311 if ((tcp_flags & (TCPHDR_PSH | TCPHDR_URG)) &&
312 !(tcp_flags & (TCPHDR_FIN | TCPHDR_SYN | TCPHDR_RST)))
313 return -EOPNOTSUPP;
314
315 /* We need to store TCP flags in the IPv4 key space, thus
316 * we need to ensure we include a IPv4 key layer if we have
317 * not done so already.
318 */
319 if (!(key_layer & NFP_FLOWER_LAYER_IPV4)) {
320 key_layer |= NFP_FLOWER_LAYER_IPV4;
321 key_size += sizeof(struct nfp_flower_ipv4);
322 }
323 }
324
291 ret_key_ls->key_layer = key_layer; 325 ret_key_ls->key_layer = key_layer;
292 ret_key_ls->key_layer_two = key_layer_two; 326 ret_key_ls->key_layer_two = key_layer_two;
293 ret_key_ls->key_size = key_size; 327 ret_key_ls->key_size = key_size;
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h b/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h
index 4499a7333078..bb63c115537d 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2015-2017 Netronome Systems, Inc. 2 * Copyright (C) 2015-2018 Netronome Systems, Inc.
3 * 3 *
4 * This software is dual licensed under the GNU General License Version 2, 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 5 * June 1991 as shown in the file COPYING in the top-level directory of this
@@ -51,12 +51,12 @@
51 * The configuration BAR is 8K in size, but due to 51 * The configuration BAR is 8K in size, but due to
52 * THB-350, 32k needs to be reserved. 52 * THB-350, 32k needs to be reserved.
53 */ 53 */
54#define NFP_NET_CFG_BAR_SZ (32 * 1024) 54#define NFP_NET_CFG_BAR_SZ (32 * 1024)
55 55
56/** 56/**
57 * Offset in Freelist buffer where packet starts on RX 57 * Offset in Freelist buffer where packet starts on RX
58 */ 58 */
59#define NFP_NET_RX_OFFSET 32 59#define NFP_NET_RX_OFFSET 32
60 60
61/** 61/**
62 * LSO parameters 62 * LSO parameters
@@ -75,65 +75,65 @@
75#define NFP_NET_META_PORTID 5 75#define NFP_NET_META_PORTID 5
76#define NFP_NET_META_CSUM 6 /* checksum complete type */ 76#define NFP_NET_META_CSUM 6 /* checksum complete type */
77 77
78#define NFP_META_PORT_ID_CTRL ~0U 78#define NFP_META_PORT_ID_CTRL ~0U
79 79
80/** 80/**
81 * Hash type pre-pended when a RSS hash was computed 81 * Hash type pre-pended when a RSS hash was computed
82 */ 82 */
83#define NFP_NET_RSS_NONE 0 83#define NFP_NET_RSS_NONE 0
84#define NFP_NET_RSS_IPV4 1 84#define NFP_NET_RSS_IPV4 1
85#define NFP_NET_RSS_IPV6 2 85#define NFP_NET_RSS_IPV6 2
86#define NFP_NET_RSS_IPV6_EX 3 86#define NFP_NET_RSS_IPV6_EX 3
87#define NFP_NET_RSS_IPV4_TCP 4 87#define NFP_NET_RSS_IPV4_TCP 4
88#define NFP_NET_RSS_IPV6_TCP 5 88#define NFP_NET_RSS_IPV6_TCP 5
89#define NFP_NET_RSS_IPV6_EX_TCP 6 89#define NFP_NET_RSS_IPV6_EX_TCP 6
90#define NFP_NET_RSS_IPV4_UDP 7 90#define NFP_NET_RSS_IPV4_UDP 7
91#define NFP_NET_RSS_IPV6_UDP 8 91#define NFP_NET_RSS_IPV6_UDP 8
92#define NFP_NET_RSS_IPV6_EX_UDP 9 92#define NFP_NET_RSS_IPV6_EX_UDP 9
93 93
94/** 94/**
95 * Ring counts 95 * Ring counts
96 * %NFP_NET_TXR_MAX: Maximum number of TX rings 96 * %NFP_NET_TXR_MAX: Maximum number of TX rings
97 * %NFP_NET_RXR_MAX: Maximum number of RX rings 97 * %NFP_NET_RXR_MAX: Maximum number of RX rings
98 */ 98 */
99#define NFP_NET_TXR_MAX 64 99#define NFP_NET_TXR_MAX 64
100#define NFP_NET_RXR_MAX 64 100#define NFP_NET_RXR_MAX 64
101 101
102/** 102/**
103 * Read/Write config words (0x0000 - 0x002c) 103 * Read/Write config words (0x0000 - 0x002c)
104 * %NFP_NET_CFG_CTRL: Global control 104 * %NFP_NET_CFG_CTRL: Global control
105 * %NFP_NET_CFG_UPDATE: Indicate which fields are updated 105 * %NFP_NET_CFG_UPDATE: Indicate which fields are updated
106 * %NFP_NET_CFG_TXRS_ENABLE: Bitmask of enabled TX rings 106 * %NFP_NET_CFG_TXRS_ENABLE: Bitmask of enabled TX rings
107 * %NFP_NET_CFG_RXRS_ENABLE: Bitmask of enabled RX rings 107 * %NFP_NET_CFG_RXRS_ENABLE: Bitmask of enabled RX rings
108 * %NFP_NET_CFG_MTU: Set MTU size 108 * %NFP_NET_CFG_MTU: Set MTU size
109 * %NFP_NET_CFG_FLBUFSZ: Set freelist buffer size (must be larger than MTU) 109 * %NFP_NET_CFG_FLBUFSZ: Set freelist buffer size (must be larger than MTU)
110 * %NFP_NET_CFG_EXN: MSI-X table entry for exceptions 110 * %NFP_NET_CFG_EXN: MSI-X table entry for exceptions
111 * %NFP_NET_CFG_LSC: MSI-X table entry for link state changes 111 * %NFP_NET_CFG_LSC: MSI-X table entry for link state changes
112 * %NFP_NET_CFG_MACADDR: MAC address 112 * %NFP_NET_CFG_MACADDR: MAC address
113 * 113 *
114 * TODO: 114 * TODO:
115 * - define Error details in UPDATE 115 * - define Error details in UPDATE
116 */ 116 */
117#define NFP_NET_CFG_CTRL 0x0000 117#define NFP_NET_CFG_CTRL 0x0000
118#define NFP_NET_CFG_CTRL_ENABLE (0x1 << 0) /* Global enable */ 118#define NFP_NET_CFG_CTRL_ENABLE (0x1 << 0) /* Global enable */
119#define NFP_NET_CFG_CTRL_PROMISC (0x1 << 1) /* Enable Promisc mode */ 119#define NFP_NET_CFG_CTRL_PROMISC (0x1 << 1) /* Enable Promisc mode */
120#define NFP_NET_CFG_CTRL_L2BC (0x1 << 2) /* Allow L2 Broadcast */ 120#define NFP_NET_CFG_CTRL_L2BC (0x1 << 2) /* Allow L2 Broadcast */
121#define NFP_NET_CFG_CTRL_L2MC (0x1 << 3) /* Allow L2 Multicast */ 121#define NFP_NET_CFG_CTRL_L2MC (0x1 << 3) /* Allow L2 Multicast */
122#define NFP_NET_CFG_CTRL_RXCSUM (0x1 << 4) /* Enable RX Checksum */ 122#define NFP_NET_CFG_CTRL_RXCSUM (0x1 << 4) /* Enable RX Checksum */
123#define NFP_NET_CFG_CTRL_TXCSUM (0x1 << 5) /* Enable TX Checksum */ 123#define NFP_NET_CFG_CTRL_TXCSUM (0x1 << 5) /* Enable TX Checksum */
124#define NFP_NET_CFG_CTRL_RXVLAN (0x1 << 6) /* Enable VLAN strip */ 124#define NFP_NET_CFG_CTRL_RXVLAN (0x1 << 6) /* Enable VLAN strip */
125#define NFP_NET_CFG_CTRL_TXVLAN (0x1 << 7) /* Enable VLAN insert */ 125#define NFP_NET_CFG_CTRL_TXVLAN (0x1 << 7) /* Enable VLAN insert */
126#define NFP_NET_CFG_CTRL_SCATTER (0x1 << 8) /* Scatter DMA */ 126#define NFP_NET_CFG_CTRL_SCATTER (0x1 << 8) /* Scatter DMA */
127#define NFP_NET_CFG_CTRL_GATHER (0x1 << 9) /* Gather DMA */ 127#define NFP_NET_CFG_CTRL_GATHER (0x1 << 9) /* Gather DMA */
128#define NFP_NET_CFG_CTRL_LSO (0x1 << 10) /* LSO/TSO (version 1) */ 128#define NFP_NET_CFG_CTRL_LSO (0x1 << 10) /* LSO/TSO (version 1) */
129#define NFP_NET_CFG_CTRL_CTAG_FILTER (0x1 << 11) /* VLAN CTAG filtering */ 129#define NFP_NET_CFG_CTRL_CTAG_FILTER (0x1 << 11) /* VLAN CTAG filtering */
130#define NFP_NET_CFG_CTRL_RINGCFG (0x1 << 16) /* Ring runtime changes */ 130#define NFP_NET_CFG_CTRL_RINGCFG (0x1 << 16) /* Ring runtime changes */
131#define NFP_NET_CFG_CTRL_RSS (0x1 << 17) /* RSS (version 1) */ 131#define NFP_NET_CFG_CTRL_RSS (0x1 << 17) /* RSS (version 1) */
132#define NFP_NET_CFG_CTRL_IRQMOD (0x1 << 18) /* Interrupt moderation */ 132#define NFP_NET_CFG_CTRL_IRQMOD (0x1 << 18) /* Interrupt moderation */
133#define NFP_NET_CFG_CTRL_RINGPRIO (0x1 << 19) /* Ring priorities */ 133#define NFP_NET_CFG_CTRL_RINGPRIO (0x1 << 19) /* Ring priorities */
134#define NFP_NET_CFG_CTRL_MSIXAUTO (0x1 << 20) /* MSI-X auto-masking */ 134#define NFP_NET_CFG_CTRL_MSIXAUTO (0x1 << 20) /* MSI-X auto-masking */
135#define NFP_NET_CFG_CTRL_TXRWB (0x1 << 21) /* Write-back of TX ring*/ 135#define NFP_NET_CFG_CTRL_TXRWB (0x1 << 21) /* Write-back of TX ring*/
136#define NFP_NET_CFG_CTRL_L2SWITCH (0x1 << 22) /* L2 Switch */ 136#define NFP_NET_CFG_CTRL_L2SWITCH (0x1 << 22) /* L2 Switch */
137#define NFP_NET_CFG_CTRL_L2SWITCH_LOCAL (0x1 << 23) /* Switch to local */ 137#define NFP_NET_CFG_CTRL_L2SWITCH_LOCAL (0x1 << 23) /* Switch to local */
138#define NFP_NET_CFG_CTRL_VXLAN (0x1 << 24) /* VXLAN tunnel support */ 138#define NFP_NET_CFG_CTRL_VXLAN (0x1 << 24) /* VXLAN tunnel support */
139#define NFP_NET_CFG_CTRL_NVGRE (0x1 << 25) /* NVGRE tunnel support */ 139#define NFP_NET_CFG_CTRL_NVGRE (0x1 << 25) /* NVGRE tunnel support */
@@ -152,35 +152,35 @@
152#define NFP_NET_CFG_CTRL_CHAIN_META (NFP_NET_CFG_CTRL_RSS2 | \ 152#define NFP_NET_CFG_CTRL_CHAIN_META (NFP_NET_CFG_CTRL_RSS2 | \
153 NFP_NET_CFG_CTRL_CSUM_COMPLETE) 153 NFP_NET_CFG_CTRL_CSUM_COMPLETE)
154 154
155#define NFP_NET_CFG_UPDATE 0x0004 155#define NFP_NET_CFG_UPDATE 0x0004
156#define NFP_NET_CFG_UPDATE_GEN (0x1 << 0) /* General update */ 156#define NFP_NET_CFG_UPDATE_GEN (0x1 << 0) /* General update */
157#define NFP_NET_CFG_UPDATE_RING (0x1 << 1) /* Ring config change */ 157#define NFP_NET_CFG_UPDATE_RING (0x1 << 1) /* Ring config change */
158#define NFP_NET_CFG_UPDATE_RSS (0x1 << 2) /* RSS config change */ 158#define NFP_NET_CFG_UPDATE_RSS (0x1 << 2) /* RSS config change */
159#define NFP_NET_CFG_UPDATE_TXRPRIO (0x1 << 3) /* TX Ring prio change */ 159#define NFP_NET_CFG_UPDATE_TXRPRIO (0x1 << 3) /* TX Ring prio change */
160#define NFP_NET_CFG_UPDATE_RXRPRIO (0x1 << 4) /* RX Ring prio change */ 160#define NFP_NET_CFG_UPDATE_RXRPRIO (0x1 << 4) /* RX Ring prio change */
161#define NFP_NET_CFG_UPDATE_MSIX (0x1 << 5) /* MSI-X change */ 161#define NFP_NET_CFG_UPDATE_MSIX (0x1 << 5) /* MSI-X change */
162#define NFP_NET_CFG_UPDATE_L2SWITCH (0x1 << 6) /* Switch changes */ 162#define NFP_NET_CFG_UPDATE_L2SWITCH (0x1 << 6) /* Switch changes */
163#define NFP_NET_CFG_UPDATE_RESET (0x1 << 7) /* Update due to FLR */ 163#define NFP_NET_CFG_UPDATE_RESET (0x1 << 7) /* Update due to FLR */
164#define NFP_NET_CFG_UPDATE_IRQMOD (0x1 << 8) /* IRQ mod change */ 164#define NFP_NET_CFG_UPDATE_IRQMOD (0x1 << 8) /* IRQ mod change */
165#define NFP_NET_CFG_UPDATE_VXLAN (0x1 << 9) /* VXLAN port change */ 165#define NFP_NET_CFG_UPDATE_VXLAN (0x1 << 9) /* VXLAN port change */
166#define NFP_NET_CFG_UPDATE_BPF (0x1 << 10) /* BPF program load */ 166#define NFP_NET_CFG_UPDATE_BPF (0x1 << 10) /* BPF program load */
167#define NFP_NET_CFG_UPDATE_MACADDR (0x1 << 11) /* MAC address change */ 167#define NFP_NET_CFG_UPDATE_MACADDR (0x1 << 11) /* MAC address change */
168#define NFP_NET_CFG_UPDATE_MBOX (0x1 << 12) /* Mailbox update */ 168#define NFP_NET_CFG_UPDATE_MBOX (0x1 << 12) /* Mailbox update */
169#define NFP_NET_CFG_UPDATE_VF (0x1 << 13) /* VF settings change */ 169#define NFP_NET_CFG_UPDATE_VF (0x1 << 13) /* VF settings change */
170#define NFP_NET_CFG_UPDATE_ERR (0x1 << 31) /* A error occurred */ 170#define NFP_NET_CFG_UPDATE_ERR (0x1 << 31) /* A error occurred */
171#define NFP_NET_CFG_TXRS_ENABLE 0x0008 171#define NFP_NET_CFG_TXRS_ENABLE 0x0008
172#define NFP_NET_CFG_RXRS_ENABLE 0x0010 172#define NFP_NET_CFG_RXRS_ENABLE 0x0010
173#define NFP_NET_CFG_MTU 0x0018 173#define NFP_NET_CFG_MTU 0x0018
174#define NFP_NET_CFG_FLBUFSZ 0x001c 174#define NFP_NET_CFG_FLBUFSZ 0x001c
175#define NFP_NET_CFG_EXN 0x001f 175#define NFP_NET_CFG_EXN 0x001f
176#define NFP_NET_CFG_LSC 0x0020 176#define NFP_NET_CFG_LSC 0x0020
177#define NFP_NET_CFG_MACADDR 0x0024 177#define NFP_NET_CFG_MACADDR 0x0024
178 178
179/** 179/**
180 * Read-only words (0x0030 - 0x0050): 180 * Read-only words (0x0030 - 0x0050):
181 * %NFP_NET_CFG_VERSION: Firmware version number 181 * %NFP_NET_CFG_VERSION: Firmware version number
182 * %NFP_NET_CFG_STS: Status 182 * %NFP_NET_CFG_STS: Status
183 * %NFP_NET_CFG_CAP: Capabilities (same bits as %NFP_NET_CFG_CTRL) 183 * %NFP_NET_CFG_CAP: Capabilities (same bits as %NFP_NET_CFG_CTRL)
184 * %NFP_NET_CFG_MAX_TXRINGS: Maximum number of TX rings 184 * %NFP_NET_CFG_MAX_TXRINGS: Maximum number of TX rings
185 * %NFP_NET_CFG_MAX_RXRINGS: Maximum number of RX rings 185 * %NFP_NET_CFG_MAX_RXRINGS: Maximum number of RX rings
186 * %NFP_NET_CFG_MAX_MTU: Maximum support MTU 186 * %NFP_NET_CFG_MAX_MTU: Maximum support MTU
@@ -190,37 +190,37 @@
190 * TODO: 190 * TODO:
191 * - define more STS bits 191 * - define more STS bits
192 */ 192 */
193#define NFP_NET_CFG_VERSION 0x0030 193#define NFP_NET_CFG_VERSION 0x0030
194#define NFP_NET_CFG_VERSION_RESERVED_MASK (0xff << 24) 194#define NFP_NET_CFG_VERSION_RESERVED_MASK (0xff << 24)
195#define NFP_NET_CFG_VERSION_CLASS_MASK (0xff << 16) 195#define NFP_NET_CFG_VERSION_CLASS_MASK (0xff << 16)
196#define NFP_NET_CFG_VERSION_CLASS(x) (((x) & 0xff) << 16) 196#define NFP_NET_CFG_VERSION_CLASS(x) (((x) & 0xff) << 16)
197#define NFP_NET_CFG_VERSION_CLASS_GENERIC 0 197#define NFP_NET_CFG_VERSION_CLASS_GENERIC 0
198#define NFP_NET_CFG_VERSION_MAJOR_MASK (0xff << 8) 198#define NFP_NET_CFG_VERSION_MAJOR_MASK (0xff << 8)
199#define NFP_NET_CFG_VERSION_MAJOR(x) (((x) & 0xff) << 8) 199#define NFP_NET_CFG_VERSION_MAJOR(x) (((x) & 0xff) << 8)
200#define NFP_NET_CFG_VERSION_MINOR_MASK (0xff << 0) 200#define NFP_NET_CFG_VERSION_MINOR_MASK (0xff << 0)
201#define NFP_NET_CFG_VERSION_MINOR(x) (((x) & 0xff) << 0) 201#define NFP_NET_CFG_VERSION_MINOR(x) (((x) & 0xff) << 0)
202#define NFP_NET_CFG_STS 0x0034 202#define NFP_NET_CFG_STS 0x0034
203#define NFP_NET_CFG_STS_LINK (0x1 << 0) /* Link up or down */ 203#define NFP_NET_CFG_STS_LINK (0x1 << 0) /* Link up or down */
204/* Link rate */ 204/* Link rate */
205#define NFP_NET_CFG_STS_LINK_RATE_SHIFT 1 205#define NFP_NET_CFG_STS_LINK_RATE_SHIFT 1
206#define NFP_NET_CFG_STS_LINK_RATE_MASK 0xF 206#define NFP_NET_CFG_STS_LINK_RATE_MASK 0xF
207#define NFP_NET_CFG_STS_LINK_RATE \ 207#define NFP_NET_CFG_STS_LINK_RATE \
208 (NFP_NET_CFG_STS_LINK_RATE_MASK << NFP_NET_CFG_STS_LINK_RATE_SHIFT) 208 (NFP_NET_CFG_STS_LINK_RATE_MASK << NFP_NET_CFG_STS_LINK_RATE_SHIFT)
209#define NFP_NET_CFG_STS_LINK_RATE_UNSUPPORTED 0 209#define NFP_NET_CFG_STS_LINK_RATE_UNSUPPORTED 0
210#define NFP_NET_CFG_STS_LINK_RATE_UNKNOWN 1 210#define NFP_NET_CFG_STS_LINK_RATE_UNKNOWN 1
211#define NFP_NET_CFG_STS_LINK_RATE_1G 2 211#define NFP_NET_CFG_STS_LINK_RATE_1G 2
212#define NFP_NET_CFG_STS_LINK_RATE_10G 3 212#define NFP_NET_CFG_STS_LINK_RATE_10G 3
213#define NFP_NET_CFG_STS_LINK_RATE_25G 4 213#define NFP_NET_CFG_STS_LINK_RATE_25G 4
214#define NFP_NET_CFG_STS_LINK_RATE_40G 5 214#define NFP_NET_CFG_STS_LINK_RATE_40G 5
215#define NFP_NET_CFG_STS_LINK_RATE_50G 6 215#define NFP_NET_CFG_STS_LINK_RATE_50G 6
216#define NFP_NET_CFG_STS_LINK_RATE_100G 7 216#define NFP_NET_CFG_STS_LINK_RATE_100G 7
217#define NFP_NET_CFG_CAP 0x0038 217#define NFP_NET_CFG_CAP 0x0038
218#define NFP_NET_CFG_MAX_TXRINGS 0x003c 218#define NFP_NET_CFG_MAX_TXRINGS 0x003c
219#define NFP_NET_CFG_MAX_RXRINGS 0x0040 219#define NFP_NET_CFG_MAX_RXRINGS 0x0040
220#define NFP_NET_CFG_MAX_MTU 0x0044 220#define NFP_NET_CFG_MAX_MTU 0x0044
221/* Next two words are being used by VFs for solving THB350 issue */ 221/* Next two words are being used by VFs for solving THB350 issue */
222#define NFP_NET_CFG_START_TXQ 0x0048 222#define NFP_NET_CFG_START_TXQ 0x0048
223#define NFP_NET_CFG_START_RXQ 0x004c 223#define NFP_NET_CFG_START_RXQ 0x004c
224 224
225/** 225/**
226 * Prepend configuration 226 * Prepend configuration
@@ -280,8 +280,8 @@
280/** 280/**
281 * 40B reserved for future use (0x0098 - 0x00c0) 281 * 40B reserved for future use (0x0098 - 0x00c0)
282 */ 282 */
283#define NFP_NET_CFG_RESERVED 0x0098 283#define NFP_NET_CFG_RESERVED 0x0098
284#define NFP_NET_CFG_RESERVED_SZ 0x0028 284#define NFP_NET_CFG_RESERVED_SZ 0x0028
285 285
286/** 286/**
287 * RSS configuration (0x0100 - 0x01ac): 287 * RSS configuration (0x0100 - 0x01ac):
@@ -290,26 +290,26 @@
290 * %NFP_NET_CFG_RSS_KEY: RSS "secret" key 290 * %NFP_NET_CFG_RSS_KEY: RSS "secret" key
291 * %NFP_NET_CFG_RSS_ITBL: RSS indirection table 291 * %NFP_NET_CFG_RSS_ITBL: RSS indirection table
292 */ 292 */
293#define NFP_NET_CFG_RSS_BASE 0x0100 293#define NFP_NET_CFG_RSS_BASE 0x0100
294#define NFP_NET_CFG_RSS_CTRL NFP_NET_CFG_RSS_BASE 294#define NFP_NET_CFG_RSS_CTRL NFP_NET_CFG_RSS_BASE
295#define NFP_NET_CFG_RSS_MASK (0x7f) 295#define NFP_NET_CFG_RSS_MASK (0x7f)
296#define NFP_NET_CFG_RSS_MASK_of(_x) ((_x) & 0x7f) 296#define NFP_NET_CFG_RSS_MASK_of(_x) ((_x) & 0x7f)
297#define NFP_NET_CFG_RSS_IPV4 (1 << 8) /* RSS for IPv4 */ 297#define NFP_NET_CFG_RSS_IPV4 (1 << 8) /* RSS for IPv4 */
298#define NFP_NET_CFG_RSS_IPV6 (1 << 9) /* RSS for IPv6 */ 298#define NFP_NET_CFG_RSS_IPV6 (1 << 9) /* RSS for IPv6 */
299#define NFP_NET_CFG_RSS_IPV4_TCP (1 << 10) /* RSS for IPv4/TCP */ 299#define NFP_NET_CFG_RSS_IPV4_TCP (1 << 10) /* RSS for IPv4/TCP */
300#define NFP_NET_CFG_RSS_IPV4_UDP (1 << 11) /* RSS for IPv4/UDP */ 300#define NFP_NET_CFG_RSS_IPV4_UDP (1 << 11) /* RSS for IPv4/UDP */
301#define NFP_NET_CFG_RSS_IPV6_TCP (1 << 12) /* RSS for IPv6/TCP */ 301#define NFP_NET_CFG_RSS_IPV6_TCP (1 << 12) /* RSS for IPv6/TCP */
302#define NFP_NET_CFG_RSS_IPV6_UDP (1 << 13) /* RSS for IPv6/UDP */ 302#define NFP_NET_CFG_RSS_IPV6_UDP (1 << 13) /* RSS for IPv6/UDP */
303#define NFP_NET_CFG_RSS_HFUNC 0xff000000 303#define NFP_NET_CFG_RSS_HFUNC 0xff000000
304#define NFP_NET_CFG_RSS_TOEPLITZ (1 << 24) /* Use Toeplitz hash */ 304#define NFP_NET_CFG_RSS_TOEPLITZ (1 << 24) /* Use Toeplitz hash */
305#define NFP_NET_CFG_RSS_XOR (1 << 25) /* Use XOR as hash */ 305#define NFP_NET_CFG_RSS_XOR (1 << 25) /* Use XOR as hash */
306#define NFP_NET_CFG_RSS_CRC32 (1 << 26) /* Use CRC32 as hash */ 306#define NFP_NET_CFG_RSS_CRC32 (1 << 26) /* Use CRC32 as hash */
307#define NFP_NET_CFG_RSS_HFUNCS 3 307#define NFP_NET_CFG_RSS_HFUNCS 3
308#define NFP_NET_CFG_RSS_KEY (NFP_NET_CFG_RSS_BASE + 0x4) 308#define NFP_NET_CFG_RSS_KEY (NFP_NET_CFG_RSS_BASE + 0x4)
309#define NFP_NET_CFG_RSS_KEY_SZ 0x28 309#define NFP_NET_CFG_RSS_KEY_SZ 0x28
310#define NFP_NET_CFG_RSS_ITBL (NFP_NET_CFG_RSS_BASE + 0x4 + \ 310#define NFP_NET_CFG_RSS_ITBL (NFP_NET_CFG_RSS_BASE + 0x4 + \
311 NFP_NET_CFG_RSS_KEY_SZ) 311 NFP_NET_CFG_RSS_KEY_SZ)
312#define NFP_NET_CFG_RSS_ITBL_SZ 0x80 312#define NFP_NET_CFG_RSS_ITBL_SZ 0x80
313 313
314/** 314/**
315 * TX ring configuration (0x200 - 0x800) 315 * TX ring configuration (0x200 - 0x800)
@@ -321,13 +321,13 @@
321 * %NFP_NET_CFG_TXR_PRIO: Per TX ring priority (1B entries) 321 * %NFP_NET_CFG_TXR_PRIO: Per TX ring priority (1B entries)
322 * %NFP_NET_CFG_TXR_IRQ_MOD: Per TX ring interrupt moderation packet 322 * %NFP_NET_CFG_TXR_IRQ_MOD: Per TX ring interrupt moderation packet
323 */ 323 */
324#define NFP_NET_CFG_TXR_BASE 0x0200 324#define NFP_NET_CFG_TXR_BASE 0x0200
325#define NFP_NET_CFG_TXR_ADDR(_x) (NFP_NET_CFG_TXR_BASE + ((_x) * 0x8)) 325#define NFP_NET_CFG_TXR_ADDR(_x) (NFP_NET_CFG_TXR_BASE + ((_x) * 0x8))
326#define NFP_NET_CFG_TXR_WB_ADDR(_x) (NFP_NET_CFG_TXR_BASE + 0x200 + \ 326#define NFP_NET_CFG_TXR_WB_ADDR(_x) (NFP_NET_CFG_TXR_BASE + 0x200 + \
327 ((_x) * 0x8)) 327 ((_x) * 0x8))
328#define NFP_NET_CFG_TXR_SZ(_x) (NFP_NET_CFG_TXR_BASE + 0x400 + (_x)) 328#define NFP_NET_CFG_TXR_SZ(_x) (NFP_NET_CFG_TXR_BASE + 0x400 + (_x))
329#define NFP_NET_CFG_TXR_VEC(_x) (NFP_NET_CFG_TXR_BASE + 0x440 + (_x)) 329#define NFP_NET_CFG_TXR_VEC(_x) (NFP_NET_CFG_TXR_BASE + 0x440 + (_x))
330#define NFP_NET_CFG_TXR_PRIO(_x) (NFP_NET_CFG_TXR_BASE + 0x480 + (_x)) 330#define NFP_NET_CFG_TXR_PRIO(_x) (NFP_NET_CFG_TXR_BASE + 0x480 + (_x))
331#define NFP_NET_CFG_TXR_IRQ_MOD(_x) (NFP_NET_CFG_TXR_BASE + 0x500 + \ 331#define NFP_NET_CFG_TXR_IRQ_MOD(_x) (NFP_NET_CFG_TXR_BASE + 0x500 + \
332 ((_x) * 0x4)) 332 ((_x) * 0x4))
333 333
@@ -340,11 +340,11 @@
340 * %NFP_NET_CFG_RXR_PRIO: Per RX ring priority (1B entries) 340 * %NFP_NET_CFG_RXR_PRIO: Per RX ring priority (1B entries)
341 * %NFP_NET_CFG_RXR_IRQ_MOD: Per RX ring interrupt moderation (4B entries) 341 * %NFP_NET_CFG_RXR_IRQ_MOD: Per RX ring interrupt moderation (4B entries)
342 */ 342 */
343#define NFP_NET_CFG_RXR_BASE 0x0800 343#define NFP_NET_CFG_RXR_BASE 0x0800
344#define NFP_NET_CFG_RXR_ADDR(_x) (NFP_NET_CFG_RXR_BASE + ((_x) * 0x8)) 344#define NFP_NET_CFG_RXR_ADDR(_x) (NFP_NET_CFG_RXR_BASE + ((_x) * 0x8))
345#define NFP_NET_CFG_RXR_SZ(_x) (NFP_NET_CFG_RXR_BASE + 0x200 + (_x)) 345#define NFP_NET_CFG_RXR_SZ(_x) (NFP_NET_CFG_RXR_BASE + 0x200 + (_x))
346#define NFP_NET_CFG_RXR_VEC(_x) (NFP_NET_CFG_RXR_BASE + 0x240 + (_x)) 346#define NFP_NET_CFG_RXR_VEC(_x) (NFP_NET_CFG_RXR_BASE + 0x240 + (_x))
347#define NFP_NET_CFG_RXR_PRIO(_x) (NFP_NET_CFG_RXR_BASE + 0x280 + (_x)) 347#define NFP_NET_CFG_RXR_PRIO(_x) (NFP_NET_CFG_RXR_BASE + 0x280 + (_x))
348#define NFP_NET_CFG_RXR_IRQ_MOD(_x) (NFP_NET_CFG_RXR_BASE + 0x300 + \ 348#define NFP_NET_CFG_RXR_IRQ_MOD(_x) (NFP_NET_CFG_RXR_BASE + 0x300 + \
349 ((_x) * 0x4)) 349 ((_x) * 0x4))
350 350
@@ -358,36 +358,36 @@
358 * the MSI-X entry and the host driver must clear the register to 358 * the MSI-X entry and the host driver must clear the register to
359 * re-enable the interrupt. 359 * re-enable the interrupt.
360 */ 360 */
361#define NFP_NET_CFG_ICR_BASE 0x0c00 361#define NFP_NET_CFG_ICR_BASE 0x0c00
362#define NFP_NET_CFG_ICR(_x) (NFP_NET_CFG_ICR_BASE + (_x)) 362#define NFP_NET_CFG_ICR(_x) (NFP_NET_CFG_ICR_BASE + (_x))
363#define NFP_NET_CFG_ICR_UNMASKED 0x0 363#define NFP_NET_CFG_ICR_UNMASKED 0x0
364#define NFP_NET_CFG_ICR_RXTX 0x1 364#define NFP_NET_CFG_ICR_RXTX 0x1
365#define NFP_NET_CFG_ICR_LSC 0x2 365#define NFP_NET_CFG_ICR_LSC 0x2
366 366
367/** 367/**
368 * General device stats (0x0d00 - 0x0d90) 368 * General device stats (0x0d00 - 0x0d90)
369 * all counters are 64bit. 369 * all counters are 64bit.
370 */ 370 */
371#define NFP_NET_CFG_STATS_BASE 0x0d00 371#define NFP_NET_CFG_STATS_BASE 0x0d00
372#define NFP_NET_CFG_STATS_RX_DISCARDS (NFP_NET_CFG_STATS_BASE + 0x00) 372#define NFP_NET_CFG_STATS_RX_DISCARDS (NFP_NET_CFG_STATS_BASE + 0x00)
373#define NFP_NET_CFG_STATS_RX_ERRORS (NFP_NET_CFG_STATS_BASE + 0x08) 373#define NFP_NET_CFG_STATS_RX_ERRORS (NFP_NET_CFG_STATS_BASE + 0x08)
374#define NFP_NET_CFG_STATS_RX_OCTETS (NFP_NET_CFG_STATS_BASE + 0x10) 374#define NFP_NET_CFG_STATS_RX_OCTETS (NFP_NET_CFG_STATS_BASE + 0x10)
375#define NFP_NET_CFG_STATS_RX_UC_OCTETS (NFP_NET_CFG_STATS_BASE + 0x18) 375#define NFP_NET_CFG_STATS_RX_UC_OCTETS (NFP_NET_CFG_STATS_BASE + 0x18)
376#define NFP_NET_CFG_STATS_RX_MC_OCTETS (NFP_NET_CFG_STATS_BASE + 0x20) 376#define NFP_NET_CFG_STATS_RX_MC_OCTETS (NFP_NET_CFG_STATS_BASE + 0x20)
377#define NFP_NET_CFG_STATS_RX_BC_OCTETS (NFP_NET_CFG_STATS_BASE + 0x28) 377#define NFP_NET_CFG_STATS_RX_BC_OCTETS (NFP_NET_CFG_STATS_BASE + 0x28)
378#define NFP_NET_CFG_STATS_RX_FRAMES (NFP_NET_CFG_STATS_BASE + 0x30) 378#define NFP_NET_CFG_STATS_RX_FRAMES (NFP_NET_CFG_STATS_BASE + 0x30)
379#define NFP_NET_CFG_STATS_RX_MC_FRAMES (NFP_NET_CFG_STATS_BASE + 0x38) 379#define NFP_NET_CFG_STATS_RX_MC_FRAMES (NFP_NET_CFG_STATS_BASE + 0x38)
380#define NFP_NET_CFG_STATS_RX_BC_FRAMES (NFP_NET_CFG_STATS_BASE + 0x40) 380#define NFP_NET_CFG_STATS_RX_BC_FRAMES (NFP_NET_CFG_STATS_BASE + 0x40)
381 381
382#define NFP_NET_CFG_STATS_TX_DISCARDS (NFP_NET_CFG_STATS_BASE + 0x48) 382#define NFP_NET_CFG_STATS_TX_DISCARDS (NFP_NET_CFG_STATS_BASE + 0x48)
383#define NFP_NET_CFG_STATS_TX_ERRORS (NFP_NET_CFG_STATS_BASE + 0x50) 383#define NFP_NET_CFG_STATS_TX_ERRORS (NFP_NET_CFG_STATS_BASE + 0x50)
384#define NFP_NET_CFG_STATS_TX_OCTETS (NFP_NET_CFG_STATS_BASE + 0x58) 384#define NFP_NET_CFG_STATS_TX_OCTETS (NFP_NET_CFG_STATS_BASE + 0x58)
385#define NFP_NET_CFG_STATS_TX_UC_OCTETS (NFP_NET_CFG_STATS_BASE + 0x60) 385#define NFP_NET_CFG_STATS_TX_UC_OCTETS (NFP_NET_CFG_STATS_BASE + 0x60)
386#define NFP_NET_CFG_STATS_TX_MC_OCTETS (NFP_NET_CFG_STATS_BASE + 0x68) 386#define NFP_NET_CFG_STATS_TX_MC_OCTETS (NFP_NET_CFG_STATS_BASE + 0x68)
387#define NFP_NET_CFG_STATS_TX_BC_OCTETS (NFP_NET_CFG_STATS_BASE + 0x70) 387#define NFP_NET_CFG_STATS_TX_BC_OCTETS (NFP_NET_CFG_STATS_BASE + 0x70)
388#define NFP_NET_CFG_STATS_TX_FRAMES (NFP_NET_CFG_STATS_BASE + 0x78) 388#define NFP_NET_CFG_STATS_TX_FRAMES (NFP_NET_CFG_STATS_BASE + 0x78)
389#define NFP_NET_CFG_STATS_TX_MC_FRAMES (NFP_NET_CFG_STATS_BASE + 0x80) 389#define NFP_NET_CFG_STATS_TX_MC_FRAMES (NFP_NET_CFG_STATS_BASE + 0x80)
390#define NFP_NET_CFG_STATS_TX_BC_FRAMES (NFP_NET_CFG_STATS_BASE + 0x88) 390#define NFP_NET_CFG_STATS_TX_BC_FRAMES (NFP_NET_CFG_STATS_BASE + 0x88)
391 391
392#define NFP_NET_CFG_STATS_APP0_FRAMES (NFP_NET_CFG_STATS_BASE + 0x90) 392#define NFP_NET_CFG_STATS_APP0_FRAMES (NFP_NET_CFG_STATS_BASE + 0x90)
393#define NFP_NET_CFG_STATS_APP0_BYTES (NFP_NET_CFG_STATS_BASE + 0x98) 393#define NFP_NET_CFG_STATS_APP0_BYTES (NFP_NET_CFG_STATS_BASE + 0x98)
@@ -404,11 +404,11 @@
404 * %NFP_NET_CFG_TXR_STATS: TX ring statistics (Packet and Byte count) 404 * %NFP_NET_CFG_TXR_STATS: TX ring statistics (Packet and Byte count)
405 * %NFP_NET_CFG_RXR_STATS: RX ring statistics (Packet and Byte count) 405 * %NFP_NET_CFG_RXR_STATS: RX ring statistics (Packet and Byte count)
406 */ 406 */
407#define NFP_NET_CFG_TXR_STATS_BASE 0x1000 407#define NFP_NET_CFG_TXR_STATS_BASE 0x1000
408#define NFP_NET_CFG_TXR_STATS(_x) (NFP_NET_CFG_TXR_STATS_BASE + \ 408#define NFP_NET_CFG_TXR_STATS(_x) (NFP_NET_CFG_TXR_STATS_BASE + \
409 ((_x) * 0x10)) 409 ((_x) * 0x10))
410#define NFP_NET_CFG_RXR_STATS_BASE 0x1400 410#define NFP_NET_CFG_RXR_STATS_BASE 0x1400
411#define NFP_NET_CFG_RXR_STATS(_x) (NFP_NET_CFG_RXR_STATS_BASE + \ 411#define NFP_NET_CFG_RXR_STATS(_x) (NFP_NET_CFG_RXR_STATS_BASE + \
412 ((_x) * 0x10)) 412 ((_x) * 0x10))
413 413
414/** 414/**
@@ -444,7 +444,7 @@
444 * %NFP_NET_CFG_TLV_TYPE: Offset of type within the TLV 444 * %NFP_NET_CFG_TLV_TYPE: Offset of type within the TLV
445 * %NFP_NET_CFG_TLV_TYPE_REQUIRED: Driver must be able to parse the TLV 445 * %NFP_NET_CFG_TLV_TYPE_REQUIRED: Driver must be able to parse the TLV
446 * %NFP_NET_CFG_TLV_LENGTH: Offset of length within the TLV 446 * %NFP_NET_CFG_TLV_LENGTH: Offset of length within the TLV
447 * %NFP_NET_CFG_TLV_LENGTH_INC: TLV length increments 447 * %NFP_NET_CFG_TLV_LENGTH_INC: TLV length increments
448 * %NFP_NET_CFG_TLV_VALUE: Offset of value with the TLV 448 * %NFP_NET_CFG_TLV_VALUE: Offset of value with the TLV
449 * 449 *
450 * List of simple TLV structures, first one starts at %NFP_NET_CFG_TLV_BASE. 450 * List of simple TLV structures, first one starts at %NFP_NET_CFG_TLV_BASE.
@@ -457,12 +457,12 @@
457 * Note that the 4 byte TLV header is not counted in %NFP_NET_CFG_TLV_LENGTH. 457 * Note that the 4 byte TLV header is not counted in %NFP_NET_CFG_TLV_LENGTH.
458 */ 458 */
459#define NFP_NET_CFG_TLV_TYPE 0x00 459#define NFP_NET_CFG_TLV_TYPE 0x00
460#define NFP_NET_CFG_TLV_TYPE_REQUIRED 0x8000 460#define NFP_NET_CFG_TLV_TYPE_REQUIRED 0x8000
461#define NFP_NET_CFG_TLV_LENGTH 0x02 461#define NFP_NET_CFG_TLV_LENGTH 0x02
462#define NFP_NET_CFG_TLV_LENGTH_INC 4 462#define NFP_NET_CFG_TLV_LENGTH_INC 4
463#define NFP_NET_CFG_TLV_VALUE 0x04 463#define NFP_NET_CFG_TLV_VALUE 0x04
464 464
465#define NFP_NET_CFG_TLV_HEADER_REQUIRED 0x80000000 465#define NFP_NET_CFG_TLV_HEADER_REQUIRED 0x80000000
466#define NFP_NET_CFG_TLV_HEADER_TYPE 0x7fff0000 466#define NFP_NET_CFG_TLV_HEADER_TYPE 0x7fff0000
467#define NFP_NET_CFG_TLV_HEADER_LENGTH 0x0000ffff 467#define NFP_NET_CFG_TLV_HEADER_LENGTH 0x0000ffff
468 468