From mboxrd@z Thu Jan 1 00:00:00 1970 From: Magnus Karlsson Subject: [PATCH bpf 1/4] xsk: do not return ENXIO from TX copy mode Date: Wed, 11 Jul 2018 10:12:49 +0200 Message-ID: <1531296772-28850-2-git-send-email-magnus.karlsson@intel.com> References: <1531296772-28850-1-git-send-email-magnus.karlsson@intel.com> Cc: qi.z.zhang@intel.com, pavel@fastnetmon.com To: magnus.karlsson@intel.com, bjorn.topel@intel.com, ast@fb.com, daniel@iogearbox.net, netdev@vger.kernel.org, eric.dumazet@gmail.com Return-path: Received: from mga01.intel.com ([192.55.52.88]:50147 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726205AbeGKIQo (ORCPT ); Wed, 11 Jul 2018 04:16:44 -0400 In-Reply-To: <1531296772-28850-1-git-send-email-magnus.karlsson@intel.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- net/xdp/xsk.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index 7d220cbd09b6..08d09115093e 100644 --- a/net/xdp/xsk.c +++ b/net/xdp/xsk.c @@ -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)) { -- 2.7.4