Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6956219rwb; Tue, 22 Nov 2022 23:19:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf7oI0ZzGpQKX6S8pnqz6qH8q6z20YtbdlOa91jOFKpZvM8fZ0F3aJ6EEK/RWDMEuwPXXKVQ X-Received: by 2002:a17:903:240a:b0:188:abb9:290 with SMTP id e10-20020a170903240a00b00188abb90290mr7886018plo.86.1669187966061; Tue, 22 Nov 2022 23:19:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669187966; cv=none; d=google.com; s=arc-20160816; b=hCUxkW7uUCvF48AufNIdfe7Dgo6bksky5atg1y6typEZ7mVozgb6iHoKwzgwnEF1wY 7/r2c/kkAxVKwxJm8bkaZHHcO5Aer2H5mj/EVKtiWiAor66QfsX0ulPoyU5Pzo/nCEME EL1LCcofpWSOyMRJ4GaV6oEmYApae4MTG8fey4zCXe/kGP3S+XmmOzQLxIShziOAP/+j K8mzNqVzMxL9HehvOMVU2ulkz4Ofi6ck9MCnzrVjDnmsDlaYYt1BCjms4YrRjzu8vak4 y0O8D1S50b0sx0d27pe4GEPown9jjfOpzmpUi3x34pfdzdW2mhHRMW0Yuc/npDQAUOJu wXmw== 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=EehDM+8gR+EVgqTGKv9vWkunp92d2FFG5bo+UDIyDug=; b=PHbSCier8uHbQcOQ0/EuiH/aE4njnJLTDKjSl5TsojWJG/XeWvjFCWmrMVz6O316MK aMCDPWALNtLPlqt922Wb/QiV5Is9SPl0ZND+cQTV4pvWztSmESkxc+cGiDE8J3R6cZqG jN6hYSym+RtHZLEza5ScLe64Fk1CqDo5X9JDekIYYyIemzY+hAcX5U7XDPx9sRlSoFN/ DfyWqGI0HmGrLsTt6uFUnbbjc9wqzN+cLjld2sPH61cbQxZcdBCnmLc+8Byw3nEAiLx/ mdCLwVc88zCnYXN5mAW9en3K9x8QtI35qw6Ge8/KYVJW6SmkGw4dItAjbb0BqDmBV0Z/ Oz4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bzgzCfjQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ls10-20020a17090b350a00b0020d4dc7fa97si1280963pjb.110.2022.11.22.23.19.14; Tue, 22 Nov 2022 23:19:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bzgzCfjQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236178AbiKWG7F (ORCPT + 89 others); Wed, 23 Nov 2022 01:59:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236165AbiKWG7C (ORCPT ); Wed, 23 Nov 2022 01:59:02 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB8A382BC0; Tue, 22 Nov 2022 22:59:01 -0800 (PST) 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 4431261AA5; Wed, 23 Nov 2022 06:59:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAD02C433C1; Wed, 23 Nov 2022 06:58:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669186740; bh=zIbIy/PtmE2LjDQ6u0ycesYy6M+OQfQCW7bQkpgh7Wk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bzgzCfjQd1alk5/e+Spa+hdB0/oWpYut0+k/MsWjFCwQ7L+rdhlvDdNiPab4PBrXI 1HArTIHZwB4Er/kcirALZN/UcNcB/AlutbbLSHLsWt8f4fW2GH+VayFQeqoxzgU+Jj +WpqJXCWUj0yZbpxtkjIm6aA3UsNsKdSpwMmsk605B+KVsldgdYgXeDEqhJJaO/cjP 1pnH1mFaTORk4pTX6HDFo62VluvlVE00/MmG8ylJj5b0mNC4pZo9fGZYylrfFiR7Vo ji9o0JpZKxLm+OD30GBRvLjBfBYIUNnYYIxcSRH2dWn+gYMgSuQjdzxPxlqI9w9COc O3kE3Uy26wQZQ== Date: Wed, 23 Nov 2022 08:58:53 +0200 From: Leon Romanovsky To: Ajit Khaparde Cc: andrew.gospodarek@broadcom.com, davem@davemloft.net, edumazet@google.com, jgg@ziepe.ca, kuba@kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, michael.chan@broadcom.com, netdev@vger.kernel.org, pabeni@redhat.com, selvin.xavier@broadcom.com Subject: Re: [PATCH v4 0/6] Add Auxiliary driver support Message-ID: References: <20221109184244.7032-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SORTED_RECIPS,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 22, 2022 at 07:02:45AM -0800, Ajit Khaparde wrote: > On Wed, Nov 16, 2022 at 5:22 AM Leon Romanovsky wrote: > > > ::snip:: > > > > All PCI management logic and interfaces are needed to be inside eth part > > > > of your driver and only that part should implement SR-IOV config. Once > > > > user enabled SR-IOV, the PCI driver should create auxiliary devices for > > > > each VF. These device will have RDMA capabilities and it will trigger RDMA > > > > driver to bind to them. > > > I agree and once the PF creates the auxiliary devices for the VF, the RoCE > > > Vf indeed get probed and created. But the twist in bnxt_en/bnxt_re > > > design is that > > > the RoCE driver is responsible for making adjustments to the RoCE resources. > > > > You can still do these adjustments by checking type of function that > > called to RDMA .probe. PCI core exposes some functions to help distinguish between > > PF and VFs. > > > > > > > > So once the VF's are created and the bnxt_en driver enables SRIOV adjusts the > > > NIC resources for the VF, and such, it tries to call into the bnxt_re > > > driver for the > > > same purpose. > > > > If I read code correctly, all these resources are for one PCI function. > > > > Something like this: > > > > bnxt_re_probe() > > { > > ... > > if (is_virtfn(p)) > > bnxt_re_sriov_config(p); > > ... > > } > I understand what you are suggesting. > But what I want is a way to do this in the context of the PF > preferably before the VFs are probed. I don't understand the last sentence. You call to this sriov_config in bnxt_re driver without any protection from VFs being probed, > So we are trying to call the > bnxt_re_sriov_config in the context of handling the PF's > sriov_configure implementation. Having the ulp_ops is allowing us to > avoid resource wastage and assumptions in the bnxt_re driver. To which resource wastage are you referring? There are no differences if same limits will be in bnxt_en driver when RDMA bnxt device is created or in bnxt_re which will be called once RDMA device is created. Thanks > > ::snip::