Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1618288rdb; Mon, 2 Oct 2023 15:49:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDowisVlgBOQEq6UFJE6fYeErxfUCYSxEBDnuhCSUhiYE9uPxLrnniJBZ2akCD3mstRdyg X-Received: by 2002:a05:6808:1495:b0:3ae:2bc8:2b93 with SMTP id e21-20020a056808149500b003ae2bc82b93mr17000853oiw.3.1696286995310; Mon, 02 Oct 2023 15:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696286995; cv=none; d=google.com; s=arc-20160816; b=NX54R4Ruz3eta0bytVpsQmLKUuHj2ti5GZ5QtxXNaKN1BK7LsY075eFqQ521Pn/7Qm ktKxVcIPmlRhq0T25/HS+P0noY4bywMn0qFsloLxSJpdVfHsjLp/kiGnxuGiHJiPIh0A hQPRvo93zz/YQ04cqDIngxSWHyPT3wZ9XejG23EuignriHQVeCrubWN6DMeTZ07CCPgt Rw+MYH/a5pXvA1LiMg51SWBiH4LesLFXQxCKvtNZYfoLBVrfq0cO1FgMNPmaKMrxItnu LKZGxiYxgqmqI6lFB1avXq8plZq4ea8SIqTu/KDNHzLmw8oiSuyMqh2FHTiNb9fUWjht Bx6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NgkLeOGqjtCb41KoruIoLPzbCEQCkBec0FNCN6KVMQo=; fh=fKFdBdk92SnglikeqllzGvCFEBpBZOM7qG0rS4x/lyA=; b=XlOInAKCTQPz41XHMGQ86ncwhcleXIahi1grvJR0Pa1ZmZK1ediVySoifK26KhWHz3 geg4mQ2AV3DJxJS3zPgtCsZgW9WziybtqBcE33v8yvlAX/YtNRpPG/GupLZ63YB4LDDv PgcsXoSSy/pBL11AQhKV307d89fGnH8dHAJlwNxYZDEeKSdOck2MaAt8gte7ahEWh2k5 K3SzikIx+MnTlUYm3Kp8u8ZVQ3vnw72r9SlWFvRwOrYHHzgBIoOlHiHG+zDuN1OgFGqW nUtnDDuC/K8Lt4Hv7cqQ1RJJIo7am9Vv03mWq0OzdhOLa86p5eXE25R3YczlUtSOjmPU WiAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zaeTs7yg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id s31-20020a056a00179f00b0068e44a5e7ffsi29636pfg.90.2023.10.02.15.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 15:49:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zaeTs7yg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id ACD2B802F559; Sun, 1 Oct 2023 04:58:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234910AbjJAL5c (ORCPT + 99 others); Sun, 1 Oct 2023 07:57:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232837AbjJAL5b (ORCPT ); Sun, 1 Oct 2023 07:57:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEB71D3 for ; Sun, 1 Oct 2023 04:57:28 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5F2CC433C8; Sun, 1 Oct 2023 11:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696161448; bh=JsTcYuCjnKCRS49oBtoC/vqy3wZU5S1GK8S0OnCnZK4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zaeTs7ygqGfjrJWOnFpfD3yxD4Vik2KbdPjbE0n2twJEyAqkuWttYUXY3y0MSydKM VgbDXZMTofVh3NjFuvBjRB+0g7QNWvqSbKpMModxj2vdeuN1iJey22rW1P4myyS8lf by8piuTx91mqiUPbju6XcRad0soc2YA8f92gTkJ4= Date: Sun, 1 Oct 2023 13:57:25 +0200 From: Greg Kroah-Hartman To: Hannes Reinecke Cc: Chris Leech , Christoph Hellwig , Rasesh Mody , Ariel Elior , Sudarsana Kalluru , Manish Chopra , Nilesh Javali , Manish Rangankar , Jerry Snitselaar , John Meneghini , Lee Duncan , Mike Christie , Hannes Reinecke , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] cnic,bnx2,bnx2x: use UIO_MEM_DMA_COHERENT Message-ID: <2023100114-flatware-mourner-3fed@gregkh> References: <20230929170023.1020032-1-cleech@redhat.com> <20230929170023.1020032-4-cleech@redhat.com> <2023093055-gotten-astronomy-a98b@gregkh> <2023093002-unlighted-ragged-c6e1@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 01 Oct 2023 04:58:08 -0700 (PDT) On Sun, Oct 01, 2023 at 12:44:05PM +0200, Hannes Reinecke wrote: > On 9/30/23 20:28, Greg Kroah-Hartman wrote: > > On Sat, Sep 30, 2023 at 11:19:20AM -0700, Chris Leech wrote: > > > On Sat, Sep 30, 2023 at 09:06:51AM +0200, Greg Kroah-Hartman wrote: > > > > On Fri, Sep 29, 2023 at 10:00:23AM -0700, Chris Leech wrote: > > > > > Make use of the new UIO_MEM_DMA_COHERENT type to properly handle mmap > > > > > for dma_alloc_coherent buffers. > > > > > > > > Why are ethernet drivers messing around with UIO devices? That's not > > > > what UIO is for, unless you are trying to do kernel bypass for these > > > > devices without anyone noticing? > > > > > > > > confused, > > > > > > It's confusing. The bnx2 driver stack included a cnic (converged nic?) > > > module that sits between the ethernet drivers (bnx2, bnx2x) and protocol > > > offload drivers (iscsi, fcoe, rdma). > > > > > > The iscsi module (bnx2i) uses a passthrough interface from cnic to > > > handle some network configuration that the device firmware doesn't do. > > > It uses a uio device and a userspace component called iscsiuio to do > > > that. > > > > That's horrible, and not what the UIO api is for at all. Configure the > > device like any other normal kernel device, don't poke at raw memory > > values directly, that way lies madness. > > > > Have a pointer to the userspace tool anywhere? All I found looks like a > > full IP stack in userspace under that name, and surely that's not what > > this api is for... > > > But that's how the interface is used, in particular for the bnx2i driver. > Problem is that the bnx2i iSCSI offload is just that, an iSCSI offload. Not > a TCP offload. So if the iSCSI interface is configured to > acquire the IP address via DHCP, someone has to run the DHCP protocol. > But the iSCSI offload can't, and the bnx2i PCI device is not a network > device so that the normal network stack can't be used. > And so the architects of the bnx2i card decided to use UIO to pass > the network traffic to userspace, and used the userspace 'iscsiuio' > application to run DHCP in userspace. > > But's been that way for several years now; so long, in fact, that > the card itself has been out of support from Marvell (since quite some > years, too, IIRC). And even the successor of that card (the qedi driver) > is nearing EOL. Mind you, the qedi driver is using the same interface (by > using UIO to run DHCP in userspace), so singling out the bnx2i for bad > design can be construed as being unfair :-) Ok, let's say they are all horrible! :) > I agree, though, that the design is a mess. Ok, so why are we papering over it and continuing to allow it to exist? What "broke" to suddenly require this UIO change? If this has been around for a very long time, what has caused this to now require the UIO layer to change? thanks, greg k-h