1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

nfp: extend capability and control words

Currently the 32-bit capability word is almost exhausted, now
allocate some more words to support new features, and control
word is also extended accordingly. Packet-type offloading is
implemented in NIC application firmware, but it's not used in
kernel driver, so reserve this bit here in case it's redefined
for other use.

Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com>
Reviewed-by: Louis Peens <louis.peens@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Yinjun Zhang 2022-11-17 14:21:00 +01:00 committed by David S. Miller
parent 8719a1c30d
commit 484963ce9f
3 changed files with 14 additions and 3 deletions

View file

@ -541,6 +541,7 @@ struct nfp_net_dp {
* @id: vNIC id within the PF (0 for VFs) * @id: vNIC id within the PF (0 for VFs)
* @fw_ver: Firmware version * @fw_ver: Firmware version
* @cap: Capabilities advertised by the Firmware * @cap: Capabilities advertised by the Firmware
* @cap_w1: Extended capabilities word advertised by the Firmware
* @max_mtu: Maximum support MTU advertised by the Firmware * @max_mtu: Maximum support MTU advertised by the Firmware
* @rss_hfunc: RSS selected hash function * @rss_hfunc: RSS selected hash function
* @rss_cfg: RSS configuration * @rss_cfg: RSS configuration
@ -617,6 +618,7 @@ struct nfp_net {
u32 id; u32 id;
u32 cap; u32 cap;
u32 cap_w1;
u32 max_mtu; u32 max_mtu;
u8 rss_hfunc; u8 rss_hfunc;

View file

@ -2452,6 +2452,7 @@ static int nfp_net_read_caps(struct nfp_net *nn)
{ {
/* Get some of the read-only fields from the BAR */ /* Get some of the read-only fields from the BAR */
nn->cap = nn_readl(nn, NFP_NET_CFG_CAP); nn->cap = nn_readl(nn, NFP_NET_CFG_CAP);
nn->cap_w1 = nn_readq(nn, NFP_NET_CFG_CAP_WORD1);
nn->max_mtu = nn_readl(nn, NFP_NET_CFG_MAX_MTU); nn->max_mtu = nn_readl(nn, NFP_NET_CFG_MAX_MTU);
/* ABI 4.x and ctrl vNIC always use chained metadata, in other cases /* ABI 4.x and ctrl vNIC always use chained metadata, in other cases

View file

@ -257,10 +257,18 @@
#define NFP_NET_CFG_BPF_CFG_MASK 7ULL #define NFP_NET_CFG_BPF_CFG_MASK 7ULL
#define NFP_NET_CFG_BPF_ADDR_MASK (~NFP_NET_CFG_BPF_CFG_MASK) #define NFP_NET_CFG_BPF_ADDR_MASK (~NFP_NET_CFG_BPF_CFG_MASK)
/* 40B reserved for future use (0x0098 - 0x00c0) /* 3 words reserved for extended ctrl words (0x0098 - 0x00a4)
* 3 words reserved for extended cap words (0x00a4 - 0x00b0)
* Currently only one word is used, can be extended in future.
*/ */
#define NFP_NET_CFG_RESERVED 0x0098 #define NFP_NET_CFG_CTRL_WORD1 0x0098
#define NFP_NET_CFG_RESERVED_SZ 0x0028 #define NFP_NET_CFG_CTRL_PKT_TYPE (0x1 << 0) /* Pkttype offload */
#define NFP_NET_CFG_CAP_WORD1 0x00a4
/* 16B reserved for future use (0x00b0 - 0x00c0) */
#define NFP_NET_CFG_RESERVED 0x00b0
#define NFP_NET_CFG_RESERVED_SZ 0x0010
/* RSS configuration (0x0100 - 0x01ac): /* RSS configuration (0x0100 - 0x01ac):
* Used only when NFP_NET_CFG_CTRL_RSS is enabled * Used only when NFP_NET_CFG_CTRL_RSS is enabled