From patchwork Sun Mar 3 08:32:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Song, Yoong Siang" X-Patchwork-Id: 777673 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F9BAB669; Sun, 3 Mar 2024 08:32:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709454781; cv=none; b=E03YZpTOVyNG1/EeahePB+i8rjxxoMe9UMjwEpkMSrmuZe/5YYFYViKYycaxuyPC5J/tmus8QVUpo6EksOxfb4pclnhw3pJSgscWZjstfbYV043eLD8iAADY/rcItYK2qxrhIRUr7HBrCVyRjXkW7p6+BbzX6ipiFeMxvislbUw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709454781; c=relaxed/simple; bh=a9Icqs4XaEB3VNC9uusOctcAw+EqQqaKssugc4WBFfg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hsMDPjp0YyM9qcY+YzR6A7yh/0KEH65ha+AHI1Rqwr7TldcVESZjOfsnSaNYjnXNRNkPZnl3YcI6SEA3uAWbeFilSHpwKIy8LwaDBQI1Tf1XdGmlC35Rr/otVr4CkPKHRWllYJDdO8r7UdWWF+aW3GaYkZVtIWqarWl7ODFeYh4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=YV/uARH0; arc=none smtp.client-ip=198.175.65.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YV/uARH0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709454781; x=1740990781; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=a9Icqs4XaEB3VNC9uusOctcAw+EqQqaKssugc4WBFfg=; b=YV/uARH0MWswXqyHXzA7UOL046Ds+cx/OmnpjskvrvXfWKyMWtKGGyof PZBA0Vr3lPoAm482fV4fQlSFhjRTW3+YR/eRU+Khi7K91ZTEfR/VtQaBX s3zoulglSrVpxcvKyb/PqbWgk7jiIsqBrac27TfWDNLidXM9smy/LuHqo yu98JNK++vp6rT/wlrx8tDc0+NRosGmKPl1zBIK7vpQ1Kfsz9IOkJ+0R3 BvZmrpiy1+Hh/ev2NuGFOgfrVIkbiK26rZVr6MM7bZcsv6AQp9quAxKNv ID7u0qI4j1x8tFKq86U6j/AhCIXnJvw0yqSDoA/PGKV4prE/+MarZxl1i w==; X-IronPort-AV: E=McAfee;i="6600,9927,11001"; a="7769300" X-IronPort-AV: E=Sophos;i="6.06,200,1705392000"; d="scan'208";a="7769300" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2024 00:33:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,200,1705392000"; d="scan'208";a="13357189" Received: from p12ill20yoongsia.png.intel.com ([10.88.227.28]) by orviesa005.jf.intel.com with ESMTP; 03 Mar 2024 00:32:51 -0800 From: Song Yoong Siang To: Jesse Brandeburg , Tony Nguyen , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Vinicius Costa Gomes , Florian Bezdeka , Andrii Nakryiko , Eduard Zingerman , Mykola Lysenko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Hao Luo , Jiri Olsa , Shuah Khan Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, xdp-hints@xdp-project.net Subject: [PATCH iwl-next,v3 1/2] selftests/bpf: xdp_hw_metadata reduce sleep interval Date: Sun, 3 Mar 2024 16:32:24 +0800 Message-Id: <20240303083225.1184165-2-yoong.siang.song@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240303083225.1184165-1-yoong.siang.song@intel.com> References: <20240303083225.1184165-1-yoong.siang.song@intel.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In current ping-pong design, xdp_hw_metadata will wait until the packet transmition completely done, then only start to receive the next packet. The current sleep interval is 10ms, which is unnecessary large. Typically, a NIC does not need such a long time to transmit a packet. Furthermore, during this 10ms sleep time, the app is unable to receive incoming packets. Therefore, this commit reduce sleep interval to 10us, so that xdp_hw_metadata able to support periodic packets with shorter interval. 10us * 500 = 5ms should be enough for packet transmission and status retrival. Signed-off-by: Song Yoong Siang Acked-by: John Fastabend Acked-by: Stanislav Fomichev --- tools/testing/selftests/bpf/xdp_hw_metadata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/xdp_hw_metadata.c b/tools/testing/selftests/bpf/xdp_hw_metadata.c index 878d68db0325..bdf5d8180067 100644 --- a/tools/testing/selftests/bpf/xdp_hw_metadata.c +++ b/tools/testing/selftests/bpf/xdp_hw_metadata.c @@ -480,7 +480,7 @@ static int verify_metadata(struct xsk *rx_xsk, int rxq, int server_fd, clockid_t for (int j = 0; j < 500; j++) { if (complete_tx(xsk, clock_id)) break; - usleep(10*1000); + usleep(10); } } }