Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp464616rdb; Tue, 5 Dec 2023 10:04:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHNinsvcgD0am6mn4E10Q7faipUEtAGUKBsC1uFzsXbYgx5Bc9kO+zbe9NBD4ufHXnk6glm X-Received: by 2002:a17:903:2348:b0:1cf:a70b:39cd with SMTP id c8-20020a170903234800b001cfa70b39cdmr6785687plh.39.1701799460519; Tue, 05 Dec 2023 10:04:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701799460; cv=none; d=google.com; s=arc-20160816; b=XORg0vqFGqjp6DUTBb4rsGkmi2vbPclu9nlLley/gd3WpJi5LOPHysbon54jtQUM03 ItX6LaEsle/KoKubsfRG6ZTacxqnktRAnzFajJBl6cQ6tv9NQ8JLyHp9q7KbvfDBODjJ yYmlS++lFrz2jyzmCnUOuLboTo0pbdIr1mlOI+09tu/+kByEF7mG95WAYaFvMGkEU1kP JWwrwpkUJWJgMgMbGZsfEx7r3cymlbkazmD1ix0k5qx7WOwhGlupYvA4LcqD6OnE80s5 oQXZXTJJW7Ib+Sqhr30aat+XPIbOwEDVqx2kOhVkzl5RoSo979rRtM0UMUCZrrLPXCZa UQHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:subject :references:in-reply-to:message-id:cc:to:from:date:dkim-signature; bh=mtqmpldzJhepZSlcxwawCnd6BYpTKMMQiQbo2+VQqDs=; fh=2piQqV7FhxCfGSSvYdIc/buHBTPrU4NLL9GcI2YEoBI=; b=HudY/wgiyyJpMRJxuC4clFEjH6FtwmWntHVXfoBs481aoEhHE/aoiTuRsBhy1SY69i DUbrSToy4G3UNpyNLmuUjZBrvOHDaITjME9W6DcmhkwTuuVkuw0I5hvYxGtke6Xi+axh EdifQShSPECMH+MFY5SJO8cPKOz2yDB1jlWb2TqKev2ozz3gF2oCyqFywCQpUP8advRh cK/tLCDLZjByThqQ1B0Uq12so22XkMUn49VAshDx5ZBg2w+JbBdmqk2yewACG2tk86zJ /MvKi1zKWP50hxzzhYvMkYy0O2ndmeDeWsGDrRO6tC17V5nEWXPeUbQsfABjq6067ANH 1RWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jDzxqxX4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id n9-20020a1709026a8900b001cfa17ec30dsi9563638plk.508.2023.12.05.10.04.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 10:04:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jDzxqxX4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id A615880A9A9C; Tue, 5 Dec 2023 10:04:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345576AbjLESDn (ORCPT + 99 others); Tue, 5 Dec 2023 13:03:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231910AbjLESDl (ORCPT ); Tue, 5 Dec 2023 13:03:41 -0500 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C127490; Tue, 5 Dec 2023 10:03:47 -0800 (PST) Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-77d8f9159fbso323096485a.2; Tue, 05 Dec 2023 10:03:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701799427; x=1702404227; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=mtqmpldzJhepZSlcxwawCnd6BYpTKMMQiQbo2+VQqDs=; b=jDzxqxX48qnzrFkI2Mjy7S6pIDdUytPY6+SEGY+S+x2V9kGMfDzFyXLXZs9BlnmsA9 Mli8NEPpO2jZJRt/4iv8Yf75m38V4e8GvnL1tdjTPdR20nQ055CnxD51xsTvB6ksf7QG B/iBw15ASauQj4bNLB8gfQp0CaeTr7rOv3nuNqP4Se1cyxZMPRC7bNdN9MnwZ8vh0chv SYuTwk0nO/PzfRsjv7/7L+AXIsKhkRSITyPdzq4bhekioT88dDteUowXa6UlocvEGiJg WnmFBq1zwoSu/+pn0D8jLltI5RMj8d6PAEpnjyHKbnF/uFA6q8+5L16chsvxrjnjzZRC Bcpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701799427; x=1702404227; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=mtqmpldzJhepZSlcxwawCnd6BYpTKMMQiQbo2+VQqDs=; b=p4p2R5pERSh7xbYoQmwvHaQ88y89dLEw3r7/fFQDWxx26yJeS/LibxmS02hZxqSREZ 6+8NBljyS+q0svZzoTDFXJQNOn8ktBGMZ3gEelUa7j+hiY6DdSy5fF7H5/MGAwdVoR1P T8K9ohgp+DJwzbAH/zMy9gOfeIkI527+Lkj+CyfG5EIYuxInks+Jl1odDFcqz8g0bpHd Do+sRZqse49gCFra9bKe0mK1zsGUaC7bXDHPLHg7sUAes+O9eI/0VNqc/cRxzl+WLVOe 5JAztn+lObC6fDFpuUdLNZYQlVeYWLjeyMRMR+X7z7WkQZuhV3MKL3m1VlQOkSo6l568 EcJg== X-Gm-Message-State: AOJu0Yy4Fej501A++wEO5E8Iy9CZ5DWXOEnQByevhBdbxwJbW3/fxKnG AO8efFiAyQ81jbuIrgOAIZI= X-Received: by 2002:a05:620a:349:b0:77e:fba3:7574 with SMTP id t9-20020a05620a034900b0077efba37574mr1530842qkm.108.1701799426793; Tue, 05 Dec 2023 10:03:46 -0800 (PST) Received: from localhost (114.66.194.35.bc.googleusercontent.com. [35.194.66.114]) by smtp.gmail.com with ESMTPSA id qh13-20020a05620a668d00b0077d85d22e89sm5264273qkn.63.2023.12.05.10.03.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 10:03:46 -0800 (PST) Date: Tue, 05 Dec 2023 13:03:46 -0500 From: Willem de Bruijn To: Stanislav Fomichev , Florian Bezdeka Cc: "Song, Yoong Siang" , Willem de Bruijn , Jesper Dangaard Brouer , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Bjorn Topel , "Karlsson, Magnus" , "Fijalkowski, Maciej" , Jonathan Lemon , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Lorenzo Bianconi , Tariq Toukan , Willem de Bruijn , Maxime Coquelin , Andrii Nakryiko , Mykola Lysenko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Hao Luo , Jiri Olsa , Shuah Khan , Alexandre Torgue , Jose Abreu , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" , "bpf@vger.kernel.org" , "xdp-hints@xdp-project.net" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kselftest@vger.kernel.org" Message-ID: <656f66023f7bd_3dd6422942a@willemb.c.googlers.com.notmuch> In-Reply-To: References: <20231203165129.1740512-1-yoong.siang.song@intel.com> <20231203165129.1740512-3-yoong.siang.song@intel.com> <43b01013-e78b-417e-b169-91909c7309b1@kernel.org> <656de830e8d70_2e983e294ca@willemb.c.googlers.com.notmuch> <5a0faf8cc9ec3ab0d5082c66b909c582c8f1eae6.camel@siemens.com> Subject: Re: [xdp-hints] Re: [PATCH bpf-next v3 2/3] net: stmmac: add Launch Time support to XDP ZC Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 05 Dec 2023 10:04:00 -0800 (PST) Stanislav Fomichev wrote: > On Tue, Dec 5, 2023 at 7:34=E2=80=AFAM Florian Bezdeka > wrote: > > > > On Tue, 2023-12-05 at 15:25 +0000, Song, Yoong Siang wrote: > > > On Monday, December 4, 2023 10:55 PM, Willem de Bruijn wrote: > > > > Jesper Dangaard Brouer wrote: > > > > > > > > > > > > > > > On 12/3/23 17:51, Song Yoong Siang wrote: > > > > > > This patch enables Launch Time (Time-Based Scheduling) suppor= t to XDP zero > > > > > > copy via XDP Tx metadata framework. > > > > > > > > > > > > Signed-off-by: Song Yoong Siang > > > > > > --- > > > > > > drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 ++ > > > > > > > > > > As requested before, I think we need to see another driver impl= ementing > > > > > this. > > > > > > > > > > I propose driver igc and chip i225. > > > > > > Sure. I will include igc patches in next version. > > > > > > > > > > > > > The interesting thing for me is to see how the LaunchTime max 1= second > > > > > into the future[1] is handled code wise. One suggestion is to a= dd a > > > > > section to Documentation/networking/xsk-tx-metadata.rst per dri= ver that > > > > > mentions/documents these different hardware limitations. It is= natural > > > > > that different types of hardware have limitations. This is a c= lose-to > > > > > hardware-level abstraction/API, and IMHO as long as we document= the > > > > > limitations we can expose this API without too many limitations= for more > > > > > capable hardware. > > > > > > Sure. I will try to add hardware limitations in documentation. > > > > > > > > > > > I would assume that the kfunc will fail when a value is passed th= at > > > > cannot be programmed. > > > > > > > > > > In current design, the xsk_tx_metadata_request() dint got return va= lue. > > > So user won't know if their request is fail. > > > It is complex to inform user which request is failing. > > > Therefore, IMHO, it is good that we let driver handle the error sil= ently. > > > > > > > If the programmed value is invalid, the packet will be "dropped" / wi= ll > > never make it to the wire, right? Programmable behavior is to either drop or cap to some boundary value, such as the farthest programmable time in the future: the horizon. In fq: /* Check if packet timestamp is too far in the future. */= if (fq_packet_beyond_horizon(skb, q, now)) { if (q->horizon_drop) { q->stat_horizon_drops++; return qdisc_drop(skb, sch, to_fr= ee); } q->stat_horizon_caps++; skb->tstamp =3D now + q->horizon; } fq_skb_cb(skb)->time_to_send =3D skb->tstamp; Drop is the more obviously correct mode. Programming with a clock source that the driver does not support will then be a persistent failure. Preferably, this driver capability can be queried beforehand (rather than only through reading error counters afterwards). Perhaps it should not be a driver task to convert from possibly multiple clock sources to the device native clock. Right now, we do use per-device timecounters for this, implemented in the driver. As for which clocks are relevant. For PTP, I suppose the device PHC, converted to nsec. For pacing offload, TCP uses CLOCK_MONOTONIC. > > > > That is clearly a situation that the user should be informed about. F= or > > RT systems this normally means that something is really wrong regardi= ng > > timing / cycle overflow. Such systems have to react on that situation= . > = > In general, af_xdp is a bit lacking in this 'notify the user that they > somehow messed up' area :-( > For example, pushing a tx descriptor with a wrong addr/len in zc mode > will not give any visible signal back (besides driver potentially > spilling something into dmesg as it was in the mlx case). > We can probably start with having some counters for these events? This is because the AF_XDP completion queue descriptor format is only a u64 address? Could error conditions be reported on tx completion in the metadata, using xsk_tx_metadata_complete?