From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: Re: [PATCH v5 bpf-next 3/9] veth: Avoid drops by oversized packets when XDP is enabled Date: Thu, 26 Jul 2018 17:51:27 -0700 Message-ID: <20180726175127.075185fc@cakuba.netronome.com> References: <20180726144032.2116-1-toshiaki.makita1@gmail.com> <20180726144032.2116-4-toshiaki.makita1@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Toshiaki Makita , Jesper Dangaard Brouer To: Toshiaki Makita Return-path: Received: from mail-qk0-f195.google.com ([209.85.220.195]:45232 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731729AbeG0CKt (ORCPT ); Thu, 26 Jul 2018 22:10:49 -0400 Received: by mail-qk0-f195.google.com with SMTP id c192-v6so2273732qkg.12 for ; Thu, 26 Jul 2018 17:51:32 -0700 (PDT) In-Reply-To: <20180726144032.2116-4-toshiaki.makita1@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 26 Jul 2018 23:40:26 +0900, Toshiaki Makita wrote: > + max_mtu = PAGE_SIZE - VETH_XDP_HEADROOM - > + peer->hard_header_len - > + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); > + if (peer->mtu > max_mtu) { > + NL_SET_ERR_MSG_MOD(extack, "Peer MTU is too large to set XDP"); > + err = -ERANGE; > + goto err; > + } You need to add .ndo_change_mtu and check this condition there too.