[ovs-dev] [RFC PATCH] netdev-dpdk: Expose per rxq/txq basic statistics.

Kevin Traynor ktraynor at redhat.com
Fri Nov 19 12:08:36 UTC 2021


On 19/11/2021 10:31, David Marchand wrote:
> On Fri, Nov 19, 2021 at 10:40 AM Maxime Coquelin
> <maxime.coquelin at redhat.com> wrote:
>>
>> Hi Kevin, David,
>>
>> On 11/18/21 16:31, Kevin Traynor wrote:
>>> On 15/10/2021 16:04, David Marchand wrote:
>>>> 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). But since OVS only filters statistics
>>>> it exposes, there is nothing to request in DPDK API.
>>>>
>>>> Extend existing filter with a regular expression.
>>>> string_ends_with() helper is not used anymore, and removed as a
>>>> consequence.
>>>>
>>>> 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 at redhat.com>
>>>
>>> The patch looks good but I tested with with ixgbe, and seeing something
>>> I am unsure of. I changed the number of rxqs to 11 but I am only seeing
>>> stats for q0. i'm not sure if this because there was no traffic yet
>>> (even though there is also no traffic on q0). i will set up a traffic
>>> gen and see what happens when the q1-q10 receives traffic.
>>
>> I think the problem is that when port reconfiguration is called because
>> the number of queues changed, netdev_dpdk_clear_xstats() is not called.
>>
>> So the next time netdev_dpdk_configure_xstats() is called, it returns
>> true early as it is already configured. So old configuration is keeped.
>>
>> When increasing the number of queues, I think we get your behavior, i.e.
>> only previous number of queues counters are disaplayed. But when
>> decreasing the number of queues, I think rte_eth_xstats_get_by_id() will
>> fail.
>>
>> I think calling netdev_dpdk_clear_xstats() in netdev_dpdk_reconfigure()
>> should fix your issue.
> 
> Thanks for the analysis.
> 
> I'll need a bit more time to dig in (I don't understand the logic
> behind the configure_xstats/clear_xstats stuff).
> In any case, it seems this is a bug predating my patch.
> 
> 

Thanks Maxime. Yes, that seems to be explanation for it.

The issue was also present with the txqs when the number of PMDs was 
increased/decreased, hence changing requested txqs. I added below and it 
is showing the right amount of rx/tx queues now.

I'm not sure it's an existing bug that we'd backport a fix for as the 
num queues changing wouldn't have previously impacted because of the 
filter. It seems more like a short cut that we now can't keep :-)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index ca92c947a..720041c34 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -1876,4 +1876,5 @@ dpdk_set_rxq_config(struct netdev_dpdk *dev, const 
struct smap *args)
          dev->requested_n_rxq = new_n_rxq;
          netdev_request_reconfigure(&dev->up);
+        netdev_dpdk_clear_xstats(dev);
      }
  }
@@ -2109,4 +2110,5 @@ netdev_dpdk_set_tx_multiq(struct netdev *netdev, 
unsigned int n_txq)
      dev->requested_n_txq = n_txq;
      netdev_request_reconfigure(netdev);
+    netdev_dpdk_clear_xstats(dev);



More information about the dev mailing list