Send one packet
Make sure that a packet can be sent correctly
Validate PMD Tx operation in general and various Tx offloads in particular.
Reconcile interdependent test parameters
Initialize the Ethernet device to get its capabilities
Conduct environment substitutions in the traffic template
Learn about protocol types present in the traffic template
Learn about offload capabilities supported by the PMD
Update traffic template in accordance with device capabilities and offloads to be tested
Set outer L4 checksum to 0 in the traffic template if need be
If
hdrs[TAPI_NDN_TUNNEL] != TE_PROTO_INVALID && tso_segsz == 0:If
hdrs[TAPI_NDN_OUTER_L3] == TE_PROTO_IP4 && ((tunnel_aware && outer_ip_cksum_offload && outer_ip_cksum_offload_supported) || (!tunnel_aware && inner_ip_cksum_offload && inner_ip_cksum_offload_supported)):Spoil outer IP checksum in the traffic template
If
(hdrs[TAPI_NDN_TUNNEL] == TE_PROTO_INVALID || tunnel_aware) && tso_segsz == 0:If
inner_ip_cksum_offload && inner_ip_cksum_offload_supported && hdrs[TAPI_NDN_INNER_L3] == TE_PROTO_IP4:Spoil inner IP checksum in the traffic template
If
l4_cksum_offload && inner_l4_cksum_offload_supported:Spoil inner L4 checksum in the traffic template
Set payload length in the traffic template
If
hdrs[TAPI_NDN_TUNNEL] != TE_PROTO_INVALID && tunnel_aware:Configure tunnel UDP port number in the PMD
Enable offloads to be tested
If
vlan_id >= 0:Enable VLAN offload in the PMD
If
outer_ip_cksum_offload && outer_ip_cksum_offload_supported && hdrs[TAPI_NDN_OUTER_L3] == TE_PROTO_IP4:Enable outer IP checksum offload in the PMD
If
outer_udp_cksum_offload_supported && hdrs[TAPI_NDN_OUTER_L4] == TE_PROTO_UDP:Enable outer UDP checksum offload in the PMD
If
inner_ip_cksum_offload && inner_ip_cksum_offload_supported && hdrs[TAPI_NDN_INNER_L3] == TE_PROTO_IP4:Enable inner IP checksum offload in the PMD
If
l4_cksum_offload && inner_l4_cksum_offload_supported && hdrs[TAPI_NDN_INNER_L4] != TE_PROTO_INVALID:Enable inner L4 checksum offload in the PMD
If
tso_segsz > 0:Enable TSO in the PMD
If
segmentation.nb_seg_groups > 0:Enable multisegment mbuf support in the PMD
Configure the Ethernet device and setup its Rx queues
Prepare mbufs to transmit by traffic template and offloads to be tested
Generate mbuf and a packet sample from the traffic template
If
vlan_id >= 0:Add VLAN offload request to the mbuf
If
hdrs[TAPI_NDN_TUNNEL] != TE_PROTO_INVALID:If
tunnel_aware:Add outer offload flags for the outer frame to the mbuf
If not
tunnel_aware:Reconcile inner header length fields in the mbuf so that they refer to the outer header and fill zeros in outer header length fields
Add inner offload flags for the outer frame to the mbuf
If
hdrs[TAPI_NDN_TUNNEL] == TE_PROTO_INVALID || tunnel_aware:Add inner offload flags for the inner frame to the mbuf
If
tso_segsz > 0:Add TSO request to the mbuf
If
segmentation.nb_seg_groups > 0:Redistribute the packet data across multiple mbuf segments
If
tso_segsz > 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
Setup Tx queue
If
m_eth_d_len > ETHER_DATA_LEN:Enlarge MTU on both ends to cope with big frame(s)
Start the Ethernet device and wait for link up
Check mbuf segmentation vs limits
Validate Tx offloads for the packet
Create an Rx CSAP on the TST host according to the template
Update expected packet in accordance with offloads to be done
If
vlan_id >= 0:Inject VLAN tag to the packet sample
If
hdrs[TAPI_NDN_TUNNEL] != TE_PROTO_INVALID:Replace checksums in the outer frame of the packet sample with script values to demand that the checksums in the packet(s) received by peer be correct
If
hdrs[TAPI_NDN_TUNNEL] == TE_PROTO_INVALID || tunnel_aware:Replace checksums in the inner frame of the packet sample with script values to demand that the checksums in the packet(s) received by the peer be correct
If
tso_segsz > 0:Conduct TSO edits for the packet sample
Prepare a traffic pattern from TSO packet samples
Mask TCP flag CWR in the first packet to handle it gracefully
If not
tso_segsz > 0:Prepare a traffic pattern from the packet sample
Ensure that interface is UP on Tester side
Start to capture traffic with the pattern prepared
Send the packet
Check that no extra packets are received on Tester
Verify the number of matching packets received
Fail if TCP CWR flag is lost
Ivan Malov Ivan.Malov@oktetlabs.ru
Parameters:
tmpl |
Traffic template |
payload_len |
Payload length |
inner_ip_cksum_offload |
Inner or no-tunnel IP checksum offload toggle |
l4_cksum_offload |
L4 checksum offload toggle |
vlan_id |
VLAN offload: VLAN ID (ON) or |
tso_segsz |
TSO: segment size > |
segmentation |
Mbuf segmentation pattern or an empty line |