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 3F20FC77B76 for ; Tue, 18 Apr 2023 06:19:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230411AbjDRGTw (ORCPT ); Tue, 18 Apr 2023 02:19:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230218AbjDRGTv (ORCPT ); Tue, 18 Apr 2023 02:19:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 612CB4EE9; Mon, 17 Apr 2023 23:19:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EDC6562D0D; Tue, 18 Apr 2023 06:19:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5823FC433EF; Tue, 18 Apr 2023 06:19:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681798789; bh=2vlCfMnPi2r13qP/XTcsNufFl5hFcfFcLZ5jp+TdpTc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BybXNaoTpdft2Ul9XKiNY3W9ytTv7iPpjZ9kyfxzscFcplG+jCiL4oxFQB2uOkt6/ Yl1uCrJepnrpssaTGmiswF5DNlidJhI01zXzJPi1YTcdYQ6XOPjRbTwuRtzOB86pHs 54yIpvtkFBlID/n4r2tx879VzzzjkCnuvZMOFpOzJET4hguA/aUCXeBus1/C471B7/ +wfEdRGuETg6g+DmfgGBk1uUMAqKXyCbHla958q9I2C6n3g7qGI5pNya9nS/ciqHG2 w19lppyiNgqnfksUoxL9iwAmV1fI8c2twb6yriO8zhvm8ducs5s3rC2O0tEdhnC4IW VXjygtUYrxBFg== Date: Mon, 17 Apr 2023 23:19:47 -0700 From: Jakub Kicinski To: Christoph Hellwig Cc: Xuan Zhuo , netdev@vger.kernel.org, =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Magnus Karlsson , Maciej Fijalkowski , Jonathan Lemon , "David S. Miller" , Eric Dumazet , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , bpf@vger.kernel.org, virtualization@lists.linux-foundation.org, "Michael S. Tsirkin" , Guenter Roeck , Gerd Hoffmann , Jason Wang , Greg Kroah-Hartman , Jens Axboe , Linus Torvalds Subject: Re: [PATCH net-next] xsk: introduce xsk_dma_ops Message-ID: <20230417231947.3972f1a8@kernel.org> In-Reply-To: References: <20230417032750.7086-1-xuanzhuo@linux.alibaba.com> <1681711081.378984-2-xuanzhuo@linux.alibaba.com> <20230417115610.7763a87c@kernel.org> <20230417115753.7fb64b68@kernel.org> <20230417181950.5db68526@kernel.org> <1681784379.909136-2-xuanzhuo@linux.alibaba.com> <20230417195400.482cfe75@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, 17 Apr 2023 22:01:36 -0700 Christoph Hellwig wrote: > On Mon, Apr 17, 2023 at 07:54:00PM -0700, Jakub Kicinski wrote: > > AF_XDP, io_uring, and increasing number of pinned memory / zero copy > > implementations need to do DMA mapping outside the drivers. > > You can't just do dma mapping outside the driver, because there are > drivers that do not require DMA mapping at all. virtio is an example, > but all the classic s390 drivers and some other odd virtualization > ones are others. What bus are the classic s390 on (in terms of the device model)? > > I don't think it's reasonable to be bubbling up custom per-subsystem > > DMA ops into all of them for the sake of virtio. > > dma addresses and thus dma mappings are completely driver specific. > Upper layers have no business looking at them. Damn, that's unfortunate. Thinking aloud -- that means that if we want to continue to pull memory management out of networking drivers to improve it for all, cross-optimize with the rest of the stack and allow various upcoming forms of zero copy -- then we need to add an equivalent of dma_ops and DMA API locally in networking?