Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp401129lqg; Fri, 1 Mar 2024 08:30:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW9ZBTySGWbPS8kwGHeDiplAdT9EGCRzsBybeUSZHgXjY3pDm2uXMD72ZGuwhI2LbhCFqCItPcF0lgHuQR/1Erw+GQjnc5EPsKIB/azUw== X-Google-Smtp-Source: AGHT+IErY+E2KtoL1wFjDL46cCkNr7yafgbtEkwYlpm1yydIlrTwWawCDCqViciEf20Dda9BIE8T X-Received: by 2002:a17:90a:7e14:b0:29a:6b1d:4d32 with SMTP id i20-20020a17090a7e1400b0029a6b1d4d32mr2201458pjl.38.1709310619672; Fri, 01 Mar 2024 08:30:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709310619; cv=pass; d=google.com; s=arc-20160816; b=e2QLCqK8/DOVLLSOsP7JtvTN9Fz0zcQh2nG/RpKbwcVCsnGPSL5yJX/CWRyOUSWC51 gZrN6xaU9cUKtBx/gY9WYWj5OUmQn+DVQR4KYpzxxW+AhN5uHJp3KS9AnP9fpQC2tPS2 ab+qMfaD4tIxIKt2tOKHejmSJJ0F3FAJM8isRxbFmhV0Atf83z2vfvtOcxJr/urAbMPg vNx4ypBs1ntWhDEl+eT9/6MmsmqB2lgsNaNExskQkezQzI43/TYhLBftJPLDJR2a9fKY FAcB2cEFDoYdofoHYplYiupdjAHnLxJpN7UUQAysAIobH8vgHrdmUh0q6smVBxH5RwF2 +Wnw== 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=VmwqdqfYLNAWSIa9X6gV0SLbuMCABANcMNf8BZMPk/8=; fh=r15o8TGgygM/m/65MoywoxrQbJATi7AWay2zD91j3j8=; b=dGuGxcL577kG7MO1OwvCi5bgkYoP52pixL8KA1DG/Q+NYB8usxJZPXi1ZYkWDy+uyc 2uvTxbuUU44rIw/AoPV7JETuppKWye7hUycwHxOZU/Gati/aGmG3AcvJucquYRBcxGZf EpEg6M99JXIf/lqNs5qrFnYIXAtYlOpwoRZmRVQnbnxt4POaEdcHRLBWixJpn7jo1vqa iFlEHGUyIFQMtgcVlUN3nvcHINWBiNYsrVzua/8sDRmQAlnqmmAfvZwyF+gNZFzgheWO tKQSVkaQZEGQ5fKHwJxATmFQMM2EycI3aXrV96Y4IsJ4YcfLULpAHiLXp/vPZ7Q+Hrvw FFBQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gsfcyClN; 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-88693-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88693-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id hk16-20020a17090b225000b0029b162f0e1esi3144410pjb.171.2024.03.01.08.30.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 08:30:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88693-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=gsfcyClN; 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-88693-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88693-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9E9C3B24C41 for ; Fri, 1 Mar 2024 16:26:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 07C03745C9; Fri, 1 Mar 2024 16:24:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="gsfcyClN" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 A296874267; Fri, 1 Mar 2024 16:24:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709310279; cv=none; b=l1etIH+qz2J0GMY1CDvZSOeovonr9dEjHnqg26YfcZw9UEY2E2gwIT3MosGVilnjlYUt8HqQoB7c8qkGYZYndEvIJqWoGNBJQqpl3405uByVw0mgYHAod/IFx/yayN6FCSU9kynSzSqZu6sNHxKqvL7/zDUs/pbp+CRN1PhieEc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709310279; c=relaxed/simple; bh=eIZMwz94SXNchV9CIz2BNTuvEAHotx8FG/pnszibmd8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u+bDOSbYpl2x7+PFcQ3LgAxa2HWk6IhzZ+8mZfvP8LhAHHcrNWhP93xrq7EyN1rD7w9R+uW7lUobSrFqcJL7Rzv3RYImVXxQwjbvnl40P0FkgzVjuPX+YkERksb3lZKch0Q7gKTkWlYUs5yUxtzNuEiW9K/IA1fCmIuXudoV0mg= 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=gsfcyClN; arc=none smtp.client-ip=198.175.65.15 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=1709310278; x=1740846278; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eIZMwz94SXNchV9CIz2BNTuvEAHotx8FG/pnszibmd8=; b=gsfcyClNsyvfDIUj0udiK+uY+kr7csIxXogSOoZWIwX/Lf8rwNW/e04J 5MvlyoSQBnciUnbUezwuyZJoSbL3wq+bV8pBm1ITsaOK+/rwsShWDK7gY xsmg9Re9A083t0FeL3hMJIdmFWmNnEGfeta31kHlE2ctddmL2RMGqPITZ wmS8jY35j8445bx8LZGuUxaJGt6ekDf4TfYKYFMs0t0Iao97JRU1nDH81 AeyJS4sHxcL5fMyYZmZsPo+o9za/DnkjuJu04qYFVfATD8FGBDSDhpAxB VzY/2VWDxW7j8/nAM3xgbHXtDz7II8ChOcdRwmMzTsh0l3//URlT+4X/h g==; X-IronPort-AV: E=McAfee;i="6600,9927,11000"; a="7673273" X-IronPort-AV: E=Sophos;i="6.06,196,1705392000"; d="scan'208";a="7673273" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2024 08:24:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,196,1705392000"; d="scan'208";a="8139571" Received: from p12ill20yoongsia.png.intel.com ([10.88.227.28]) by fmviesa007.fm.intel.com with ESMTP; 01 Mar 2024 08:24:30 -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,v2 1/2] selftests/bpf: xdp_hw_metadata reduce sleep interval Date: Sat, 2 Mar 2024 00:23:47 +0800 Message-Id: <20240301162348.898619-2-yoong.siang.song@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240301162348.898619-1-yoong.siang.song@intel.com> References: <20240301162348.898619-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 --- 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