Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3572710pxf; Mon, 22 Mar 2021 09:30:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGJ3ugEkMXTdG6VWfjA2QqKuIHsXXBKwVnFxchCbSFLLyhj+Ph/6E7vd4FLus3Enqd+CrQ X-Received: by 2002:a17:907:76c7:: with SMTP id kf7mr625724ejc.470.1616430620347; Mon, 22 Mar 2021 09:30:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616430620; cv=none; d=google.com; s=arc-20160816; b=JzOQipVgJ3XDoEUb0Qt3r00sfHm2PyuVXnVDPBAp7CyDrkKq5mcehbL7qYR14VHdvC ptpuG/FpL6133yFQ1OFVkCjIRycBV4KbSYTFnI3QTa1yhzveAERMvlwKk0KZKoxmAOdk 3bpu3mNQ7V7c4zEtStCjO52hvbZzlvq2gX8V6v6wz9Ul8/Vy6xpTGuO0xOfOCzR9bCf1 vKzRsnP5ATarhgd9/PRjq4tk/KT+9dNUANr4Vud+jYMtLE/Ocsf3sv4kAtX5b1UZar8h fgHqZaWJLpbJP05/KKP1FhxI/lBsZjVKrwayKS8Mvr+LCp6Qdo3WM7jsftO4xEIqOWJl gl4Q== 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; bh=enPuGsnzkALawsRcVJW//cXi433F/fLEibINug0UoFk=; b=mpltmda+i7nQ9BVs3wpc3g/sBoS2DKWLTAk7isaR10W5NrfZk7vyzEQEHVnvZQNrCf 5sRDg96u00INvnkHlIWTvzAiIuzhDBPT4fR1//uDmIvyVf7sm9843qh3dc+ZUMnbILet dvs2XX+WllGAGdURPL226hkdqeWocQ4g9g5rpJvm4UGuUgrNa1dpN3IgCTtNggE/wMLp +YLd5RTKRgko2lUdiODF4RV8jTA7vIgdlFchb1Xrt4RbnQ9jOWtTy68YsJssn+9yN3Si /9Ycx+rXJ8JibBXodjwqdUvpb9cKkG0/6kb5Ysuzhw3L4j9N7v31HMRF41R5SbBRMhWY gaew== ARC-Authentication-Results: i=1; mx.google.com; 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 d26si11784128edz.20.2021.03.22.09.29.57; Mon, 22 Mar 2021 09:30:20 -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; 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 S231783AbhCVQ2z (ORCPT + 99 others); Mon, 22 Mar 2021 12:28:55 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:40674 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231882AbhCVQ2c (ORCPT ); Mon, 22 Mar 2021 12:28:32 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lONPl-00CQnP-F3; Mon, 22 Mar 2021 17:28:25 +0100 Date: Mon, 22 Mar 2021 17:28:25 +0100 From: Andrew Lunn To: Stefan Chulski Cc: "kuba@kernel.org" , "netdev@vger.kernel.org" , "thomas.petazzoni@bootlin.com" , "davem@davemloft.net" , Nadav Haklai , Yan Markman , "linux-kernel@vger.kernel.org" , "linux@armlinux.org.uk" , "mw@semihalf.com" , "rmk+kernel@armlinux.org.uk" , "atenart@kernel.org" , "rabeeh@solid-run.com" Subject: Re: [EXT] Re: [V2 net-next] net: mvpp2: Add reserved port private flag configuration Message-ID: References: <1615481007-16735-1-git-send-email-stefanc@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 22, 2021 at 03:59:43PM +0000, Stefan Chulski wrote: > > > > 2. CM3 code has very small footprint requirement, we cannot > > > implement the complete Serdes and PHY infrastructure that kernel > > > provides as part of CM3 application. Therefore I would like to > > > continue relying on kernel configuration for that. > > > > How can that work? How does Linux know when CM3 has up'ed the > > interface? > > CM3 won't use this interface till ethtool priv flag was set, it can be done by communication over CM3 SRAM memory. > > > How does CM3 know the status of the link? > > CM3 has access to MAC registers and can read port status bit. > > > How does CM3 set its > > flow control depending on what auto-neg determines, etc? > > Same as PPv2 Packet Processor RX and TX flow don't really care about auto-neg, flow control, etc. > CM3 can ignore it, all this stuff handled in MAC layer. CM3 just polling RX descriptor ring and using TX ring for transmit. > > > > > > 3. In some cases we need to dynamically switch the port "user" > > > between CM3 and kernel. So I would like to preserve this > > > functionality. > > > > And how do you synchronize between Linux and CM3 so you know how is > > using it and who cannot use it? > > > > Andrew > > I can add CM3 SRAM update into ethtool priv flag callback, so CM3 won't use port till it was reserved to CM3. I really think you need to step back here and look at the bigger picture. If linux should not use the interface, it should not exist. If it does not exist, you cannot use ethtool on it. What you might want to consider is adding remoteproc support between Linux on the main processor and whatever you have on the CM3. You can use RPMsg to send requests back and forth between Linux and the CM3. It can request that the shared parts of the packet processor are set up for it. Linux can tell it when the link comes up? It can request how the PHY auto-neg should be configured. Andrew