netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net-next] selftests: devmem: configure HDS threshold
@ 2025-07-02 10:42 Taehee Yoo
  2025-07-02 15:37 ` Stanislav Fomichev
  2025-07-02 18:39 ` Jakub Kicinski
  0 siblings, 2 replies; 8+ messages in thread
From: Taehee Yoo @ 2025-07-02 10:42 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, shuah, almasrymina,
	sdf, jdamato, netdev, linux-kselftest
  Cc: ap420073

The devmem TCP requires the hds-thresh value to be 0, but it doesn't
change it automatically.
Therefore, make configure_headersplit() sets hds-thresh value to 0.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
---

v2:
 - Do not implement configure_hds_thresh().
 - Make configure_headersplit() sets hds-thresh to 0.

 tools/testing/selftests/drivers/net/hw/ncdevmem.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/drivers/net/hw/ncdevmem.c b/tools/testing/selftests/drivers/net/hw/ncdevmem.c
index cc9b40d9c5d5..52b72de11e3b 100644
--- a/tools/testing/selftests/drivers/net/hw/ncdevmem.c
+++ b/tools/testing/selftests/drivers/net/hw/ncdevmem.c
@@ -331,6 +331,12 @@ static int configure_headersplit(bool on)
 	ret = ethtool_rings_set(ys, req);
 	if (ret < 0)
 		fprintf(stderr, "YNL failed: %s\n", ys->err.msg);
+	if (on) {
+		ethtool_rings_set_req_set_hds_thresh(req, 0);
+		ret = ethtool_rings_set(ys, req);
+		if (ret < 0)
+			fprintf(stderr, "YNL failed: %s\n", ys->err.msg);
+	}
 	ethtool_rings_set_req_free(req);
 
 	if (ret == 0) {
@@ -338,9 +344,12 @@ static int configure_headersplit(bool on)
 		ethtool_rings_get_req_set_header_dev_index(get_req, ifindex);
 		get_rsp = ethtool_rings_get(ys, get_req);
 		ethtool_rings_get_req_free(get_req);
-		if (get_rsp)
+		if (get_rsp) {
 			fprintf(stderr, "TCP header split: %s\n",
 				tcp_data_split_str(get_rsp->tcp_data_split));
+			fprintf(stderr, "HDS threshold: %u\n",
+				get_rsp->hds_thresh);
+		}
 		ethtool_rings_get_rsp_free(get_rsp);
 	}
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 net-next] selftests: devmem: configure HDS threshold
  2025-07-02 10:42 [PATCH v2 net-next] selftests: devmem: configure HDS threshold Taehee Yoo
@ 2025-07-02 15:37 ` Stanislav Fomichev
  2025-07-02 16:12   ` Taehee Yoo
  2025-07-02 18:39 ` Jakub Kicinski
  1 sibling, 1 reply; 8+ messages in thread
From: Stanislav Fomichev @ 2025-07-02 15:37 UTC (permalink / raw)
  To: Taehee Yoo
  Cc: davem, kuba, pabeni, edumazet, andrew+netdev, shuah, almasrymina,
	sdf, jdamato, netdev, linux-kselftest

On 07/02, Taehee Yoo wrote:
> The devmem TCP requires the hds-thresh value to be 0, but it doesn't
> change it automatically.
> Therefore, make configure_headersplit() sets hds-thresh value to 0.
> 
> Signed-off-by: Taehee Yoo <ap420073@gmail.com>
> ---
> 
> v2:
>  - Do not implement configure_hds_thresh().
>  - Make configure_headersplit() sets hds-thresh to 0.
> 
>  tools/testing/selftests/drivers/net/hw/ncdevmem.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/drivers/net/hw/ncdevmem.c b/tools/testing/selftests/drivers/net/hw/ncdevmem.c
> index cc9b40d9c5d5..52b72de11e3b 100644
> --- a/tools/testing/selftests/drivers/net/hw/ncdevmem.c
> +++ b/tools/testing/selftests/drivers/net/hw/ncdevmem.c
> @@ -331,6 +331,12 @@ static int configure_headersplit(bool on)
>  	ret = ethtool_rings_set(ys, req);
>  	if (ret < 0)
>  		fprintf(stderr, "YNL failed: %s\n", ys->err.msg);
> +	if (on) {
> +		ethtool_rings_set_req_set_hds_thresh(req, 0);
> +		ret = ethtool_rings_set(ys, req);

Why call ethtool_rings_set again here? Can we move ethtool_rings_set_req_set_hds_thresh
to be after ethtool_rings_set_req_set_tcp_data_split ?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 net-next] selftests: devmem: configure HDS threshold
  2025-07-02 15:37 ` Stanislav Fomichev
@ 2025-07-02 16:12   ` Taehee Yoo
  2025-07-03 15:41     ` Stanislav Fomichev
  0 siblings, 1 reply; 8+ messages in thread
From: Taehee Yoo @ 2025-07-02 16:12 UTC (permalink / raw)
  To: Stanislav Fomichev
  Cc: davem, kuba, pabeni, edumazet, andrew+netdev, shuah, almasrymina,
	sdf, jdamato, netdev, linux-kselftest

On Thu, Jul 3, 2025 at 12:37 AM Stanislav Fomichev <stfomichev@gmail.com> wrote:
>

Hi Stanislav,
Thanks a lot for your review!

> On 07/02, Taehee Yoo wrote:
> > The devmem TCP requires the hds-thresh value to be 0, but it doesn't
> > change it automatically.
> > Therefore, make configure_headersplit() sets hds-thresh value to 0.
> >
> > Signed-off-by: Taehee Yoo <ap420073@gmail.com>
> > ---
> >
> > v2:
> >  - Do not implement configure_hds_thresh().
> >  - Make configure_headersplit() sets hds-thresh to 0.
> >
> >  tools/testing/selftests/drivers/net/hw/ncdevmem.c | 11 ++++++++++-
> >  1 file changed, 10 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/drivers/net/hw/ncdevmem.c b/tools/testing/selftests/drivers/net/hw/ncdevmem.c
> > index cc9b40d9c5d5..52b72de11e3b 100644
> > --- a/tools/testing/selftests/drivers/net/hw/ncdevmem.c
> > +++ b/tools/testing/selftests/drivers/net/hw/ncdevmem.c
> > @@ -331,6 +331,12 @@ static int configure_headersplit(bool on)
> >       ret = ethtool_rings_set(ys, req);
> >       if (ret < 0)
> >               fprintf(stderr, "YNL failed: %s\n", ys->err.msg);
> > +     if (on) {
> > +             ethtool_rings_set_req_set_hds_thresh(req, 0);
> > +             ret = ethtool_rings_set(ys, req);
>
> Why call ethtool_rings_set again here? Can we move ethtool_rings_set_req_set_hds_thresh
> to be after ethtool_rings_set_req_set_tcp_data_split ?

I think tcp-data-split will fail if a driver doesn't support
hds-thresh, even if it supports tcp-data-split.
So, I separated them.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 net-next] selftests: devmem: configure HDS threshold
  2025-07-02 10:42 [PATCH v2 net-next] selftests: devmem: configure HDS threshold Taehee Yoo
  2025-07-02 15:37 ` Stanislav Fomichev
@ 2025-07-02 18:39 ` Jakub Kicinski
  2025-07-03  3:51   ` Taehee Yoo
  2025-07-07 18:48   ` Mina Almasry
  1 sibling, 2 replies; 8+ messages in thread
From: Jakub Kicinski @ 2025-07-02 18:39 UTC (permalink / raw)
  To: Taehee Yoo
  Cc: davem, pabeni, edumazet, andrew+netdev, shuah, almasrymina, sdf,
	jdamato, netdev, linux-kselftest

On Wed,  2 Jul 2025 10:42:49 +0000 Taehee Yoo wrote:
> The devmem TCP requires the hds-thresh value to be 0, but it doesn't
> change it automatically.
> Therefore, make configure_headersplit() sets hds-thresh value to 0.

I don't see any undoing of the configuration :(
The selftest should leave the system in the state that it started.
We should either add some code to undo at shutdown or (preferably)
move the logic to the Python script where we can handle this more
cleanly with defer().
-- 
pw-bot: cr

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 net-next] selftests: devmem: configure HDS threshold
  2025-07-02 18:39 ` Jakub Kicinski
@ 2025-07-03  3:51   ` Taehee Yoo
  2025-07-07 18:48   ` Mina Almasry
  1 sibling, 0 replies; 8+ messages in thread
From: Taehee Yoo @ 2025-07-03  3:51 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: davem, pabeni, edumazet, andrew+netdev, shuah, almasrymina, sdf,
	jdamato, netdev, linux-kselftest

On Thu, Jul 3, 2025 at 3:39 AM Jakub Kicinski <kuba@kernel.org> wrote:
>

Hi Jakub,
Thanks a lot for your review!

> On Wed,  2 Jul 2025 10:42:49 +0000 Taehee Yoo wrote:
> > The devmem TCP requires the hds-thresh value to be 0, but it doesn't
> > change it automatically.
> > Therefore, make configure_headersplit() sets hds-thresh value to 0.
>
> I don't see any undoing of the configuration :(
> The selftest should leave the system in the state that it started.
> We should either add some code to undo at shutdown or (preferably)
> move the logic to the Python script where we can handle this more
> cleanly with defer().

Okay, I understand it.
I will fix this in the next version.

Thanks a lot!
Taehee Yoo

> --
> pw-bot: cr

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 net-next] selftests: devmem: configure HDS threshold
  2025-07-02 16:12   ` Taehee Yoo
@ 2025-07-03 15:41     ` Stanislav Fomichev
  0 siblings, 0 replies; 8+ messages in thread
From: Stanislav Fomichev @ 2025-07-03 15:41 UTC (permalink / raw)
  To: Taehee Yoo
  Cc: davem, kuba, pabeni, edumazet, andrew+netdev, shuah, almasrymina,
	sdf, jdamato, netdev, linux-kselftest

On 07/03, Taehee Yoo wrote:
> On Thu, Jul 3, 2025 at 12:37 AM Stanislav Fomichev <stfomichev@gmail.com> wrote:
> >
> 
> Hi Stanislav,
> Thanks a lot for your review!
> 
> > On 07/02, Taehee Yoo wrote:
> > > The devmem TCP requires the hds-thresh value to be 0, but it doesn't
> > > change it automatically.
> > > Therefore, make configure_headersplit() sets hds-thresh value to 0.
> > >
> > > Signed-off-by: Taehee Yoo <ap420073@gmail.com>
> > > ---
> > >
> > > v2:
> > >  - Do not implement configure_hds_thresh().
> > >  - Make configure_headersplit() sets hds-thresh to 0.
> > >
> > >  tools/testing/selftests/drivers/net/hw/ncdevmem.c | 11 ++++++++++-
> > >  1 file changed, 10 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/tools/testing/selftests/drivers/net/hw/ncdevmem.c b/tools/testing/selftests/drivers/net/hw/ncdevmem.c
> > > index cc9b40d9c5d5..52b72de11e3b 100644
> > > --- a/tools/testing/selftests/drivers/net/hw/ncdevmem.c
> > > +++ b/tools/testing/selftests/drivers/net/hw/ncdevmem.c
> > > @@ -331,6 +331,12 @@ static int configure_headersplit(bool on)
> > >       ret = ethtool_rings_set(ys, req);
> > >       if (ret < 0)
> > >               fprintf(stderr, "YNL failed: %s\n", ys->err.msg);
> > > +     if (on) {
> > > +             ethtool_rings_set_req_set_hds_thresh(req, 0);
> > > +             ret = ethtool_rings_set(ys, req);
> >
> > Why call ethtool_rings_set again here? Can we move ethtool_rings_set_req_set_hds_thresh
> > to be after ethtool_rings_set_req_set_tcp_data_split ?
> 
> I think tcp-data-split will fail if a driver doesn't support
> hds-thresh, even if it supports tcp-data-split.
> So, I separated them.

Sorry for going back and forth on this, but in this case your v1 is
better (maybe improve it by not printing an error for 'not supported'
errno). And will probably better be suited for Jakub's suggestion of
adding undo.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 net-next] selftests: devmem: configure HDS threshold
  2025-07-02 18:39 ` Jakub Kicinski
  2025-07-03  3:51   ` Taehee Yoo
@ 2025-07-07 18:48   ` Mina Almasry
  2025-07-07 20:10     ` Jakub Kicinski
  1 sibling, 1 reply; 8+ messages in thread
From: Mina Almasry @ 2025-07-07 18:48 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Taehee Yoo, davem, pabeni, edumazet, andrew+netdev, shuah, sdf,
	jdamato, netdev, linux-kselftest

On Wed, Jul 2, 2025 at 11:39 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Wed,  2 Jul 2025 10:42:49 +0000 Taehee Yoo wrote:
> > The devmem TCP requires the hds-thresh value to be 0, but it doesn't
> > change it automatically.
> > Therefore, make configure_headersplit() sets hds-thresh value to 0.
>
> I don't see any undoing of the configuration :(
> The selftest should leave the system in the state that it started.
> We should either add some code to undo at shutdown or (preferably)
> move the logic to the Python script where we can handle this more
> cleanly with defer().

I'm sure you're aware but this test in general doesn't aim to undo any
of it's configuration AFAIR :( that includes ethtool tcp-data-split,
-X, -N and -L. Sorry about that.

I wonder if you want this series to clean that up completely such that
all configurations are cleaned up, or if you're asking Taehee to only
clean up the hds-thres configuration for now.

Also, sorry for the late reply, but FWIW, I prefer the configuration
cleanup to be in ncdevmem itself. We use it outside of the ksft to run
stress tests, and folks are going to copy-paste ncdevmem for their
applications, so having it be as nice as possible is a plus. But if
you feel strongly about doing this outside of ncdevmem.c itself I
don't mind that much.

--
Thanks,
Mina

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 net-next] selftests: devmem: configure HDS threshold
  2025-07-07 18:48   ` Mina Almasry
@ 2025-07-07 20:10     ` Jakub Kicinski
  0 siblings, 0 replies; 8+ messages in thread
From: Jakub Kicinski @ 2025-07-07 20:10 UTC (permalink / raw)
  To: Mina Almasry
  Cc: Taehee Yoo, davem, pabeni, edumazet, andrew+netdev, shuah, sdf,
	jdamato, netdev, linux-kselftest

On Mon, 7 Jul 2025 11:48:53 -0700 Mina Almasry wrote:
> > On Wed,  2 Jul 2025 10:42:49 +0000 Taehee Yoo wrote:  
> > > The devmem TCP requires the hds-thresh value to be 0, but it doesn't
> > > change it automatically.
> > > Therefore, make configure_headersplit() sets hds-thresh value to 0.  
> >
> > I don't see any undoing of the configuration :(
> > The selftest should leave the system in the state that it started.
> > We should either add some code to undo at shutdown or (preferably)
> > move the logic to the Python script where we can handle this more
> > cleanly with defer().  
> 
> I'm sure you're aware but this test in general doesn't aim to undo any
> of it's configuration AFAIR :( that includes ethtool tcp-data-split,
> -X, -N and -L. Sorry about that.
> 
> I wonder if you want this series to clean that up completely such that
> all configurations are cleaned up, or if you're asking Taehee to only
> clean up the hds-thres configuration for now.

Just the hds-thrs config for now. Avoid adding more problems.

> Also, sorry for the late reply, but FWIW, I prefer the configuration
> cleanup to be in ncdevmem itself. We use it outside of the ksft to run
> stress tests, and folks are going to copy-paste ncdevmem for their
> applications, so having it be as nice as possible is a plus. But if
> you feel strongly about doing this outside of ncdevmem.c itself I
> don't mind that much.

Stan & Bobby added devmem support to kperf I think that's a better
choice for stress testing: https://github.com/facebookexperimental/kperf
selftests are for testing the kernel, in the context of upstream CIs.
The experience with netdevsim teaches me that having "out of tree"
use cases as an explicit goal is a road to nowhere.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-07-07 20:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02 10:42 [PATCH v2 net-next] selftests: devmem: configure HDS threshold Taehee Yoo
2025-07-02 15:37 ` Stanislav Fomichev
2025-07-02 16:12   ` Taehee Yoo
2025-07-03 15:41     ` Stanislav Fomichev
2025-07-02 18:39 ` Jakub Kicinski
2025-07-03  3:51   ` Taehee Yoo
2025-07-07 18:48   ` Mina Almasry
2025-07-07 20:10     ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).