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.5 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham 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 DA3D6C43381 for ; Wed, 13 Mar 2019 07:47:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8E2FA2171F for ; Wed, 13 Mar 2019 07:47:32 +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="uWqyTST7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726939AbfCMHrb (ORCPT ); Wed, 13 Mar 2019 03:47:31 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36980 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726829AbfCMHrb (ORCPT ); Wed, 13 Mar 2019 03:47:31 -0400 Received: by mail-wr1-f66.google.com with SMTP id y15so799654wro.4 for ; Wed, 13 Mar 2019 00:47:29 -0700 (PDT) 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=qmrk14SA0E8cprdgXRciDKmtgQzL2N8IAgkEYCw4nqY=; b=uWqyTST7vZkKQb5+4fDrJz2nbccSrfhiib+GPUM5Q6f8a59k16vQBxKavV32+LqCxd dKKnCtE2uSc27a0jmKEZQZjAbSKRR+kyM3fEX6HHKh+4ZAG0CPrx0Z/0HFjmIQicUfvI ipR4vFoTAhcBmeaLiEL1/Ll8QKOGVzV63irIw5wE1s88+gIxiN3rXyzBAmpdBkrzANh/ iSFPXtBwaaS/FxGkjEsDwAYcqkA/WKyFZwKp/QnLlxESDMXhlxYhIORrgb7yW55S7dwt qH2svsdvuJ9NcwrQLKa97EIVOhAbeJIkruDV77557YOcpbL1bYLQmfg2tWapehqV79WE x5BQ== 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=qmrk14SA0E8cprdgXRciDKmtgQzL2N8IAgkEYCw4nqY=; b=YuxCT7cpwLh0qYlCV1eZU0Ei+D7KtZTh5LD4TbcHozUXvmJdAJ8fZ9zr+B2V9ap9Hj 6IZ9YdQmfslGdamp6fqyYdYa54idZfcG4Zp4CkDav0EwJuEQPigMDSxF8wzSjttu3D8D U7U8gVn7SDAeVafteqYNITvWotIpSFZ/s9UUoZMp0qOjVGGZHUB/04E2aF//YFHyI13i JxKg2zYkAMTuUr8rd61YWfQIVO3/bffskZVsdAHcl8whGoIjyrvKlhZmLJSxDMvKLh87 BDX1DrJeT+LJ/k663K8mTbdy2rgWaFBhOePvvVtKwB+0lvqUz6NYxduGjZHp0tIIuPMs bsbA== X-Gm-Message-State: APjAAAV5YB5gu9wNzrQ1CifXHnQMfpk18TbNYXrtkqyGqaBsSoQwGAa9 Axb8HUldnfiY2vbYI4kT7PF2x+UylMo= X-Google-Smtp-Source: APXvYqy8sOuwSIBQYePt03l/aOhvbncP/gRAM0ZcirdLTnS1KHGndE24gX0ttmoDS4EOppulC0XXDQ== X-Received: by 2002:adf:fe05:: with SMTP id n5mr13469686wrr.160.1552463248753; Wed, 13 Mar 2019 00:47:28 -0700 (PDT) Received: from localhost (mail.chocen-mesto.cz. [85.163.43.2]) by smtp.gmail.com with ESMTPSA id z15sm1018125wmi.46.2019.03.13.00.47.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Mar 2019 00:47:28 -0700 (PDT) Date: Wed, 13 Mar 2019 08:37:02 +0100 From: Jiri Pirko To: "Samudrala, Sridhar" Cc: Jakub Kicinski , davem@davemloft.net, netdev@vger.kernel.org, oss-drivers@netronome.com Subject: Re: [PATCH net-next v2 4/7] devlink: allow subports on devlink PCI ports Message-ID: <20190313073702.GA2270@nanopsycho> References: <20190306122037.GB2819@nanopsycho> <20190306095638.7c028bdd@cakuba.hsd1.ca.comcast.net> <20190307094816.GA2190@nanopsycho> <20190307185202.2db37490@cakuba.hsd1.ca.comcast.net> <20190308145421.GA2888@nanopsycho.orion> <20190308110943.2ee42bc0@cakuba.hsd1.ca.comcast.net> <20190311085204.GA2194@nanopsycho> <20190311191054.36b801d6@cakuba.hsd1.ca.comcast.net> <20190312140239.GA2455@nanopsycho> <7227d58e-ac58-d549-b921-ca0a0dd3f4b0@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7227d58e-ac58-d549-b921-ca0a0dd3f4b0@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Wed, Mar 13, 2019 at 07:17:04AM CET, sridhar.samudrala@intel.com wrote: > >On 3/12/2019 7:02 AM, Jiri Pirko wrote: > >> >> > >> > > I originally planned to implement sriov orchestration api in devlink too. >> > >> > Interesting, would you mind elaborating? >> >> I have to think about it. But something like this: >> >> After bootup, you see only physical port, PF switch port and PF host leg. > >Is this after changing the eswitch mode to 'switchdev' I believe so. For new drivers, this should be default and only option. > >> $ devlink port show >> pci/0000:05:00.0/0: type eth netdev enp5s0np0 flavour physical switch_id 00154d130d2 > >Is this the uplink port representor? Yes > >> pci/0000:05:00.0/1: type eth netdev ??? flavour pci_pf_host >> peer pci/0000:05:00.0/10000 > >I guess this is PF netdev Yes, port > >> pci/0000:05:00.0/10000: type eth netdev enp5s0npf0pf0s0 flavour pci_pf pf 0 subport 0 >> switch_id 00154d130d2f peer pci/0000:05:00.0/1 > >and this one is PF port representor netdev Yes, port > >> >> To create new PF subport under PF 0: >> $ devlink dev port add pci/0000:05:00.0 flavour pci_pf pf 0 > >Can we consider l2-fwd offload macvlan device also as a subport of PF? What does this have to with with macvlan? Macvlan is a separate soft driver. > >> $ devlink port show >> pci/0000:05:00.0/0: type eth netdev enp5s0np0 flavour physical switch_id 00154d130d2 >> pci/0000:05:00.0/1: type eth netdev ??? flavour pci_pf_host >> peer pci/0000:05:00.0/10000 >> pci/0000:05:00.0/10000: type eth netdev enp5s0npf0pf0s0 flavour pci_pf pf 0 subport 0 >> switch_id 00154d130d2f peer pci/0000:05:00.0/1 >> pci/0000:05:00.0/2: type eth netdev ??? flavour pci_pf_host <<<<<<<<<<<<<<<<<< >> peer pci/0000:05:00.0/10001 <<<<<<<<<<<<<<<<<< >> pci/0000:05:00.0/10001: type eth netdev enp5s0npf0pf0s0 flavour pci_pf pf 0 subport 1 <<<<<<<<<<<<<<<<<< >> switch_id 00154d130d2f peer pci/0000:05:00.0/2 <<<<<<<<<<<<<<<<<< >> >> To create a new VF under PF 0: >> $ devlink dev port add pci/0000:05:00.0 flavour pci_vf pf 0 > >Does this mean that this interface allows creating VFs dynamically one at a >time? Yes > >> $ devlink port show >> pci/0000:05:00.0/0: type eth netdev enp5s0np0 flavour physical switch_id 00154d130d2 >> pci/0000:05:00.0/1: type eth netdev ??? flavour pci_pf_host >> peer pci/0000:05:00.0/10000 >> pci/0000:05:00.0/10000: type eth netdev enp5s0npf0pf0s0 flavour pci_pf pf 0 subport 0 >> switch_id 00154d130d2f peer pci/0000:05:00.0/1 >> pci/0000:05:00.0/2: type eth netdev ??? flavour pci_pf_host >> peer pci/0000:05:00.0/10001 >> pci/0000:05:00.0/10001: type eth netdev enp5s0npf0pf0s0 flavour pci_pf pf 0 subport 1 >> switch_id 00154d130d2f peer pci/0000:05:00.0/2 >> pci/0000:05:10.1/0: type eth netdev ??? flavour pci_vf_host <<<<<<<<<<<<<<<<<< >> peer pci/0000:05:00.0/10002 <<<<<<<<<<<<<<<<<< >> pci/0000:05:00.0/10002: type eth netdev enp5s0npf0pf0s0 flavour pci_vf pf 0 vf 0 <<<<<<<<<<<<<<<<<< >> switch_id 00154d130d2f peer pci/0000:05:10.1/0 <<<<<<<<<<<<<<<<<< >> >> So new VF is created. >> >> >> To delete, use would need to use the port which is in eswitch: >> $ devlink port del pci/0000:05:00.0/2 >> devlink answers: Operation not permitted >> $ devlink port del pci/0000:05:00.0/10001 <<<<<<<<<< this >> >> $ devlink port del pci/0000:05:10.1/0 >> devlink answers: Operation not permitted >> $ devlink port del pci/0000:05:00.0/10002 <<<<<<<<<< this >> >> This actually removes VF. >> >> >> For VF subports this would work too, we just have to have "subport" >> attribute not only for PFs but also for VFs: >> >> To create a new VF subport under PF 0 and VF 0: >> $ devlink dev port add pci/0000:05:00.0 flavour pci_vf pf 0 vf 0 >> $ devlink port show >> pci/0000:05:00.0/0: type eth netdev enp5s0np0 flavour physical switch_id 00154d130d2 >> pci/0000:05:00.0/1: type eth netdev ??? flavour pci_pf_host >> peer pci/0000:05:00.0/10000 >> pci/0000:05:00.0/10000: type eth netdev enp5s0npf0pf0s0 flavour pci_pf pf 0 subport 0 >> switch_id 00154d130d2f peer pci/0000:05:00.0/1 >> pci/0000:05:00.0/2: type eth netdev ??? flavour pci_pf_host >> peer pci/0000:05:00.0/10001 >> pci/0000:05:00.0/10001: type eth netdev enp5s0npf0pf0s0 flavour pci_pf pf 0 subport 1 >> switch_id 00154d130d2f peer pci/0000:05:00.0/2 >> pci/0000:05:10.1/0: type eth netdev ??? flavour pci_vf_host >> peer pci/0000:05:00.0/10002 >> pci/0000:05:00.0/10002: type eth netdev enp5s0npf0pf0s0 flavour pci_vf pf 0 vf 0 subport 0 >> switch_id 00154d130d2f peer pci/0000:05:10.1/0 >> pci/0000:05:10.1/1: type eth netdev ??? flavour pci_vf_host <<<<<<<<<<<<<<<<<< >> peer pci/0000:05:00.0/10003 <<<<<<<<<<<<<<<<<< >> pci/0000:05:00.0/10003: type eth netdev enp5s0npf0pf0s0 flavour pci_vf pf 0 vf 0 subport 1 <<<<<<<<<<<<<<<<<< >> switch_id 00154d130d2f peer pci/0000:05:10.1/1 <<<<<<<<<<<<<<<<<< >> >>