๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16196

Re: [PATCH net-next v8 03/11] r8152: add rtl8157_change_mtu() for RTL8157 and RTL8159

#16196
From: netdev-bot+sashiko
Date: Sat, 14 Nov 2026 09:28
75 lines
10535 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] This patch carries two Fixes: tags, so it will go to stable, but
  the commit message gives no user-visible symptom for the old behaviour.

--

r8152: add rtl8157_change_mtu() for RTL8157 and RTL8159

This adds rtl8157_change_mtu() for RTL8157 and RTL8159. It sets
PLA_MTPS from the configured MTU (max_pkt_size / 64, at least 10K,
capped at 0xff) instead of the fixed MTPS_JUMBO that rtl8156_change_mtu()
uses. rtl8156_up() now calls tp->rtl_ops.change_mtu() so each chip gets
its own helper.

> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index bb4106f238a3a..1517753f843ef 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -6800,6 +6800,28 @@ static void rtl8156_change_mtu(struct r8152 *tp)
>  		       ALIGN(rx_max_size + tp->tx_desc.size, 1024) / 16);
>  }
>  
> +static void rtl8157_change_mtu(struct r8152 *tp)
> +{
> +	u32 max_pkt_size = mtu_to_size(tp->netdev->mtu);
> +	u32 ocp_data;
> +
> +	ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, max_pkt_size);
> +
> +	/* Use at least 10K for MTPS */
> +	ocp_data = max_t(u32, max_pkt_size, 10 * 1024) / 64;
> +
> +	/* 16 * 1024 / 64 = 0x100, so the max is 0xff for 8 bits data */
> +	ocp_data = min_t(u32, ocp_data, 0xff);
> +
> +	ocp_write_byte(tp, MCU_TYPE_PLA, PLA_MTPS, ocp_data);

[Severity: Low]
Could the commit message say what user-visible problem the old fixed
value caused?

The patch has two Fixes: tags, so it will probably be picked up for
stable. The only reason the message gives is:

  Per the datasheet they need an MTPS scaled from the configured MTU
  instead: max_pkt_size / 64, at least 10K and capped at 0xff.

Before this patch, RTL8157 and RTL8159 always wrote MTPS_JUMBO to
PLA_MTPS through rtl8156_change_mtu():

  #define MTPS_JUMBO		(12 * 1024 / 64)

That value is 192. At the default MTU of 1500, mtu_to_size() returns
1522. So rtl8157_change_mtu() now writes max(1522, 10240) / 64 = 160,
which is 10K instead of 12K.

For any MTU below about 12266, MTPS is now lower than it was before.

Did the 12K setting cause a failure, such as stalled or dropped TX for
jumbo frames above 12K? Or is this only a change to match the datasheet
recommendation?

Could the message also say plainly that every RTL8157/RTL8159 at the
default MTU now gets a smaller MTPS?

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261110032416.16968-1-nic_swsd%40realtek.com
Technical Details
Message-ID: <179464851229.2199510.6886290228452142765@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363153-linux-kernel-netdev=dewy.ru
References: <20261110032416.16968-4-nic_swsd@realtek.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363153-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v8 03/11] r8152: add rtl8157_change_mtu() for
 RTL8157 and RTL8159
Date: Sat, 14 Nov 2026 09:28:32 +0000
Organization: Usenet Network
Message-ID: <179464851229.2199510.6886290228452142765@kernel.org>
References: <20261110032416.16968-4-nic_swsd@realtek.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1540509"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:xbJ+R8mcloxJ1jZClIvsDxiuzf8= sha256:GuMK7ranlfXjSNB7slK75Joe5lMmQbH67z0GjopVnF4=
	sha1:cHJab+PMmlaffd8UGkzt2AWiN+g= sha256:aKCacJLXJY3Fc8G27+J/phIxCI+1K0XKyr2S9hJvu+o=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 5B4BF114792; Sat, 14 Nov 2026 12:29:15 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id GcXR0eHaHp03;
	Sat, 14 Nov 2026 12:29:10 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-363153-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 005A211478D; Sat, 14 Nov 2026 12:29:01 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 480B43C791; Sat, 14 Nov 2026 09:28:46 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794648514;
	b=lGo1P9B5wco+S3TR8QynXsMQgw9dwENgKx642lZp7VYEriXlWKLBRQ3XBuppxFrHnZVc
	 meo55QCWSq6MNeqeBkwT3hefCw/9kt+XXatcPhGW2B2v6zYoqyDXh8bQMg+bzcMOERhCe
	 R7esER5Eh0aSghNz5v2tGMQxHDmjdF/j4II1wFA/B6f1+vmKxemiH2zLEgiezr4jyIU7h
	 0JudN1mP3gov1fLNY6/9P5pFpBVXbkyjFXKXL6J/s+uO7tiPjXCDT/lYyhkGvAyCFRtag
	 h+9AKnLC2VcfBu5mu4yyeh2iMdQ2pHjYkKFUi/L5H2S8Cu4lcsQjoyNsx7bbgWUK00w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794648514;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=9q7KdoPOJAUBkHe+eMsuTBs/HDctpzeS5tV4z1fwdIE=;
	b=GPiWm8DsxkW2NUXAClLukluZm+rGk2RqD7dvBt7WSsIsaN28a/zpJ5eBqZsIHx3oXjPi
	 oO4EHImLe9rJPWXL2Zg/7kYSABkBOx+pxveZPFayNF2zwmK7EDr5zIObmXvWg92714qdP
	 GAIRUGRTPPdASkFWeJPJz6Ytb/+NJzhAYm9Mn/b6JWCDB8E/30wm85eDJrfavPqf6ow7w
	 v4bUIU+nWsXMfV/lJGV8MhtQoYSblKTeviWGeRJXipu0FEz3P4CLOiJs9oZi/NS39E/xh
	 O6YLFGsWt1rGwS2YwOa00UxpdVKbpLnikEqXAnEaswXgXaCk3j/Qt/UR/E1EIWq6jMA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TLQXIPCr;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 6EA9B606A8A9;
	Sat, 14 Nov 2026 09:28:34 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TLQXIPCr
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794648513;
	b=wrCNEzyW6i1zkFeFbMPLeV0jh4kQ4e1DiJps5QpwIjS3IQwWVDoX93SX6N4Wj14Iv3zm
	 jdXHJU+qguG8KIOWt92FJxGfcMbXttj0qnllD/UcRggs1+yf08RaLaI/vPU66OOVHJ/V7
	 lORR1BbZUM5Bj9tvl6OFMH6vtUQB/CTqv/n9658AADpaRIMSopBl2NejuekIO+httA9Pd
	 puLKFx7q/oMQZEjuwo4C3+Pl2xfalqJHPoLp71CNd+8PiVcFan/DUThCkCJ8CKfNP/iSh
	 t8Sahhlg/m4knPdTDPMXnuZqn7KHcAKk+QTDle/9ZBOQjKkO0jCZnqhUVMqHMWUPADg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794648513;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=9q7KdoPOJAUBkHe+eMsuTBs/HDctpzeS5tV4z1fwdIE=;
	b=5pPhBzJv2GyY9UHbw7lFO9+qtjFIqeSMcLmuduWvRnSBHduDCPlwWWDbzGlewjK7G7by
	 0FVbmJv/F7wJDl6BoeOCTW1tEf60FwCCOndEcxOEE+Z08daHurJ9TEROVtPcu66PiJXri
	 kPPY9Ny427TNpCS4wsdsVhsPZmhXscEjo19GfiuYG9Xi8phjOVi5LMnd+dan4SeY0e0PJ
	 uu6y1RQ+GboBvtnrG9d8czBV7Rk9lpbxhKb3/k0OxhFJ8OdJeenLanMyx+G2ieZQFRXwl
	 QjHKXya0nWufHg9JyzI/AbgSpGG2r9OQCvht3jRhbk3gTEYCaLo7XJPY4HfA+z7q3rw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TLQXIPCr;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FF73606A89C;
	Sat, 14 Nov 2026 09:28:33 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id B84601F000C6;
	Sat, 14 Nov 2026 09:28:32 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794648513;
	bh=9q7KdoPOJAUBkHe+eMsuTBs/HDctpzeS5tV4z1fwdIE=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=TLQXIPCrbbgGPHmtwaZDTOtNoyDxyw6RCmNNHWW73nor1V9LhhExKAhoEN/2th2ma
	 2VOsgpGfNipo3ILFUuhg9NAFZqVRy3SQlRzQZwz7d/NVGsf/3zcIPVjXrxy3Z4cJW1
	 VIyQ8ocXcBd4iQMNpf8XCU1ET4XM4R+1EyGo3znIAukzmt6CYeht2MjN6zGAicnr/+
	 xMz3TqD7xQxuqbk7N2RERy4cH+xoMq0UzBMqZYy9cdb6QJB2X09JgeWXVcvctgZiq8
	 OMGwxfDoEILQTig5C3vCWaccfHt1bZOznvMb2A/eN24vV4d6HnbWO6AgVTcKAhWe5W
	 NP1pd88Hyz+JQ==
X-Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org,
 nic_swsd@realtek.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
 edumazet@google.com, bjorn@mork.no, pabeni@redhat.com, andrew+netdev@lunn.ch,
 mail@birger-koblitz.de
X-In-Reply-To: <20261110032416.16968-4-nic_swsd@realtek.com>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list