Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3362102pxb; Mon, 9 Nov 2020 09:12:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxc9x5EP+9dcl3rYXkKVV0TC9GCno86JB4RaZBpjVTXI/dsPAWfgAt1mn5H1fJHhdY6dXYC X-Received: by 2002:a17:906:9457:: with SMTP id z23mr15225344ejx.296.1604941923104; Mon, 09 Nov 2020 09:12:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604941923; cv=none; d=google.com; s=arc-20160816; b=ObgetN/P0P3CZgt0WooKtYHCkPxATul6Iun3SoALdgLmAPFuXIkMEuql9yHHbzcK8m p0BnNMv/2nIPFD99ADJ9c+n67epERyjbOqz4Mbvv5UUbUDcexlY5RY17xR+fFrFS0Rpi sYGRRGFPfPOcs0icAySi7b1DFIyKYIdztZHGbPxMsvS0TKAq6PFgS+ByNcBe1n/PgaLr nQisyS0vHK17FKyzukaVjyF8ESsRIBqSt/Sqh8hloEiFqf9I9SGY6uMZaRoCP2hgDW+Z 9f+rcsLw6vA632+RZgfUXCKJiNqJC7SK3YiPWXWusMf19G+g5Gj7r8lbRKVSLNE0SIfi PVjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=QvIn+60yZ2g+goNrF89dTWG7tHbqd9bjnmQMUGC2tLU=; b=Nxij/ENxMbT62ufzd2j1K9N4cMj48Kh1VcmWnBf/3KrSn2afDGPG0Z1KQ5WEmLFBJ8 TUitqs4p5D/BPdNYT5J0X0rDbRMFNNScqbmWfEV7KQ+i2MoYjV+ytwjDr6eDZXvnk+XU h6ZHPBb/0/Qg9ilOxQhHfJdV+g7szOEVzPGBy+vMS55flk3xuxRXwsuwhT3YWD+Fkdd/ 12V/20KKrFwu988HIv3ud59UXKuf8BwYhTsvp4hiV5pRJ1k4GXdovxIW5pMEzMi0clL0 tbPZaePMMwKbh+UvOYzKstktUrvz/4wtD2xbwJucPegVXu4fr6uoReq9l+6wjasWQ2CF 4Gfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YpTfEjmT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oi23si7341124ejb.676.2020.11.09.09.11.37; Mon, 09 Nov 2020 09:12:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YpTfEjmT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731079AbgKIRJd (ORCPT + 99 others); Mon, 9 Nov 2020 12:09:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731042AbgKIRJa (ORCPT ); Mon, 9 Nov 2020 12:09:30 -0500 Received: from mail-vs1-xe43.google.com (mail-vs1-xe43.google.com [IPv6:2607:f8b0:4864:20::e43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62F60C0613D3 for ; Mon, 9 Nov 2020 09:09:29 -0800 (PST) Received: by mail-vs1-xe43.google.com with SMTP id y73so5359367vsc.5 for ; Mon, 09 Nov 2020 09:09:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QvIn+60yZ2g+goNrF89dTWG7tHbqd9bjnmQMUGC2tLU=; b=YpTfEjmTXWyjdnCRbF1zQbmyqT2hKUct9afPYfFH5oW3/DcnggcPMyCpWRmENya1pD V+cg6e1urqOJej0La9XFWK3KU2ek+mAJ36QHPnKd9i8AZ8Ks9N4EULj9y1UYAUX9aYOf 69cdOZ363g1IY+CmsIDnSLDj8ABv7dj4/YIDS6yW9/sLf+Nf8JNtAihUqQvr/U4F9mCf wwicQBoAqPEb52v4qcInalAXBo8tluBhXKOpEe6dLp5X3tKyYU1fw+a5TvRqmXkwDzsE jpJ13f6KwWq5agsBctGj3oGnzqrWqJh8M5y8zFlb/8vmPFE5trlE8RLDCinZ7V9yrfmZ 6PPw== 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; bh=QvIn+60yZ2g+goNrF89dTWG7tHbqd9bjnmQMUGC2tLU=; b=icGXdAKw/beJi5257JhIoK8TLaBnsm3nQD5D6NWG22CeFY4QvXPsYfN2PNfSlZhPhv 2Ik4HvmDEp/iGf3A88Ju0TBaVEBiEfcAuT4+OzbbZHdKn2kEYLD9cVdYJ/leXRU4EsCg 0Gn9A/WMVzCimWOgaPC6fnBiM8/PFi/jKnm5iAK/uSRiHaFE6R3L+nehzYMcm87ZghF1 2mmRrLAsVN86XZ3db5JBEfFxw173KyeUpRF0XuXItnZABcXoFrnVEKWQ40HIewDeMoJW mcXWVIw2hyRPKP/BAf4fpQaHSvlwm/7ga/EF/2fW0Rs5UJi0Vaza5O/C4Xj164qOeyJ/ kE/A== X-Gm-Message-State: AOAM532BxA6fsTanm4SXGB9gL9G/bbm1ZQiFZIyULX75Co/+bt0zhphL G71WmvLWig6xPVoPQaVdgJ5rqfHwErI= X-Received: by 2002:a05:6102:22d0:: with SMTP id a16mr8708307vsh.23.1604941768169; Mon, 09 Nov 2020 09:09:28 -0800 (PST) Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com. [209.85.222.43]) by smtp.gmail.com with ESMTPSA id m205sm1362768vkm.9.2020.11.09.09.09.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Nov 2020 09:09:26 -0800 (PST) Received: by mail-ua1-f43.google.com with SMTP id p12so3012085uam.1 for ; Mon, 09 Nov 2020 09:09:26 -0800 (PST) X-Received: by 2002:a9f:28a7:: with SMTP id d36mr7956189uad.37.1604941766063; Mon, 09 Nov 2020 09:09:26 -0800 (PST) MIME-Version: 1.0 References: <0eaG8xtbtKY1dEKCTKUBubGiC9QawGgB3tVZtNqVdY@cp4-web-030.plabs.ch> In-Reply-To: <0eaG8xtbtKY1dEKCTKUBubGiC9QawGgB3tVZtNqVdY@cp4-web-030.plabs.ch> From: Willem de Bruijn Date: Mon, 9 Nov 2020 12:08:49 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 net] net: udp: fix Fast/frag0 UDP GRO To: Alexander Lobakin Cc: "David S. Miller" , Jakub Kicinski , Alexey Kuznetsov , Hideaki YOSHIFUJI , Paolo Abeni , Network Development , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 9, 2020 at 11:57 AM Alexander Lobakin wrote: > > While testing UDP GSO fraglists forwarding through driver that uses > Fast GRO (via napi_gro_frags()), I was observing lots of out-of-order > iperf packets: > > [ ID] Interval Transfer Bitrate Jitter > [SUM] 0.0-40.0 sec 12106 datagrams received out-of-order > > Simple switch to napi_gro_receive() any other method without frag0 > shortcut completely resolved them. > > I've found that UDP GRO uses udp_hdr(skb) in its .gro_receive() > callback. While it's probably OK for non-frag0 paths (when all > headers or even the entire frame are already in skb->data), this > inline points to junk when using Fast GRO (napi_gro_frags() or > napi_gro_receive() with only Ethernet header in skb->data and all > the rest in shinfo->frags) and breaks GRO packet compilation and > the packet flow itself. > To support both modes, skb_gro_header_fast() + skb_gro_header_slow() > are typically used. UDP even has an inline helper that makes use of > them, udp_gro_udphdr(). Use that instead of troublemaking udp_hdr() > to get rid of the out-of-order delivers. > > Present since the introduction of plain UDP GRO in 5.0-rc1. > > Since v1 [1]: > - added a NULL pointer check for "uh" as suggested by Willem. > > [1] https://lore.kernel.org/netdev/YazU6GEzBdpyZMDMwJirxDX7B4sualpDG68ADZYvJI@cp4-web-034.plabs.ch > > Fixes: e20cf8d3f1f7 ("udp: implement GRO for plain UDP sockets.") > Signed-off-by: Alexander Lobakin Acked-by: Willem de Bruijn Thanks