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 B8BB89CD2EC for ; Thu, 8 Dec 2022 23:59:40 +0100 (CET) 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=dkfSWrgk DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670540379; 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=baTIkTKoeOdiFtRby0whXRwP+amvPAt/6cxtZd8HV9w=; b=dkfSWrgkkUqBIdKyqXdGR5kE8X1Qay6QMsWEULrnh0F9D+cDMl+h6/nbxywzHZ4mGykICh l0R1RneEOcUjBkuZ6BCTl4jL6UMO0BpOWLbOg3WUSm8vgNj/5AS86jY+t2i8b6gLZhXHuN tbfR/7JHc/TPUn997rcrmASu5JRiZ6Q= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-349-uQSSp_FbOEiD4DgJ9gqpuw-1; Thu, 08 Dec 2022 17:59:38 -0500 X-MC-Unique: uQSSp_FbOEiD4DgJ9gqpuw-1 Received: by mail-ed1-f69.google.com with SMTP id f17-20020a056402355100b00466481256f6so310690edd.19 for ; Thu, 08 Dec 2022 14:59:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=baTIkTKoeOdiFtRby0whXRwP+amvPAt/6cxtZd8HV9w=; b=ZR01gusdrdyPjPEvfcNb1V4lEqmwtl8L51EfRcbOJn1NQwqbpzk5zg5yn+1wRVr3q6 a6IQ5roGSA+jnSx8xx/ammXjgTa9IkgnW6tgLsQZ4dYj5EOq4abaNk/xyK1BoSPfQWIA WEgYJr29Vq8j+dJKuIPkLQ+eYo6FDzurUG++Gh89DN1X+1sz2hDuusiWmHe0iwlXFw0x e8ckaunyeO6JSCjmCjRF4CwxZuqukFxLYVBorpaBtx2Ioxx3/6wids+mibsKcJoQgDs/ zozBAD+XuGoz3xVkXi0qT1BAeGUXUR+zZI8U/WntD8WkEHxE+1Fvok8hRYfeucbesAbs 5OkA== X-Gm-Message-State: ANoB5pl/XdOMkczW5E4QQS87F5JiQa4ubLM0BiW+f/oVOADHWdYrhD0E SAMHb8GRFJt1/tOpFn7nxteBBBxRKDGfwiQu19m8zkf5J8Wxg6yH2hkmxgtN/188NGV7U3g2p8v fy5r4A6ugQYg09LQu1UOr X-Received: by 2002:a17:906:f741:b0:7b4:edca:739 with SMTP id jp1-20020a170906f74100b007b4edca0739mr3069789ejb.5.1670540375557; Thu, 08 Dec 2022 14:59:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf4O+Sh1+ZnimYfAGU1O9NIcjaEK3y0uiAjFVUdKd6hZII5wg8CkGMiUh5lXxHViZL7jNEWBEg== X-Received: by 2002:a17:906:f741:b0:7b4:edca:739 with SMTP id jp1-20020a170906f74100b007b4edca0739mr3069736ejb.5.1670540374385; Thu, 08 Dec 2022 14:59:34 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([2a0c:4d80:42:443::2]) by smtp.gmail.com with ESMTPSA id m14-20020a170906848e00b007c0a7286ac8sm9777449ejx.69.2022.12.08.14.59.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Dec 2022 14:59:33 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 0DA6782E9A9; Thu, 8 Dec 2022 23:59:33 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Stanislav Fomichev , bpf@vger.kernel.org In-Reply-To: <20221206024554.3826186-12-sdf@google.com> References: <20221206024554.3826186-1-sdf@google.com> <20221206024554.3826186-12-sdf@google.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Thu, 08 Dec 2022 23:59:33 +0100 Message-ID: <875yellcx6.fsf@toke.dk> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: JHKI5IENKJPMRA3AY7IUYTJU7MHELZ4Y X-Message-ID-Hash: JHKI5IENKJPMRA3AY7IUYTJU7MHELZ4Y X-MailFrom: toke@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: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, Saeed Mahameed , David Ahern , Jakub Kicinski , Willem de Bruijn , Jesper Dangaard Brouer , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org X-Mailman-Version: 3.3.7 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v3 11/12] mlx5: Support RX XDP metadata List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Stanislav Fomichev writes: > From: Toke H=C3=B8iland-J=C3=B8rgensen > > Support RX hash and timestamp metadata kfuncs. We need to pass in the cqe > pointer to the mlx5e_skb_from* functions so it can be retrieved from the > XDP ctx to do this. So I finally managed to get enough ducks in row to actually benchmark this. With the caveat that I suddenly can't get the timestamp support to work (it was working in an earlier version, but now timestamp_supported() just returns false). I'm not sure if this is an issue with the enablement patch, or if I just haven't gotten the hardware configured properly. I'll investigate some more, but figured I'd post these results now: Baseline XDP_DROP: 25,678,262 pps / 38.94 ns/pkt XDP_DROP + read metadata: 23,924,109 pps / 41.80 ns/pkt Overhead: 1,754,153 pps / 2.86 ns/pkt As per the above, this is with calling three kfuncs/pkt (metadata_supported(), rx_hash_supported() and rx_hash()). So that's ~0.95 ns per function call, which is a bit less, but not far off from the ~1.2 ns that I'm used to. The tests where I accidentally called the default kfuncs cut off ~1.3 ns for one less kfunc call, so it's definitely in that ballpark. I'm not doing anything with the data, just reading it into an on-stack buffer, so this is the smallest possible delta from just getting the data out of the driver. I did confirm that the call instructions are still in the BPF program bytecode when it's dumped back out from the kernel. -Toke