From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: Re: [bpf-next V4 PATCH 0/8] xdp: introduce bulking for ndo_xdp_xmit API Date: Wed, 23 May 2018 11:24:14 +0200 Message-ID: <74408d8f-bb05-2d0d-9d4b-ea9b0e17fc5e@iogearbox.net> References: <152665044141.21055.1276346542020340263.stgit@firesoul> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Christoph Hellwig , =?UTF-8?B?QmrDtnJuVMO2cGVs?= , Magnus Karlsson , makita.toshiaki@lab.ntt.co.jp To: Jesper Dangaard Brouer , netdev@vger.kernel.org, Daniel Borkmann , Alexei Starovoitov Return-path: Received: from www62.your-server.de ([213.133.104.62]:56879 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754378AbeEWJYQ (ORCPT ); Wed, 23 May 2018 05:24:16 -0400 In-Reply-To: <152665044141.21055.1276346542020340263.stgit@firesoul> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 05/18/2018 03:34 PM, Jesper Dangaard Brouer wrote: > This patchset change ndo_xdp_xmit API to take a bulk of xdp frames. > > In this V4 patchset, I've split-out the patches from 4 to 8 patches. > I cannot split the driver changes from the NDO change, but I've tried > to isolated the NDO change together with the driver change as much as > possible. > > When kernel is compiled with CONFIG_RETPOLINE, every indirect function > pointer (branch) call hurts performance. For XDP this have a huge > negative performance impact. > > This patchset reduce the needed (indirect) calls to ndo_xdp_xmit, but > also prepares for further optimizations. The DMA APIs use of indirect > function pointer calls is the primary source the regression. It is > left for a followup patchset, to use bulking calls towards the DMA API > (via the scatter-gatter calls). > > The other advantage of this API change is that drivers can easier > amortize the cost of any sync/locking scheme, over the bulk of > packets. The assumption of the current API is that the driver > implemementing the NDO will also allocate a dedicated XDP TX queue for > every CPU in the system. Which is not always possible or practical to > configure. E.g. ixgbe cannot load an XDP program on a machine with > more than 96 CPUs, due to limited hardware TX queues. E.g. virtio_net > is hard to configure as it requires manually increasing the > queues. E.g. tun driver chooses to use a per XDP frame producer lock > modulo smp_processor_id over avail queues. > > I'm considered adding 'flags' to ndo_xdp_xmit, but it's not part of > this patchset. This will be a followup patchset, once we know if this > will be needed (e.g. for non-map xdp_redirect flush-flag, and if > AF_XDP chooses to use ndo_xdp_xmit for TX). > > --- > > Jesper Dangaard Brouer (8): > bpf: devmap introduce dev_map_enqueue > bpf: devmap prepare xdp frames for bulking > xdp: add tracepoint for devmap like cpumap have > samples/bpf: xdp_monitor use tracepoint xdp:xdp_devmap_xmit > xdp: introduce xdp_return_frame_rx_napi > xdp: change ndo_xdp_xmit API to support bulking > xdp/trace: extend tracepoint in devmap with an err > samples/bpf: xdp_monitor use err code from tracepoint xdp:xdp_devmap_xmit Series applied to bpf-next, thanks Jesper. (Some minor comments in the patches.)