Thread (12 messages) 12 messages, 4 authors, 2018-08-01

Re: [PATCH net-next 1/2] virtio-net: correctly update XDP_TX counters

From: Toshiaki Makita <hidden>
Date: 2018-08-01 01:43:26
Also in: lkml, virtualization

On 2018/08/01 10:31, Jason Wang wrote:
On 2018年07月31日 17:57, Toshiaki Makita wrote:
quoted
On 2018/07/31 18:43, Jason Wang wrote:
quoted
Commit 5b8f3c8d30a6 ("virtio_net: Add XDP related stats") tries to
count TX XDP stats in virtnet_receive(). This will cause several
issues:

- virtnet_xdp_sq() was called without checking whether or not XDP is
   set. This may cause out of bound access when there's no enough txq
   for XDP.
- Stats were updated even if there's no XDP/XDP_TX.>
Fixing this by reusing virtnet_xdp_xmit() for XDP_TX which can counts
TX XDP counter itself and remove the unnecessary tx stats embedded in
rx stats.
Thanks for fixing this.
I wanted to avoid calling u64_stats_update_begin() (i.e. smp_wmb() in 32
bit systems) for every packet. So I'd like to keep sq stats in
virtnet_rx_stats.
We can optimize this by adding batching on top. (virtnet_xdp_xmit()
accepts an array of xdp frames). If you like, please send a patch for this.
Yes, that sounds like a better optimization. will think about it...

Thanks,
Toshiaki Makita

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help