Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2232533rdb; Wed, 21 Feb 2024 00:48:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXZ92VdwcSN0KVPMuKf6yQvnT2qem4nKQ8vcPh8SNIi1zFJGWBUA+50de7ay4PbHKEioVrKe0qTaqyogQRFy5OWTojezGa4oUKo1J78og== X-Google-Smtp-Source: AGHT+IEc3+a4e0NeaIZKLr6g8OtKnwQ9PKziE18SlSOV5dPEjkKS1g/ScV1ozwhSY9uZva8Cr8hv X-Received: by 2002:a17:90a:1149:b0:299:ef19:1778 with SMTP id d9-20020a17090a114900b00299ef191778mr3172757pje.10.1708505286125; Wed, 21 Feb 2024 00:48:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708505286; cv=pass; d=google.com; s=arc-20160816; b=v6ol4ScrNedY4AZ71CXx1OtW2jGFJUU05faujTlNyYjHnq1GX9yC2K9NzPG4k5MUir c12uLuk8OEfoDD1zZUxPjcNMC0H6wnJUpgl5fGoVltAy1nyDAtQwX/eHiyePmN7ezUhJ N+8DDSUQT+fgPFGp1JRJPSQHQiwaidPAC4WxdOH5i6MZnvxabQ73d8NOeiqKKPZ462zW MUascTbAqckIzx3NnSZojzSfrMNq9Wm/XDOhUnYuW9xj5pe6+D6GFmz/I6mHOudyk2k2 LlkFJMN8O5n6pvcqyhkG+Lmt6iMlbm4IxRvtPEipTkULwzMxCGM2GCT2a/uwFMX0QgwC A87w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=MKtbQFGi29nwrYk3QubhIue9JnNyRVyNIhYKnNLYWAc=; fh=Q8f8FlENDMJfS93R2EHJJ4vBoU1YHNzea5UJmyBrlpE=; b=CzFReqf9yYMylwdBnO+rYJ8sO4vzgX+Qyrht745bFyeCLbQpBuI9imvE493EWHpOiy grFlpvK8HmoUDpBxCe1fW0sIwREYKMMQP4tJJBixDtLJ+7TD6FuCK3QauytpOqJArpPl 21MGZHM+wi/wD7lx7R9JHAu6ZdDaNkrZrT3O98iDZx2EV5rQGZdkiWmke0uQ9C//rY3l 27gXtLP5jRdhaM+eJCYeEKzHp018WLyLL4GuYynRZKwD6MmEbUaxlbPUK1v2r+CUfhxu mIbAE7GdcnhEQAL2TZaNgyhJu2R/1q1xcpP4kOE+e+2s1lK74etDTKrM9pFdJw3BHffD aO4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cdOa7g8i; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-74323-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id my11-20020a17090b4c8b00b0029a1e818978si514472pjb.56.2024.02.21.00.48.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 00:48:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74323-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cdOa7g8i; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-74323-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74323-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AF98F285D2D for ; Wed, 21 Feb 2024 08:48:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C45D23CF52; Wed, 21 Feb 2024 08:47:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="cdOa7g8i" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 779DE3C6A3 for ; Wed, 21 Feb 2024 08:47:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708505276; cv=none; b=if79z7ink7C+xJMdD2R1GgKBR52IrjtIxDp007yx7d+GMvhWzBdODG5s3xHZPs3cwBIfA43Vn9gujsdhodpV9KRoC1B0XIUGMuIegTsd48xPKne098jTqJxuLuk3owngW0hbisrgHoNl54N2kYxh8BLHXcy1hvs21XU1OKap6f8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708505276; c=relaxed/simple; bh=84houcy4OXpPnj74pGNM1YYzjfNXhn1ObuocFwoW02w=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BHIcz5kzGEK7wDdr15RKryaQoabl3vpejOnPqhHvj21la9rsh60y0CM9BIdPHDBW+ZinejKT4VwcTdVjAt3E9LwDEWwNAB25ORDkgnkOMQVHhAp0mzwSbY3Srd6wFB8DySC0Wah45tyZKwa20Vj9BOJ0oCnYO/54VsC5sNiBT7Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=cdOa7g8i; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708505274; 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:autocrypt:autocrypt; bh=MKtbQFGi29nwrYk3QubhIue9JnNyRVyNIhYKnNLYWAc=; b=cdOa7g8iU7ss47DZksTIMO9CbWCkH7MqXvKr5RDCBHroXterdC7a+2S6J0vBZr9YD7MG2K xCZijhMYxx5OfCSrw+2Xzb5P/Gl8ks+k7NAEFmw0MTN29l1dmPaZWOAxpvng0hNUKx74QO uBvvUEHk+Qf11oQhMfhd5doMRKBIzrw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-648-gcrmhqhTNjqLrKNK9w29Iw-1; Wed, 21 Feb 2024 03:47:50 -0500 X-MC-Unique: gcrmhqhTNjqLrKNK9w29Iw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8ED13185A785; Wed, 21 Feb 2024 08:47:49 +0000 (UTC) Received: from [10.39.208.17] (unknown [10.39.208.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 89D3E2592; Wed, 21 Feb 2024 08:47:46 +0000 (UTC) Message-ID: <77a8b8d5-69c2-4386-bae5-871270aa110d@redhat.com> Date: Wed, 21 Feb 2024 09:47:44 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] vduse: implement DMA sync callbacks To: Christoph Hellwig 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 References: <20240219170606.587290-1-maxime.coquelin@redhat.com> Content-Language: en-US From: Maxime Coquelin Autocrypt: addr=maxime.coquelin@redhat.com; keydata= xsFNBFOEQQIBEADjNLYZZqghYuWv1nlLisptPJp+TSxE/KuP7x47e1Gr5/oMDJ1OKNG8rlNg kLgBQUki3voWhUbMb69ybqdMUHOl21DGCj0BTU3lXwapYXOAnsh8q6RRM+deUpasyT+Jvf3a gU35dgZcomRh5HPmKMU4KfeA38cVUebsFec1HuJAWzOb/UdtQkYyZR4rbzw8SbsOemtMtwOx YdXodneQD7KuRU9IhJKiEfipwqk2pufm2VSGl570l5ANyWMA/XADNhcEXhpkZ1Iwj3TWO7XR uH4xfvPl8nBsLo/EbEI7fbuUULcAnHfowQslPUm6/yaGv6cT5160SPXT1t8U9QDO6aTSo59N jH519JS8oeKZB1n1eLDslC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TxYZif2pfNxfINFzCGw42s3EtZFteczClKcVSJ1+L +QUY/J24x0/ocQX/M1PwtZbB4c/2Pg/t5FS+s6UB1Ce08xsJDcwyOPIH6O3tccZuriHgvqKP yKz/Ble76+NFlTK1mpUlfM7PVhD5XzrDUEHWRTeTJSvJ8TIPL4uyfzhjHhlkCU0mw7Pscyxn DE8G0UYMEaNgaZap8dcGMYH/96EfE5s/nTX0M6MXV0yots7U2BDb4soLCxLOJz4tAFDtNFtA wLBhXRSvWhdBJZiig/9CG3dXmKfi2H+wdUCSvEFHRpgo7GK8/Kh3vGhgKmnnxhl8ACBaGy9n fxjSxjSO6rj4/MeenmlJw1yebzkX8ZmaSi8BHe+n6jTGEFNrbiOdWpJgc5yHIZZnwXaW54QT UhhSjDL1rV2B4F28w30jYmlRmm2RdN7iCZfbyP3dvFQTzQ4ySquuPkIGcOOHrvZzxbRjzMx1 Mwqu3GQ= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 Hello Christoph, On 2/20/24 10:01, Christoph Hellwig wrote: > 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. > I wasn't involved when vduse was initially submitted, I don't know if any alternative was considered at that time. Do you have something specific in mind we could do to have VDUSE not implementing DMA ops, knowing other vDPA devices rely on DMA? Thanks, Maxime