TAPI for RTE mbuf layer API remote calls
Overview
// global functions int rpc_rte_mk_mbuf_from_template(rcf_rpc_server* rpcs, const asn_value* template, rpc_rte_mempool_p mp, rpc_rte_mbuf_p** mbufs, unsigned int* count); int rpc_rte_mbuf_match_pattern(rcf_rpc_server* rpcs, const asn_value* pattern, rpc_rte_mbuf_p* mbufs, unsigned int count, asn_value*** packets, unsigned int* matched); int tapi_rte_mbuf_match_pattern_seq(rcf_rpc_server* rpcs, const asn_value* pattern, rpc_rte_mbuf_p* mbufs, unsigned int count, asn_value*** packets, unsigned int* matched); int rpc_rte_mbuf_match_tx_rx_pre(rcf_rpc_server* rpcs, rpc_rte_mbuf_p m); int rpc_rte_mbuf_match_tx_rx(rcf_rpc_server* rpcs, rpc_rte_mbuf_p m_tx, rpc_rte_mbuf_p* rx_burst, unsigned int nb_rx, struct tarpc_rte_mbuf_report* reportp);
Detailed Documentation
Global Functions
int rpc_rte_mk_mbuf_from_template(rcf_rpc_server* rpcs, const asn_value* template, rpc_rte_mempool_p mp, rpc_rte_mbuf_p** mbufs, unsigned int* count)
Convert an ASN.1 traffic template to RTE mbuf(s)
Parameters:
template |
ASN.1 traffic template |
mp |
RTE mempool pointer |
mbufs |
Location for RTE mbuf pointer(s) |
count |
Location for the number of mbufs prepared |
Returns:
0
on success; jumps out in case of failure
int rpc_rte_mbuf_match_pattern(rcf_rpc_server* rpcs, const asn_value* pattern, rpc_rte_mbuf_p* mbufs, unsigned int count, asn_value*** packets, unsigned int* matched)
Match RTE mbuf(s) to a particular pattern
Parameters:
pattern |
ASN.1 traffic pattern |
mbufs |
Array of RTE mbuf pointer(s) |
count |
The number of RTE mbuf pointers in the array |
packets |
Location for the matching ASN.1 packets (optional) |
matched |
Location for the number of packets matched |
Returns:
0
on success; jumps out in case of failure
int tapi_rte_mbuf_match_pattern_seq(rcf_rpc_server* rpcs, const asn_value* pattern, rpc_rte_mbuf_p* mbufs, unsigned int count, asn_value*** packets, unsigned int* matched)
Wrapper for rte_mbuf_match_pattern() RPC intended for sequence matching
int rpc_rte_mbuf_match_tx_rx_pre(rcf_rpc_server* rpcs, rpc_rte_mbuf_p m)
Prepare Tx mbuf for comparison with Rx burst.
Length fields in the header must assume zero L4 payload length, but the payload itself must be present in the mbuf.
VLAN tags in the outermost header must use standard QinQ and VLAN TPID values.
If encapsulation is used, no VLAN tags are allowed in the inner header.
IPv6 extension headers are disallowed.
m
MUST have m->[…]lX_len values originally set by TAD rte_mbuf layer.
The packet header must be contiguous.
Parameters:
m |
Packet mbuf |
Returns:
0
on success; jumps out on failure
int rpc_rte_mbuf_match_tx_rx(rcf_rpc_server* rpcs, rpc_rte_mbuf_p m_tx, rpc_rte_mbuf_p* rx_burst, unsigned int nb_rx, struct tarpc_rte_mbuf_report* reportp)
Ensure that the given Tx mbuf and Rx burst match. If they do, provide status of HW offloads in the report.
Usage instructions for future test maintainers: 1) Construct the mbuf by means of rte_mbuf SAP in the assumption that payload size is zero; 2) Remove any padding at the end of the packet and append the actual payload to the packet; 3) Adjust the mbuf to enable hardware offloads; 4) Invoke rpc_rte_mbuf_match_tx_rx_pre() on it; 5) If the packet is supposed to be received on a different test agent than the one used to transmit it, clone the mbuf between the two; 6) If required, make m_tx
a multi-seg chain; 7) Carry out transmit and receive transactions; 8) Invoke rpc_rte_mbuf_match_tx_rx() on the Rx burst and pass the mbuf from step (5) to it.
m
tx must abide by prerequisites imposed by rpc_rte_mbuf_match_tx_rx_pre()
.
For correct Tx VLAN insertion status discovery, Rx VLAN stripping must be enabled on Rx device.
The mbufs will be modified and can’t be reused.
Parameters:
m_tx |
Tx mbuf |
rx_burst |
Rx burst |
nb_rx |
Rx burst size |
reportp |
Report location; can be |
Returns:
0
on success; jumps out on failure