Skip to content

Commit

Permalink
nfp: extend capability and control words
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
zhangyinjun authored and davem330 committed Nov 21, 2022
1 parent 8719a1c commit 484963c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/netronome/nfp/nfp_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ struct nfp_net_dp {
* @id: vNIC id within the PF (0 for VFs)
* @fw_ver: Firmware version
* @cap: Capabilities advertised by the Firmware
* @cap_w1: Extended capabilities word advertised by the Firmware
* @max_mtu: Maximum support MTU advertised by the Firmware
* @rss_hfunc: RSS selected hash function
* @rss_cfg: RSS configuration
Expand Down Expand Up @@ -617,6 +618,7 @@ struct nfp_net {
u32 id;

u32 cap;
u32 cap_w1;
u32 max_mtu;

u8 rss_hfunc;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/netronome/nfp/nfp_net_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2452,6 +2452,7 @@ static int nfp_net_read_caps(struct nfp_net *nn)
{
/* Get some of the read-only fields from the BAR */
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);

/* ABI 4.x and ctrl vNIC always use chained metadata, in other cases
Expand Down
14 changes: 11 additions & 3 deletions drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,18 @@
#define NFP_NET_CFG_BPF_CFG_MASK 7ULL
#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_RESERVED_SZ 0x0028
#define NFP_NET_CFG_CTRL_WORD1 0x0098
#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):
* Used only when NFP_NET_CFG_CTRL_RSS is enabled
Expand Down

0 comments on commit 484963c

Please sign in to comment.