Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2177930lqo; Mon, 13 May 2024 09:54:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVjcpOOtYiwl7pRtiigSQ4pAzSylXvxYb+lPCOrtIc/bt+CYdoLrTy8MLR4xlpz8v8y5wfA7MlBB/MtbfOf0lYP/tvnNwcQjMH47ramCg== X-Google-Smtp-Source: AGHT+IFxu506OJT8kznhlivYXySVafRz91VwdpMWcKrcrZZLJJ5XaT3LWzcdELKyBa4wZLvIUMSf X-Received: by 2002:a2e:998f:0:b0:2e0:1414:5eb9 with SMTP id 38308e7fff4ca-2e51ff4d5a5mr65865171fa.25.1715619263736; Mon, 13 May 2024 09:54:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715619263; cv=pass; d=google.com; s=arc-20160816; b=brr92YPSOyBHM9mZZWw7F3+tXr43YjSnW3ye7Ct2UrbykW2cHa6w+TbNLsG0A1cec7 xEL7Ts1JWDeyXVjQ/PqqAq28OJi6sgtRGh/MQkCl5tdeYJLdZ/aGe+bn4CtrHFOWsquJ YYFkHYWAFaaEmsbysxYFBQKCnDKkZ0ZLx00Sv5zpWxTWCvJIxgpQD9mARMwcY/ilHL+X E2rzrhCEEfxktDJjjqOAgMtvH2kATTuQ3ag26BM7mLa6Z1qBhb1yydlWsY0VLW80vlTO yy5Aiqxi4Nw2Q7L/v700R4mCxkgd9ooYiLcMh/K8yGQKCScmIKkwGW6ZZwf+AOxDBhIP zDjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=AxpmKkEHWsf0GDlqpvJu8ao2VhIdXEomezlWOSgaREw=; fh=OFmq+UUjpur9MV32jfOcsGnGCQE3OIzZu/7TbeebgyI=; b=UpT77r9YL/RkK/hoYf5qRqsyZNLh1v759j0+f5f55AAfwdb0bJsAU+H0j0crssTo5q DYCaV+4p3S/X37nCsaiZa3B3qz/XxNk8kemZidmY8aAsJ0jklyvGd6mR/vIQvpuWc9sY qQn+dL2G0rP0Q/5ZFeiZZuUMORDcexzHgFO+NaQZwCtsyZQMB28rM7AlVhNPi10kB8Rc ILPsb5XYiHFhtkXrhPnP4Ybfvg98dxEOeq3kIG8AB/x1CxBiLv8jBmcrSKZBWGqXKvxV j0nxavfSdkqe3B3GHBl+fbS658tPkukQBDAgo+sWVRC1E8ZWcOJxV5nfW396Yb5U4yAk SUWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=GOgbe9zy; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-177857-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177857-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c36e35bsi5326539a12.554.2024.05.13.09.54.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 09:54:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177857-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=GOgbe9zy; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-177857-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177857-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4D1C51F214F6 for ; Mon, 13 May 2024 16:54:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 15F8D22EE5; Mon, 13 May 2024 16:54:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="GOgbe9zy" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87065224DC for ; Mon, 13 May 2024 16:54:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715619255; cv=none; b=R0K784xziT4EQBadUR+Gau4zERZPEVTZH0dEVBgqvKrWMJP9HS2Mk9x36FTtJEB60A6DaFP4nqOMztTxWRKtRvzZ6cm4DI7K7vcmF7HIluLtT5nt8j1mTx5lRJZZUQdIpEMmDSWQ+oHI6sGbs81atXe4KXkgRH/NcaMGkiKz0Rw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715619255; c=relaxed/simple; bh=VSyMo7DaP8KwB5t5bwaEbjfbFZwEfyRtAF6IFAROUOQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qhW62aX1Vogs775nfL4kEMvpofOjsmRRrIA0QmUw5Ct4CbsITHQ2J+bV0ocSi0qGNkDqqaIo0dPS7hs0YfWlHSvNlSdVq098mj6YhLjHipb5y9e6c9OufQQb6EEp1M7fQs0dAW3mtBryGK/Cisu+NnhqzwWxYqLvngA9bPdju94= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=GOgbe9zy; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch 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=AxpmKkEHWsf0GDlqpvJu8ao2VhIdXEomezlWOSgaREw=; b=GOgbe9zy7XQs6mjdR1ZG6ET3v/ M2pRaO1M62ufIEErA602bm/pjg4R2nmBO5jGSlMKHos1Wcf8oUg171SfV8oaLGKs0d5ac51gf9r+T IX3goI9IKFZbuvYu4DspFBgNHtmqEppw2RiZbhM8Ow9K/SkQVSUOwKb+VYFMfM5mwGf0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1s6YwE-00FK4D-P4; Mon, 13 May 2024 18:54:10 +0200 Date: Mon, 13 May 2024 18:54:10 +0200 From: Andrew Lunn To: Stephen Langstaff Cc: Florian Fainelli , linux-kernel@vger.kernel.org, "OlteanV@gmail.com" Subject: Re: drivers/net/dsa/dsa_loop_bdinfo.c build problems Message-ID: <688e54ec-3b29-4e3b-a2c3-f2c83b9c97b7@lunn.ch> References: <338daebd-b4af-4a0c-951a-ad7f86dc4646@gmail.com> <7efffaa0-6330-4b01-b3d2-63eb063cbbb0@gmail.com> <212a9464-d52b-4730-95b9-5a0aebd38c91@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: > What I am trying to achieve is to use dsa_loop to connect a CPU > running Linux to an Ethernet switch via a "conduit" Ethernet link > (e.g. eth0) using the port-based Ethertype DSA (Marvell) frame tagging > protocol, so that the Linux kernel will present the userspace with > separate Ethernet links for each of the switch's user ports (e.g. > lan1, lan2, lan3). > > As I understand it this is usually done via a fixed phy-less conduit > (e.g. xMII) and an MDIO link between the processor and the switch so > that the processor can configure and control the physical user ports. > > I want to do some software development ahead of receiving the > hardware, so I want to "fake" the MDIO link, or in some other way > configure the kernel, such that it uses port-based EDSA frame tagging > over an ordinary (PHY-equipped) Ethernet port and it looks to me like > dsa_loop should be capable of doing this. That is an interesting use case. I don't know of anybody doing that before. As Florian pointed out, dsa_loop_bdinfo.o should be built into your kernel. When you insmod dsa_loop.ko, it should match the data in dsa_loop_bdinfo to the dsa_loop driver an instantiate an instance of it. Do you see that happening? You could hack dsa_loop_get_protocol() to return DSA_TAG_PROTO_EDSA, in order to use the EDSA frame tagger. dsa_loop does not have an implementation of .change_tag_protocol, so i don't think you can change it at runtime. However an implementation of it should be trivial. Andrew