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.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,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 CA872C43381 for ; Fri, 29 Mar 2019 18:59:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8DD15206DD for ; Fri, 29 Mar 2019 18:59:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="MrlleMTI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730099AbfC2S7c (ORCPT ); Fri, 29 Mar 2019 14:59:32 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:46028 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730056AbfC2S7b (ORCPT ); Fri, 29 Mar 2019 14:59:31 -0400 Received: by mail-qk1-f193.google.com with SMTP id z76so1982101qkb.12 for ; Fri, 29 Mar 2019 11:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=nKABLsMU7TzGsgTS09z99IEyns8Mhe4C5UGU6lR3d6I=; b=MrlleMTIQD+VdyQVTkyX/ub9tdebogq3CitsGRfCdlojWSKoS4Z3kA0rZOMm+k5EKV rvWKwXueqTD6rOJywTgmaqf5W8ndncK4vecAPo8U5AvEgDRkVSyyxqOhhBO9DMp3DXLL qO5mM8ebcFQxhvo9oOd3qAuFDMAGm58pjKn7V6NwZeeUJCcuQyA1XR25avLunGdOAQQM BZW0Fg/XMjTD+mqsbV1z2XB/nqhJ2KmAA2vJ13W8Yv6835AyeeUvmzcTUwvEfbk/YWi2 KHRWFt10qYWD3qwDde9TEpgn2ndiOeWCMgf/pFTRnzkGlW79b6GviU8OXwQwY7ud67aO 5NRw== 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:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=nKABLsMU7TzGsgTS09z99IEyns8Mhe4C5UGU6lR3d6I=; b=EosbtNpdrJ1Mkwi4D7D+Bqi8mYO6UwCyLl1vYd4Y8aigZ8j+L3EU5B7zqY9gtDiZ/x wU5RmfEUKkO9OB+CfVJAA5vAMvHShMJ3ZzwFomEJjJWUrPONajqe93xsQWp8cCe06mCG fjekoAkr9rXDF8qtF2lUOZQAmb4LmF2IAe/ylSS3KvN8tvo3iEk/DukZ5nwuph8czzfv Mxjh8ReORBXcJc40jNVzAytGKlu5LyuglO2NLM5JZVS2BmM+BwYy2a+4V6ZluLtoKYVT 04cxNr96miYOd/CiXWO2/TmjafvqFLiMDzhYk4MkXU1Hpn9B9aD+lLPZ8kzIJuxVGyiB ryHw== X-Gm-Message-State: APjAAAUJdy+uT+lVmvigjIkHqYccG6sKT/ygxJOVZWZp2JSOiOm2oWTX JXIAjtPMTcjxitNtli5XsSPg9Q== X-Google-Smtp-Source: APXvYqzQ2jlFSNhmlrkMJbX6TEman3FTpv6FjmRRVhi2KwP9dLRhR9FKGD+YcEBcVcINgkMJ3yFTbQ== X-Received: by 2002:a37:a14:: with SMTP id 20mr1207837qkk.265.1553885970831; Fri, 29 Mar 2019 11:59:30 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id g12sm1557346qkk.85.2019.03.29.11.59.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Mar 2019 11:59:30 -0700 (PDT) Date: Fri, 29 Mar 2019 11:59:26 -0700 From: Jakub Kicinski To: Jiri Pirko Cc: netdev@vger.kernel.org, davem@davemloft.net, mlxsw@mellanox.com, idosch@mellanox.com, f.fainelli@gmail.com, andrew@lunn.ch, vivien.didelot@gmail.com, michael.chan@broadcom.com Subject: Re: [patch net-next 00/12] net: expose switch ID via devlink Message-ID: <20190329115926.5c16d2fd@cakuba.netronome.com> In-Reply-To: <20190329064905.GS14297@nanopsycho> References: <20190328211254.1894-1-jiri@resnulli.us> <20190328144002.245c9eef@cakuba.netronome.com> <20190329064905.GS14297@nanopsycho> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 29 Mar 2019 07:49:05 +0100, Jiri Pirko wrote: > Thu, Mar 28, 2019 at 10:40:02PM CET, jakub.kicinski@netronome.com wrote: > >On Thu, 28 Mar 2019 22:12:42 +0100, Jiri Pirko wrote: > >> From: Jiri Pirko > >> > >> To provide visibility of the ports, this patchset exposes switch ID > >> for devlink ports, which are part of a switch. The rest of the ports > >> if any (in case of sr-iov for example) do not set switch ID. > > > >I don't feel good about this patch set. There is no visibility > >provided here. Should the port flavour should be a sufficient > > 1) this patch is mainly about avoiding need to define the ndo and moving > the switch id definition to devlink port attr. Sure, that you could achieve by putting the data in the netdevice structure as well.. What is the guiding principle here? I'm trying to argue for leaving forwarding-related info in netdev code, and only have HW control in devlink. I just don't see switch id being useful at devlink level in any way. > 2) along with that, switch id is added as attribute. It tells the user > that some devlink port is part of a switch with certain id. If port > is not part of a switch (like upcoming hostport, cpu, dsa, etc), > switch id is not set on that port If the flavour already gives that information, why crowd the attributes for ports with switch id? > >indication of whether netdev associated with that port can be > >switched to or not? CPU, DSA, and Host flavours can't be switched > >to. And the switchid can be an attribute of the devlink instance, > >if we want to expose it via devlink. > > One devlink instance can have multiple switch ids in use as it may > contain multiple switches. Take mlx5 as an instance. Currently every PF > creates a separate devlink instance, however there are some features > shared. In this example, with proposed idea of aliasing, there would be > one devlink instance aliased between these 2 pf inctances, with 2 > eswitches and 2 sets of switch ports each belonging to an eswitch - > distinguished by switch id. Out of curiosity, what are the shared features? It seems mlx5 drives a lot of our API design, it'd be good if the community had a better understanding of it. The situation with pipelined devices is somewhat murky. Didn't Or add some from of PCIe-side looped queue to forward between PFs? Presumably DSA would lean the opposite way with multiple ASICs reporting the same ID?