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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34069C43331 for ; Mon, 11 Nov 2019 13:30:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F3C5F222BD for ; Mon, 11 Nov 2019 13:30:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20150623.gappssmtp.com header.i=@resnulli-us.20150623.gappssmtp.com header.b="s328wBZB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727020AbfKKNaa (ORCPT ); Mon, 11 Nov 2019 08:30:30 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:34495 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727002AbfKKNa3 (ORCPT ); Mon, 11 Nov 2019 08:30:29 -0500 Received: by mail-wm1-f67.google.com with SMTP id j18so3173315wmk.1 for ; Mon, 11 Nov 2019 05:30:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mkwenBuk+yOAxdES4LJS2kpTu2gXDKAkkdekG5IpFbI=; b=s328wBZB9kmOFPu4tqfyJMK+7A3waE1Qg75T6g83rUmKO/zjxLvxrHVvPNXJXpOeH/ GCzJ3BeVkRa+0fRmeqCMvHYDRtabAIkSO0KudD+4MoildGDktJiNurEd4Bx21E6OTAZ9 aYVXy7VSZXvm5EPSjShNaklxzwzydP4jKIu7REnJq3uxQwFHZqCeqtnpfXJm/QU95wIt uGZKN+tGdH1/uclUdMnOBG1Ax5e2u/121WZVo6BkUpFVC/JPqDJoaaRO0wR7Jxd0lYqF H0LR03kV+Y8BEZH76EZqZsUT1s0JV9D3yejviqk66P8pM+m6DWg7vpTJmaWyaw8TpwGz a2eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mkwenBuk+yOAxdES4LJS2kpTu2gXDKAkkdekG5IpFbI=; b=n2DRI55l3gr6bVPG6CBQ97wnEzgV5EMlHcz9MaU0BgeqBbWngHSheF0t55FZgr3iHJ T2PIasTw8hc3nuJYuDB3lCzXnwnQmY+p6qHy5eUECmNBHfznp1M1mTIIzlOA+vaynCeU QqjHmA2slUpzMXwkKOVTJE5TMUi2VdhoSIOgSBc4cXSvUfSH95RNOEgooYgxJdBqrunb MejIALGo7sHaYE38vfITBNe1+3MMYqlOLFGwvfofUQZ0CqmeJfo21UFg0bkZ0wdVN/2Z plIkEyePysynZuKvmeAGEklNTH7OzscRgGMTUAVhr/C05IYrlsOWbR0J+hlnbebo4hTw 0DeA== X-Gm-Message-State: APjAAAXN5bd0k/YjASxviuAJl8CFfJXoSJ1Jsmb3vnkehRaKrMZytjer 2wq4/lo8yPf/7rKa/nD2hzA/kQ== X-Google-Smtp-Source: APXvYqzwooUbxzm69efOp0rljYcE0gAn6F/FddFwTjRmADcvS5J3lQevJ5I6HflzU4YKaBn7XXxoTw== X-Received: by 2002:a1c:1d48:: with SMTP id d69mr19104416wmd.160.1573479028082; Mon, 11 Nov 2019 05:30:28 -0800 (PST) Received: from localhost (jirka.pirko.cz. [84.16.102.26]) by smtp.gmail.com with ESMTPSA id y6sm9905517wrn.21.2019.11.11.05.30.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 05:30:27 -0800 (PST) Date: Mon, 11 Nov 2019 14:30:26 +0100 From: Jiri Pirko To: Jakub Kicinski Cc: "gregkh@linuxfoundation.org" , Jason Gunthorpe , Parav Pandit , David M , "alex.williamson@redhat.com" , "davem@davemloft.net" , "kvm@vger.kernel.org" , "netdev@vger.kernel.org" , Saeed Mahameed , "kwankhede@nvidia.com" , "leon@kernel.org" , "cohuck@redhat.com" , Jiri Pirko , "linux-rdma@vger.kernel.org" , Or Gerlitz Subject: Re: [PATCH net-next 00/19] Mellanox, mlx5 sub function support Message-ID: <20191111133026.GA2202@nanopsycho> References: <20191108121233.GJ6990@nanopsycho> <20191108144054.GC10956@ziepe.ca> <20191108111238.578f44f1@cakuba> <20191108201253.GE10956@ziepe.ca> <20191108134559.42fbceff@cakuba> <20191109004426.GB31761@ziepe.ca> <20191109092747.26a1a37e@cakuba> <20191110091855.GE1435668@kroah.com> <20191110194601.0d6ed1a0@cakuba> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191110194601.0d6ed1a0@cakuba> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Mon, Nov 11, 2019 at 04:46:01AM CET, jakub.kicinski@netronome.com wrote: >On Sun, 10 Nov 2019 10:18:55 +0100, gregkh@linuxfoundation.org wrote: >> > What I'm missing is why is it so bad to have a driver register to >> > multiple subsystems. >> >> Because these PCI devices seem to do "different" things all in one PCI >> resource set. Blame the hardware designers :) > >See below, I don't think you can blame the HW designers in this >particular case :) > >> > For the nfp I think the _real_ reason to have a bus was that it >> > was expected to have some out-of-tree modules bind to it. Something >> > I would not encourage :) >> >> That's not ok, and I agree with you. >> >> But there seems to be some more complex PCI devices that do lots of >> different things all at once. Kind of like a PCI device that wants to >> be both a keyboard and a storage device at the same time (i.e. a button >> on a disk drive...) > >The keyboard which is also a storage device may be a clear cut case >where multiple devices were integrated into one bus endpoint. Also, I think that very important differentiator between keyboard/button and NIC is that keyboard/button is fixed. You have driver bus with 2 devices on constant addresses. However in case of NIC subfunctions. You have 0 at he beginning and user instructs to create more (maybe hundreds). Now important questions appear: 1) How to create devices (what API) - mdev has this figured out 2) How to to do the addressing of the devices. Needs to be predictable/defined by the user - mdev has this figured out 3) Udev names of netdevices - udev names that according to the bus/address. That is straightforeward with mdev. I can't really see how to figure this one in particular with per-driver busses :/ > >The case with these advanced networking adapters is a little different >in that they are one HW device which has oodles of FW implementing >clients or acceleration for various networking protocols. > >The nice thing about having a fake bus is you can load out-of-tree >drivers to operate extra protocols quite cleanly. > >I'm not saying that's what the code in question is doing, I'm saying >I'd personally like to understand the motivation more clearly before >every networking driver out there starts spawning buses. The only >argument I've heard so far for the separate devices is reloading subset >of the drivers, which I'd rate as moderately convincing.