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.133.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 01C1A1FF5F7 for ; Fri, 17 Jan 2025 12:45:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737117912; cv=none; b=hoK2yZoaLz+Di2Dx1im4JAFKl95gMuj1J0xpWFT2NredZNq6Xnq0Fh+1FcFpv3AZ42lWCFj2Zm9cJInZbcR3+lliQs/YwBt+o0+3S+/mc+tr6gSPJ1/0Hgn5+ly2UBTTaSKy5Jmyq2KYrPNcWXSRyS0UHy+YJolGrP7fGA26RJ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737117912; c=relaxed/simple; bh=z5CesBDK1xBpr2Un/QnljJBmVidZTP3FaHlwwSl6zIg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Tt3YpGHfSbkC0DLd2iw/zq7KCXeHdIdMj2fhLkcsAqBp0M16gk5r4qmsEasvcdKDcklxb+bOD80jxlf7dvQHgrdnccwJ660tIGm7+SVOt2sr4uB78xr1/oMum7EoznQp/h4tD8Cal3xJPZcufCVSB1DkBCumtqaT2M4HjBPYpio= 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=ejQjzloM; arc=none smtp.client-ip=170.10.133.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="ejQjzloM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737117910; 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=z5CesBDK1xBpr2Un/QnljJBmVidZTP3FaHlwwSl6zIg=; b=ejQjzloMQGj6awgv3ZQaAfIroOCzbNk/zVbn5/fKmysqfEMwtMhPqotpHmcPeO1YzfDj5S rCgEURTa0uAKRewVYiSXsK9tzkDXuB9F6itHVqV1ZUPAKtZ/aFQ1Jo4LmTvnP2s4efv8fH iSE6QxJliWYi9Jbc0kWFjG1HI2L0HXM= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-554-SJZUsn7MOoWcDTjiWcIY4Q-1; Fri, 17 Jan 2025 07:45:08 -0500 X-MC-Unique: SJZUsn7MOoWcDTjiWcIY4Q-1 X-Mimecast-MFC-AGG-ID: SJZUsn7MOoWcDTjiWcIY4Q Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-aaf921b8a85so234833066b.0 for ; Fri, 17 Jan 2025 04:45:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737117907; x=1737722707; 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=z5CesBDK1xBpr2Un/QnljJBmVidZTP3FaHlwwSl6zIg=; b=HBwIDWHuhOz19DDxT4FdG8UHUVjbqm2HHoVmBQHQ6bCc0VbKiP4BZiNMRsLRvy9DvP 7VmiYolNzFl7FTM3J+5G+Bp2q6XDc4kgAyO++jEePZ4HIuV9az3evFNin9/coqhhuWFm O+qffTQ3NjLuMGtLex/860+3t7fFZ1dFF2oRa5lBSKstd+N4e7g44Svxat3mEmNQb2NI F+2M6uSU33tTeTgGss+9fzBErhxPm6TA8Dyhn6ECz7wz1BqnF/fhJ3y0ADG+Wus5vnLd W1iS/FSYw5SUdpxLumt34TBsRzU4v5LgyxfIM/F4NR4ejJh2GmnU8CRqPF1KqHZMFRqt 6aBg== X-Forwarded-Encrypted: i=1; AJvYcCUwWePtqgy4NS9u/wUMvKRdxr64ngI7LCAcbgTXUBf072cLYoR4PTU2hvveCTfrn5wamnl9fX4KNV27B8E=@vger.kernel.org X-Gm-Message-State: AOJu0YxENySEdZU7g5FV7rypb122TPNzUVsugkl2H5PXrQ045okF7zSV Y7JdZqwU+kwwm+agZPxz9Oooy1A7m9WNXze+VijsG+FD40qAShUP/8ep8IupxmaePCiJ4h7Mqr0 UcObkzYwl3JudVbDyBpgUxMC4C4n56USqvd+Jax8IAsarRePYOn63r0t1+pvlPQ== X-Gm-Gg: ASbGnctwrdA1xk21CmaqxZRmknI9dwstGGoPuN9db14ppUyeHN2yODnk9GOkLXEOcmj nRuMZIuhAiA/ACRMvqeh5tM4pS1SBMLofTsWX8SSe/28BUe4vdSkOoFlb8tH5iRxTms+WpxOvW3 cwfXCvVmO00l96HbJYCBDI8KjpfDuuvXH8hzW2U8dszTJ7X2dkz8Tbib7dSPPxXntKj5tE2I1BZ 2y8LsVQX3f7n9dRfJAf8k0q3v1A8bl2gyZgDrkMHiNv+NDUijeVjVOu5Dn24EMfF/m6rcWI4Mqz nCEB+Q== X-Received: by 2002:a17:907:6d0e:b0:aa6:966d:3f93 with SMTP id a640c23a62f3a-ab38b112b07mr226450666b.23.1737117907402; Fri, 17 Jan 2025 04:45:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHfFt2OocIDCeVCuphJzNl9Mw6EvXmqC8VOMNFVCg1AliOY0zzpd05VMHD+2EiGsW65Bih1uQ== X-Received: by 2002:a17:907:6d0e:b0:aa6:966d:3f93 with SMTP id a640c23a62f3a-ab38b112b07mr226447466b.23.1737117906979; Fri, 17 Jan 2025 04:45:06 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384f223f3sm164037166b.116.2025.01.17.04.45.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 04:45:06 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 6986217E786D; Fri, 17 Jan 2025 13:45:05 +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 3/8] bpf: cpumap: switch to GRO from netif_receive_skb_list() In-Reply-To: <20250115151901.2063909-4-aleksander.lobakin@intel.com> References: <20250115151901.2063909-1-aleksander.lobakin@intel.com> <20250115151901.2063909-4-aleksander.lobakin@intel.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Fri, 17 Jan 2025 13:45:05 +0100 Message-ID: <87cyglobhq.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 has its own BH context based on kthread. It has a sane batch > size of 8 frames per one cycle. > GRO can be used here 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. > In plenty of tests, GRO performs better than listed receiving even > given that it has to calculate full frame checksums on the 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 points 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 > Tested-by: Daniel Xu Reviewed-by: Toke H=C3=B8iland-J=C3=B8rgensen