Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp306397pxb; Fri, 8 Jan 2021 05:40:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzI4UfuvPcTwIS3IWI9HJ+wy7hAyynsOOMbKqVHKzm7sdDwBLwOBFPCV/pkZ7kr8XuPT3F6 X-Received: by 2002:a17:906:eca9:: with SMTP id qh9mr2795401ejb.188.1610113224370; Fri, 08 Jan 2021 05:40:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610113224; cv=none; d=google.com; s=arc-20160816; b=UMiFv5Z03PrSgsYCNro4+8kMYLaNt8tqwQtqIwnl3V4VLV9siF8Yvp14wR/VQZDINL j+yAxGrxJxiKk3YJYWG9QmgvvQDi8qX2wOEbnM8JwRCc0eM57ZWu0nCouvW5iL9dljc/ D2cDQp31driND8vkGu1+dZsKGfBtkDgjygtxtaq30iJv3o0+6KPYoK5XacW59chYL8wx Olx6IrfTUqGYaX1C4X1T5kDRNkDrsjmc3N3Xd2ySazMXv5CVy5PoqZaJdd6Rf7z914+0 LAJHZL/8NhIlS1BxjljwdxZMa8XVQp+aTJqSCQ95GjFPPDyDS/O1SXuUlL0MWj24LS1h EmWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=cFQz8PsAJdaWvYYbpH1pjuuafvzgWcJ0Y6957DfqzJc=; b=eplaBsLuYC0d56U96sSTbcNDeFaMzm/cDeA8oeLHrIlzDpWFgm34d0XMzBYQyAhdut 5v1RANGLtfaZUtEm6YVJ4wQmTCc9jH2rL09HiyeHhnDA8h9BSFSWOd5iEG4b513YpGXW ZOIINmshvM4dcxSthBKdiV+PbVa8uN0kDOj+J8lhIqR5721L+7XmLfgHg1GDbXHLAIJj WmGlz/lHYNiJh3z0sQmLU7dG2QrlzgGUwj+NdLnaqBqoGKZRb0c3hjKGBh1Cran4vUPF 5x6oxXCAX/bM3VQzS+Ly30Wou8Vwe2/kZr8e5j49S2Qg2uhtXC1hw+yAwbDlxfbdoe1/ IGvg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f19si2812815ejf.221.2021.01.08.05.40.00; Fri, 08 Jan 2021 05:40:24 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727706AbhAHNiB (ORCPT + 99 others); Fri, 8 Jan 2021 08:38:01 -0500 Received: from a.mx.secunet.com ([62.96.220.36]:50492 "EHLO a.mx.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726059AbhAHNiA (ORCPT ); Fri, 8 Jan 2021 08:38:00 -0500 Received: from localhost (localhost [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id 741AC2057B; Fri, 8 Jan 2021 14:36:50 +0100 (CET) X-Virus-Scanned: by secunet Received: from a.mx.secunet.com ([127.0.0.1]) by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ixpUgj6Iguuf; Fri, 8 Jan 2021 14:36:45 +0100 (CET) Received: from cas-essen-02.secunet.de (unknown [10.53.40.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by a.mx.secunet.com (Postfix) with ESMTPS id 995482049B; Fri, 8 Jan 2021 14:35:04 +0100 (CET) Received: from mbx-dresden-01.secunet.de (10.53.40.199) by cas-essen-02.secunet.de (10.53.40.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 8 Jan 2021 14:35:04 +0100 Received: from gauss2.secunet.de (10.182.7.193) by mbx-dresden-01.secunet.de (10.53.40.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Fri, 8 Jan 2021 14:35:03 +0100 Received: by gauss2.secunet.de (Postfix, from userid 1000) id F3D0C3182BA9; Fri, 8 Jan 2021 14:35:02 +0100 (CET) Date: Fri, 8 Jan 2021 14:35:02 +0100 From: Steffen Klassert To: Dongseok Yi CC: "David S. Miller" , , Alexey Kuznetsov , Hideaki YOSHIFUJI , Jakub Kicinski , Willem de Bruijn , , Subject: Re: [RFC PATCH net] udp: check sk for UDP GRO fraglist Message-ID: <20210108133502.GZ3576117@gauss3.secunet.de> References: <1610110348-119768-1-git-send-email-dseok.yi@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1610110348-119768-1-git-send-email-dseok.yi@samsung.com> X-ClientProxiedBy: cas-essen-02.secunet.de (10.53.40.202) To mbx-dresden-01.secunet.de (10.53.40.199) X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 08, 2021 at 09:52:28PM +0900, Dongseok Yi wrote: > It is a workaround patch. > > UDP/IP header of UDP GROed frag_skbs are not updated even after NAT > forwarding. Only the header of head_skb from ip_finish_output_gso -> > skb_gso_segment is updated but following frag_skbs are not updated. > > A call path skb_mac_gso_segment -> inet_gso_segment -> > udp4_ufo_fragment -> __udp_gso_segment -> __udp_gso_segment_list > does not try to update any UDP/IP header of the segment list. > > It might make sense because each skb of frag_skbs is converted to a > list of regular packets. Header update with checksum calculation may > be not needed for UDP GROed frag_skbs. > > But UDP GRO frag_list is started from udp_gro_receive, we don't know > whether the skb will be NAT forwarded at that time. For workaround, > try to get sock always when call udp4_gro_receive -> udp_gro_receive > to check if the skb is for local. > > I'm still not sure if UDP GRO frag_list is really designed for local > session only. Can kernel support NAT forward for UDP GRO frag_list? > What am I missing? The initial idea when I implemented this was to have a fast forwarding path for UDP. So forwarding is a usecase, but NAT is a problem, indeed. A quick fix could be to segment the skb before it gets NAT forwarded. Alternatively we could check for a header change in __udp_gso_segment_list and update the header of the frag_skbs accordingly in that case.