dts: add blocklist test suite
cover dts: add blocklist test suite
Hello,
sending in an re-implementation of the blocklist test suite. This new version slightly differs in the way it verifies if a NIC was blocked or not, but should be equivalent to the original from old DTS.
Best,
Luca
Luca Vizzarro (2):
dts: add blocked ports to EalParams
dts: add blocklist test suite
dts/framework/config/conf_yaml_schema.json | 3 +- dts/framework/params/eal.py | 6 +- dts/framework/params/types.py | 3 +- dts/framework/remote_session/dpdk_shell.py | 4 +- dts/framework/remote_session/testpmd_shell.py | 2 +- dts/tests/TestSuite_blocklist.py | 68 +++++++++++++++++++ 6 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 dts/tests/TestSuite_blocklist.py
Signature · 1 line
2.34.1
PATCH 1/2 dts: add blocked ports to EalParams
Make the "ports" attribute of EalParams as it actually is to "allowed_ports", and add "blocked_ports".
--- dts/framework/params/eal.py | 6 +++++- dts/framework/params/types.py | 3 ++- dts/framework/remote_session/dpdk_shell.py | 4 ++-- dts/framework/remote_session/testpmd_shell.py | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-)
dts/framework/params/eal.py +5 -1
@@ -42,9 +42,13 @@ class EalParams(Params): vdevs: list[VirtualDevice] | None = field( default=None, metadata=Params.multiple() | Params.long("vdev") ) - ports: list[Port] | None = field( + allowed_ports: list[Port] | None = field( default=None, metadata=Params.convert_value(_port_to_pci) | Params.multiple() | Params.short("a"), ) + blocked_ports: list[Port] | None = field( + default=None, + metadata=Params.convert_value(_port_to_pci) | Params.multiple() | Params.short("b"), + ) other_eal_param: Params | None = None _separator: Literal[True] = field(default=True, init=False, metadata=Params.short("-"))
dts/framework/params/types.py +2 -1
@@ -49,7 +49,8 @@ class EalParamsDict(TypedDict, total=False): prefix: str no_pci: Switch vdevs: list[VirtualDevice] | None - ports: list[Port] | None + allowed_ports: list[Port] | None + blocked_ports: list[Port] | None other_eal_param: Params | None
dts/framework/remote_session/dpdk_shell.py +2 -2
@@ -54,8 +54,8 @@ def compute_eal_params( sut_node.dpdk_prefix_list.append(prefix) params.prefix = prefix - if params.ports is None: - params.ports = sut_node.ports + if params.allowed_ports is None: + params.allowed_ports = sut_node.ports return params
dts/framework/remote_session/testpmd_shell.py +1 -1
@@ -638,7 +638,7 @@ def start(self, verify: bool = True) -> None: self._logger.debug(f"Failed to start packet forwarding: \n{start_cmd_output}") raise InteractiveCommandExecutionError("Testpmd failed to start packet forwarding.") - number_of_ports = len(self._app_params.ports or []) + number_of_ports = len(self._app_params.allowed_ports or []) for port_id in range(number_of_ports): if not self.wait_link_status_up(port_id): raise InteractiveCommandExecutionError(
Signature · 1 line
2.34.1
Re: [PATCH 1/2] dts: add blocked ports to EalParams
Quoted 6 lines · Luca Vizzarro
Make the "ports" attribute of EalParams as it actually is to "
allowed_ports", and add "blocked_ports".Signed-off-by Luca Vizzarro <[email protected]>Reviewed-by Paul Szczepanek <[email protected]>
Re: [PATCH 1/2] dts: add blocked ports to EalParams
In reply to Luca VizzarroPATCH 2/2 dts: add blocklist test suite
In reply to Luca VizzarroThis test suite tests the port blocklisting functionality built in testpmd.
--- dts/framework/config/conf_yaml_schema.json | 3 +- dts/tests/TestSuite_blocklist.py | 68 ++++++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 dts/tests/TestSuite_blocklist.py
dts/framework/config/conf_yaml_schema.json +2 -1
@@ -187,7 +187,8 @@ "enum": [ "hello_world", "os_udp", - "pmd_buffer_scatter" + "pmd_buffer_scatter", + "blocklist" ] }, "test_target": {
dts/tests/TestSuite_blocklist.py new file +68 -0
68 lines not on this page · raw message
Signature · 1 line
2.34.1
Quoted 6 lines · Luca Vizzarro
This test suite tests the port blocklisting functionality built in testpmd.
Signed-off-by Luca Vizzarro <[email protected]>Reviewed-by Paul Szczepanek <[email protected]>
Barring a couple updates needed due to framework changes, this looks good and runs on a Broadcom 975908 25G NIC I used for testing.
It runs fine after switching to invoking the testpmd shell via the context manager, and removing the use of "testpmd.close()." Once a new version is submitted with these changes, in my opinion it makes sense to move this series to next-dts. Thanks!
v2 cover dts: add blocklist test suite
In reply to Luca VizzarroHi there,
sending v2.
v2:
- rebased
Best,
Luca
Luca Vizzarro (2):
dts: add blocked ports to EalParams
dts: add blocklist test suite
dts/framework/config/conf_yaml_schema.json | 3 +- dts/framework/params/eal.py | 6 +- dts/framework/params/types.py | 3 +- dts/framework/remote_session/dpdk_shell.py | 4 +- dts/framework/remote_session/testpmd_shell.py | 2 +- dts/tests/TestSuite_blocklist.py | 63 +++++++++++++++++++ 6 files changed, 75 insertions(+), 6 deletions(-) create mode 100644 dts/tests/TestSuite_blocklist.py
Signature · 1 line
2.43.0
PATCH v2 1/2 dts: add blocked ports to EalParams
Make the "ports" attribute of EalParams as it actually is to "allowed_ports", and add "blocked_ports".
--- dts/framework/params/eal.py | 6 +++++- dts/framework/params/types.py | 3 ++- dts/framework/remote_session/dpdk_shell.py | 4 ++-- dts/framework/remote_session/testpmd_shell.py | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-)
dts/framework/params/eal.py +5 -1
@@ -45,9 +45,13 @@ class EalParams(Params): vdevs: list[VirtualDevice] | None = field( default=None, metadata=Params.multiple() | Params.long("vdev") ) - ports: list[Port] | None = field( + allowed_ports: list[Port] | None = field( default=None, metadata=Params.convert_value(_port_to_pci) | Params.multiple() | Params.short("a"), ) + blocked_ports: list[Port] | None = field( + default=None, + metadata=Params.convert_value(_port_to_pci) | Params.multiple() | Params.short("b"), + ) other_eal_param: Params | None = None _separator: Literal[True] = field(default=True, init=False, metadata=Params.short("-"))
dts/framework/params/types.py +2 -1
@@ -50,7 +50,8 @@ class EalParamsDict(TypedDict, total=False): prefix: str no_pci: Switch vdevs: list[VirtualDevice] | None - ports: list[Port] | None + allowed_ports: list[Port] | None + blocked_ports: list[Port] | None other_eal_param: Params | None
dts/framework/remote_session/dpdk_shell.py +2 -2
@@ -56,8 +56,8 @@ def compute_eal_params( sut_node.dpdk_prefix_list.append(prefix) params.prefix = prefix - if params.ports is None: - params.ports = sut_node.ports + if params.allowed_ports is None: + params.allowed_ports = sut_node.ports return params
dts/framework/remote_session/testpmd_shell.py +1 -1
@@ -1465,7 +1465,7 @@ def start(self, verify: bool = True) -> None: self._logger.debug(f"Failed to start packet forwarding: \n{start_cmd_output}") raise InteractiveCommandExecutionError("Testpmd failed to start packet forwarding.") - number_of_ports = len(self._app_params.ports or []) + number_of_ports = len(self._app_params.allowed_ports or []) for port_id in range(number_of_ports): if not self.wait_link_status_up(port_id): raise InteractiveCommandExecutionError(
Signature · 1 line
2.43.0
Re: [PATCH v2 1/2] dts: add blocked ports to EalParams
Hi Luca, this looks good to me! The only thing that needs to be fixed is the attributes component of the docstring for EalParams in eal.py. Aside from that:
Quoted 77 lines · Luca Vizzarro
Make the "ports" attribute of EalParams as it actually is to "
allowed_ports", and add "blocked_ports".Signed-off-by Luca Vizzarro <[email protected]>Reviewed-by Paul Szczepanek <[email protected]>--- dts/framework/params/eal.py | 6 +++++- dts/framework/params/types.py | 3 ++- dts/framework/remote_session/dpdk_shell.py | 4 ++-- dts/framework/remote_session/testpmd_shell.py | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-)dts/framework/params/eal.py +5
-1@@ -45,9 +45,13 @@ class EalParams(Params): vdevs: list[VirtualDevice] | None = field( default=None, metadata=Params.multiple() | Params.long("vdev") ) - ports: list[Port] | None = field( + allowed_ports: list[Port] | None = field( default=None, metadata=Params.convert_value(_port_to_pci) | Params.multiple() | Params.short("a"), ) + blocked_ports: list[Port] | None = field( + default=None, + metadata=Params.convert_value(_port_to_pci) | Params.multiple() | Params.short("b"), + ) other_eal_param: Params | None = None _separator: Literal[True] = field(default=True, init=False, metadata=Params.short("-"))dts/framework/params/types.py +2
-1@@ -50,7 +50,8 @@ class EalParamsDict(TypedDict, total=False): prefix: str no_pci: Switch vdevs: list[VirtualDevice] | None - ports: list[Port] | None + allowed_ports: list[Port] | None + blocked_ports: list[Port] | None other_eal_param: Params | Nonedts/framework/remote_session/dpdk_shell.py +2
-2@@ -56,8 +56,8 @@ def compute_eal_params( sut_node.dpdk_prefix_list.append(prefix) params.prefix = prefix - if params.ports is None: - params.ports = sut_node.ports + if params.allowed_ports is None: + params.allowed_ports = sut_node.ports return paramsdts/framework/remote_session/testpmd_shell.py +1
-2@@ -1465,7 +1465,7 @@ def start(self, verify: bool = True) -> None: self._logger.debug(f"Failed to start packet forwarding: \n{start_cmd_output}") raise InteractiveCommandExecutionError("Testpmd failed to start packet forwarding.") - number_of_ports = len(self._app_params.ports or []) + number_of_ports = len(self._app_params.allowed_ports or []) for port_id in range(number_of_ports): if not self.wait_link_status_up(port_id): raise InteractiveCommandExecutionError( --2.43.0
Re: [PATCH v2 1/2] dts: add blocked ports to EalParams
Quoted 5 lines · Nicholas Pratte
Hi Luca, this looks good to me! The only thing that needs to be fixed is the attributes component of the docstring for EalParams in
eal.py. Aside from that:Reviewed-by Nicholas Pratte <[email protected]>
Great, catch! Thanks!
PATCH v2 2/2 dts: add blocklist test suite
In reply to Luca VizzarroThis test suite tests the port blocklisting functionality built in testpmd.
--- dts/framework/config/conf_yaml_schema.json | 3 +- dts/tests/TestSuite_blocklist.py | 63 ++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 dts/tests/TestSuite_blocklist.py
dts/framework/config/conf_yaml_schema.json +2 -1
@@ -244,7 +244,8 @@ "hello_world", "os_udp", "pmd_buffer_scatter", - "vlan" + "vlan", + "blocklist" ] }, "test_target": {
dts/tests/TestSuite_blocklist.py new file +63 -0
63 lines not on this page · raw message
Signature · 1 line
2.43.0
Hi Luca, nice work!
See my small comment below/ I ran some local tests and everything seems to be working fine, so other than that minor fix I pointed out, the rest should be all set!
<snip>
Review
Quoted 3 lines
+"""The DPDK device blocklisting test suite.
(quoted diff) +2
-0+ +This testing suite ensures tests the port blocklisting functionality of testpmd.
I would remove the 'tests' and just write 'testing suite ensures the port...'
Quoted 2 lines
+"""
+
<snip>
Quoted 5 lines · Nicholas Pratte
Hi Luca, nice work!
See my small comment below/ I ran some local tests and everything seems to be working fine, so other than that minor fix I pointed out, the rest should be all set!
Good suggestion, I've changed it a little bit now. Thanks!
Patrick Robb
AppliedApplied to next-dts, thanks.