Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp308972pxb; Mon, 13 Sep 2021 20:12:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSRiFqig9VZQLycFtepA8sMPeOlCKP879tYux37IyqHs8wib+WflpmVfI4qt3G9Ae+ZXjU X-Received: by 2002:a05:6402:40d1:: with SMTP id z17mr15388771edb.247.1631589161784; Mon, 13 Sep 2021 20:12:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631589161; cv=none; d=google.com; s=arc-20160816; b=xcQQnGmhwWL9ItBUmY42GMjtFGcNLLxa5IKTCbXMW5Rdb2BgoNe+pnO6Srkt8nm7O7 g79hUjm+th/M6urs1xv2bNQCk51WTWRIcgFnFQu+sxYLCKWbumA/shXVOzDQnQUREQGB rQWORq1KPjlB9HhSg4RQrdL+WiIPtTCzx5rB0oC6+7XN5y5BbYlKs0UtvFtaQuiHw6rp Tna7Fj7562CuaRWaoO+lOjFzcwqPQS7De8DbF9RAHwtGoboLTdXtER/qO1hxB1MGWHp+ jeJYO6XIpPZ06Wmbo9exgQ2na2BOsmADbOHBCYAFwUSki0OaiKb27p87nBF1czvVJorI ipMg== 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=8iEHrSJBYnoaNzAvX13CzwScj5XNqY/DmTyDN2Kz7+g=; b=cTCug9eJnB0FfQwIvS5tHImkZ5TEMTQZbUSc1PAMVvz6UKbrt1KmWhmpNBak0qXjlq c8zprE1SZT/3QQZQRJGMpA2u9fPu9ocvnXBF5kg9eUzyC9ruQUilHNV8ptb/OO30rrRu lLIMSQal/M315n56htg7+V4+y0UWkOjlDtsNdIsSZfkHdRSrYtWLaMozwBbu9vVKIlnv eOWFLjOD9QqZix48wHlnhFF84DJQWY8J0G/l5lwvER3gDWTyjJuuT4rFmMagKWUFl4le 5ai7Zk0oJ2N8YB6i3JD2fxlEMQeiJdoiQL37SYHGf4NNJAuOzP7kyqs2BO3MU5cvt+ZR qTVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NDtBMryA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ml15si8670261ejb.747.2021.09.13.20.12.18; Mon, 13 Sep 2021 20:12:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NDtBMryA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S238661AbhINDL2 (ORCPT + 99 others); Mon, 13 Sep 2021 23:11:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:38808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238376AbhINDL2 (ORCPT ); Mon, 13 Sep 2021 23:11:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DDEC960E90; Tue, 14 Sep 2021 03:10:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631589011; bh=OBSvTK9Mvwq13+v31xdl+LwtoLoV9Tl+58u1TVDdvc4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NDtBMryApIiBpCUNt/v5qt5jXAIaf/mUpfl0xAdPm0ysnZ7p+FJuoOVvSiu0JWVxR Ji3hqjupI/WBTs1ioh6d3c4zm3c7veFU8x3Y0WNJBsFwRL8VCl0ONcyjOwFCOt+7DW fM3XdyVwZhj6AZ0NNkkvnBJzoGiFfMEQPpy5xt89ZXaPQ+/UfizMbNayBXdL26+aJu Qp/tJbZcJqNcw97+8OmgmwIHLaHjYTHcv5rTR7Ftwqir/jQ+tHqZnE57zQABLBcH4a SVhTVRWSzW/HjwE1LDAw5vIBY2eYYC4Gs0OZBJbuaRD5p1Rucn2jTxGMKL1JtQTUq5 8GIyOWLRMw2Qg== Date: Tue, 14 Sep 2021 06:10:07 +0300 From: Leon Romanovsky To: "Saleem, Shiraz" Cc: "Ertman, David M" , "davem@davemloft.net" , "kuba@kernel.org" , "yongxin.liu@windriver.com" , "Nguyen, Anthony L" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Brandeburg, Jesse" , "intel-wired-lan@lists.osuosl.org" , "linux-rdma@vger.kernel.org" , "jgg@ziepe.ca" , "Williams, Dan J" , "Singhai, Anjali" , "Parikh, Neerav" , "Samudrala, Sridhar" Subject: Re: [PATCH RESEND net] ice: Correctly deal with PFs that do not support RDMA Message-ID: References: <20210909151223.572918-1-david.m.ertman@intel.com> <4bc2664ac89844a79242339f5e971335@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4bc2664ac89844a79242339f5e971335@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 13, 2021 at 03:49:43PM +0000, Saleem, Shiraz wrote: > > Subject: Re: [PATCH RESEND net] ice: Correctly deal with PFs that do not > > support RDMA > > > > On Thu, Sep 09, 2021 at 08:12:23AM -0700, Dave Ertman wrote: > > > There are two cases where the current PF does not support RDMA > > > functionality. The first is if the NVM loaded on the device is set to > > > not support RDMA (common_caps.rdma is false). The second is if the > > > kernel bonding driver has included the current PF in an active link > > > aggregate. > > > > > > When the driver has determined that this PF does not support RDMA, > > > then auxiliary devices should not be created on the auxiliary bus. > > > > This part is wrong, auxiliary devices should always be created, in your case it will > > be one eth device only without extra irdma device. > > It is worth considering having an eth aux device/driver but is it a hard-and-fast rule? > In this case, the RDMA-capable PCI network device spawns an auxiliary device for RDMA > and the core driver is a network driver. > > > > > Your "bug" is that you mixed auxiliary bus devices with "regular" ones and created > > eth device not as auxiliary one. This is why you are calling to auxiliary_device_init() > > for RDMA only and fallback to non-auxiliary mode. > > It's a design choice on how you carve out function(s) off your PCI core device to be > managed by auxiliary driver(s) and not a bug. I'm not the one who is setting rules, just explaining what is wrong with the current design and proposed solution. The driver/core design expects three building blocks: logic that enumerates (creates) devices, bus that connects those devices (load/unload drivers) and specific drivers for every such device. Such separation allows clean view from locking perspective (separated devices), proper sysfs layout and same logic for the user space tools. In your case, you connected ethernet driver to be "enumerator" and replaced (duplicated) general driver/core logic that decides if to load or not auxiliary device driver with your custom code. Thanks > > Shiraz