Send one packet and request offloads

Evaluate transmit operation correctness by sending one packet

  1. Learn about protocol types from the traffic template

  2. Initialize the Ethernet device to get its capabilities

  3. Attempt to configure tunnel UDP port number in the PMD

  4. If vlan >= 0 :

    • Enable VLAN offload in the PMD

  5. If outer_ip_cksum :

    • Enable outer IP checksum offload in the PMD

  6. If outer_udp_cksum :

    • Enable outer UDP checksum offload in the PMD

  7. If innermost_ip_cksum :

    • If not tso != 0 && ol_ipv4_cs_capa == 0 :

      • Enable innermost IP checksum offload in the PMD

  8. If innermost_l4_cksum :

    • Enable innermost L4 checksum offload in the PMD

  9. If tso != 0 :

    • Depending on tmpl_protocols[TAPI_NDN_TUNNEL] :

      • Enable non-tunnel TSO in the PMD

      • Enable VXLAN TSO in the PMD

      • Enable Geneve TSO in the PMD

  10. If segmentation.nb_seg_groups > 0 :

    • Enable multi-seg mbuf support in the PMD

  11. Configure the Ethernet device

  12. Setup the Ethernet device Rx queues

  13. Cook the traffic template

  14. Generate and customise a packet mbuf

  15. If vlan >= 0 :

    • Add VLAN offload request to the mbuf

  16. If outer_ip_cksum && tmpl_protocols[TAPI_NDN_OUTER_L3] == TE_PROTO_IP4 :

    • Add outer IP checksum offload request to the mbuf

  17. If outer_udp_cksum && tmpl_protocols[TAPI_NDN_OUTER_L4] == TE_PROTO_UDP :

    • Add outer UDP checksum offload request to the mbuf

  18. If innermost_ip_cksum && tmpl_protocols[TAPI_NDN_INNER_L3] == TE_PROTO_IP4 :

    • Add innermost IP checksum offload request to the mbuf

  19. If innermost_l4_cksum && tmpl_protocols[TAPI_NDN_INNER_L4] == TE_PROTO_TCP :

    • Add TCP checksum offload request to the mbuf

  20. If innermost_l4_cksum && tmpl_protocols[TAPI_NDN_INNER_L4] == TE_PROTO_UDP :

    • Add innermost UDP checksum offload request to the mbuf

  21. If tso != 0 :

    • Add TSO request to the mbuf

  22. Clone the mbuf from IUT RPCS to TST RPCS

  23. If segmentation.nb_seg_groups > 0 :

    • Redistribute the packet data across multiple mbuf segments

  24. Evaluate TxQ ring size

  25. If tso != 0 :

    • Override the number of descriptors by the maximum supported value since the NIC may need additional descriptor room for TSO transaction while being unable to report this in limits

  26. Setup the Ethernet device Tx queues

  27. Start the Ethernet device and wait for link up

  28. Check mbuf segmentation vs limits

  29. Sanity check the packet mbuf with Tx prepare API

  30. Derive the maximum packet length and the number of packets to be seen on Rx side

  31. If m_rx_size_max > ETHER_HDR_LEN + ETHER_DATA_LEN :

    • Enlarge MTU on both ends

  32. Deploy RTE af_packet on top of TST network interface

  33. Ensure that interface is UP on Tester side

  34. Squeeze out garbage packets possibly captured by RTE af_packet

  35. Send the packet

  36. Receive the packet(s)

  37. Match Rx packet(s) and figure out what offloads took place

Ivan Malov Ivan.Malov@oktetlabs.ru

Parameters:

segmentation

Mbuf segmentation pattern or an empty line

innermost_ip_cksum

Innermost IP checksum offload toggle

innermost_l4_cksum

Innermost L4 checksum offload toggle

outer_udp_cksum

Outer UDP checksum offload toggle

outer_ip_cksum

Outer IP checksum offload toggle

tmpl

Traffic template

pld_size

Payload size

vlan

VLAN offload: VLAN ID (ON) or -1 (OFF)

tso

TSO: segment size (ON) or 0 (OFF)