rte_pmd_cnxk.h(3)
β¨ rte_pmd_cnxk.h β bestie's guide to the CNXK PMD header π
okay so listen. this is rte_pmd_cnxk.h, part of the DPDK library functions manual, and it's literally the CNXK PMD specific functions header. it's giving "low-level hardware girlie who knows exactly what she's doing" and honestly? iconic. let's get into it π«Ά
πΈ SYNOPSIS πΈ
#include <rte_compat.h>
#include <rte_ethdev.h>
#include <rte_ether.h>
#include <rte_security.h>
π Data Structures
no cap, bestie, there are a LOT of these. every single one, here we go:
struct rte_pmd_cnxk_cpt_q_statsunion rte_pmd_cnxk_ipsec_outer_ip_hdrstruct rte_pmd_cnxk_ipsec_inb_ctx_update_regunion rte_pmd_cnxk_ipsec_outb_ivstruct rte_pmd_cnxk_ipsec_outb_ctx_update_regstruct rte_pmd_cnxk_ipsec_inb_sastruct rte_pmd_cnxk_ipsec_outb_saunion rte_pmd_cnxk_ipsec_hw_saunion rte_pmd_cnxk_cpt_res_sstruct rte_pmd_cnxk_cpt_res_s::rte_pmd_cpt_cn10k_res_sstruct rte_pmd_cnxk_cpt_res_s::rte_pmd_cpt_cn9k_res_sstruct rte_pmd_cnxk_ipsec_inb_cfg
β¨ Macros
- ```c #define RTE_PMD_CNXK_AR_WIN_SIZE_MIN 64
- ```c
#define RTE_PMD_CNXK_AR_WINBITS_SZ
(RTE_ALIGN_CEIL(RTE_PMD_CNXK_AR_WIN_SIZE_MAX, 64) / 64)
π¦ Enumerations
enum rte_pmd_cnxk_sec_action_alg { RTE_PMD_CNXK_SEC_ACTION_ALG0, RTE_PMD_CNXK_SEC_ACTION_ALG1, RTE_PMD_CNXK_SEC_ACTION_ALG2, RTE_PMD_CNXK_SEC_ACTION_ALG3, RTE_PMD_CNXK_SEC_ACTION_ALG4 }enum rte_pmd_cnxk_cpt_q_stats_type { RTE_PMD_CNXK_CPT_Q_STATS_INL_DEV, RTE_PMD_CNXK_CPT_Q_STATS_KERNEL, RTE_PMD_CNXK_CPT_Q_STATS_ETHDEV }
π Functions
the whole roster, and yes every single __rte_experimental is there because that's just how we live:
__rte_experimental int rte_pmd_cnxk_hw_sa_read (uint16_t portid, void
*sess, union rte_pmd_cnxk_ipsec_hw_sa *data, uint32_t len, bool inb)
__rte_experimental int rte_pmd_cnxk_hw_sa_write (uint16_t portid, void
*sess, union rte_pmd_cnxk_ipsec_hw_sa *data, uint32_t len, bool inb)
__rte_experimental union rte_pmd_cnxk_cpt_res_s *
rte_pmd_cnxk_inl_ipsec_res (struct rte_mbuf *mbuf)
__rte_experimental union rte_pmd_cnxk_ipsec_hw_sa *
rte_pmd_cnxk_hw_session_base_get (uint16_t portid, bool inb)
__rte_experimental int rte_pmd_cnxk_sa_flush (uint16_t portid, union
rte_pmd_cnxk_ipsec_hw_sa *sess, bool inb)
__rte_experimental struct rte_pmd_cnxk_inl_dev_q *
rte_pmd_cnxk_inl_dev_qptr_get (void)
__rte_experimental uint16_t rte_pmd_cnxk_inl_dev_submit (struct
rte_pmd_cnxk_inl_dev_q *qptr, void *inst, uint16_t nb_inst)
__rte_experimental int rte_pmd_cnxk_cpt_q_stats_get (uint16_t portid,
enum rte_pmd_cnxk_cpt_q_stats_type type, struct
rte_pmd_cnxk_cpt_q_stats *stats, uint16_t idx)
__rte_experimental void rte_pmd_cnxk_hw_inline_inb_cfg_set (uint16_t
portid, struct rte_pmd_cnxk_ipsec_inb_cfg *cfg)
__rte_experimental const char * rte_pmd_cnxk_model_str_get (void)
π Detailed Description π
CNXK PMD specific functions.
Definition in file rte_pmd_cnxk.h.
π Macro Definition Documentation π
β¨ #define RTE_PMD_CNXK_AR_WIN_SIZE_MIN 64
Anti reply window size supported
Definition at line 91 of file rte_pmd_cnxk.h.
β¨ #define RTE_PMD_CNXK_AR_WINBITS_SZ (RTE_ALIGN_CEIL(RTE_PMD_CNXK_AR_WIN_SIZE_MAX, 64) / 64)
u64 array size to fit anti replay window bits
Definition at line 96 of file rte_pmd_cnxk.h.
π Enumeration Type Documentation π
π enum rte_pmd_cnxk_sec_action_alg
Algorithm type to be used with security action to calculate SA_index
Enumerator
RTE_PMD_CNXK_SEC_ACTION_ALG0β no swizzling of SPI bits into SA index. SA_index is from SA_XOR if enabled.RTE_PMD_CNXK_SEC_ACTION_ALG1βSPI<31:28>has 4 upper bits which segment the sequence number space. Initial SA_index is from SA_XOR if enabled.SA_alg = { 4'b0, SA_mcam[27:0] + SPI[31:28]}RTE_PMD_CNXK_SEC_ACTION_ALG2βSPI<27:25>segment the sequence number space. Initial SA_index is from SA_XOR if enabled.SA_alg = { 7'b0, SA_mcam[24:0] + SPI[27:25]}RTE_PMD_CNXK_SEC_ACTION_ALG3βSPI<28:25>segment the sequence number space. Initial SA_index is from SA_XOR if enabled.SA_alg = { 7'b0, SA_mcam[24:0] + SPI[28:25]}RTE_PMD_CNXK_SEC_ACTION_ALG4β the inbound SPI maybe "random", therefore we want the MCAM to be capable of remapping the SPI to an arbitrary SA_index. SPI to SA is done using a lookup in NIX/NPC cam entry with key as SPI, MATCH_ID, LFID.
Definition at line 22 of file rte_pmd_cnxk.h.
π enum rte_pmd_cnxk_cpt_q_stats_type
CPT queue type for obtaining queue hardware statistics.
Enumerator
RTE_PMD_CNXK_CPT_Q_STATS_INL_DEVβ type to get Inline Device queue(s) statisticsRTE_PMD_CNXK_CPT_Q_STATS_KERNELβ type to get Inline Inbound queue which is attached to kernel device statistics.RTE_PMD_CNXK_CPT_Q_STATS_ETHDEVβ type to get CPT queue which is attached to ethdev statistics
Definition at line 51 of file rte_pmd_cnxk.h.
π¦ Function Documentation π¦
π __rte_experimental int rte_pmd_cnxk_hw_sa_read (uint16_t portid, void * sess, union rte_pmd_cnxk_ipsec_hw_sa * data, uint32_t len, bool inb)
Read HW SA context from session.
Parameters
- portid β Port identifier of Ethernet device.
- sess β Handle of the security session as
void *. - data β Destination pointer to copy SA context for application.
- len β Length of SA context to copy into
dataparameter. - inb β Determines the type of specified SA.
Returns
0 on success, a negative errno value otherwise.
π __rte_experimental int rte_pmd_cnxk_hw_sa_write (uint16_t portid, void * sess, union rte_pmd_cnxk_ipsec_hw_sa * data, uint32_t len, bool inb)
Write HW SA context to session.
Parameters
- portid β Port identifier of Ethernet device.
- sess β Handle of the security session as
void *. - data β Source data pointer from application to copy SA context into session.
- len β Length of SA context to copy from
dataparameter. - inb β Determines the type of specified SA.
Returns
0 on success, a negative errno value otherwise.
π __rte_experimental union rte_pmd_cnxk_cpt_res_s * rte_pmd_cnxk_inl_ipsec_res (struct rte_mbuf * mbuf)
Get pointer to CPT result info for inline inbound processed pkt.
It is recommended to use this API only when mbuf indicates packet was processed with inline IPsec and there was a failure with the same i.e mbuf->ol_flags indicates (RTE_MBUF_F_RX_SEC_OFFLOAD | RTE_MBUF_F_RX_SEC_OFFLOAD_FAILED).
Parameters
- mbuf β Pointer to packet that was just received and was processed with Inline IPsec.
Returns
- Pointer to mbuf location where
union rte_pmd_cnxk_cpt_res_sis stored on success. NULLon failure.
π __rte_experimental union rte_pmd_cnxk_ipsec_hw_sa * rte_pmd_cnxk_hw_session_base_get (uint16_t portid, bool inb)
Get pointer to the Inline Inbound or Outbound SA table base.
Parameters
- portid β Port identifier of Ethernet device.
- inb β Determines the type of SA base to be returned. When inb is true, the method returns the Inbound SA base. When inb is false, the method returns the Outbound SA base.
Returns
Pointer to Inbound or Outbound SA base.
π __rte_experimental int rte_pmd_cnxk_sa_flush (uint16_t portid, union rte_pmd_cnxk_ipsec_hw_sa * sess, bool inb)
Executes a CPT flush on the specified session.
Parameters
- portid β Port identifier of Ethernet device.
- sess β Handle of the session on which the CPT flush will be executed.
- inb β Determines the type of SA to be flushed, Inbound or Outbound.
Returns
0 Upon success, a negative errno value otherwise.
π __rte_experimental struct rte_pmd_cnxk_inl_dev_q * rte_pmd_cnxk_inl_dev_qptr_get (void )
Get queue pointer of Inline Device.
Returns
- Pointer to queue structure that would be the input to submit API.
NULLupon failure.
π __rte_experimental uint16_t rte_pmd_cnxk_inl_dev_submit (struct rte_pmd_cnxk_inl_dev_q * qptr, void * inst, uint16_t nb_inst)
Submit CPT instruction(s) (cpt_inst_s) to Inline Device.
Parameters
- qptr β Pointer obtained with
rte_pmd_cnxk_inl_dev_qptr_get. - inst β Pointer to an array of
cpt_inst_sprapared by application. - nb_inst β Number of instructions to be processed.
Returns
Number of instructions processed.
π __rte_experimental int rte_pmd_cnxk_cpt_q_stats_get (uint16_t portid, enum rte_pmd_cnxk_cpt_q_stats_type type, struct rte_pmd_cnxk_cpt_q_stats * stats, uint16_t idx)
Retrieves the hardware statistics of a given port and stats type.
Parameters
- portid β Port identifier of Ethernet device.
- type β The type of hardware statistics to retrieve, as defined in the enum
rte_pmd_cnxk_cpt_q_stats_type. - stats β Pointer where the retrieved statistics will be stored.
- idx β The index of the queue of a given type.
Returns
0 Upon success, a negative errno value otherwise.
π __rte_experimental void rte_pmd_cnxk_hw_inline_inb_cfg_set (uint16_t portid, struct rte_pmd_cnxk_ipsec_inb_cfg * cfg)
Set the configuration for hardware inline inbound IPsec processing. This API must be called before calling the rte_eth_dev_configure API.
Parameters
- portid β Port identifier of Ethernet device.
- cfg β Pointer to the IPsec inbound configuration structure.
π __rte_experimental const char * rte_pmd_cnxk_model_str_get (void )
Retrieves model name on which it is running as a string.
Returns
Returns model string, ex. "cn10ka_a1"
π Author π
Generated automatically by Doxygen for DPDK from the source code.
okay that's the whole thing bestie, you ate that π
β¨ this was DPDK Version 25.11.3, page rte_pmd_cnxk.h(3) β and yes it's a real one, iykyk. go forth and configure your CNXK PMD, you absolute icon ππ¦ no cap, fr fr. π
π¦ where this page comes from
- ubuntu resolute: dpdk-doc 25.11.3-0ubuntu0.26.04.1 Β· BSD-3-Clause
- ubuntu stonking: dpdk-doc 25.11.3-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms