From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexei Starovoitov Subject: Re: [PATCH bpf-next v3 00/15] Introducing AF_XDP support Date: Thu, 3 May 2018 16:38:21 -0700 Message-ID: <20180503233819.2tplfjd32auudys2@ast-mbp> References: <20180502110136.3738-1-bjorn.topel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , magnus.karlsson@intel.com, alexander.h.duyck@intel.com, alexander.duyck@gmail.com, john.fastabend@gmail.com, ast@fb.com, brouer@redhat.com, willemdebruijn.kernel@gmail.com, mst@redhat.com, netdev@vger.kernel.org, =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , michael.lundkvist@ericsson.com, jesse.brandeburg@intel.com, anjali.singhai@intel.com, qi.z.zhang@intel.com To: Daniel Borkmann Return-path: Received: from mail-pg0-f67.google.com ([74.125.83.67]:35825 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750930AbeECXiZ (ORCPT ); Thu, 3 May 2018 19:38:25 -0400 Received: by mail-pg0-f67.google.com with SMTP id j11-v6so14209310pgf.2 for ; Thu, 03 May 2018 16:38:25 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Fri, May 04, 2018 at 12:49:09AM +0200, Daniel Borkmann wrote: > On 05/02/2018 01:01 PM, Björn Töpel wrote: > > From: Björn Töpel > > > > This patch set introduces a new address family called AF_XDP that is > > optimized for high performance packet processing and, in upcoming > > patch sets, zero-copy semantics. In this patch set, we have removed > > all zero-copy related code in order to make it smaller, simpler and > > hopefully more review friendly. This patch set only supports copy-mode > > for the generic XDP path (XDP_SKB) for both RX and TX and copy-mode > > for RX using the XDP_DRV path. Zero-copy support requires XDP and > > driver changes that Jesper Dangaard Brouer is working on. Some of his > > work has already been accepted. We will publish our zero-copy support > > for RX and TX on top of his patch sets at a later point in time. > > +1, would be great to see it land this cycle. Saw few minor nits here > and there but nothing to hold it up, for the series: > > Acked-by: Daniel Borkmann > > Thanks everyone! Great stuff! Applied to bpf-next, with one condition. Upcoming zero-copy patches for both RX and TX need to be posted and reviewed within this release window. If netdev community as a whole won't be able to agree on the zero-copy bits we'd need to revert this feature before the next merge window. Few other minor nits: patch 3: +struct xdp_ring { + __u32 producer __attribute__((aligned(64))); + __u32 consumer __attribute__((aligned(64))); +}; It kinda begs for ____cacheline_aligned_in_smp to be introduced for uapi headers. patch 5: +struct sockaddr_xdp { + __u16 sxdp_family; + __u32 sxdp_ifindex; Not great to have a hole in uapi struct. Please fix it in the follow up. patch 7: Has a lot of synchronize_net(). I think udpate/delete side can be improved to avoid them. Otherwise users may unknowingly DoS. As the next steps I suggest to prioritize the highest to ship zero-copy rx/tx patches and to add selftests. Thanks!