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=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 3A50AC4360F for ; Wed, 27 Mar 2019 23:47:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC9D12146F for ; Wed, 27 Mar 2019 23:47:00 +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="Cc7ij2um" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387451AbfC0Xq7 (ORCPT ); Wed, 27 Mar 2019 19:46:59 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43441 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387686AbfC0Xq5 (ORCPT ); Wed, 27 Mar 2019 19:46:57 -0400 Received: by mail-wr1-f68.google.com with SMTP id k17so12658367wrx.10 for ; Wed, 27 Mar 2019 16:46:56 -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=BWtTO3K4+Z+gEwlqaTu/RWhG2vnoH6pggLRDrC1lGPA=; b=Cc7ij2umHiuM4dRyuGYkFAXDEjfRapJDwf4uaRgGa6/3GktJp+EXb/3yGY63BquF79 VBEUqPzjMy8uSG4Zj/hGZ2rNW4VgvMad+wJIPEMKEWM/JiiGJ5ZUkaGJcnwEP6tdNsRP dmKdsyiRyiHr6sKF+L1QCQQeeXdc6y4Tzjz2/Egfymhrln+1Nvy15kMX0WuTHfe1c7sx GnSu9zAvU/v732oJm74cU4i0xRjvci1s6C/gF/xFZWRTLL7aVAZrxL4/o1fQUFnfztcM A6MWLTM681y3cNs+fTgrXs3vlhkwzhYbUlPL6SRxwCqW/IwHOSUtYzPPGa29gSN5h/SV HUgw== 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=BWtTO3K4+Z+gEwlqaTu/RWhG2vnoH6pggLRDrC1lGPA=; b=R5X2giH8S88WzO/hGPxGhMUpXxGo5XEHZCXS+hQuepX/w7EM/uu5XLtC0n5LtE5xmx U6kiTdAC00wxwkyMo8Qhr2pt8+2uBkwNxqZB/qUJO2BunOtE73f+HXeLKwgcWN1WOlfx Bxc88l8bMRB2GAmMu7lb+oIpN+ej0OWwhlaMY04DfVI+J1mK9yF7nn7l+lcpuhXN6VRB WUL3c9kGHGNDO6NxoEoKxsro08nujZHsYve4SJVSdv/cP8KQpaQTuyJIIfaYB/0mC2tP tI0s5G3ha81TYWJeGK10oZdHXBrrAboXGGAG3gnH+A7YDWZgCVpg5VNGgARLPepD+ohh d6SQ== X-Gm-Message-State: APjAAAVW9pVAeQKxgG6B+BXE5H+hyMuJFLkYxYSOjtXiURGrpXNOMNm9 UAV9XYE3JjRdhSZfF6S8u6QJoIeZ2Vo= X-Google-Smtp-Source: APXvYqwJHo3rBkwsaTiwB8Vtu84AAcp4+PEL48FvqmOg2q15LpTGKbn7pdjsSvTYcwiB64HT1zNKIw== X-Received: by 2002:adf:e407:: with SMTP id g7mr14223558wrm.47.1553730415513; Wed, 27 Mar 2019 16:46:55 -0700 (PDT) Received: from localhost (ip-94-113-223-73.net.upcbroadband.cz. [94.113.223.73]) by smtp.gmail.com with ESMTPSA id r16sm12315306wrx.37.2019.03.27.16.46.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 16:46:55 -0700 (PDT) Date: Thu, 28 Mar 2019 00:46:54 +0100 From: Jiri Pirko To: Florian Fainelli Cc: netdev@vger.kernel.org, davem@davemloft.net, mlxsw@mellanox.com, idosch@mellanox.com, jakub.kicinski@netronome.com, andrew@lunn.ch, vivien.didelot@gmail.com, michael.chan@broadcom.com Subject: Re: [patch net-next v2 08/12] dsa: implement ndo_get_devlink_port Message-ID: <20190327234654.GI14297@nanopsycho> References: <20190326120307.2953-1-jiri@resnulli.us> <20190326120307.2953-9-jiri@resnulli.us> <6477e604-0b6a-fa49-920f-9a1fd4478dbb@gmail.com> <20190327200122.GF14297@nanopsycho> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Wed, Mar 27, 2019 at 09:13:00PM CET, f.fainelli@gmail.com wrote: >On 3/27/19 1:01 PM, Jiri Pirko wrote: >> Wed, Mar 27, 2019 at 08:54:41PM CET, f.fainelli@gmail.com wrote: >>> On 3/26/2019 5:03 AM, Jiri Pirko wrote: >>>> From: Jiri Pirko >>>> >>>> In order for devlink compat functions to work, implement >>>> ndo_get_devlink_port. Legacy slaves does not have devlink port instances >>>> created for themselves. >>> >>> Not a big fan of de-duplicating the entire set of netdev_ops for legacy >>> vs. non-legacy, can we just check that the devlink instance was r >> >> In nfp, I make legacy and non-legacy ndos to be shared. However there, >> they are doing to eventually all use devlink ports. In dsa on the other >> hand, I don't think that legacy is going to use devlink port, would it? > >The legacy probing method has not been updated to match what >net/dsa/dsa2.c does, but there is no technical reason for not supporting >devlink instances over ports registered through the legacy interface. So >eventually all of what you did here will be thrown away (not sure by >which timeframe, probably after mv88e6060 finally gets converted to the >new binding). Okay. In that case, when you say legacy will be eventually remove, Will do the same as I did for nfp. Thanks! > >> I wan't to eventually have WARN_ON in devlink code in case devlink_port >> exists and phys_port_name ndo is present at the same time. >> > >No sure, but you could always do something like: > >if (!dp->devlink_registered) > return dsa_slave_get_phys_port_name(); > >return &dp->devlink_port; > >is what I had in mind. This just requires adding a boolean to track the >registration of devlink ports within net/dsa/dsa2.c which should be >fewer lines of code and easier to remove in the future. No strong >objections though. >-- >Florian