Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp878606ybt; Fri, 26 Jun 2020 13:54:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpI8ZK5rgafrIU6zKVnG1TeACu2IkSo7JJvZurIGeH1n8BFt8tutY3RIQNVg/9x1FnFNTE X-Received: by 2002:a05:6402:459:: with SMTP id p25mr5239007edw.383.1593204846080; Fri, 26 Jun 2020 13:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593204846; cv=none; d=google.com; s=arc-20160816; b=S4lgKQENMJNrXBwyFnLMJ54M0CxLt7exh5l0usyrYhYtAMORDKJqf/fmu8fMEI9P19 V8wQrxMufI4Ys78uzLXYMVFKR1cni0RzR5Gff1t6g5iHcEDitRsqHlWAPxSpHtJSfRb4 jKAu+MWLz6DViicZpbp3WdfrPjn4y6Ru6ZgXKU1AbhsMCd0izbZEIcSnRvOOuhg7H/gf d6YjA2Xn/JhOPgMa3fRwa+XIZMy47U4WWme8F+GR3KFhnEvXoJ7gK1EdLCNzcW/VG39n 0DAgSn+W7+0BON/XaudzcpHV+hDKgeiL/TL/YeEJ/rJ+fUvFhk36zBV0IPyd0LAI5jLp NXxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=OtsC43FTjunjlKheGH0ZKUbGCL1p+Y7+8kJC6GBEasg=; b=nrJeDwD74Fi7CpRqF+5WTnhOTSJ7Hi6W351Rq0I3wsdlgaa7OqOaT5s0xmyRQcXc/F z3d6D7jKqgv3RZfeORbRUlRTgHVjRS6RWMg8vFx3ahFjJgUgfv2irHFh/M7pKluvuopK bDScwYG1bKXBBoBBGirYk6YMfD7U04MQy0drYJNCObTGE7a0ZXU2V+19Fow5mCGkEHC/ 8aAwOz8SppISeqFe2VWea4gx69l1zqzfy+NNf86shNuTVe8YhWIajU904gTualVS46EB UHGsC/m1n7l9jij/p1SMGUg9Qd7fhhn7/tFtvvZNv90ZyXjlCu+FvmiAT+hQHdNTHP07 Sjbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p91si9468312edb.129.2020.06.26.13.53.43; Fri, 26 Jun 2020 13:54:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725864AbgFZUvf (ORCPT + 99 others); Fri, 26 Jun 2020 16:51:35 -0400 Received: from smtp3.emailarray.com ([65.39.216.17]:54100 "EHLO smtp3.emailarray.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725803AbgFZUve (ORCPT ); Fri, 26 Jun 2020 16:51:34 -0400 Received: (qmail 90924 invoked by uid 89); 26 Jun 2020 20:44:53 -0000 Received: from unknown (HELO localhost) (amxlbW9uQGZsdWdzdmFtcC5jb21AMTYzLjExNC4xMzIuMw==) (POLARISLOCAL) by smtp3.emailarray.com with SMTP; 26 Jun 2020 20:44:53 -0000 Date: Fri, 26 Jun 2020 13:44:48 -0700 From: Jonathan Lemon To: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= Cc: netdev@vger.kernel.org, =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , hch@lst.de, davem@davemloft.net, konrad.wilk@oracle.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, maximmi@mellanox.com, magnus.karlsson@intel.com Subject: Re: [PATCH net] xsk: remove cheap_dma optimization Message-ID: <20200626204448.bxvr35qaxkfj6chs@bsd-mbp> References: <20200626134358.90122-1-bjorn.topel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200626134358.90122-1-bjorn.topel@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 26, 2020 at 03:43:58PM +0200, Bj?rn T?pel wrote: > From: Bj?rn T?pel > > When the AF_XDP buffer allocation API was introduced it had an > optimization, "cheap_dma". The idea was that when the umem was DMA > mapped, the pool also checked whether the mapping required a > synchronization (CPU to device, and vice versa). If not, it would be > marked as "cheap_dma" and the synchronization would be elided. > > In [1] Christoph points out that the optimization above breaks the DMA > API abstraction, and should be removed. Further, Christoph points out > that optimizations like this should be done within the DMA mapping > core, and not elsewhere. > > Unfortunately this has implications for the packet rate > performance. The AF_XDP rxdrop scenario shows a 9% decrease in packets > per second. > > [1] https://lore.kernel.org/netdev/20200626074725.GA21790@lst.de/ > > Cc: Christoph Hellwig > Fixes: 2b43470add8c ("xsk: Introduce AF_XDP buffer allocation API") > Signed-off-by: Bj?rn T?pel Acked-by: Jonathan Lemon