From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F3CF1FF5F7 for ; Fri, 17 Jan 2025 12:43:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737117827; cv=none; b=a1WIry+dReLzuTdyzPytuex0Ka5CLYLnhpUoDefQpiFML27IhmKE6VNYLamwPl6hbDHB3QWWulEID9NZGzb1WqZLNYktlmCG79ptFD5Wbp65kOYtazUVSeIxrRVcKh/3ud/aow5RHyJUKrPRpA3BUfmmC1QekBay7iD9t9GqIKI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737117827; c=relaxed/simple; bh=cd54XL3aliFy0NpAyf3XBTHTvds4Rpx46S1hRQhFiU8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=DmunuiUTYbJMfu5obln4aJoQ3tflwtKUxNOoYvHTfmK4hXgy5nh2Lq8QMjajDolIi+MZDsH83zSUKT3sj49cF52rMctGwqW4LRHdi481vNYj99c2jRSwpLpMyyy7BMHAe3WxS/Mfiubgh9QXJJQ3fQJ7I+Gtyv+w+DjnPlKDGIc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=K2Ju7Ocj; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="K2Ju7Ocj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737117824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cob0lF5N6/+utp7g7nFV/A1Rwu4ms+yA3+XLT1WVBjE=; b=K2Ju7OcjxLyvTshoSUn51wiXQibfiTc2QiRzlwZVfmSFydOMQHcfTyg2WSloVlzm8Vl4qn ZySt4AmwOKXtxeskF2BvJFv8KcJPUXe0l4e+dpV2Yzed6jk+k9ROQPw/0AQg55LfN9n045 XTx3qUwDUCzlCbMOhtKpcrCJ+r3RYMY= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-267-JMm9kE24OSuLm0j5U-SdJw-1; Fri, 17 Jan 2025 07:43:40 -0500 X-MC-Unique: JMm9kE24OSuLm0j5U-SdJw-1 X-Mimecast-MFC-AGG-ID: JMm9kE24OSuLm0j5U-SdJw Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-aa67f03ca86so194064166b.2 for ; Fri, 17 Jan 2025 04:43:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737117819; x=1737722619; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Cob0lF5N6/+utp7g7nFV/A1Rwu4ms+yA3+XLT1WVBjE=; b=oOBUhp/4OcFMsomfY1OJBJJVr5GyGBP7BvW+OROl2sSaZnkSZUJ/FtSu61oFX8PjBY j8jE/DSNHin69RSn8jThEJJmPqlyE/YFojRaIucsLqZy2MhcVaGwOC5KD9IG/hxMLMKD 6Sg7GfD/pZn5TXzzND2f/sbYVzikiGtJknKrTNrkt033aYyu/qTWTyZ5NiUwBQzySFK3 BVd5j0QDxi54+SnIr5wBm1IUfqND87fYfRO8a4klBQlCmutrzd4Lvo16ub5KTyCRLW5K AsViLCebgPbrGbiID6GGR8d/pEofQHsTyCTg/4UODXDvP3nbGzGyF0jfo+JMYkvbdrtf z0yg== X-Forwarded-Encrypted: i=1; AJvYcCUseqKU1ImDGKehznrXSHAlpcdnNYaTP5Yje5g/Pf437pfMjzdZR4XlfeQlxjwyBmliWi2Ql6tXoI/9SZI=@vger.kernel.org X-Gm-Message-State: AOJu0Yzz3470LQbgWSfgriwodFPI5A9mXiNKRbVcA4uLMBBe3EcpYll+ yZIU6P1lAWsx3ZEynum9dIwz8S07ZIDk1jL8nUIbYer2IVKC6RNrnfneirXIWgMnYLr3MBIOOnQ jglcoNdJojpmpypx1XrsyshNxi1OghdWR5lkxcLNqIxuIBt3ezwjZIZYrG0XLtA== X-Gm-Gg: ASbGncv3FRgfPPAos7HTBZ2k88oK3hhVmCyAr0RGI4pVOappbkeMcHCQ/ytDd5ihD5G gI5iWTXXfIO+62sxHzi/12kWIFme3e4SxjwMJT4X1biyOvM9Acm4qTVfZVd+yTbfNPEeYlEuFvR 4Z3G/sxsw0oiJo8P17Y/xx9wFcp0xuPxOJz1FDaEQTXLQ2PP3aEBrA5XbVf6mze3JTNqsFt1h/c JEbk1DOtXKhzQ2xSrLe4YNPI0Y6MvULxqRaha2DmPgOXVlcVGGp/qiYCOpgf2qsAi7PPqSwXlGQ YF7J4A== X-Received: by 2002:a05:6402:2706:b0:5d4:2ef7:1c with SMTP id 4fb4d7f45d1cf-5db7db078c2mr5461825a12.24.1737117819440; Fri, 17 Jan 2025 04:43:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IExD7igQimPr+aQ0ED+vHaFPU0l3YZshIqVzmzRJdN8CGUD9UBkdkZfSFMOOMOsnPZQQHv4Sw== X-Received: by 2002:a05:6402:2706:b0:5d4:2ef7:1c with SMTP id 4fb4d7f45d1cf-5db7db078c2mr5461773a12.24.1737117818999; Fri, 17 Jan 2025 04:43:38 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5db73edc8b7sm1400986a12.76.2025.01.17.04.43.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 04:43:37 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id BFCCD17E7866; Fri, 17 Jan 2025 13:43:36 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Alexander Lobakin , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Alexander Lobakin , Lorenzo Bianconi , Daniel Xu , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , John Fastabend , Jesper Dangaard Brouer , Martin KaFai Lau , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v3 1/8] net: gro: decouple GRO from the NAPI layer In-Reply-To: <20250115151901.2063909-2-aleksander.lobakin@intel.com> References: <20250115151901.2063909-1-aleksander.lobakin@intel.com> <20250115151901.2063909-2-aleksander.lobakin@intel.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Fri, 17 Jan 2025 13:43:36 +0100 Message-ID: <87ikqdobk7.fsf@toke.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Alexander Lobakin writes: > In fact, these two are not tied closely to each other. The only > requirements to GRO are to use it in the BH context and have some > sane limits on the packet batches, e.g. NAPI has a limit of its > budget (64/8/etc.). > Move purely GRO fields into a new tagged group, &gro_node. Embed it > into &napi_struct and adjust all the references. napi_id doesn't > really belong to GRO, but: > > 1. struct gro_node has a 4-byte padding at the end anyway. If you > leave napi_id outside, struct napi_struct takes additional 8 bytes > (u32 napi_id + another 4-byte padding). > 2. gro_receive_skb() uses it to mark skbs. We don't want to split it > into two functions or add an `if`, as this would be less efficient, > but we need it to be NAPI-independent. The current approach doesn't > change anything for NAPI-backed GROs; for standalone ones (which > are less important currently), the embedded napi_id will be just > zero =3D> no-op. > > Three Ethernet drivers use napi_gro_flush() not really meant to be > exported, so move it to and add that include there. > napi_gro_receive() is used in more than 100 drivers, keep it > in . > This does not make GRO ready to use outside of the NAPI context > yet. > > Signed-off-by: Alexander Lobakin > Tested-by: Daniel Xu Reviewed-by: Toke H=C3=B8iland-J=C3=B8rgensen