diff mbox series

[net-next,3/5] selftest: include dst-ip in ethtool ntuple rules

Message ID 8e5d23c8f21310c23c080cc7bcd31b76f8fd3096.1731499022.git.ecree.xilinx@gmail.com (mailing list archive)
State New
Headers show
Series net: make RSS+RXNFC semantics more explicit | expand

Commit Message

edward.cree@amd.com Nov. 13, 2024, 12:13 p.m. UTC
From: Edward Cree <ecree.xilinx@gmail.com>

sfc hardware does not support filters with only ipproto + dst-port;
 adding dst-ip to the flow spec allows the rss_ctx test to be run on
 these devices.

Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
---
I'm not sure if this change will break the test for other drivers that
perhaps support the old filter but not the new one.  If so we might
need to add an option to cfg to control this choice.

 tools/testing/selftests/drivers/net/hw/rss_ctx.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Martin Habets Nov. 14, 2024, 9:54 a.m. UTC | #1
On Wed, Nov 13, 2024 at 12:13:11PM +0000, edward.cree@amd.com wrote:
> 
> From: Edward Cree <ecree.xilinx@gmail.com>
> 
> sfc hardware does not support filters with only ipproto + dst-port;
>  adding dst-ip to the flow spec allows the rss_ctx test to be run on
>  these devices.
> 
> Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>

Reviewed-by: Martin Habets <habetsm.xilinx@gmail.com>

> ---
> I'm not sure if this change will break the test for other drivers that
> perhaps support the old filter but not the new one.  If so we might
> need to add an option to cfg to control this choice.
> 
>  tools/testing/selftests/drivers/net/hw/rss_ctx.py | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/testing/selftests/drivers/net/hw/rss_ctx.py b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> index 29995586993c..fb61dae20fd8 100755
> --- a/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> +++ b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> @@ -215,7 +215,7 @@ def test_rss_queue_reconfigure(cfg, main_ctx=True):
>          defer(ethtool, f"-X {cfg.ifname} default")
>      else:
>          other_key = 'noise'
> -        flow = f"flow-type tcp{cfg.addr_ipver} dst-port {port} context {ctx_id}"
> +        flow = f"flow-type tcp{cfg.addr_ipver} dst-ip {cfg.addr} dst-port {port} context {ctx_id}"
>          ntuple = ethtool_create(cfg, "-N", flow)
>          defer(ethtool, f"-N {cfg.ifname} delete {ntuple}")
>  
> @@ -429,7 +429,7 @@ def test_rss_context(cfg, ctx_cnt=1, create_with_cfg=None):
>          ksft_eq(max(data['rss-indirection-table']), 2 + i * 2 + 1, "Unexpected context cfg: " + str(data))
>  
>          ports.append(rand_port())
> -        flow = f"flow-type tcp{cfg.addr_ipver} dst-port {ports[i]} context {ctx_id}"
> +        flow = f"flow-type tcp{cfg.addr_ipver} dst-ip {cfg.addr} dst-port {ports[i]} context {ctx_id}"
>          ntuple = ethtool_create(cfg, "-N", flow)
>          defer(ethtool, f"-N {cfg.ifname} delete {ntuple}")
>  
> @@ -516,7 +516,7 @@ def test_rss_context_out_of_order(cfg, ctx_cnt=4):
>          ctx.append(defer(ethtool, f"-X {cfg.ifname} context {ctx_id} delete"))
>  
>          ports.append(rand_port())
> -        flow = f"flow-type tcp{cfg.addr_ipver} dst-port {ports[i]} context {ctx_id}"
> +        flow = f"flow-type tcp{cfg.addr_ipver} dst-ip {cfg.addr} dst-port {ports[i]} context {ctx_id}"
>          ntuple_id = ethtool_create(cfg, "-N", flow)
>          ntuple.append(defer(ethtool, f"-N {cfg.ifname} delete {ntuple_id}"))
>  
> @@ -569,7 +569,7 @@ def test_rss_context_overlap(cfg, other_ctx=0):
>  
>      port = rand_port()
>      if other_ctx:
> -        flow = f"flow-type tcp{cfg.addr_ipver} dst-port {port} context {other_ctx}"
> +        flow = f"flow-type tcp{cfg.addr_ipver} dst-ip {cfg.addr} dst-port {port} context {other_ctx}"
>          ntuple_id = ethtool_create(cfg, "-N", flow)
>          ntuple = defer(ethtool, f"-N {cfg.ifname} delete {ntuple_id}")
>  
> @@ -587,7 +587,7 @@ def test_rss_context_overlap(cfg, other_ctx=0):
>      # Now create a rule for context 1 and make sure traffic goes to a subset
>      if other_ctx:
>          ntuple.exec()
> -    flow = f"flow-type tcp{cfg.addr_ipver} dst-port {port} context {ctx_id}"
> +    flow = f"flow-type tcp{cfg.addr_ipver} dst-ip {cfg.addr} dst-port {port} context {ctx_id}"
>      ntuple_id = ethtool_create(cfg, "-N", flow)
>      defer(ethtool, f"-N {cfg.ifname} delete {ntuple_id}")
>  
> @@ -620,7 +620,7 @@ def test_delete_rss_context_busy(cfg):
>  
>      # utilize context from ntuple filter
>      port = rand_port()
> -    flow = f"flow-type tcp{cfg.addr_ipver} dst-port {port} context {ctx_id}"
> +    flow = f"flow-type tcp{cfg.addr_ipver} dst-ip {cfg.addr} dst-port {port} context {ctx_id}"
>      ntuple_id = ethtool_create(cfg, "-N", flow)
>      defer(ethtool, f"-N {cfg.ifname} delete {ntuple_id}")
>
diff mbox series

Patch

diff --git a/tools/testing/selftests/drivers/net/hw/rss_ctx.py b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
index 29995586993c..fb61dae20fd8 100755
--- a/tools/testing/selftests/drivers/net/hw/rss_ctx.py
+++ b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
@@ -215,7 +215,7 @@  def test_rss_queue_reconfigure(cfg, main_ctx=True):
         defer(ethtool, f"-X {cfg.ifname} default")
     else:
         other_key = 'noise'
-        flow = f"flow-type tcp{cfg.addr_ipver} dst-port {port} context {ctx_id}"
+        flow = f"flow-type tcp{cfg.addr_ipver} dst-ip {cfg.addr} dst-port {port} context {ctx_id}"
         ntuple = ethtool_create(cfg, "-N", flow)
         defer(ethtool, f"-N {cfg.ifname} delete {ntuple}")
 
@@ -429,7 +429,7 @@  def test_rss_context(cfg, ctx_cnt=1, create_with_cfg=None):
         ksft_eq(max(data['rss-indirection-table']), 2 + i * 2 + 1, "Unexpected context cfg: " + str(data))
 
         ports.append(rand_port())
-        flow = f"flow-type tcp{cfg.addr_ipver} dst-port {ports[i]} context {ctx_id}"
+        flow = f"flow-type tcp{cfg.addr_ipver} dst-ip {cfg.addr} dst-port {ports[i]} context {ctx_id}"
         ntuple = ethtool_create(cfg, "-N", flow)
         defer(ethtool, f"-N {cfg.ifname} delete {ntuple}")
 
@@ -516,7 +516,7 @@  def test_rss_context_out_of_order(cfg, ctx_cnt=4):
         ctx.append(defer(ethtool, f"-X {cfg.ifname} context {ctx_id} delete"))
 
         ports.append(rand_port())
-        flow = f"flow-type tcp{cfg.addr_ipver} dst-port {ports[i]} context {ctx_id}"
+        flow = f"flow-type tcp{cfg.addr_ipver} dst-ip {cfg.addr} dst-port {ports[i]} context {ctx_id}"
         ntuple_id = ethtool_create(cfg, "-N", flow)
         ntuple.append(defer(ethtool, f"-N {cfg.ifname} delete {ntuple_id}"))
 
@@ -569,7 +569,7 @@  def test_rss_context_overlap(cfg, other_ctx=0):
 
     port = rand_port()
     if other_ctx:
-        flow = f"flow-type tcp{cfg.addr_ipver} dst-port {port} context {other_ctx}"
+        flow = f"flow-type tcp{cfg.addr_ipver} dst-ip {cfg.addr} dst-port {port} context {other_ctx}"
         ntuple_id = ethtool_create(cfg, "-N", flow)
         ntuple = defer(ethtool, f"-N {cfg.ifname} delete {ntuple_id}")
 
@@ -587,7 +587,7 @@  def test_rss_context_overlap(cfg, other_ctx=0):
     # Now create a rule for context 1 and make sure traffic goes to a subset
     if other_ctx:
         ntuple.exec()
-    flow = f"flow-type tcp{cfg.addr_ipver} dst-port {port} context {ctx_id}"
+    flow = f"flow-type tcp{cfg.addr_ipver} dst-ip {cfg.addr} dst-port {port} context {ctx_id}"
     ntuple_id = ethtool_create(cfg, "-N", flow)
     defer(ethtool, f"-N {cfg.ifname} delete {ntuple_id}")
 
@@ -620,7 +620,7 @@  def test_delete_rss_context_busy(cfg):
 
     # utilize context from ntuple filter
     port = rand_port()
-    flow = f"flow-type tcp{cfg.addr_ipver} dst-port {port} context {ctx_id}"
+    flow = f"flow-type tcp{cfg.addr_ipver} dst-ip {cfg.addr} dst-port {port} context {ctx_id}"
     ntuple_id = ethtool_create(cfg, "-N", flow)
     defer(ethtool, f"-N {cfg.ifname} delete {ntuple_id}")