From: Liang Chen <liangchen.linux@gmail•com>
To: hawk@kernel•org, horms@kernel•org, davem@davemloft•net,
edumazet@google•com, kuba@kernel•org, pabeni@redhat•com,
linyunsheng@huawei•com
Cc: ilias.apalodimas@linaro•org, daniel@iogearbox•net,
ast@kernel•org, netdev@vger•kernel.org,
liangchen.linux@gmail•com
Subject: [PATCH net-next] net: veth: Page pool creation error handling for existing pools only
Date: Fri, 11 Aug 2023 20:16:40 +0800 [thread overview]
Message-ID: <20230811121640.13301-1-liangchen.linux@gmail.com> (raw)
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
next reply other threads:[~2023-08-11 12:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 12:16 Liang Chen [this message]
2023-08-11 20:06 ` [PATCH net-next] net: veth: Page pool creation error handling for existing pools only Jesper Dangaard Brouer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230811121640.13301-1-liangchen.linux@gmail.com \
--to=liangchen.linux@gmail$(echo .)com \
--cc=ast@kernel$(echo .)org \
--cc=daniel@iogearbox$(echo .)net \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=hawk@kernel$(echo .)org \
--cc=horms@kernel$(echo .)org \
--cc=ilias.apalodimas@linaro$(echo .)org \
--cc=kuba@kernel$(echo .)org \
--cc=linyunsheng@huawei$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox