diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2017-08-18 15:48:17 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-18 22:39:28 -0700 |
commit | 7344bea1401627cd1b02d19252baa1c40c0fb5e9 (patch) | |
tree | 796376526c2c5913170193521e3f860915a13d37 /drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | |
parent | 325945ede6d49fd94b79c8c243fc3c0f2db2fcdb (diff) | |
download | linux-7344bea1401627cd1b02d19252baa1c40c0fb5e9.tar.gz linux-7344bea1401627cd1b02d19252baa1c40c0fb5e9.tar.bz2 linux-7344bea1401627cd1b02d19252baa1c40c0fb5e9.zip |
nfp: store pointer to MAC statistics in nfp_port
Store pointer to device memory containing MAC statistics
in nfp_port. This simplifies representor code and will
be used to dump those statistics in ethtool as well.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/nfp_net_repr.c')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c index 50f7cc057cc9..28e932eab812 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_repr.c @@ -78,12 +78,10 @@ void nfp_repr_inc_rx_stats(struct net_device *netdev, unsigned int len) } static void -nfp_repr_phy_port_get_stats64(const struct nfp_app *app, u8 phy_port, +nfp_repr_phy_port_get_stats64(struct nfp_port *port, struct rtnl_link_stats64 *stats) { - u8 __iomem *mem; - - mem = app->pf->mac_stats_mem + phy_port * NFP_MAC_STATS_SIZE; + u8 __iomem *mem = port->eth_stats; /* TX and RX stats are flipped as we are returning the stats as seen * at the switch port corresponding to the phys port. @@ -141,7 +139,6 @@ static void nfp_repr_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats) { struct nfp_repr *repr = netdev_priv(netdev); - struct nfp_eth_table_port *eth_port; struct nfp_app *app = repr->app; if (WARN_ON(!repr->port)) @@ -149,10 +146,9 @@ nfp_repr_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats) switch (repr->port->type) { case NFP_PORT_PHYS_PORT: - eth_port = __nfp_port_get_eth_port(repr->port); - if (!eth_port) + if (!__nfp_port_get_eth_port(repr->port)) break; - nfp_repr_phy_port_get_stats64(app, eth_port->index, stats); + nfp_repr_phy_port_get_stats64(repr->port, stats); break; case NFP_PORT_PF_PORT: nfp_repr_pf_get_stats64(app, repr->port->pf_id, stats); |