Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp205797rdb; Sun, 28 Jan 2024 22:11:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFj0ZbIznovq1OkLkNR11N5n7aBxzSoTILCA2/5suJ3/Oz/PGx4syV/XYzfXqaNm1F/v3pe X-Received: by 2002:a25:906:0:b0:dbf:e0a:c62b with SMTP id 6-20020a250906000000b00dbf0e0ac62bmr1623033ybj.48.1706508718904; Sun, 28 Jan 2024 22:11:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706508718; cv=pass; d=google.com; s=arc-20160816; b=iUEuER0ArZ+8ecsvBQgXAyOkYFE7+N5uZV09eWYG3UPfktlgJoUVWovncAfaTGcNmD eV63PS7WP5TqQfAcgi7PdSBcm3zT8DlmrIlF0AGykIu8/WMH+ZOhyzQkzuHH0KC+8VwB Y74okiJwg2/8vHbGDabg0QyNUD924zjwJgYxAgKG4KnLtpAmPfV9gI34usMuWXS2RkYo BVfKPgoEoXb6NUMPpqfKxY6p+Sjuh15sk4+c0JClZoxMrelafx+TNl3bo1VVdguIDpZr jCk9vcQ/1851E72vZdkYbmgDmaLbCLZfydHVGLt1aOcUxhUZag0UaMz3mcqPRPpy+gkG +exg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=sLTsEscOS/ncQZHzR7ejefYaKbYScj47kF/r85oS/II=; fh=Fq/b8ryyzZN0IBKK45pHqy7V6ufQoOiIItXtuK8hu90=; b=p0S6XV5FY9DOCVICgWnFDNa8vuLmpxUEsf5ETiMF44jlh/1uwJEapHaFlnm8esrA/Z K+uDIpCkknYdFpog9qbbf7vaxGrrHWPTj0YVlSiPa8X7iK6/U8oH13ihIT44HFfpGxLe 0mFdrjTGQCreRxZ+zu/s1QJvikEPjSccQy3NzsQX/gNUfUV+5DHKP27TMsxOhcofU86w jNmcCu6J7G1+HYAYogjIHL/Brp4lCsGtkqNX17SUcxOwc9exTscDdGp9fhHhUi9fMV/f SKW5CS3DfgGWaOy+ZX4OIcF5cZDkouLnDuVl8ALUyUS2yydctXfCVWwKSrCHaasHJeqg l8cw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-42216-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42216-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id s67-20020a635e46000000b005b942de1e92si5033968pgb.443.2024.01.28.22.11.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 22:11:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42216-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-kernel+bounces-42216-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42216-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E4CA6B21BD8 for ; Mon, 29 Jan 2024 06:11:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB4874C60E; Mon, 29 Jan 2024 06:11:42 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E6BF45BE8; Mon, 29 Jan 2024 06:11:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706508702; cv=none; b=soDO5bk7r5Qb/pbQSuedH5quWexZbsdxWSw1TUhzckux3xUwYZY4miIaYH9Gea8oUiYkTACPnG520KFXNnyGHj0KbhY9iJcTV/pXEXgt5YhZ6Nms3JCM9qSP+t0Szp+JXtMMdTNHp+6D8uZEdmUM88GFrtPuzhwZaBn3dAXxJtQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706508702; c=relaxed/simple; bh=LcxMe8nXcndnUrfBfP/5djB7IjR0n6rkBIDeoH73Ly4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mel6zIdeumNQxWqigMQOEmw4Fw/SMJhKdWHVosMC35qbNUOXPr3Eg3qkGGbpRfRAXuMMcNjvW27L4Hy7Tsr02kGT1aOdB8x39Ye7KTIvQTObmUZZ9xeLsMwuQ1VgG0b0pih7q8ymEsJTjgC2kWpB00hxiqKWqZDElpy9h1QgWTE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 8165668B05; Mon, 29 Jan 2024 07:11:36 +0100 (CET) Date: Mon, 29 Jan 2024 07:11:36 +0100 From: Christoph Hellwig To: Alexander Lobakin Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Joerg Roedel , Will Deacon , Greg Kroah-Hartman , "Rafael J. Wysocki" , Magnus Karlsson , Maciej Fijalkowski , Alexander Duyck , bpf@vger.kernel.org, netdev@vger.kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 1/7] dma: compile-out DMA sync op calls when not used Message-ID: <20240129061136.GD19258@lst.de> References: <20240126135456.704351-1-aleksander.lobakin@intel.com> <20240126135456.704351-2-aleksander.lobakin@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240126135456.704351-2-aleksander.lobakin@intel.com> User-Agent: Mutt/1.5.17 (2007-11-01) On Fri, Jan 26, 2024 at 02:54:50PM +0100, Alexander Lobakin wrote: > Some platforms do have DMA, but DMA there is always direct and coherent. > Currently, even on such platforms DMA sync operations are compiled and > called. > Add a new hidden Kconfig symbol, DMA_NEED_SYNC, and set it only when > either sync operations are needed or there is DMA ops or swiotlb > enabled. Set dma_need_sync() and dma_skip_sync() (stub for now) > depending on this symbol state and don't call sync ops when > dma_skip_sync() is true. > The change allows for future optimizations of DMA sync calls depending > on compile-time or runtime conditions. So the idea of compiling out the calls sounds fine to me. But what is the point of the extra indirection through the __-prefixed calls? And if we need that (please document it in the commit log), please make the wrappers proper inline functions and not macros.