:orphan: .. index:: pair: group; RTE mbuf CSAP layer .. _doxid-group__te__lib__rpc__rte__mbuf__ndn: RTE mbuf CSAP layer =================== .. toctree:: :hidden: Overview ~~~~~~~~ Convert between RTE mbufs and the ASN.1 packet representation the Traffic Application Domain uses, so that a DPDK test can describe packets the same way a CSAP test does. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block // global functions int :ref:`rpc_rte_mk_mbuf_from_template`(:ref:`rcf_rpc_server`* rpcs, const :ref:`asn_value`* template, rpc_rte_mempool_p mp, rpc_rte_mbuf_p** mbufs, unsigned int* count); int :ref:`rpc_rte_mbuf_match_pattern`(:ref:`rcf_rpc_server`* rpcs, const :ref:`asn_value`* pattern, rpc_rte_mbuf_p* mbufs, unsigned int count, :ref:`asn_value`*** packets, unsigned int* matched); int :ref:`tapi_rte_mbuf_match_pattern_seq`(:ref:`rcf_rpc_server`* rpcs, const :ref:`asn_value`* pattern, rpc_rte_mbuf_p* mbufs, unsigned int count, :ref:`asn_value`*** packets, unsigned int* matched); int :ref:`rpc_rte_mbuf_match_tx_rx_pre`(:ref:`rcf_rpc_server`* rpcs, rpc_rte_mbuf_p m); int :ref:`rpc_rte_mbuf_match_tx_rx`(:ref:`rcf_rpc_server`* rpcs, rpc_rte_mbuf_p m_tx, rpc_rte_mbuf_p* rx_burst, unsigned int nb_rx, struct :ref:`tarpc_rte_mbuf_report`* reportp); .. _details-group__te__lib__rpc__rte__mbuf__ndn: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Convert between RTE mbufs and the ASN.1 packet representation the Traffic Application Domain uses, so that a DPDK test can describe packets the same way a CSAP test does. Global Functions ---------------- .. index:: pair: function; rpc_rte_mk_mbuf_from_template .. _doxid-group__te__lib__rpc__rte__mbuf__ndn_1gae64efc01b5cf6dbdef782431e361e08c: .. ref-code-block:: cpp :class: doxyrest-title-code-block int rpc_rte_mk_mbuf_from_template(:ref:`rcf_rpc_server`* rpcs, const :ref:`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) .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - template - ASN.1 traffic template * - mp - RTE mempool pointer * - mbufs - Location for RTE mbuf pointer(s) * - count - Location for the number of mbufs prepared .. rubric:: Returns: ``0`` on success; jumps out in case of failure .. index:: pair: function; rpc_rte_mbuf_match_pattern .. _doxid-group__te__lib__rpc__rte__mbuf__ndn_1gad32308b5060476aa9a8369c9efaa7a39: .. ref-code-block:: cpp :class: doxyrest-title-code-block int rpc_rte_mbuf_match_pattern(:ref:`rcf_rpc_server`* rpcs, const :ref:`asn_value`* pattern, rpc_rte_mbuf_p* mbufs, unsigned int count, :ref:`asn_value`*** packets, unsigned int* matched) Match RTE mbuf(s) to a particular pattern .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - 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 .. rubric:: Returns: ``0`` on success; jumps out in case of failure .. index:: pair: function; tapi_rte_mbuf_match_pattern_seq .. _doxid-group__te__lib__rpc__rte__mbuf__ndn_1ga831d5f1c694a65444362263f32b5956b: .. ref-code-block:: cpp :class: doxyrest-title-code-block int tapi_rte_mbuf_match_pattern_seq(:ref:`rcf_rpc_server`* rpcs, const :ref:`asn_value`* pattern, rpc_rte_mbuf_p* mbufs, unsigned int count, :ref:`asn_value`*** packets, unsigned int* matched) Wrapper for rte_mbuf_match_pattern() RPC intended for sequence matching .. index:: pair: function; rpc_rte_mbuf_match_tx_rx_pre .. _doxid-group__te__lib__rpc__rte__mbuf__ndn_1ga761010431b91adccc7a325f82b3e1461: .. ref-code-block:: cpp :class: doxyrest-title-code-block int rpc_rte_mbuf_match_tx_rx_pre(:ref:`rcf_rpc_server`* rpcs, rpc_rte_mbuf_p m) Prepare Tx mbuf for comparison with Rx burst. .. note:: Length fields in the header must assume zero L4 payload length, but the payload itself must be present in the mbuf. .. note:: VLAN tags in the outermost header must use standard QinQ and VLAN TPID values. .. note:: If encapsulation is used, no VLAN tags are allowed in the inner header. .. note:: IPv6 extension headers are disallowed. .. note:: ``m`` MUST have m->[...]lX_len values originally set by TAD rte_mbuf layer. .. note:: The packet header must be contiguous. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - m - Packet mbuf .. rubric:: Returns: ``0`` on success; jumps out on failure .. index:: pair: function; rpc_rte_mbuf_match_tx_rx .. _doxid-group__te__lib__rpc__rte__mbuf__ndn_1gaf05a1e911faaaff1172a83ff5c94465e: .. ref-code-block:: cpp :class: doxyrest-title-code-block int rpc_rte_mbuf_match_tx_rx(:ref:`rcf_rpc_server`* rpcs, rpc_rte_mbuf_p m_tx, rpc_rte_mbuf_p* rx_burst, unsigned int nb_rx, struct :ref:`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. .. note:: 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 :ref:`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 :ref:`rpc_rte_mbuf_match_tx_rx() ` on the Rx burst and pass the mbuf from step (5) to it. .. note:: ``m`` tx must abide by prerequisites imposed by ``:ref:`rpc_rte_mbuf_match_tx_rx_pre() ```. .. note:: For correct Tx VLAN insertion status discovery, Rx VLAN stripping must be enabled on Rx device. .. note:: The mbufs will be modified and can't be reused. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - m_tx - Tx mbuf * - rx_burst - Rx burst * - nb_rx - Rx burst size * - reportp - Report location; can be ``NULL`` .. rubric:: Returns: ``0`` on success; jumps out on failure