From nobody Sun Apr 12 10:20:05 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 C742E30CDAB for ; Wed, 4 Mar 2026 18:23:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772648637; cv=none; b=mIdWq6FQKSt169z7K97XlCeMlQppiYUsuM9E72MyVvHrBYxhDFG0aNzJYf9/apAS4Opdq0UxdvLBARcOrY6pR+FF+xtgCuizwjLhIhfdRXOCIc3HgnRlgI14cvcGaW2zQFLX5z2DbPRkbSQYfz0OhbcQ9uxgF3qInXWLnxYQ+Yw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772648637; c=relaxed/simple; bh=1kn1psIhiJQGixudWstdQUGbMnl65a2Ws9qkxb0h6vA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WM/gqaU80gak2/Je3UHUISrQR7NLiuIcS9XpVma7/iVp/jAAnN6QyL3CxzFyUSXufrjaQI8EY3KxR27GR4O2u9C2tJOjtY/h1PMtWVp+UoMaPDTZrexFDwgr5jHb6b9V+aRwXffhtPsx00BucuWuJMzm70Yr4JRCIvX4yD6TVPI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=w3i6uVd4; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="w3i6uVd4" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id A697AC143FC; Wed, 4 Mar 2026 18:24:12 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 720F75FF5C; Wed, 4 Mar 2026 18:23:54 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id AAFBD103686F7; Wed, 4 Mar 2026 19:23:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1772648633; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=afu30LFlXgCnEzNfi1TzEAIspkrLSXKZZ9DD7cZcOIc=; b=w3i6uVd41bBP13Q+BQH5YtXrv+ff1V3T7cn1eKOdnoTrqj5rAj1pmPosQ5ibH4A0IcUJMK 6AT78kO6A0T8dxt5cKYPGntS2nX3Cte3yNsnmY9/wIzUdiNMrk6kwLO1ZbQSXh7Bzqn/U7 4IxCnh1FHhO5/dLl6vKVerclWr9sJJmp3b9kbZ4diExs8MqJA8LzpojjkTsc8iMOuCKHXs sBxexzr35W0G0LemztF+CivPaxMsf8I9R5aq/+qcWGDR7F9cJL1YaI7zZcODBlognKSxHd itAXcNgbKmGApPbuJ1qWd/M6lfDS2h5l39qOerpQvSeiAE0wg2uHx2aN/Cnxnw== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 04 Mar 2026 19:23:44 +0100 Subject: [PATCH net-next 1/8] net: macb: make rx error messages rate-limited 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260304-macb-xsk-v1-1-3d036076abf5@bootlin.com> References: <20260304-macb-xsk-v1-0-3d036076abf5@bootlin.com> In-Reply-To: <20260304-macb-xsk-v1-0-3d036076abf5@bootlin.com> To: Nicolas Ferre , Claudiu Beznea , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Richard Cochran Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?q?Beno=C3=AEt_Monin?= , Tawfik Bayouk , Thomas Petazzoni , Maxime Chevallier , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 If Rx codepath error messages trigger, they do not interrupt reception. Kernel log gets spammed, we lose useful history and everything crawls to a halt. Instead, make them rate-limited to keep old useful information in the log and keep the system responsive. No netdev_*_ratelimited() variants exist so we switch to dev_*(). Signed-off-by: Th=C3=A9o Lebrun --- drivers/net/ethernet/cadence/macb_main.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index a79daad275ba..ab73d1a522c2 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -1303,11 +1303,12 @@ static int macb_tx_complete(struct macb_queue *queu= e, int budget) static inline int gem_rx_data_len(struct macb *bp, struct macb_queue *queu= e, u32 desc_ctrl, bool rx_sof, bool rx_eof) { + struct device *dev =3D &bp->pdev->dev; int len; =20 if (unlikely(!rx_sof && !queue->skb)) { - netdev_err(bp->dev, - "Received non-starting frame while expecting a starting one\n"); + dev_err_ratelimited(dev, + "Received non-starting frame while expecting a starting one\n"); return -1; } =20 @@ -1322,7 +1323,7 @@ static inline int gem_rx_data_len(struct macb *bp, st= ruct macb_queue *queue, =20 if (rx_eof && !rx_sof) { if (unlikely(queue->skb->len > len)) { - netdev_err(bp->dev, "Unexpected frame len: %d\n", len); + dev_err_ratelimited(dev, "Unexpected frame len: %d\n", len); return -1; } =20 @@ -1382,8 +1383,8 @@ static int gem_rx_refill(struct macb_queue *queue, bo= ol napi) gem_total_rx_buffer_size(bp), gfp_alloc | __GFP_NOWARN); if (!page) { - netdev_err(bp->dev, - "Unable to allocate rx buffer\n"); + dev_err_ratelimited(&bp->pdev->dev, + "Unable to allocate rx buffer\n"); err =3D -ENOMEM; break; } @@ -1666,8 +1667,8 @@ static int gem_rx(struct macb_queue *queue, struct na= pi_struct *napi, =20 buff_head =3D queue->rx_buff[entry]; if (unlikely(!buff_head)) { - netdev_err(bp->dev, - "inconsistent Rx descriptor chain\n"); + dev_err_ratelimited(&bp->pdev->dev, + "inconsistent Rx descriptor chain\n"); bp->dev->stats.rx_dropped++; queue->stats.rx_dropped++; break; --=20 2.53.0