Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1606322rdb; Tue, 20 Feb 2024 01:03:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXd1P+hTjGqnfS7+L3Y4bi6OX3utyEhf1nyhqtT+03q0hjCh4FqlVUPAVp3OXK24EfmvKHqV0A993m0DnulkdICM4SQS4+8Phvdfvh0xg== X-Google-Smtp-Source: AGHT+IFLWAgZXhYBkDakSvUyDu1bwhydfZbkTLYDBqDaPPYL9AxrqNcu6SGHDz8xTJMMVmfpsEmc X-Received: by 2002:a0c:e086:0:b0:68f:5d8f:7c14 with SMTP id l6-20020a0ce086000000b0068f5d8f7c14mr7111021qvk.19.1708419794367; Tue, 20 Feb 2024 01:03:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708419794; cv=pass; d=google.com; s=arc-20160816; b=fx1ffDqxWgmdL0THV0RdmkduPJHoBW89e9xFjkwTLTPDtChxHB2g0HaqYyYRI6ZDUC U7e+DHq/QbNMk5i2ZX4goaIykY3MlWTH3liUcI+Sh44qgjkKC4eGNDejVZAhV/LryrBt tCy7qFpbinNkTpqCEjzzl0cSklenTjs4rtLxTAz2RfACqve2Bl8XUs1M+x4q+dYrij3A xU5NvRqkmB1taTeh2TLHm8Jsd5AN7knhQfyOC1BDoFDSikjkKvwZR+YF4bJghexVWP/b 3W9CzuyIHryEJPM8228iu66HwfmrnBQv7wUKveICCmPRleg8vdE7dOEN/+OXe/Iihn7k q0iw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=VRlf7svvB4q3qj2+V468QhWzpfRTFZwbhai9UV0td6E=; fh=aionVUuHCtlAbiP1lZpXGtDgLyKmOk1f1jKLEDxQ/lQ=; b=JbvJCjVYkLa+G0Lw8gLop6r6BjylDIdiXDeb+lQEZsThn6xDYYVMeDlwEhqI8TZLsU pI5AwS0MdmWTR/ZF1FjzngJ8Pkg6q64BHqBMOKiXPsXKqVDGUQ+6Royxj+JFqRHMpoKS 64f42isFYmQO59Ky4d3UbRhP02k3GWBYdmJt8okaEPqCuvcLGozL6mGmFciH+N/GBn9I oWVBlK9mCHxdcXceZgUp/N4OFi8/y3nqtoeZFmwaTQF9U3O6oMrifCXDb0fhSlxYks7i k4i9xt58NdMyLN2jsoxouzZ0nHxCFqmYAv+3kPkBHKHp+AcNaEEXA1SJviOQ4SMtxKpl v8uw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=iqk3YcAi; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-72634-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72634-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q2-20020ad45742000000b0068f2eed8e0esi8199188qvx.287.2024.02.20.01.03.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 01:03:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72634-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=iqk3YcAi; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-72634-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72634-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id ED0031C23D7E for ; Tue, 20 Feb 2024 09:03:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E1E6B60ED5; Tue, 20 Feb 2024 09:01:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="iqk3YcAi" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 BE90860ED3; Tue, 20 Feb 2024 09:01:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708419707; cv=none; b=RfpZt+h/0Ie5+mzqTMhvQV/PobXG4EHHQSnKfvMPrYAtyZXIYnKM+7UXgF5+FNkVdcqKDFzsq48bznChZ3HjiTF4j9DIYhYSzgG1WvkYhdl+wnwjpADLiKuGDovyPHSbkQkBmmBxCp3dKkvD30ldn1kknFLUqqZLtQ07bltRybE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708419707; c=relaxed/simple; bh=w5txP1p8eaflpPcLD3mB5+qv4wWL4h7pHa6trQ/riJA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bQyA/4N/SWwMabZxSLzFIls29GtDV3RNtUOiljfz/QJnOExNpJm6zmon2Emx2WNMGqQR4nJms9+kVDHsTcP1jPfBsKT3qzLmVoE5k/EK+pLKFYQ3gmbwJHTihXOfAdVDXFiIR+nj69IE2RWcHozyZuTyXyX0uj1As6zkkVfE9Yc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=iqk3YcAi; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VRlf7svvB4q3qj2+V468QhWzpfRTFZwbhai9UV0td6E=; b=iqk3YcAiFd67dsPwfK7F8Vp89Q h1ifVmoTcjWdUAELwGMWt/o22BxGyK8VB6vEfvCNU7pC3aeDkIQck28i1sW9j+g3ADN523WIBvpo3 qru/5jsN0BGt6hMF/B9zbxlcg/+P7XUE7HVFPa2wrnRsh9FT4d2Qi3oaH/yay+d5rTullBwcvqAfT 5lH0fHeWuZxIAsOBDagQPUdFKUzgNvQDCeF0dnRLfQRZaSDnhAWdeS8u3MNE68dLkHyPOSvX3fnTl SXAod76wUbXj22LGZeAYnJcesZa1FYGz5MMt8rBzm447+KuzBC+w2SEYFx1NdPs0aZGlEIRCvpWwI NZB4OjRA==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcM0O-0000000DrMm-3rVh; Tue, 20 Feb 2024 09:01:36 +0000 Date: Tue, 20 Feb 2024 01:01:36 -0800 From: Christoph Hellwig To: Maxime Coquelin Cc: mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com, xieyongji@bytedance.com, axboe@kernel.dk, gregkh@linuxfoundation.org, brauner@kernel.org, lstoakes@gmail.com, virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, david.marchand@redhat.com Subject: Re: [PATCH] vduse: implement DMA sync callbacks Message-ID: References: <20240219170606.587290-1-maxime.coquelin@redhat.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: <20240219170606.587290-1-maxime.coquelin@redhat.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Mon, Feb 19, 2024 at 06:06:06PM +0100, Maxime Coquelin wrote: > Since commit 295525e29a5b ("virtio_net: merge dma > operations when filling mergeable buffers"), VDUSE device > require support for DMA's .sync_single_for_cpu() operation > as the memory is non-coherent between the device and CPU > because of the use of a bounce buffer. > > This patch implements both .sync_single_for_cpu() and > sync_single_for_device() callbacks, and also skip bounce > buffer copies during DMA map and unmap operations if the > DMA_ATTR_SKIP_CPU_SYNC attribute is set to avoid extra > copies of the same buffer. vduse really needs to get out of implementing fake DMA operations for something that is not DMA.