From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toshiaki Makita Subject: Re: consistency for statistics with XDP mode Date: Tue, 27 Nov 2018 16:04:49 +0900 Message-ID: <41bbe7c8-4435-ec8a-316e-36a8428f34a9@lab.ntt.co.jp> References: <1d9a6548-4d1d-6624-e808-6ab0460a8655@gmail.com> <30c14d9e-5ae7-b02f-9db9-db2590714e7d@lab.ntt.co.jp> <05db5e18-acd5-772b-3620-820fe82be5a9@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: =?UTF-8?Q?Pawe=c5=82_Staszewski?= , Jesper Dangaard Brouer , Saeed Mahameed , Jason Wang , "Michael S. Tsirkin" , David Miller To: David Ahern , "netdev@vger.kernel.org" Return-path: Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]:43153 "EHLO tama50.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727537AbeK0SDD (ORCPT ); Tue, 27 Nov 2018 13:03:03 -0500 In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 2018/11/26 10:37, Toshiaki Makita wrote: > On 2018/11/23 1:43, David Ahern wrote: >> On 11/21/18 5:53 PM, Toshiaki Makita wrote: >>>> We really need consistency in the counters and at a minimum, users >>>> should be able to track packet and byte counters for both Rx and Tx >>>> including XDP. >>>> >>>> It seems to me the Rx and Tx packet, byte and dropped counters returned >>>> for the standard device stats (/proc/net/dev, ip -s li show, ...) should >>>> include all packets managed by the driver regardless of whether they are >>>> forwarded / dropped in XDP or go up the Linux stack. This also aligns >>> >>> Agreed. When I introduced virtio_net XDP counters, I just forgot to >>> update tx packets/bytes counters on ndo_xdp_xmit. Probably I thought it >>> is handled by free_old_xmit_skbs. >> >> Do you have some time to look at adding the Tx counters to virtio_net? > > hoping I can make some time within a couple of days. Hmm... It looks like free_old_xmit_skbs() calls dev_consume_skb_any() for xdp_frame when napi_tx is enabled. I will fix this beforehand. -- Toshiaki Makita