Skip to content

Commit

Permalink
i40e: add XDP ring statistics to VSI stats
Browse files Browse the repository at this point in the history
Prior to this, only Rx and Tx ring statistics were accounted for.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
  • Loading branch information
Ciara Loftus authored and Tony Nguyen committed Jul 1, 2020
1 parent 1fd972e commit e296826
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions drivers/net/ethernet/intel/i40e/i40e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,25 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)
rx_p += packets;
rx_buf += p->rx_stats.alloc_buff_failed;
rx_page += p->rx_stats.alloc_page_failed;

if (i40e_enabled_xdp_vsi(vsi)) {
/* locate XDP ring */
p = READ_ONCE(vsi->xdp_rings[q]);
if (!p)
continue;

do {
start = u64_stats_fetch_begin_irq(&p->syncp);
packets = p->stats.packets;
bytes = p->stats.bytes;
} while (u64_stats_fetch_retry_irq(&p->syncp, start));
tx_b += bytes;
tx_p += packets;
tx_restart += p->tx_stats.restart_queue;
tx_busy += p->tx_stats.tx_busy;
tx_linearize += p->tx_stats.tx_linearize;
tx_force_wb += p->tx_stats.tx_force_wb;
}
}
rcu_read_unlock();
vsi->tx_restart = tx_restart;
Expand Down

0 comments on commit e296826

Please sign in to comment.