Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp323287lqb; Tue, 4 Jun 2024 12:27:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUH5g6SlFxo05EcbAqjXt38gvjmK7i9agIyFUBTstP0j3MB/6unoRN04Kxirz+byEYLkEElW8UQ6nwYApon42gxfNK4agP1Gts2EgjIpw== X-Google-Smtp-Source: AGHT+IHeYkKkK6TXgD5wVCIhz7q6fsb4AcK1dwM6leQqESOoAKzV4jnugtsm6G/++HXEM6SpIYw/ X-Received: by 2002:a17:90a:ea05:b0:2c2:3f17:6014 with SMTP id 98e67ed59e1d1-2c27db116e3mr432149a91.13.1717529228374; Tue, 04 Jun 2024 12:27:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717529228; cv=pass; d=google.com; s=arc-20160816; b=VLgIzehSg+clvdUPY903+HLPuNuTUlNLKZvXd5ACVrQyKSU2rhvYKoqODpdZtC2ENt f/TgDFkrDCdA3e0Q3e/reSLdPCs50bHez4QB6ov0qGb6/IA7YCrUrjfPwgdgAvci7+C4 9NHktu3h6kDJBToc6VShEuDqB1IMf1o+9mbv4uHfge+j5RAD2p2hdd9b8hj4J7M9i5MI ZTBRP2FsqCqeiLXP9sj8NSxWWcxfnimCcjveLMq7HuEPxanIqDp2RSrA4f3yI3Xr7LOX 9XNt6/YzEsko5u7Q21e70p/kJ5bnrtj0fqVnhzcjHBbzsDAbwJXtY2ZPwQk6iKTV2O1G c3SQ== 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=wsZATjoAW728C9PCBeyQtYSddogYGOk05sPShVwPjac=; fh=8XN/CgKDi8rDFDpMmKu722YzCcxd1CvLe4g1OdAOL3s=; b=WiBnIIg0yJTbB47Dn4mrymDEV7nCwisBXL+/WaRueAKiOPw/9FCFRBQJ9+2dFXEVXk RFgyfdcs+WgUttlb7Ol0czxqjZ2m8J30IhMxLS9cDtdijhYwl//JyiqTuz36Fr+r6yi2 Gdhnp4wlHGElIDzzIBFhgSxUz39Wxu2Dqx7LXLG3rPjLhnkgnqwmVuTMWdVpc4zubyTQ jvRQvyGC+T61GK+k0LzFK303da2O+VRPebS6duOIo4eLGcNQtMojGqYB/TmOczFSpfYn AyYYYa6HRdUGw9L/bCyKCyhopTm9r1SmyPeql5yIZfKM8K5TjAvi1zA49V8huLZot+zP wjzw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="kZHYxDO/"; 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-201283-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201283-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c1a7766131si2755839a91.3.2024.06.04.12.27.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 12:27:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201283-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="kZHYxDO/"; 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-201283-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201283-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 080B32841ED for ; Tue, 4 Jun 2024 19:27:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A78B614B075; Tue, 4 Jun 2024 19:27:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="kZHYxDO/" 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 2BD9F801; Tue, 4 Jun 2024 19:26:57 +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=1717529219; cv=none; b=A7ga2kf+aTp5jrsw6N5ccvCplubkG1lH+Y7C4EpI3CV1lHQ82JgsYgp3pknK4rMPgTuMtuh4qAeW/7yspsykdCMGheLG8Va9yYrfQHETVizF9XZTBj4Lf0QXu5ZWDHaLTOl+xWRTEnkvcCWy7+06eZpScXpy0RiURV73oiIqGPc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717529219; c=relaxed/simple; bh=RfYADli4pR43LR8z8+OGq/B16AAsfprRCkUGcCgzMbw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qihTp39lqd/gg3s5YsRYiIwf4Nwr5V5N5YvuBoCaU1XhrApdvA00LSSFZr/NdXIt9xRYLJgjxKZf2glGVeDUU9n861gLc+txRNg/7NbBJr9FMK56hGhu+/TxxNyEjDDcM4nNVZp9ERpbMFP1/Emv0m3osVDF+fDxVmtX1/C1hbI= 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=kZHYxDO/; 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=wsZATjoAW728C9PCBeyQtYSddogYGOk05sPShVwPjac=; b=kZHYxDO/WVRlIL3QNyFnI4rCsk YgvhSkh9mfhdWR2/JAqlpW0Wm1xbMoXf1OfqcG2i8nQPHDS6Nyn9WFlVsg6jcCjFUP8DcarUZlL10 c0F9boXbmKWcoT01q59knzKrEBXXaQal4jFdnx6tMjlKBFYYKQEnCtDfAiD8Q8OzkHP8=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1sEZnp-00Gq9r-2O; Tue, 04 Jun 2024 21:26:37 +0200 Date: Tue, 4 Jun 2024 21:26:37 +0200 From: Andrew Lunn To: "Ng, Boon Khai" Cc: Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , "netdev@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "Ang, Tien Sung" , "G Thomas, Rohan" , "Looi, Hong Aun" , Andy Shevchenko , "Tham, Mun Yew" Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature v2 1/1] net: stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping Message-ID: <734c0d46-63f2-457d-85bf-d97159110583@lunn.ch> References: <20240527093339.30883-1-boon.khai.ng@intel.com> <20240527093339.30883-2-boon.khai.ng@intel.com> <48176576-e1d2-4c45-967a-91cabb982a21@lunn.ch> <48673551-cada-4194-865f-bc04c1e19c29@lunn.ch> <322d8745-7eae-4a68-4606-d9fdb19b4662@linux.intel.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: On Tue, Jun 04, 2024 at 06:05:35AM +0000, Ng, Boon Khai wrote: > > > You should generalize the existing functions into some other file within > > stmmac/ folder and call those functions from both dwmac4_core and > > dwxgmac2_core. > > Do the rework of existing function & callers first and add the new bits in > > another patch in the patch series. > > > > Hi Ilpo, do you mean I should create a new file for example, > stammc_vlan.c, and move the common vlan function inside? > so that it can be called either from dwmac4_core, dwxgmac2_core > or stmmac_main.c? or maybe I should just consolidate them into > stmmac_main.c? Do you have access to all the reference documentation for the IP driven in dwmac4_core.c, dwxgmac2_core.c and stmmac_main.c? Is it just VLAN which is the same, and everything else is different? Or are other blocks of the hardware also identical and the code should be shared? If VLAN is all that is identical, then stammc_vlan.c would make sense. If there is more in common, you can start the cleanup of the mess this driver is by moving the VLAN code into a shared file, but make the naming of that file more generic so more shared code can be added with later cleanups. Andrew