Two Rx rules and AF_XDP socketsΒΆ

Check that two AF_XDP sockets can work simultaneously each receiving packets from a different Rx queue specified by a Rx classification rule.

  1. From IUT TA pin XSK BPF map of rxq_stats XDP program to a file. From IUT RPC server open that file to obtain file descriptor of the map.

  2. Choose two different Rx queues: queue1 and queue2.

  3. Construct iut_addr1 with address taken from iut_addr and a random port such that packets sent to it from tst_addr will not be received by queue1 by default.

  4. Construct iut_addr2 with address taken from iut_addr and a random port such that packets sent to it from tst_addr will not be received by queue2 by default.

  5. Create UDP socket on Tester, bind it to tst_addr.

  6. Create two AF_XDP sockets on IUT, the first one bound to queue1, and the second one bound to queue2.

  7. Add Rx rule on IUT to redirect packets sent from tst_addr to iut_addr1 to Rx queue queue1.

  8. Add Rx rule on IUT to redirect packets sent from tst_addr to iut_addr2 to Rx queue queue2.

  9. Configure rxq_stats program on IUT to process only packets going from tst_addr to iut_addr (accepting any destination port).

  10. Check that the first AF_XDP socket can receive and reply UDP packet sent from tst_addr to iut_addr1.

  11. Check that the second AF_XDP socket can receive and reply UDP packet sent from tst_addr to iut_addr2.

Parameters:

env

Testing environment:

copy_mode

XDP copy mode:

  • none (kernel tries zero-copy, falls back to copy mode if it fails)

  • copy

  • zerocopy