From mboxrd@z Thu Jan 1 00:00:00 1970 From: Magnus Karlsson Subject: [PATCH bpf 4/4] xsk: do not return EMSGSIZE in copy mode for packets larger than MTU Date: Wed, 11 Jul 2018 10:12:52 +0200 Message-ID: <1531296772-28850-5-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 S1726410AbeGKIQp (ORCPT ); Wed, 11 Jul 2018 04:16:45 -0400 In-Reply-To: <1531296772-28850-1-git-send-email-magnus.karlsson@intel.com> Sender: netdev-owner@vger.kernel.org List-ID: This patch stops returning EMSGSIZE from sendmsg in copy mode when the size of the packet is larger than the MTU. Just send it to the device so that it will drop it as in zero-copy mode. This makes the error reporting consistent between copy mode and zero-copy mode. Fixes: 35fcde7f8deb ("xsk: support for Tx") Signed-off-by: Magnus Karlsson --- net/xdp/xsk.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c index 9c784307f7b0..72335c2e8108 100644 --- a/net/xdp/xsk.c +++ b/net/xdp/xsk.c @@ -233,15 +233,10 @@ static int xsk_generic_xmit(struct sock *sk, struct msghdr *m, if (xskq_reserve_addr(xs->umem->cq)) goto out; - len = desc.len; - if (unlikely(len > xs->dev->mtu)) { - err = -EMSGSIZE; - goto out; - } - if (xs->queue_id >= xs->dev->real_num_tx_queues) goto out; + len = desc.len; skb = sock_alloc_send_skb(sk, len, 1, &err); if (unlikely(!skb)) { err = -EAGAIN; -- 2.7.4