Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4011966pxj; Tue, 11 May 2021 17:47:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3zhUJdMQQ+TQvOZgZCkkTrtbNc8bBnyuYLbn3nzxCzhR+r74/lQ4jLpWsORulAljQOqjO X-Received: by 2002:a92:bf09:: with SMTP id z9mr29349504ilh.32.1620780421927; Tue, 11 May 2021 17:47:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620780421; cv=none; d=google.com; s=arc-20160816; b=v9MEIew/Gga5kbMEoHCtRC5Gq1YOVWIstlNUNuLS/YBnPRlfJGZEujIZl/gosNn+82 +GQu1Jcb1g0RpHFxk6y0IEub2lSGWuEr4u5A8ueI5wJwdKQMxEbR371VN5+hgIycfpMf lwLQLuJMqcXvV/D4BgG4L0O5oqkFIL4/u/ZPZD+TAkEWem/tArcu2ohRZLEMqWIsTRe+ 0ibYRkh0+c0DTy1ixAK0k1TF5a+Y2iDEZ9FES66biRzeA5WfcC+6YiYpcSLwrG0Mttws WEJxcSGRYXYfFW7H0mv1tDuDcOS6uKOebnv124nyQaKvN4pQ43SqMxJNYpd6fZLvmwjx ndoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:content-language :thread-index:content-transfer-encoding:mime-version:message-id:date :subject:in-reply-to:cc:to:from:dkim-signature:dkim-filter; bh=dfggp+4g/zAr9O+AzcgFCwUClokaZu0+FQs1KqAJUDg=; b=h+UKSg/AStwkrbqaXXHJZ+WbPoQ0YrIDuuilO7lk3f3RH40NGw8+kyR2pA2S4Pnqi2 C0FsOhxOJ4hCNlG0AYfvWkV3p+RtunkMHnXt0xZvGCx+PjBDd4wUD9mVBIVsJr26GYUB kZrGevd+o3Pk/hn+ZdecA22xEIERdhE+Ui54MqtsS+hQT7g29n6ReffILYbULlajuQTC mnqtHznMyJhYVyw0NQxLtEH/Du6Vw/CrIjrEHdNHQMXRzRvDLzaeSCal1B2FWg0w4kOx UvCQxHHGRak0aXmYu+RgUPyb/UAsbEeb0HDc6GrHTmr0KVkm6BjWAjCRqsUqAhJS1poW a8EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=XA9RW9j3; 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=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u15si26137697iot.55.2021.05.11.17.46.49; Tue, 11 May 2021 17:47:01 -0700 (PDT) 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=@samsung.com header.s=mail20170921 header.b=XA9RW9j3; 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=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229945AbhELAqR (ORCPT + 99 others); Tue, 11 May 2021 20:46:17 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:60470 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbhELAqQ (ORCPT ); Tue, 11 May 2021 20:46:16 -0400 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20210512004507epoutp01f49c6c415dc951eaec0458d7890fec55~_KxpPaPLP1156911569epoutp01H for ; Wed, 12 May 2021 00:45:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20210512004507epoutp01f49c6c415dc951eaec0458d7890fec55~_KxpPaPLP1156911569epoutp01H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1620780307; bh=dfggp+4g/zAr9O+AzcgFCwUClokaZu0+FQs1KqAJUDg=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=XA9RW9j343EQGsDvb6I7Pk2hS9Qmu1HOB3WvJHzaFcSlz+fsSm425BMgXqzaJQnb2 f9n34GdW7IjPPaCLNROsKWB7kLOclO12Ae3r61zGUds5ponfBplwUZDEg3z4K6BaDp koUf7dc0ZJMeXgmVx0CUysUhca+xjYwkwDkasOWs= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20210512004507epcas2p268219b25083295c943dd87ba0e8fdf02~_KxoumdM70700007000epcas2p2c; Wed, 12 May 2021 00:45:07 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.40.184]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4Ffx0167Gfz4x9Q2; Wed, 12 May 2021 00:45:05 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 30.68.09433.0152B906; Wed, 12 May 2021 09:45:04 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20210512004504epcas2p3e3dc9b5dc5df6ea16fb887e0fb23718c~_Kxl9Kbhf1310913109epcas2p3Z; Wed, 12 May 2021 00:45:04 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20210512004504epsmtrp2c27fee30e1107570bdf11cc1e6972289~_Kxl8Bl4H0559905599epsmtrp2E; Wed, 12 May 2021 00:45:04 +0000 (GMT) X-AuditID: b6c32a47-f61ff700000024d9-1e-609b2510bf9e Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 1C.05.08637.0152B906; Wed, 12 May 2021 09:45:04 +0900 (KST) Received: from KORDO035731 (unknown [12.36.185.47]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20210512004504epsmtip15aec5dec4cde3de0795bff4ac6ee4d6f~_KxloXrmK0154401544epsmtip1Y; Wed, 12 May 2021 00:45:04 +0000 (GMT) From: "Dongseok Yi" To: "'Willem de Bruijn'" Cc: "'Yunsheng Lin'" , "'Daniel Borkmann'" , "'bpf'" , "'Alexei Starovoitov'" , "'Andrii Nakryiko'" , "'Martin KaFai Lau'" , "'Song Liu'" , "'Yonghong Song'" , "'John Fastabend'" , "'KP Singh'" , "'David S. Miller'" , "'Jakub Kicinski'" , "'Network Development'" , "'linux-kernel'" In-Reply-To: Subject: RE: [PATCH bpf] bpf: check for data_len before upgrading mss when 6 to 4 Date: Wed, 12 May 2021 09:45:03 +0900 Message-ID: <01b701d746c8$0c15ae70$24410b50$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQKypHYW3xad5/j2XvChPebQmKG2owG+YoocAqFpyMsBZavlXQIxNaIYAiru3ucBq8RF2QKY6vTDAm6kVlUBadK04AMaqQ3GARiLayQDE+caWwJJGwtFAeZKb9QDLW923AHUONYWAfw9g6SoAqstYA== Content-Language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKJsWRmVeSWpSXmKPExsWy7bCmma6A6uwEg43TzSy+/57NbPHl5212 i89HjrNZLF74jdlizvkWFoumHSuYLF58eMJo8XxfL5PFhW19rBaXd81hs2h4y2VxbIGYxc/D Z5gtFv/cAFS1ZAajA7/HlpU3mTwmNr9j99g56y67R8uRt6weXTcuMXtsWtXJ5vF5k1wAe1SO TUZqYkpqkUJqXnJ+SmZeuq2Sd3C8c7ypmYGhrqGlhbmSQl5ibqqtkotPgK5bZg7Q2UoKZYk5 pUChgMTiYiV9O5ui/NKSVIWM/O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16fb887e0fb23718c X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210429102143epcas2p4c8747c09a9de28f003c20389c050394a References: <1619690903-1138-1-git-send-email-dseok.yi@samsung.com> <8c2ea41a-3fc5-d560-16e5-bf706949d857@iogearbox.net> <02bf01d74211$0ff4aed0$2fde0c70$@samsung.com> <02c801d7421f$65287a90$2f796fb0$@samsung.com> <001801d742db$68ab8060$3a028120$@samsung.com> <436dbc62-451b-9b29-178d-9da28f47ef24@huawei.com> <007001d7431a$96281960$c2784c20$@samsung.com> <00c901d74543$57fa3620$07eea260$@samsung.com> <015101d74602$86442210$92cc6630$ @samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 11, 2021 at 01:38:41PM -0400, Willem de Bruijn wrote: > On Mon, May 10, 2021 at 9:11 PM Dongseok Yi wrote: > > > > On Mon, May 10, 2021 at 09:46:25AM -0400, Willem de Bruijn wrote: > > > On Mon, May 10, 2021 at 9:19 AM Willem de Bruijn > > > wrote: > > > > > > > > > > That generates TCP packets with different MSS within the same stream. > > > > > > > > > > > > My suggestion remains to just not change MSS at all. But this has to > > > > > > be a new flag to avoid changing established behavior. > > > > > > > > > > I don't understand why the mss size should be kept in GSO step. Will > > > > > there be any issue with different mss? > > > > > > > > This issue has come up before and that has been the feedback from > > > > TCP experts at one point. > > > > > > > > > In general, upgrading mss make sense when 6 to 4. The new flag would be > > > > > set by user to not change mss. What happened if user does not set the > > > > > flag? I still think we should fix the issue with a general approach. Or > > > > > can we remove the skb_increase_gso_size line? > > > > > > > > Admins that insert such BPF packets should be aware of these issues. > > > > And likely be using clamping. This is a known issue. > > > > > > > > We arrived that the flag approach in bpf_skb_net_shrink. Extending > > > > that to bpf_skb_change_proto would be consistent. > > > > > > As for more generic approach: does downgrading to non-TSO by clearing > > > gso_size work for this edge case? > > > > It can hit __skb_linearize in validate_xmit_skb and frags will be > > copied to a linear part. The linear part size can exceed the MTU of > > skb->dev unexpectedly. > > When does skb_needs_linearize return true here (besides lack of > scatter-gather support, which would also preclude TSO)? As I know not every netdev support NETIF_F_SG. TSO requires SG. /* TSO requires that SG is present as well. */ if ((features & NETIF_F_ALL_TSO) && !(features & NETIF_F_SG)) { netdev_dbg(dev, "Dropping TSO features since no SG feature.\n"); features &= ~NETIF_F_ALL_TSO; } > > > I will make another patch with the flag approach. > >