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 5651F1FF1AD for ; Fri, 17 Jan 2025 12:53:10 +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=1737118391; cv=none; b=oRzakW87cg1I3yPyQFy0yg+yQMIOeCP8mbfuJPzahTjtAgnUnItj6W8UdlYgL+epbbH9gGkBFqzNSrKV/1zgE4oOR1N9NYZUqI4xxguJr5km0naLYk/CmL71CR8FAsE1IArX1owHRRNu36W86MYikrtHoRUldini+nJp2mX7aSo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737118391; c=relaxed/simple; bh=qN6oQdM0gmq9bZuCu0hFeMmKij2Q4XKghqJIhff84jU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=jExgfcaZStBVRuZ+zNAabfKN3lbW6hXuMNRMeiuIobTOG1vkfy5YKXeWAuIQk8uISHSTAXFzxw7UOEC0W+y0FgfaK8anDUSKb9cZd9Ie3aDDaaX32txoFJxwLMFs+hjY3Fw+bFPaYwzwE/+6cVxZ+GKcXfGRPPy3uSr3Wiep6T0= 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=ha5NbZqe; 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="ha5NbZqe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737118389; 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=qN6oQdM0gmq9bZuCu0hFeMmKij2Q4XKghqJIhff84jU=; b=ha5NbZqew3uQiZEZxdH8RVv3UvCPISebjifymLdq9HFTssCPfvUvK7eWoHfIKwow23Wpl9 lv7t2cIeaojKVyefYjuxN2yF95UBNpcj8LKazugQuVFafuM+KeiZXt/XqdKPkd00ZOYOrT jxWkkKZb0bH4Nsx59819tUQKZTFCszI= 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-225-38LkjTR8M3uAuTKtQbnx7w-1; Fri, 17 Jan 2025 07:53:05 -0500 X-MC-Unique: 38LkjTR8M3uAuTKtQbnx7w-1 X-Mimecast-MFC-AGG-ID: 38LkjTR8M3uAuTKtQbnx7w Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-aa66bc3b46dso173810166b.3 for ; Fri, 17 Jan 2025 04:53:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737118385; x=1737723185; 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=qN6oQdM0gmq9bZuCu0hFeMmKij2Q4XKghqJIhff84jU=; b=Nj+JaN9+bDf2+mr1Ea9pbOFNGb1EMhvQ7UUJCUM4HFCnfsbEDDP/jZddAftk+L9Bg8 DwBtk5C1UvzzIuvqufPVRGaZSfZ1FNKW4fNZsZC6j+K0lWn4tShA1nPz1IRlaMyn6Yja Aaisk/5+8uVYaRPY/Zp9I75XLEk7HMumG0w4PB7SwX1vJhDF3UDQvJIEEuu8bcf6MTtR pDR0gnl3Ha0aSs6+kxBzyCFGS48rFcPC+5h1VObMvIqlWFD3mK1a53dRQYCSbaXvved1 OrT0Olo0BfHjQVeWiUl0fOS8ADZq0w15mA8TaoRa9y5n9HvWZyV8NxW+BncRqCUMaoMm 7jew== X-Forwarded-Encrypted: i=1; AJvYcCVzhWWAylMUUM9Qd/sjbKUv4uxQGo/M/3plI0FVfoBw5P+3z9WqN/BRadG0pP6kI2GpttcHdCcEzZZW3H8=@vger.kernel.org X-Gm-Message-State: AOJu0YyEts82w8xZ4WXwkFTvle0kryWz+GqHEVwJzKboNsoo9wP1qPxA 9frUSQrOvIrktWN/MuzMjdAfYTCjoL5rYlS43Pxm6IwYXRJxRKgM3eQ0/lE7vuNllLqCLZMV/IH Lovrfi23boBJ39FSTSnXaCjDeUh4kV22uQXzDcQZ7EyWMRLm9+JxsqX/i0XUgfw== X-Gm-Gg: ASbGncthJBx891z8QRi/zBjj8vT+st1iPErBEaRHYwVrFdgvMaIhn5to/z4KZF2R87N 9NoN/tLiW+FEKqG4HcbT9dWi6jJ4HA+W9zX1cdQ3jFZZ5Mrse30Vx14AhLUO5BfmAU7T1usbyQq 4i9GRNRz3Q84nDtHZQP58jjBh+qw09JQwryIlJqz6jGp3lPWH2yNWNG98k9N5Vx192wH3pP1BiI 0U3XITcLGOm9fsKNkeJwHzgEGQoZTsikuAxj2SNUjTFzySe63sTnA== X-Received: by 2002:a05:6402:518d:b0:5d0:ed92:cdf6 with SMTP id 4fb4d7f45d1cf-5db7d30114amr5261861a12.19.1737118384721; Fri, 17 Jan 2025 04:53:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IECEDgqEa9N1u7Nf9uT2ewMSMFMEzvISL0C0K2RPIRXP5iZTwga5ZJuTpP90f83OYACuxDQZQ== X-Received: by 2002:a05:6402:518d:b0:5d0:ed92:cdf6 with SMTP id 4fb4d7f45d1cf-5db7d30114amr5261800a12.19.1737118384305; Fri, 17 Jan 2025 04:53:04 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([2a0c:4d80:42:443::2]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5db73670d52sm1471453a12.24.2025.01.17.04.53.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 04:53:03 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 4674017E786F; Fri, 17 Jan 2025 13:53:02 +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 4/8] bpf: cpumap: reuse skb array instead of a linked list to chain skbs In-Reply-To: <20250115151901.2063909-5-aleksander.lobakin@intel.com> References: <20250115151901.2063909-1-aleksander.lobakin@intel.com> <20250115151901.2063909-5-aleksander.lobakin@intel.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Fri, 17 Jan 2025 13:53:02 +0100 Message-ID: <87a5bpob4h.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: > cpumap still uses linked lists to store a list of skbs to pass to the > stack. Now that we don't use listified Rx in favor of > napi_gro_receive(), linked list is now an unneeded overhead. > Inside the polling loop, we already have an array of skbs. Let's reuse > it for skbs passed to cpumap (generic XDP) and keep there in case of > XDP_PASS when a program is installed to the map itself. Don't list > regular xdp_frames after converting them to skbs as well; store them > in the mentioned array (but *before* generic skbs as the latters have > lower priority) and call gro_receive_skb() for each array element after > they're done. > > Signed-off-by: Alexander Lobakin > Tested-by: Daniel Xu Clever approach. A little hard to follow all the memmoves, but I think it checks out given the description above :) Reviewed-by: Toke H=C3=B8iland-J=C3=B8rgensen