Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp144086pxb; Mon, 8 Nov 2021 11:09:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuDd6XabBCFU5iUko88zZC3xHuDu6BxiCza/AmjrThLyJtG2dlHEqSsCRJifqJs3CWXsFA X-Received: by 2002:a02:caac:: with SMTP id e12mr1098662jap.29.1636398592488; Mon, 08 Nov 2021 11:09:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636398592; cv=none; d=google.com; s=arc-20160816; b=FXbP40AFgZh+78V5+w0u5/YC6yrtmnqc0Gk/zq2tZqwll8s7Q9+jguapP5xKsByJzy BzjW1bTd+mSvC/GPu9YxNZA+Ck3/J8lJPsbbvASVv6M/+wn10RQljtbPr9C1rbCjRJXr xPxXPSDRkeITGs3aycfqR5lk1yZUbqOLKcQy3HdPImIjWEk79x30m72TlwmEp79BH3ZO 1/oQrrI0M2rvh9C9ErcACQi08QJCCQ0HCjiVllOdwkiRkeBcLsSPDQ7Dv8Am/tj03omH dQvcU9i5RudWTKPFyJc4TMgsv5kkcHc/3VJkCgVdkogAv2bVVC25OskRJFhgIEl8Q6TF pW/A== 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=osVSOLYOJwSGODa9jrgI/5dh+40TO58UgjiAmVBjKPQ=; b=EC0xuR1SNAx6vhvQluOVNsWAqnPubxa9JIQJMthLIz7Ny1UThN8DFM9FzjPil8mlNi pjUOaZGTEd18ify2UXNrs02nSgJkie5AaOGJDrcSWD56QSQUpqUKy0r3xvBEGmw30B9W 9btkSmLtuLXY1CNVk30iY+wvPXMkm9hrHyD8JPlBQtRLrobsZkYQNgtMZNM0wAOM/yAF fXh7eBvLKhEyJma5R/ap/0RPrQSUQ6k3gIPOQkAkuZNNDey9m334vj/PUmrIsaDEFt5r DzO/bm/SAUNjke3laSrU2ytx4M9D6X4jOC97nOtT0H7a+xkUOdegEsKtGRugbobPgJc8 S4zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=So6zvcfG; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g14si37907901ioo.113.2021.11.08.11.09.39; Mon, 08 Nov 2021 11:09:52 -0800 (PST) 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=@lunn.ch header.s=20171124 header.b=So6zvcfG; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239844AbhKHNSq (ORCPT + 99 others); Mon, 8 Nov 2021 08:18:46 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:50532 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235636AbhKHNSq (ORCPT ); Mon, 8 Nov 2021 08:18:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=osVSOLYOJwSGODa9jrgI/5dh+40TO58UgjiAmVBjKPQ=; b=So6zvcfGyFcIy+0GqfFKVCOQ82 CDB8/b7vfWNhJE2X7EPoTmzYib4wXVgFBe9lP66euZjJARFTkkoIfmEqCs3SQw0be0uyRKbbScSsA 2QPe3Yj9+AnmVGQjgX7OEZEgSApJQQ36KO9qdwQFx6ERIaPc31rBX6FXp0WOPqNPYZ4A=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mk4V3-00CtfT-55; Mon, 08 Nov 2021 14:15:49 +0100 Date: Mon, 8 Nov 2021 14:15:49 +0100 From: Andrew Lunn To: Wells Lu =?utf-8?B?5ZGC6Iqz6aiw?= Cc: Wells Lu , "davem@davemloft.net" , "kuba@kernel.org" , "robh+dt@kernel.org" , "netdev@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "p.zabel@pengutronix.de" Subject: Re: [PATCH 2/2] net: ethernet: Add driver for Sunplus SP7021 Message-ID: References: <650ec751dd782071dd56af5e36c0d509b0c66d7f.1635936610.git.wells.lu@sunplus.com> <64626e48052c4fba9057369060bfbc84@sphcmbx02.sunplus.com.tw> <7c77f644b7a14402bad6dd6326ba85b1@sphcmbx02.sunplus.com.tw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7c77f644b7a14402bad6dd6326ba85b1@sphcmbx02.sunplus.com.tw> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > SP7021 Ethernet supports 3 operation modes: > - Dual Ethernet mode > In this mode, driver creates two net-device interfaces. Each connects > to PHY. There are two LAN ports totally. > I am sorry that EMAC of SP7021 cannot support L2 switch functions > of Linux switch-device model because it only has partial function of > switch. This is fine. > > - One Ethernet mode > In this mode, driver creates one net-device interface. It connects to > to a PHY (There is only one LAN port). > The LAN port is then connected to a 3-port Ethernet hub. > The 3-port Ethernet hub is a hardware circuitry. All operations > (packet forwarding) are done by hardware. No software > intervention is needed. Actually, even just power-on, no software > running, two LAN ports of SP7021 work well as 2-port hub. We need to dig into the details of this mode. I would initially say no, until we really do know it is impossible to do it correctly. Even if it is impossible to do it correctly, i'm still temped to reject this mode. How does spanning tree work? Who sends and receives the BPDU? Is there PTP support? How do you send and receive the PTP frames? Is IGMP snooping supported? All of these have one thing in common, you need to be able to egress frames out a specific port of the switch, and you need to know what port a received frames ingressed on. If you can do that, you can probably do proper support in Linux. Is the datasheet available? Andrew