[PATCH net-next] virtio_net: Add ethtool stats

2017-12-19 Thread Toshiaki Makita
tx_queue_1_packets: 3084697 tx_queue_1_bytes: 4670196372 Signed-off-by: Toshiaki Makita <makita.toshi...@lab.ntt.co.jp> --- drivers/net/virtio_net.c | 187 ++- 1 file changed, 136 insertions(+), 51 deletions(-) diff --git a/drive

[PATCH net-next] virtio_net: Disable interrupts if napi_complete_done rescheduled napi

2017-12-06 Thread Toshiaki Makita
10^6bits/sec 2129921472 60.00 32794646 06436.49 212992 60.00 32793501 6436.27 Interrupts on guest: 4941299 Packets/interrupt: 6.64 Signed-off-by: Toshiaki Makita <makita.toshi...@lab.ntt.co.jp> --- drivers/net/virtio_net.c | 9 ++--- 1 file c

Re: [PATCH vhost] vhost_net: Fix too many vring kick on busypoll

2018-07-02 Thread Toshiaki Makita
On 2018/07/02 16:52, Jason Wang wrote: > On 2018年07月02日 15:11, Toshiaki Makita wrote: >> On 2018/07/02 15:17, Jason Wang wrote: >>> On 2018年07月02日 12:37, Toshiaki Makita wrote: >>>> On 2018/07/02 11:54, Jason Wang wrote: >>>>> On 2018年07月02日

Re: [PATCH vhost] vhost_net: Fix too many vring kick on busypoll

2018-07-01 Thread Toshiaki Makita
Hi Jason, On 2018/06/29 18:30, Jason Wang wrote: > On 2018年06月29日 16:09, Toshiaki Makita wrote: ... >> To fix this, poll the work instead of enabling notification when >> busypoll is interrupted by something. IMHO signal_pending() and >> vhost_has_work() are kind of inte

Re: [PATCH vhost] vhost_net: Fix too many vring kick on busypoll

2018-07-01 Thread Toshiaki Makita
On 2018/07/02 11:41, Jason Wang wrote: > On 2018年06月30日 00:38, Michael S. Tsirkin wrote: >> On Fri, Jun 29, 2018 at 05:09:50PM +0900, Toshiaki Makita wrote: >>> Under heavy load vhost busypoll may run without suppressing >>> notification. For example tx zerocopy call

Re: [PATCH vhost] vhost_net: Fix too many vring kick on busypoll

2018-07-01 Thread Toshiaki Makita
5.43 >> Recv 4.17 5.26 >> TCP_STREAM 8801.0345794 9592.77 2884 >> >> Signed-off-by: Toshiaki Makita > > Is this with busy poll enabled? Yes, as I wrote "Set 10us busypoll" above. > Are there

Re: [PATCH vhost] vhost_net: Fix too many vring kick on busypoll

2018-07-01 Thread Toshiaki Makita
On 2018/07/02 11:54, Jason Wang wrote: > On 2018年07月02日 10:45, Toshiaki Makita wrote: >> Hi Jason, >> >> On 2018/06/29 18:30, Jason Wang wrote: >>> On 2018年06月29日 16:09, Toshiaki Makita wrote: >> ... >>>> To fix this, poll the work instead of enablin

[PATCH v2 net-next 0/4] vhost_net: Avoid vq kicks during busyloop

2018-07-03 Thread Toshiaki Makita
5.43 Recv 4.17 5.26 TCP_STREAM 8801.0345794 9592.77 2884 v2: - Split patches into 3 parts (renaming variables, tx-kick fix, rx-wakeup fix). - Avoid rx-kicks too (patch 4). - Don't memorize endtime as it is not needed for now. Toshia

[PATCH v2 net-next 1/4] vhost_net: Rename local variables in vhost_net_rx_peek_head_len

2018-07-03 Thread Toshiaki Makita
So we can easily see which variable is for which, tx or rx. Signed-off-by: Toshiaki Makita --- drivers/vhost/net.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 29756d8..3939c50 100644

[PATCH v2 net-next 4/4] vhost_net: Avoid rx vring kicks during busyloop

2018-07-03 Thread Toshiaki Makita
We may run out of avail rx ring descriptor under heavy load but busypoll did not detect it so busypoll may have exited prematurely. Avoid this by checking rx ring full during busypoll. Signed-off-by: Toshiaki Makita --- drivers/vhost/net.c | 10 +++--- 1 file changed, 7 insertions(+), 3

[PATCH v2 net-next 2/4] vhost_net: Avoid tx vring kicks during busyloop

2018-07-03 Thread Toshiaki Makita
is done. Signed-off-by: Toshiaki Makita --- drivers/vhost/net.c | 35 ++- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 3939c50..811c0e5 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c

[PATCH v2 net-next 3/4] vhost_net: Avoid rx queue wake-ups during busypoll

2018-07-03 Thread Toshiaki Makita
-ups, so poll rx work instead of enabling the vq. Signed-off-by: Toshiaki Makita --- drivers/vhost/net.c | 26 +++--- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 811c0e5..791bc8b 100644 --- a/drivers/vhost/net.c

Re: [PATCH v2 net-next 4/4] vhost_net: Avoid rx vring kicks during busyloop

2018-07-03 Thread Toshiaki Makita
On 2018/07/03 18:05, Jason Wang wrote: > On 2018年07月03日 15:31, Toshiaki Makita wrote: >> We may run out of avail rx ring descriptor under heavy load but busypoll >> did not detect it so busypoll may have exited prematurely. Avoid this by >> checking rx ring full during bu

[PATCH v2 net-next] virtio_net: Add ethtool stats

2018-01-16 Thread Toshiaki Makita
-0.32% TCP_STREAM16956.3216890.63 -0.39% UDP_RR 178667.11 185862.70 +4.03% TCP_RR 128473.04 124985.81 -2.71% Signed-off-by: Toshiaki Makita <makita.toshi...@lab.ntt.co.jp> --- v2: - Removed redundant counters which can be obtaine

Re: [PATCH net-next] virtio_net: Add ethtool stats

2017-12-25 Thread Toshiaki Makita
On 2017/12/26 1:47, Florian Fainelli wrote: > On December 25, 2017 3:45:36 AM PST, Toshiaki Makita > <makita.toshi...@lab.ntt.co.jp> wrote: >> On 2017/12/25 3:16, Stephen Hemminger wrote: >>> On Wed, 20 Dec 2017 13:40:37 +0900 >>> Toshiaki Makita &

Re: [PATCH net-next] virtio_net: Add ethtool stats

2017-12-20 Thread Toshiaki Makita
On 2017/12/20 17:13, Jason Wang wrote: > On 2017年12月20日 12:40, Toshiaki Makita wrote: >> The main purpose of this patch is adding a way of checking per-queue >> stats. >> It's useful to debug performance problems on multiqueue environment. >> >> $ e

Re: [PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()

2018-08-02 Thread Toshiaki Makita
emoved). Also, I think we should move vhost_net_enable_vq() from vhost_net_busy_poll() to this last "else" block because this is the case where rx wakeups is required. Anyway this part will be refactored so let's see what this code will look like in next version. -- Toshiaki Makita ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()

2018-08-02 Thread Toshiaki Makita
>>> On 2018年08月03日 10:51, Tonghao Zhang wrote: >>>>>> On Thu, Aug 2, 2018 at 5:23 PM Jason Wang  >>>>>> wrote: >>>>>>> On 2018年08月02日 16:41, Toshiaki Makita wrote: >>>>>>>> On 2018/08/02 17:18, Jason Wa

Re: [PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()

2018-08-02 Thread Toshiaki Makita
On 2018/08/03 12:24, Tonghao Zhang wrote: > On Fri, Aug 3, 2018 at 11:07 AM Jason Wang wrote: >> On 2018年08月03日 10:51, Tonghao Zhang wrote: >>> On Thu, Aug 2, 2018 at 5:23 PM Jason Wang wrote: >>>> On 2018年08月02日 16:41, Toshiaki Makita wrote: >>>&

Re: [PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()

2018-08-02 Thread Toshiaki Makita
On 2018/08/03 13:14, Tonghao Zhang wrote: > On Fri, Aug 3, 2018 at 11:40 AM Toshiaki Makita > wrote: >> >> On 2018/08/03 12:24, Tonghao Zhang wrote: >>> On Fri, Aug 3, 2018 at 11:07 AM Jason Wang wrote: >>>> On 2018年08月03日 10:51, Tonghao Zhang wrote: >

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

2018-07-31 Thread Toshiaki Makita
On 2018/08/01 10:31, Jason Wang wrote: > On 2018年07月31日 17:57, Toshiaki Makita wrote: >> 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(

Re: [PATCH net-next 2/2] virtio-net: get rid of unnecessary container of rq stats

2018-07-31 Thread Toshiaki Makita
On 2018/08/01 10:39, Jason Wang wrote: > On 2018年07月31日 18:02, Toshiaki Makita wrote: >> On 2018/07/31 18:43, Jason Wang wrote: >>> We don't maintain tx counters in rx stats any more. There's no need >>> for an extra container of rq stats. >>> >>> Cc: T

Re: [PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()

2018-08-02 Thread Toshiaki Makita
>> so the network is broken. > > Not sure I understand here. I mean is we schedule work for handle_rx(), > there's no need to enable it since handle_rx() will do this for us. Looks like in the last "else" block in vhost_net_busy_poll_check() we need to enable vq since in that case we have no rx data and handle_rx() is not scheduled. -- Toshiaki Makita ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()

2018-08-02 Thread Toshiaki Makita
On 2018/08/02 18:23, Jason Wang wrote: > On 2018年08月02日 16:41, Toshiaki Makita wrote: >> On 2018/08/02 17:18, Jason Wang wrote: >>> On 2018年08月01日 17:52, Tonghao Zhang wrote: >>>>> +static void vhost_net_busy_poll_check(struct vhost_net *net, >>>>

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

2018-07-31 Thread Toshiaki Makita
ts. 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 ___ Virtualization mailing list V

Re: [PATCH net-next 2/2] virtio-net: get rid of unnecessary container of rq stats

2018-07-31 Thread Toshiaki Makita
On 2018/07/31 18:43, Jason Wang wrote: > We don't maintain tx counters in rx stats any more. There's no need > for an extra container of rq stats. > > Cc: Toshiaki Makita > Signed-off-by: Jason Wang > --- > drivers/net/virtio_net.c | 80 > ++---

Re: [PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()

2018-07-23 Thread Toshiaki Makita
On 2018/07/24 2:31, Tonghao Zhang wrote: > On Mon, Jul 23, 2018 at 10:20 PM Toshiaki Makita > wrote: >> >> On 18/07/23 (月) 21:43, Tonghao Zhang wrote: >>> On Mon, Jul 23, 2018 at 5:58 PM Toshiaki Makita >>> wrote: >>>> >>>> On 2018/07/

Re: [PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()

2018-07-23 Thread Toshiaki Makita
On 2018/07/24 12:28, Tonghao Zhang wrote: > On Tue, Jul 24, 2018 at 10:53 AM Toshiaki Makita > wrote: >> >> On 2018/07/24 2:31, Tonghao Zhang wrote: >>> On Mon, Jul 23, 2018 at 10:20 PM Toshiaki Makita >>> wrote: >>>> >>>> On 18/07/2

Re: [PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()

2018-07-23 Thread Toshiaki Makita
if (unlikely(vhost_enable_notify(>dev, rvq))) { vhost_disable_notify(>dev, rvq); vhost_poll_queue(>poll); } } Also it's better to care vhost_net_disable_vq()/vhost_net_enable_vq() on tx? -- Toshiaki Makita ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH net-next v5 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()

2018-07-04 Thread Toshiaki Makita
ot needed. Do you want this actually? } else if (rx && vhost_enable_notify(>dev, vq)) { > + vhost_disable_notify(>dev, vq); > + vhost_poll_queue(>poll); > + } -- Toshiaki Makita ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[PATCH vhost] vhost_net: Fix too many vring kick on busypoll

2018-06-29 Thread Toshiaki Makita
6 TCP_STREAM 8801.0345794 9592.77 2884 Signed-off-by: Toshiaki Makita --- drivers/vhost/net.c | 94 +++ drivers/vhost/vhost.c | 1 + drivers/vhost/vhost.h | 1 + 3 files changed, 66 insertions(+), 30 deletions(-) diff --git a/d

Re: [RFC] virtio_net: add local_bh_disable() around u64_stats_update_begin

2018-10-16 Thread Toshiaki Makita
rio: > | > |CPU0 > | > | lock(>seq#2); > | > | lock(>seq#2); > | > | *** DEADLOCK *** IIUC try_fill_recv is called only when NAPI is disabled from process context, so there should be no point to race with virtnet_receive which is called

Re: [RFC] virtio_net: add local_bh_disable() around u64_stats_update_begin

2018-10-18 Thread Toshiaki Makita
On 2018/10/18 18:08, Sebastian Andrzej Siewior wrote: > On 2018-10-18 18:00:05 [+0900], Toshiaki Makita wrote: >> On 2018/10/18 17:47, Sebastian Andrzej Siewior wrote: >>> On 2018-10-17 14:48:02 [+0800], Jason Wang wrote: >>>> >>>> On 2018/10/17 上午9:13,

Re: [RFC] virtio_net: add local_bh_disable() around u64_stats_update_begin

2018-10-18 Thread Toshiaki Makita
On 2018/10/18 17:47, Sebastian Andrzej Siewior wrote: > On 2018-10-17 14:48:02 [+0800], Jason Wang wrote: >> >> On 2018/10/17 上午9:13, Toshiaki Makita wrote: >>> I'm not sure what condition triggered this warning. > > If the seqlock is acquired once in softirq and t

Re: [PATCH] virtio_net: add local_bh_disable() around u64_stats_update_begin

2018-10-18 Thread Toshiaki Makita
Hemminger > Signed-off-by: Sebastian Andrzej Siewior NACK. Again, this race should not happen because of NAPI guard. We need to investigate why this warning happened. -- Toshiaki Makita ___ Virtualization mailing list Virtualization@lists.linux-f

Re: [PATCH] virtio_net: add local_bh_disable() around u64_stats_update_begin

2018-10-18 Thread Toshiaki Makita
On 2018/10/18 18:11, Sebastian Andrzej Siewior wrote: > On 2018-10-18 18:06:57 [+0900], Toshiaki Makita wrote: >> NACK. Again, this race should not happen because of NAPI guard. >> We need to investigate why this warning happened. > > I tried to explain this. Please see &

Re: [RFC] virtio_net: add local_bh_disable() around u64_stats_update_begin

2018-10-18 Thread Toshiaki Makita
On 2018/10/18 18:30, Sebastian Andrzej Siewior wrote: > On 2018-10-18 18:19:21 [+0900], Toshiaki Makita wrote: >> On 2018/10/18 18:08, Sebastian Andrzej Siewior wrote: >>> Again: lockdep saw the lock in softirq context once and in process >>> context once and this i

[PATCH net 7/7] virtio_net: Differentiate sk_buff and xdp_frame on freeing

2019-01-17 Thread Toshiaki Makita
to keep skipping free_old_xmit_skbs() from NAPI handlers when XDP is enabled, because XDP tx queues do not aquire queue locks. Fixes: 4941d472bf95 ("virtio-net: do not reset during XDP set") Signed-off-by: Toshiaki Makita --- drivers/net/virtio_

[PATCH net 6/7] virtio_net: Use xdp_return_frame to free xdp_frames on destroying vqs

2019-01-17 Thread Toshiaki Makita
put_page() can work as a fallback for freeing xdp_frames, but the appropriate way is to use xdp_return_frame(). Fixes: cac320c850ef ("virtio_net: convert to use generic xdp_frame and xdp_return_frame API") Signed-off-by: Toshiaki Makita --- drivers/net/virtio_net.c | 2 +- 1 file

[PATCH net 5/7] virtio_net: Don't process redirected XDP frames when XDP is disabled

2019-01-17 Thread Toshiaki Makita
values. Thus, when disabling XDP, assign NULL to rq->xdp_prog first, and wait for RCU grace period, then change xxx_queue_pairs. Note that we need to keep the current order when enabling XDP though. Fixes: 186b3c998c50 ("virtio-net: support XDP_REDIRECT") Signed-off-by: Toshiaki Makit

[PATCH net 2/7] virtio_net: Don't call free_old_xmit_skbs for xdp_frames

2019-01-17 Thread Toshiaki Makita
so virtnet_poll_tx() can safely access curr_queue_pairs and xdp_queue_pairs, which are not atomically updated while disabling XDP. Fixes: b92f1e6751a6 ("virtio-net: transmit napi") Fixes: 7b0411ef4aa6 ("virtio-net: clean tx descriptors from rx napi") Signed-off-by: Toshiaki Makita --- d

[PATCH net 3/7] virtio_net: Fix not restoring real_num_rx_queues

2019-01-17 Thread Toshiaki Makita
Signed-off-by: Toshiaki Makita --- drivers/net/virtio_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 7d35e6d..670cc15 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -2427,10 +2427,10 @@

[PATCH net 4/7] virtio_net: Fix out of bounds access of sq

2019-01-17 Thread Toshiaki Makita
stats") Signed-off-by: Toshiaki Makita --- drivers/net/virtio_net.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 670cc15..204eedf 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/vi

[PATCH net 0/7] virtio_net: Fix problems around XDP tx and napi_tx

2019-01-17 Thread Toshiaki Makita
a normal queue is reused for XDP and vise versa. Signed-off-by: Toshiaki Makita Toshiaki Makita (7): virtio_net: Don't enable NAPI when interface is down virtio_net: Don't call free_old_xmit_skbs for xdp_frames virtio_net: Fix not restoring real_num_rx_queues virtio_net: Fix out of bounds

[PATCH net 1/7] virtio_net: Don't enable NAPI when interface is down

2019-01-17 Thread Toshiaki Makita
NAPI twice on virtnet_open(), which would trigger BUG_ON() in napi_enable(). Fixes: 4941d472bf95b ("virtio-net: do not reset during XDP set") Signed-off-by: Toshiaki Makita --- drivers/net/virtio_net.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio

Re: [PATCH net 2/7] virtio_net: Don't call free_old_xmit_skbs for xdp_frames

2019-01-18 Thread Toshiaki Makita
On 2019/01/17 21:39, Jason Wang wrote: > On 2019/1/17 下午7:20, Toshiaki Makita wrote: >> When napi_tx is enabled, virtnet_poll_cleantx() called >> free_old_xmit_skbs() even for xdp send queue. >> This is bogus since the queue has xdp_frames, not sk_buffs, thus mangled >&g

Re: [PATCH net 5/7] virtio_net: Don't process redirected XDP frames when XDP is disabled

2019-01-18 Thread Toshiaki Makita
On 2019/01/18 12:52, Jason Wang wrote: > On 2019/1/18 上午9:56, Toshiaki Makita wrote: >> On 2019/01/17 22:05, Jason Wang wrote: >>> On 2019/1/17 下午8:53, Jason Wang wrote: >>>> On 2019/1/17 下午7:20, Toshiaki Makita wrote: >>>>> Commit 8dcc5b0ab0ec

Re: [PATCH net 0/7] virtio_net: Fix problems around XDP tx and napi_tx

2019-01-18 Thread Toshiaki Makita
On 2019/01/17 23:55, Michael S. Tsirkin wrote: > On Thu, Jan 17, 2019 at 08:20:38PM +0900, Toshiaki Makita wrote: >> While I'm looking into how to account standard tx counters on XDP tx >> processing, I found several bugs around XDP tx and napi_tx. >> >> Patch1: Fix

Re: [PATCH net 5/7] virtio_net: Don't process redirected XDP frames when XDP is disabled

2019-01-18 Thread Toshiaki Makita
On 2019/01/17 22:05, Jason Wang wrote: > On 2019/1/17 下午8:53, Jason Wang wrote: >> On 2019/1/17 下午7:20, Toshiaki Makita wrote: >>> Commit 8dcc5b0ab0ec ("virtio_net: fix ndo_xdp_xmit crash towards dev not >>> ready for XDP") tried to avoid access to un

[PATCH v2 net 5/7] virtio_net: Don't process redirected XDP frames when XDP is disabled

2019-01-28 Thread Toshiaki Makita
. Fixes: 186b3c998c50 ("virtio-net: support XDP_REDIRECT") Signed-off-by: Toshiaki Makita --- drivers/net/virtio_net.c | 33 ++--- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 669b65c..

[PATCH v2 net 4/7] virtio_net: Fix out of bounds access of sq

2019-01-28 Thread Toshiaki Makita
stats") Signed-off-by: Toshiaki Makita Acked-by: Jason Wang Acked-by: Michael S. Tsirkin --- drivers/net/virtio_net.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 0e1a369..669b65c 100644 ---

[PATCH v2 net 2/7] virtio_net: Don't call free_old_xmit_skbs for xdp_frames

2019-01-28 Thread Toshiaki Makita
so virtnet_poll_tx() can safely access curr_queue_pairs and xdp_queue_pairs, which are not atomically updated while disabling XDP. Fixes: b92f1e6751a6 ("virtio-net: transmit napi") Fixes: 7b0411ef4aa6 ("virtio-net: clean tx descriptors from rx napi") Signed-off-by: Toshiaki Makita Acke

[PATCH v2 net 3/7] virtio_net: Fix not restoring real_num_rx_queues

2019-01-28 Thread Toshiaki Makita
Signed-off-by: Toshiaki Makita Acked-by: Jason Wang Acked-by: Michael S. Tsirkin --- drivers/net/virtio_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 046f955..0e1a369 100644 --- a/drivers/net/virtio_net.c +++ b/d

[PATCH v2 net 6/7] virtio_net: Use xdp_return_frame to free xdp_frames on destroying vqs

2019-01-28 Thread Toshiaki Makita
put_page() can work as a fallback for freeing xdp_frames, but the appropriate way is to use xdp_return_frame(). Fixes: cac320c850ef ("virtio_net: convert to use generic xdp_frame and xdp_return_frame API") Signed-off-by: Toshiaki Makita Acked-by: Jason Wang Acked-by: Jesper Danga

[PATCH v2 net 0/7] virtio_net: Fix problems around XDP tx and napi_tx

2019-01-28 Thread Toshiaki Makita
a normal queue is reused for XDP and vise versa. v2: - patch5: Make rcu_assign_pointer/synchronize_net conditional instead of _virtnet_set_queues. - patch7: Use napi_consume_skb() instead of dev_consume_skb_any() Signed-off-by: Toshiaki Makita Toshiaki Makita (7): virtio_net: Don't

[PATCH v2 net 1/7] virtio_net: Don't enable NAPI when interface is down

2019-01-28 Thread Toshiaki Makita
NAPI twice on virtnet_open(), which would trigger BUG_ON() in napi_enable(). Fixes: 4941d472bf95b ("virtio-net: do not reset during XDP set") Signed-off-by: Toshiaki Makita Acked-by: Jason Wang Acked-by: Michael S. Tsirkin --- drivers/net/virtio_net.c | 6 -- 1 file changed, 4 insertions(+),

Re: [PATCH v2 net 7/7] virtio_net: Differentiate sk_buff and xdp_frame on freeing

2019-01-28 Thread Toshiaki Makita
On 2019/01/29 11:23, Jason Wang wrote: > On 2019/1/29 上午8:45, Toshiaki Makita wrote: ... >> @@ -2666,10 +2696,10 @@ static void free_unused_bufs(struct >> virtnet_info *vi) >>   for (i = 0; i < vi->max_queue_pairs; i++) { >>   struct virtqueue *vq =

[PATCH v2 net 7/7] virtio_net: Differentiate sk_buff and xdp_frame on freeing

2019-01-28 Thread Toshiaki Makita
to keep skipping free_old_xmit_skbs() from NAPI handlers when XDP is enabled, because XDP tx queues do not aquire queue locks. - v2: Use napi_consume_skb() instead of dev_consume_skb_any() Fixes: 4941d472bf95 ("virtio-net: do not reset during XDP set") Signed-off-by: Toshiaki Makita

[PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-01-31 Thread Toshiaki Makita
Previously virtnet_xdp_xmit() did not account for device tx counters, which caused confusions. To be consistent with SKBs, account them on freeing xdp_frames. Reported-by: David Ahern Signed-off-by: Toshiaki Makita --- drivers/net/virtio_net.c | 20 1 file changed, 16

Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-02-01 Thread Toshiaki Makita
On 2019/02/01 5:15, Jesper Dangaard Brouer wrote: > On Thu, 31 Jan 2019 09:45:23 -0800 (PST) > David Miller wrote: > >> From: "Michael S. Tsirkin" >> Date: Thu, 31 Jan 2019 10:25:17 -0500 >> >>> On Thu, Jan 31, 2019 at 08:40:30PM +0900, Toshiaki Ma