Two rules, one of them omits src or dstΒΆ

Check what happens when there are two TCP or UDP Rx rules - one specifying both source and destination and another one specifying only source or destination.

  1. Determine def_queue which should be used for packets sent from tst_addr to iut_addr according to RSS indirection table.

  2. Find another port new_port for iut_addr (if partial_src is TRUE) or for tst_addr (if partial_src is FALSE) such that connection using this new port will still be mapped to def_queue according to RSS indirection table.

  3. Add two Rx classification rules on IUT. One of the rules should have both source (tst_addr) and destination (iut_addr) filled - let's call it the full rule. If first_partial is TRUE, it should be the second rule, otherwise - the first rule. Another rule should have only source (tst_addr) or destination (iut_addr) filled depending on partial_src test parameter - let's call it the partial rule. These two rules should specify two different Rx queues not equal to def_queue.

  4. Create the first connection of type sock_type using tst_addr on Tester and iut_addr on IUT.

    • In case of TCP sockets, set SO_LINGER option with zero linger time to ensure immediate release of bound ports once sockets are closed.

  5. Send a few packets from Tester over the first connection.

  6. Check that packets received on IUT went to the Rx queue assigned to the full rule.

  7. Close sockets of the first connection.

  8. Create the second connection using tst_addr on Tester and iut_addr on IUT. But this time bind to new_port on IUT (if partial_src is TRUE) or on Tester (if partial_src is FALSE). This will ensure that only the partial rule should match packets sent from Tester.

  9. Send a few packets from Tester over the second connection.

  10. Check that packets received on IUT went to the Rx queue assigned to the partial rule.

Parameters:

env

Testing environment:

sock_type

Socket type:

  • SOCK_STREAM

  • SOCK_DGRAM

first_partial

If TRUE, the first rule omits src or dst. If FALSE, the second rule does that.

partial_src

If TRUE, one of the rules has only source address/port specified. If FALSE - only the destination address/port.