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); }
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 ?
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.
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.
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().
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
linux-kselftest-mirror@lists.linaro.org