diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-12-10 08:04:01 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-12-11 04:34:43 +0300 |
commit | ca866ee825911cb70e64ad5b33ac73d4ab924c1f (patch) | |
tree | 14a82e6d94023bafa9ec3ed98fc0c9d597c4b16e /drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c | |
parent | 5000b28b0b1a34144b39376318cafb8c2a0f79fd (diff) | |
download | linux-ca866ee825911cb70e64ad5b33ac73d4ab924c1f.tar.xz |
nfp: add support for TLV device stats
Device stats are currently hard coded in the PCI BAR0 layout.
Add a ability to read them from the TLV area instead.
Names for the stats are maintained by the driver, and their
meaning documented. This allows us to more easily add and
remove device stats.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c b/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c index d835c14b7257..45756648a85c 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.c @@ -114,6 +114,15 @@ int nfp_net_tlv_caps_parse(struct device *dev, u8 __iomem *ctrl_mem, caps->crypto_ops = readl(data); caps->crypto_enable_off = data - ctrl_mem + 16; break; + case NFP_NET_CFG_TLV_TYPE_VNIC_STATS: + if ((data - ctrl_mem) % 8) { + dev_warn(dev, "VNIC STATS TLV misaligned, ignoring offset:%u len:%u\n", + offset, length); + break; + } + caps->vnic_stats_off = data - ctrl_mem; + caps->vnic_stats_cnt = length / 10; + break; default: if (!FIELD_GET(NFP_NET_CFG_TLV_HEADER_REQUIRED, hdr)) break; |