xsk: do not return ENXIO from TX copy mode
authorMagnus Karlsson <magnus.karlsson@intel.com>
Wed, 11 Jul 2018 08:12:49 +0000 (10:12 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 13 Jul 2018 13:34:31 +0000 (15:34 +0200)
This patch removes the ENXIO return code from TX copy-mode when
someone has forcefully changed the number of queues on the device so
that the queue bound to the socket is no longer available. Just
silently stop sending anything as in zero-copy mode so the error
reporting gets consistent between the two modes.

Fixes: 35fcde7f8deb ("xsk: support for Tx")
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
net/xdp/xsk.c

index 7d220cbd09b6af6f65a7d9bedeaac958f3b159b7..08d09115093edc8710ddce09a823f53498f3c7b4 100644 (file)
@@ -244,10 +244,8 @@ static int xsk_generic_xmit(struct sock *sk, struct msghdr *m,
                        goto out;
                }
 
-               if (xs->queue_id >= xs->dev->real_num_tx_queues) {
-                       err = -ENXIO;
+               if (xs->queue_id >= xs->dev->real_num_tx_queues)
                        goto out;
-               }
 
                skb = sock_alloc_send_skb(sk, len, 1, &err);
                if (unlikely(!skb)) {