From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesper Dangaard Brouer Subject: Re: [bpf-next V4 PATCH 3/8] xdp: add tracepoint for devmap like cpumap have Date: Wed, 23 May 2018 17:04:53 +0200 Message-ID: <20180523170453.0824ca1a@redhat.com> References: <152665044141.21055.1276346542020340263.stgit@firesoul> <152665048683.21055.2555532949856555388.stgit@firesoul> <4345d6a2-935d-e206-e309-b63825f880b8@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, Daniel Borkmann , Alexei Starovoitov , Christoph Hellwig , =?UTF-8?B?QmrDtnJuVMO2cGVs?= , Magnus Karlsson , makita.toshiaki@lab.ntt.co.jp, brouer@redhat.com To: John Fastabend Return-path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60732 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933151AbeEWPE6 (ORCPT ); Wed, 23 May 2018 11:04:58 -0400 In-Reply-To: <4345d6a2-935d-e206-e309-b63825f880b8@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Wed, 23 May 2018 07:24:03 -0700 John Fastabend wrote: > > @@ -219,8 +221,8 @@ void __dev_map_insert_ctx(struct bpf_map *map, u32 bit) > > static int bq_xmit_all(struct bpf_dtab_netdev *obj, > > struct xdp_bulk_queue *bq) > > { > > - unsigned int processed = 0, drops = 0; > > struct net_device *dev = obj->dev; > > + int sent = 0, drops = 0; > > int i; > > > > if (unlikely(!bq->count)) > > @@ -241,10 +243,13 @@ static int bq_xmit_all(struct bpf_dtab_netdev *obj, > > drops++; > > xdp_return_frame(xdpf); > > } > > - processed++; > > + sent++; > > Do 'dropped' frames also get counted as 'sent' frames? This seems a bit > counter-intuitive to me. Should it be 'drops+sent = total frames' > instead? Again, sorry for mixing this up when spliting up the patch. The patchset does end up with: 'drops+sent = total frames'. (The "processed" counter is a copy-paste of code from cpumap, which have another semantics). I'll clean it up in V5, to help reviewers. -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer