From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8777AC433FE for ; Thu, 17 Nov 2022 20:51:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234954AbiKQUvw (ORCPT ); Thu, 17 Nov 2022 15:51:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231240AbiKQUvv (ORCPT ); Thu, 17 Nov 2022 15:51:51 -0500 Received: from smtp1.emailarray.com (smtp1.emailarray.com [65.39.216.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D34852727 for ; Thu, 17 Nov 2022 12:51:49 -0800 (PST) Received: (qmail 91568 invoked by uid 89); 17 Nov 2022 20:51:48 -0000 Received: from unknown (HELO ?192.168.137.22?) (amxlbW9uQGZsdWdzdmFtcC5jb21ANzEuMjEyLjEzMS44MA==) (POLARISLOCAL) by smtp1.emailarray.com with ESMTPS (AES256-GCM-SHA384 encrypted); 17 Nov 2022 20:51:48 -0000 From: Jonathan Lemon To: Christoph Hellwig Cc: Jonathan Lemon , io-uring@vger.kernel.org Subject: Re: [PATCH v1 07/15] io_uring: Allocate zctap device buffers and dma map them. Date: Thu, 17 Nov 2022 12:51:46 -0800 X-Mailer: MailMate (1.14r5918) Message-ID: In-Reply-To: References: <20221108050521.3198458-1-jonathan.lemon@gmail.com> <20221108050521.3198458-8-jonathan.lemon@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On 16 Nov 2022, at 0:15, Christoph Hellwig wrote: >> + dma_unmap_page_attrs(device, buf->dma, PAGE_SIZE, >> + DMA_BIDIRECTIONAL, >> + DMA_ATTR_SKIP_CPU_SYNC); > >> + addr = dma_map_page_attrs(device, page, 0, PAGE_SIZE, >> + DMA_BIDIRECTIONAL, >> + DMA_ATTR_SKIP_CPU_SYNC); > > You can't just magically skip cpu syncs. The flag is only valid > for mappings of already mapped memory when following a very careful > protocol. I can't see any indications of that beeing true here, > but maybe I'm just missing something. This was copied from page_pool_dma_map(). The same logic applies - io_uring pins the memory, zctap creates a pool that is dma mapped, and the driver performs dma_sync_single_*() when receiving the packet. — Jonathan