🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16756

Re: [PATCH net-next v6 2/2] net: macb: distribute evenly Tx SRAM segments

#16756
From: Nicolai Buchwitz
Date: Sun, 15 Nov 2026 19:40
48 lines
10486 bytes
On 13.11.2026 18:32, Théo Lebrun wrote:
> GEM has registers to configure the Tx SRAM segments distribution across
> queues. The reset value is apprioriate (even spread) but we need to
> care if/when number of active queues is modified (or if we inherited
> unevenly initialised hardware from bootloader).
> 
> To distribute segments, we take as input the number of queues
> (ctx->num_queues) and the number of segments (found inside DCFG6).
> Its output is a number of segments for each queue, formatted as
> powers-of-two (eg 2 for queue 0 means it has 2^2=4 segments).
> 
> Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
> ---
>  drivers/net/ethernet/cadence/macb.h      | 14 ++++++
>  drivers/net/ethernet/cadence/macb_main.c | 76 
> +++++++++++++++++++++++++++++++-

> [...]

>  static void macb_init_hw(struct macb *bp)
>  {
>  	u32 config;
> @@ -3465,6 +3522,20 @@ static void macb_init_hw(struct macb *bp)
>  	if (bp->caps & MACB_CAPS_JUMBO)
>  		bp->rx_frm_len_mask = MACB_RX_JFRMLEN_MASK;
> 
> +	/* Distribute Tx SRAM segments evenly based on active number of 
> queues.
> +	 * TXQSEGALLOC is only documented for some GEM integrations.
> +	 */
> +	if (bp->caps & MACB_CAPS_TXQSEGALLOC) {
> +		unsigned int num_segments;
> +		u32 val;
> +
> +		num_segments = 1U << GEM_BFEXT(SEGMENTS_BIT_SIZE,
> +					       gem_readl(bp, DCFG6));
> +		val = gem_sram_distribute_segments(bp->ctx->num_queues,
> +						   num_segments);
> +		gem_writel(bp, TXQSEGALLOC_LOWER, val);

This only runs on open, not on a context swap. So ethtool -L on a
running interface keeps the old split until the next down/up?

> [...]

Regards,
Nicolai
Technical Details
Message-ID: <00aea741bd079eb9168fb2ef9b656f25@tipi-net.de>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363832-linux-kernel-netdev=dewy.ru
References: <20261113-macb-set-channels-v6-0-5de59d9e7f02@bootlin.com> <20261113-macb-set-channels-v6-2-5de59d9e7f02@bootlin.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363832-linux-kernel-netdev=dewy.ru
From: nb@tipi-net.de (Nicolai Buchwitz)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v6 2/2] net: macb: distribute evenly Tx SRAM
 segments
Date: Sun, 15 Nov 2026 20:40:55 +0100
Organization: Usenet Network
Message-ID: <00aea741bd079eb9168fb2ef9b656f25@tipi-net.de>
References: <20261113-macb-set-channels-v6-0-5de59d9e7f02@bootlin.com>
 <20261113-macb-set-channels-v6-2-5de59d9e7f02@bootlin.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1885558"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:wTOn3197LHcYZnRekQ5IfqruivY= sha256:zC8dgAoeVNNsQsPqvhSDy8qporlTTmrpgkH/k1juLto=
	sha1:9C9R6Fgu8vFbY04OeeqAiSPUfEA= sha256:vpwIgjEnn5qe/0GY3s3M9sE8C0TaLO+o0dOM5wcXGrg=
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 D4255114A51; Sun, 15 Nov 2026 22:41:18 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=tipi-net.de
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 R6hCo2o_athI;
	Sun, 15 Nov 2026 22:41:15 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-363832-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 8D5F9114A4C; Sun, 15 Nov 2026 22:41:06 +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 9672730BFA; Sun, 15 Nov 2026 19:41:04 +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=1794771664;
	b=A/O6im0mA90TCXn6J8Ye7lkJjYlATigxOJI3C0rEDg6XyC63Md55LVqeIkBlh1VDARvR
	 3yfzWNY71y32VRyU9UBKEQgK6vFXv37Xj0gXDEoQObGRQ5wJhBRtuzLyMaCsltMwpfsYe
	 25nrizxA3HW66Mp3cmfVmLz7fJyIEs7FPqj9mknqJ+sSOHOeSv/8Z9mj8yvmQXG4pqcTm
	 Dr3mrtbj5fmoNBg3DnH8cWwVdUmjtZrDyuhJo0tu+fTEZ0S1FLv/ZcDTdTs1+2YZ4decH
	 rPrYttuZFmuUnbQV2S9Dxx7bGMWRCf9T7pJ2Vuzt5Gaz9U70jTJVBi6+z42T+Ej2meg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794771664;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Date:From:To:Cc:
	 Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type:
	 Content-Transfer-Encoding:X-Last-TLS-Session-Version;
	bh=9Z/SeLigb7cKZ8AenGFKvsGPiHPN7jeIOZeKFYBKPbY=;
	b=QmWSPXqwP5dvP8w45btGskMZzDaSbCVhGAXn6Mx1m1BRfo00enDccZCfIcovI2AAqO0W
	 I00IpFMyUDl8f/+qb6htYQM7e+qdX1+1R5Kf6UzSF0bbvNbMLBbtOsJVdHCuQWU3cx21T
	 vE6MYXb78A9G9eyi8uZd+u3vn+0wnqAlnr+diiaDJeU+Y+8Bt5oTx4yV41BTbwdParrUS
	 E6P8OXPmISc4UW9qDEXhO1RDcGxHwnEdx7PpT+esfGyX6Sbj1pgyyy3sCHmKRleGLsZbG
	 0hV2TP/at8tQFb/e2LkBxQjm0wUrWu+O24XKIqqguQkoW16OAs+vgum2CWpYJ4szf5Q==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=yWY28+xR;
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	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 6C9DB606A335;
	Sun, 15 Nov 2026 19:41:04 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=yWY28+xR
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=194.13.80.246
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794771658;
	b=FzRdJzr/lkxPsMvlZPa4HaWa2G9tiPZjnGrzyLSstTsfGYQuL67V/MFx8ns+b3TGbJRu
	 6wsE4P5iHm5tv4gG0mcL6rwXTWF/Q5oU61xFbkpuMrHvffBTdmWJzSusiZAp9vgUGx5+3
	 pCD506kUqYkP+9YVNE1E2r4bPQcgiNfoorB4Iz2pCfw1T9UDuuUlonoLhEG/e7fYZpDTq
	 y2fJGGUBhdt3cjgRBy1cDTDm3FUo7QG/6bkThIvoyR2+VamFufRrARcP7t5inGejIIh2H
	 TTRu8nwCcmDaKH9MlKC/4iqnZn0GZKVGcdnxKoYmDwdWDdOiVIzPJlp3TBRH3vaQ5OA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794771658;
	h=DMARC-Filter:Received:DKIM-Signature:MIME-Version:Date:From:To:Cc:
	 Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type:
	 Content-Transfer-Encoding:X-Last-TLS-Session-Version;
	bh=9Z/SeLigb7cKZ8AenGFKvsGPiHPN7jeIOZeKFYBKPbY=;
	b=n6C6cptDivGLhiLcDBQbjTqlRv5bUwyShudveKw3dfMpHBE8kFI7r+Ybp1J7BuoeP2rn
	 siY4dTNP0P5ZWzeJtRSX6jlgAvpg3nIdj1xHjWphecTYkIZQJWeYgsHF7g1xlkCHKPEL7
	 duoUiodPLXGiBnNzFqHVKKgm2j7IPHOCrgcbAs2oKKq55cOvmCnstuBu2WromMx6ZIOYk
	 3rAYKssJVP3rMvF/czKuJ1iyZxXnByWNtRta2iJSqPFsbl78moCqrtGkQIYZyzxVenaUG
	 /QJtw8LmBe1AVw2sbLV23z4KqBkEhpJLoROe6dz7QYg5HGQvl1fTEVyq7B5YGyZhK/A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=yWY28+xR;
	arc=none smtp.remote-ip=194.13.80.246
X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246])
	(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 1A146606A31F;
	Sun, 15 Nov 2026 19:40:57 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1A146606A31F
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de
X-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 57395A15A5;
	Sun, 15 Nov 2026 20:40:55 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim;
	t=1794771656; h=from:subject:date:message-id:to:cc:mime-version:content-type:
	 content-transfer-encoding:in-reply-to:references;
	bh=9Z/SeLigb7cKZ8AenGFKvsGPiHPN7jeIOZeKFYBKPbY=;
	b=yWY28+xR+uME0tIkAhr6W+D54FEYTar3UfmQ29bGapl8Xt9Us9v6la1EqRQx8CzrCHhk2s
	OgE7SYbSdMA8NVXaRbQDaQWAid9YLmvbFu3LavUJPUYkMi1D3i6+fPotd8cn7oIbtg4aiD
	CnniVTMDuscpm8DXyfF/TVgnueGb0N47PECPFb160IkU5NVCZtXaNh4xFM6kDGSNnxx2x3
	DRuo57WoaKekYx0wX+vT0zh63ZYfNbgY2KNFfizynNwuPpX5PC4bN5KzfBT5FLN1zj11I1
	Pof4Fl4n4aI5ctvJeBu7LcW+QbGpivOkSeXuNXDdtd1F7lszO3CZuKhUqpp/VA==
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
X-Cc: Conor Dooley <conor.dooley@microchip.com>, Andrew Lunn
 <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Eric
 Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni
 <pabeni@redhat.com>, Russell King <linux@armlinux.org.uk>,
 netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Valerio
 <pvalerio@redhat.com>, Vladimir Kondratiev
 <vladimir.kondratiev@mobileye.com>, Gregory CLEMENT
 <gregory.clement@bootlin.com>, Benoît Monin
 <benoit.monin@bootlin.com>, Tawfik Bayouk <tawfik.bayouk@mobileye.com>,
 Thomas Petazzoni <thomas.petazzoni@bootlin.com>
X-In-Reply-To: <20261113-macb-set-channels-v6-2-5de59d9e7f02@bootlin.com>
X-Sender: nb@tipi-net.de
X-Last-TLS-Session-Version: TLSv1.3