From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by mail.toke.dk (Postfix) with ESMTPS id 216E4ABAD22 for ; Thu, 09 Jan 2025 18:39:22 +0100 (CET) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=BLhbkUI1 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-21654fdd5daso19011515ad.1 for ; Thu, 09 Jan 2025 09:39:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736444360; x=1737049160; darn=xdp-project.net; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=6KsRQIc1JxQBezEIVdfkOzKqKFxNDLhEnsfcwp5vSS0=; b=BLhbkUI1MnzfCLLvvhx4KFZpnGKm+g1BJj3KDFMzbhTQpD54Fsm5xULIUqveWMmB9x V4t+Ph08t41FjhhNnWZggikegXHYjgqr45DeZ7dZ1I7VZslhJxG2LZxNaF1rkpphZvFg Su+U8U/ODeY44Ulfs4anj6zSwIHGZplg25ztHiJxD1EhNcdgn+ClGmXwgYK8h6Caei8z 7S173LTYTgx8hLrqkEx3iWXEmS3D+iSkULJTw1OBm8jDYFo79KG5Z+yYVJMA5In8a2GX MB1DtFsvA6LFbjCoyDyFx4PmfC3B9nrZXDabGcSI/KcNLn3BDFKZZRvUg+UEEwWoDup+ 0AnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736444360; x=1737049160; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6KsRQIc1JxQBezEIVdfkOzKqKFxNDLhEnsfcwp5vSS0=; b=Hk32ZnsaKXwPvKfgWWYUtNJ5wXYQdOl46K8oYrvmxCvoQXggPAuFzEuX/a6/tWskhU EOqNHK3xIdaSfAOvwK8MnSt3aiakGwZVKm+ONCNWD4tUtwgRzeiB1/0l1Smav0WBoFdF u//w5S4f2ZXQebAJr+UBcBL5LU56yd8uEe+ANPzBcAGBTNd5JL/zgkG0rwjyQTEh0w9b q5N5YUxIpwr/mHwZGct0KvcWpxigydiSk4bxULz/dYSdGr+3AaHWEX60dhn7QwqffiJm d/yV7CKj90/Nx9soTfPTWdPYMn/pG24UevUGbDuZ2aAzaOXwTG5UAkZIkGKvt+7QoSG+ UCXQ== X-Forwarded-Encrypted: i=1; AJvYcCUMZ4gM4lPl5CU7S/bGNNGp7xCSzISOFhFaZtLczt0G3UTFFdAhmQoPIQs2eSl2RqEKKZwBX4BQDM8=@xdp-project.net X-Gm-Message-State: AOJu0Yw6GD/VD/e2cFaTkPvI0ynafxnrygofDwLmUOiegKu61lvSKlfE oc2ZSb3yJuobq2edbsfBhS3DmqiWg91GBOzF3Q1/7+K+23HMf/Y= X-Gm-Gg: ASbGncvJRGQqbsWQJKE5z0tMbRwyF0MvY1cGtA/sYa51Ta2Yf5b87Lnn/DaR5Pc/nBp nYCjz6w6C2DLWYnj3chZPQvbUGccIs6uX05trjObT8bMQ3v1oTK0Y2NAZhuBpQd0ZKaZA6pmszd /K+jT1yuiaA9QQU6eH7q93O2KesYF5KX6BPkNSJw2PmgC/nBmx1sNmiibjHBZTTfymylzMpJ/nw sF5uzbM6BjQmIYWdskq/iPaISbjsuG2SVMVwZt7eIIGK0ERnfblW9EH X-Google-Smtp-Source: AGHT+IEOsPd8gi8EzkqvvII6DaS7kpXwJUDoEvR9sz6x99GD7Aypk+y99jv+WqRaCxVsNJdjbVm5kQ== X-Received: by 2002:a17:902:d2ca:b0:216:56d5:d87 with SMTP id d9443c01a7336-21a83f8ea52mr112422135ad.34.1736444360267; Thu, 09 Jan 2025 09:39:20 -0800 (PST) Received: from localhost ([2601:646:9e00:f56e:123b:cea3:439a:b3e3]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f22f051sm516575ad.203.2025.01.09.09.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:39:19 -0800 (PST) Date: Thu, 9 Jan 2025 09:39:19 -0800 From: Stanislav Fomichev To: "Song, Yoong Siang" Message-ID: References: <20250106135658.9734-1-yoong.siang.song@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Message-ID-Hash: TSFR2O6RFSHUXDOXOIBMFESR6H3HFR46 X-Message-ID-Hash: TSFR2O6RFSHUXDOXOIBMFESR6H3HFR46 X-MailFrom: stfomichev@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Willem de Bruijn , "Bezdeka, Florian" , Donald Hunter , Jonathan Corbet , Bjorn Topel , "Karlsson, Magnus" , "Fijalkowski, Maciej" , Jonathan Lemon , Andrew Lunn , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , "Damato, Joe" , Stanislav Fomichev , Xuan Zhuo , Mina Almasry , Daniel Jurgens , Amritha Nambiar , Andrii Nakryiko , Eduard Zingerman , Mykola Lysenko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Hao Luo , Jiri Olsa , Shuah Khan , Alexandre Torgue , Jose Abreu , Maxime Coquelin , "Nguyen, Anthony L" , "Kitszel, Przemyslaw" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" , "bpf@vger.kernel.org" , "linux-kselftest@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , "intel-wired-lan@lists.osuosl.org" , "xdp-hints@xdp-project.net" X-Mailman-Version: 3.3.10 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v4 3/4] net: stmmac: Add launch time support to XDP ZC List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 01/09, Song, Yoong Siang wrote: > On Wednesday, January 8, 2025 1:08 AM, Stanislav Fomichev wrote: > >On 01/06, Song Yoong Siang wrote: > >> Enable launch time (Time-Based Scheduling) support to XDP zero copy via XDP > >> Tx metadata framework. > >> > >> This patch is tested with tools/testing/selftests/bpf/xdp_hw_metadata on > >> Intel Tiger Lake platform. Below are the test steps and result. > >> > >> Test Steps: > >> 1. Add mqprio qdisc: > >> $ sudo tc qdisc add dev enp0s30f4 handle 8001: parent root mqprio num_tc > >> 4 map 0 1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 queues 1@0 1@1 1@2 1@3 hw 0 > >> > >> 2. Enable launch time hardware offload on hardware queue 1: > >> $ sudo tc qdisc replace dev enp0s30f4 parent 8001:2 etf offload clockid > >> CLOCK_TAI delta 500000 > >> > >> 3. Add an ingress qdisc: > >> $ sudo tc qdisc add dev enp0s30f4 ingress > >> > >> 4. Add a flower filter to route incoming packet with VLAN priority 1 into > >> hardware queue 1: > >> $ sudo tc filter add dev enp0s30f4 parent ffff: protocol 802.1Q flower > >> vlan_prio 1 hw_tc 1 > >> > >> 5. Enable VLAN tag stripping: > >> $ sudo ethtool -K enp0s30f4 rxvlan on > >> > >> 6. Start xdp_hw_metadata selftest application: > >> $ sudo ./xdp_hw_metadata enp0s30f4 -l 1000000000 > >> > >> 7. Send an UDP packet with VLAN priority 1 to port 9091 of DUT. > > > >Tangential: I wonder whether we can add the setup steps to the > >xdp_hw_metadata tool? It is useful to have one command to run that > >takes care of all the details. Same way it already enables HW > >tstamping.. > > > >Or, if not the full setup, some kind of detection we can signal to the > >user that some things might be missing? > > Sure. I can try to add the setup steps into xdp_hw_metadata > by using ioctl() function. However, there are some device specific > command, like the number of queue, their priority, > how they route the incoming packet, etc. I will try to find out > a common way that can work for most of the devices, > at least work for both igc and stmmac. We can query the number of queues (and everything else you need) in the tool, similar to what we do in testing/selftests/drivers/net/hw/ncdevmem.c, take a look. But if it's too complicated, maybe at least print these commands on startup and tell the user to run them. The reason I'm asking is that I hope that we eventually can run this tool from (automatic) testing/selftests/drivers/net/hw testsuite to make sure the metadata stuff keeps working.