Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp951362ybt; Fri, 26 Jun 2020 16:04:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8UysPE7y+EFASGExsKB9L7d8W9YgKO49o4m8EqBk+d69wuBZFTIrSUXlKF6HCd5t2e+mY X-Received: by 2002:a17:906:4cd0:: with SMTP id q16mr4454448ejt.418.1593212667446; Fri, 26 Jun 2020 16:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593212667; cv=none; d=google.com; s=arc-20160816; b=Ugam6+8FCdYIOPp5m+M+/Aw1mknJ9XyZhVzGUrtrLyLN6eW2/pNyHPBuy8lCtL9vGY tBJbztL6BzoMcBGFu7R8yuTkJjFlR+MfTK5MW+FjE2ORvlokgcEJkX3ApnpmZuXacuyv 1QrJmxMzaWxTUfgpIacNSvq4YJUBqlJuJWWp7/W1QJQ4r6T6LBgDd3RP+3QNPFAJg/DX sRZCezNtOZfIgoTO6lJ8vCkOYtkgi6HzH7x/fNs3cP/35OQmZ/pRIS2zG7WJc13oQueo R5L22+E+RKyasSv9U7tfBsKiYVjr0joUuCsxs6XkpDttWm1qjC5iBtqr32Sti2cRfXHE jfxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=wXF2VW82HSX/TPq5LakN2+WQzBY6OYUSjAg5xaJsE3Y=; b=qa3HqSSUEf6FEb7ezyrn5CfdAvhVrQCs3cNcagNuo73JgwHR4/ZPJNr0lnKF8hNbWO INgWqmNieG5CErXdJZ7JfwUGNu3mexqskh8cdt8HbLJUb5XrSMwoWkXG3ZH9i4/26bIY 27lNjhkNckutEOu3CxaQOhkdrfVnYcVxVki/WtQrA0/5YeMV7yulBd28PRgpq834WCJ9 21RWiyYhSjKLjYOeXM4RzFN1uVYYyvy5ob44b9Ki9dUT+fw1JgKCBu/jL76xQnnCmYfS KL4HD3XVTnWED0+kPcznQRYvJj07KTaJejMzYXLc55Vu6XRem/XAhJNIsOxuCkjspxt2 abpQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si3863019ejp.213.2020.06.26.16.04.01; Fri, 26 Jun 2020 16:04:27 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726015AbgFZXAg (ORCPT + 99 others); Fri, 26 Jun 2020 19:00:36 -0400 Received: from www62.your-server.de ([213.133.104.62]:53520 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725951AbgFZXAg (ORCPT ); Fri, 26 Jun 2020 19:00:36 -0400 Received: from sslproxy03.your-server.de ([88.198.220.132]) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1joxKW-0000PS-RM; Sat, 27 Jun 2020 01:00:20 +0200 Received: from [178.196.57.75] (helo=pc-9.home) by sslproxy03.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1joxKW-000HDo-F1; Sat, 27 Jun 2020 01:00:20 +0200 Subject: Re: [PATCH net] xsk: remove cheap_dma optimization To: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , netdev@vger.kernel.org Cc: =?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, jonathan.lemon@gmail.com References: <20200626134358.90122-1-bjorn.topel@gmail.com> From: Daniel Borkmann Message-ID: Date: Sat, 27 Jun 2020 01:00:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20200626134358.90122-1-bjorn.topel@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.102.3/25855/Fri Jun 26 15:19:25 2020) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/26/20 3:43 PM, 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 Given there is roughly a ~5 weeks window at max where this removal could still be applied in the worst case, could we come up with a fix / proposal first that moves this into the DMA mapping core? If there is something that can be agreed upon by all parties, then we could avoid re-adding the 9% slowdown. :/ Thanks, Daniel