All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Song Yoong Siang <yoong.siang.song@intel.com>,
	 Jesse Brandeburg <jesse.brandeburg@intel.com>,
	 Tony Nguyen <anthony.l.nguyen@intel.com>,
	 "David S . Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,
	 Richard Cochran <richardcochran@gmail.com>,
	 Alexei Starovoitov <ast@kernel.org>,
	 Daniel Borkmann <daniel@iogearbox.net>,
	 Jesper Dangaard Brouer <hawk@kernel.org>,
	 John Fastabend <john.fastabend@gmail.com>,
	 Stanislav Fomichev <sdf@google.com>,
	 Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	 Florian Bezdeka <florian.bezdeka@siemens.com>,
	 Andrii Nakryiko <andrii@kernel.org>,
	 Eduard Zingerman <eddyz87@gmail.com>,
	 Mykola Lysenko <mykolal@fb.com>,
	 Martin KaFai Lau <martin.lau@linux.dev>,
	 Song Liu <song@kernel.org>,
	 Yonghong Song <yonghong.song@linux.dev>,
	 KP Singh <kpsingh@kernel.org>,  Hao Luo <haoluo@google.com>,
	 Jiri Olsa <jolsa@kernel.org>,  Shuah Khan <shuah@kernel.org>
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: RE: [PATCH iwl-next,v2 1/2] selftests/bpf: xdp_hw_metadata reduce sleep interval
Date: Fri, 01 Mar 2024 09:23:57 -0800	[thread overview]
Message-ID: <65e20f2d314bd_5dcfe20857@john.notmuch> (raw)
In-Reply-To: <20240301162348.898619-2-yoong.siang.song@intel.com>

Song Yoong Siang wrote:
> 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 <yoong.siang.song@intel.com>
> ---
>  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
> 

Acked-by: John Fastabend <john.fastabend@gmail.com>

WARNING: multiple messages have this Message-ID (diff)
From: John Fastabend <john.fastabend@gmail.com>
To: Song Yoong Siang <yoong.siang.song@intel.com>,
	 Jesse Brandeburg <jesse.brandeburg@intel.com>,
	 Tony Nguyen <anthony.l.nguyen@intel.com>,
	 "David S . Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,
	 Richard Cochran <richardcochran@gmail.com>,
	 Alexei Starovoitov <ast@kernel.org>,
	 Daniel Borkmann <daniel@iogearbox.net>,
	 Jesper Dangaard Brouer <hawk@kernel.org>,
	 John Fastabend <john.fastabend@gmail.com>,
	 Stanislav Fomichev <sdf@google.com>,
	 Vinicius Costa Gomes <vinicius.gomes@intel.com>,
	 Florian Bezdeka <florian.bezdeka@siemens.com>,
	 Andrii Nakryiko <andrii@kernel.org>,
	 Eduard Zingerman <eddyz87@gmail.com>,
	Mykola Lysenko <mykolal@fb.com>,
	 Martin KaFai Lau <martin.lau@linux.dev>,
	Song Liu <song@kernel.org>,
	 Yonghong Song <yonghong.song@linux.dev>,
	KP Singh <kpsingh@kernel.org>,  Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>,  Shuah Khan <shuah@kernel.org>
Cc: xdp-hints@xdp-project.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org,
	linux-kselftest@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [Intel-wired-lan] [PATCH iwl-next, v2 1/2] selftests/bpf: xdp_hw_metadata reduce sleep interval
Date: Fri, 01 Mar 2024 09:23:57 -0800	[thread overview]
Message-ID: <65e20f2d314bd_5dcfe20857@john.notmuch> (raw)
In-Reply-To: <20240301162348.898619-2-yoong.siang.song@intel.com>

Song Yoong Siang wrote:
> 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 <yoong.siang.song@intel.com>
> ---
>  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
> 

Acked-by: John Fastabend <john.fastabend@gmail.com>

  reply	other threads:[~2024-03-01 17:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 16:23 [PATCH iwl-next,v2 0/2] XDP Tx Hardware Timestamp for igc driver Song Yoong Siang
2024-03-01 16:23 ` [Intel-wired-lan] [PATCH iwl-next, v2 " Song Yoong Siang
2024-03-01 16:23 ` [PATCH iwl-next,v2 1/2] selftests/bpf: xdp_hw_metadata reduce sleep interval Song Yoong Siang
2024-03-01 16:23   ` [Intel-wired-lan] [PATCH iwl-next, v2 " Song Yoong Siang
2024-03-01 17:23   ` John Fastabend [this message]
2024-03-01 17:23     ` John Fastabend
2024-03-01 18:10   ` [PATCH iwl-next,v2 " Stanislav Fomichev
2024-03-01 18:10     ` [Intel-wired-lan] [PATCH iwl-next, v2 " Stanislav Fomichev
2024-03-01 16:23 ` [PATCH iwl-next,v2 2/2] igc: Add Tx hardware timestamp request for AF_XDP zero-copy packet Song Yoong Siang
2024-03-01 16:23   ` [Intel-wired-lan] [PATCH iwl-next, v2 " Song Yoong Siang
2024-03-01 17:54   ` [PATCH iwl-next,v2 " John Fastabend
2024-03-01 17:54     ` [Intel-wired-lan] [PATCH iwl-next, v2 " John Fastabend
2024-03-02  4:04     ` [PATCH iwl-next,v2 " Song, Yoong Siang
2024-03-02  4:04       ` [Intel-wired-lan] [PATCH iwl-next, v2 " Song, Yoong Siang
2024-03-03  1:58       ` [PATCH iwl-next,v2 " John Fastabend
2024-03-03  1:58         ` [Intel-wired-lan] [PATCH iwl-next, v2 " John Fastabend
2024-03-03  7:15         ` [PATCH iwl-next,v2 " Song, Yoong Siang
2024-03-03  7:15           ` [Intel-wired-lan] [PATCH iwl-next, v2 " Song, Yoong Siang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65e20f2d314bd_5dcfe20857@john.notmuch \
    --to=john.fastabend@gmail.com \
    --cc=andrii@kernel.org \
    --cc=anthony.l.nguyen@intel.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@google.com \
    --cc=florian.bezdeka@siemens.com \
    --cc=haoluo@google.com \
    --cc=hawk@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mykolal@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=sdf@google.com \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=vinicius.gomes@intel.com \
    --cc=xdp-hints@xdp-project.net \
    --cc=yonghong.song@linux.dev \
    --cc=yoong.siang.song@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.