From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2363FC3F2CD for ; Thu, 5 Mar 2020 14:39:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E957D20732 for ; Thu, 5 Mar 2020 14:39:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="P9BrOgBp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726889AbgCEOjx (ORCPT ); Thu, 5 Mar 2020 09:39:53 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:40038 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725944AbgCEOjw (ORCPT ); Thu, 5 Mar 2020 09:39:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583419191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=939ubS6/Mea4GeLT83aqVqtxGhj3OLFtb6w5myvHrnQ=; b=P9BrOgBpU4WM/DakR7mLyT5cMATbQdKtVzh4jYROEG5vlq+NiOtVI1xcLF1STN84hRxYF3 vuen4LTuifXtvvMvIuqiY2+WPbXMyTqWWWi009GyhvIl+Qeg6GhPksPoic88VYOWTtBM7v vgWSd53cxY+i0PC0Q9CCpuD+vP/+zt8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-443-QKvHbWmKN32hWozKMqjuXQ-1; Thu, 05 Mar 2020 09:39:49 -0500 X-MC-Unique: QKvHbWmKN32hWozKMqjuXQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3EC651062682; Thu, 5 Mar 2020 14:39:48 +0000 (UTC) Received: from carbon (ovpn-200-32.brq.redhat.com [10.40.200.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id 19E9884D90; Thu, 5 Mar 2020 14:39:43 +0000 (UTC) Date: Thu, 5 Mar 2020 15:39:41 +0100 From: Jesper Dangaard Brouer To: Ilias Apalodimas Cc: brouer@redhat.com, Denis Kirjanov , Denis Kirjanov , netdev@vger.kernel.org, jgross@suse.com Subject: Re: [PATCH net-next v2] xen-netfront: add basic XDP support Message-ID: <20200305153929.186819a8@carbon> In-Reply-To: <20200305133114.GA574299@apalos.home> References: <1583158874-2751-1-git-send-email-kda@linux-powerpc.org> <20200305130404.GA574021@apalos.home> <20200305133114.GA574299@apalos.home> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 5 Mar 2020 15:31:14 +0200 Ilias Apalodimas wrote: > On Thu, Mar 05, 2020 at 04:23:31PM +0300, Denis Kirjanov wrote: > > On 3/5/20, Ilias Apalodimas wrote: > > > Hi Denis, > > > > > > There's a bunch of things still missing from my remarks on V1. > > > XDP is not supposed to allocate and free pages constantly as that's one of > > > the things that's making it fast. > > > > Hi Ilias, > > > > I've removed the copying to an allocated page so there is no page > > allocation/free logic added. > > > > Yea that has been removed. I am not familiar with the driver though, so i'll > give you an example. > Let's say the BPF program says the packet must be dropped. What will happen to > the page with the packet payload? > Ideally on XDP we want that page recycled back into the device descriptors, so > the driver won't have to allocate and map a fresh page. I agree. The main point with XDP is that we can do something faster-than the normal network stack. Especially in case of XDP_DROP, we do driver specific recycling tricks, to avoid any allocations and reinsert the RX-frame in RX-ring, and avoid overhead of SKB allocations. Looking closer at your patch it seem you run XDP after the SKB alloc?!? > > > > > > > > You are also missing proper support for XDP_REDIRECT, ndo_xdp_xmit. We > > > usually require the whole functionality to merge the driver. I agree, we have unfortunately seen drivers not getting completed if we don't require full-XDP feature set. > > > > I wanted to minimize changes and send follow-up patches > > > > Adding XDP_REDIRECT is pretty trivial and the ndo_xdp_xmit should be very > similar to XDP_TX. So assuming you'll fix XDP_TX adding the .ndo one will be > relatively small amount of code. You can have a patchset with more patches, if you prefer splitting this up in multiple patches. -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer