From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by mail.toke.dk (Postfix) with ESMTPS id 073719B40F3 for ; Mon, 7 Nov 2022 20:10:33 +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=OtmzjJoc Received: by mail-io1-xd2c.google.com with SMTP id z3so9690958iof.3 for ; Mon, 07 Nov 2022 11:10:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=erviGKB6Nsun5EKJl5hBJZE8ooBTgrJ8Z6T63fZPXFE=; b=OtmzjJocSoWm1bnb0oipEeshOIUhdJ9fEDPQG5L4EpoHjPJ2OH/TBMUxT3tNiNyWTx gzWhRw0FEC/oeEFpxo1mZCcjj/6hnGoWIu+1cOC3HVugZPi2HRdPMFREhFKXxrAQseDA V0ls84lUmbW9D/Z+sltLjjJhQwXojeI5SLJ80D3tPO+h9Zfjs4uu82yuFCNC8tPrM2uN YPzMunhjHZIUydHN6mit7B5gr/IgB+NWsDzaMZAehBpc7seLrKN/vSw47JGlQ3RILrMN fFqvzmR7hlzxZ8MQogSweWxoqBJNxgtqEkHVEOptJUObafaN+y48bhV8YdhnzADDyf0V aMBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=erviGKB6Nsun5EKJl5hBJZE8ooBTgrJ8Z6T63fZPXFE=; b=BR4dnCzBDPa2vQTqINKwBKhFuXmEZpxXyaLC5iiqBOefQ0foE0Rky2yLq+z5+C8gUk 6MHTXIpDsh1jBidpYlPEmHfLvBA5GyLbPWW7hl/KBbpFk+hSCnQx4njN/plD5XgJW/pC E5mf8FGCTF9JN631oSxWnI1s9luwE0ELVFQL5q3r0U6hDUNfjJxRYTPqbFa0rhhmou1Z thvTC315jks2HIAKsCzYOQlwbpVChAc0OTH2Aq798+2Osb/gUQ8yd/Wbgtil4QP6hZjj 1AFxHtq4MbGUkILdn2BGssX6AFvd/63Ql4vjzH/RoZq8yk0w/rwlnKE4CcuOtMNEehz+ Dt2A== X-Gm-Message-State: ACrzQf0w+sJsyi8VU53MnNx9SKLdxdl+c24b9vygIv27CFV7YRaBRvLG wymB+XN/c+xKy9HG+M+QoTY46boT7NbmPfxef7D6aQ== X-Google-Smtp-Source: AMsMyM4KEg0au2uacpnbCzl9DFGJoedCy6eHgWKObP3R1ocX8JPUoPOMDdFXOgZlOgWnqzhpfzgbBz/JTDaMmA4Lg8o= X-Received: by 2002:a02:cacf:0:b0:375:4038:62a0 with SMTP id f15-20020a02cacf000000b00375403862a0mr31256711jap.23.1667848232027; Mon, 07 Nov 2022 11:10:32 -0800 (PST) MIME-Version: 1.0 References: <20221104032532.1615099-1-sdf@google.com> <20221104032532.1615099-11-sdf@google.com> <20221104143547.3575615-1-alexandr.lobakin@intel.com> <20221107171130.559191-1-alexandr.lobakin@intel.com> In-Reply-To: <20221107171130.559191-1-alexandr.lobakin@intel.com> From: Stanislav Fomichev Date: Mon, 7 Nov 2022 11:10:21 -0800 Message-ID: To: Alexander Lobakin Content-Type: text/plain; charset="UTF-8" Message-ID-Hash: HE3Q6ZNGVWC6RNZ2WPSDQAIBXUW5QUPG X-Message-ID-Hash: HE3Q6ZNGVWC6RNZ2WPSDQAIBXUW5QUPG 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, David Ahern , Jakub Kicinski , Willem de Bruijn , Jesper Dangaard Brouer , Anatoly Burakov , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org X-Mailman-Version: 3.3.5 Precedence: list Subject: [xdp-hints] Re: [RFC bpf-next v2 10/14] ice: 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: On Mon, Nov 7, 2022 at 9:33 AM Alexander Lobakin wrote: > > From: Stanislav Fomichev > Date: Fri, 4 Nov 2022 11:21:47 -0700 > > > On Fri, Nov 4, 2022 at 7:38 AM Alexander Lobakin > > wrote: > > > > > > From: Stanislav Fomichev > > > Date: Thu,3 Nov 2022 20:25:28 -0700 > > [...] > > > > Hey, > > > > > > FYI, our team wants to write a follow-up patch with ice support > > > added, not like a draft, more of a mature code. I'm thinking of > > > calling ice C function which would process Rx descriptors from > > > that BPF code from the unrolling callback -- otherwise, > > > implementing a couple hundred C code lines from ice_txrx_lib.c > > > would be a bit too much :D > > > > Sounds good! I would gladly drop all/most of the driver changes for > > the non-rfc posting :-) > > I'll probably have a mlx4 one because there is a chance I might find > > HW, but the rest I'll drop most likely. > > (they are here to show how the driver changes might look like, hence > > compile-tested only) > > > > Btw, does it make sense to have some small xsk selftest binary that > > can be used to test the metadata with the real device? > > The one I'm having right now depends on veth/namespaces; having a > > similar one for the real hardware to qualify it sounds useful? > > Something simple that sets up af_xdp for all queues, divers some > > traffic, and exposes to the userspace consumer all the info about > > frame metadata... > > Or maybe there is something I can reuse already? > > There's XSk selftest already and recently Maciej added support for > executing it on a physical device (via `-i ` cmdline arg)[0]. > I guess the most optimal solution is to expand it to cover metadata > cases as it has some sort of useful helper functions / infra? In the > set I posted in June, I simply expanded xdp_meta selftest, but there > weren't any XSk bits, so I don't think it's a way to go. Yeah, I was also extending xskxceiver initially, but not sure we want to put metadata in there (that test is already too big imo)? Jesper also pointed out [0], so maybe that thing should live out-of-tree? I got mlx4 working locally with a small xskxceiver-like selftest. I'll probably include it in the next non-rfc submission and we can discuss whether it makes sense to keep it or it's better to extend xskxceiver. 0: https://github.com/xdp-project/bpf-examples/tree/master/AF_XDP-interaction > > > > > > > > + } else 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)) { > > > > > > [...] > > > > > > > -- > > > > 2.38.1.431.g37b22c650d-goog > > > > > > Thanks, > > > Olek > > [0] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=a693ff3ed5610a07b1b0dd831d10f516e13cf6c6 > > Thank, > Olek