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 AA18F495E5 for ; Sat, 10 Aug 2024 08:00:46 +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=1723276848; cv=none; b=mpwEks0P9GYTX2iVL8uCJQ6Q7Nhk1CugPvVNbBRAwxcK0bMu/a55B+GTWo77l5lmsqdgVORR2877euUT6u42IznZdt/dcmROXK1He80j92DEQJ41ZTooFdr4xvvi1DkZQKUCCDOcxKSZ27IpQDGP0U/xLNxKe230XCxjt6oij5M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723276848; c=relaxed/simple; bh=FxumrIDW6qoxo9gfQ9R1lcQJdhBiVgoBIKMyeVQ2eZc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=c5WA1t6pFVRptY0GY6fG3vTNhvGdqC+68Ft+Cku1RuczunLREwVsOCp41208rju50JzkJQqrY1G0zCe+858lUEfYiiiQ9h8qrXdXoyt1Qze0+aEVmSwtPdMYUmQdID7mdEBUKmsy17jmQnEWB5nTDJ8f5hUeOQuhy27pDTTtrL0= 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=JBLGu17y; 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="JBLGu17y" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723276845; 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: in-reply-to:in-reply-to:references:references; bh=cxaBsOWYXbQjl952d0wR8HU0oXx4pPetERcANE2n4pw=; b=JBLGu17y9ofecNJCfnMNBNIC/ao+cQfV/7MNBaNk8Ca9qN+pj+9ua9QEbMeLM2REQlCIL9 2J0c5xqo4ATFodZaoqCe+yTkWI6AyrRoZlL7TFW6pK+VYqA4vDjUlE0iLZvCNSE28HlJ/J w02XSAuHRQEROcyk6wSl/nJgHTtNNJI= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-225-d-UZrteJPQ6syx15xjw1mg-1; Sat, 10 Aug 2024 04:00:42 -0400 X-MC-Unique: d-UZrteJPQ6syx15xjw1mg-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2ef23a67c5bso26596711fa.3 for ; Sat, 10 Aug 2024 01:00:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723276841; x=1723881641; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cxaBsOWYXbQjl952d0wR8HU0oXx4pPetERcANE2n4pw=; b=p7GtvQFS2WAQ0FJNENZlXIZt2QEBOXkSJSSZTsrseWMkiJLtubv3WfguUMXpIoDopR WTUTDUD5dGU2XQq4nB7Sm+oiOynNKDg2bz98PaQunTn9Py1dZ1/B4P/CeV6EybAm4Hti cLhTSqMBCjd9cP5BDoyzo7EhyjyE80uSB7SLiHd7qnn8riMHu68VVsh1nx6FHSItNBjg LVHCS5S3/rTe7iBZpQjGMAENkIi/SKl3qMFVvTbT1HM6PRGnF5mWwPLYKRaNHOyxItb1 lHfpew9zkMrWz5BTknizQIuT0wDUOOgNpEq2kPhEA5h4TDZ5kPMdfDW0eS28+nrX9qPm xDGw== X-Forwarded-Encrypted: i=1; AJvYcCVKwIodtSbBhOts5YEC8Xkq/AYULhsP6C9cDKGkmWs4+AY3Zvce+ABA2r5VtQ2x9mQ+jpS7CB1sRzLE/GCKEw1obau3mmYd X-Gm-Message-State: AOJu0YzRL+lF+cYV1O5Dj9TPipK5V5ftacdG6mGrxrc+Hx9qUgJXr0vb l8xfZ5IJwbMhLl3XAO3CoxnbgF6zc/jSVaV6FKz1lftl6r7P+FFUq/dn4tkh/vnlcFHHgCEiXJD x5zOu54lEgkA45l+yt1cb2Mf/N0VKgkfBqan/VfbVkDdKa4lLTTF47w== X-Received: by 2002:a2e:be9d:0:b0:2f0:20cd:35fc with SMTP id 38308e7fff4ca-2f1a6c4cf01mr33426821fa.7.1723276840547; Sat, 10 Aug 2024 01:00:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHm7k8IUz5d3cudToCANSXgZtSllkVKwZwQhLwKqQ43m1YO/m1NdkmZJerxkfQZ0JUye0k27A== X-Received: by 2002:a2e:be9d:0:b0:2f0:20cd:35fc with SMTP id 38308e7fff4ca-2f1a6c4cf01mr33426271fa.7.1723276839630; Sat, 10 Aug 2024 01:00:39 -0700 (PDT) Received: from localhost (53.116.107.80.static.otenet.gr. [80.107.116.53]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-429c7736b05sm19723545e9.29.2024.08.10.01.00.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Aug 2024 01:00:39 -0700 (PDT) Date: Sat, 10 Aug 2024 10:00:36 +0200 From: Lorenzo Bianconi To: Alexander Lobakin Cc: Daniel Xu , Alexander Lobakin , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Larysa Zaremba , Michal Swiatkowski , Jesper Dangaard Brouer , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Magnus Karlsson , Maciej Fijalkowski , Jonathan Lemon , "toke@redhat.com" , Lorenzo Bianconi , David Miller , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jesse Brandeburg , John Fastabend , Yajun Deng , Willem de Bruijn , "bpf@vger.kernel.org" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, xdp-hints@xdp-project.net Subject: Re: [xdp-hints] Re: [PATCH RFC bpf-next 32/52] bpf, cpumap: switch to GRO from netif_receive_skb_list() Message-ID: References: <20220628194812.1453059-1-alexandr.lobakin@intel.com> <20220628194812.1453059-33-alexandr.lobakin@intel.com> <54aab7ec-80e9-44fd-8249-fe0cabda0393@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3tjfGVd/eoZK+rGd" Content-Disposition: inline In-Reply-To: <54aab7ec-80e9-44fd-8249-fe0cabda0393@intel.com> --3tjfGVd/eoZK+rGd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Aug 08, Alexander Lobakin wrote: > From: Lorenzo Bianconi > Date: Thu, 8 Aug 2024 06:54:06 +0200 >=20 > >> Hi Alexander, > >> > >> On Tue, Jun 28, 2022, at 12:47 PM, Alexander Lobakin wrote: > >>> cpumap has its own BH context based on kthread. It has a sane batch > >>> size of 8 frames per one cycle. > >>> GRO can be used on its own, adjust cpumap calls to the > >>> upper stack to use GRO API instead of netif_receive_skb_list() which > >>> processes skbs by batches, but doesn't involve GRO layer at all. > >>> It is most beneficial when a NIC which frame come from is XDP > >>> generic metadata-enabled, but in plenty of tests GRO performs better > >>> than listed receiving even given that it has to calculate full frame > >>> checksums on CPU. > >>> As GRO passes the skbs to the upper stack in the batches of > >>> @gro_normal_batch, i.e. 8 by default, and @skb->dev point to the > >>> device where the frame comes from, it is enough to disable GRO > >>> netdev feature on it to completely restore the original behaviour: > >>> untouched frames will be being bulked and passed to the upper stack > >>> by 8, as it was with netif_receive_skb_list(). > >>> > >>> Signed-off-by: Alexander Lobakin > >>> --- > >>> kernel/bpf/cpumap.c | 43 ++++++++++++++++++++++++++++++++++++++----- > >>> 1 file changed, 38 insertions(+), 5 deletions(-) > >>> > >> > >> AFAICT the cpumap + GRO is a good standalone improvement. I think > >> cpumap is still missing this. >=20 > The only concern for having GRO in cpumap without metadata from the NIC > descriptor was that when the checksum status is missing, GRO calculates > the checksum on CPU, which is not really fast. > But I remember sometimes GRO was faster despite that. For the moment we could test it with UDP traffic with checksum disabled. Regards, Lorenzo >=20 > >> > >> I have a production use case for this now. We want to do some intellig= ent > >> RX steering and I think GRO would help over list-ified receive in some= cases. > >> We would prefer steer in HW (and thus get existing GRO support) but no= t all > >> our NICs support it. So we need a software fallback. > >> > >> Are you still interested in merging the cpumap + GRO patches? >=20 > For sure I can revive this part. I was planning to get back to this > branch and pick patches which were not related to XDP hints and send > them separately. >=20 > >=20 > > Hi Daniel and Alex, > >=20 > > Recently I worked on a PoC to add GRO support to cpumap codebase: > > - https://github.com/LorenzoBianconi/bpf-next/commit/a4b8264d5000ecf016= da5a2dd9ac302deaf38b3e > > Here I added GRO support to cpumap through gro-cells. > > - https://github.com/LorenzoBianconi/bpf-next/commit/da6cb32a4674aa7240= 1c7414c9a8a0775ef41a55 > > Here I added GRO support to cpumap trough napi-threaded APIs (with a = some > > changes to them). >=20 > Hmm, when I was testing it, adding a whole NAPI to cpumap was sorta > overkill, that's why I separated GRO structure from &napi_struct. >=20 > Let me maybe find some free time, I would then test all 3 solutions > (mine, gro_cells, threaded NAPI) and pick/send the best? >=20 > >=20 > > Please note I have not run any performance tests so far, just verified = it does > > not crash (I was planning to resume this work soon). Please let me know= if it > > works for you. > >=20 > > Regards, > > Lorenzo > >=20 > >> > >> Thanks, > >> Daniel >=20 > Thanks, > Olek >=20 --3tjfGVd/eoZK+rGd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCZrceIQAKCRA6cBh0uS2t rAuOAP9lAP+wUtI4DT03vstan8oVHlFYyfbFpQ5S9GXv19t6iQD+Oq31gcfUQN93 0x2SbfWudVdpE9DvTKzXi6mE/f29ZAc= =6Wya -----END PGP SIGNATURE----- --3tjfGVd/eoZK+rGd--