Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1306048lqs; Sat, 15 Jun 2024 03:31:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVX+C5R2Fskl2HepiIWusu9UPYNHC1lo/wEqHR2ZpHPH6gHPrspAutCgrCLWwNwq2WDLwHDzsejOjnFNWeUkEkPBR43tMEtu3prwjV0/Q== X-Google-Smtp-Source: AGHT+IFayz4Et3uY3CykH7GWdauyuWVIxaf/N0GilbQoFcumbpYht+hqyftU7HmY9xMdoG83It7q X-Received: by 2002:ac8:5f8c:0:b0:440:b388:97b4 with SMTP id d75a77b69052e-44216029c21mr92395421cf.12.1718447479408; Sat, 15 Jun 2024 03:31:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718447479; cv=pass; d=google.com; s=arc-20160816; b=NBwlqWBqF9xA3YiMLcv4HsA9/8U26HgRwH2YurWwLhX3SIWAxOK8/FXIR0RbCC4c/k dcKOYj0ZM264FwPmKV4k733j7f8Xr+si1UtlAIZqDZrOd8lToWi9QfdUXEMmVs7rv/xQ s60HN9DNnzUt12GcaZ5TrjwSupA9rLOe1EtmjhcPQzrhC8FzxLjz8wNy3c/w76VC8ZwO HnoZPlU27idfVi9LvMdwpFfZUCDixl1tth4kp+vThb/RkLW2Yys7j2bfGd8lcWzHWu5q 8Rsw8MAVI2hI7WFAgDT+8iWy4Q5RSaGOjqH0ql6FxjoMrKO2YozUZURINGPD38M0iqWS 5KPA== 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=CKeq0xGA99gQcMnXTsaoMRgTxn1jFQOiEAaOR4V7VsA=; fh=Z1JVr0YDlIkHaULJ+vmIfkkerT98nOlutccotBqgt7g=; b=HQjBkiZyx/FGEvGx4coJhpKvnrCPKc2DuOKEOcUjoCMqtb17YSDlsJyh3sd3Wl36+F gOGC+GUmcAJ8leCMNdHp19FSKHZe/6xR4Km0DEDGkudbuFDq52ovEbYeYw5M77yWCNCa Ywkg3UAMXTJuolESHjU2JU84b4aE87kFOXzD+UYvKqwOIt1vrn1tiTTyOULVCOpdAi4x a1/wByBzPYbhGmqDFHghkbkxEj02R2T1CGivxjJioOxqiNJf95toZ7nvhXI8xjSy4D2i 3yxtfcjjSkvSVsOgWnqyO/Xzu2u15FibMDFyv4w6yzxrsb6PcLi0Z7HsM7E8omYVKIqF wtqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=bp.renesas.com dmarc=pass fromdomain=bp.renesas.com); spf=pass (google.com: domain of linux-kernel+bounces-215830-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215830-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-4421cf51800si29381651cf.777.2024.06.15.03.31.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jun 2024 03:31:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215830-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=bp.renesas.com dmarc=pass fromdomain=bp.renesas.com); spf=pass (google.com: domain of linux-kernel+bounces-215830-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215830-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com 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 14F261C2109D for ; Sat, 15 Jun 2024 10:31:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 811E53B1BC; Sat, 15 Jun 2024 10:30:57 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42F9C38DDB; Sat, 15 Jun 2024 10:30:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718447457; cv=none; b=UyCvRGddQ8DLLxv2zpAMf59lmHbY0L7lqIgg5SknP6hSAohnE1q+VEEMaD+8JE2NprZ8hTS2/rNlhbP0aXsqoUnx90ABZSQcpOI5PuJA8zCBPMSdY90jnuoWIf4CJQr8OqzFpkE94lunS/A4QMQku/XmdZaoTBjfL7tGVvuGPt0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718447457; c=relaxed/simple; bh=DiMKpHDWyatyehE4Sc48yNSznIy8WZ+otkL59Gy7c9M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=frvcQImEMgimnkXxHnbCJuUfHwWaTU6zw7Lk//66v8gWdHfQd092JmjtgStcATGekhlJSr8gOv/rzjbcwOQZKnu6QQOhcf800ec7f1kaIwAh4MeR4SAghDLw68G86lj6ILdh+TNqnVgM4iIgqjXwjKan10/XRGEJhZNged7OlnY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com; spf=pass smtp.mailfrom=bp.renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bp.renesas.com X-IronPort-AV: E=Sophos;i="6.08,240,1712588400"; d="scan'208";a="208029883" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 15 Jun 2024 19:30:54 +0900 Received: from renesas-deb12.mshome.net (unknown [10.226.92.58]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 4958940071E2; Sat, 15 Jun 2024 19:30:49 +0900 (JST) From: Paul Barker To: Sergey Shtylyov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , =?UTF-8?q?Niklas=20S=C3=B6derlund?= Cc: Paul Barker , Biju Das , Claudiu Beznea , Lad Prabhakar , Mitsuhiro Kimura , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [net-next PATCH 1/2] net: ravb: Fix maximum MTU for GbEth devices Date: Sat, 15 Jun 2024 11:30:37 +0100 Message-Id: <20240615103038.973-2-paul.barker.ct@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240615103038.973-1-paul.barker.ct@bp.renesas.com> References: <20240615103038.973-1-paul.barker.ct@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: 8bit The datasheets for all SoCs using the GbEth IP specify a maximum transmission frame size of 1.5 kByte. I've confirmed through internal discussions that support for 1522 byte frames has been validated, which allows us to support the default MTU of 1500 bytes after reserving space for the Ethernet header, frame checksums and an optional VLAN tag. Fixes: 2e95e08ac009 ("ravb: Add rx_max_buf_size to struct ravb_hw_info") Signed-off-by: Paul Barker --- drivers/net/ethernet/renesas/ravb.h | 1 + drivers/net/ethernet/renesas/ravb_main.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/renesas/ravb.h b/drivers/net/ethernet/renesas/ravb.h index 6b2444d31fcc..e592e89b0d96 100644 --- a/drivers/net/ethernet/renesas/ravb.h +++ b/drivers/net/ethernet/renesas/ravb.h @@ -1051,6 +1051,7 @@ struct ravb_hw_info { netdev_features_t net_features; int stats_len; u32 tccr_mask; + u32 tx_max_frame_size; u32 rx_max_frame_size; u32 rx_buffer_size; u32 rx_desc_size; diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index c1546b916e4e..02cbf850bd85 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2664,6 +2664,7 @@ static const struct ravb_hw_info ravb_gen3_hw_info = { .net_features = NETIF_F_RXCSUM, .stats_len = ARRAY_SIZE(ravb_gstrings_stats), .tccr_mask = TCCR_TSRQ0 | TCCR_TSRQ1 | TCCR_TSRQ2 | TCCR_TSRQ3, + .tx_max_frame_size = SZ_2K, .rx_max_frame_size = SZ_2K, .rx_buffer_size = SZ_2K + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)), @@ -2689,6 +2690,7 @@ static const struct ravb_hw_info ravb_gen2_hw_info = { .net_features = NETIF_F_RXCSUM, .stats_len = ARRAY_SIZE(ravb_gstrings_stats), .tccr_mask = TCCR_TSRQ0 | TCCR_TSRQ1 | TCCR_TSRQ2 | TCCR_TSRQ3, + .tx_max_frame_size = SZ_2K, .rx_max_frame_size = SZ_2K, .rx_buffer_size = SZ_2K + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)), @@ -2711,6 +2713,7 @@ static const struct ravb_hw_info ravb_rzv2m_hw_info = { .net_features = NETIF_F_RXCSUM, .stats_len = ARRAY_SIZE(ravb_gstrings_stats), .tccr_mask = TCCR_TSRQ0 | TCCR_TSRQ1 | TCCR_TSRQ2 | TCCR_TSRQ3, + .tx_max_frame_size = SZ_2K, .rx_max_frame_size = SZ_2K, .rx_buffer_size = SZ_2K + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)), @@ -2735,6 +2738,7 @@ static const struct ravb_hw_info gbeth_hw_info = { .net_features = NETIF_F_RXCSUM | NETIF_F_HW_CSUM, .stats_len = ARRAY_SIZE(ravb_gstrings_stats_gbeth), .tccr_mask = TCCR_TSRQ0, + .tx_max_frame_size = 1522, .rx_max_frame_size = SZ_8K, .rx_buffer_size = SZ_2K, .rx_desc_size = sizeof(struct ravb_rx_desc), @@ -2946,7 +2950,7 @@ static int ravb_probe(struct platform_device *pdev) priv->avb_link_active_low = of_property_read_bool(np, "renesas,ether-link-active-low"); - ndev->max_mtu = info->rx_max_frame_size - + ndev->max_mtu = info->tx_max_frame_size - (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN); ndev->min_mtu = ETH_MIN_MTU; -- 2.39.2