dynamic_queue_conf Test Suite

Dynamic configuration of port queues test suite.

This test suite tests the support of being able to either stop or reconfigure port queues at runtime without stopping the entire device. Previously, to configure a DPDK ethdev, the application first specifies how many Tx and Rx queues to include in the ethdev and then application sets up each queue individually. Only once all the queues have been set up can the application then start the device, and at this point traffic can flow. If device stops, this halts the flow of traffic on all queues in the ethdev completely. Dynamic queue is a capability present on some NICs that specifies whether the NIC is able to delay the configuration of queues on its port. This capability allows for the support of stopping and reconfiguring queues on a port at runtime without stopping the entire device.

Support of this capability is shown by starting the Poll Mode Driver with multiple Rx and Tx queues configured and stopping some prior to forwarding packets, then examining whether or not the stopped ports and the unmodified ports were able to handle traffic. In addition to just stopping the ports, the ports must also show that they support configuration changes on their queues at runtime without stopping the entire device. This is shown by changing the ring size of the queues.

If the Poll Mode Driver is able to stop some queues on a port and modify them then handle traffic on the unmodified queues while the others are stopped, then it is the case that the device properly supports dynamic configuration of its queues.

setup_and_teardown_test(test_meth: Callable[[TestDynamicQueueConf, int, MutableSet, MutableSet, TestPmd, bool], None]) Callable[[TestDynamicQueueConf, bool], None]

Decorator that provides a setup and teardown for testing methods.

This decorator provides a method that sets up the environment for testing, runs the test method, and then does a clean-up verification step after the queues are started again. The decorated method will be provided with all the variables it should need to run testing including: The ID of the port where the queues for testing reside, disjoint sets of IDs for queues that are/aren’t modified, a testpmd session to run testing with, and a flag that indicates whether or not testing should be done on Rx or Tx queues.

Parameters:

test_meth (Callable[[TestDynamicQueueConf, int, MutableSet, MutableSet, TestPmd, bool], None]) – The decorated method that tests configuration of port queues at runtime. This method must have the following parameters in order: An int that represents a port ID, a set of queues for testing, a set of unmodified queues, a testpmd interactive shell, and a boolean that, when True, does Rx testing, otherwise does Tx testing. This method must also be a member of the TestDynamicQueueConf class.

Returns:

A method that sets up the environment, runs the decorated method, then re-enables all queues and validates they can still handle traffic.

Return type:

Callable[[TestDynamicQueueConf, bool], None]

class TestDynamicQueueConf

Bases: TestSuite

DPDK dynamic queue configuration test suite.

Testing for the support of dynamic queue configuration is done by splitting testing by the type of queue (either Rx or Tx) and the type of testing (testing for stopping a port at runtime vs testing configuration changes at runtime). Testing is done by first stopping a finite number of port queues (3 is sufficient) and either modifying the configuration or sending packets to verify that the unmodified queues can handle traffic. Specifically, the following cases are tested:

  1. The application should be able to start the device with only some of the queues set up.

  2. The application should be able to reconfigure existing queues at runtime without calling dev_stop().

num_ports_to_modify: ClassVar[int] = 3
src_addr: ClassVar[str] = '192.168.0.1'

Source IP address to use when sending packets.

dst_address_subnet: ClassVar[str] = '192.168.1'

Subnet to use for all of the destination addresses of the packets being sent.

rx_port_num: ClassVar[int] = 0

ID of the port to modify Rx queues on.

tx_port_num: ClassVar[int] = 1

ID of the port to modify Tx queues on.

number_of_queues: ClassVar[int] = 8

Number of queues to start testpmd with. There will be the same number of Rx and Tx queues. 8 was chosen as a number that is low enough for most NICs to accommodate while also being enough to validate the usage of the queues.

number_of_packets_to_send: ClassVar[int] = 1024

The number of packets to send while testing. The test calls for well over the ring size - 1 packets in the modification test case and the only options for ring size are 256 or 512, therefore 1024 will be more than enough.

rx_queue_stop() None

Test Rx stopping queues when flag is set to True.

Steps:
  • Start testpmd.

  • Set forward mode.

  • Send packets with different addresses and capture.

Verify
  • Stopped queues don’t handle traffic and doesn’t block traffic on other queues.

rx_queue_configuration() None

Test Rx queue configuration when testing is set to True.

Steps:
  • Start testpmd.

  • Set forward mode.

  • Send packets with different addresses and capture.

Verify
  • Ring size of port queues can be configured at runtime.

tx_queue_stop() None

Test Rx stopping queues when flag is set to False.

Steps:
  • Start testpmd.

  • Set forward mode.

  • Send packets with different addresses and capture.

Verify
  • Stopped queues don’t handle traffic and doesn’t block traffic on other queues.

tx_queue_configuration() None

Test Rx queue configuration when testing is set to False.

Steps:
  • Start testpmd.

  • Set forward mode.

  • Send packets with different addresses and capture.

Verify
  • Ring size of port queues can be configured at runtime.

required_capabilities: ClassVar[set[Capability]] = {28}

The capabilities the test case or suite requires in order to be executed.