summaryrefslogtreecommitdiff
path: root/net/xdp
diff options
context:
space:
mode:
Diffstat (limited to 'net/xdp')
-rw-r--r--net/xdp/xsk.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index ea8d2ec8386e..5eb6662f562a 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -701,14 +701,11 @@ static int xsk_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
sockfd_put(sock);
goto out_unlock;
}
- if (umem_xs->dev != dev) {
- err = -EINVAL;
- sockfd_put(sock);
- goto out_unlock;
- }
- if (umem_xs->queue_id != qid) {
- /* Share the umem with another socket on another qid */
+ if (umem_xs->queue_id != qid || umem_xs->dev != dev) {
+ /* Share the umem with another socket on another qid
+ * and/or device.
+ */
xs->pool = xp_create_and_assign_umem(xs,
umem_xs->umem);
if (!xs->pool) {