[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210602031001.18656-1-wanghai38@huawei.com>
Date: Wed, 2 Jun 2021 11:10:01 +0800
From: Wang Hai <wanghai38@...wei.com>
To: <bjorn@...nel.org>, <magnus.karlsson@...el.com>,
<jonathan.lemon@...il.com>, <davem@...emloft.net>,
<kuba@...nel.org>, <ast@...nel.org>, <daniel@...earbox.net>,
<hawk@...nel.org>, <john.fastabend@...il.com>
CC: <netdev@...r.kernel.org>, <bpf@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH net-next] xsk: Return -EINVAL instead of -EBUSY after xsk_get_pool_from_qid() fails
xsk_get_pool_from_qid() fails not because the device's queues are busy,
but because the queue_id exceeds the current number of queues.
So when it fails, it is better to return -EINVAL instead of -EBUSY.
Signed-off-by: Wang Hai <wanghai38@...wei.com>
---
net/xdp/xsk_buff_pool.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/xdp/xsk_buff_pool.c b/net/xdp/xsk_buff_pool.c
index 8de01aaac4a0..30ece117117a 100644
--- a/net/xdp/xsk_buff_pool.c
+++ b/net/xdp/xsk_buff_pool.c
@@ -135,7 +135,7 @@ int xp_assign_dev(struct xsk_buff_pool *pool,
return -EINVAL;
if (xsk_get_pool_from_qid(netdev, queue_id))
- return -EBUSY;
+ return -EINVAL;
pool->netdev = netdev;
pool->queue_id = queue_id;
--
2.17.1
Powered by blists - more mailing lists