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 559341FECA4 for ; Fri, 17 Jan 2025 12:58:34 +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=1737118716; cv=none; b=mQPs9eK19IJYutUF8extLo7mkhgdaXySvJLvyBl6i0BO7rEC92A2TfDh4OUMnY5DcM2tuvIXmMG3jPF66Ccnt2MwlhZcQVgYPhTY/i/jRt1MuQcuFax6+Z5qjxlFOeFnQFD1HXSDJxa5iIu5Hn+axgp0hRq/khvi7oPBlLvrPiA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737118716; c=relaxed/simple; bh=un1b/p+etlaRZvGTnj0wGy4rWWQjEn54RRTXDwwF4Cw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=CZlhUsXrNRigR89YEjdVqZfvPHEbewdZ40jxB2yGSN/juSu2LYVpNKX/hy4krWqW87YVJFi38nLCRrSf8jGbFvkYEm9+Awr+g8Emekxd8NDmS38QbkHwnjNgN1fIxN3ApkWbU7a/t8HjrXNNigvG5jWMkTYxaWOiCeUE8GJ/e5o= 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=aS9Y5yQt; 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="aS9Y5yQt" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1737118713; 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=Z7IA/4+Igfj/5zI/g3T0/mubsjPOaD5i2z7Uf9OFwuY=; b=aS9Y5yQtDcg5ZQEXSgJ4hdP5rSbFOK+CDpMD8LeOgsOgyy2exI6k5aWJPgEjnRhJjWxU2r G1cLL4nyGRcBp+gJziBf70HXgbzOQudzKXZ8y4TFxbNGwGq9H3s+ncZwMLwTRdFffwmvlq 5RG9QNEWxfuyq/ZNhmsAwEbm5vNO958= 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-214-HWFhZLVcONO3pMJjr7sMRw-1; Fri, 17 Jan 2025 07:58:32 -0500 X-MC-Unique: HWFhZLVcONO3pMJjr7sMRw-1 X-Mimecast-MFC-AGG-ID: HWFhZLVcONO3pMJjr7sMRw Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-aa63b02c69cso360914366b.0 for ; Fri, 17 Jan 2025 04:58:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737118711; x=1737723511; 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=Z7IA/4+Igfj/5zI/g3T0/mubsjPOaD5i2z7Uf9OFwuY=; b=H/GHDg37Q76RAYSOMhT8jh3JgMAnx9liBdLZk6taMF9UmquiBymeQlXFOrnhCL7kv0 G89kJuJzjTB5DYoRKwrUMI9Hu21137zaEr+h5hD89YvIn2aIPEmjoXJtmKHN/indOlNg s5oZF587sbHzBBpTOL49GiTzWfTqowSWQqfxZFsRKwc+dtpMzh5uflXIK//Fd52v7axw w+f1whTfJKx9jS+EkSwW6nc+HcSj6Zj2nB92ie5jsF+AHe88oTITmMoIs9wMqP1Hoan5 UjvI6FHNBPj5+ETsdELK0UNwlZRtsL/MnE6XpAMzcVILvXvb9Xyl2vp11MMbxvHpUPVV ueVA== X-Forwarded-Encrypted: i=1; AJvYcCViPehTp1zi/z1TvKBkszuDF+hgvpXICja3IL1AAxpabr8qslQYQzh+5YHKIL+CiYwHzXuDY+IwgPPwMC4=@vger.kernel.org X-Gm-Message-State: AOJu0YypXwiq93I3RQX5y8tWvnrgJcJQsbXF8Oj9eQHvok1+INlfQLQS rlv7fFE1rQOB/me3xmxGUxI6CLApA9M6aEQac/TevsWCzAkIdiX2D9eSOf9FGF35qqYFAfejHTL oHU2dKY1MfL9woFtXV0KjI+xO4OmhWjohNwMJwEullcwOwnjUOWZWgbfJb176PA== X-Gm-Gg: ASbGncuUYHWCYpM1320/6I/GnGpUUR6H2zjBzFFIBMQ+y78ftbOb8ngqhWs1sB6VcdD yZTtsUjKAdq7XMx0INp6rmAb2WQXIf1Z5+KduQKYlV43SISnzNgRs4AvbMekPceP2ZnLBDCz0xo glDDOURxtajcS+I+ouME7LWAmFztR6OazHs09zPfJukig1Y+LOGgS0AHyHLN/VgOJc73103JGmq c5EvRkhulXXtCeIBdUKFpp8TeL841NDKhHybldZ/WDdILy4CEHQF7GpeIkmmYtUG3k+LcVriYOC 3JDw+A== X-Received: by 2002:a17:906:99c2:b0:ab2:faed:fad5 with SMTP id a640c23a62f3a-ab38cc8f4afmr176758466b.15.1737118710939; Fri, 17 Jan 2025 04:58:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IEC3t1kll5oxU2z48Sg1MKuVMUZmjw7/P62bWkfTQ1ddyFTQEqfnRkWMl7N2wCb/X4hazKIFQ== X-Received: by 2002:a17:906:99c2:b0:ab2:faed:fad5 with SMTP id a640c23a62f3a-ab38cc8f4afmr176756066b.15.1737118710597; Fri, 17 Jan 2025 04:58:30 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384d2d583sm165329266b.84.2025.01.17.04.58.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 04:58:30 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 4604617E7873; Fri, 17 Jan 2025 13:58:29 +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 6/8] bpf: cpumap: switch to napi_skb_cache_get_bulk() In-Reply-To: <20250115151901.2063909-7-aleksander.lobakin@intel.com> References: <20250115151901.2063909-1-aleksander.lobakin@intel.com> <20250115151901.2063909-7-aleksander.lobakin@intel.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Fri, 17 Jan 2025 13:58:29 +0100 Message-ID: <874j1xoave.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: > Now that cpumap uses GRO, which drops unused skb heads to the NAPI > cache, use napi_skb_cache_get_bulk() to try to reuse cached entries > and lower MM layer pressure. Always disable the BH before checking and > running the cpumap-pinned XDP prog and don't re-enable it in between > that and allocating an skb bulk, as we can access the NAPI caches only > from the BH context. > The better GRO aggregates packets, the less new skbs will be allocated. > If an aggregated skb contains 16 frags, this means 15 skbs were returned > to the cache, so next 15 skbs will be built without allocating anything. > > The same trafficgen UDP GRO test now shows: > > GRO off GRO on > threaded GRO 2.3 4 Mpps > thr bulk GRO 2.4 4.7 Mpps > diff +4 +17 % > > Comparing to the baseline cpumap: > > baseline 2.7 N/A Mpps > thr bulk GRO 2.4 4.7 Mpps > diff -11 +74 % > > Signed-off-by: Alexander Lobakin > Tested-by: Daniel Xu Reviewed-by: Toke H=C3=B8iland-J=C3=B8rgensen