From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 01C2D31F98D for ; Wed, 11 Mar 2026 16:42:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773247327; cv=none; b=hOr7h7eZgbpvLMpnDoNUW0mZxQ8bO1BXBvz9ULG+eC8LxRZdyAIt0yBexWsvS9BcalctFW0weDDP9VXofz1dQBEHLF90SY/VeC3LqncVqQjzNLFM3uLzWNYPZBFpoVa3IuQ5FE6U2Tp82rXktmzKNjBODUILW2ID3Hek2TJsb2s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773247327; c=relaxed/simple; bh=Rxwu7P2BsBf7J3IMi0b3ZYktsM6QyOeW9SKkUNzmkwM=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=Z/F9UkHAnpfGj7b1jkc7PP6HIbKf/l7ck17sMuRg5F2Dz/KxqFxp2c6uB30+6r1DQtkokUOiMLMHigkAiV2NTvsZAjY+m+FNAeiL2cMwdQN1pwtMsbeoEIny/yYE848r5EujJBSR+nG4u4tf+4KEj5M+beMVbUzYbzsXldvHJQY= 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=FftUn82e; arc=none smtp.client-ip=185.246.85.4 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="FftUn82e" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 65E184E40885; Wed, 11 Mar 2026 16:42:02 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 3971B60004; Wed, 11 Mar 2026 16:42:02 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 36DAA10369C3E; Wed, 11 Mar 2026 17:41:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1773247321; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding; bh=JcIMZNMBI1wXpXximaDXv28O7qFSIHi31ekLqyAd7Hc=; b=FftUn82eNPTqQwYk+E19drRGFnglXM5f2DDFCtgUh7JjlbtFMXtSNWzMmSo+0ztL6YEoqL IqmdyfCOoEeRnibpNB7ZN8AOUqm1q0OjGPGDZ9s/5gVPf4F+I8jpDbZjtd2qlsNYFB44fH iX4MRw59LnpFJeljZ+iTkmzrKeJuXG19q//ST2MXjt08jFm4N5rvWZg25XGN/p1jNETBbn NnDREneC2eHLUOZCqHFkPVIPEpcFtfTve/1DTbPJTS31r2B5ry0u+kvJJoHRywzNAbiKsW Y7v/Wakna6Q9xHeI9242304sIljtSkEzsBUUx+ul70do+XavgFSjheIwfGdgTA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Subject: [PATCH net-next v2 0/2] net: macb: implement ethtool set channels count operation Date: Wed, 11 Mar 2026 17:41:52 +0100 Message-Id: <20260311-macb-set-channels-v2-0-982693a1f5fc@bootlin.com> 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: 8bit X-B4-Tracking: v=1; b=H4sIAFCbsWkC/32NQQ6DIBBFr2Jm3WkQorZd9R6NC8SxTqJggBgbw 91LOUCXP+//908I5JkCPKoTPO0c2Nkc5KUCM2v7JuQxZ5BCtkKJBldtBgwU8YctLQGbYWpJdJO SnYC82zxNfBTnC2xuWjoi9JnMHKLzn3K214X/8e41CpQ3UvreajUa9Ryciwvbq3Er9CmlL6GtE cy+AAAA X-Change-ID: 20260305-macb-set-channels-5bf6e07f3270 To: Nicolas Ferre , Claudiu Beznea , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Vladimir Kondratiev , Gregory CLEMENT , =?utf-8?q?Beno=C3=AEt_Monin?= , Tawfik Bayouk , Thomas Petazzoni , Paolo Valerio , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.15-dev X-Last-TLS-Session-Version: TLSv1.3 Add support for changing the active number of queues. Tested on Mobileye EyeQ5. The first patch is as expected. However the second one might be more surprising: GEM has per-queue Tx SRAM segmentation. If we do not touch SRAM distribution then we'll only be able to exploit a portion of it when a smaller queue count is configured. It also is beneficial if bootloader stages write to the register and we don't reset it but attempt to use all queues (the default). The operation is only hidden behind MACB_CAPS_QUEUE_DISABLE, we do not introduce yet another feature flag. As this series must s/num_queues/max_num_queues/ quite a lot, it conflicts with other in-flights series touching MACB in the netdev ML. I'll make sure to resend once net-next gets updated. Have a nice day, Thanks, Théo Signed-off-by: Théo Lebrun --- Changes in v2: - Move gem_sram_distribute_segments() from macb_main.c to macb_utils.c and kunit tests from macb_main.c to macb_kunit.c. - macb_set_channels(): - Add comment about MACB_CAPS_QUEUE_DISABLE. - Refuse operation if netif_running(), with code comment. - Drop useless sanity checks on ch->{combined,rx,tx}_count. - Add help text to CONFIG_MACB_KUNIT_TEST. - Fix `checkpatch --max-line-length=80` warnings. - Rebase onto latest net-next; nothing to report. - Link to v1: https://lore.kernel.org/r/20260305-macb-set-channels-v1-0-28e3a96a3dc3@bootlin.com --- Théo Lebrun (2): net: macb: implement ethtool_ops.get|set_channels() net: macb: distribute evenly Tx SRAM segments drivers/net/ethernet/cadence/Kconfig | 13 ++++ drivers/net/ethernet/cadence/Makefile | 5 +- drivers/net/ethernet/cadence/macb.h | 9 +++ drivers/net/ethernet/cadence/macb_kunit.c | 73 ++++++++++++++++++ drivers/net/ethernet/cadence/macb_main.c | 118 ++++++++++++++++++++++++++---- drivers/net/ethernet/cadence/macb_utils.c | 56 ++++++++++++++ 6 files changed, 257 insertions(+), 17 deletions(-) --- base-commit: df99d268555f52fb2ac3b9fc9a6198ea0579c48a change-id: 20260305-macb-set-channels-5bf6e07f3270 Best regards, -- Théo Lebrun