Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp238932lqt; Thu, 6 Jun 2024 02:01:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXU7ORAOxnf6KtqNKW1nhMQ9honm0zVjM036y93zxxuf2gd/nVIUiKavd3NA5eXIe8q0/FpGBqbxiZ40FCAMWlO/1kYMIFYZm8M+qnnyg== X-Google-Smtp-Source: AGHT+IE7lwEeuWlArIxy8AN2L/Zh7E5HrGzHg8ITb3tq0TT8uKf7nd3wduvPawhjln9nPz/MnCrg X-Received: by 2002:a05:6214:5244:b0:6ad:5a91:3f1d with SMTP id 6a1803df08f44-6b030a8122cmr60044526d6.40.1717664467076; Thu, 06 Jun 2024 02:01:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717664467; cv=pass; d=google.com; s=arc-20160816; b=BTWuPh44vPnEkgx7Ptj2sLRcZQUeHZt2wQA5wWtKpqriJWNhXSoi3nrI/6HjEBOuV/ 1kvbHFPGcMKx4ECV1eeobWl8Gp34cBuDRHL55tyh3tpvporntGIUylrp09vsFztUTBZw mD4gaLkOFHz4rEq4S5jTY0rEWTx7bhxkxXc38eypKptwTaPwcFRaEFy0gJ2CzADaeD51 K19pUy4HccrSaMfOYyZFjnAc9uE6rRjdPsSqtUNvcx7XZwdeJDBSIydyM87t3TZdJEMP hpQXnxRIp7/lJ/aODYPIBli4h/q4TJcdACMWSLHeIyYcGEAoOcfBbZT/t7ocpJob+Eej i2tg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=s9VpEAwUuoH6LCudbCYlJ7sUCaV6nf2hatsslt+Q7fI=; fh=v3SCYaeCJa93a+n0Uxo5VFFPo3sWNiBtrk6VU3AZNuM=; b=CaZSkO4HR6gmmA2ITpJOkLc6BOdLcWfi5JTwNAgKOEXNwuZza6SzgWLDUvpDEWyzEX /4TvNXGEVLuksvjjfJP5btXaku5rHPyHsIF74fUiPfQ21SPidsKw+7s6QkrJ9C8pR4dm 0D5ScqZxJuT4camxIXNu2wZuz2YpjRJbUyFgeL4lImn1kdZkRZKcZxrIpdV241yUu1Fs RGnWNh7lCxheiHaT3vufypTBGgN0MK0zM8Q6aSNRZNTRNxOwCLpyI9LrtIqEeYc7Qf9y t8BD9Ra4FKKA/ZGw0R4Iozo/1WIOYVvP5xwwqnEdkEiILPPuhDVmqK++lwIAn+2zjZBp DBow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=dev.tdt.de); spf=pass (google.com: domain of linux-kernel+bounces-203908-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203908-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6b04f967c78si10635696d6.291.2024.06.06.02.01.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 02:01:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203908-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=dev.tdt.de); spf=pass (google.com: domain of linux-kernel+bounces-203908-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203908-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 504091C25544 for ; Thu, 6 Jun 2024 09:01:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 774D4155382; Thu, 6 Jun 2024 08:55:06 +0000 (UTC) Received: from mxout70.expurgate.net (mxout70.expurgate.net [194.37.255.70]) (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 9123A155307; Thu, 6 Jun 2024 08:55:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.37.255.70 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664105; cv=none; b=B6FACCMtn+WldNoxkTvhv68n7xNXnaF+jmOL/BVyCvedB092VGALfqDHuWVw9aFojtHMOCLiQx3xYcmYlMf2/G0bZlHZMD9pKDnGxGzRLG2VqgH9M7oKEvRrxV+ArhdPnJa0+ukdSCZm1w9FkM0R0G9AOkMh2dv8wlgdgzV+XTM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717664105; c=relaxed/simple; bh=whHbmZoVgRqfuvp8JQDubSalkz34FeHDYtrAB7NSNX0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OlptdBhp1S+SIUXbU1QIWIdp+Zi9sckjaGcU7RdCfU9SdSxCDhvO5MibuUKpQBlGKe2k7mwDy7jKLjYbiROz+eQ7sqxWiDbLN4RqwDXXMRfk+y6LekfRWxLsL9augkOK+duZNkG/AGAuWC98ixomPxjbiISM7qf7+iqwLTbUTs8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dev.tdt.de; spf=pass smtp.mailfrom=dev.tdt.de; arc=none smtp.client-ip=194.37.255.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dev.tdt.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dev.tdt.de Received: from [127.0.0.1] (helo=localhost) by relay.expurgate.net with smtp (Exim 4.92) (envelope-from ) id 1sF8ti-00ESSM-H9; Thu, 06 Jun 2024 10:55:02 +0200 Received: from [195.243.126.94] (helo=securemail.tdt.de) by relay.expurgate.net with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sF8th-002l7A-W2; Thu, 06 Jun 2024 10:55:02 +0200 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id ADD66240053; Thu, 6 Jun 2024 10:55:01 +0200 (CEST) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id 41261240050; Thu, 6 Jun 2024 10:55:01 +0200 (CEST) Received: from mschiller1.dev.tdt.de (unknown [10.2.3.20]) by mail.dev.tdt.de (Postfix) with ESMTPSA id E8977379F6; Thu, 6 Jun 2024 10:55:00 +0200 (CEST) From: Martin Schiller To: martin.blumenstingl@googlemail.com, hauke@hauke-m.de, andrew@lunn.ch, f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 12/13] net: dsa: lantiq_gswip: Add and use a GSWIP_TABLE_MAC_BRIDGE_FID macro Date: Thu, 6 Jun 2024 10:52:33 +0200 Message-ID: <20240606085234.565551-13-ms@dev.tdt.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240606085234.565551-1-ms@dev.tdt.de> References: <20240606085234.565551-1-ms@dev.tdt.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-purgate: clean X-purgate-type: clean X-purgate-ID: 151534::1717664102-06392B7C-B77CF30C/0/0 From: Martin Blumenstingl Only bits [5:0] in mac_bridge.key[3] are reserved for the FID. Add a macro so this becomes obvious when reading the driver code. Signed-off-by: Martin Blumenstingl --- drivers/net/dsa/lantiq_gswip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswi= p.c index f2faee112e33..4bb894e75b81 100644 --- a/drivers/net/dsa/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq_gswip.c @@ -238,6 +238,7 @@ #define GSWIP_TABLE_MAC_BRIDGE 0x0b #define GSWIP_TABLE_MAC_BRIDGE_STATIC BIT(0) /* Static not, aging entr= y */ #define GSWIP_TABLE_MAC_BRIDGE_PORT GENMASK(7, 4) /* Port on learned en= tries */ +#define GSWIP_TABLE_MAC_BRIDGE_FID GENMASK(5, 0) /* Filtering identifie= r */ =20 #define XRX200_GPHY_FW_ALIGN (16 * 1024) =20 @@ -1385,7 +1386,7 @@ static int gswip_port_fdb(struct dsa_switch *ds, in= t port, mac_bridge.key[0] =3D addr[5] | (addr[4] << 8); mac_bridge.key[1] =3D addr[3] | (addr[2] << 8); mac_bridge.key[2] =3D addr[1] | (addr[0] << 8); - mac_bridge.key[3] =3D fid; + mac_bridge.key[3] =3D FIELD_PREP(GSWIP_TABLE_MAC_BRIDGE_FID, fid); mac_bridge.val[0] =3D add ? BIT(port) : 0; /* port map */ mac_bridge.val[1] =3D GSWIP_TABLE_MAC_BRIDGE_STATIC; mac_bridge.valid =3D add; --=20 2.39.2