๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #20621

Re: [PATCH net-next 2/8] ibmveth: Refactor RX resource allocation for MQ RX bring-up

#20621
From: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 01:06
92 lines
11343 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] The kernel-doc for ibmveth_cleanup_rx_resources() in
  drivers/net/ethernet/ibm/ibmveth.c says "Free all RX queue resources",โ€ฆ

--

ibmveth: Refactor RX resource allocation for MQ RX bring-up

This moves the filter list and per-queue RX ring and buffer list
allocation out of ibmveth_open() into helpers that loop over
num_rx_queues and undo their own partial failures. ibmveth_close() and
the open() error path now free through the same helpers.

> diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
> index fc50036d5d265..559c4d2d957bb 100644
> --- a/drivers/net/ethernet/ibm/ibmveth.c
> +++ b/drivers/net/ethernet/ibm/ibmveth.c
> @@ -159,6 +159,177 @@ static unsigned int ibmveth_real_max_tx_queues(void)

[ ... ]

> +/**
> + * ibmveth_cleanup_rx_resources - Free all RX queue resources
> + * @adapter: ibmveth adapter structure
> + */
> +static void
> +ibmveth_cleanup_rx_resources(struct ibmveth_adapter *adapter)
> +{
> +	struct device *dev = &adapter->vdev->dev;
> +	int i;
> +
> +	for (i = 0; i < adapter->num_rx_queues; i++) {
> +		if (adapter->buffer_list_addr[i]) {
> +			dma_unmap_single(dev, adapter->buffer_list_dma[i],
> +					 4096, DMA_BIDIRECTIONAL);
> +			adapter->buffer_list_dma[i] = 0;
> +		}
> +
> +		if (adapter->rx_queue[i].queue_addr) {
> +			dma_free_coherent(dev, adapter->rx_queue[i].queue_len,
> +					  adapter->rx_queue[i].queue_addr,
> +					  adapter->rx_queue[i].queue_dma);
> +			adapter->rx_queue[i].queue_addr = NULL;
> +		}
> +
> +		if (adapter->buffer_list_addr[i]) {
> +			free_page((unsigned long)adapter->buffer_list_addr[i]);
> +			adapter->buffer_list_addr[i] = NULL;
> +		}
> +	}
> +}

[Severity: Low]
This isn't a bug, but is the kernel-doc for ibmveth_cleanup_rx_resources()
accurate? It says "Free all RX queue resources". The body only frees
buffer_list_addr[i] with its buffer_list_dma[i] mapping, plus the coherent
ring at rx_queue[i].queue_addr.

It doesn't free the per-queue buffer pools in adapter->rx_buff_pool[queue][*]
(the free_map, dma_addr and skbuff arrays and the DMA-mapped skbs). That is
why ibmveth_close() still frees them in a separate loop after calling this
helper:

	ibmveth_cleanup_rx_resources(adapter);
	ibmveth_free_filter_list(adapter);

	for (i = 0; i < IBMVETH_NUM_BUFF_POOLS; i++)
		if (adapter->rx_buff_pool[0][i].active)
			ibmveth_free_buffer_pool(adapter,
						 &adapter->rx_buff_pool[0][i]);

The ibmveth_open() error path also keeps its own out_free_buffer_pools
label for the same reason.

At the end of the series this doc line hasn't changed. There, close() and
the open() error path call ibmveth_free_buffer_pools() separately before
this helper. So the helper doesn't seem meant to free the pools.

Could the comment be narrowed to describe the buffer lists and RX rings it
actually frees? The name could also be changed to match its allocator,
ibmveth_alloc_rx_queues().

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119000711.18093-1-mmc%40linux.ibm.com
Technical Details
Message-ID: <179539596618.3135.16248027677119364858@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368924-linux-kernel-netdev=dewy.ru
References: <20261119000711.18093-3-mmc@linux.ibm.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368924-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 2/8] ibmveth: Refactor RX resource allocation for
 MQ RX bring-up
Date: Mon, 23 Nov 2026 01:06:06 +0000
Organization: Usenet Network
Message-ID: <179539596618.3135.16248027677119364858@kernel.org>
References: <20261119000711.18093-3-mmc@linux.ibm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3759668"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:DUYmkx26/GTFRb1z/VcT3LP6Kgg= sha256:krXo2TUt86A/3BNG4amxxLfhlfZM02kgXj1Xsa1zczc=
	sha1:/mnPwWed5oFcpNJqQ7KG8aQJV28= sha256:6yJlsR/uC88hNvauh8DTiB7rFiR6/WnL7+2Yzja2G0I=
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 54750125D8B; Mon, 23 Nov 2026 04:06:24 +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 BlW9eEiYiM4z;
	Mon, 23 Nov 2026 04:06:20 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-368924-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 0D13A125D88; Mon, 23 Nov 2026 04:06:10 +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 2AE7624694; Mon, 23 Nov 2026 01:06:09 +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=1795395969;
	b=Lm4STtrOm1eR0f+yFfoEwsmFRX/AXzqbshm7+Rulz6p8ypE9T8SMOzn80ReDhhSkE1n4
	 fnHqkswmZoCOeVrjCNplQn/0BMO+EbTq1wKZKmfXEZW4iianGhwX+AVs6guDOI8nh8MDw
	 SYHY3Gp5QJWVlEN8kxwSqCrptHfWwLkJ2DaMwYjEH7BibUnidfPEh0+JhplWYsyCgAi7u
	 h4ERdQxwl8nmvXxyyQvfP6aAxdWTyvnrTyZSnq2hKdzBkTIPj7XuZhBWz9k9RgWGF5Abe
	 sDzRRJYH8xFaBk+L0GlfHMUk9cGIAMYcebX9Pncx0Ioa7KPsR9Qdis0iCwRyFki7C9g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795395969;
	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=Pc0mbPEt0qUdPQBtJKfrlvydOvmXsdAhSeL1Yff4aoM=;
	b=lRi0eI2wdF6qe0VaYDsOA3XNKDRVm15hPNF1WNsrg0X0jgZoQcVp7J3cqC/VETqbw2jU
	 NCYL+UUBISkoGX3hnziAzptGDtfFF84e2lnfiUi4Y8wT5V2yFOf+lCaOXQqo4bc3Qb9DS
	 lmrOMmv6FAtVMNEGmPF6CH515TTLWGuo3JUrguDgOCK9dwbudOzSm5T2QKz94lZm2rqEh
	 fXxXew2bCSmLHWIX/udOFJz7wF/pDsdqPUtsnE//ec53mmsIoecvC6Y1W1+3e0VUqMOdF
	 cEy3WfQE5P5tskiX9DlnuMw0c+JLBgHy2uHCcYMB8ujR4Lib+UZgO9LNUDx1jWoZWTw==
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=BZVPkEAb;
	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 EC7CA606A330;
	Mon, 23 Nov 2026 01:06:08 +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=BZVPkEAb
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=1795395968;
	b=VX0jsLgudp1sEOkYOJMf65S5sf7JpSGmgFhfPVN1lXqMfXHpJ9dgz1qKV4UxukRleVg+
	 JJzgHmcwv+2D6Pi7JjTfEKI2uVS/LZ27Crl9TUhO9u6J3vByGUDb/BBSQkJtusne+rWmZ
	 dIxy1Hv0ER4AJtzA8EB0Bv4EYikmBS3PNYGytlW/03b1PYk2V5VnxunVhSPVwFj81zFLP
	 SRZQM/vZQJKxuHccDTUrlPb/RgnnyvVRbr41U0cpGbxhTdAxSLn4SFC7GhxLRT6LYQyi8
	 uxayXmFWjSmTKSo0hVB2VNuEqb3wKhk5XyTgx69sFrtOD0AmwVmZecsZX9+AH8T8agw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795395968;
	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=Pc0mbPEt0qUdPQBtJKfrlvydOvmXsdAhSeL1Yff4aoM=;
	b=0RtnMrlEPvvmtPvQMx7N8a4mkvjadzchEaZxC5w5oXZKmNpY8LK4JdsWwbob/46f1IZN
	 7Oi2+I2vs7iLN03LkWSrNTDouY5dj4idh2DbRjWX4rJZ6XhlxHoRkVva03QiBq9pJ0bof
	 JeKzuZ5KUowdppX8fD+9QPC8iam22N3Wiy7AlS30/EQjLHODLBnpu8Gj2fWIRaPYFF/uD
	 N7dXcCsmN2Se5ndaoApJkbk7Fg0O41b4ubycasPdqr4vq+iG/5jDCurRatfJlXFlwlL4a
	 49R+VsjDv+pefLMuvz7NjZm5bck/X1NcIiSwsaToBS+b/cVSsciYw7jnBoUJwDiIDDw==
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=BZVPkEAb;
	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 18E91606A31E
	for <netdev@vger.kernel.org>; Mon, 23 Nov 2026 01:06:08 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id A97691F000C0;
	Mon, 23 Nov 2026 01:06:06 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795395967;
	bh=Pc0mbPEt0qUdPQBtJKfrlvydOvmXsdAhSeL1Yff4aoM=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=BZVPkEAbcTojVg8JMq9AXiu3/+6RVnbR+VC+8EeuzlUt8+/jgMB+eMo2CgQIyd0JH
	 sw0LEDjpOO6jRRgEiAvAscgXh7sPQwhrysjSaqVnLvKaQ4nwZ5VXunKm4dKuD9UAtd
	 W8w3mXbynmYuJy0Cfo9VrG96OIyEwBzaGfeGxS93ySTlPS6H+RDMm7Xa/Ka30FjqsZ
	 C6MPKq1InnhNzmkctgEus+74d7H5wYnMG1NaTBl8GzNQXApzjc4q1rm2qsEAhrMVJa
	 RxIXKdoxjKT3rJg8JuFJdMAys8nPPAamrKiX5NCsJ+I22C6LcLEaVXCqnwK5im11Y3
	 5IKtIvtVHMAog==
X-Cc: netdev@vger.kernel.org, maddy@linux.ibm.com, mpe@ellerman.id.au,
 npiggin@gmail.com, chleroy@kernel.org, ritesh.list@gmail.com,
 sshegde@linux.ibm.com, nnac123@linux.ibm.com, andrew+netdev@lunn.ch,
 davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
 linuxppc-dev@lists.ozlabs.org, horms@kernel.org, davemarq@linux.ibm.com,
 haren@linux.ibm.com, ricklind@linux.ibm.com, bjking1@linux.ibm.com,
 shaik.abdulla1@ibm.com
X-In-Reply-To: <20261119000711.18093-3-mmc@linux.ibm.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