From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FROM_EXCESS_BASE64,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48489C282C2 for ; Thu, 7 Feb 2019 04:51:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0BD3E218FE for ; Thu, 7 Feb 2019 04:51:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="PVWno5Av" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726750AbfBGEvu (ORCPT ); Wed, 6 Feb 2019 23:51:50 -0500 Received: from mail-yb1-f196.google.com ([209.85.219.196]:34747 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726666AbfBGEvu (ORCPT ); Wed, 6 Feb 2019 23:51:50 -0500 Received: by mail-yb1-f196.google.com with SMTP id k9so3496897ybg.1 for ; Wed, 06 Feb 2019 20:51:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ySPyruGu9nYUYpSYuiTyZS4GqJqS2GK07xa/2Nx+3qk=; b=PVWno5AvEw1kuQo0Pt6xz3VK3j74Vw1K+fL/zzSSlC4zYPJxXfJ8o0oKL70I/6xdH7 xsiyovTLjsDDcOM8xAyTGTbht3cI8UfYhJtYAxb8cvoX7z64cp0gBIqQGl1I5rTKi7TR t07QfXfIJPbyzFMlwbtYNQ7dyt8yYVKOj2hAy3u+Qh66kcOqpSNX912jOZ97yUHOLYZJ B2W+h0CGejmuSgFjOPipI8xe+d/lvmDaBcIlw4Pj+1jpVwGMOI/hdF87RFTgrp8CCfNr mDNrKuJuBsrJm2cM0qxH8an07rdqB0lNFQFzJLrbDmxlyiAnXn4SFXRnm4pKD6WTo5ug s4ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ySPyruGu9nYUYpSYuiTyZS4GqJqS2GK07xa/2Nx+3qk=; b=se5YraIM8Q/pEgPwyz6KEH/AUEYC5zNgG8kPvEjmjQPN+3n0zHO41LFqiFQL/9hA3S 9d1y5kJQcXLQMhWXxBtyBNdZ5rUpBv3j43MkLaoWtBrRU0mwVm8lkDoeS4ULgo9RPS++ 4eMNpyIQy+GmlfuTbP2yQWDnjh6KrfZQ8dssXozBCjFpiex3QnZnbMeUtxKKg51c5MrW gjXHTBcftSptM61JvxSAy/W1Xdj9Q/0R65R5u3hG2huh6qM6bySSnYMAqwT+8pQ71ax1 EiqTRvi9Dq12kMjbI7oeGq7kG2+M9tG/ZX7Kfy9UWdJPJFwOQc9BstQTjOJyGey9g4gB qgtQ== X-Gm-Message-State: AHQUAuZlDvEqwY5yFXIreu75GXCjr88bWavrUJmNgPpsoYJ6vZ0Tk7aL ubWnHUQyJMJ/CR6ixHV2NoVwsgp9I96uVOJgE25Viw== X-Google-Smtp-Source: AHgI3IadWd4zTJpq0vL6010hSQkE21RMkAyprsZJCO6JfliqDkNhfdXFrWrMfREMZ6JBfOFJC6Ckk/3AnBKHzcCArwE= X-Received: by 2002:a25:4903:: with SMTP id w3mr11458538yba.212.1549515108806; Wed, 06 Feb 2019 20:51:48 -0800 (PST) MIME-Version: 1.0 References: <874la1r0io.fsf@linkitivity.dja.id.au> In-Reply-To: From: =?UTF-8?B?TWFoZXNoIEJhbmRld2FyICjgpK7gpLngpYfgpLYg4KSs4KSC4KSh4KWH4KS14KS+4KSwKQ==?= Date: Wed, 6 Feb 2019 20:51:37 -0800 Message-ID: Subject: Re: Stack sends oversize UDP packet to the driver To: Michael Chan Cc: Daniel Axtens , Netdev , David Miller , Eric Dumazet , Willem de Bruijn Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Feb 5, 2019 at 11:36 AM Michael Chan wr= ote: > > On Wed, Jan 30, 2019 at 5:00 PM Mahesh Bandewar (=E0=A4=AE=E0=A4=B9=E0=A5= =87=E0=A4=B6 =E0=A4=AC=E0=A4=82=E0=A4=A1=E0=A5=87=E0=A4=B5=E0=A4=BE=E0=A4= =B0) > wrote: > > > > On Wed, Jan 30, 2019 at 1:07 AM Michael Chan wrote: > > > > > > On Tue, Jan 22, 2019 at 10:29 AM Mahesh Bandewar (=E0=A4=AE=E0=A4=B9= =E0=A5=87=E0=A4=B6 =E0=A4=AC=E0=A4=82=E0=A4=A1=E0=A5=87=E0=A4=B5=E0=A4=BE= =E0=A4=B0) > > > wrote: > > > > > > > > > > > The idea behind the fix is very simple and it is to create a dst-on= ly > > > > (unregistered) device with a very low MTU and use it instead of 'lo= ' > > > > while invalidating the dst. This would make it *not* forward packet= s > > > > to driver which might need fragmentation. > > > > > > > > > > We tested the 2 patches many times and including an overnight test. = I > > > can confirm that the oversize UDP packets are no longer seen with the > > > patches applied. However, I don't see the blackhole xmit function > > > getting called to free the SKBs though. > > > > > Thanks for the confirmation Michael. The blackhole device mtu is > > really small, so I would assume the fragmentation code dropped those > > packets before calling the xmit function (in ip_fragment), you could > > verify that with icmp counters. > > > > I've looked at this a little more. The blackhole_dev is not IFF_UP | > IFF_RUNNING, right? May be that's why the packets are never getting > to the xmit function? Yes, so I added those two flags and ended up writing a test-module for the device (which I will include while posting the patch-series). However, adding those flags is also not sufficient since the qdisc is initialized to noop_qdisc so qdisc enqueue will drop packets before hitting the ndo_start_xmit().