Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp737642lqo; Fri, 10 May 2024 13:20:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWOBdtN9OgyBoXJT8d4hNGbwIn1PjxzNTXzkN07d+BOssrZFKU8NsFW/zrb5cYq36KFE/GKrW86r2yL+G1ZRAf3u2Q7YSbbzcqr0jvOjg== X-Google-Smtp-Source: AGHT+IEST/8RhdvmMfzdWrr1wK2sNOG1oaUTFa//M43hmYdlnLF6JB18jGJ57iyKmVhIPYauZ9g2 X-Received: by 2002:a17:906:b7c4:b0:a59:bb24:a61 with SMTP id a640c23a62f3a-a5a2d292a23mr311365666b.30.1715372439214; Fri, 10 May 2024 13:20:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715372439; cv=pass; d=google.com; s=arc-20160816; b=CriZsMG/ZOOwKRVtgM1Px6I48a/0k1bv4BWRbrlOHr6py5Hx9r7qU9SAkRFrPLynJ4 BppFy/UGeVDvuHWymlrov9q+hc6RZpgPIWSkKp2yPJ18jkn1y9DQ+p6bPwIeSASU+oJ1 YjZ/39J0vGmLykVWUDwvGJGICcLxBfg0Ae5LJQB2R9GUusyyYl+JogzzMb21xHHs6GmN SzJpl2MuHg0k/z9y2OsmQQKXLrvFpcm46TbvehwGf1x7dVsdWf3tIzYSem/DIYnz+ajM GHfwkoo/grCgtqSt9G5x3BuYEJRtQVL0bASuwVOtiJeOnqBSGO8ACgKXRGL+pdwcUOjy GIxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :date:message-id:dkim-signature; bh=iyletMkDgqWyPnxZ333kKZUZ/DMhM/dfy7JO2wgf3Ss=; fh=NO57z5DYufGDSzj539fG0TzBHzTJAGZqcw67mynjmFg=; b=Y77S50n4h3aGOp+HxvuaELow7uVXpwiYmuvYPnYVqJbcXV7TVQ/m+JyXlE4OYOp/W/ Eh/XMVSxtS+PmTZVmwXw0vXO29S2vrAqPSUVDppSLLpoj2XbXutRoDW+3PuQQ6UbdgMO nfXIRfFAFUPNWJKP7tX5t9+x91g0uYXrHrPlm+KU1JPRnK/J5YjM6eHV9hcTeJy7sYlZ pXKGsVhKHtUfz1Ymjr6eQoAhX1Xw7iMJAXlEySWrsazabM2WObirCX6zMjTqSR/aPgtA k43235W1L/gi8QbkrZ+HOEkGtodQ7V0VwWhO/eaJzIeNCrh6iFxHeZTGr0SvQzey0bdE ALTw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=g59Lspif; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-176168-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176168-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17c2c846si237334766b.990.2024.05.10.13.20.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 13:20:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176168-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=g59Lspif; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-176168-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176168-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CE7AD1F22A94 for ; Fri, 10 May 2024 20:20:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 541DC502A0; Fri, 10 May 2024 20:20:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g59Lspif" Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF9554D595; Fri, 10 May 2024 20:20:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715372420; cv=none; b=rZu8XrH1KFngBQVMTuq+3hB0odpRLyI3odxk9+zsrZRbs+omjHEzQyu9BEdCmCAdZextSSKdIZDQLVmXG4a+LtJhUVjE2c97FGbv437yXtN3cZepVv+jQKa2zBdVREGu2rFcj7AHBUKjkyR3sI9x6jejY4ibSTrZDrIZwp7T3a0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715372420; c=relaxed/simple; bh=TCXUmEuv+iM2nkO3iZsdvA9IrZmd3DCpNc0fVLD83qs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Z+Rz9eOKecWAeq79TcnLrq58/jQfeImmKBET38HTNGP8GserltWaFhhMKUR72FDyemkfrCda1PdV8o2LO24xOsa8EUk014ZU+L2kOoRw3rKpjxZtwgLyhLN+JpDvlVvziPDlC9dgqY1zUGfb8GXJxKo+6YR+v7Xs8u+OuCG0qPw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=g59Lspif; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-41fc2f7fbb5so12911505e9.1; Fri, 10 May 2024 13:20:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715372417; x=1715977217; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=iyletMkDgqWyPnxZ333kKZUZ/DMhM/dfy7JO2wgf3Ss=; b=g59Lspifh12xwhk1uv3ZRwrWxFDyCygDQdF39EANP4LSQBMhSNPbDV1ABBAjR2C4ZJ 845THMMb6T8hWTiTsFG4LzSC5xs0xKASpiGc825ckjCkMUE4TsyQxr0X1prx/Fvh2xGp CizJrK4f0L+KO953J4Oou1YaKaI/cme3sJF7Trak4fQcDdd7P5GS0qZL6H8e8SOdtiFJ 7L88vCoip4n0NcpPpFmPMc+aO0+WdFF2bROFXoJMR2N5HnJOcO/U2mE7OMXOMFGywVc0 4rme36Joqar3Vt3l3z7nJMimSxPoAz7xpizhbY48NokcWjTbepKQ2uT3oWpMhifgaRw8 c36Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715372417; x=1715977217; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=iyletMkDgqWyPnxZ333kKZUZ/DMhM/dfy7JO2wgf3Ss=; b=vtyXkxF1ix2ONZbeRQjb1ePiZGm8+sI66lWaeTBCPA5PkvLoWrp1QfUknPeFM+zIYk AhHBN+QEwJSbCMtkB8WY2caPU3R0tIYXpxU1RdBOfSYHFaI/W4rOlHfW5iBw8M72TzK5 NlHj4g5ukxKPNzpKotDNpH2vRMuGZyQtjmtl2sBU+fvbEV4hGsdLXHoj3poeKadQOy7b 75FROAYOlz6GkcG6zN6Rpt8FJKV0nTyaIow3GDDXH4ujgkAnCoonLgB4VnWgkoZyJ5+8 6ss+8Teba+pTd0k/5Vb9lekn84i2EBDY8zLveRBgRXuzohLPjh0BcL7vCDyHCVMtf4Sm Oe9Q== X-Forwarded-Encrypted: i=1; AJvYcCWVkqGmv082ATlGV1bv6SmRUzUeaKwF9u+2sUTh/SfqAhVyiZf1+QjckLBzfJn6Q2c23wNpP94vCzdGyZ+KADw+3/zZswMCvtvs9qrDLTrG8HUYZrEmlRUnuMbhs92/17KPVS6PYoFW44CLNDqzQRnIkJy7N9K4ZJr4SXD1wBzTQJoltVVt X-Gm-Message-State: AOJu0Yy/+VwVokhcYn+awSWUzaplGIN+5NIDx798zf23No23YcKYeHF0 gxVFJDmoLBr9CvTY59G9BcWZ3IfMXeRfoAxYfSLvBYWKR0jUWsaX X-Received: by 2002:a05:600c:511f:b0:418:5ef3:4a04 with SMTP id 5b1f17b1804b1-41fead59f07mr33462855e9.18.1715372416890; Fri, 10 May 2024 13:20:16 -0700 (PDT) Received: from debian ([146.70.204.204]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccce25d5sm75046735e9.14.2024.05.10.13.20.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 May 2024 13:20:16 -0700 (PDT) Message-ID: <98b7998a-3111-4892-ba1e-d0a026b64b0b@gmail.com> Date: Fri, 10 May 2024 22:20:03 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH net-next v9 2/3] net: gro: move L3 flush checks to tcp_gro_receive and udp_gro_receive_segment To: Eric Dumazet Cc: alexander.duyck@gmail.com, davem@davemloft.net, dsahern@kernel.org, kuba@kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, shuah@kernel.org, willemdebruijn.kernel@gmail.com References: <20240507162349.130277-1-richardbgobert@gmail.com> <20240507163021.130466-1-richardbgobert@gmail.com> <82f6854c-5d69-4675-8233-052a7b085cd4@gmail.com> From: Richard Gobert In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eric Dumazet wrote: > On Thu, May 9, 2024 at 8:58 PM Richard Gobert wrote: >> > >> >> Interesting, I think that is indeed a bug, that exists also in the current >> implementation. >> NAPI_GRO_CB(p)->ip_fixedid (is_atomic before we renamed it in this commit) >> is cleared as being part of NAPI_GRO_CB(skb)->zeroed in dev_gro_receive. > > And the code there seems wrong. > > A compiler can absolutely reorder things, I have seen this many times. > > I would play safe here, to make sure NAPI_GRO_CB(skb)->is_atomic = 1; > can not be lost. > > diff --git a/net/core/gro.c b/net/core/gro.c > index c7901253a1a8fc1e9425add77014e15b363a1623..6e4203ea4d54b8955a504e42633f7667740b796e > 100644 > --- a/net/core/gro.c > +++ b/net/core/gro.c > @@ -470,6 +470,7 @@ static enum gro_result dev_gro_receive(struct > napi_struct *napi, struct sk_buff > BUILD_BUG_ON(!IS_ALIGNED(offsetof(struct napi_gro_cb, zeroed), > sizeof(u32))); /* Avoid slow > unaligned acc */ > *(u32 *)&NAPI_GRO_CB(skb)->zeroed = 0; > + barrier(); > NAPI_GRO_CB(skb)->flush = skb_has_frag_list(skb); > NAPI_GRO_CB(skb)->is_atomic = 1; > NAPI_GRO_CB(skb)->count = 1; I removed NAPI_GRO_CB(skb)->is_atomic = 1 from dev_gro_receive in this series since it is not needed anymore, so going forward this issue is fixed. I understand your concern about previous versions, I could send a patch to net to settle this issue. WDYT?