Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp764235rdb; Sun, 1 Oct 2023 04:50:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6tYD/gWR6uGpTZva1qsxcFYA+OvW3j+3jwACAXUeJUNUvlOnNLPmZ+YUQFlMmI0L+IWuN X-Received: by 2002:a17:902:a510:b0:1c4:32da:2037 with SMTP id s16-20020a170902a51000b001c432da2037mr5845640plq.64.1696161047427; Sun, 01 Oct 2023 04:50:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696161047; cv=none; d=google.com; s=arc-20160816; b=mlj/6Z8dPHjIMwXZnavyu0xTUV2tGVWiqMuGggIinT0L0KdZt9F0TwkKdOwv1/Mzvy qBBJczxW5Ve3zLSehw4Q+iDyoeE4PYiNNQ8bY3QRKqXIXZOaZ41K6mwyHcfymOi+o8Ds kKpelzuCZsMNj8myYJrh22yRK4MWr8sfRmB1Krga5O4kvZJW40OfaC/ROJaDjeHU8Ucx NNyDziGDvwR/6IUsV3276H9XgAUues9GhjGT4eEdI1Vp1jmDl1JGRM33EG9iSROYZ4OL +xQq+DAbKpp16ekPdNskJnDuK8qF9LE+pWqZrUSenc2mHI1tUfbOisrna6T0Zl6wV0SG 0O2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=KjN8Jj9pXX9nJ/oV/ViQdrLPUA+iQsH1M0z+BUtNsS4=; fh=xFem/TPwwv3oNZJzAnPHGSym4BrCHgcgElXYy9XHJn8=; b=OZ9CbZe7nrQ0IYzRTQ8SXJ6y1TpcxqBddHwiOAkw7lQfqHl6YJEg3iIdtpqDpq4XrL mEYeRvAKq8qyvuFlR4viLjo2JYqCJSKVi4TxizmbgS6YZdX0qHfvu8jaOZruxH/rgaPW zupGXMKchfwRDgcYjdD9yUF5VtzJsH+socTA+MhGfqmiZwqG9nApZDuNTZCe3NN7GwwY FvIyiNHmtVx+tw834aC0DqM/JkCeO/ZFIPIpq7b/aEe3YvmRZgkurpjIY9uCZtu+YxnC p/a4fkk2uHAEte7FtJH/diNtVE/IJDuZGoWVqYxRGDfYvNOJ2VdqF/DYkxKG8oUt5WDJ +Znw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=W+T0U5VC; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="A/oShsgD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id ik7-20020a170902ab0700b001c604f8de9fsi18879883plb.631.2023.10.01.04.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Oct 2023 04:50:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=W+T0U5VC; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="A/oShsgD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id DA52780254CA; Sun, 1 Oct 2023 03:44:26 -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 S234848AbjJAKoN (ORCPT + 99 others); Sun, 1 Oct 2023 06:44:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234823AbjJAKoM (ORCPT ); Sun, 1 Oct 2023 06:44:12 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A976B7; Sun, 1 Oct 2023 03:44:09 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E3C142184E; Sun, 1 Oct 2023 10:44:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1696157046; h=from:from:reply-to: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; bh=KjN8Jj9pXX9nJ/oV/ViQdrLPUA+iQsH1M0z+BUtNsS4=; b=W+T0U5VCcSvnv3PZ5nIsaPbS0kynBOBKKcLR41f6b0hVPcutsdyd0DdZ/0j6sDYd8Vt4lC LMiRYPwYlhJeOhglhruxRWMrowncDpKpq5R0bL5SkI6tmrxJMnh2bg0uez9CLKyh3WHK7v T02WAOhH7P7PaayzaCxI20dot5KOf4U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1696157046; h=from:from:reply-to: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; bh=KjN8Jj9pXX9nJ/oV/ViQdrLPUA+iQsH1M0z+BUtNsS4=; b=A/oShsgDE03LIuhKodJBq2l80uiUQ72jCQrfyJO/GgdxnSWhHd5ntt5RpR0ymzLXspmpjW 0x2oBaTTbgly9ODA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6737F132BE; Sun, 1 Oct 2023 10:44:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id l84GGHZNGWU7UwAAMHmgww (envelope-from ); Sun, 01 Oct 2023 10:44:06 +0000 Message-ID: Date: Sun, 1 Oct 2023 12:44:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] cnic,bnx2,bnx2x: use UIO_MEM_DMA_COHERENT Content-Language: en-US To: Greg Kroah-Hartman , Chris Leech Cc: 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 References: <20230929170023.1020032-1-cleech@redhat.com> <20230929170023.1020032-4-cleech@redhat.com> <2023093055-gotten-astronomy-a98b@gregkh> <2023093002-unlighted-ragged-c6e1@gregkh> From: Hannes Reinecke In-Reply-To: <2023093002-unlighted-ragged-c6e1@gregkh> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=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 03:44:27 -0700 (PDT) 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 :-) I agree, though, that the design is a mess. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman