* [PATCH net-next] net: veth: Page pool creation error handling for existing pools only
@ 2023-08-11 12:16 Liang Chen
2023-08-11 20:06 ` Jesper Dangaard Brouer
0 siblings, 1 reply; 2+ messages in thread
From: Liang Chen @ 2023-08-11 12:16 UTC (permalink / raw)
To: hawk, horms, davem, edumazet, kuba, pabeni, linyunsheng
Cc: ilias.apalodimas, daniel, ast, netdev, liangchen.linux
The failure handling procedure destroys page pools for all queues,
including those that haven't had their page pool created yet. this patch
introduces necessary adjustments to prevent potential risks and
inconsistency with the error handling behavior.
Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
Signed-off-by: Liang Chen <liangchen.linux@gmail.com>
---
drivers/net/veth.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 614f3e3efab0..509e901da41d 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -1081,8 +1081,9 @@ static int __veth_napi_enable_range(struct net_device *dev, int start, int end)
err_xdp_ring:
for (i--; i >= start; i--)
ptr_ring_cleanup(&priv->rq[i].xdp_ring, veth_ptr_free);
+ i = end;
err_page_pool:
- for (i = start; i < end; i++) {
+ for (i--; i >= start; i--) {
page_pool_destroy(priv->rq[i].page_pool);
priv->rq[i].page_pool = NULL;
}
--
2.40.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: veth: Page pool creation error handling for existing pools only
2023-08-11 12:16 [PATCH net-next] net: veth: Page pool creation error handling for existing pools only Liang Chen
@ 2023-08-11 20:06 ` Jesper Dangaard Brouer
0 siblings, 0 replies; 2+ messages in thread
From: Jesper Dangaard Brouer @ 2023-08-11 20:06 UTC (permalink / raw)
To: Liang Chen, horms, davem, edumazet, kuba, pabeni, linyunsheng
Cc: hawk, ilias.apalodimas, daniel, ast, netdev
On 11/08/2023 14.16, Liang Chen wrote:
> The failure handling procedure destroys page pools for all queues,
> including those that haven't had their page pool created yet. this patch
> introduces necessary adjustments to prevent potential risks and
> inconsistency with the error handling behavior.
>
> Acked-by: Jesper Dangaard Brouer <hawk@kernel.org>
> Signed-off-by: Liang Chen <liangchen.linux@gmail.com>
> ---
Fixes: 0ebab78cbcbf ("net: veth: add page_pool for page recycling")
But not a critical fix, so net-next is okay.
> drivers/net/veth.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> index 614f3e3efab0..509e901da41d 100644
> --- a/drivers/net/veth.c
> +++ b/drivers/net/veth.c
> @@ -1081,8 +1081,9 @@ static int __veth_napi_enable_range(struct net_device *dev, int start, int end)
> err_xdp_ring:
> for (i--; i >= start; i--)
> ptr_ring_cleanup(&priv->rq[i].xdp_ring, veth_ptr_free);
> + i = end;
> err_page_pool:
> - for (i = start; i < end; i++) {
> + for (i--; i >= start; i--) {
> page_pool_destroy(priv->rq[i].page_pool);
> priv->rq[i].page_pool = NULL;
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-11 20:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-11 12:16 [PATCH net-next] net: veth: Page pool creation error handling for existing pools only Liang Chen
2023-08-11 20:06 ` Jesper Dangaard Brouer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).