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=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 5CC9AC433DF for ; Fri, 29 May 2020 08:30:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 322B6207BC for ; Fri, 29 May 2020 08:30:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JD5xqc3a" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726115AbgE2Ia4 (ORCPT ); Fri, 29 May 2020 04:30:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725306AbgE2Iaz (ORCPT ); Fri, 29 May 2020 04:30:55 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D8C6C03E969 for ; Fri, 29 May 2020 01:30:55 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id l27so1273604ejc.1 for ; Fri, 29 May 2020 01:30:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4drjY3GtswmXUpynwtnC1DxxRb68vUXPtN4B0R+zr5E=; b=JD5xqc3aYEFA8GAHldSxgy4X/eynKmFSbnJKv1m+gUnYBBGliwA/dMsdmslNhj/Hdw EGVrMjXtYaEILrE8+heyWQjHGA6jybDKGu9KPl2MfnDb+53hVsdv4/2egiUxavDT3tHc 5/Zzg3GoToT0fkkCBFVF7kym5XmCPqfbbhhfO3GQh6adO9z1fSqwWszetAiJwAzc7ymE lBQQ7hQvF74GTW0iU4WIl6sOOuc9Sw+23czRXMSYgLMZDyW7JuFAZsipqR6fdtNPoWE3 RCXnjCmce9xf+PgfDQjjnh6EN49XQ6n+gOzQ0pvJHNKzckJEUQ8e3F0pGtrLNcVg78yt JE/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4drjY3GtswmXUpynwtnC1DxxRb68vUXPtN4B0R+zr5E=; b=idDVmP6ia7azr7wQYqwWeWUc7I2+VeMWcTJ7FVs8MkacRbTDOVh7KgXN+gKRv0m+mE Nrtpdf1rJ1TbauBot8ewnpJrEy2++h1H3lTmIqeaF5CjikGs9Ou+IDiDQ3fcH+JGNxGe nKuCkoTVBTsEZeqdxdxVYBxqv8n03TpVLQl907MyQOpg/bgv1qI+P162K9GyTDPeUQbD U70tOP60Eg0jgCaRc2TC0cqZyLcXwAfsjkYCvjIk6StEq168umHN79rX5S+pJxgpDjG0 0Sb+bjYQL4bv07WMSjtyAu3Aeq5IMRMFA2AC8619Lfmg1nXB73b1gQvCWIf5wTVRLU8I dTrg== X-Gm-Message-State: AOAM532C9EuXT0GyvEvHBF96re4CQ62I3w8/5swbKGxmC/762h13yiii BzCS46Phmt9jLoAMFLBl1RW9SOBau8DyaFsIwxwFwQ== X-Google-Smtp-Source: ABdhPJyqY/GdvmTF0kQElUycwN0nbs2ywtMt9I9KQ0lNUkR6qV8TS4XuYbJXgfYM7da42dl+Qmtzj1IZhA03JseWYIg= X-Received: by 2002:a17:906:a843:: with SMTP id dx3mr6310876ejb.396.1590741054010; Fri, 29 May 2020 01:30:54 -0700 (PDT) MIME-Version: 1.0 References: <20200527234113.2491988-1-olteanv@gmail.com> <20200527234113.2491988-12-olteanv@gmail.com> <20200528215618.GA853774@lunn.ch> <20200529081441.GW3972@piout.net> In-Reply-To: <20200529081441.GW3972@piout.net> From: Vladimir Oltean Date: Fri, 29 May 2020 11:30:43 +0300 Message-ID: Subject: Re: [PATCH net-next 11/11] net: dsa: ocelot: introduce driver for Seville VSC9953 switch To: Alexandre Belloni Cc: Andrew Lunn , "David S. Miller" , netdev , Vivien Didelot , Florian Fainelli , Russell King - ARM Linux admin , Antoine Tenart , Horatiu Vultur , "Allan W. Nielsen" , Microchip Linux Driver Support , Alexandru Marginean , Claudiu Manoil , "Madalin Bucur (OSS)" , radu-andrei.bulie@nxp.com, fido_max@inbox.ru Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Alexandre, On Fri, 29 May 2020 at 11:14, Alexandre Belloni wrote: > > On 29/05/2020 01:09:16+0300, Vladimir Oltean wrote: > > On Fri, 29 May 2020 at 00:56, Andrew Lunn wrote: > > > > > > > Extending the Felix driver to probe a PCI as well as a platform device > > > > would have introduced unnecessary complexity. The 'meat' of both drivers > > > > is in drivers/net/ethernet/mscc/ocelot*.c anyway, so let's just > > > > duplicate the Felix driver, s/Felix/Seville/, and define the low-level > > > > bits in seville_vsc9953.c. > > > > > > Hi Vladimir > > > > > > That has resulted in a lot of duplicated code. > > > > > > Is there an overall family name for these switch? > > > > > > Could you add foo_set_ageing_time() with both felix and saville share? > > > > > > Andrew > > > > Yes, it looks like I can. I can move Felix PCI probing to > > felix_vsc9959.c, Seville platform device probing to seville_vsc9953.c, > > and remove seville.c. > > I would not be in a position to know whether there's any larger family > > name which should be used here. According to > > https://media.digikey.com/pdf/Data%20Sheets/Microsemi%20PDFs/Ocelot_Family_of_Ethernet_Switches_Dec2016.pdf, > > "Ocelot is a low port count, small form factor Ethernet switch family > > for the Industrial IoT market". Seville would not qualify as part of > > the Ocelot family (high port count, no 1588) but that doesn't mean it > > can't use the Ocelot driver. As confusing as it might be for the > > people at Microchip, I would tend to call anything that probes as pure > > switchdev "ocelot" and anything that probes as DSA "felix", since > > As ocelot can be used in a DSA configuration (even if it is not > implemented yet), I don't think this would be correct. From my point of > view, felix and seville are part of the ocelot family. > In this case, there would be a third driver in drivers/net/dsa/ocelot/ocelot_vsc7511.c which uses the intermediate felix_switch_ops from felix.c to access the ocelot core implementation. Unless you have better naming suggestions? > > these were the first 2 drivers that entered mainline. Under this > > working model, Seville would reuse the struct dsa_switch_ops > > felix_switch_ops, while having its own low-level seville_vsc9953.c > > that deals with platform integration specific stuff (probing, internal > > MDIO, register map, etc), and the felix_switch_ops would call into > > ocelot for the common functionalities. > > What do you think? > > > > -Vladimir > > -- > Alexandre Belloni, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com Thanks, -Vladimir