.. index:: pair: group; Two Rx rules and AF_XDP sockets .. _doxid-group__rss-af__xdp__two__rules: Two Rx rules and AF_XDP sockets =============================== .. toctree:: :hidden: Check that two AF_XDP sockets can work simultaneously each receiving packets from a different Rx queue specified by a Rx classification rule. #. 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. #. Choose two different Rx queues: **queue1** and **queue2**. #. 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. #. 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. #. Create UDP socket on Tester, bind it to **tst_addr**. #. Create two AF_XDP sockets on IUT, the first one bound to **queue1**, and the second one bound to **queue2**. #. Add Rx rule on IUT to redirect packets sent from **tst_addr** to **iut_addr1** to Rx queue **queue1**. #. Add Rx rule on IUT to redirect packets sent from **tst_addr** to **iut_addr2** to Rx queue **queue2**. #. Configure **rxq_stats** program on IUT to process only packets going from **tst_addr** to **iut_addr** (accepting any destination port). #. Check that the first AF_XDP socket can receive and reply UDP packet sent from **tst_addr** to **iut_addr1**. #. Check that the second AF_XDP socket can receive and reply UDP packet sent from **tst_addr** to **iut_addr2**. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - env - Testing environment: * :ref:`env.peer2peer ` * :ref:`env.peer2peer_ipv6 ` * - copy_mode - XDP copy mode: * ``none`` (kernel tries zero-copy, falls back to copy mode if it fails) * ``copy`` * ``zerocopy``