<div dir="ltr"><div>Hello again,</div><div><br></div><div>The flag is already set during the device init, so it should be removed, not added.</div><div>I can confirm removing it fixed my issue.</div><div><br></div><div>I will submit a patch for this bug.</div><div><br></div><div>Regards,</div><div>Edwin Brossette.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 24, 2023 at 11:39 AM Maxime Coquelin <<a href="mailto:maxime.coquelin@redhat.com">maxime.coquelin@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Edwin,<br>
<br>
Thanks for reporting the issue.<br>
<br>
On 11/24/23 10:26, Olivier Matz wrote:<br>
> Fix Maxime's mail.<br>
<br>
Thanks Olivier.<br>
<br>
> On Fri, Nov 24, 2023 at 10:18:27AM +0100, Edwin Brossette wrote:<br>
>> Hello,<br>
>><br>
>> I noticed a small inconsistency in the virtio pmd's xstats.<br>
>> The stat "rx_q0_errors" appears twice.<br>
>> I also think the stats "rx_q0_packets", "rx_q0_bytes", "tx_q0_packets" and<br>
>> "tx_q0_bytes" are duplicates of "rx_q0_good_packets", "rx_q0_good_bytes",<br>
>> "tx_q0_good_packets" and "tx_q0_good_bytes"<br>
>><br>
>> I believe this issue probably appeared after this commit:<br>
>><br>
>> f30e69b41f94: ethdev: add device flag to bypass auto-filled queue xstats<br>
>> <a href="http://scm.6wind.com/vendor/dpdk.org/dpdk/commit/?id=f30e69b41f949cd4a9afb6ff39de196e661708e2" rel="noreferrer" target="_blank">http://scm.6wind.com/vendor/dpdk.org/dpdk/commit/?id=f30e69b41f949cd4a9afb6ff39de196e661708e2</a><br>
<br>
Adding Ferruh as he is the author of this commit.<br>
<br>
>>  From what I understand, the rxq0_error stat was originally reported by the<br>
>> librte. However, changes were made so it is reported by the pmd instead.<br>
>> The flag RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS was temporarily set to keep the<br>
>> old behaviour so that every pmd could have time to adapt the change.<br>
>> But it seems the flag was forgotten in the virtio pmd and as a result, some<br>
>> stats are fetched at two different times when displaying xstats.<br>
<br>
Have you tried adding this flag to Virtio PMD? Does it fixes the issue?<br>
<br>
>> First in lib_rte_ethdev:<br>
>> <a href="https://git.dpdk.org/dpdk/tree/lib/ethdev/rte_ethdev.c#n3266" rel="noreferrer" target="_blank">https://git.dpdk.org/dpdk/tree/lib/ethdev/rte_ethdev.c#n3266</a><br>
>> (you can see the check on the RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS flag before<br>
>> the snprintf on eth_dev_rxq_stats_strings[] )<br>
>><br>
>> And a second time in the virtio pmd:<br>
>> <a href="https://git.dpdk.org/dpdk/tree/drivers/net/virtio/virtio_ethdev.c#n705" rel="noreferrer" target="_blank">https://git.dpdk.org/dpdk/tree/drivers/net/virtio/virtio_ethdev.c#n705</a> pmd<br>
>> (see the snprintf on rte_virtio_rxq_stat_strings[] )<br>
>><br>
>> This problem can be reproduced on testpmd simply by displaying the xstats<br>
>> on a port with the net_virtio driver:<br>
>><br>
>> Reproduction:<br>
>> ===========<br>
>><br>
>>      1) start dpdk-testpmd:<br>
>><br>
>> modprobe -a uio_pci_generic<br>
>> dpdk-devbind -b uio_pci_generic 03:00.0<br>
>> dpdk-devbind -b uio_pci_generic 04:00.0<br>
>><br>
>> dpdk-devbind -s<br>
>><br>
>> Network devices using DPDK-compatible driver<br>
>> ============================================<br>
>> 0000:03:00.0 'Virtio 1.0 network device 1041' drv=uio_pci_generic<br>
>> unused=vfio-pci<br>
>> 0000:04:00.0 'Virtio 1.0 network device 1041' drv=uio_pci_generic<br>
>> unused=vfio-pci<br>
>> [...]<br>
>><br>
>> dpdk-testpmd -a 0000:03:00.0 -a 0000:04:00.0 -- -i --rxq=1 --txq=1<br>
>> --coremask=0x4 --total-num-mbufs=250000<br>
>> EAL: Detected CPU lcores: 3<br>
>> EAL: Detected NUMA nodes: 1<br>
>> EAL: Detected static linkage of DPDK<br>
>> EAL: Multi-process socket /var/run/dpdk/rte/mp_socket<br>
>> EAL: Selected IOVA mode 'PA'<br>
>> EAL: VFIO support initialized<br>
>> EAL: Probe PCI driver: net_virtio (1af4:1041) device: 0000:03:00.0 (socket<br>
>> -1)<br>
>> EAL: Probe PCI driver: net_virtio (1af4:1041) device: 0000:04:00.0 (socket<br>
>> -1)<br>
>> Interactive-mode selected<br>
>> Warning: NUMA should be configured manually by using --port-numa-config and<br>
>> --ring-numa-config parameters along with --numa.<br>
>> testpmd: create a new mbuf pool <mb_pool_0>: n=250000, size=2176, socket=0<br>
>> testpmd: preferred mempool ops selected: ring_mp_mc<br>
>> Configuring Port 0 (socket 0)<br>
>> Port 0: 52:54:00:B0:8F:88<br>
>> Configuring Port 1 (socket 0)<br>
>> Port 1: 52:54:00:EF:09:1F<br>
>> Checking link statuses...<br>
>> Done<br>
>><br>
>>      2) port info:<br>
>><br>
>> show port info 0<br>
>><br>
>> ********************* Infos for port 0  *********************<br>
>> MAC address: 52:54:00:B0:8F:88<br>
>> Device name: 0000:03:00.0<br>
>> Driver name: net_virtio<br>
>> Firmware-version: not available<br>
>> Devargs:<br>
>> Connect to socket: 0<br>
>> memory allocation on the socket: 0<br>
>> Link status: up<br>
>> Link speed: Unknown<br>
>> Link duplex: full-duplex<br>
>> Autoneg status: On<br>
>> MTU: 1500<br>
>> Promiscuous mode: enabled<br>
>> Allmulticast mode: disabled<br>
>> Maximum number of MAC addresses: 64<br>
>> Maximum number of MAC addresses of hash filtering: 0<br>
>> VLAN offload:<br>
>>    strip off, filter off, extend off, qinq strip off<br>
>> No RSS offload flow type is supported.<br>
>> Minimum size of RX buffer: 64<br>
>> Maximum configurable length of RX packet: 9728<br>
>> Maximum configurable size of LRO aggregated packet: 0<br>
>> Current number of RX queues: 1<br>
>> Max possible RX queues: 1<br>
>> Max possible number of RXDs per queue: 32768<br>
>> Min possible number of RXDs per queue: 32<br>
>> RXDs number alignment: 1<br>
>> Current number of TX queues: 1<br>
>> Max possible TX queues: 1<br>
>> Max possible number of TXDs per queue: 32768<br>
>> Min possible number of TXDs per queue: 32<br>
>> TXDs number alignment: 1<br>
>> Max segment number per packet: 65535<br>
>> Max segment number per MTU/TSO: 65535<br>
>> Device capabilities: 0x0( )<br>
>> Device error handling mode: none<br>
>> Device private info:<br>
>> guest_features: 0x110af8020<br>
>> vtnet_hdr_size: 12<br>
>> use_vec: rx-0 tx-0<br>
>> use_inorder: rx-0 tx-0<br>
>> intr_lsc: 1<br>
>> max_mtu: 9698<br>
>> max_rx_pkt_len: 1530<br>
>> max_queue_pairs: 1<br>
>> req_guest_features: 0x8000005f10ef8028<br>
>><br>
>>      3) show port xstats:<br>
>><br>
>> show port xstats 0<br>
>> ###### NIC extended statistics for port 0<br>
>> rx_good_packets: 0<br>
>> tx_good_packets: 0<br>
>> rx_good_bytes: 0<br>
>> tx_good_bytes: 0<br>
>> rx_missed_errors: 0<br>
>> rx_errors: 0<br>
>> tx_errors: 0<br>
>> rx_mbuf_allocation_errors: 0<br>
>> rx_q0_packets: 0<br>
>> rx_q0_bytes: 0<br>
>> rx_q0_errors: 0      <==================<br>
>> tx_q0_packets: 0<br>
>> tx_q0_bytes: 0<br>
>> rx_q0_good_packets: 0<br>
>> rx_q0_good_bytes: 0<br>
>> rx_q0_errors: 0      <==================<br>
>> rx_q0_multicast_packets: 0<br>
>> rx_q0_broadcast_packets: 0<br>
>> rx_q0_undersize_packets: 0<br>
>> rx_q0_size_64_packets: 0<br>
>> rx_q0_size_65_127_packets: 0<br>
>> rx_q0_size_128_255_packets: 0<br>
>> rx_q0_size_256_511_packets: 0<br>
>> rx_q0_size_512_1023_packets: 0<br>
>> rx_q0_size_1024_1518_packets: 0<br>
>> rx_q0_size_1519_max_packets: 0<br>
>> tx_q0_good_packets: 0<br>
>> tx_q0_good_bytes: 0<br>
>> tx_q0_multicast_packets: 0<br>
>> tx_q0_broadcast_packets: 0<br>
>> tx_q0_undersize_packets: 0<br>
>> tx_q0_size_64_packets: 0<br>
>> tx_q0_size_65_127_packets: 0<br>
>> tx_q0_size_128_255_packets: 0<br>
>> tx_q0_size_256_511_packets: 0<br>
>> tx_q0_size_512_1023_packets: 0<br>
>> tx_q0_size_1024_1518_packets: 0<br>
>> tx_q0_size_1519_max_packets: 0<br>
>><br>
>> You can see the stat "rx_q0_errors" appeared twice.<br>
> <br>
<br>
If simply adding the flag solves your issue, do you plan to submit a<br>
patch?<br>
<br>
If not, could you please file a Bz in the upstream bug tracker so that<br>
we don't lose track of this bug?<br>
<br>
Best regards,<br>
Maxime<br>
<br>
</blockquote></div>