From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by mail.toke.dk (Postfix) with ESMTPS id 478989CD3A3 for ; Fri, 9 Dec 2022 00:46:11 +0100 (CET) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20210112 header.b=Dof5R32N Received: by mail-pg1-x535.google.com with SMTP id f9so2418170pgf.7 for ; Thu, 08 Dec 2022 15:46:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=p6eq3qVqvQa6a4DnGmG8Wa/pErkcr+JiA2KWwUdGIB4=; b=Dof5R32NxDjfCPkvDtsQsnwcDGtJEcCtLAO/d+sZEmis0wCMh6WLMP3oE6yLqiY3L1 3Yuz9C7Yy7Fq6Ue2NfarLL7dW2yMx4bY93tfDOeYRSzONeaAqfprST6gcM/K6t9cmLiu YBJOFL1EsyxwNDjC2RzH9VorQipA1J7qyNcqSBuHWE1O1SpU6KtfgfV86CABddx1bwQq 87Ib1OgpKRWg6892EJbb4XOCw7pMSCAc6HGk80MJHws+x+bfj/svI5KyqN0ZhZt/zmQj j/hA1j1ImRlIcVCnqv3CPcAB7uBiI8qE6Rqd2cIqW3fMnEM8Ab0ik5YV8DkW+PN/gyDo sTEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p6eq3qVqvQa6a4DnGmG8Wa/pErkcr+JiA2KWwUdGIB4=; b=7YqqM/ZWE8q1EXsYwQxZnvsrfebeDEKfpMKlJ7nlGcmJxXZNelh8NpzMcA9bfjtcLB VduX1ZP0WK8AW1b0YXlTPd3Z3orqy9l6OnKex6n8WWO6pON73Yb4e/JzOV4KasY5vhew tL7qkhrWDGHf8KDeQHI7sgZuCxAMXu5Io2C+dLCPfSu3s5KSzOfY5DSl3pxjTrWChWVI qyEn3XS0bbenmmYStauB8u1foWhwJ9lznLhSLFH+R06L9B80uS93+D27Q5M5lk/PKaRr 7DfJPnopsPZjOP5Jt7grqplWd88c02BCSomng1skrUpnFmINhF+usrzow2Sgjocwe2rX z1dA== X-Gm-Message-State: ANoB5pkI+EC4D2ZMuVAYeDw9e1UA2L5ZBhth9xgUOk5jK9OFRZzmdbBd iW5cpYnf7a6jES9vKbzKU8rYhy5X33v10SVyIavc1Q== X-Google-Smtp-Source: AA0mqf68EfiXKzh4Qqsn45VAM2KqCRu9H5SQS0jk5yiyZhZc9LribcXnYNomw9PrYLODWclkAlvlqykAQZgVL7MVIGk= X-Received: by 2002:a63:2160:0:b0:46f:f26e:e8ba with SMTP id s32-20020a632160000000b0046ff26ee8bamr71514626pgm.250.1670543169691; Thu, 08 Dec 2022 15:46:09 -0800 (PST) MIME-Version: 1.0 References: <20221206024554.3826186-1-sdf@google.com> <20221206024554.3826186-12-sdf@google.com> <875yellcx6.fsf@toke.dk> In-Reply-To: <875yellcx6.fsf@toke.dk> From: Stanislav Fomichev Date: Thu, 8 Dec 2022 15:45:58 -0800 Message-ID: To: =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: UL7MKRYFQP7EJOY546SUDNW5FVYNDBPO X-Message-ID-Hash: UL7MKRYFQP7EJOY546SUDNW5FVYNDBPO X-MailFrom: sdf@google.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: bpf@vger.kernel.org, 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, 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: On Thu, Dec 8, 2022 at 2:59 PM Toke H=C3=B8iland-J=C3=B8rgensen wrote: > > Stanislav Fomichev writes: > > > From: Toke H=C3=B8iland-J=C3=B8rgensen > > > > Support RX hash and timestamp metadata kfuncs. We need to pass in the c= qe > > pointer to the mlx5e_skb_from* functions so it can be retrieved from th= e > > 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 > Oh, that's great, thanks for running the numbers! Will definitely reference them in v4! Presumably, we should be able to at least unroll most of the _supported callbacks if we want, they should be relatively easy; but the numbers look fine as is?