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]) by mail.toke.dk (Postfix) with ESMTPS id DF301A7EBEE for ; Thu, 08 Aug 2024 06:54:15 +0200 (CEST) Authentication-Results: mail.toke.dk; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=hfqFyRMo DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723092853; 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=qGxD/J7yLslw467eIYb7KFvZb5Ntx0WCR07t6fDsHCo=; b=hfqFyRMoShnV80rWtZCOp6uKw3vAdkN36DmkflxBGJoxvThhbCt6RDeZsDdF2t8qrCjsR8 q2dGi04SsGV3gBzQ9fcnT8F7w+UFsnYZYr8efd5Ke5mek1T/h7FIvL8ya999rdZATFamce dUxfXiaI6rlu2YWImNZyVZMEJs2nQKc= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-39-kTnmKq78Ngyy74MvFz8yzA-1; Thu, 08 Aug 2024 00:54:11 -0400 X-MC-Unique: kTnmKq78Ngyy74MvFz8yzA-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-3687f4f9fecso421026f8f.1 for ; Wed, 07 Aug 2024 21:54:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723092850; x=1723697650; 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=qGxD/J7yLslw467eIYb7KFvZb5Ntx0WCR07t6fDsHCo=; b=JOjuQbRJyfzLQ42ulPb73jOsrtpCGKHky6Q+imfkxqLlEcrZjEQWDnYzmsIBWPr/s7 KqGomjn5Azm5vZLNTV4lBN+231dVg6Uoz8Vm4qZ5SeoYya96JSGgt4SA9jWX8fr1JLgg LCNSJL/Z7dh6uuLBEWPdNLrmaG1joUksvRZnF0l6RUDu80ybbbUM0vDlEZ6bDffI0YZv dfzkklcOSNMnvJ0/xayLKBWdp1WsOD43vgJrnRM3CLbe5nF3acXoUu3ArmBZ61Ni3rQp 9aTp907H7agyRVgNSX97jDQp575p8o05VAP5zUO86pIs6lGeJxAXbBwt4jRe3BER2ztr jzSg== X-Forwarded-Encrypted: i=1; AJvYcCXbJ7xD72+XS+EskkOo9dHHiSpsWwbLfMOXrHNuFudYjgAgt1MQ0PKLSer/hULvMVLwoXxMBi75j6qhguExzAT+iS4KPoYDqYAK X-Gm-Message-State: AOJu0YyFNRDzs/Rq/27b6PEM4J5k3BXwyhp2a3jH40SA1nYJkdits2lE DCTuLZhwPD+2Xj1Qm6ge4MkP96T1Tf3fz7Md7vWVucdDw3jZKC93yuH4bqtoP9d9gP0XLwJ1DnK 1Pji7Zu2O62/y9vjhzTgrhlKnzKgmtjzFyYuGEpfddFaIOqvVhBJbeHw4Cg== X-Received: by 2002:a5d:4f05:0:b0:368:3384:e9da with SMTP id ffacd0b85a97d-36d275ce9a7mr428251f8f.62.1723092850050; Wed, 07 Aug 2024 21:54:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGxcuyBS6WGfohjX62xojVV6mMc4LlSUlv10jMb/ThanMzMeAKJEdX/KoyeeG9vRzfcx6bY1A== X-Received: by 2002:a5d:4f05:0:b0:368:3384:e9da with SMTP id ffacd0b85a97d-36d275ce9a7mr428232f8f.62.1723092849508; Wed, 07 Aug 2024 21:54:09 -0700 (PDT) Received: from localhost (53.116.107.80.static.otenet.gr. [80.107.116.53]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36d2716befbsm594845f8f.27.2024.08.07.21.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 21:54:08 -0700 (PDT) Date: Thu, 8 Aug 2024 06:54:06 +0200 From: Lorenzo Bianconi To: Daniel Xu Message-ID: References: <20220628194812.1453059-1-alexandr.lobakin@intel.com> <20220628194812.1453059-33-alexandr.lobakin@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BrzZC+NstxqLld0s" Content-Disposition: inline In-Reply-To: Message-ID-Hash: GJRAMSQ7TRKTPCBKRQ6VDD2CJOQUDMR5 X-Message-ID-Hash: GJRAMSQ7TRKTPCBKRQ6VDD2CJOQUDMR5 X-MailFrom: lorenzo.bianconi@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: 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 X-Mailman-Version: 3.3.9 Precedence: list Subject: [xdp-hints] Re: [PATCH RFC bpf-next 32/52] bpf, cpumap: switch to GRO from netif_receive_skb_list() List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --BrzZC+NstxqLld0s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > Hi Alexander, >=20 > 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(-) > > >=20 > AFAICT the cpumap + GRO is a good standalone improvement. I think > cpumap is still missing this. >=20 > I have a production use case for this now. We want to do some intelligent > RX steering and I think GRO would help over list-ified receive in some ca= ses. > We would prefer steer in HW (and thus get existing GRO support) but not a= ll > our NICs support it. So we need a software fallback. >=20 > Are you still interested in merging the cpumap + GRO patches? Hi Daniel and Alex, Recently I worked on a PoC to add GRO support to cpumap codebase: - https://github.com/LorenzoBianconi/bpf-next/commit/a4b8264d5000ecf016da5a= 2dd9ac302deaf38b3e Here I added GRO support to cpumap through gro-cells. - https://github.com/LorenzoBianconi/bpf-next/commit/da6cb32a4674aa72401c74= 14c9a8a0775ef41a55 Here I added GRO support to cpumap trough napi-threaded APIs (with a some changes to them). Please note I have not run any performance tests so far, just verified it d= oes not crash (I was planning to resume this work soon). Please let me know if = it works for you. Regards, Lorenzo >=20 > Thanks, > Daniel >=20 --BrzZC+NstxqLld0s Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCZrRPagAKCRA6cBh0uS2t rK0FAQCwzPqU/L+8uGaMYta8IEEG8is+yCbIYKNDjVPfsabMBwD8DTd1Xi5dSpFL Lj2cZ9irZxRYcLz+GkmnAHDga5i2+Qk= =Oc7V -----END PGP SIGNATURE----- --BrzZC+NstxqLld0s--