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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS 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 EF88AC43381 for ; Thu, 28 Feb 2019 16:24:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AFE10218C3 for ; Thu, 28 Feb 2019 16:24:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NwQk0F+j" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732348AbfB1QYh (ORCPT ); Thu, 28 Feb 2019 11:24:37 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42486 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726269AbfB1QYh (ORCPT ); Thu, 28 Feb 2019 11:24:37 -0500 Received: by mail-pf1-f196.google.com with SMTP id n74so9950332pfi.9 for ; Thu, 28 Feb 2019 08:24:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=UAAB7qqPOX+dssTGBe2gbVWLwbiK/hTeD4q6eHr7A3w=; b=NwQk0F+jLWI3ENzmKZRH7jubdFQdUTZ6jk+JSfVTdu4OmOf6LPUzknl567bAU5QoK0 bWl+x/mwzPUWui4TbZ5fNghaQSYaBlAYl9VBQsbvWAgeT4miletEihyPjTTt/C2ANpWL rL7PDuGCiLLuHUVDhMZ6HN3Js4rPfooPFeLU3UbVlYak7rV34vjb+J5OMK3AxKWpBUwo pR7D47yRXMHtV5sbuVWbNkxggHCXIBS+B+tobkG7y2IBCtVP/gkOuPFglbwTIqo2dckA nUJSfKo1CKspFzIzSdP8JUGKjlhlmf+/Qxp+ZnPKieaifjsbeYYCcfUvhcQfiawdIFiZ xsfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UAAB7qqPOX+dssTGBe2gbVWLwbiK/hTeD4q6eHr7A3w=; b=S6iPIlukrx/WtPbMC1o3nI8Jyy++fbBWg4qhep1UdfPBVYJ1ZxZlYoFu7MSFy9Abu0 oW1SweFGNzEqp5XvbvH132CTF3k6w5MOgEFgbSjh/qWP6jkgtvjWzPzB9gKWRWQzJC1J +JGXq22oy3oazo0IOA3yO4+9MOTtyv5yO77vyt+qbYaH8yKxUaaaInLBpjbiram7uSY+ wDldqD0BXWRTcclJfFyBmiDqbq7ekYl8TBywjFV6gLtFA7yP05/SjtTBVKtGgSIn/GKn ldR82PFgFnCa9/4zUkumyW1pyQLAJ1IH4i/Xk43Bbpuco1Su9D2Z0faDUU60qHMoCUaG 6Lzw== X-Gm-Message-State: APjAAAXINs+KRuwFDHIp08Ly37Swnq78Rr5DqBqbJ3B8hEhUvz4QnKzv AHPxIpgwa6wQxDPdB6+0LpV6bR7D X-Google-Smtp-Source: APXvYqz62F/G7Jq/mDgu+a5e3xSb8pZmNrfbKZA20aQPjOgqCYqU8Z81VoJ/PvIDhCHWqz5QGLBSOw== X-Received: by 2002:a63:d810:: with SMTP id b16mr5664pgh.220.1551371075905; Thu, 28 Feb 2019 08:24:35 -0800 (PST) Received: from ?IPv6:2601:282:800:fd80:426:ff55:d0ef:2e52? ([2601:282:800:fd80:426:ff55:d0ef:2e52]) by smtp.googlemail.com with ESMTPSA id n25sm45581961pfi.173.2019.02.28.08.24.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Feb 2019 08:24:34 -0800 (PST) Subject: Re: [PATCH net-next 2/8] devlink: add PF and VF port flavours To: Jakub Kicinski , Jiri Pirko Cc: davem@davemloft.net, oss-drivers@netronome.com, netdev@vger.kernel.org References: <20190226182436.23811-1-jakub.kicinski@netronome.com> <20190226182436.23811-3-jakub.kicinski@netronome.com> <20190227122327.GA10571@nanopsycho> <20190227124135.GB10571@nanopsycho> <20190227092326.5abf417b@cakuba.netronome.com> <20190227201727.GA2042@nanopsycho> <20190227144239.55481885@cakuba.netronome.com> From: David Ahern Message-ID: <0671e26e-2bb5-5360-e062-70abfaf1faf7@gmail.com> Date: Thu, 28 Feb 2019 09:24:33 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190227144239.55481885@cakuba.netronome.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2/27/19 3:42 PM, Jakub Kicinski wrote: > On Wed, 27 Feb 2019 21:17:27 +0100, Jiri Pirko wrote: >> Wed, Feb 27, 2019 at 06:23:26PM CET, jakub.kicinski@netronome.com wrote: >>> On Wed, 27 Feb 2019 13:41:35 +0100, Jiri Pirko wrote: >>>> Wed, Feb 27, 2019 at 01:23:27PM CET, jiri@resnulli.us wrote: >>>>> Tue, Feb 26, 2019 at 07:24:30PM CET, jakub.kicinski@netronome.com wrote: >>>>>> Current port flavours cover simple switches and DSA. Add PF >>>>>> and VF flavours to cover "switchdev" SR-IOV NICs. >>>>>> >>>>>> Example devlink user space output: >>>>>> >>>>>> $ devlink port >>>>>> pci/0000:82:00.0/0: type eth netdev p4p1 flavour physical >>>>>> pci/0000:82:00.0/10000: type eth netdev eth0 flavour pcie_pf pf 0 >>>>>> pci/0000:82:00.0/10001: type eth netdev eth1 flavour pcie_vf pf 0 vf 0 >>>>>> pci/0000:82:00.0/10002: type eth netdev eth2 flavour pcie_vf pf 0 vf 1 >>>>> >>>>> Wait a second, howcome pf and vfs have the same PCI address? >>>> >>>> Oh, I think you have these as eswitch port representors. Confusing... >>> >>> FWIW I don't like the word representor, its a port. We don't call >>> physical ports "representors" even though from ASIC's point of view >>> they are exactly the same. >> >> My point is, they are not PFs and VFs. We have to find a way to clearly >> see what's what. > > Okay, so let me explain the way I see it, and you can explain your way > or tell me where you disagree. Those devlink ports and netdevs are pf > ports and vf ports, which most refer to as "representor". If one sends > packets to the netdev indicated in DEVLINK_ATTR_PORT_NETDEV_* > attributes they will _egress_ the switch from that port. For physical > port that means going onto the Ethernet or IB wire. For PCIe it means > getting DMAed over the PCIe link to host memory. > > There is a netdev construct on the host which is in charge of that > host memory. Maybe we shall call that host netdev? > > (I said I don't like "representor" for the reason that people don't > refer to the physical port as "representor" even though it has exactly > the semantics we are following. This distinction between behaviour of > physical and PCI ports is what leads to confusion, I think.) > > Let me bring out the moose :) > > HOST A || HOST B > || > PF A | V | V | V | V || PF B | V | V | V > |*F |*F |*F |*F ... || |*F |*F |*F ... > *port A0 |*port A1 | 0 | 1 | 2 | 3 ||*port B0 |*port B1 | 0 | 1 | 2 > || > PCI Express link || PCI Express link > \ \ \ | | | | | / / / > \ \ \ | | | | | / / / > /\ \______\______\'___|___|__________|_______'____/___/___/__ /\ > || |+PF0s0|+PF0s1 |+VF0|+VF1| ...| |+PF1s0|+PF1s1|+VF0|+VF1| || > i || |------ ------ ----- ---- ----|--- ------ ------ ---- ----| || i > d n H || | <<========== | || d n H > e s O || | ==========>> | || e s O > v t S || | SR-IOV e-switch | || v t S > l a T || | <<========== | || l a T > i n || | ==========>> | || i n > n c A || | ________ _________ ________ | || n c B > k e || | |+Phys 0 |+Phys 1 |+Phys 2 | | || k e > || \---------------------------------------------------------/ || > \/ | | | \/ > | | | > || || > MAC 0 || MAC 1 || MAC 2 > || || > > Things marked with + are devlink ports and have port (-repr-) netdevs > (including physical ports). > Things marked with * are host netdevs, don't have devlink ports. > That would a good update to the commit message or cover letter.