Skip to content

Commit 1140c87

Browse files
david-marchandigsilya
authored andcommitted
netdev-dpdk: Expose per rxq/txq basic statistics.
When troubleshooting multiqueue setups, having per queue statistics helps checking packets repartition in rx and tx queues. Per queue statistics are exported by most DPDK drivers (with capability RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS). OVS only filters DPDK statistics, there is nothing to request in DPDK API. So the only change is to extend the filter on xstats. Querying statistics with $ ovs-vsctl get interface dpdk0 statistics | sed -e 's#[{}]##g' -e 's#, #\n#g' and comparing gives: @@ -13,7 +13,12 @@ rx_phy_crc_errors=0 rx_phy_in_range_len_errors=0 rx_phy_symbol_errors=0 +rx_q0_bytes=0 rx_q0_errors=0 +rx_q0_packets=0 +rx_q1_bytes=0 rx_q1_errors=0 +rx_q1_packets=0 rx_wqe_errors=0 tx_broadcast_packets=0 tx_bytes=0 @@ -27,3 +32,13 @@ tx_pp_rearm_queue_errors=0 tx_pp_timestamp_future_errors=0 tx_pp_timestamp_past_errors=0 +tx_q0_bytes=0 +tx_q0_packets=0 +tx_q1_bytes=0 +tx_q1_packets=0 +tx_q2_bytes=0 +tx_q2_packets=0 +tx_q3_bytes=0 +tx_q3_packets=0 +tx_q4_bytes=0 +tx_q4_packets=0 Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Kevin Traynor <ktraynor@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
1 parent f260db1 commit 1140c87

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

lib/netdev-dpdk.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,16 @@ netdev_dpdk_get_xstat_name(struct netdev_dpdk *dev, uint64_t id)
15831583
return dev->rte_xstats_names[id].name;
15841584
}
15851585

1586+
static bool
1587+
is_queue_stat(const char *s)
1588+
{
1589+
uint16_t tmp;
1590+
1591+
return (s[0] == 'r' || s[0] == 't') &&
1592+
(ovs_scan(s + 1, "x_q%"SCNu16"_packets", &tmp) ||
1593+
ovs_scan(s + 1, "x_q%"SCNu16"_bytes", &tmp));
1594+
}
1595+
15861596
static void
15871597
netdev_dpdk_configure_xstats(struct netdev_dpdk *dev)
15881598
OVS_REQUIRES(dev->mutex)
@@ -1633,9 +1643,10 @@ netdev_dpdk_configure_xstats(struct netdev_dpdk *dev)
16331643
id = rte_xstats[i].id;
16341644
name = netdev_dpdk_get_xstat_name(dev, id);
16351645

1636-
/* We need to filter out everything except dropped, error and
1637-
* management counters. */
1638-
if (string_ends_with(name, "_errors") ||
1646+
/* For custom stats, we filter out everything except per rxq/txq basic
1647+
* stats, and dropped, error and management counters. */
1648+
if (is_queue_stat(name) ||
1649+
string_ends_with(name, "_errors") ||
16391650
strstr(name, "_management_") ||
16401651
string_ends_with(name, "_dropped")) {
16411652

0 commit comments

Comments
 (0)