All of lore.kernel.org
 help / color / mirror / Atom feed
From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
To: Jason Wang <jasowang@redhat.com>
Cc: mst@redhat.com, virtualization@lists.linux-foundation.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] virtio-net: correctly update XDP_TX counters
Date: Tue, 31 Jul 2018 18:57:21 +0900	[thread overview]
Message-ID: <2cdb8081-90a8-3a87-b6a6-4395825594a1@lab.ntt.co.jp> (raw)
In-Reply-To: <1533030219-9904-1-git-send-email-jasowang@redhat.com>

On 2018/07/31 18:43, Jason Wang wrote:
> 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.

-- 
Toshiaki Makita


WARNING: multiple messages have this Message-ID (diff)
From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
To: Jason Wang <jasowang@redhat.com>
Cc: netdev@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, mst@redhat.com
Subject: Re: [PATCH net-next 1/2] virtio-net: correctly update XDP_TX counters
Date: Tue, 31 Jul 2018 18:57:21 +0900	[thread overview]
Message-ID: <2cdb8081-90a8-3a87-b6a6-4395825594a1@lab.ntt.co.jp> (raw)
In-Reply-To: <1533030219-9904-1-git-send-email-jasowang@redhat.com>

On 2018/07/31 18:43, Jason Wang wrote:
> 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.

-- 
Toshiaki Makita

  parent reply	other threads:[~2018-07-31  9:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-31  9:43 [PATCH net-next 1/2] virtio-net: correctly update XDP_TX counters Jason Wang
2018-07-31  9:43 ` [PATCH net-next 2/2] virtio-net: get rid of unnecessary container of rq stats Jason Wang
2018-07-31  9:43 ` Jason Wang
2018-07-31 10:02   ` Toshiaki Makita
2018-07-31 10:02     ` Toshiaki Makita
2018-08-01  1:39     ` Jason Wang
2018-08-01  1:39       ` Jason Wang
2018-08-01  1:46       ` Toshiaki Makita
2018-08-01  1:46         ` Toshiaki Makita
2018-07-31 11:22   ` Michael S. Tsirkin
2018-07-31 11:22   ` Michael S. Tsirkin
2018-07-31 17:03   ` David Miller
2018-07-31 17:03   ` David Miller
2018-07-31  9:57 ` Toshiaki Makita [this message]
2018-07-31  9:57   ` [PATCH net-next 1/2] virtio-net: correctly update XDP_TX counters Toshiaki Makita
2018-08-01  1:31   ` Jason Wang
2018-08-01  1:31     ` Jason Wang
2018-08-01  1:42     ` Toshiaki Makita
2018-08-01  1:42       ` Toshiaki Makita
2018-07-31 11:22 ` Michael S. Tsirkin
2018-07-31 11:22   ` Michael S. Tsirkin
2018-07-31 17:03 ` David Miller
2018-07-31 17:03   ` David Miller
2018-07-31  9:43 Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2cdb8081-90a8-3a87-b6a6-4395825594a1@lab.ntt.co.jp \
    --to=makita.toshiaki@lab.ntt.co.jp \
    --cc=jasowang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.