Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1234634lqg; Sun, 3 Mar 2024 00:33:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVfjFxdPuo/fGSsTRXKsNwTOv+nfRzm0DgEBYJSdx6c5/WQRUfP2LhCBc82WmJua+zUaPXO4Z79qyd/AaD/zGg5rDWdTxNg7XDv66tO/A== X-Google-Smtp-Source: AGHT+IEnB1dm0yn9Q9LvZEevbXaoZKscY8djCGOJU7+f/0cIou0JWCX8PxaCqB/RJypQupngDRJk X-Received: by 2002:a05:620a:102f:b0:788:18e2:8469 with SMTP id a15-20020a05620a102f00b0078818e28469mr4342394qkk.7.1709454806026; Sun, 03 Mar 2024 00:33:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709454806; cv=pass; d=google.com; s=arc-20160816; b=0xdz2Y1RmPY48NypgRYQUq4rb0ZF1amKtjocvKLqjNHg3I/hui4AMlVTsuvtTn/CxB LlPganTmznAZh6bp6ORrUAs9T0KkrR6KN7AHKmAvc7ePJ76odIcoT53ViYj1Pl2hB3fI 0bTg18y0qw17Mj1GUf88S86IYrWLasr6swZ+SfMDaFVZWyb7qbVLbkapHL7U4X+X7gek Jp9qGX5StxUkHv/3ArSpQLwOr6Jah2w/YWruIYTD6msk5X/xRJw8hUrPXjnup4t/mAo+ YtXNn/653jLHwB8jPVOVTE4F+e1m6N1h5mml4Rouwi9UyeLfEg+S8IA4KbZz9MmF88kG E1bw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=itaI91wisnjw/oyI7C1uWnGbyQZtJQnFpyk117k4zF0=; fh=r15o8TGgygM/m/65MoywoxrQbJATi7AWay2zD91j3j8=; b=CkW9K4kAEPtDSbDo3ZvXw6sne5ZKcvBXJd97E5cxW7y3otkmWwXRgvmY5YwHacZzTj yJyr8OGaiVGg/JJUm4tqqB+9XkeGys0uxt0Rjo4Akh7s86BDuIr4LsrKHBu0moGUswPU 614ka8fQmZktJZa+T4/D55d83egj7f7iH58RDBuULi4GnVlGYPnxmEHueSPbCoIOMUht FrtqAG+DQ/jR0vouc/6vvT8nYdY7sHXbk38E/6NlVg+F39zFBZNXGIgdeOTU2q8ue/xw zWTYk0NOAGhuQGzQYRazQaJqvDuVTZ03RJurcTF3wRo7Dv9x43jOj29IbC33K0imXHMG v/QA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="YV/uARH0"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-89675-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89675-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d24-20020a05620a205800b00787be694972si7214283qka.666.2024.03.03.00.33.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 00:33:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89675-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="YV/uARH0"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-89675-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89675-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BC9EC1C20C42 for ; Sun, 3 Mar 2024 08:33:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D018BBA26; Sun, 3 Mar 2024 08:33:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YV/uARH0" 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 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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); } } } -- 2.34.1