From nobody Tue Dec 2 02:04:29 2025 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE9BB34D93D for ; Fri, 21 Nov 2025 11:36:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724978; cv=none; b=F0l/sv+s21zh/5H+e8956FGW6/jy2NC+3qBEcB15AgLFPL8w+nDJjGYN04SbEwWW8v4wQxk9xntCjRhnWPqqH+eh4I+NoSWWwJPG37dfpGH24TVxmWx723myTTEggKIwoUIqYfvji7hfecpM3ew4LAnMxUf0fsrHd7SAfzvnWxM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763724978; c=relaxed/simple; bh=iV5547O2Jkc5KxmhzNymYPOd0IDQwWkKNkuGqo67YKM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tzyyI6JhPu/giOJM9SgtdlbTZqBDkgLKvrQaHtJvhAMiKQK0bGoTuctKNG993y+0BiSfPK/H0bbLqAfLzIFJf0qHl1h4zyBd8tzA4x3NpYAzQRJ/4JqPVXdW/fvdgfrqUtohcYHoqtArczzcUoSMz7aW6M7NVg+JK/a+jM8ibZM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TBh9lvWP; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TBh9lvWP" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-47790b080e4so10608625e9.3 for ; Fri, 21 Nov 2025 03:36:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763724974; x=1764329774; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BL9yVtMaskxLuPDjF5CARhK40Dj9w0uig2rqjbmy1/w=; b=TBh9lvWPl5qCRjt4wm/sUSifj8jSsSY1iO707TIGFAs9gDc2y+HpmHNNrmd6jYIHOr DC8ZS57NmuPuKvYD5fIIbeGqWAxCKKULLafZzgY5hbovc6JTn6QUQtv1qf8gb4dkUXSD WEpmw9K4IvmbmBgwI6BKwvaN7xKhfIOkUPILxevhFFPUXWbirFVjVn55cB9Da0qqqLHU 2JKY5NrEoPH8vMMC0EhpNWoiSdss0tER2t8zcsWNDGl8EW7ZR9rak3lZiH/oxghN+kGI nNhrZeffgVjAjnngBs/AIOhpCqaQQIv5DiCw8wEvz0a3KhWHlmFoI759n3yvq3m8YmQ/ XsJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763724974; x=1764329774; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BL9yVtMaskxLuPDjF5CARhK40Dj9w0uig2rqjbmy1/w=; b=xHLbI3kQBMTXN2YGLcJuqkyJ3WZLfjRCrYfcn25P2oag/+pqTX+NYsHi9WFd9UPktC H+26lIdwO0S/sRGG4jGzArSDLjCYXXtiVXb4v8ArqeKe8tKwfz7rv8XidsFgSzK2tjGA bjGxpE7uxt+yR27+lZ1FBiBF5PtLfQ5ub8Bo0GtTFbHdCiYVvtWzDjU+4/pGz0MD4Bh5 6KMM1k8PF1RzCNT7PUrerNv1xHgvr+nBk+ppe3fUkMYENQXYT4zHtUtn3+apQU+o0x4+ gKWQqYsnG+rJTb+kWyvRFEwwsx2CpmShaRY7XpWk+aoLe6w7R473la/ApmFno7AcWuYj ljcg== X-Forwarded-Encrypted: i=1; AJvYcCXP8/p/uh+acv5g8U1efSyT3hTqbtKWCvu19ihQYqr6bduy1FW8hVKW3WiPua2smcrdVzTquSg3SoS596A=@vger.kernel.org X-Gm-Message-State: AOJu0YxlNemUvn04n0pIf51+fsSO3g9kLAi1A9+uzR72bNIbqWYsfJLb ekkwPCFjfgkHv4H3n19/KIevtLDoBvFReiGInLmkxq6OEWOO2Ayu+MWW X-Gm-Gg: ASbGncvSd2Awf5iiAqgWY1HLBn9C1mc5wGZSma9KgCk5DqwkHZHcZ5fqtOnFsKsdLWp 2+YCzuag4+qj3EMayl6fio2Ev5g856O6qKOknkSPtmOo/bcTYJJMKw2oRcJSnWGh+N7ccZZNT49 qO410bgbHAxjriZRamFgDqGk+9+zIU7/IjrCj5RLVjZoa8HDbzAvdfTUKK+4VGeigaMG4U0wk5X 9QSqO4YWECCvG3w1buw93eJ5YBmK1QJpgEZFX/xiZkyiMvZB1Odxpw+VS3o/Om48jzm/jpgzaWM LAJBPIAWJihbGMAr6vnyT8CIrNdaYQfE38j851BGS3oFfLAtHomSIMxyrKymy4ACmYM9y0PX4el 7wOMhMx5O2sKR4a9MJl+5tYpjLwtbCOCHaLKO8Hqjmtli8z4DAtFnfl6/shVNP2hgmvGmg1CtdP Klf6cXWkNbU8PnpGBgfRZuAn9iDQTXA20HIF0= X-Google-Smtp-Source: AGHT+IH36k8lUJuOn97e5nXbz9w9MMFZJjRypq3XClPag4vI3s41hFu6V390MCHf+PjbZXWUpQ6F2A== X-Received: by 2002:a05:600c:4f82:b0:477:952d:fc11 with SMTP id 5b1f17b1804b1-477c11175a9mr22999955e9.16.1763724973805; Fri, 21 Nov 2025 03:36:13 -0800 (PST) Received: from iku.Home ([2a06:5906:61b:2d00:9cce:8ab9:bc72:76cd]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477bf3558d5sm38732465e9.1.2025.11.21.03.36.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 03:36:13 -0800 (PST) From: Prabhakar X-Google-Original-From: Prabhakar To: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Simon Horman , Philipp Zabel , Russell King , Geert Uytterhoeven , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH net-next 09/11] net: dsa: rzn1-a5psw: Add support for management port frame length adjustment Date: Fri, 21 Nov 2025 11:35:35 +0000 Message-ID: <20251121113553.2955854-10-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com> 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 Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Extend the RZN1 A5PSW driver to support SoC-specific adjustments to the management (CPU) port frame length. Some SoCs, such as the RZ/T2H and RZ/N2H, require additional headroom on the management port to account for a special management tag added to frames. Without this adjustment, frames may be incorrectly detected as oversized and subsequently discarded. Introduce a new field, `management_port_frame_len_adj`, in `struct a5psw_of_data` to represent this adjustment, and apply it in `a5psw_port_change_mtu()` when configuring the frame length for the CPU port. This change prepares the driver for use on RZ/T2H and RZ/N2H SoCs. Signed-off-by: Lad Prabhakar --- drivers/net/dsa/rzn1_a5psw.c | 4 ++++ drivers/net/dsa/rzn1_a5psw.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c index dc42a409eaef..82f4236a726e 100644 --- a/drivers/net/dsa/rzn1_a5psw.c +++ b/drivers/net/dsa/rzn1_a5psw.c @@ -211,6 +211,10 @@ static int a5psw_port_change_mtu(struct dsa_switch *ds= , int port, int new_mtu) struct a5psw *a5psw =3D ds->priv; =20 new_mtu +=3D ETH_HLEN + A5PSW_EXTRA_MTU_LEN + ETH_FCS_LEN; + + if (dsa_is_cpu_port(ds, port)) + new_mtu +=3D a5psw->of_data->management_port_frame_len_adj; + a5psw_reg_writel(a5psw, A5PSW_FRM_LENGTH(port), new_mtu); =20 return 0; diff --git a/drivers/net/dsa/rzn1_a5psw.h b/drivers/net/dsa/rzn1_a5psw.h index 0fef32451e4f..41c910d534cf 100644 --- a/drivers/net/dsa/rzn1_a5psw.h +++ b/drivers/net/dsa/rzn1_a5psw.h @@ -235,11 +235,15 @@ union lk_data { * @nports: Number of ports in the switch * @cpu_port: CPU port number * @tag_proto: DSA tag protocol used by the switch + * @management_port_frame_len_adj: Adjustment to apply to management + * port frame length to account for accepting a frame with special + * management tag. */ struct a5psw_of_data { unsigned int nports; unsigned int cpu_port; enum dsa_tag_protocol tag_proto; + unsigned int management_port_frame_len_adj; }; =20 /** --=20 2.52.0