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 458419C2728 for ; Tue, 15 Nov 2022 17:17:48 +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=gcQatQJc DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668529067; 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=dDNdu3Y9fr5FOdr8MTcDO+pL9js6k+/irqVmUcE/IG0=; b=gcQatQJcrTkmLdKGPd33IPdZ/b8u2qcSeHm+vgXozm7pgu1Tbv5STI78FhZ9yHrcwzSL85 TjF9TFZYM4/CS+HM+yu2EVXJ6BRkqul2ZmXNRAw9iPm/Qg2ykxZ0k5t9VZ6wC8MAETT+oc NWdBdAsJXkTg00nhlThMb2Z5iNs6jSo= 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_128_GCM_SHA256) id us-mta-457-ISJTItvePT2Hyp9k_kmQvQ-1; Tue, 15 Nov 2022 11:17:45 -0500 X-MC-Unique: ISJTItvePT2Hyp9k_kmQvQ-1 Received: by mail-ej1-f71.google.com with SMTP id qf25-20020a1709077f1900b0078c02a23da3so7482891ejc.0 for ; Tue, 15 Nov 2022 08:17:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=dDNdu3Y9fr5FOdr8MTcDO+pL9js6k+/irqVmUcE/IG0=; b=T4gV9L3AfOJDUZ+B5nIxLQyD0BlhfhHS3MIYP1TRyhMQ0Bre3UwiHCJuAL1gVATaT3 1vOJnx95tEL4IjqHYDk8n+Ot64OA8ysF9iujhwlL/OKVD2dGT+wwoShgss8yfrYgYl5x IIHJS8wMMA6Ug4Oi5NjOs1EfiVzqQD6zrbHhIVxTnn0Fbzi2HkwlMRggeA6r4dWZ7viY 8d87mTE/fyQGaEJysDW60kwsn99LFiK/eFwWWTRCA3x3rLIwdXnz4tPyoU9RWmEvh24O cdlwSDNrZc+q4p12KjLgR14Cyfpvjr246Fokc+3H4D6N0UVSMgnY9d8DhLZsQGHSUReL hwgg== X-Gm-Message-State: ANoB5pmQ9LHa7YrcWCj277d+XGLFgr7Rb3hPbZ0CmmH5JWRmz9UkS24G 0o46nPOqx1MA6Z+25e6CZ6VoX0xlQuQjvxgf/hhNrhPYg39YRcw0oplbLyUBRQDRPo+hubUINFm umsKkYMgtgvV7sC9Y5L1d X-Received: by 2002:a17:906:4dd6:b0:7ad:a030:487e with SMTP id f22-20020a1709064dd600b007ada030487emr14892560ejw.508.1668529063837; Tue, 15 Nov 2022 08:17:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf4cIst8+Ig0NZcClVeIsQkF2jZkdjAmTbe5xwQCO1YruIKHoWA/N3/mXPzzpNeqf2RQNQE7OA== X-Received: by 2002:a17:906:4dd6:b0:7ad:a030:487e with SMTP id f22-20020a1709064dd600b007ada030487emr14892527ejw.508.1668529063454; Tue, 15 Nov 2022 08:17:43 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id r7-20020aa7cfc7000000b004610899742asm6234653edy.13.2022.11.15.08.17.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 08:17:42 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 4A90F7A6CDA; Tue, 15 Nov 2022 17:17:42 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Stanislav Fomichev , bpf@vger.kernel.org In-Reply-To: <20221115030210.3159213-6-sdf@google.com> References: <20221115030210.3159213-1-sdf@google.com> <20221115030210.3159213-6-sdf@google.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Tue, 15 Nov 2022 17:17:42 +0100 Message-ID: <87h6z0i449.fsf@toke.dk> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Message-ID-Hash: V6ZB4XBIYG5ARUXCEKKFKN5CXO3QFKO3 X-Message-ID-Hash: V6ZB4XBIYG5ARUXCEKKFKN5CXO3QFKO3 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, 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.6 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next 05/11] veth: Support rx timestamp metadata for xdp List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Stanislav Fomichev writes: > The goal is to enable end-to-end testing of the metadata > for AF_XDP. Current rx_timestamp kfunc returns current > time which should be enough to exercise this new functionality. > > Cc: John Fastabend > Cc: David Ahern > Cc: Martin KaFai Lau > Cc: Jakub Kicinski > Cc: Willem de Bruijn > Cc: Jesper Dangaard Brouer > Cc: Anatoly Burakov > Cc: Alexander Lobakin > Cc: Magnus Karlsson > Cc: Maryam Tahhan > Cc: xdp-hints@xdp-project.net > Cc: netdev@vger.kernel.org > Signed-off-by: Stanislav Fomichev > --- > drivers/net/veth.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/net/veth.c b/drivers/net/veth.c > index 2a4592780141..c626580a2294 100644 > --- a/drivers/net/veth.c > +++ b/drivers/net/veth.c > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include > #include > > #define DRV_NAME "veth" > @@ -1659,6 +1660,18 @@ static int veth_xdp(struct net_device *dev, struct netdev_bpf *xdp) > } > } > > +static void veth_unroll_kfunc(const struct bpf_prog *prog, u32 func_id, > + struct bpf_patch *patch) > +{ > + if (func_id == xdp_metadata_kfunc_id(XDP_METADATA_KFUNC_RX_TIMESTAMP_SUPPORTED)) { > + /* return true; */ > + bpf_patch_append(patch, BPF_MOV64_IMM(BPF_REG_0, 1)); > + } else if (func_id == xdp_metadata_kfunc_id(XDP_METADATA_KFUNC_RX_TIMESTAMP)) { > + /* return ktime_get_mono_fast_ns(); */ > + bpf_patch_append(patch, BPF_EMIT_CALL(ktime_get_mono_fast_ns)); > + } > +} So these look reasonable enough, but would be good to see some examples of kfunc implementations that don't just BPF_CALL to a kernel function (with those helper wrappers we were discussing before). -Toke