Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3489017pxv; Mon, 28 Jun 2021 05:50:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwMhtt2ufEvrxaKgLQEtDqwwH2BFzV6VMiAk6qtHyvzmwVIEvApUErPhtfO2HpRBxx0zDD X-Received: by 2002:a05:6402:1d11:: with SMTP id dg17mr33513009edb.30.1624884621466; Mon, 28 Jun 2021 05:50:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624884621; cv=none; d=google.com; s=arc-20160816; b=tYFdg54DxX7+dyGeYncIBEW1tuAn5SoAnmPfUB+J9dJu2ihQ2E+i/mLN+FxoORa+qt ZNYZ566ERlXEzA6tdZHmWAQbyc5+3jmHm9SAQuoSkARCZX9IYOMOBcsfePqeKAvJQoUh BfQzTMTHHmDzJuFp9ecWt64wSuxUoN7bGJvuT0+WolTEyDLqJf5ODw074nsDgdRXyDM3 Q+NtwbhqVznI+tHB34cnPF3aOHLZwU/rX2W6xaD4SSA1UhzbHLOuXBMBmntxKypaCgEF HTbK+5CpaFJGOrGqw0DIL5mppKyB4Zs+MuZ48R8Q/v7MlxpIFmUs1beLdxUCIiOtA4/R 0aaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NPhqsvNIof7wCDk0v6mRn0i9DTXUk2KH9LJ6omkVnw8=; b=ZQJbnot1DUww7fCK05LHpIhpqjKrBmqAdt4mGNp/JrrXSqdI9lJMcj/R+fJUkKamNp RPvxNwQBGyL2y7u1UHI9d2/djAvLNivYCxX7hF0ykIiEilCxtACIRo9zQGXvj017gDIT iT3kIL/7sbD86kxX8gEUSkSgmlIs9uwvr79fysZedulxtjBZFTlmEybfglJiEAg6KZs6 xzLO6z1GxuBuY0mSV+OFhnpmKnsa6RwcR7TZox7P/oqVtlaHtTfpjFLUWMqFtg+4FY/o GbdqhVxTgPG5N5VHij6iq4UzZpNZ/QsTMdRmh0nhNXcQ4Rs5cFexcPnwDXKptLxUv3Zw 1sBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="XfpoPH/o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h6si9312372edb.458.2021.06.28.05.49.55; Mon, 28 Jun 2021 05:50:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="XfpoPH/o"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233022AbhF1MvG (ORCPT + 99 others); Mon, 28 Jun 2021 08:51:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232557AbhF1MvF (ORCPT ); Mon, 28 Jun 2021 08:51:05 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D30EDC061574; Mon, 28 Jun 2021 05:48:38 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id bu12so29878896ejb.0; Mon, 28 Jun 2021 05:48:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=NPhqsvNIof7wCDk0v6mRn0i9DTXUk2KH9LJ6omkVnw8=; b=XfpoPH/o6now8GJy5K4IFDLCf3samF3Lny2YtRW9BX4osNfdac0RacNYj8Sp++bubv grrtn0LvR8gOEC4YGHoIq7r2ng4wVWuZqZJDcM25Wx20Ztb3Aowsl7sLo627W3pJcIUl mY7/1XzgmadeXZoGmZMqipkHrCAe02VjaIya5GzbJp5JXc9NuYfUY1CSpFF85pAxwniY 17gAdPzUjv/dcetj4n0dlV8kwM8sqWxhulP5KWPRcQWN3CdGq8k5VMDYYarV5N0hLqP9 UVZ8jtlIORtuuU3puui6JDKK7xJx1ImZE5q/hO+FfowCwtayN8dL8Ab52uxzcPoVEBxz EIiA== 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; bh=NPhqsvNIof7wCDk0v6mRn0i9DTXUk2KH9LJ6omkVnw8=; b=bTBojPD+rRq/Z22n4e6ep1s2//Ktfpv3zi+R3aGRFPq1o45sV0wiB+rHwVH6AfDymr I86qNFGsPjdsWLuNt/Pd5UyC4S+yaNWD1EmVBdLLk8+dPNJcyRO+GNoGZPLEIK+vsOP+ SNOZM4ccT6D55xw9rTnO6zm1BTb/0FW99XKbdSivvRJhLUXyJuRPNrlsQMOfEf2YfTnY ibFC0rwZyMJm/5TjPb3qQm6SzsZYCXIJhYud62kzcUYc/H43sjPhJoW77BJBv34/2hYx e3lSiq8fZhOIaolADD7kQ6ysnrC5YHdhmDwFDryp4q1hqLFALQYfRaNd118qojKk+dZ9 uLrw== X-Gm-Message-State: AOAM532EW+UvhwiEyrAIaYLf0ZBtqZdTtGX8z8JfVhd2LPwdPDs5vBlK p5I6eJ+mNnK6bMsnpOch5PWSEnQoCR4= X-Received: by 2002:a17:906:8a72:: with SMTP id hy18mr23577505ejc.393.1624884517425; Mon, 28 Jun 2021 05:48:37 -0700 (PDT) Received: from skbuf ([188.26.224.68]) by smtp.gmail.com with ESMTPSA id p23sm9426745edt.71.2021.06.28.05.48.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Jun 2021 05:48:37 -0700 (PDT) Date: Mon, 28 Jun 2021 15:48:35 +0300 From: Vladimir Oltean To: Lukasz Majewski Cc: Andrew Lunn , "David S . Miller" , Jakub Kicinski , Madalin Bucur , Nicolas Ferre , Joakim Zhang , Florian Fainelli , netdev@vger.kernel.org, Arnd Bergmann , Mark Einon , NXP Linux Team , linux-kernel@vger.kernel.org Subject: Re: [RFC 2/3] net: Provide switchdev driver for NXP's More Than IP L2 switch Message-ID: <20210628124835.zbuija3hwsnh2zmd@skbuf> References: <20210623133704.334a84df@ktm> <20210624125304.36636a44@ktm> <20210624163542.5b6d87ee@ktm> <20210625115935.132922ff@ktm> <20210628140526.7417fbf2@ktm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210628140526.7417fbf2@ktm> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 28, 2021 at 02:05:26PM +0200, Lukasz Majewski wrote: > Hi Andrew, > > > > I do believe that I can just extend the L2 switch driver (fec_mtip.c > > > file to be precise) to provide full blown L2 switch functionality > > > without touching the legacy FEC more than in this patch set. > > > > > > Would you consider applying this patch series then? > > > > What is most important is the ABI. If something is merged now, we need > > to ensure it does not block later refactoring to a clean new > > driver. The DT binding is considered ABI. So the DT binding needs to > > be like a traditional switchdev driver. Florian already pointed out, > > you can use a binding very similar to DSA. ti,cpsw-switch.yaml is > > another good example. > > The best I could get would be: > > ð_switch { > compatible = "imx,mtip-l2switch"; > reg = <0x800f8000 0x400>, <0x800fC000 0x4000>; > > interrupts = <100>; > status = "okay"; > > ethernet-ports { > port1@1 { > reg = <1>; > label = "eth0"; > phys = <&mac0 0>; > }; > > port2@2 { > reg = <2>; > label = "eth1"; > phys = <&mac1 1>; > }; > }; > }; > > Which would abuse the "phys" properties usages - as 'mac[01]' are > referring to ethernet controllers. > > On TI SoCs (e.g. am33xx-l4.dtsi) phys refer to some separate driver > responsible for PHY management. On NXP this is integrated with FEC > driver itself. If we were really honest, the binding would need to be called port@0 { puppet = <&mac0>; }; port@1 { puppet = <&mac1>; }; which speaks for itself as to why accepting "puppet master" drivers is not really very compelling. I concur with the recommendation given by Andrew and Florian to refactor FEC as a multi-port single driver. > > > > So before considering merging your changes, i would like to see a > > usable binding. > > > > I also don't remember seeing support for STP. Without that, your > > network has broadcast storm problems when there are loops. So i would > > like to see the code needed to put ports into blocking, listening, > > learning, and forwarding states. > > > > Andrew I cannot stress enough how important it is for us to see STP support and consequently the ndo_start_xmit procedure for switch ports. Let me see if I understand correctly. When the switch is enabled, eth0 sends packets towards both physical switch ports, and eth1 sends packets towards none, but eth0 handles the link state of switch port 0, and eth1 handles the link state of switch port 1?