Rx classification rule and AF_XDP socketΒΆ

Check that a packet directed to Rx queue by Rx classification rule can be received and replied by AF_XDP socket.

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

  2. 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.

  3. Find out which Rx queue on IUT will be used for packets sent from tst_addr to iut_addr according to RSS indirection table.

  4. Choose a different Rx queue rule_queue on IUT.

  5. Create Rx classification rule on IUT redirecting packets sent from tst_addr to iut_addr to Rx queue rule_queue.

  6. Configure rxq_stats XDP program on IUT to process only packets going from tst_addr to iut_addr.

  7. Create AF_XDP socket on IUT bound to rule_queue. Set corresponding record of XSK map of rxq_stats program to its file descriptor.

  8. Send a packet from the Tester UDP socket. Check that the AF_XDP socket gets that packet on IUT. Construct a reply by inverting addresses and ports of the received packet. Send it back to Tester over the AF_XDP socket. Check that the Tester socket gets it and its payload is the same as in the previously sent packet.

Parameters:

env

Testing environment:

copy_mode

XDP copy mode:

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

  • copy

  • zerocopy