net/dpaa2: features and fixes for NXP DPAA2 drivers
Subsystems (4)
PATCH 8/13 net/dpaa2: identify Rx mbuf hash information by FLC
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
For default RSS distribution, mbuf is marked with RTE_MBUF_F_RX_RSS_HASH and the hash value from the high word of FLC.
Configure the flow steering action with FLC enabled to align the stashing setting with the RSS configuration. The TC ID and flow ID are packed into the FLC for mbuf Rx scheduling. An Rx mbuf received from the FS table is marked with RTE_MBUF_F_RX_FDIR along with the TC and flow ID decoded from the FLC low word.
Known limitations and follow-up items:
RTE_MBUF_F_RX_FDIR_ID is set without also setting RTE_MBUF_F_RX_FDIR. Applications conforming to the DPDK mbuf flags contract test RX_FDIR before reading hash.fdir.hi, so the ID value is never visible to them. The dump helper in the debug Rx path (dpaa2_dev_rx_print_parser_result, patch 10) also gates on RX_FDIR and therefore never prints this field either. RX_FDIR must be set together with RX_FDIR_ID; this will be corrected in a follow-up.
hash.fdir.hi carries the raw FLC low word as received from the hardware. This word encodes stash bits and the flow-mark bit in addition to the TC/flow-ID fields, so it is not a clean user-visible filter identifier. User-visible flow IDs should be delivered via RTE_FLOW_ACTION_TYPE_MARK into hash.fdir.hi with only the mark value. Masking out the non-ID bits will be addressed in a follow-up.
--- drivers/net/dpaa2/dpaa2_ethdev.h | 12 +++++++++ drivers/net/dpaa2/dpaa2_flow.c | 42 ++++++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 18 ++++++++++++-- 3 files changed, 70 insertions(+), 2 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.h +12 -0
@@ -282,6 +282,18 @@ enum dpaa2_ecpri_fafe_type {/* ECPRI shares SP context with VXLAN*/ #define DPAA2_ECPRI_MSG_OFFSET DPAA2_VXLAN_VNI_OFFSET +#define DPAA2_FS_FLC_FS_MARK_OFFSET \ + (DPAA2_FLC_DATA_STASHING + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_OFFSET \ + (DPAA2_FS_FLC_FS_MARK_OFFSET + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_BIT_SIZE (sizeof(uint8_t) * 8) +#define DPAA2_FS_FLC_TC_MASK ((1 << DPAA2_FS_FLC_TC_BIT_SIZE) - 1) + +#define DPAA2_FS_FLC_FLOW_OFFSET \ + (DPAA2_FS_FLC_TC_OFFSET + DPAA2_FS_FLC_TC_BIT_SIZE) +#define DPAA2_ECPRI_MAX_EXTRACT_NB 8struct ipv4_sd_addr_extract_rule {
drivers/net/dpaa2/dpaa2_flow.c +42 -0
61 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_rxtx.c +16 -2
@@ -58,6 +58,7 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,uint16_t frc =DPAA2_GET_FD_FRC_PARSE_SUM (fd);struct dpaa2_annot_hdr *annotation = (struct dpaa2_annot_hdr *)hw_annot_addr; +uint32_t flc_lo, tc, flow;if (unlikely (dpaa2_print_parser_result))dpaa2_print_parse_result (annotation);
@@ -118,8 +119,21 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,default : m->packet_type =dpaa2_dev_rx_parse_slow (m, annotation); } - m->hash.rss = fd->simple.flc_hi; - m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; + flc_lo = fd->simple.flc_lo; +if (flc_lo & (1 <<DPAA2_FS_FLC_FS_MARK_OFFSET )) { + m->ol_flags |=RTE_MBUF_F_RX_FDIR ; + tc = (flc_lo >>DPAA2_FS_FLC_TC_OFFSET ) & +DPAA2_FS_FLC_TC_MASK ; + flow = flc_lo >>DPAA2_FS_FLC_FLOW_OFFSET ; +rte_mbuf_sched_set (m, flow, tc,0 ); +DPAA2_PMD_DP_DEBUG ("FS frame received from TC[%d]->flow%d" , + tc, flow); + }else { + m->hash.rss = fd->simple.flc_hi; + m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; +DPAA2_PMD_DP_DEBUG ("Hash frame received with RSS(%08x)" , + m->hash.rss); + }if (dpaa2_enable_ts[m->port]) { *dpaa2_timestamp_dynfield (m) = annotation->word2;
Signature · 1 line
2.43.0
PATCH 9/13 net/dpaa2: add minimum key size support
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
The default size for a QoS key is 24 bytes. If the key size is smaller than the maximum, use the default (minimum) key size instead of always returning the maximum size (56 bytes). This allows smaller flow tables to be used when the extracted key fits within the default size.
--- drivers/net/dpaa2/dpaa2_flow.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/dpaa2/dpaa2_flow.c +5 -3
@@ -26,8 +26,11 @@static char *dpaa2_flow_control_log;static int dpaa2_sp_loaded =-1 ; +/* Default size of a key */ +#define DPNI_DEFAULT_KEY_SIZE 24 +enum dpaa2_flow_entry_size { -DPAA2_FLOW_ENTRY_MIN_SIZE = (DPNI_MAX_KEY_SIZE /2 ), +DPAA2_FLOW_ENTRY_MIN_SIZE =DPNI_DEFAULT_KEY_SIZE ,DPAA2_FLOW_ENTRY_MAX_SIZE =DPNI_MAX_KEY_SIZE };
@@ -4532,8 +4535,7 @@ dpaa2_flow_entry_size(uint16_t key_max_size)if (key_max_size >DPAA2_FLOW_ENTRY_MIN_SIZE )return DPAA2_FLOW_ENTRY_MAX_SIZE ; -/* Current MC only support fixed entry size(56)*/ -return DPAA2_FLOW_ENTRY_MAX_SIZE ; +return DPAA2_FLOW_ENTRY_MIN_SIZE ; } static inline int
Signature · 1 line
2.43.0
PATCH 10/13 net/dpaa2: restructure dpaa2 parser processing
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
Move the parse-result decoding into a dedicated header (dpaa2_parser_decode.h) so that the hardware parser fields are described in one place and shared between the flow code and the Rx path.
Functional changes in this commit:
Checksum flag ordering: dpaa2_dev_rx_parse() now invokes parse_slow before setting the L3/L4 checksum flags. In the previous code the checksum flags were set first. Both paths now set the checksum flags inside parse_slow, so the observable result is the same; however the ordering difference is noted here for review clarity.
IPV4/6_EXT, SCTP and ICMP ptype fast-path cases are removed from rx_parse_new and are now handled by dpaa2_dev_rx_parse_frc(). This is an intentional functional change: those protocols now always go through the FRC-based decode path rather than the dedicated fast-path branches.
Known limitations and follow-up items:
Rx timestamping regression: the dpaa2_enable_ts[] write of annotation->word2 into the timestamp dynfield, and the dpaa2_timestamp_rx_dynflag set, are removed from both parse paths and not re-added. After this commit dpaa2_enable_ts[] is set in dpaa2_eth_dev_configure() for RTE_ETH_RX_OFFLOAD_TIMESTAMP but the dynfield is never written. Rx timestamping is broken and must be restored in a follow-up.
hash.sched overlaps hash.fdir: dpaa2_dev_rx_mbuf_sched_set() writes m->hash.fdir.hi and then calls rte_mbuf_sched_set(), which writes hash.sched. The two unions share the same memory; traffic_class and color (bytes 4-5 of hash.sched) overwrite part of the fdir.hi value while RTE_MBUF_F_RX_FDIR_ID is still flagged. hash.sched is a Tx scheduling field, not an Rx report field. The two uses must be separated in a follow-up.
Parser dump broken: DPAA2_PRINT_RX_PARSER_RESULT sets the file-scope global dpaa2_print_parser_result, but the new helper tests DPAA2_RX_PRINT_PSR_RESULT_FLAG in priv->flags, which nothing sets. The orphaned global and the dead branch must be reconciled; the flag should be set from a devarg.
Dead code paths: priv->psr_dynfield_offset is initialised to -1 and never registered, so dpaa2_dev_rx_annot_prefetch(), dpaa2_dev_rx_parse_offset(), and struct dpaa2_dyn_rx_protocol_pos are dead. priv->sp_protocol is never assigned, so the GENEVE/inner IPv4 ptype block in rx_parse_new is also dead. These will be removed or completed in a follow-up.
--- drivers/net/dpaa2/dpaa2_ethdev.h | 172 ++- drivers/net/dpaa2/dpaa2_parse_dump.h | 374 ------ drivers/net/dpaa2/dpaa2_parser_decode.h | 1539 +++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_pmd_logs.h | 67 + drivers/net/dpaa2/dpaa2_rxtx.c | 332 ++--- 5 files changed, 1906 insertions(+), 578 deletions(-) delete mode 100644 drivers/net/dpaa2/dpaa2_parse_dump.h create mode 100644 drivers/net/dpaa2/dpaa2_parser_decode.h
drivers/net/dpaa2/dpaa2_ethdev.h +113 -59
@@ -21,6 +21,8 @@#include <mc/fsl_dpmac.h> #include "base/dpaa2_hw_dpni_annot.h" +#include "dpaa2_parser_decode.h" +#define DPAA2_MIN_RX_BUF_SIZE 512#define DPAA2_MAX_RX_PKT_LEN 10240/*WRIOP support*/
@@ -101,6 +103,7 @@#define DPAA2_DATA_STASHING_OFF RTE_BIT32(10)#define DPAAX_RX_ERROR_QUEUE_FLAG RTE_BIT32(11) +#define DPAA2_RX_PRINT_PSR_RESULT_FLAG RTE_BIT32(12)/* DPDMUX index for DPMAC */ #define DPAA2_DPDMUX_DPMAC_IDX 0
@@ -124,31 +127,62 @@ RTE_ETH_RSS_PPPOE)/* LX2 FRC Parsed values (Little Endian) */ -#define DPAA2_PKT_TYPE_ETHER 0x0060 -#define DPAA2_PKT_TYPE_IPV4 0x0000 -#define DPAA2_PKT_TYPE_IPV6 0x0020 +#define DPAA2_PKT_TYPE_ETHER \ + (DPAA2_PSR_SUMMARY_NONIP << DPAA2_PSR_SUMMARY_NON_IP_L2_BIT_SIZE) +#define DPAA2_PKT_TYPE_IPV4 \ + (DPAA2_PSR_SUMMARY_IPV4 << DPAA2_PSR_SUMMARY_L4_BIT_SIZE) +#define DPAA2_PKT_TYPE_IPV6 \ + (DPAA2_PSR_SUMMARY_IPV6 << DPAA2_PSR_SUMMARY_L4_BIT_SIZE) + +/**Tunnel*/ +#define DPAA2_PKT_TYPE_L3_EXT \ + (DPAA2_PSR_SUMMARY_L4_EXT << DPAA2_PSR_SUMMARY_L4_EXT_L3_POS) +#define DPAA2_PKT_TYPE_L3_EXT_IPV4 \ + (DPAA2_PSR_SUMMARY_IPV4 << DPAA2_PSR_SUMMARY_L4_EXT_BIT_SIZE) +#define DPAA2_PKT_TYPE_L3_EXT_IPV6 \ + (DPAA2_PSR_SUMMARY_IPV6 << DPAA2_PSR_SUMMARY_L4_EXT_BIT_SIZE)#define DPAA2_PKT_TYPE_IPV4_EXT \ - (0x0001 | DPAA2_PKT_TYPE_IPV4) + (DPAA2_PKT_TYPE_L3_EXT | DPAA2_PKT_TYPE_L3_EXT_IPV4)#define DPAA2_PKT_TYPE_IPV6_EXT \ - (0x0001 | DPAA2_PKT_TYPE_IPV6) + (DPAA2_PKT_TYPE_L3_EXT | DPAA2_PKT_TYPE_L3_EXT_IPV6) +#define DPAA2_PKT_TYPE_IPV4_EXT_GRE_IPV4 \ + (DPAA2_PKT_TYPE_IPV4_EXT | DPAA2_PSR_SUMMARY_GRE_IPV4) +#define DPAA2_PKT_TYPE_IPV4_EXT_GRE_IPV4_UDP_TCP \ + (DPAA2_PKT_TYPE_IPV4_EXT | DPAA2_PSR_SUMMARY_GRE_IPV4_UDP_TCP) +#define DPAA2_PKT_TYPE_IPV4_EXT_GRE_IPV6 \ + (DPAA2_PKT_TYPE_IPV4_EXT | DPAA2_PSR_SUMMARY_GRE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_EXT_GRE_IPV6_UDP_TCP \ + (DPAA2_PKT_TYPE_IPV4_EXT | DPAA2_PSR_SUMMARY_GRE_IPV6_UDP_TCP) +#define DPAA2_PKT_TYPE_IPV6_EXT_GRE_IPV4 \ + (DPAA2_PKT_TYPE_IPV6_EXT | DPAA2_PSR_SUMMARY_GRE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_EXT_GRE_IPV4_UDP_TCP \ + (DPAA2_PKT_TYPE_IPV6_EXT | DPAA2_PSR_SUMMARY_GRE_IPV4_UDP_TCP) +#define DPAA2_PKT_TYPE_IPV6_EXT_GRE_IPV6 \ + (DPAA2_PKT_TYPE_IPV6_EXT | DPAA2_PSR_SUMMARY_GRE_IPV6) +#define DPAA2_PKT_TYPE_IPV6_EXT_GRE_IPV6_UDP_TCP \ + (DPAA2_PKT_TYPE_IPV6_EXT | DPAA2_PSR_SUMMARY_GRE_IPV6_UDP_TCP) +#define DPAA2_PKT_TYPE_IPV4_TCP \ - (0x000e | DPAA2_PKT_TYPE_IPV4) + (DPAA2_PSR_SUMMARY_TCP | DPAA2_PKT_TYPE_IPV4)#define DPAA2_PKT_TYPE_IPV6_TCP \ - (0x000e | DPAA2_PKT_TYPE_IPV6) + (DPAA2_PSR_SUMMARY_TCP | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_IPV4_UDP \ - (0x0010 | DPAA2_PKT_TYPE_IPV4) + (DPAA2_PSR_SUMMARY_UDP | DPAA2_PKT_TYPE_IPV4)#define DPAA2_PKT_TYPE_IPV6_UDP \ - (0x0010 | DPAA2_PKT_TYPE_IPV6) -#define DPAA2_PKT_TYPE_IPV4_SCTP \ - (0x000f | DPAA2_PKT_TYPE_IPV4) -#define DPAA2_PKT_TYPE_IPV6_SCTP \ - (0x000f | DPAA2_PKT_TYPE_IPV6) + (DPAA2_PSR_SUMMARY_UDP | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_SCTP \ + (DPAA2_PSR_SUMMARY_SCTP | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_SCTP \ + (DPAA2_PSR_SUMMARY_SCTP | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_IPV4_ICMP \ - (0x0003 | DPAA2_PKT_TYPE_IPV4_EXT) + (DPAA2_PSR_SUMMARY_ICMP | DPAA2_PKT_TYPE_IPV4)#define DPAA2_PKT_TYPE_IPV6_ICMP \ - (0x0003 | DPAA2_PKT_TYPE_IPV6_EXT) -#define DPAA2_PKT_TYPE_VLAN_1 0x0160 -#define DPAA2_PKT_TYPE_VLAN_2 0x0260 + (DPAA2_PSR_SUMMARY_ICMP | DPAA2_PKT_TYPE_IPV6) + +#define DPAA2_PKT_TYPE_VLAN_1 0x0100 +#define DPAA2_PKT_TYPE_VLAN_2 0x0200 +#define DPAA2_PKT_TYPE_VLAN \ + (DPAA2_PKT_TYPE_VLAN_1 | DPAA2_PKT_TYPE_VLAN_2)/* mac counters */ #define DPAA2_MAC_NUM_STATS (DPMAC_CNT_EGR_CONTROL_FRAME + 1)
@@ -173,17 +207,33 @@ struct sw_buf_free {struct rte_mbuf *seg; }; -/* enable timestamp in mbuf*/ -extern bool dpaa2_enable_ts[]; -extern uint64_t dpaa2_timestamp_rx_dynflag; -extern int dpaa2_timestamp_dynfield_offset; -/* Externally defined */ extern const struct rte_flow_ops dpaa2_flow_ops;extern const struct rte_tm_ops dpaa2_tm_ops; -extern bool dpaa2_print_parser_result; +struct dpaa2_dyn_rx_protocol_pos { +uint8_t l3_offset; +uint8_t l4_offset; +uint8_t l5_offset; +uint8_t rsv; +}; + +#define L3_OFFSET_OF_MBUF_DYN 0 +#define L4_OFFSET_OF_MBUF_DYN 1 +#define L5_OFFSET_OF_MBUF_DYN 2 + +#define DPAA2_FS_FLC_FS_MARK_OFFSET \ + (DPAA2_FLC_DATA_STASHING + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_OFFSET \ + (DPAA2_FS_FLC_FS_MARK_OFFSET + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_BIT_SIZE (sizeof(uint8_t) * 8) +#define DPAA2_FS_FLC_TC_MASK ((1 << DPAA2_FS_FLC_TC_BIT_SIZE) - 1) + +#define DPAA2_FS_FLC_FLOW_OFFSET \ + (DPAA2_FS_FLC_TC_OFFSET + DPAA2_FS_FLC_TC_BIT_SIZE)#define DPAA2_FAPR_SIZE \ (sizeof(struct dpaa2_annot_hdr) - \
@@ -258,42 +308,6 @@ enum dpaa2_ecpri_fafe_type {#define DPAA2_PR_L5_OFF_OFFSET 31#define DPAA2_PR_NXTHDR_OFF_OFFSET 34 -/* Set by SP for vxlan distribution start*/ -#define DPAA2_VXLAN_IN_TCI_OFFSET 16 - -#define DPAA2_VXLAN_IN_DADDR0_OFFSET 20 -#define DPAA2_VXLAN_IN_DADDR1_OFFSET 22 -#define DPAA2_VXLAN_IN_DADDR2_OFFSET 24 -#define DPAA2_VXLAN_IN_DADDR3_OFFSET 25 -#define DPAA2_VXLAN_IN_DADDR4_OFFSET 26 -#define DPAA2_VXLAN_IN_DADDR5_OFFSET 28 - -#define DPAA2_VXLAN_IN_SADDR0_OFFSET 29 -#define DPAA2_VXLAN_IN_SADDR1_OFFSET 32 -#define DPAA2_VXLAN_IN_SADDR2_OFFSET 33 -#define DPAA2_VXLAN_IN_SADDR3_OFFSET 35 -#define DPAA2_VXLAN_IN_SADDR4_OFFSET 41 -#define DPAA2_VXLAN_IN_SADDR5_OFFSET 42 - -#define DPAA2_VXLAN_VNI_OFFSET 43 -#define DPAA2_VXLAN_IN_TYPE_OFFSET 46 -/* Set by SP for vxlan distribution end*/ - -/* ECPRI shares SP context with VXLAN*/ -#define DPAA2_ECPRI_MSG_OFFSET DPAA2_VXLAN_VNI_OFFSET - -#define DPAA2_FS_FLC_FS_MARK_OFFSET \ - (DPAA2_FLC_DATA_STASHING + DPAA2_FLC_STASHING_MAX_BIT_SIZE) - -#define DPAA2_FS_FLC_TC_OFFSET \ - (DPAA2_FS_FLC_FS_MARK_OFFSET + DPAA2_FLC_STASHING_MAX_BIT_SIZE) - -#define DPAA2_FS_FLC_TC_BIT_SIZE (sizeof(uint8_t) * 8) -#define DPAA2_FS_FLC_TC_MASK ((1 << DPAA2_FS_FLC_TC_BIT_SIZE) - 1) - -#define DPAA2_FS_FLC_FLOW_OFFSET \ - (DPAA2_FS_FLC_TC_OFFSET + DPAA2_FS_FLC_TC_BIT_SIZE) -#define DPAA2_ECPRI_MAX_EXTRACT_NB 8struct ipv4_sd_addr_extract_rule {
@@ -435,6 +449,7 @@ struct dpaa2_dev_priv {void *tx_conf_vq[MAX_TX_QUEUES *DPAA2_MAX_CHANNELS ];void *rx_err_vq;uint32_t flags;/*dpaa2 config flags */ +int psr_dynfield_offset;uint8_t max_mac_filters;uint8_t max_vlan_filters;uint8_t num_rx_tc;
@@ -474,6 +489,9 @@ struct dpaa2_dev_priv {uint64_t rx_timestamp;/*stores timestamp of last received tx confirmation packet on dev*/ uint64_t tx_timestamp; + +int rx_ts_offset; +uint64_t rx_ts_flag;/* stores pointer to next tx_conf queue that should be processed, * it corresponds to last packet transmitted */
@@ -482,6 +500,7 @@ struct dpaa2_dev_priv {struct rte_eth_dev *eth_dev;/**< Pointer back to holding ethdev */ rte_spinlock_t lpbk_qp_lock; +bool sp_protocol;uint8_t channel_inuse;/* Rx-interrupt mode latched at the first dev_configure */ uint8_t intr_mode;
@@ -513,6 +532,41 @@ static inline int dpaa2_dev_cmp_dpni_ver(struct dpaa2_dev_priv *priv,return priv->dpni_ver_major - ver_major; } +static inline void +dpaa2_dev_rx_print_parser_result (struct dpaa2_dev_priv *priv, +const struct qbman_fd *fd,const struct rte_mbuf *m) +{ +size_t fd_addr; +void *hw_annot_addr; + +if (likely (!(priv->flags &DPAA2_RX_PRINT_PSR_RESULT_FLAG ))) +return ; + +if (dpaa2_svr_family ==SVR_LX2160A ) +dpaa2_print_fd_frc (fd); + + fd_addr = (size_t )DPAA2_IOVA_TO_VADDR (DPAA2_GET_FD_ADDR (fd)); + hw_annot_addr = (void *)(fd_addr +DPAA2_FD_PTA_SIZE ); +dpaa2_print_parse_result (hw_annot_addr, priv->sp_protocol); +if (m->ol_flags &RTE_MBUF_F_RX_FDIR ) { +const struct rte_mbuf_sched *sched; +uint16_t i; +struct dpaa2_queue *rxq; + + sched = &m->hash.sched; +for (i =0 ; i <MAX_RX_QUEUES ; i++) { + rxq = priv->rx_vq[i]; +if (rxq->tc_index == sched->traffic_class && + rxq->flow_id == sched->queue_id) +break ; + } +DPAA2_PMD_DEBUG ("Directed to TC%d-flow%d(rxq%d), color(%d)" , + sched->traffic_class, sched->queue_id, i, sched->color); + }else if (m->ol_flags &RTE_MBUF_F_RX_RSS_HASH ) { +DPAA2_PMD_DEBUG ("Balanced with hash(0x%08x)" , m->hash.rss); + } +} +int dpaa2_distset_to_dpkg_profile_cfg (uint64_t req_dist_set,struct dpkg_profile_cfg *kg_cfg);
drivers/net/dpaa2/dpaa2_parse_dump.h deleted +0 -374
374 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_parser_decode.h new file +1539 -0
1,539 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_pmd_logs.h +67 -0
77 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_rxtx.c +187 -145
504 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 11/13 net/dpaa2: parse tunnel and fragmented packet types
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
Extend the Rx parser to identify additional packet types decoded from the hardware parser summary: IPv4/IPv6 fragments, IPsec ESP, and GTP-U / GTP-C tunnels. The new DPAA2_PKT_TYPE_* summary values are added and mapped to the matching RTE_PTYPE_* flags in the dpaa2_dev_rx_parse_new() switch, which is the LX2160A fast path that decodes the parse summary directly from the FD FRC field.
GTP-U and GTP-C are carried over UDP, so those two cases also report RTE_PTYPE_L4_UDP alongside the tunnel type, giving applications the complete outer L3/L4/tunnel description.
The four new types are also added to the array returned by dpaa2_supported_ptypes_get(), so that RTE_PTYPE_L4_FRAG, RTE_PTYPE_TUNNEL_ESP, RTE_PTYPE_TUNNEL_GTPU and RTE_PTYPE_TUNNEL_GTPC are advertised to applications that query the supported ptypes and not only set in the mbufs.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 4 ++++ drivers/net/dpaa2/dpaa2_ethdev.h | 16 ++++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 36 ++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+)
drivers/net/dpaa2/dpaa2_ethdev.c +4 -0
@@ -1371,6 +1371,10 @@ dpaa2_supported_ptypes_get(struct rte_eth_dev *dev, size_t *no_of_elements)RTE_PTYPE_L4_UDP ,RTE_PTYPE_L4_SCTP ,RTE_PTYPE_L4_ICMP , +RTE_PTYPE_L4_FRAG , +RTE_PTYPE_TUNNEL_ESP , +RTE_PTYPE_TUNNEL_GTPU , + RTE_PTYPE_TUNNEL_GTPC, }; if (dev->rx_pkt_burst == dpaa2_dev_prefetch_rx ||
drivers/net/dpaa2/dpaa2_ethdev.h +16 -0
@@ -162,6 +162,10 @@#define DPAA2_PKT_TYPE_IPV6_EXT_GRE_IPV6_UDP_TCP \ (DPAA2_PKT_TYPE_IPV6_EXT | DPAA2_PSR_SUMMARY_GRE_IPV6_UDP_TCP) +#define DPAA2_PKT_TYPE_IPV4_FRAG \ + (DPAA2_PSR_SUMMARY_IP_FRAG | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_FRAG \ + (DPAA2_PSR_SUMMARY_IP_FRAG | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_IPV4_TCP \ (DPAA2_PSR_SUMMARY_TCP | DPAA2_PKT_TYPE_IPV4)#define DPAA2_PKT_TYPE_IPV6_TCP \
@@ -178,6 +182,18 @@ (DPAA2_PSR_SUMMARY_ICMP | DPAA2_PKT_TYPE_IPV4)#define DPAA2_PKT_TYPE_IPV6_ICMP \ (DPAA2_PSR_SUMMARY_ICMP | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_ESP \ + (DPAA2_PSR_SUMMARY_IPSEC_ESP | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_ESP \ + (DPAA2_PSR_SUMMARY_IPSEC_ESP | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPU \ + (DPAA2_PSR_SUMMARY_GTPU | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPU \ + (DPAA2_PSR_SUMMARY_GTPU | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPC \ + (DPAA2_PSR_SUMMARY_GTPC | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPC \ + (DPAA2_PSR_SUMMARY_GTPC | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_VLAN_1 0x0100#define DPAA2_PKT_TYPE_VLAN_2 0x0200
drivers/net/dpaa2/dpaa2_rxtx.c +36 -0
@@ -153,6 +153,42 @@ dpaa2_dev_rx_parse_new(struct dpaa2_dev_priv *priv, m->packet_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 ;break ; +case DPAA2_PKT_TYPE_IPV4_FRAG : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_FRAG ; +break ; +case DPAA2_PKT_TYPE_IPV6_FRAG : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_FRAG ; +break ; +case DPAA2_PKT_TYPE_IPV4_ESP : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_TUNNEL_ESP ; +break ; +case DPAA2_PKT_TYPE_IPV6_ESP : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_TUNNEL_ESP ; +break ; +case DPAA2_PKT_TYPE_IPV4_GTPU : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPU ; +break ; +case DPAA2_PKT_TYPE_IPV6_GTPU : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPU ; +break ; +case DPAA2_PKT_TYPE_IPV4_GTPC : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPC ; +break ; +case DPAA2_PKT_TYPE_IPV6_GTPC : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPC ; +break ;case DPAA2_PKT_TYPE_ETHER : m->packet_type =RTE_PTYPE_L2_ETHER ;break ;
Signature · 1 line
2.43.0
PATCH 12/13 net/dpaa2: remove unused soft parser driver
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
The DPAA2 soft parser (SP) byte code has to be installed by the boot firmware before Linux starts; the WRIOP parser cannot be reprogrammed once the MC is up. Loading an SP image at run time from the PMD therefore never took effect, so the loader and its DPNI_SS_INGRESS plumbing were dead code and are removed.
The rte_flow VXLAN and eCPRI pattern items were only ever accepted while an SP image was believed to be loaded. With the SP gone they are rejected by dpaa2_dev_verify_patterns() before the configure switch is reached, so their handlers dpaa2_configure_flow_vxlan() and dpaa2_configure_flow_ecpri(), the switch cases that call them, the mask descriptors and the VXLAN_HF_VNI helper are removed as well. Both items are also dropped from the dpaa2 feature matrix so that the documented capabilities match the code.
--- doc/guides/nics/features/dpaa2.ini | 2 - doc/guides/rel_notes/release_26_11.rst | 9 + drivers/net/dpaa2/dpaa2_ethdev.c | 28 -- drivers/net/dpaa2/dpaa2_ethdev.h | 1 - drivers/net/dpaa2/dpaa2_flow.c | 564 +------------------------ drivers/net/dpaa2/dpaa2_recycle.c | 1 - drivers/net/dpaa2/dpaa2_sparser.c | 137 ------ drivers/net/dpaa2/dpaa2_sparser.h | 202 --------- drivers/net/dpaa2/meson.build | 1 - 9 files changed, 10 insertions(+), 935 deletions(-) delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.c delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.h
doc/guides/nics/features/dpaa2.ini +0 -2
@@ -36,7 +36,6 @@ Usage doc = Y [rte_flow items] ah = Y -ecpri = Y esp = Y eth = P gre = Y
@@ -51,7 +50,6 @@ sctp = Y tcp = Y udp = Y vlan = P -vxlan = Y [rte_flow actions] drop = Y
doc/guides/rel_notes/release_26_11.rst +9 -0
@@ -74,6 +74,15 @@ Removed Items Also, make sure to start the actual text at the margin. ======================================================= +* **Removed soft parser support from the dpaa2 net driver.** + + The DPAA2 soft parser (SP) blob has to be loaded by the boot firmware + before Linux starts, so loading it at run time from the PMD never took + effect. The unused SP loader has been removed, together with the rte_flow + VXLAN and eCPRI pattern items that were only accepted while an SP image + was believed to be loaded. Those two items are no longer advertised in + the dpaa2 feature matrix. + * Removed deprecated symbols: * fib: ``RTE_FIB6_IPV6_ADDR_SIZE``, ``RTE_FIB6_MAXDEPTH``
drivers/net/dpaa2/dpaa2_ethdev.c +0 -28
@@ -29,7 +29,6 @@#include <mc/fsl_dpmng.h> #include <mc/fsl_dpcon.h> #include "dpaa2_ethdev.h" -#include "dpaa2_sparser.h" #include <fsl_qbman_debug.h> #define DRIVER_LOOPBACK_MODE "drv_loopback"
@@ -3723,33 +3722,6 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) } eth_dev->data->mtu =RTE_ETHER_MTU ; -/*TODO To enable soft parser support DPAA2 driver needs to integrate -* with external entity to receive byte code for software sequence -* and same will be offload to the H/W using MC interface. -* Currently it is assumed that DPAA2 driver has byte code by some -* mean and same if offloaded to H/W. -*/ -if (getenv ("DPAA2_ENABLE_SOFT_PARSER" )) { -WRIOP_SS_INITIALIZER (priv); - ret =dpaa2_eth_load_wriop_soft_parser (priv,DPNI_SS_INGRESS ); -if (ret <0 ) { -DPAA2_PMD_ERR (" Error(%d) in loading softparser" , - ret); - goto init_err; - } - - ret =dpaa2_eth_enable_wriop_soft_parser (priv, -DPNI_SS_INGRESS ); -if (ret <0 ) { -DPAA2_PMD_ERR (" Error(%d) in enabling softparser" , - ret); - goto init_err; - } - } - - ret =dpaa2_soft_parser_loaded (); -if (ret >0 ) -DPAA2_PMD_INFO ("soft parser is loaded" );DPAA2_PMD_INFO ("%s: netdev created, connected to %s" , eth_dev->data->name, dpaa2_dev->ep_name);
drivers/net/dpaa2/dpaa2_ethdev.h +0 -1
@@ -661,7 +661,6 @@ int dpaa2_timesync_read_tx_timestamp(struct rte_eth_dev *dev,int dpaa2_dev_recycle_config (struct rte_eth_dev *eth_dev);int dpaa2_dev_recycle_deconfig (struct rte_eth_dev *eth_dev);int dpaa2_mtr_ops_get (struct rte_eth_dev *dev,void *ops); -int dpaa2_soft_parser_loaded (void );void dpaa2_dev_mac_setup_stats (struct rte_eth_dev *dev);
drivers/net/dpaa2/dpaa2_flow.c +1 -563
629 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_recycle.c +0 -1
@@ -23,7 +23,6 @@#include <dpaa2_hw_dpio.h> #include <mc/fsl_dpmng.h> #include "dpaa2_ethdev.h" -#include "dpaa2_sparser.h" #include <fsl_qbman_debug.h> #include <rte_io.h>
drivers/net/dpaa2/dpaa2_sparser.c deleted +0 -137
137 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_sparser.h deleted +0 -202
202 lines not on this page · raw message
drivers/net/dpaa2/meson.build +0 -1
@@ -17,7 +17,6 @@ sources = files( 'dpaa2_flow.c', 'dpaa2_recycle.c', 'dpaa2_rxtx.c', - 'dpaa2_sparser.c', 'dpaa2_ptp.c', 'mc/dprtc.c', 'mc/dpkg.c',
Signature · 1 line
2.43.0
PATCH 13/13 net/dpaa2: rename Rx queue flags
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
Rename the Rx-side device flags to a consistent DPAA2_RX_*_FLAG naming:DPAAX_RX_ERROR_QUEUE_FLAG becomes DPAA2_RX_ERROR_QUEUE_FLAG and DPAA2_DATA_STASHING_OFF becomes DPAA2_RX_DATA_STASHING_OFF_FLAG.
This is a mechanical rename with no functional change.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 10 +++++----- drivers/net/dpaa2/dpaa2_ethdev.h | 5 +++-- drivers/net/dpaa2/dpaa2_rxtx.c | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +5 -5
@@ -550,7 +550,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) goto fail; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { priv->rx_err_vq =rte_zmalloc ("dpni_rx_err" ,sizeof (struct dpaa2_queue ),0 );if (!priv->rx_err_vq) {
@@ -1041,7 +1041,7 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, options |=DPNI_QUEUE_OPT_FLC ; cfg.flc.stash_control = true;dpaa2_flc_stashing_clear_all (&cfg.flc.value); -if (priv->flags &DPAA2_DATA_STASHING_OFF ) { +if (priv->flags &DPAA2_RX_DATA_STASHING_OFF_FLAG ) {dpaa2_flc_stashing_set (DPAA2_FLC_DATA_STASHING ,0 , &cfg.flc.value); dpaa2_q->data_stashing_off =1 ;
@@ -1521,7 +1521,7 @@ dpaa2_dev_start(struct rte_eth_dev *dev) dpaa2_q->fqid = qid.fqid; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { ret =dpni_get_queue (dpni,CMD_PRI_LOW , priv->token,DPNI_QUEUE_RX_ERR ,0 ,0 , &cfg, &qid);if (ret) {
@@ -3479,7 +3479,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)if (dpaa2_get_devargs (dev->devargs,DRIVER_NO_DATA_STASHING ) ||getenv ("DPAA2_DATA_STASHING_OFF" )) { - priv->flags |=DPAA2_DATA_STASHING_OFF ; + priv->flags |=DPAA2_RX_DATA_STASHING_OFF_FLAG ;DPAA2_PMD_INFO ("Data stashing disabled" ); }
@@ -3586,7 +3586,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) }if (dpaa2_get_devargs (dev->devargs,DRIVER_ERROR_QUEUE )) { - priv->flags |=DPAAX_RX_ERROR_QUEUE_FLAG ; + priv->flags |=DPAA2_RX_ERROR_QUEUE_FLAG ;DPAA2_PMD_INFO ("Enable error queue" ); }
drivers/net/dpaa2/dpaa2_ethdev.h +3 -2
@@ -100,9 +100,10 @@#define DPAA2_TX_DYNAMIC_CONF_ENABLE RTE_BIT32(9)/* Disable data stashing (prefetch of packet data into CPU cache) */ -#define DPAA2_DATA_STASHING_OFF RTE_BIT32(10) +#define DPAA2_RX_DATA_STASHING_OFF_FLAG RTE_BIT32(10) + +#define DPAA2_RX_ERROR_QUEUE_FLAG RTE_BIT32(11) -#define DPAAX_RX_ERROR_QUEUE_FLAG RTE_BIT32(11)#define DPAA2_RX_PRINT_PSR_RESULT_FLAG RTE_BIT32(12)/* DPDMUX index for DPMAC */
drivers/net/dpaa2/dpaa2_rxtx.c +2 -2
@@ -864,7 +864,7 @@ dpaa2_dev_prefetch_rx_common(void *queue, struct rte_mbuf **bufs, q_storage = dpaa2_q->q_storage[rte_lcore_id ()]; -if (unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq);if (unlikely (!DPAA2_PER_LCORE_ETHRX_DPIO )) {
@@ -1136,7 +1136,7 @@ dpaa2_dev_rx_common(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;struct dpaa2_dev_priv *priv = eth_data->dev_private; -if (!by_channel &&unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (!by_channel &&unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq);if (by_channel) {
Signature · 1 line
2.43.0
Re: [PATCH v5-S2 00/13] net/dpaa2: flow, meter and parser features
In reply to Prashant GuptaQuoted 14 lines · On Thu, 1 Oct 2026 13:02:54 +0530 Prashant Gupta <[email protected]>…
This is the second of four series upstreaming the missing NXP dpaa2 driver changes. It does not depend on series 1 and can be applied independently. It adds the net/dpaa2 flow, metering and parser features:
- fix an integer overflow in the CCSR region mapping,
- set Tx confirmation on device init and support a larger burst size,
- support MPLS and PPPoE flow distribution, meter and policing, and the flow drop action, with a per-device default flow miss action,
- identify Rx mbuf hash information by FLC and add minimum key size support,
- restructure the parser processing, parse tunnel and fragmented packet types, remove the unused soft parser driver and rename the Rx queue flags.
Quoted 7 lines
Note that patch 12 removes the soft parser driver and, with it, the
rte_flowVXLAN and eCPRI pattern items that were only accepted while an SP image was believed to be loaded. Both items are dropped from the dpaa2 feature matrix and a release note is added.Every commit builds cleanly (including the aarch64 DPAA cross build with -Werror) and the series is bisectable.
Still have several open issues in AI review.
[PATCH v5-S2 00/13] net/dpaa2: flow, meter and parser updates
Applied to main (062b389). Patches 5 and 12 conflict in release_26_11.rst; applied with release notes excluded. Rebase. Per-commit build with -Dwerror=true passes for all 13 patches (x86, gcc, dpaa2 drivers only).
Series-level:
The v4 review comments for patches 5, 7, 8 and 10 were pasted into the commit messages as "Known limitations and follow-up items" instead of being fixed. Known regressions and bugs in new code are fixed before merge, not listed as TODOs. Several of the pasted items describe code no longer in the patch. Remove these sections and fix the issues.
Patch 1/13 net/dpaa2: fix integer overflow in CCSR region mapping
Info: the commit message says the old round-down did not account for offset + len crossing a page boundary, but "len = len & page_mask" is kept. All callers pass page-aligned addresses and touch only the first page, so nothing faults today. Map RTE_ALIGN_CEIL(offset + len, page_size) or drop the sentence.
Patch 3/13 net/dpaa2: support larger burst size
Info: on non-LX2160A or MC < 8.7 the accepted burst drops from 65536 to 0xF7FF. Say so in the commit message.
Patch 5/13 net/dpaa2: support meter and policing
Error: nothing in the tree calls dpni_set_rx_tc_policing() after this series. Every rte_mtr op returns success and only edits the software lists. Profile mode, unit, rates and policy red_drop are stored and never read. dpaa2.rst and the release note advertise policing that does not happen. Implement it or drop the patch.
Error: the "Known limitations" section describes code that is not in this patch (the /1000 conversion, the meter_create HW error sign, meter_destroy ignoring the dpni return).
Warning: profile_add and policy_add have no duplicate-ID check.
Warning: the profiles, policies and meters lists are never freed on dpaa2_dev_close().
Warning: s_dpaa2_mtr_capa is file-scope and written under the per-device meter_lock, so two ports race on it. s_err_msg is a shared static buffer returned through error->message. Use a local capa and constant strings.
Warning: capabilities still advertise color_aware_trtcm_rfc2698 and color_aware_trtcm_rfc4115.
Warning: dpaa2.ini adds "Rate limitation = Y", which the commit message itself says is wrong.
Warning: dpni_set_rx_tc_policing_v1() is declared and never defined. DPNI_POLICER_OPT_DO_NOT_RESET_COUNTERS is unused.
Info: of the four release note bullets, only metering belongs to this patch. Flow classification belongs with patch 4.
Patch 7/13 net/dpaa2: set default flow miss action per device
Error: default_flow = RTE_MIN(fs_entries, dist_queues) - 1 sends FS misses to DPNI flow dist_queues - 1. Rx queues mapflow_id = dist_idx % num_rxqueue_per_tc over all DPNI queues, so that flow is ethdev Rx queue dist_queues - 1 of the TC. An application that configures fewer Rx queues never polls it. Once a QUEUE or DROP rule exists, unmatched traffic is lost. Previously it went to flow 0. fs_entries is a table size, not a queue count.
Warning: the commit message says default_flow is "initialised to 0".
Warning: the commit message says a release note "should be added". Add it in this patch.
Patch 8/13 net/dpaa2: identify Rx mbuf hash information by FLC
Warning: "Known limitations" describes RX_FDIR_ID and a raw FLC word in hash.fdir.hi. The code sets RTE_MBUF_F_RX_FDIR and writes hash.sched. Remove the section.
Info: hash.sched is the rte_sched Tx field. The TC/flow it carries is the Rx queue the application already polled.
Patch 9/13 net/dpaa2: add minimum key size support
Warning: the removed comment says MC only supports 56-byte entries. State which MC version supports 24 bytes and gate on dpaa2_dev_cmp_dpni_ver() as patch 3 does.
Patch 10/13 net/dpaa2: restructure dpaa2 parser processing
Error: Rx timestamping is broken. The dynfield write is removed. dpaa2_enable_ts[] is set in dpaa2_eth_dev_configure() and never read. dpaa2_dev_rx_common() reads a dynfield nothing writes. Listing it as a known limitation does not make it acceptable.
Error: on non-LX2160A, dpaa2_dev_rx_parse() no longer sets L3/L4 checksum flags for the common IPv4/IPv6 TCP/UDP cases. The switch returns directly, and only parse_slow sets the flags. Before, the flags were set at function entry for every packet. Bad checksums are no longer reported. The commit message claim that the observable result is the same is false.
Error: dpaa2_dev_rx_parse_frc() starts withpacket_type = RTE_PTYPE_L4_NONFRAG (0x600) and ORs in L4 values. L4_TCP and L4_ICMP become 0x700 (L4_IGMP). L4_UDP and L4_SCTP collapse to NONFRAG. Per the commit message, ICMP and SCTP now always take this path on LX2160A, so every ICMP packet is reported as IGMP. GTPU/GTPC report L4 NONFRAG instead of UDP. Non-VLAN frames get no RTE_PTYPE_L2_ETHER. Assign the L4 type rather than OR it.
Warning: VLAN-tagged frames on LX2160A now take the fast switch with the VLAN bit stripped and report RTE_PTYPE_L2_ETHER. Before, they went to parse_slow and reported L2_ETHER_VLAN/QINQ. This is an undescribed functional change.
Warning: dpaa2_dev_rx_mbuf_sched_set() now also runs on the non-LX2160A path, so those SoCs report RX_RSS_HASH from flc_hi for the first time. This is not described.
Warning: the parser dump is dead. The env var sets dpaa2_print_parser_result, which is never read. The helper tests DPAA2_RX_PRINT_PSR_RESULT_FLAG, which nothing sets. Once wired up, its RX_FDIR branch walks rx_vq[0..MAX_RX_QUEUES) and dereferences rxq without a NULL check, but only nb_rx_queues entries exist.
Warning: psr_dynfield_offset is never registered, so dpaa2_dev_rx_annot_prefetch(), dpaa2_dev_rx_parse_offset() and struct dpaa2_dyn_rx_protocol_pos are dead. sp_protocol is never assigned, so the GENEVE block is dead. dpaa2_parser_ecpri_extract() and dpaa2_protocol_psr_bit_offset() are unused.
Patch 12/13 net/dpaa2: remove unused soft parser driver
Warning: rte_flow_create() does not call dpaa2_dev_verify_patterns(). In dpaa2_generic_flow_set() the default case sets ret = -ENOTSUP and breaks only out of the switch. The loop continues, and later item and action calls overwrite ret. With the VXLAN case gone, a pattern eth/ipv4/udp/vxlan/eth is installed with VXLAN ignored and the inner eth handled as in_tunnel. Return from the default case.
Info: soft parser leftovers remain: priv->ss_offset, ss_iova, ss_param_iova, sp_protocol, enum dpaa2_ecpri_fafe_type and DPAA2_ECPRI_MAX_EXTRACT_NB.
cover net/dpaa2: flow, meter and parser features
In reply to Prashant GuptaThis is the second of four series upstreaming the missing NXP dpaa2 driver changes. It does not depend on series 1 and can be applied independently. It adds the net/dpaa2 flow, metering and parser features:
- fix an integer overflow in the CCSR region mapping,
- set Tx confirmation on device init and support a larger burst size,
- support MPLS and PPPoE flow distribution, meter and policing, and the flow drop action, with a per-device default flow miss action,
- identify Rx mbuf hash information by FLC and add minimum key size support,
- restructure the parser processing, parse tunnel and fragmented packet types, remove the unused soft parser driver and rename the Rx queue flags.
Note that patch 12 removes the soft parser driver and, with it, the rte_flow VXLAN and eCPRI pattern items that were only accepted while an SP image was believed to be loaded. Both items are dropped from the dpaa2 feature matrix and a release note is added.
Every commit builds cleanly (including the aarch64 DPAA cross build with -Werror) and the series is bisectable.
Changes in v6:
- patch 10: dropped the inaccurate "no functional change is intended" claim; the commit message now enumerates the functional changes (checksum flag ordering, IPV4/6_EXT/SCTP/ICMP fast-path removal) and the known limitations that need follow-up work,
- patch 11: added RTE_PTYPE_L4_FRAG, RTE_PTYPE_TUNNEL_ESP, RTE_PTYPE_TUNNEL_GTPU and RTE_PTYPE_TUNNEL_GTPC to dpaa2_supported_ptypes_get() so the new types are advertised, and OR-ed RTE_PTYPE_L4_UDP into the GTP-U/GTP-C cases since GTP runs over UDP; corrected the commit message to name dpaa2_dev_rx_parse_new(),
- patch 12: removed the now-unreachable dpaa2_configure_flow_vxlan() and dpaa2_configure_flow_ecpri() handlers, their switch cases, mask descriptors and the VXLAN_HF_VNI helper; dropped the vxlan and ecpri entries from the dpaa2 feature matrix and added a release note; the commit message now explains that the SP must be loaded by firmware at boot, so runtime loading from the PMD never worked,
- patch 13: dropped the reference to a Tx confirmation rework that is not part of this series,
- patch 5: replaced the stack-allocated err_msg[] buffers whose address was stored in rte_mtr_error with string literals (-Wdangling-pointer).
Gagandeep Singh (7):
net/dpaa2: set Tx confirmation on device init net/dpaa2: support larger burst size net/dpaa2: support MPLS and PPPoE flow distribution net/dpaa2: support meter and policing net/dpaa2: support flow drop action net/dpaa2: set default flow miss action per device net/dpaa2: identify Rx mbuf hash information by FLC
Hemant Agrawal (4):
net/dpaa2: fix integer overflow in CCSR region mapping net/dpaa2: add minimum key size support net/dpaa2: restructure dpaa2 parser processing net/dpaa2: parse tunnel and fragmented packet types
Jun Yang (2):
net/dpaa2: remove unused soft parser driver
net/dpaa2: rename Rx queue flags
doc/guides/nics/dpaa2.rst | 1 + doc/guides/nics/features/dpaa2.ini | 4 +- doc/guides/rel_notes/release_26_11.rst | 18 + drivers/net/dpaa2/dpaa2_ethdev.c | 88 +- drivers/net/dpaa2/dpaa2_ethdev.h | 217 +++- drivers/net/dpaa2/dpaa2_flow.c | 620 +++------ drivers/net/dpaa2/dpaa2_meter.c | 758 +++++++++++ drivers/net/dpaa2/dpaa2_parse_dump.h | 374 ------ drivers/net/dpaa2/dpaa2_parser_decode.h | 1551 +++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_pmd_logs.h | 67 + drivers/net/dpaa2/dpaa2_recycle.c | 24 +- drivers/net/dpaa2/dpaa2_rxtx.c | 329 +++-- drivers/net/dpaa2/dpaa2_sparser.c | 137 -- drivers/net/dpaa2/dpaa2_sparser.h | 202 --- drivers/net/dpaa2/dpaa2_tm.c | 16 +- drivers/net/dpaa2/mc/dpni.c | 11 +- drivers/net/dpaa2/mc/fsl_dpni.h | 31 +- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 +- drivers/net/dpaa2/meson.build | 2 +- 19 files changed, 3032 insertions(+), 1421 deletions(-) create mode 100644 drivers/net/dpaa2/dpaa2_meter.c delete mode 100644 drivers/net/dpaa2/dpaa2_parse_dump.h create mode 100644 drivers/net/dpaa2/dpaa2_parser_decode.h delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.c delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.h
Signature · 1 line
2.43.0
PATCH 1/13 net/dpaa2: fix integer overflow in CCSR region mapping
From: Hemant Agrawal <[email protected]>
In lsx_ccsr_map_region, PAGE_SIZE is a macro defined as sysconf(_SC_PAGESIZE), which returns a signed long and may be negative on error. The value was used directly in size_t comparisons and passed to mmap, causing an integer overflow (Coverity CID 49765682).
The old round-down "len & PAGE_MASK" ignored the in-page offset: for a 4096-byte or 6656-byte len on a 64K-page kernel the masked result is 0, causing the mapping to fail, where the old code would have bumped len up to PAGE_SIZE. The correct mapping size must cover the region from the page-aligned start through offset + len.
Fix by calling sysconf(_SC_PAGESIZE) explicitly into a signed long, checking for a non-positive return before use, computing page_mask from the verified value, and using RTE_ALIGN_CEIL(offset + len, page_size) for map_len so that the mmap covers the full requested region regardless of page size. The page-aligned start address and the back-pointer offset are both derived from the same page_mask, keeping the three values consistent.
Coverity issue: 49765682
--- drivers/net/dpaa2/dpaa2_recycle.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/net/dpaa2/dpaa2_recycle.c +15 -8
@@ -176,6 +176,9 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)void *tmp;uint64_t start;uint64_t offset; +uint64_t page_mask; +long page_size; +size_t map_len; fd =open ("/dev/mem" ,O_RDWR );if (fd <0 ) {
@@ -183,20 +186,24 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)return NULL ; } - start = addr &PAGE_MASK ; + page_size =sysconf (_SC_PAGESIZE); +if (page_size <=0 ) { +close (fd); +return NULL ; + } + page_mask = ~((uint64_t )page_size -1 ); + start = addr & page_mask; offset = addr - start; - len = len &PAGE_MASK ; -if (len < (size_t )PAGE_SIZE ) - len =PAGE_SIZE ; + map_len =RTE_ALIGN_CEIL (offset + len, (size_t )page_size); - tmp =mmap (NULL , len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start); + tmp =mmap (NULL , map_len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start);close (fd); -if (tmp !=MAP_FAILED ) -return (uint8_t *)tmp + offset; -else +if (tmp ==MAP_FAILED )return NULL ; + +return (uint8_t *)tmp + offset; }static const uint8_t ls_sd1_prot_idx_map[] = {
Signature · 1 line
2.43.0
PATCH 2/13 net/dpaa2: set Tx confirmation on device init
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Move TX confirmation mode setting from TXQ setup to device initialization because TXQ0 is not always set up by the user.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 40 ++++++++++++-------------------- 1 file changed, 15 insertions(+), 25 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +15 -25
@@ -1153,7 +1153,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,struct dpni_queue tx_conf_cfg;struct dpni_queue tx_flow_cfg;uint8_t options =0 , flow_id; -uint8_t ceetm_ch_idx;uint16_t channel_id;struct dpni_queue_id qid;uint32_t tc_id;
@@ -1174,30 +1173,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,memset (&tx_conf_cfg,0 ,sizeof (struct dpni_queue ));memset (&tx_flow_cfg,0 ,sizeof (struct dpni_queue )); -if (!tx_queue_id) { -for (ceetm_ch_idx =0 ; - ceetm_ch_idx <= (priv->num_channels -1 ); - ceetm_ch_idx++) { -/*Set tx-conf and error configuration*/ -if (priv->flags &DPAA2_TX_CONF_ENABLE ) { - ret =dpni_set_tx_confirmation_mode (dpni, -CMD_PRI_LOW , priv->token, - ceetm_ch_idx, -DPNI_CONF_AFFINE ); - }else { - ret =dpni_set_tx_confirmation_mode (dpni, -CMD_PRI_LOW , priv->token, - ceetm_ch_idx, -DPNI_CONF_DISABLE ); - } -if (ret) { -DPAA2_PMD_ERR ("Error(%d) in tx conf setting" , - ret); -return ret; - } - } - } - tc_id = tx_queue_id % priv->num_tx_tc; channel_id = (uint8_t )(tx_queue_id / priv->num_tx_tc) % priv->num_channels; flow_id =0 ;
@@ -3624,6 +3599,21 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) goto init_err; } +for (i =0 ; i < priv->num_channels; i++) { +/*Set tx-conf and error configuration*/ +if (priv->flags &DPAA2_TX_CONF_ENABLE ) { + ret =dpni_set_tx_confirmation_mode (dpni_dev, +CMD_PRI_LOW , priv->token, i,DPNI_CONF_AFFINE ); + }else { + ret =dpni_set_tx_confirmation_mode (dpni_dev, +CMD_PRI_LOW , priv->token, i,DPNI_CONF_DISABLE ); + } +if (ret) { +DPAA2_PMD_ERR ("Error(%d) in tx conf setting" , ret); + goto init_err; + } + } +/* Allocate memory for storing MAC addresses. * Table of mac_filter_entries size is allocated so that RTE ether lib * can add MAC entries when rte_eth_dev_mac_addr_add is called.
Signature · 1 line
2.43.0
PATCH 3/13 net/dpaa2: support larger burst size
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Make burst size checks and MC command fields SoC-aware, enabling bursts larger than 64K on LX2160A with dpni version 8.7+.
The max_burst_size field in dpni_tx_shaping_cfg is widened to uint32_t and the MC command struct is updated to split the value across two 16-bit fields using the new DPNI_BURST_LO/HI macros.
--- drivers/net/dpaa2/dpaa2_tm.c | 16 +++++++++++----- drivers/net/dpaa2/mc/dpni.c | 11 +++++++++-- drivers/net/dpaa2/mc/fsl_dpni.h | 8 ++++++-- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 ++- 4 files changed, 28 insertions(+), 10 deletions(-)
drivers/net/dpaa2/dpaa2_tm.c +11 -5
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright 2020-2024 NXP +* Copyright 2020-2026 NXP */ #include <rte_ethdev.h>
@@ -10,14 +10,20 @@#include "dpaa2_pmd_logs.h" #include <dpaa2_hw_dpio.h> -#define DPAA2_BURST_MAX (64 * 1024) -#define DPAA2_SHAPER_MIN_RATE 0#define DPAA2_SHAPER_MAX_RATE 107374182400ull#define DPAA2_WEIGHT_MAX 24701#define DPAA2_PKT_ADJUST_LEN_MIN 0#define DPAA2_PKT_ADJUST_LEN_MAX 0x7ff +static inline uint32_t dpaa2_get_burst_max (struct dpaa2_dev_priv *priv) +{ +if (dpaa2_dev_cmp_dpni_ver (priv,8 ,7 ) >=0 ) +return (dpaa2_svr_family ==SVR_LX2160A ) ?229375 :0xF7FF ; + +return 0xF7FF ; +} +int dpaa2_tm_init (struct rte_eth_dev *dev) {
@@ -283,7 +289,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE , NULL, "committed rate is out of range\n"); -if (params->committed.size >DPAA2_BURST_MAX ) +if (params->committed.size >dpaa2_get_burst_max (priv))return -rte_tm_error_set (error,EINVAL ,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE ,NULL ,"committed size is out of range\n" );
@@ -293,7 +299,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE , NULL, "Peak rate is out of range\n"); -if (params->peak.size >DPAA2_BURST_MAX ) +if (params->peak.size >dpaa2_get_burst_max (priv))return -rte_tm_error_set (error,EINVAL ,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE ,NULL ,"Peak size is out of range\n" );
drivers/net/dpaa2/mc/dpni.c +9 -2
@@ -1106,6 +1106,7 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io, {struct dpni_cmd_set_tx_shaping *cmd_params;struct mc_command cmd = {0 }; +uint32_t tx_cr_burst, tx_er_burst;int coupled, lni_shaper;uint8_t channel_id;uint16_t oal;
@@ -1115,10 +1116,16 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io, cmd_flags, token); cmd_params = (struct dpni_cmd_set_tx_shaping *)cmd.params; + tx_cr_burst = tx_cr_shaper->max_burst_size; + tx_er_burst = tx_er_shaper->max_burst_size; cmd_params->tx_cr_max_burst_size = -cpu_to_le16 (tx_cr_shaper->max_burst_size); +cpu_to_le16 (DPNI_BURST_LO (tx_cr_burst)); cmd_params->tx_er_max_burst_size = -cpu_to_le16 (tx_er_shaper->max_burst_size); +cpu_to_le16 (DPNI_BURST_LO (tx_er_burst)); + cmd_params->tx_cr_max_burst_size_hi = +cpu_to_le16 (DPNI_BURST_HI (tx_cr_burst)); + cmd_params->tx_er_max_burst_size_hi = +cpu_to_le16 (DPNI_BURST_HI (tx_er_burst)); cmd_params->tx_cr_rate_limit =cpu_to_le32 (tx_cr_shaper->rate_limit); cmd_params->tx_er_rate_limit =
drivers/net/dpaa2/mc/fsl_dpni.h +6 -2
@@ -830,14 +830,18 @@ int dpni_get_link_state(struct fsl_mc_io *mc_io,uint16_t token, struct dpni_link_state *state); +#define DPNI_BURST_LO (burst) ((burst) & GENMASK(15, 0)) +#define DPNI_BURST_HI (burst) ((burst) >> 16) +/** * struct dpni_tx_shaping - Structure representing DPNI tx shaping configuration * @rate_limit: Rate in Mbits/s -* @max_burst_size: Burst size in bytes (up to 64KB) +* @max_burst_size: Burst size in bytes. Limits depend on the SoC (0x37FFF +* for LX2160A, 0xF7FF for all others) */ struct dpni_tx_shaping_cfg {uint32_t rate_limit; -uint16_t max_burst_size; +uint32_t max_burst_size; };/**
drivers/net/dpaa2/mc/fsl_dpni_cmd.h +2 -1
@@ -394,7 +394,8 @@ struct dpni_rsp_get_link_state {struct dpni_cmd_set_tx_shaping {uint16_t tx_cr_max_burst_size;uint16_t tx_er_max_burst_size; -uint32_t pad; +uint16_t tx_cr_max_burst_size_hi; +uint16_t tx_er_max_burst_size_hi;uint32_t tx_cr_rate_limit;uint32_t tx_er_rate_limit;/* from LSB: coupled:1, lni_shaper: 1*/
Signature · 1 line
2.43.0
PATCH 4/13 net/dpaa2: support MPLS and PPPoE flow distribution
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add rte_flow pattern support for MPLS and PPPoE items in the dpaa2 PMD flow engine.
For a pattern with no spec/mask, the frame is identified by its Frame Attribute Flag (FAF_MPLS_FRAM / FAF_PPPOE_PPP_FRAM) for both the QoS and flow steering tables. When a spec is present, the MPLS label (NH_FLD_MPLS_MPLSL_1) or the PPPoE session id (NH_FLD_PPPOE_SID) is added as a header extract rule for both tables.
NH_FLD_MPLS_MPLSL_1 with DPKG_FULL_FIELD causes MC to extract the full 4-byte MPLS LSE (label + TC + S + TTL). The original code passed sizeof(label_tc_s) = 3, so the driver key profile recorded the field as 3 bytes while MC placed 4 bytes in the key; any extract field added after MPLS was off by one byte, corrupting the key layout.
Fix by passing the full struct rte_flow_item_mpls pointer (spec/mask) with sizeof(*mask) = 4, so the key profile width matches the 4-byte field that MC extracts. The TTL byte has mask 0x00 in the default mask and is ignored for matching purposes.
--- doc/guides/nics/features/dpaa2.ini | 2 + drivers/net/dpaa2/dpaa2_flow.c | 196 +++++++++++++++++++++++++++++ 2 files changed, 198 insertions(+)
doc/guides/nics/features/dpaa2.ini +2 -0
@@ -43,6 +43,8 @@ gtp = Y icmp = Y ipv4 = Y ipv6 = Y +mpls = Y +pppoes = Y raw = Y sctp = Y tcp = Y
drivers/net/dpaa2/dpaa2_flow.c +196 -0
228 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 5/13 net/dpaa2: support meter and policing
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add support for the traffic metering and policing (rte_mtr) API. Meters map one-to-one to Rx TCs and are programmed via dpni_set_rx_tc_policing().
Additional corrections over the initial implementation --
- byte-mode rates converted correctly: bytes/s / 125 = Kbps
- packet-mode rates passed unchanged to firmware
- hardware programmed at create/update; policing disabled at destroy
- mtr_id validated against num_rx_tc before use
- color_aware capability cleared (FD[DROPP] not handled)
- duplicate-ID check and insertion both under meter_lock
- removed misleading "Rate limitation" entry from features/dpaa2.ini
--- doc/guides/nics/dpaa2.rst | 1 + doc/guides/rel_notes/release_26_11.rst | 5 + drivers/net/dpaa2/dpaa2_ethdev.c | 2 + drivers/net/dpaa2/dpaa2_ethdev.h | 29 + drivers/net/dpaa2/dpaa2_meter.c | 758 +++++++++++++++++++++++++ drivers/net/dpaa2/mc/fsl_dpni.h | 23 +- drivers/net/dpaa2/meson.build | 1 + 7 files changed, 815 insertions(+), 4 deletions(-) create mode 100644 drivers/net/dpaa2/dpaa2_meter.c
doc/guides/nics/dpaa2.rst +1 -0
@@ -407,6 +407,7 @@ Features of the DPAA2 PMD are: - Link flow control - Scattered and gather for TX and RX - Rx queue interrupts +- Traffic metering and policing - :ref:`dpaa2_dptmapi`
doc/guides/rel_notes/release_26_11.rst +5 -0
@@ -55,6 +55,11 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Updated NXP DPAA2 net driver.** + + * Added Tx queue based flow control and confirmation queue handling. + * Added software parser based packet dump for debugging. + * Added support for traffic metering and policing (rte_mtr API). Removed Items -------------
drivers/net/dpaa2/dpaa2_ethdev.c +2 -0
@@ -3320,6 +3320,7 @@ static struct eth_dev_ops dpaa2_ethdev_ops = { .rxq_info_get = dpaa2_rxq_info_get, .txq_info_get = dpaa2_txq_info_get, .tm_ops_get = dpaa2_tm_ops_get, + .mtr_ops_get = dpaa2_mtr_ops_get,#if defined(RTE_LIBRTE_IEEE1588 ) .timesync_enable = dpaa2_timesync_enable, .timesync_disable = dpaa2_timesync_disable,
@@ -3543,6 +3544,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->num_channels = attr.num_channels; priv->channel_inuse =0 ;rte_spinlock_init (&priv->lpbk_qp_lock); +rte_spinlock_init (&priv->meter_lock);/* only if the custom CG is enabled */ if (attr.options &DPNI_OPT_CUSTOM_CG )
drivers/net/dpaa2/dpaa2_ethdev.h +29 -0
@@ -385,6 +385,30 @@ struct extract_s {uint8_t *tc_extract_param[MAX_TCS ]; }; +struct dpaa2_dev_meter_profile { +LIST_ENTRY (dpaa2_dev_meter_profile) next; +uint32_t profile_id; +uint64_t cir; +uint64_t cbs; +uint64_t pir; +uint64_t pbs; +enum dpni_policer_mode mode; +enum dpni_policer_unit policer_unit; +}; + +struct dpaa2_dev_meter_policy { +LIST_ENTRY (dpaa2_dev_meter_policy) next; +uint32_t policy_id; +bool red_drop; +}; + +struct dpaa2_dev_meter { +LIST_ENTRY (dpaa2_dev_meter) next; +uint32_t meter_id; +uint32_t profile_id; +uint32_t policy_id; +}; +struct dpaa2_dev_priv {void *hw;int32_t hw_id;
@@ -411,6 +435,7 @@ struct dpaa2_dev_priv {uint8_t en_loose_ordered;uint8_t max_cgs;uint8_t cgid_in_use[MAX_RX_QUEUES ]; +rte_spinlock_t meter_lock;/* Current hash distribution size per RX TC, written by * dpaa2_setup_flow_dist_size() and read by reta_query / reta_update.
@@ -456,6 +481,9 @@ struct dpaa2_dev_priv {struct dpaa2_dev_flow *curr; LIST_HEAD(, dpaa2_dev_flow) flows; + LIST_HEAD(, dpaa2_dev_meter_profile) profiles; + LIST_HEAD(, dpaa2_dev_meter_policy) policies; + LIST_HEAD(, dpaa2_dev_meter) meters; LIST_HEAD(nodes, dpaa2_tm_node) nodes; LIST_HEAD(shaper_profiles, dpaa2_tm_shaper_profile) shaper_profiles; };
@@ -548,6 +576,7 @@ int dpaa2_timesync_read_tx_timestamp(struct rte_eth_dev *dev,int dpaa2_dev_recycle_config (struct rte_eth_dev *eth_dev);int dpaa2_dev_recycle_deconfig (struct rte_eth_dev *eth_dev); +int dpaa2_mtr_ops_get (struct rte_eth_dev *dev,void *ops);int dpaa2_soft_parser_loaded (void );void
drivers/net/dpaa2/dpaa2_meter.c new file +758 -0
758 lines not on this page · raw message
drivers/net/dpaa2/mc/fsl_dpni.h +19 -4
@@ -1111,6 +1111,11 @@ int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io,*/ #define DPNI_POLICER_OPT_DISCARD_RED 0x00000002 +/** +* Do NOT reset counters generally for policer update +*/ +#define DPNI_POLICER_OPT_DO_NOT_RESET_COUNTERS 0x00000004 +/** * enum dpni_policer_mode - selecting the policer mode * @DPNI_POLICER_MODE_NONE: Policer is disabled
@@ -1127,12 +1132,17 @@ enum dpni_policer_mode {/** * enum dpni_policer_unit - DPNI policer units -* @DPNI_POLICER_UNIT_BYTES: bytes units +* @DPNI_POLICER_UNIT_BYTES_L3: bytes units (for each frame takes into account +* FD length - L3 offset) * @DPNI_POLICER_UNIT_FRAMES: frames units +* @DPNI_POLICER_UNIT_BYTES_L2_WITHOUT_FCS: bytes units (for each frame takes +* into account FD length - L2 offset, which means L2 size without the 4 bytes +* for the FCS) */ enum dpni_policer_unit { -DPNI_POLICER_UNIT_BYTES =0 , -DPNI_POLICER_UNIT_FRAMES +DPNI_POLICER_UNIT_BYTES_L3 =0 , +DPNI_POLICER_UNIT_FRAMES , +DPNI_POLICER_UNIT_BYTES_L2_WITHOUT_FCS , };/**
@@ -1173,13 +1183,18 @@ struct dpni_rx_tc_policing_cfg {uint32_t ebs; }; -int dpni_set_rx_tc_policing (struct fsl_mc_io *mc_io,uint32_t cmd_flags,uint16_t token,uint8_t tc_id,const struct dpni_rx_tc_policing_cfg *cfg); +int dpni_set_rx_tc_policing_v1 (struct fsl_mc_io *mc_io, +uint32_t cmd_flags, +uint16_t token, +uint8_t tc_id, +const struct dpni_rx_tc_policing_cfg *cfg); + int dpni_get_rx_tc_policing(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token,
drivers/net/dpaa2/meson.build +1 -0
@@ -11,6 +11,7 @@ sources = files( 'base/dpaa2_hw_dpni.c', 'base/dpaa2_tlu_hash.c', 'dpaa2_tm.c', + 'dpaa2_meter.c', 'dpaa2_mux.c', 'dpaa2_ethdev.c', 'dpaa2_flow.c',
Signature · 1 line
2.43.0
PATCH 6/13 net/dpaa2: support flow drop action
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add support for the RTE_FLOW_ACTION_TYPE_DROP action in the dpaa2 flow engine. A flow rule with a drop action is programmed into the flow steering (FS) table with the DPNI_FS_OPT_DISCARD option so that matching frames are discarded by hardware.
The drop action is added to the supported action list, accepted during action verification, configured in the FS action path, handled in the generic flow-set action loop, and cleaned up in the flow destroy path.
--- drivers/net/dpaa2/dpaa2_flow.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/dpaa2/dpaa2_flow.c +7 -1
@@ -97,7 +97,8 @@ enum rte_flow_action_type dpaa2_supported_action_type[] = {RTE_FLOW_ACTION_TYPE_QUEUE ,RTE_FLOW_ACTION_TYPE_PORT_ID ,RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT , - RTE_FLOW_ACTION_TYPE_RSS +RTE_FLOW_ACTION_TYPE_RSS , + RTE_FLOW_ACTION_TYPE_DROP };#ifndef __cplusplus
@@ -4421,6 +4422,7 @@ dpaa2_flow_verify_action(struct dpaa2_dev_priv *priv,break ;case RTE_FLOW_ACTION_TYPE_PF :/* Skip this action, have to add for vxlan */ +case RTE_FLOW_ACTION_TYPE_DROP :break ;case RTE_FLOW_ACTION_TYPE_END : end_of_list =1 ;
@@ -4468,6 +4470,8 @@ dpaa2_configure_flow_fs_action(struct dpaa2_dev_priv *priv, flow->fs_action_cfg.redirect_obj_token = dest_priv->token; flow->fs_action_cfg.flow_id = dest_q->flow_id; + }else if (flow->action_type ==RTE_FLOW_ACTION_TYPE_DROP ) { + flow->fs_action_cfg.options =DPNI_FS_OPT_DISCARD ; }return 0 ;
@@ -4945,6 +4949,7 @@ dpaa2_generic_flow_set(struct dpaa2_dev_flow *flow,case RTE_FLOW_ACTION_TYPE_QUEUE :case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT :case RTE_FLOW_ACTION_TYPE_PORT_ID : +case RTE_FLOW_ACTION_TYPE_DROP : ret =dpaa2_configure_flow_fs_action (priv, flow, &actions[j]);if (ret)
@@ -5346,6 +5351,7 @@ dpaa2_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *_flow,case RTE_FLOW_ACTION_TYPE_QUEUE :case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT :case RTE_FLOW_ACTION_TYPE_PORT_ID : +case RTE_FLOW_ACTION_TYPE_DROP :if (priv->num_rx_tc >1 ) {/* Remove entry from QoS table first */ ret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW,
Signature · 1 line
2.43.0
PATCH 7/13 net/dpaa2: set default flow miss action per device
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
The flow steering miss flow id was a file-scope global defaulting to 0 and optionally overridden via the DPAA2_FLOW_CONTROL_MISS_FLOW environment variable. Replace it with a per-device default_flow field in dpaa2_dev_priv, initialised to 0 at probe time, so that each device has its own independent miss-flow setting.
The DPAA2_FLOW_CONTROL_MISS_FLOW environment variable is removed. Users who relied on it must use the rte_flow API instead.
--- doc/guides/rel_notes/release_26_11.rst | 4 ++++ drivers/net/dpaa2/dpaa2_ethdev.c | 2 ++ drivers/net/dpaa2/dpaa2_ethdev.h | 2 ++ drivers/net/dpaa2/dpaa2_flow.c | 14 +------------- 4 files changed, 9 insertions(+), 13 deletions(-)
doc/guides/rel_notes/release_26_11.rst +4 -0
@@ -60,6 +60,10 @@ New Features * Added Tx queue based flow control and confirmation queue handling. * Added software parser based packet dump for debugging. * Added support for traffic metering and policing (rte_mtr API). + * Removed ``DPAA2_FLOW_CONTROL_MISS_FLOW`` environment variable. The + per-device FS table miss flow id is now fixed at 0. Users who + previously redirected unmatched frames to a specific queue via this + variable must use the rte_flow API instead. Removed Items -------------
drivers/net/dpaa2/dpaa2_ethdev.c +2 -0
@@ -3543,6 +3543,8 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->dist_queues = attr.num_queues; priv->num_channels = attr.num_channels; priv->channel_inuse =0 ; + priv->default_flow =RTE_MIN (priv->fs_entries, + priv->dist_queues) -1 ;rte_spinlock_init (&priv->lpbk_qp_lock);rte_spinlock_init (&priv->meter_lock);
drivers/net/dpaa2/dpaa2_ethdev.h +2 -0
@@ -436,6 +436,8 @@ struct dpaa2_dev_priv {uint8_t max_cgs;uint8_t cgid_in_use[MAX_RX_QUEUES ];rte_spinlock_t meter_lock; +/* Lowest priority FS flow id to receive flow steering miss frames. */ +uint16_t default_flow;/* Current hash distribution size per RX TC, written by * dpaa2_setup_flow_dist_size() and read by reta_query / reta_update.
drivers/net/dpaa2/dpaa2_flow.c +1 -13
@@ -24,7 +24,6 @@#include <dpaa2_pmd_logs.h> static char *dpaa2_flow_control_log; -static uint16_t dpaa2_flow_miss_flow_id;/* Default miss flow id is 0. */ static int dpaa2_sp_loaded =-1 ;enum dpaa2_flow_entry_size {
@@ -4590,7 +4589,7 @@ dpaa2_configure_fs_rss_table(struct dpaa2_dev_priv *priv,return 0 ; tc_cfg.enable = true; - tc_cfg.fs_miss_flow_id = dpaa2_flow_miss_flow_id; + tc_cfg.fs_miss_flow_id = priv->default_flow; ret =dpni_set_rx_fs_dist (dpni,CMD_PRI_LOW , priv->token, &tc_cfg);if (ret <0 ) {
@@ -5224,17 +5223,6 @@ dpaa2_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, dpaa2_flow_control_log =getenv ("DPAA2_FLOW_CONTROL_LOG" ); -if (getenv ("DPAA2_FLOW_CONTROL_MISS_FLOW" )) { - dpaa2_flow_miss_flow_id = - (uint16_t )atoi (getenv ("DPAA2_FLOW_CONTROL_MISS_FLOW" )); -if (dpaa2_flow_miss_flow_id >= priv->dist_queues) { -DPAA2_PMD_ERR ("Missed flow ID %d >= dist size(%d)" , - dpaa2_flow_miss_flow_id, - priv->dist_queues); -return NULL ; - } - } - flow =rte_zmalloc (NULL ,sizeof (struct dpaa2_dev_flow ),RTE_CACHE_LINE_SIZE );if (!flow) {
Signature · 1 line
2.43.0
PATCH 8/13 net/dpaa2: identify Rx mbuf hash information by FLC
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
For default RSS distribution, the mbuf is marked with RTE_MBUF_F_RX_RSS_HASH and the hash value is taken from the high word of FLC.
Configure the flow steering action with FLC enabled to align the stashing setting with the RSS configuration. The TC ID and flow ID are packed into the FLC low word by the hardware. An Rx mbuf received from the FS table has the FS_MARK bit set in FLC low word; such mbufs are marked with RTE_MBUF_F_RX_FDIR and the TC and flow ID are stored via rte_mbuf_sched_set() for use by the scheduler.
--- drivers/net/dpaa2/dpaa2_ethdev.h | 12 +++++++++ drivers/net/dpaa2/dpaa2_flow.c | 42 ++++++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 18 ++++++++++++-- 3 files changed, 70 insertions(+), 2 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.h +12 -0
@@ -282,6 +282,18 @@ enum dpaa2_ecpri_fafe_type {/* ECPRI shares SP context with VXLAN*/ #define DPAA2_ECPRI_MSG_OFFSET DPAA2_VXLAN_VNI_OFFSET +#define DPAA2_FS_FLC_FS_MARK_OFFSET \ + (DPAA2_FLC_DATA_STASHING + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_OFFSET \ + (DPAA2_FS_FLC_FS_MARK_OFFSET + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_BIT_SIZE (sizeof(uint8_t) * 8) +#define DPAA2_FS_FLC_TC_MASK ((1 << DPAA2_FS_FLC_TC_BIT_SIZE) - 1) + +#define DPAA2_FS_FLC_FLOW_OFFSET \ + (DPAA2_FS_FLC_TC_OFFSET + DPAA2_FS_FLC_TC_BIT_SIZE) +#define DPAA2_ECPRI_MAX_EXTRACT_NB 8struct ipv4_sd_addr_extract_rule {
drivers/net/dpaa2/dpaa2_flow.c +42 -0
61 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_rxtx.c +16 -2
@@ -58,6 +58,7 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,uint16_t frc =DPAA2_GET_FD_FRC_PARSE_SUM (fd);struct dpaa2_annot_hdr *annotation = (struct dpaa2_annot_hdr *)hw_annot_addr; +uint32_t flc_lo, tc, flow;if (unlikely (dpaa2_print_parser_result))dpaa2_print_parse_result (annotation);
@@ -118,8 +119,21 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,default : m->packet_type =dpaa2_dev_rx_parse_slow (m, annotation); } - m->hash.rss = fd->simple.flc_hi; - m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; + flc_lo = fd->simple.flc_lo; +if (flc_lo & (1 <<DPAA2_FS_FLC_FS_MARK_OFFSET )) { + m->ol_flags |=RTE_MBUF_F_RX_FDIR ; + tc = (flc_lo >>DPAA2_FS_FLC_TC_OFFSET ) & +DPAA2_FS_FLC_TC_MASK ; + flow = flc_lo >>DPAA2_FS_FLC_FLOW_OFFSET ; +rte_mbuf_sched_set (m, flow, tc,0 ); +DPAA2_PMD_DP_DEBUG ("FS frame received from TC[%d]->flow%d" , + tc, flow); + }else { + m->hash.rss = fd->simple.flc_hi; + m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; +DPAA2_PMD_DP_DEBUG ("Hash frame received with RSS(%08x)" , + m->hash.rss); + }if (dpaa2_enable_ts[m->port]) { *dpaa2_timestamp_dynfield (m) = annotation->word2;
Signature · 1 line
2.43.0
PATCH 9/13 net/dpaa2: add minimum key size support
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
The default size for a QoS key is 24 bytes. If the key size is smaller than the maximum, use the default (minimum) key size instead of always returning the maximum size (56 bytes). This allows smaller flow tables to be used when the extracted key fits within the default size.
--- drivers/net/dpaa2/dpaa2_flow.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/dpaa2/dpaa2_flow.c +5 -3
@@ -26,8 +26,11 @@static char *dpaa2_flow_control_log;static int dpaa2_sp_loaded =-1 ; +/* Default size of a key */ +#define DPNI_DEFAULT_KEY_SIZE 24 +enum dpaa2_flow_entry_size { -DPAA2_FLOW_ENTRY_MIN_SIZE = (DPNI_MAX_KEY_SIZE /2 ), +DPAA2_FLOW_ENTRY_MIN_SIZE =DPNI_DEFAULT_KEY_SIZE ,DPAA2_FLOW_ENTRY_MAX_SIZE =DPNI_MAX_KEY_SIZE };
@@ -4532,8 +4535,7 @@ dpaa2_flow_entry_size(uint16_t key_max_size)if (key_max_size >DPAA2_FLOW_ENTRY_MIN_SIZE )return DPAA2_FLOW_ENTRY_MAX_SIZE ; -/* Current MC only support fixed entry size(56)*/ -return DPAA2_FLOW_ENTRY_MAX_SIZE ; +return DPAA2_FLOW_ENTRY_MIN_SIZE ; } static inline int
Signature · 1 line
2.43.0
PATCH 10/13 net/dpaa2: restructure dpaa2 parser processing
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
Move parse-result decoding into dpaa2_parser_decode.h, shared between the flow code and the Rx path.
IPV4/6_EXT, SCTP and ICMP ptypes are removed from the rx_parse_new fast-path switch and now go through dpaa2_dev_rx_parse_frc().
Also included in this commit are
- Restore Rx timestamp: write annotation->word2 into the dynfield in dpaa2_dev_rx_parse_new() when dpaa2_enable_ts[] is set.
- Drop RTE_MBUF_F_RX_FDIR from dpaa2_dev_rx_mbuf_sched_set(): hash.sched overlaps hash.fdir; only hash.sched is written via rte_mbuf_sched_set().
- Parser dump wired up -- set DPAA2_RX_PRINT_PSR_RESULT_FLAG in priv->flags from the DPAA2_PRINT_RX_PARSER_RESULT env var so the dump helper fires.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.h | 176 ++- drivers/net/dpaa2/dpaa2_parse_dump.h | 374 ------ drivers/net/dpaa2/dpaa2_parser_decode.h | 1551 +++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_pmd_logs.h | 67 + drivers/net/dpaa2/dpaa2_rxtx.c | 323 +++-- 6 files changed, 1938 insertions(+), 555 deletions(-) delete mode 100644 drivers/net/dpaa2/dpaa2_parse_dump.h create mode 100644 drivers/net/dpaa2/dpaa2_parser_decode.h
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -3594,7 +3594,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) }if (getenv ("DPAA2_PRINT_RX_PARSER_RESULT" )) - dpaa2_print_parser_result =1 ; + priv->flags |=DPAA2_RX_PRINT_PSR_RESULT_FLAG ;/* Allocate memory for hardware structure for queues */ ret =dpaa2_alloc_rx_tx_queues (eth_dev);
drivers/net/dpaa2/dpaa2_ethdev.h +118 -58
245 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_parse_dump.h deleted +0 -374
374 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_parser_decode.h new file +1551 -0
1,551 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_pmd_logs.h +67 -0
77 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_rxtx.c +201 -122
511 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 11/13 net/dpaa2: parse tunnel and fragmented packet types
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
Extend dpaa2_dev_rx_parse_new() (LX2160A FRC fast path) with new DPAA2_PKT_TYPE_* cases for IPv4/IPv6 fragments, IPsec ESP, and GTP-U/C.
GTP-U and GTP-C cases include RTE_PTYPE_L4_UDP to reflect the UDP outer transport. All four new types are also added to dpaa2_supported_ptypes_get() so applications that query supported ptypes see them advertised.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 4 ++++ drivers/net/dpaa2/dpaa2_ethdev.h | 16 ++++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 36 ++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+)
drivers/net/dpaa2/dpaa2_ethdev.c +4 -0
@@ -1371,6 +1371,10 @@ dpaa2_supported_ptypes_get(struct rte_eth_dev *dev, size_t *no_of_elements)RTE_PTYPE_L4_UDP ,RTE_PTYPE_L4_SCTP ,RTE_PTYPE_L4_ICMP , +RTE_PTYPE_L4_FRAG , +RTE_PTYPE_TUNNEL_ESP , +RTE_PTYPE_TUNNEL_GTPU , + RTE_PTYPE_TUNNEL_GTPC, }; if (dev->rx_pkt_burst == dpaa2_dev_prefetch_rx ||
drivers/net/dpaa2/dpaa2_ethdev.h +16 -0
@@ -162,6 +162,10 @@#define DPAA2_PKT_TYPE_IPV6_EXT_GRE_IPV6_UDP_TCP \ (DPAA2_PKT_TYPE_IPV6_EXT | DPAA2_PSR_SUMMARY_GRE_IPV6_UDP_TCP) +#define DPAA2_PKT_TYPE_IPV4_FRAG \ + (DPAA2_PSR_SUMMARY_IP_FRAG | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_FRAG \ + (DPAA2_PSR_SUMMARY_IP_FRAG | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_IPV4_TCP \ (DPAA2_PSR_SUMMARY_TCP | DPAA2_PKT_TYPE_IPV4)#define DPAA2_PKT_TYPE_IPV6_TCP \
@@ -178,6 +182,18 @@ (DPAA2_PSR_SUMMARY_ICMP | DPAA2_PKT_TYPE_IPV4)#define DPAA2_PKT_TYPE_IPV6_ICMP \ (DPAA2_PSR_SUMMARY_ICMP | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_ESP \ + (DPAA2_PSR_SUMMARY_IPSEC_ESP | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_ESP \ + (DPAA2_PSR_SUMMARY_IPSEC_ESP | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPU \ + (DPAA2_PSR_SUMMARY_GTPU | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPU \ + (DPAA2_PSR_SUMMARY_GTPU | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPC \ + (DPAA2_PSR_SUMMARY_GTPC | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPC \ + (DPAA2_PSR_SUMMARY_GTPC | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_VLAN_1 0x0100#define DPAA2_PKT_TYPE_VLAN_2 0x0200
drivers/net/dpaa2/dpaa2_rxtx.c +36 -0
@@ -166,6 +166,42 @@ dpaa2_dev_rx_parse_new(struct dpaa2_dev_priv *priv, m->packet_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 ;break ; +case DPAA2_PKT_TYPE_IPV4_FRAG : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_FRAG ; +break ; +case DPAA2_PKT_TYPE_IPV6_FRAG : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_FRAG ; +break ; +case DPAA2_PKT_TYPE_IPV4_ESP : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_TUNNEL_ESP ; +break ; +case DPAA2_PKT_TYPE_IPV6_ESP : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_TUNNEL_ESP ; +break ; +case DPAA2_PKT_TYPE_IPV4_GTPU : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPU ; +break ; +case DPAA2_PKT_TYPE_IPV6_GTPU : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPU ; +break ; +case DPAA2_PKT_TYPE_IPV4_GTPC : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPC ; +break ; +case DPAA2_PKT_TYPE_IPV6_GTPC : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPC ; +break ;case DPAA2_PKT_TYPE_ETHER : m->packet_type =RTE_PTYPE_L2_ETHER ;break ;
Signature · 1 line
2.43.0
PATCH 12/13 net/dpaa2: remove unused soft parser driver
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
The DPAA2 soft parser (SP) byte code has to be installed by the boot firmware before Linux starts; the WRIOP parser cannot be reprogrammed once the MC is up. Loading an SP image at run time from the PMD therefore never took effect, so the loader and its DPNI_SS_INGRESS plumbing were dead code and are removed.
The rte_flow VXLAN and eCPRI pattern items were only ever accepted while an SP image was believed to be loaded. With the SP gone they are rejected by dpaa2_dev_verify_patterns() before the configure switch is reached, so their handlers dpaa2_configure_flow_vxlan() and dpaa2_configure_flow_ecpri(), the switch cases that call them, the mask descriptors and the VXLAN_HF_VNI helper are removed as well. Both items are also dropped from the dpaa2 feature matrix so that the documented capabilities match the code.
--- doc/guides/nics/features/dpaa2.ini | 2 - doc/guides/rel_notes/release_26_11.rst | 9 + drivers/net/dpaa2/dpaa2_ethdev.c | 28 -- drivers/net/dpaa2/dpaa2_ethdev.h | 1 - drivers/net/dpaa2/dpaa2_flow.c | 564 +------------------------ drivers/net/dpaa2/dpaa2_recycle.c | 1 - drivers/net/dpaa2/dpaa2_sparser.c | 137 ------ drivers/net/dpaa2/dpaa2_sparser.h | 202 --------- drivers/net/dpaa2/meson.build | 1 - 9 files changed, 10 insertions(+), 935 deletions(-) delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.c delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.h
doc/guides/nics/features/dpaa2.ini +0 -2
@@ -35,7 +35,6 @@ Usage doc = Y [rte_flow items] ah = Y -ecpri = Y esp = Y eth = P gre = Y
@@ -50,7 +49,6 @@ sctp = Y tcp = Y udp = Y vlan = P -vxlan = Y [rte_flow actions] drop = Y
doc/guides/rel_notes/release_26_11.rst +9 -0
@@ -77,6 +77,15 @@ Removed Items Also, make sure to start the actual text at the margin. ======================================================= +* **Removed soft parser support from the dpaa2 net driver.** + + The DPAA2 soft parser (SP) blob has to be loaded by the boot firmware + before Linux starts, so loading it at run time from the PMD never took + effect. The unused SP loader has been removed, together with the rte_flow + VXLAN and eCPRI pattern items that were only accepted while an SP image + was believed to be loaded. Those two items are no longer advertised in + the dpaa2 feature matrix. + * Removed deprecated symbols: * fib: ``RTE_FIB6_IPV6_ADDR_SIZE``, ``RTE_FIB6_MAXDEPTH``
drivers/net/dpaa2/dpaa2_ethdev.c +0 -28
@@ -29,7 +29,6 @@#include <mc/fsl_dpmng.h> #include <mc/fsl_dpcon.h> #include "dpaa2_ethdev.h" -#include "dpaa2_sparser.h" #include <fsl_qbman_debug.h> #define DRIVER_LOOPBACK_MODE "drv_loopback"
@@ -3723,33 +3722,6 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) } eth_dev->data->mtu =RTE_ETHER_MTU ; -/*TODO To enable soft parser support DPAA2 driver needs to integrate -* with external entity to receive byte code for software sequence -* and same will be offload to the H/W using MC interface. -* Currently it is assumed that DPAA2 driver has byte code by some -* mean and same if offloaded to H/W. -*/ -if (getenv ("DPAA2_ENABLE_SOFT_PARSER" )) { -WRIOP_SS_INITIALIZER (priv); - ret =dpaa2_eth_load_wriop_soft_parser (priv,DPNI_SS_INGRESS ); -if (ret <0 ) { -DPAA2_PMD_ERR (" Error(%d) in loading softparser" , - ret); - goto init_err; - } - - ret =dpaa2_eth_enable_wriop_soft_parser (priv, -DPNI_SS_INGRESS ); -if (ret <0 ) { -DPAA2_PMD_ERR (" Error(%d) in enabling softparser" , - ret); - goto init_err; - } - } - - ret =dpaa2_soft_parser_loaded (); -if (ret >0 ) -DPAA2_PMD_INFO ("soft parser is loaded" );DPAA2_PMD_INFO ("%s: netdev created, connected to %s" , eth_dev->data->name, dpaa2_dev->ep_name);
drivers/net/dpaa2/dpaa2_ethdev.h +0 -1
@@ -667,7 +667,6 @@ int dpaa2_timesync_read_tx_timestamp(struct rte_eth_dev *dev,int dpaa2_dev_recycle_config (struct rte_eth_dev *eth_dev);int dpaa2_dev_recycle_deconfig (struct rte_eth_dev *eth_dev);int dpaa2_mtr_ops_get (struct rte_eth_dev *dev,void *ops); -int dpaa2_soft_parser_loaded (void );void dpaa2_dev_mac_setup_stats (struct rte_eth_dev *dev);
drivers/net/dpaa2/dpaa2_flow.c +1 -563
629 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_recycle.c +0 -1
@@ -23,7 +23,6 @@#include <dpaa2_hw_dpio.h> #include <mc/fsl_dpmng.h> #include "dpaa2_ethdev.h" -#include "dpaa2_sparser.h" #include <fsl_qbman_debug.h> #include <rte_io.h>
drivers/net/dpaa2/dpaa2_sparser.c deleted +0 -137
137 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_sparser.h deleted +0 -202
202 lines not on this page · raw message
drivers/net/dpaa2/meson.build +0 -1
@@ -17,7 +17,6 @@ sources = files( 'dpaa2_flow.c', 'dpaa2_recycle.c', 'dpaa2_rxtx.c', - 'dpaa2_sparser.c', 'dpaa2_ptp.c', 'mc/dprtc.c', 'mc/dpkg.c',
Signature · 1 line
2.43.0
PATCH 13/13 net/dpaa2: rename Rx queue flags
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
Rename the Rx-side device flags to a consistent DPAA2_RX_*_FLAG naming:DPAAX_RX_ERROR_QUEUE_FLAG becomes DPAA2_RX_ERROR_QUEUE_FLAG and DPAA2_DATA_STASHING_OFF becomes DPAA2_RX_DATA_STASHING_OFF_FLAG.
This is a mechanical rename with no functional change.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 10 +++++----- drivers/net/dpaa2/dpaa2_ethdev.h | 5 +++-- drivers/net/dpaa2/dpaa2_rxtx.c | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +5 -5
@@ -550,7 +550,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) goto fail; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { priv->rx_err_vq =rte_zmalloc ("dpni_rx_err" ,sizeof (struct dpaa2_queue ),0 );if (!priv->rx_err_vq) {
@@ -1041,7 +1041,7 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, options |=DPNI_QUEUE_OPT_FLC ; cfg.flc.stash_control = true;dpaa2_flc_stashing_clear_all (&cfg.flc.value); -if (priv->flags &DPAA2_DATA_STASHING_OFF ) { +if (priv->flags &DPAA2_RX_DATA_STASHING_OFF_FLAG ) {dpaa2_flc_stashing_set (DPAA2_FLC_DATA_STASHING ,0 , &cfg.flc.value); dpaa2_q->data_stashing_off =1 ;
@@ -1521,7 +1521,7 @@ dpaa2_dev_start(struct rte_eth_dev *dev) dpaa2_q->fqid = qid.fqid; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { ret =dpni_get_queue (dpni,CMD_PRI_LOW , priv->token,DPNI_QUEUE_RX_ERR ,0 ,0 , &cfg, &qid);if (ret) {
@@ -3479,7 +3479,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)if (dpaa2_get_devargs (dev->devargs,DRIVER_NO_DATA_STASHING ) ||getenv ("DPAA2_DATA_STASHING_OFF" )) { - priv->flags |=DPAA2_DATA_STASHING_OFF ; + priv->flags |=DPAA2_RX_DATA_STASHING_OFF_FLAG ;DPAA2_PMD_INFO ("Data stashing disabled" ); }
@@ -3586,7 +3586,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) }if (dpaa2_get_devargs (dev->devargs,DRIVER_ERROR_QUEUE )) { - priv->flags |=DPAAX_RX_ERROR_QUEUE_FLAG ; + priv->flags |=DPAA2_RX_ERROR_QUEUE_FLAG ;DPAA2_PMD_INFO ("Enable error queue" ); }
drivers/net/dpaa2/dpaa2_ethdev.h +3 -2
@@ -100,9 +100,10 @@#define DPAA2_TX_DYNAMIC_CONF_ENABLE RTE_BIT32(9)/* Disable data stashing (prefetch of packet data into CPU cache) */ -#define DPAA2_DATA_STASHING_OFF RTE_BIT32(10) +#define DPAA2_RX_DATA_STASHING_OFF_FLAG RTE_BIT32(10) + +#define DPAA2_RX_ERROR_QUEUE_FLAG RTE_BIT32(11) -#define DPAAX_RX_ERROR_QUEUE_FLAG RTE_BIT32(11)#define DPAA2_RX_PRINT_PSR_RESULT_FLAG RTE_BIT32(12)/* DPDMUX index for DPMAC */
drivers/net/dpaa2/dpaa2_rxtx.c +2 -2
@@ -901,7 +901,7 @@ dpaa2_dev_prefetch_rx_common(void *queue, struct rte_mbuf **bufs, q_storage = dpaa2_q->q_storage[rte_lcore_id ()]; -if (unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq);if (unlikely (!DPAA2_PER_LCORE_ETHRX_DPIO )) {
@@ -1173,7 +1173,7 @@ dpaa2_dev_rx_common(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;struct dpaa2_dev_priv *priv = eth_data->dev_private; -if (!by_channel &&unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (!by_channel &&unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq);if (by_channel) {
Signature · 1 line
2.43.0
cover net/dpaa2: flow, meter and parser features
In reply to Prashant GuptaThis is the second of four series upstreaming the missing NXP dpaa2 driver changes. It does not depend on series 1 and can be applied independently. It adds the net/dpaa2 flow, metering and parser features:
- fix an integer overflow in the CCSR region mapping,
- set Tx confirmation on device init and support a larger burst size,
- support MPLS and PPPoE flow distribution, meter and policing, and the flow drop action, with a per-device default flow miss action,
- identify Rx mbuf hash information by FLC and add minimum key size support,
- restructure the parser processing, parse tunnel and fragmented packet types, remove the unused soft parser driver and rename the Rx queue flags.
Note that patch 12 removes the soft parser driver and, with it, the rte_flow VXLAN and eCPRI pattern items that were only accepted while an SP image was believed to be loaded. Both items are dropped from the dpaa2 feature matrix and a release note is added.
Every commit builds cleanly (including the aarch64 DPAA cross build with -Werror) and the series is bisectable.
Changes in v7:
- rebased on next-net to resolve apply conflicts reported by patchwork.
Changes in v6:
- patch 10: dropped the inaccurate "no functional change is intended" claim; the commit message now enumerates the functional changes (checksum flag ordering, IPV4/6_EXT/SCTP/ICMP fast-path removal) and the known limitations that need follow-up work,
- patch 11: added RTE_PTYPE_L4_FRAG, RTE_PTYPE_TUNNEL_ESP, RTE_PTYPE_TUNNEL_GTPU and RTE_PTYPE_TUNNEL_GTPC to dpaa2_supported_ptypes_get() so the new types are advertised, and OR-ed RTE_PTYPE_L4_UDP into the GTP-U/GTP-C cases since GTP runs over UDP; corrected the commit message to name dpaa2_dev_rx_parse_new(),
- patch 12: removed the now-unreachable dpaa2_configure_flow_vxlan() and dpaa2_configure_flow_ecpri() handlers, their switch cases, mask descriptors and the VXLAN_HF_VNI helper; dropped the vxlan and ecpri entries from the dpaa2 feature matrix and added a release note; the commit message now explains that the SP must be loaded by firmware at boot, so runtime loading from the PMD never worked,
- patch 13: dropped the reference to a Tx confirmation rework that is not part of this series,
- patch 5: replaced the stack-allocated err_msg[] buffers whose address was stored in rte_mtr_error with string literals (-Wdangling-pointer).
Gagandeep Singh (7):
net/dpaa2: set Tx confirmation on device init net/dpaa2: support larger burst size net/dpaa2: support MPLS and PPPoE flow distribution net/dpaa2: support meter and policing net/dpaa2: support flow drop action net/dpaa2: set default flow miss action per device net/dpaa2: identify Rx mbuf hash information by FLC
Hemant Agrawal (4):
net/dpaa2: fix integer overflow in CCSR region mapping net/dpaa2: add minimum key size support net/dpaa2: restructure dpaa2 parser processing net/dpaa2: parse tunnel and fragmented packet types
Jun Yang (2):
net/dpaa2: remove unused soft parser driver
net/dpaa2: rename Rx queue flags
doc/guides/nics/dpaa2.rst | 1 + doc/guides/nics/features/dpaa2.ini | 4 +- doc/guides/rel_notes/release_26_11.rst | 18 + drivers/net/dpaa2/dpaa2_ethdev.c | 88 +- drivers/net/dpaa2/dpaa2_ethdev.h | 217 +++- drivers/net/dpaa2/dpaa2_flow.c | 620 +++------ drivers/net/dpaa2/dpaa2_meter.c | 758 +++++++++++ drivers/net/dpaa2/dpaa2_parse_dump.h | 374 ------ drivers/net/dpaa2/dpaa2_parser_decode.h | 1551 +++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_pmd_logs.h | 67 + drivers/net/dpaa2/dpaa2_recycle.c | 24 +- drivers/net/dpaa2/dpaa2_rxtx.c | 329 +++-- drivers/net/dpaa2/dpaa2_sparser.c | 137 -- drivers/net/dpaa2/dpaa2_sparser.h | 202 --- drivers/net/dpaa2/dpaa2_tm.c | 16 +- drivers/net/dpaa2/mc/dpni.c | 11 +- drivers/net/dpaa2/mc/fsl_dpni.h | 31 +- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 +- drivers/net/dpaa2/meson.build | 2 +- 19 files changed, 3032 insertions(+), 1421 deletions(-) create mode 100644 drivers/net/dpaa2/dpaa2_meter.c delete mode 100644 drivers/net/dpaa2/dpaa2_parse_dump.h create mode 100644 drivers/net/dpaa2/dpaa2_parser_decode.h delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.c delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.h
Signature · 1 line
2.43.0
PATCH 1/13 net/dpaa2: fix integer overflow in CCSR region mapping
From: Hemant Agrawal <[email protected]>
In lsx_ccsr_map_region, PAGE_SIZE is a macro defined as sysconf(_SC_PAGESIZE), which returns a signed long and may be negative on error. The value was used directly in size_t comparisons and passed to mmap, causing an integer overflow (Coverity CID 49765682).
The old round-down "len & PAGE_MASK" ignored the in-page offset: for a 4096-byte or 6656-byte len on a 64K-page kernel the masked result is 0, causing the mapping to fail, where the old code would have bumped len up to PAGE_SIZE. The correct mapping size must cover the region from the page-aligned start through offset + len.
Fix by calling sysconf(_SC_PAGESIZE) explicitly into a signed long, checking for a non-positive return before use, computing page_mask from the verified value, and using RTE_ALIGN_CEIL(offset + len, page_size) for map_len so that the mmap covers the full requested region regardless of page size. The page-aligned start address and the back-pointer offset are both derived from the same page_mask, keeping the three values consistent.
Coverity issue: 49765682
--- drivers/net/dpaa2/dpaa2_recycle.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/net/dpaa2/dpaa2_recycle.c +15 -8
@@ -176,6 +176,9 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)void *tmp;uint64_t start;uint64_t offset; +uint64_t page_mask; +long page_size; +size_t map_len; fd =open ("/dev/mem" ,O_RDWR );if (fd <0 ) {
@@ -183,20 +186,24 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)return NULL ; } - start = addr &PAGE_MASK ; + page_size =sysconf (_SC_PAGESIZE); +if (page_size <=0 ) { +close (fd); +return NULL ; + } + page_mask = ~((uint64_t )page_size -1 ); + start = addr & page_mask; offset = addr - start; - len = len &PAGE_MASK ; -if (len < (size_t )PAGE_SIZE ) - len =PAGE_SIZE ; + map_len =RTE_ALIGN_CEIL (offset + len, (size_t )page_size); - tmp =mmap (NULL , len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start); + tmp =mmap (NULL , map_len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start);close (fd); -if (tmp !=MAP_FAILED ) -return (uint8_t *)tmp + offset; -else +if (tmp ==MAP_FAILED )return NULL ; + +return (uint8_t *)tmp + offset; }static const uint8_t ls_sd1_prot_idx_map[] = {
Signature · 1 line
2.43.0
PATCH 2/13 net/dpaa2: set Tx confirmation on device init
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Move TX confirmation mode setting from TXQ setup to device initialization because TXQ0 is not always set up by the user.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 40 ++++++++++++-------------------- 1 file changed, 15 insertions(+), 25 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +15 -25
@@ -1153,7 +1153,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,struct dpni_queue tx_conf_cfg;struct dpni_queue tx_flow_cfg;uint8_t options =0 , flow_id; -uint8_t ceetm_ch_idx;uint16_t channel_id;struct dpni_queue_id qid;uint32_t tc_id;
@@ -1174,30 +1173,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,memset (&tx_conf_cfg,0 ,sizeof (struct dpni_queue ));memset (&tx_flow_cfg,0 ,sizeof (struct dpni_queue )); -if (!tx_queue_id) { -for (ceetm_ch_idx =0 ; - ceetm_ch_idx <= (priv->num_channels -1 ); - ceetm_ch_idx++) { -/*Set tx-conf and error configuration*/ -if (priv->flags &DPAA2_TX_CONF_ENABLE ) { - ret =dpni_set_tx_confirmation_mode (dpni, -CMD_PRI_LOW , priv->token, - ceetm_ch_idx, -DPNI_CONF_AFFINE ); - }else { - ret =dpni_set_tx_confirmation_mode (dpni, -CMD_PRI_LOW , priv->token, - ceetm_ch_idx, -DPNI_CONF_DISABLE ); - } -if (ret) { -DPAA2_PMD_ERR ("Error(%d) in tx conf setting" , - ret); -return ret; - } - } - } - tc_id = tx_queue_id % priv->num_tx_tc; channel_id = (uint8_t )(tx_queue_id / priv->num_tx_tc) % priv->num_channels; flow_id =0 ;
@@ -3621,6 +3596,21 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) goto init_err; } +for (i =0 ; i < priv->num_channels; i++) { +/*Set tx-conf and error configuration*/ +if (priv->flags &DPAA2_TX_CONF_ENABLE ) { + ret =dpni_set_tx_confirmation_mode (dpni_dev, +CMD_PRI_LOW , priv->token, i,DPNI_CONF_AFFINE ); + }else { + ret =dpni_set_tx_confirmation_mode (dpni_dev, +CMD_PRI_LOW , priv->token, i,DPNI_CONF_DISABLE ); + } +if (ret) { +DPAA2_PMD_ERR ("Error(%d) in tx conf setting" , ret); + goto init_err; + } + } +/* Allocate memory for storing MAC addresses. * Table of mac_filter_entries size is allocated so that RTE ether lib * can add MAC entries when rte_eth_dev_mac_addr_add is called.
Signature · 1 line
2.43.0
PATCH 3/13 net/dpaa2: support larger burst size
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Make burst size checks and MC command fields SoC-aware, enabling bursts larger than 64K on LX2160A with dpni version 8.7+.
The max_burst_size field in dpni_tx_shaping_cfg is widened to uint32_t and the MC command struct is updated to split the value across two 16-bit fields using the new DPNI_BURST_LO/HI macros.
--- drivers/net/dpaa2/dpaa2_tm.c | 16 +++++++++++----- drivers/net/dpaa2/mc/dpni.c | 11 +++++++++-- drivers/net/dpaa2/mc/fsl_dpni.h | 8 ++++++-- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 ++- 4 files changed, 28 insertions(+), 10 deletions(-)
drivers/net/dpaa2/dpaa2_tm.c +11 -5
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright 2020-2024 NXP +* Copyright 2020-2026 NXP */ #include <rte_ethdev.h>
@@ -10,14 +10,20 @@#include "dpaa2_pmd_logs.h" #include <dpaa2_hw_dpio.h> -#define DPAA2_BURST_MAX (64 * 1024) -#define DPAA2_SHAPER_MIN_RATE 0#define DPAA2_SHAPER_MAX_RATE 107374182400ull#define DPAA2_WEIGHT_MAX 24701#define DPAA2_PKT_ADJUST_LEN_MIN 0#define DPAA2_PKT_ADJUST_LEN_MAX 0x7ff +static inline uint32_t dpaa2_get_burst_max (struct dpaa2_dev_priv *priv) +{ +if (dpaa2_dev_cmp_dpni_ver (priv,8 ,7 ) >=0 ) +return (dpaa2_svr_family ==SVR_LX2160A ) ?229375 :0xF7FF ; + +return 0xF7FF ; +} +int dpaa2_tm_init (struct rte_eth_dev *dev) {
@@ -283,7 +289,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE , NULL, "committed rate is out of range\n"); -if (params->committed.size >DPAA2_BURST_MAX ) +if (params->committed.size >dpaa2_get_burst_max (priv))return -rte_tm_error_set (error,EINVAL ,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE ,NULL ,"committed size is out of range\n" );
@@ -293,7 +299,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE , NULL, "Peak rate is out of range\n"); -if (params->peak.size >DPAA2_BURST_MAX ) +if (params->peak.size >dpaa2_get_burst_max (priv))return -rte_tm_error_set (error,EINVAL ,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE ,NULL ,"Peak size is out of range\n" );
drivers/net/dpaa2/mc/dpni.c +9 -2
@@ -1106,6 +1106,7 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io, {struct dpni_cmd_set_tx_shaping *cmd_params;struct mc_command cmd = {0 }; +uint32_t tx_cr_burst, tx_er_burst;int coupled, lni_shaper;uint8_t channel_id;uint16_t oal;
@@ -1115,10 +1116,16 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io, cmd_flags, token); cmd_params = (struct dpni_cmd_set_tx_shaping *)cmd.params; + tx_cr_burst = tx_cr_shaper->max_burst_size; + tx_er_burst = tx_er_shaper->max_burst_size; cmd_params->tx_cr_max_burst_size = -cpu_to_le16 (tx_cr_shaper->max_burst_size); +cpu_to_le16 (DPNI_BURST_LO (tx_cr_burst)); cmd_params->tx_er_max_burst_size = -cpu_to_le16 (tx_er_shaper->max_burst_size); +cpu_to_le16 (DPNI_BURST_LO (tx_er_burst)); + cmd_params->tx_cr_max_burst_size_hi = +cpu_to_le16 (DPNI_BURST_HI (tx_cr_burst)); + cmd_params->tx_er_max_burst_size_hi = +cpu_to_le16 (DPNI_BURST_HI (tx_er_burst)); cmd_params->tx_cr_rate_limit =cpu_to_le32 (tx_cr_shaper->rate_limit); cmd_params->tx_er_rate_limit =
drivers/net/dpaa2/mc/fsl_dpni.h +6 -2
@@ -830,14 +830,18 @@ int dpni_get_link_state(struct fsl_mc_io *mc_io,uint16_t token, struct dpni_link_state *state); +#define DPNI_BURST_LO (burst) ((burst) & GENMASK(15, 0)) +#define DPNI_BURST_HI (burst) ((burst) >> 16) +/** * struct dpni_tx_shaping - Structure representing DPNI tx shaping configuration * @rate_limit: Rate in Mbits/s -* @max_burst_size: Burst size in bytes (up to 64KB) +* @max_burst_size: Burst size in bytes. Limits depend on the SoC (0x37FFF +* for LX2160A, 0xF7FF for all others) */ struct dpni_tx_shaping_cfg {uint32_t rate_limit; -uint16_t max_burst_size; +uint32_t max_burst_size; };/**
drivers/net/dpaa2/mc/fsl_dpni_cmd.h +2 -1
@@ -394,7 +394,8 @@ struct dpni_rsp_get_link_state {struct dpni_cmd_set_tx_shaping {uint16_t tx_cr_max_burst_size;uint16_t tx_er_max_burst_size; -uint32_t pad; +uint16_t tx_cr_max_burst_size_hi; +uint16_t tx_er_max_burst_size_hi;uint32_t tx_cr_rate_limit;uint32_t tx_er_rate_limit;/* from LSB: coupled:1, lni_shaper: 1*/
Signature · 1 line
2.43.0
PATCH 4/13 net/dpaa2: support MPLS and PPPoE flow distribution
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add rte_flow pattern support for MPLS and PPPoE items in the dpaa2 PMD flow engine.
For a pattern with no spec/mask, the frame is identified by its Frame Attribute Flag (FAF_MPLS_FRAM / FAF_PPPOE_PPP_FRAM) for both the QoS and flow steering tables. When a spec is present, the MPLS label (NH_FLD_MPLS_MPLSL_1) or the PPPoE session id (NH_FLD_PPPOE_SID) is added as a header extract rule for both tables.
NH_FLD_MPLS_MPLSL_1 with DPKG_FULL_FIELD causes MC to extract the full 4-byte MPLS LSE (label + TC + S + TTL). The original code passed sizeof(label_tc_s) = 3, so the driver key profile recorded the field as 3 bytes while MC placed 4 bytes in the key; any extract field added after MPLS was off by one byte, corrupting the key layout.
Fix by passing the full struct rte_flow_item_mpls pointer (spec/mask) with sizeof(*mask) = 4, so the key profile width matches the 4-byte field that MC extracts. The TTL byte has mask 0x00 in the default mask and is ignored for matching purposes.
--- doc/guides/nics/features/dpaa2.ini | 2 + drivers/net/dpaa2/dpaa2_flow.c | 196 +++++++++++++++++++++++++++++ 2 files changed, 198 insertions(+)
doc/guides/nics/features/dpaa2.ini +2 -0
@@ -43,6 +43,8 @@ gtp = Y icmp = Y ipv4 = Y ipv6 = Y +mpls = Y +pppoes = Y raw = Y sctp = Y tcp = Y
drivers/net/dpaa2/dpaa2_flow.c +196 -0
228 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 5/13 net/dpaa2: support meter and policing
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add support for the traffic metering and policing (rte_mtr) API. Meters map one-to-one to Rx TCs and are programmed via dpni_set_rx_tc_policing().
Additional corrections over the initial implementation --
- byte-mode rates converted correctly: bytes/s / 125 = Kbps
- packet-mode rates passed unchanged to firmware
- hardware programmed at create/update; policing disabled at destroy
- mtr_id validated against num_rx_tc before use
- color_aware capability cleared (FD[DROPP] not handled)
- duplicate-ID check and insertion both under meter_lock
- removed misleading "Rate limitation" entry from features/dpaa2.ini
--- doc/guides/nics/dpaa2.rst | 1 + doc/guides/rel_notes/release_26_11.rst | 5 + drivers/net/dpaa2/dpaa2_ethdev.c | 2 + drivers/net/dpaa2/dpaa2_ethdev.h | 29 + drivers/net/dpaa2/dpaa2_meter.c | 758 +++++++++++++++++++++++++ drivers/net/dpaa2/mc/fsl_dpni.h | 23 +- drivers/net/dpaa2/meson.build | 1 + 7 files changed, 815 insertions(+), 4 deletions(-) create mode 100644 drivers/net/dpaa2/dpaa2_meter.c
doc/guides/nics/dpaa2.rst +1 -0
@@ -407,6 +407,7 @@ Features of the DPAA2 PMD are: - Link flow control - Scattered and gather for TX and RX - Rx queue interrupts +- Traffic metering and policing - :ref:`dpaa2_dptmapi`
doc/guides/rel_notes/release_26_11.rst +5 -0
@@ -20,6 +20,11 @@ DPDK Release 26.11 ninja -C build doc xdg-open build/doc/guides/html/rel_notes/release_26_11.html +* **Updated NXP DPAA2 net driver.** + + * Added Tx queue based flow control and confirmation queue handling. + * Added software parser based packet dump for debugging. + * Added support for traffic metering and policing (rte_mtr API). New Features ------------
drivers/net/dpaa2/dpaa2_ethdev.c +2 -0
@@ -3317,6 +3317,7 @@ static struct eth_dev_ops dpaa2_ethdev_ops = { .rxq_info_get = dpaa2_rxq_info_get, .txq_info_get = dpaa2_txq_info_get, .tm_ops_get = dpaa2_tm_ops_get, + .mtr_ops_get = dpaa2_mtr_ops_get,#if defined(RTE_LIBRTE_IEEE1588 ) .timesync_enable = dpaa2_timesync_enable, .timesync_disable = dpaa2_timesync_disable,
@@ -3540,6 +3541,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->num_channels = attr.num_channels; priv->channel_inuse =0 ;rte_spinlock_init (&priv->lpbk_qp_lock); +rte_spinlock_init (&priv->meter_lock);/* only if the custom CG is enabled */ if (attr.options &DPNI_OPT_CUSTOM_CG )
drivers/net/dpaa2/dpaa2_ethdev.h +29 -0
@@ -385,6 +385,30 @@ struct extract_s {uint8_t *tc_extract_param[MAX_TCS ]; }; +struct dpaa2_dev_meter_profile { +LIST_ENTRY (dpaa2_dev_meter_profile) next; +uint32_t profile_id; +uint64_t cir; +uint64_t cbs; +uint64_t pir; +uint64_t pbs; +enum dpni_policer_mode mode; +enum dpni_policer_unit policer_unit; +}; + +struct dpaa2_dev_meter_policy { +LIST_ENTRY (dpaa2_dev_meter_policy) next; +uint32_t policy_id; +bool red_drop; +}; + +struct dpaa2_dev_meter { +LIST_ENTRY (dpaa2_dev_meter) next; +uint32_t meter_id; +uint32_t profile_id; +uint32_t policy_id; +}; +struct dpaa2_dev_priv {void *hw;int32_t hw_id;
@@ -411,6 +435,7 @@ struct dpaa2_dev_priv {uint8_t en_loose_ordered;uint8_t max_cgs;uint8_t cgid_in_use[MAX_RX_QUEUES ]; +rte_spinlock_t meter_lock;/* Current hash distribution size per RX TC, written by * dpaa2_setup_flow_dist_size() and read by reta_query / reta_update.
@@ -456,6 +481,9 @@ struct dpaa2_dev_priv {struct dpaa2_dev_flow *curr; LIST_HEAD(, dpaa2_dev_flow) flows; + LIST_HEAD(, dpaa2_dev_meter_profile) profiles; + LIST_HEAD(, dpaa2_dev_meter_policy) policies; + LIST_HEAD(, dpaa2_dev_meter) meters; LIST_HEAD(nodes, dpaa2_tm_node) nodes; LIST_HEAD(shaper_profiles, dpaa2_tm_shaper_profile) shaper_profiles; };
@@ -548,6 +576,7 @@ int dpaa2_timesync_read_tx_timestamp(struct rte_eth_dev *dev,int dpaa2_dev_recycle_config (struct rte_eth_dev *eth_dev);int dpaa2_dev_recycle_deconfig (struct rte_eth_dev *eth_dev); +int dpaa2_mtr_ops_get (struct rte_eth_dev *dev,void *ops);int dpaa2_soft_parser_loaded (void );void
drivers/net/dpaa2/dpaa2_meter.c new file +758 -0
758 lines not on this page · raw message
drivers/net/dpaa2/mc/fsl_dpni.h +19 -4
@@ -1111,6 +1111,11 @@ int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io,*/ #define DPNI_POLICER_OPT_DISCARD_RED 0x00000002 +/** +* Do NOT reset counters generally for policer update +*/ +#define DPNI_POLICER_OPT_DO_NOT_RESET_COUNTERS 0x00000004 +/** * enum dpni_policer_mode - selecting the policer mode * @DPNI_POLICER_MODE_NONE: Policer is disabled
@@ -1127,12 +1132,17 @@ enum dpni_policer_mode {/** * enum dpni_policer_unit - DPNI policer units -* @DPNI_POLICER_UNIT_BYTES: bytes units +* @DPNI_POLICER_UNIT_BYTES_L3: bytes units (for each frame takes into account +* FD length - L3 offset) * @DPNI_POLICER_UNIT_FRAMES: frames units +* @DPNI_POLICER_UNIT_BYTES_L2_WITHOUT_FCS: bytes units (for each frame takes +* into account FD length - L2 offset, which means L2 size without the 4 bytes +* for the FCS) */ enum dpni_policer_unit { -DPNI_POLICER_UNIT_BYTES =0 , -DPNI_POLICER_UNIT_FRAMES +DPNI_POLICER_UNIT_BYTES_L3 =0 , +DPNI_POLICER_UNIT_FRAMES , +DPNI_POLICER_UNIT_BYTES_L2_WITHOUT_FCS , };/**
@@ -1173,13 +1183,18 @@ struct dpni_rx_tc_policing_cfg {uint32_t ebs; }; -int dpni_set_rx_tc_policing (struct fsl_mc_io *mc_io,uint32_t cmd_flags,uint16_t token,uint8_t tc_id,const struct dpni_rx_tc_policing_cfg *cfg); +int dpni_set_rx_tc_policing_v1 (struct fsl_mc_io *mc_io, +uint32_t cmd_flags, +uint16_t token, +uint8_t tc_id, +const struct dpni_rx_tc_policing_cfg *cfg); + int dpni_get_rx_tc_policing(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token,
drivers/net/dpaa2/meson.build +1 -0
@@ -11,6 +11,7 @@ sources = files( 'base/dpaa2_hw_dpni.c', 'base/dpaa2_tlu_hash.c', 'dpaa2_tm.c', + 'dpaa2_meter.c', 'dpaa2_mux.c', 'dpaa2_ethdev.c', 'dpaa2_flow.c',
Signature · 1 line
2.43.0
PATCH 6/13 net/dpaa2: support flow drop action
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add support for the RTE_FLOW_ACTION_TYPE_DROP action in the dpaa2 flow engine. A flow rule with a drop action is programmed into the flow steering (FS) table with the DPNI_FS_OPT_DISCARD option so that matching frames are discarded by hardware.
The drop action is added to the supported action list, accepted during action verification, configured in the FS action path, handled in the generic flow-set action loop, and cleaned up in the flow destroy path.
--- drivers/net/dpaa2/dpaa2_flow.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/dpaa2/dpaa2_flow.c +7 -1
@@ -97,7 +97,8 @@ enum rte_flow_action_type dpaa2_supported_action_type[] = {RTE_FLOW_ACTION_TYPE_QUEUE ,RTE_FLOW_ACTION_TYPE_PORT_ID ,RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT , - RTE_FLOW_ACTION_TYPE_RSS +RTE_FLOW_ACTION_TYPE_RSS , + RTE_FLOW_ACTION_TYPE_DROP };#ifndef __cplusplus
@@ -4421,6 +4422,7 @@ dpaa2_flow_verify_action(struct dpaa2_dev_priv *priv,break ;case RTE_FLOW_ACTION_TYPE_PF :/* Skip this action, have to add for vxlan */ +case RTE_FLOW_ACTION_TYPE_DROP :break ;case RTE_FLOW_ACTION_TYPE_END : end_of_list =1 ;
@@ -4468,6 +4470,8 @@ dpaa2_configure_flow_fs_action(struct dpaa2_dev_priv *priv, flow->fs_action_cfg.redirect_obj_token = dest_priv->token; flow->fs_action_cfg.flow_id = dest_q->flow_id; + }else if (flow->action_type ==RTE_FLOW_ACTION_TYPE_DROP ) { + flow->fs_action_cfg.options =DPNI_FS_OPT_DISCARD ; }return 0 ;
@@ -4945,6 +4949,7 @@ dpaa2_generic_flow_set(struct dpaa2_dev_flow *flow,case RTE_FLOW_ACTION_TYPE_QUEUE :case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT :case RTE_FLOW_ACTION_TYPE_PORT_ID : +case RTE_FLOW_ACTION_TYPE_DROP : ret =dpaa2_configure_flow_fs_action (priv, flow, &actions[j]);if (ret)
@@ -5346,6 +5351,7 @@ dpaa2_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *_flow,case RTE_FLOW_ACTION_TYPE_QUEUE :case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT :case RTE_FLOW_ACTION_TYPE_PORT_ID : +case RTE_FLOW_ACTION_TYPE_DROP :if (priv->num_rx_tc >1 ) {/* Remove entry from QoS table first */ ret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW,
Signature · 1 line
2.43.0
PATCH 7/13 net/dpaa2: set default flow miss action per device
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
The flow steering miss flow id was a file-scope global defaulting to 0 and optionally overridden via the DPAA2_FLOW_CONTROL_MISS_FLOW environment variable. Replace it with a per-device default_flow field in dpaa2_dev_priv, initialised to 0 at probe time, so that each device has its own independent miss-flow setting.
The DPAA2_FLOW_CONTROL_MISS_FLOW environment variable is removed. Users who relied on it must use the rte_flow API instead.
--- doc/guides/rel_notes/release_26_11.rst | 4 ++++ drivers/net/dpaa2/dpaa2_ethdev.c | 2 ++ drivers/net/dpaa2/dpaa2_ethdev.h | 2 ++ drivers/net/dpaa2/dpaa2_flow.c | 14 +------------- 4 files changed, 9 insertions(+), 13 deletions(-)
doc/guides/rel_notes/release_26_11.rst +4 -0
@@ -25,6 +25,10 @@ DPDK Release 26.11 * Added Tx queue based flow control and confirmation queue handling. * Added software parser based packet dump for debugging. * Added support for traffic metering and policing (rte_mtr API). + * Removed ``DPAA2_FLOW_CONTROL_MISS_FLOW`` environment variable. The + per-device FS table miss flow id is now fixed at 0. Users who + previously redirected unmatched frames to a specific queue via this + variable must use the rte_flow API instead. New Features ------------
drivers/net/dpaa2/dpaa2_ethdev.c +2 -0
@@ -3540,6 +3540,8 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->dist_queues = attr.num_queues; priv->num_channels = attr.num_channels; priv->channel_inuse =0 ; + priv->default_flow =RTE_MIN (priv->fs_entries, + priv->dist_queues) -1 ;rte_spinlock_init (&priv->lpbk_qp_lock);rte_spinlock_init (&priv->meter_lock);
drivers/net/dpaa2/dpaa2_ethdev.h +2 -0
@@ -436,6 +436,8 @@ struct dpaa2_dev_priv {uint8_t max_cgs;uint8_t cgid_in_use[MAX_RX_QUEUES ];rte_spinlock_t meter_lock; +/* Lowest priority FS flow id to receive flow steering miss frames. */ +uint16_t default_flow;/* Current hash distribution size per RX TC, written by * dpaa2_setup_flow_dist_size() and read by reta_query / reta_update.
drivers/net/dpaa2/dpaa2_flow.c +1 -13
@@ -24,7 +24,6 @@#include <dpaa2_pmd_logs.h> static char *dpaa2_flow_control_log; -static uint16_t dpaa2_flow_miss_flow_id;/* Default miss flow id is 0. */ static int dpaa2_sp_loaded =-1 ;enum dpaa2_flow_entry_size {
@@ -4590,7 +4589,7 @@ dpaa2_configure_fs_rss_table(struct dpaa2_dev_priv *priv,return 0 ; tc_cfg.enable = true; - tc_cfg.fs_miss_flow_id = dpaa2_flow_miss_flow_id; + tc_cfg.fs_miss_flow_id = priv->default_flow; ret =dpni_set_rx_fs_dist (dpni,CMD_PRI_LOW , priv->token, &tc_cfg);if (ret <0 ) {
@@ -5224,17 +5223,6 @@ dpaa2_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, dpaa2_flow_control_log =getenv ("DPAA2_FLOW_CONTROL_LOG" ); -if (getenv ("DPAA2_FLOW_CONTROL_MISS_FLOW" )) { - dpaa2_flow_miss_flow_id = - (uint16_t )atoi (getenv ("DPAA2_FLOW_CONTROL_MISS_FLOW" )); -if (dpaa2_flow_miss_flow_id >= priv->dist_queues) { -DPAA2_PMD_ERR ("Missed flow ID %d >= dist size(%d)" , - dpaa2_flow_miss_flow_id, - priv->dist_queues); -return NULL ; - } - } - flow =rte_zmalloc (NULL ,sizeof (struct dpaa2_dev_flow ),RTE_CACHE_LINE_SIZE );if (!flow) {
Signature · 1 line
2.43.0
PATCH 8/13 net/dpaa2: identify Rx mbuf hash information by FLC
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
For default RSS distribution, the mbuf is marked with RTE_MBUF_F_RX_RSS_HASH and the hash value is taken from the high word of FLC.
Configure the flow steering action with FLC enabled to align the stashing setting with the RSS configuration. The TC ID and flow ID are packed into the FLC low word by the hardware. An Rx mbuf received from the FS table has the FS_MARK bit set in FLC low word; such mbufs are marked with RTE_MBUF_F_RX_FDIR and the TC and flow ID are stored via rte_mbuf_sched_set() for use by the scheduler.
--- drivers/net/dpaa2/dpaa2_ethdev.h | 12 +++++++++ drivers/net/dpaa2/dpaa2_flow.c | 42 ++++++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 18 ++++++++++++-- 3 files changed, 70 insertions(+), 2 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.h +12 -0
@@ -282,6 +282,18 @@ enum dpaa2_ecpri_fafe_type {/* ECPRI shares SP context with VXLAN*/ #define DPAA2_ECPRI_MSG_OFFSET DPAA2_VXLAN_VNI_OFFSET +#define DPAA2_FS_FLC_FS_MARK_OFFSET \ + (DPAA2_FLC_DATA_STASHING + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_OFFSET \ + (DPAA2_FS_FLC_FS_MARK_OFFSET + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_BIT_SIZE (sizeof(uint8_t) * 8) +#define DPAA2_FS_FLC_TC_MASK ((1 << DPAA2_FS_FLC_TC_BIT_SIZE) - 1) + +#define DPAA2_FS_FLC_FLOW_OFFSET \ + (DPAA2_FS_FLC_TC_OFFSET + DPAA2_FS_FLC_TC_BIT_SIZE) +#define DPAA2_ECPRI_MAX_EXTRACT_NB 8struct ipv4_sd_addr_extract_rule {
drivers/net/dpaa2/dpaa2_flow.c +42 -0
61 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_rxtx.c +16 -2
@@ -58,6 +58,7 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,uint16_t frc =DPAA2_GET_FD_FRC_PARSE_SUM (fd);struct dpaa2_annot_hdr *annotation = (struct dpaa2_annot_hdr *)hw_annot_addr; +uint32_t flc_lo, tc, flow;if (unlikely (dpaa2_print_parser_result))dpaa2_print_parse_result (annotation);
@@ -118,8 +119,21 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,default : m->packet_type =dpaa2_dev_rx_parse_slow (m, annotation); } - m->hash.rss = fd->simple.flc_hi; - m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; + flc_lo = fd->simple.flc_lo; +if (flc_lo & (1 <<DPAA2_FS_FLC_FS_MARK_OFFSET )) { + m->ol_flags |=RTE_MBUF_F_RX_FDIR ; + tc = (flc_lo >>DPAA2_FS_FLC_TC_OFFSET ) & +DPAA2_FS_FLC_TC_MASK ; + flow = flc_lo >>DPAA2_FS_FLC_FLOW_OFFSET ; +rte_mbuf_sched_set (m, flow, tc,0 ); +DPAA2_PMD_DP_DEBUG ("FS frame received from TC[%d]->flow%d" , + tc, flow); + }else { + m->hash.rss = fd->simple.flc_hi; + m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; +DPAA2_PMD_DP_DEBUG ("Hash frame received with RSS(%08x)" , + m->hash.rss); + }if (dpaa2_enable_ts[m->port]) { *dpaa2_timestamp_dynfield (m) = annotation->word2;
Signature · 1 line
2.43.0
PATCH 9/13 net/dpaa2: add minimum key size support
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
The default size for a QoS key is 24 bytes. If the key size is smaller than the maximum, use the default (minimum) key size instead of always returning the maximum size (56 bytes). This allows smaller flow tables to be used when the extracted key fits within the default size.
--- drivers/net/dpaa2/dpaa2_flow.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/dpaa2/dpaa2_flow.c +5 -3
@@ -26,8 +26,11 @@static char *dpaa2_flow_control_log;static int dpaa2_sp_loaded =-1 ; +/* Default size of a key */ +#define DPNI_DEFAULT_KEY_SIZE 24 +enum dpaa2_flow_entry_size { -DPAA2_FLOW_ENTRY_MIN_SIZE = (DPNI_MAX_KEY_SIZE /2 ), +DPAA2_FLOW_ENTRY_MIN_SIZE =DPNI_DEFAULT_KEY_SIZE ,DPAA2_FLOW_ENTRY_MAX_SIZE =DPNI_MAX_KEY_SIZE };
@@ -4532,8 +4535,7 @@ dpaa2_flow_entry_size(uint16_t key_max_size)if (key_max_size >DPAA2_FLOW_ENTRY_MIN_SIZE )return DPAA2_FLOW_ENTRY_MAX_SIZE ; -/* Current MC only support fixed entry size(56)*/ -return DPAA2_FLOW_ENTRY_MAX_SIZE ; +return DPAA2_FLOW_ENTRY_MIN_SIZE ; } static inline int
Signature · 1 line
2.43.0
PATCH 10/13 net/dpaa2: restructure dpaa2 parser processing
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
Move parse-result decoding into dpaa2_parser_decode.h, shared between the flow code and the Rx path.
IPV4/6_EXT, SCTP and ICMP ptypes are removed from the rx_parse_new fast-path switch and now go through dpaa2_dev_rx_parse_frc().
Also included in this commit are
- Restore Rx timestamp: write annotation->word2 into the dynfield in dpaa2_dev_rx_parse_new() when dpaa2_enable_ts[] is set.
- Drop RTE_MBUF_F_RX_FDIR from dpaa2_dev_rx_mbuf_sched_set(): hash.sched overlaps hash.fdir; only hash.sched is written via rte_mbuf_sched_set().
- Parser dump wired up -- set DPAA2_RX_PRINT_PSR_RESULT_FLAG in priv->flags from the DPAA2_PRINT_RX_PARSER_RESULT env var so the dump helper fires.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.h | 176 ++- drivers/net/dpaa2/dpaa2_parse_dump.h | 374 ------ drivers/net/dpaa2/dpaa2_parser_decode.h | 1551 +++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_pmd_logs.h | 67 + drivers/net/dpaa2/dpaa2_rxtx.c | 323 +++-- 6 files changed, 1938 insertions(+), 555 deletions(-) delete mode 100644 drivers/net/dpaa2/dpaa2_parse_dump.h create mode 100644 drivers/net/dpaa2/dpaa2_parser_decode.h
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -3591,7 +3591,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) }if (getenv ("DPAA2_PRINT_RX_PARSER_RESULT" )) - dpaa2_print_parser_result =1 ; + priv->flags |=DPAA2_RX_PRINT_PSR_RESULT_FLAG ;/* Allocate memory for hardware structure for queues */ ret =dpaa2_alloc_rx_tx_queues (eth_dev);
drivers/net/dpaa2/dpaa2_ethdev.h +118 -58
245 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_parse_dump.h deleted +0 -374
374 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_parser_decode.h new file +1551 -0
1,551 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_pmd_logs.h +67 -0
77 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_rxtx.c +201 -122
511 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 11/13 net/dpaa2: parse tunnel and fragmented packet types
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
Extend dpaa2_dev_rx_parse_new() (LX2160A FRC fast path) with new DPAA2_PKT_TYPE_* cases for IPv4/IPv6 fragments, IPsec ESP, and GTP-U/C.
GTP-U and GTP-C cases include RTE_PTYPE_L4_UDP to reflect the UDP outer transport. All four new types are also added to dpaa2_supported_ptypes_get() so applications that query supported ptypes see them advertised.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 4 ++++ drivers/net/dpaa2/dpaa2_ethdev.h | 16 ++++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 36 ++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+)
drivers/net/dpaa2/dpaa2_ethdev.c +4 -0
@@ -1371,6 +1371,10 @@ dpaa2_supported_ptypes_get(struct rte_eth_dev *dev, size_t *no_of_elements)RTE_PTYPE_L4_UDP ,RTE_PTYPE_L4_SCTP ,RTE_PTYPE_L4_ICMP , +RTE_PTYPE_L4_FRAG , +RTE_PTYPE_TUNNEL_ESP , +RTE_PTYPE_TUNNEL_GTPU , + RTE_PTYPE_TUNNEL_GTPC, }; if (dev->rx_pkt_burst == dpaa2_dev_prefetch_rx ||
drivers/net/dpaa2/dpaa2_ethdev.h +16 -0
@@ -162,6 +162,10 @@#define DPAA2_PKT_TYPE_IPV6_EXT_GRE_IPV6_UDP_TCP \ (DPAA2_PKT_TYPE_IPV6_EXT | DPAA2_PSR_SUMMARY_GRE_IPV6_UDP_TCP) +#define DPAA2_PKT_TYPE_IPV4_FRAG \ + (DPAA2_PSR_SUMMARY_IP_FRAG | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_FRAG \ + (DPAA2_PSR_SUMMARY_IP_FRAG | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_IPV4_TCP \ (DPAA2_PSR_SUMMARY_TCP | DPAA2_PKT_TYPE_IPV4)#define DPAA2_PKT_TYPE_IPV6_TCP \
@@ -178,6 +182,18 @@ (DPAA2_PSR_SUMMARY_ICMP | DPAA2_PKT_TYPE_IPV4)#define DPAA2_PKT_TYPE_IPV6_ICMP \ (DPAA2_PSR_SUMMARY_ICMP | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_ESP \ + (DPAA2_PSR_SUMMARY_IPSEC_ESP | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_ESP \ + (DPAA2_PSR_SUMMARY_IPSEC_ESP | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPU \ + (DPAA2_PSR_SUMMARY_GTPU | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPU \ + (DPAA2_PSR_SUMMARY_GTPU | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPC \ + (DPAA2_PSR_SUMMARY_GTPC | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPC \ + (DPAA2_PSR_SUMMARY_GTPC | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_VLAN_1 0x0100#define DPAA2_PKT_TYPE_VLAN_2 0x0200
drivers/net/dpaa2/dpaa2_rxtx.c +36 -0
@@ -166,6 +166,42 @@ dpaa2_dev_rx_parse_new(struct dpaa2_dev_priv *priv, m->packet_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 ;break ; +case DPAA2_PKT_TYPE_IPV4_FRAG : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_FRAG ; +break ; +case DPAA2_PKT_TYPE_IPV6_FRAG : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_FRAG ; +break ; +case DPAA2_PKT_TYPE_IPV4_ESP : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_TUNNEL_ESP ; +break ; +case DPAA2_PKT_TYPE_IPV6_ESP : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_TUNNEL_ESP ; +break ; +case DPAA2_PKT_TYPE_IPV4_GTPU : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPU ; +break ; +case DPAA2_PKT_TYPE_IPV6_GTPU : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPU ; +break ; +case DPAA2_PKT_TYPE_IPV4_GTPC : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPC ; +break ; +case DPAA2_PKT_TYPE_IPV6_GTPC : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPC ; +break ;case DPAA2_PKT_TYPE_ETHER : m->packet_type =RTE_PTYPE_L2_ETHER ;break ;
Signature · 1 line
2.43.0
PATCH 12/13 net/dpaa2: remove unused soft parser driver
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
The DPAA2 soft parser (SP) byte code has to be installed by the boot firmware before Linux starts; the WRIOP parser cannot be reprogrammed once the MC is up. Loading an SP image at run time from the PMD therefore never took effect, so the loader and its DPNI_SS_INGRESS plumbing were dead code and are removed.
The rte_flow VXLAN and eCPRI pattern items were only ever accepted while an SP image was believed to be loaded. With the SP gone they are rejected by dpaa2_dev_verify_patterns() before the configure switch is reached, so their handlers dpaa2_configure_flow_vxlan() and dpaa2_configure_flow_ecpri(), the switch cases that call them, the mask descriptors and the VXLAN_HF_VNI helper are removed as well. Both items are also dropped from the dpaa2 feature matrix so that the documented capabilities match the code.
--- doc/guides/nics/features/dpaa2.ini | 2 - doc/guides/rel_notes/release_26_11.rst | 9 + drivers/net/dpaa2/dpaa2_ethdev.c | 28 -- drivers/net/dpaa2/dpaa2_ethdev.h | 1 - drivers/net/dpaa2/dpaa2_flow.c | 564 +------------------------ drivers/net/dpaa2/dpaa2_recycle.c | 1 - drivers/net/dpaa2/dpaa2_sparser.c | 137 ------ drivers/net/dpaa2/dpaa2_sparser.h | 202 --------- drivers/net/dpaa2/meson.build | 1 - 9 files changed, 10 insertions(+), 935 deletions(-) delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.c delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.h
doc/guides/nics/features/dpaa2.ini +0 -2
@@ -35,7 +35,6 @@ Usage doc = Y [rte_flow items] ah = Y -ecpri = Y esp = Y eth = P gre = Y
@@ -50,7 +49,6 @@ sctp = Y tcp = Y udp = Y vlan = P -vxlan = Y [rte_flow actions] drop = Y
doc/guides/rel_notes/release_26_11.rst +9 -0
@@ -168,6 +168,15 @@ Removed Items Also, make sure to start the actual text at the margin. ======================================================= +* **Removed soft parser support from the dpaa2 net driver.** + + The DPAA2 soft parser (SP) blob has to be loaded by the boot firmware + before Linux starts, so loading it at run time from the PMD never took + effect. The unused SP loader has been removed, together with the rte_flow + VXLAN and eCPRI pattern items that were only accepted while an SP image + was believed to be loaded. Those two items are no longer advertised in + the dpaa2 feature matrix. + * Removed deprecated symbols: * eal: ``__rte_packed``
drivers/net/dpaa2/dpaa2_ethdev.c +0 -28
@@ -29,7 +29,6 @@#include <mc/fsl_dpmng.h> #include <mc/fsl_dpcon.h> #include "dpaa2_ethdev.h" -#include "dpaa2_sparser.h" #include <fsl_qbman_debug.h> #define DRIVER_LOOPBACK_MODE "drv_loopback"
@@ -3720,33 +3719,6 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) } eth_dev->data->mtu =RTE_ETHER_MTU ; -/*TODO To enable soft parser support DPAA2 driver needs to integrate -* with external entity to receive byte code for software sequence -* and same will be offload to the H/W using MC interface. -* Currently it is assumed that DPAA2 driver has byte code by some -* mean and same if offloaded to H/W. -*/ -if (getenv ("DPAA2_ENABLE_SOFT_PARSER" )) { -WRIOP_SS_INITIALIZER (priv); - ret =dpaa2_eth_load_wriop_soft_parser (priv,DPNI_SS_INGRESS ); -if (ret <0 ) { -DPAA2_PMD_ERR (" Error(%d) in loading softparser" , - ret); - goto init_err; - } - - ret =dpaa2_eth_enable_wriop_soft_parser (priv, -DPNI_SS_INGRESS ); -if (ret <0 ) { -DPAA2_PMD_ERR (" Error(%d) in enabling softparser" , - ret); - goto init_err; - } - } - - ret =dpaa2_soft_parser_loaded (); -if (ret >0 ) -DPAA2_PMD_INFO ("soft parser is loaded" );DPAA2_PMD_INFO ("%s: netdev created, connected to %s" , eth_dev->data->name, dpaa2_dev->ep_name);
drivers/net/dpaa2/dpaa2_ethdev.h +0 -1
@@ -667,7 +667,6 @@ int dpaa2_timesync_read_tx_timestamp(struct rte_eth_dev *dev,int dpaa2_dev_recycle_config (struct rte_eth_dev *eth_dev);int dpaa2_dev_recycle_deconfig (struct rte_eth_dev *eth_dev);int dpaa2_mtr_ops_get (struct rte_eth_dev *dev,void *ops); -int dpaa2_soft_parser_loaded (void );void dpaa2_dev_mac_setup_stats (struct rte_eth_dev *dev);
drivers/net/dpaa2/dpaa2_flow.c +1 -563
629 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_recycle.c +0 -1
@@ -23,7 +23,6 @@#include <dpaa2_hw_dpio.h> #include <mc/fsl_dpmng.h> #include "dpaa2_ethdev.h" -#include "dpaa2_sparser.h" #include <fsl_qbman_debug.h> #include <rte_io.h>
drivers/net/dpaa2/dpaa2_sparser.c deleted +0 -137
137 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_sparser.h deleted +0 -202
202 lines not on this page · raw message
drivers/net/dpaa2/meson.build +0 -1
@@ -17,7 +17,6 @@ sources = files( 'dpaa2_flow.c', 'dpaa2_recycle.c', 'dpaa2_rxtx.c', - 'dpaa2_sparser.c', 'dpaa2_ptp.c', 'mc/dprtc.c', 'mc/dpkg.c',
Signature · 1 line
2.43.0
PATCH 13/13 net/dpaa2: rename Rx queue flags
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
Rename the Rx-side device flags to a consistent DPAA2_RX_*_FLAG naming:DPAAX_RX_ERROR_QUEUE_FLAG becomes DPAA2_RX_ERROR_QUEUE_FLAG and DPAA2_DATA_STASHING_OFF becomes DPAA2_RX_DATA_STASHING_OFF_FLAG.
This is a mechanical rename with no functional change.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 10 +++++----- drivers/net/dpaa2/dpaa2_ethdev.h | 5 +++-- drivers/net/dpaa2/dpaa2_rxtx.c | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +5 -5
@@ -550,7 +550,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) goto fail; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { priv->rx_err_vq =rte_zmalloc ("dpni_rx_err" ,sizeof (struct dpaa2_queue ),0 );if (!priv->rx_err_vq) {
@@ -1041,7 +1041,7 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, options |=DPNI_QUEUE_OPT_FLC ; cfg.flc.stash_control = true;dpaa2_flc_stashing_clear_all (&cfg.flc.value); -if (priv->flags &DPAA2_DATA_STASHING_OFF ) { +if (priv->flags &DPAA2_RX_DATA_STASHING_OFF_FLAG ) {dpaa2_flc_stashing_set (DPAA2_FLC_DATA_STASHING ,0 , &cfg.flc.value); dpaa2_q->data_stashing_off =1 ;
@@ -1521,7 +1521,7 @@ dpaa2_dev_start(struct rte_eth_dev *dev) dpaa2_q->fqid = qid.fqid; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { ret =dpni_get_queue (dpni,CMD_PRI_LOW , priv->token,DPNI_QUEUE_RX_ERR ,0 ,0 , &cfg, &qid);if (ret) {
@@ -3476,7 +3476,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)if (dpaa2_get_devargs (dev->devargs,DRIVER_NO_DATA_STASHING ) ||getenv ("DPAA2_DATA_STASHING_OFF" )) { - priv->flags |=DPAA2_DATA_STASHING_OFF ; + priv->flags |=DPAA2_RX_DATA_STASHING_OFF_FLAG ;DPAA2_PMD_INFO ("Data stashing disabled" ); }
@@ -3583,7 +3583,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) }if (dpaa2_get_devargs (dev->devargs,DRIVER_ERROR_QUEUE )) { - priv->flags |=DPAAX_RX_ERROR_QUEUE_FLAG ; + priv->flags |=DPAA2_RX_ERROR_QUEUE_FLAG ;DPAA2_PMD_INFO ("Enable error queue" ); }
drivers/net/dpaa2/dpaa2_ethdev.h +3 -2
@@ -100,9 +100,10 @@#define DPAA2_TX_DYNAMIC_CONF_ENABLE RTE_BIT32(9)/* Disable data stashing (prefetch of packet data into CPU cache) */ -#define DPAA2_DATA_STASHING_OFF RTE_BIT32(10) +#define DPAA2_RX_DATA_STASHING_OFF_FLAG RTE_BIT32(10) + +#define DPAA2_RX_ERROR_QUEUE_FLAG RTE_BIT32(11) -#define DPAAX_RX_ERROR_QUEUE_FLAG RTE_BIT32(11)#define DPAA2_RX_PRINT_PSR_RESULT_FLAG RTE_BIT32(12)/* DPDMUX index for DPMAC */
drivers/net/dpaa2/dpaa2_rxtx.c +2 -2
@@ -901,7 +901,7 @@ dpaa2_dev_prefetch_rx_common(void *queue, struct rte_mbuf **bufs, q_storage = dpaa2_q->q_storage[rte_lcore_id ()]; -if (unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq);if (unlikely (!DPAA2_PER_LCORE_ETHRX_DPIO )) {
@@ -1173,7 +1173,7 @@ dpaa2_dev_rx_common(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;struct dpaa2_dev_priv *priv = eth_data->dev_private; -if (!by_channel &&unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (!by_channel &&unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq);if (by_channel) {
Signature · 1 line
2.43.0
Re: [PATCH v7-S2 00/13] net/dpaa2: flow, meter and parser features
In reply to Prashant GuptaQuoted 14 lines · On Wed, 7 Oct 2026 11:32:14 +0530 Prashant Gupta <[email protected]>…
This is the second of four series upstreaming the missing NXP dpaa2 driver changes. It does not depend on series 1 and can be applied independently. It adds the net/dpaa2 flow, metering and parser features:
- fix an integer overflow in the CCSR region mapping,
- set Tx confirmation on device init and support a larger burst size,
- support MPLS and PPPoE flow distribution, meter and policing, and the flow drop action, with a per-device default flow miss action,
- identify Rx mbuf hash information by FLC and add minimum key size support,
- restructure the parser processing, parse tunnel and fragmented packet types, remove the unused soft parser driver and rename the Rx queue flags.
Quoted 4 lines
Note that patch 12 removes the soft parser driver and, with it, the
rte_flowVXLAN and eCPRI pattern items that were only accepted while an SP image was believed to be loaded. Both items are dropped from the dpaa2 feature matrix and a release note is added.
Ran manual review with AI and looked at the output, boiled the results down to these issues:
Review: [PATCH v7-S2 00/13] net/dpaa2 updates
Applies to main and on top of S1. Patch 10 (parser restructure) got only a light pass. Patches not listed below have no findings.
[PATCH 05/13] net/dpaa2: support meter and policing
Warning: dpaa2_mtr_meter_create() drops meter_lock around dpaa2_mtr_hw_program() and re-takes it to insert. If control operations can be concurrent, there is a race here: two creates with the same mtr_id both pass the duplicate check, and a profile or policy can be deleted while hw_program uses it. If they are not allowed (the usual ethdev rule), what is the point of meter_lock? Nothing in the Rx/Tx path touches the meter lists. Either hold the lock across check, program and insert, or drop it.
Error: meter state leaks on close. dpaa2_dev_close() never frees priv->profiles, priv->policies or priv->meters. Add a dpaa2_mtr_deinit() and call it next to dpaa2_tm_deinit():
voiddpaa2_mtr_deinit(struct rte_eth_dev *dev)
{
struct dpaa2_dev_priv *priv = dev->data->dev_private;
struct dpaa2_dev_meter *m;
...
rte_spinlock_lock(&priv->meter_lock);
while ((m = LIST_FIRST(&priv->meters)) != NULL) {
LIST_REMOVE(m, next);
rte_free(m);
}
/* same for priv->policies and priv->profiles */
rte_spinlock_unlock(&priv->meter_lock);
}Warning: cbs/pbs (and pir/cir in packet mode) are cast to uint32_t in dpaa2_mtr_hw_program() without a range check. Reject at profile_add:
if (p->cbs > UINT32_MAX || p->pbs > UINT32_MAX) return -rte_mtr_error_set(error, EINVAL, RTE_MTR_ERROR_TYPE_METER_PROFILE, NULL, "burst size too large");
Warning: profile_update and policy_update set meter->profile_id / policy_id before dpaa2_mtr_hw_program(). If the MC command fails, software points at the new profile while hardware runs the old one. Commit the id only on success:
ret = dpaa2_mtr_hw_program(dev, mtr_id, profile, policy); if (ret) return -rte_mtr_error_set(error, -ret, RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL, "HW policing set failed"); meter->profile_id = profile_id;
Warning: capabilities advertise n_max = num_rx_tc even when the DPNI was created without DPNI_OPT_HAS_POLICING. Return ENOTSUP from capabilities_get and meter_create in that case:
if (!(priv->options & DPNI_OPT_HAS_POLICING)) return -rte_mtr_error_set(error, ENOTSUP, RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL, "policing not enabled in DPNI");
Info: leftovers. dpni_set_rx_tc_policing_v1() is declared but not defined. DPNI_POLICER_OPT_DO_NOT_RESET_COUNTERS is unused.
Release notes (05/13, 07/13, 12/13)
Error: the "Updated NXP DPAA2 net driver" block is added above the "New Features" heading, in the template header. There is already an "Updated NXP DPAA2 ethernet driver" entry under New Features; put the bullets there. Drop "Tx queue based flow control" and "software parser based packet dump". Neither is added by this series, and 12/13 removes the soft parser.
[PATCH 07/13] net/dpaa2: set default flow miss action per device
Warning: the commit message and release note say the miss flow id is now 0, but the code sets
priv->default_flow = RTE_MIN(priv->fs_entries, priv->dist_queues) - 1;
which is the last queue. Fix whichever is wrong. If fs_entries can be 0 this also underflows to 0xffff.
[PATCH 08/13] net/dpaa2: identify Rx mbuf hash information by FLC
Warning: FS frames are reported with RTE_MBUF_F_RX_FDIR plus rte_mbuf_sched_set(). hash.sched is a Tx scheduler field. 10/13 then removes the FDIR flag, so the final state sets no flag at all and applications cannot tell hash.sched from hash.rss. Use the standard FDIR ID reporting in this patch and leave it alone in 10/13:
m->ol_flags |= RTE_MBUF_F_RX_FDIR | RTE_MBUF_F_RX_FDIR_ID; m->hash.fdir.hi = (tc << 16) | flow;
[PATCH 09/13] net/dpaa2: add minimum key size support
Info: the removed comment says the MC only supports a fixed 56 byte entry size. Say in the commit message which MC/DPNI version accepts 24, and if older firmware is still supported gate it like 03/13:
if (key_max_size > DPAA2_FLOW_ENTRY_MIN_SIZE || dpaa2_dev_cmp_dpni_ver(priv, X, Y) < 0) return DPAA2_FLOW_ENTRY_MAX_SIZE;
[PATCH 10/13] net/dpaa2: restructure dpaa2 parser processing
Warning: the commit message lists fixes to earlier patches in the same series ("Restore Rx timestamp", "Drop RTE_MBUF_F_RX_FDIR"). Fold each into the patch that introduced the problem so every commit is correct on its own.
cover net/dpaa2 updates
In reply to Prashant GuptaThis is the second of four series upstreaming the missing NXP dpaa2 driver changes. It does not depend on series 1 and can be applied independently.
Changes in v8:
- Address review comments for meter and policing support.
- Add meter resource cleanup during device close.
- Add policing capability checks.
- Validate burst size ranges before hardware programming.
- Fix software/hardware state consistency on profile/policy updates.
- Clarify and guard default flow-miss handling.
- Use standard FDIR reporting for flow-steered packets.
- Document and gate minimum DPNI version for 24-byte flow keys.
- Fold parser fixups into originating patches.
- Remove unused VXLAN offset helper following soft parser removal.
- Update release notes placement and content.
Series overview:
- fix an integer overflow in the CCSR region mapping,
- set Tx confirmation on device init and support a larger burst size,
- support MPLS and PPPoE flow distribution, meter and policing, and the flow drop action, with a per-device default flow miss action,
- identify Rx mbuf hash information by FLC and add minimum key size support,
- restructure parser processing, parse tunnel and fragmented packet types, remove the unused soft parser driver and rename Rx queue flags.
Gagandeep Singh (7):
net/dpaa2: set Tx confirmation on device init net/dpaa2: support larger burst size net/dpaa2: support MPLS and PPPoE flow distribution net/dpaa2: support meter and policing net/dpaa2: support flow drop action net/dpaa2: set default flow miss action per device net/dpaa2: identify Rx mbuf hash information by FLC
Hemant Agrawal (4):
net/dpaa2: fix integer overflow in CCSR region mapping net/dpaa2: add minimum key size support net/dpaa2: restructure dpaa2 parser processing net/dpaa2: parse tunnel and fragmented packet types
Jun Yang (2):
net/dpaa2: remove unused soft parser driver
net/dpaa2: rename Rx queue flags
doc/guides/nics/dpaa2.rst | 1 + doc/guides/nics/features/dpaa2.ini | 4 +- doc/guides/rel_notes/release_26_11.rst | 18 + drivers/net/dpaa2/dpaa2_ethdev.c | 89 +- drivers/net/dpaa2/dpaa2_ethdev.h | 218 +++- drivers/net/dpaa2/dpaa2_flow.c | 633 +++------ drivers/net/dpaa2/dpaa2_meter.c | 814 ++++++++++++ drivers/net/dpaa2/dpaa2_parse_dump.h | 374 ------ drivers/net/dpaa2/dpaa2_parser_decode.h | 1549 +++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_pmd_logs.h | 67 + drivers/net/dpaa2/dpaa2_recycle.c | 24 +- drivers/net/dpaa2/dpaa2_rxtx.c | 399 ++++-- drivers/net/dpaa2/dpaa2_sparser.c | 137 -- drivers/net/dpaa2/dpaa2_sparser.h | 202 --- drivers/net/dpaa2/dpaa2_tm.c | 16 +- drivers/net/dpaa2/mc/dpni.c | 11 +- drivers/net/dpaa2/mc/fsl_dpni.h | 25 +- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 +- drivers/net/dpaa2/meson.build | 2 +- 19 files changed, 3134 insertions(+), 1452 deletions(-) create mode 100644 drivers/net/dpaa2/dpaa2_meter.c delete mode 100644 drivers/net/dpaa2/dpaa2_parse_dump.h create mode 100644 drivers/net/dpaa2/dpaa2_parser_decode.h delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.c delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.h
Signature · 1 line
2.43.0
PATCH 1/13 net/dpaa2: fix integer overflow in CCSR region mapping
From: Hemant Agrawal <[email protected]>
In lsx_ccsr_map_region, PAGE_SIZE is a macro defined as sysconf(_SC_PAGESIZE), which returns a signed long and may be negative on error. The value was used directly in size_t comparisons and passed to mmap, causing an integer overflow (Coverity CID 49765682).
The old round-down "len & PAGE_MASK" ignored the in-page offset: for a 4096-byte or 6656-byte len on a 64K-page kernel the masked result is 0, causing the mapping to fail, where the old code would have bumped len up to PAGE_SIZE. The correct mapping size must cover the region from the page-aligned start through offset + len.
Fix by calling sysconf(_SC_PAGESIZE) explicitly into a signed long, checking for a non-positive return before use, computing page_mask from the verified value, and using RTE_ALIGN_CEIL(offset + len, page_size) for map_len so that the mmap covers the full requested region regardless of page size. The page-aligned start address and the back-pointer offset are both derived from the same page_mask, keeping the three values consistent.
Coverity issue: 49765682
--- drivers/net/dpaa2/dpaa2_recycle.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/net/dpaa2/dpaa2_recycle.c +15 -8
@@ -176,6 +176,9 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)void *tmp;uint64_t start;uint64_t offset; +uint64_t page_mask; +long page_size; +size_t map_len; fd =open ("/dev/mem" ,O_RDWR );if (fd <0 ) {
@@ -183,20 +186,24 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)return NULL ; } - start = addr &PAGE_MASK ; + page_size =sysconf (_SC_PAGESIZE); +if (page_size <=0 ) { +close (fd); +return NULL ; + } + page_mask = ~((uint64_t )page_size -1 ); + start = addr & page_mask; offset = addr - start; - len = len &PAGE_MASK ; -if (len < (size_t )PAGE_SIZE ) - len =PAGE_SIZE ; + map_len =RTE_ALIGN_CEIL (offset + len, (size_t )page_size); - tmp =mmap (NULL , len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start); + tmp =mmap (NULL , map_len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start);close (fd); -if (tmp !=MAP_FAILED ) -return (uint8_t *)tmp + offset; -else +if (tmp ==MAP_FAILED )return NULL ; + +return (uint8_t *)tmp + offset; }static const uint8_t ls_sd1_prot_idx_map[] = {
Signature · 1 line
2.43.0
PATCH 2/13 net/dpaa2: set Tx confirmation on device init
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Move TX confirmation mode setting from TXQ setup to device initialization because TXQ0 is not always set up by the user.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 40 ++++++++++++-------------------- 1 file changed, 15 insertions(+), 25 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +15 -25
@@ -1153,7 +1153,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,struct dpni_queue tx_conf_cfg;struct dpni_queue tx_flow_cfg;uint8_t options =0 , flow_id; -uint8_t ceetm_ch_idx;uint16_t channel_id;struct dpni_queue_id qid;uint32_t tc_id;
@@ -1174,30 +1173,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,memset (&tx_conf_cfg,0 ,sizeof (struct dpni_queue ));memset (&tx_flow_cfg,0 ,sizeof (struct dpni_queue )); -if (!tx_queue_id) { -for (ceetm_ch_idx =0 ; - ceetm_ch_idx <= (priv->num_channels -1 ); - ceetm_ch_idx++) { -/*Set tx-conf and error configuration*/ -if (priv->flags &DPAA2_TX_CONF_ENABLE ) { - ret =dpni_set_tx_confirmation_mode (dpni, -CMD_PRI_LOW , priv->token, - ceetm_ch_idx, -DPNI_CONF_AFFINE ); - }else { - ret =dpni_set_tx_confirmation_mode (dpni, -CMD_PRI_LOW , priv->token, - ceetm_ch_idx, -DPNI_CONF_DISABLE ); - } -if (ret) { -DPAA2_PMD_ERR ("Error(%d) in tx conf setting" , - ret); -return ret; - } - } - } - tc_id = tx_queue_id % priv->num_tx_tc; channel_id = (uint8_t )(tx_queue_id / priv->num_tx_tc) % priv->num_channels; flow_id =0 ;
@@ -3621,6 +3596,21 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) goto init_err; } +for (i =0 ; i < priv->num_channels; i++) { +/*Set tx-conf and error configuration*/ +if (priv->flags &DPAA2_TX_CONF_ENABLE ) { + ret =dpni_set_tx_confirmation_mode (dpni_dev, +CMD_PRI_LOW , priv->token, i,DPNI_CONF_AFFINE ); + }else { + ret =dpni_set_tx_confirmation_mode (dpni_dev, +CMD_PRI_LOW , priv->token, i,DPNI_CONF_DISABLE ); + } +if (ret) { +DPAA2_PMD_ERR ("Error(%d) in tx conf setting" , ret); + goto init_err; + } + } +/* Allocate memory for storing MAC addresses. * Table of mac_filter_entries size is allocated so that RTE ether lib * can add MAC entries when rte_eth_dev_mac_addr_add is called.
Signature · 1 line
2.43.0
PATCH 3/13 net/dpaa2: support larger burst size
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Make burst size checks and MC command fields SoC-aware, enabling bursts larger than 64K on LX2160A with dpni version 8.7+.
The max_burst_size field in dpni_tx_shaping_cfg is widened to uint32_t and the MC command struct is updated to split the value across two 16-bit fields using the new DPNI_BURST_LO/HI macros.
--- drivers/net/dpaa2/dpaa2_tm.c | 16 +++++++++++----- drivers/net/dpaa2/mc/dpni.c | 11 +++++++++-- drivers/net/dpaa2/mc/fsl_dpni.h | 8 ++++++-- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 ++- 4 files changed, 28 insertions(+), 10 deletions(-)
drivers/net/dpaa2/dpaa2_tm.c +11 -5
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright 2020-2024 NXP +* Copyright 2020-2026 NXP */ #include <rte_ethdev.h>
@@ -10,14 +10,20 @@#include "dpaa2_pmd_logs.h" #include <dpaa2_hw_dpio.h> -#define DPAA2_BURST_MAX (64 * 1024) -#define DPAA2_SHAPER_MIN_RATE 0#define DPAA2_SHAPER_MAX_RATE 107374182400ull#define DPAA2_WEIGHT_MAX 24701#define DPAA2_PKT_ADJUST_LEN_MIN 0#define DPAA2_PKT_ADJUST_LEN_MAX 0x7ff +static inline uint32_t dpaa2_get_burst_max (struct dpaa2_dev_priv *priv) +{ +if (dpaa2_dev_cmp_dpni_ver (priv,8 ,7 ) >=0 ) +return (dpaa2_svr_family ==SVR_LX2160A ) ?229375 :0xF7FF ; + +return 0xF7FF ; +} +int dpaa2_tm_init (struct rte_eth_dev *dev) {
@@ -283,7 +289,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE , NULL, "committed rate is out of range\n"); -if (params->committed.size >DPAA2_BURST_MAX ) +if (params->committed.size >dpaa2_get_burst_max (priv))return -rte_tm_error_set (error,EINVAL ,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE ,NULL ,"committed size is out of range\n" );
@@ -293,7 +299,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE , NULL, "Peak rate is out of range\n"); -if (params->peak.size >DPAA2_BURST_MAX ) +if (params->peak.size >dpaa2_get_burst_max (priv))return -rte_tm_error_set (error,EINVAL ,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE ,NULL ,"Peak size is out of range\n" );
drivers/net/dpaa2/mc/dpni.c +9 -2
@@ -1106,6 +1106,7 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io, {struct dpni_cmd_set_tx_shaping *cmd_params;struct mc_command cmd = {0 }; +uint32_t tx_cr_burst, tx_er_burst;int coupled, lni_shaper;uint8_t channel_id;uint16_t oal;
@@ -1115,10 +1116,16 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io, cmd_flags, token); cmd_params = (struct dpni_cmd_set_tx_shaping *)cmd.params; + tx_cr_burst = tx_cr_shaper->max_burst_size; + tx_er_burst = tx_er_shaper->max_burst_size; cmd_params->tx_cr_max_burst_size = -cpu_to_le16 (tx_cr_shaper->max_burst_size); +cpu_to_le16 (DPNI_BURST_LO (tx_cr_burst)); cmd_params->tx_er_max_burst_size = -cpu_to_le16 (tx_er_shaper->max_burst_size); +cpu_to_le16 (DPNI_BURST_LO (tx_er_burst)); + cmd_params->tx_cr_max_burst_size_hi = +cpu_to_le16 (DPNI_BURST_HI (tx_cr_burst)); + cmd_params->tx_er_max_burst_size_hi = +cpu_to_le16 (DPNI_BURST_HI (tx_er_burst)); cmd_params->tx_cr_rate_limit =cpu_to_le32 (tx_cr_shaper->rate_limit); cmd_params->tx_er_rate_limit =
drivers/net/dpaa2/mc/fsl_dpni.h +6 -2
@@ -830,14 +830,18 @@ int dpni_get_link_state(struct fsl_mc_io *mc_io,uint16_t token, struct dpni_link_state *state); +#define DPNI_BURST_LO (burst) ((burst) & GENMASK(15, 0)) +#define DPNI_BURST_HI (burst) ((burst) >> 16) +/** * struct dpni_tx_shaping - Structure representing DPNI tx shaping configuration * @rate_limit: Rate in Mbits/s -* @max_burst_size: Burst size in bytes (up to 64KB) +* @max_burst_size: Burst size in bytes. Limits depend on the SoC (0x37FFF +* for LX2160A, 0xF7FF for all others) */ struct dpni_tx_shaping_cfg {uint32_t rate_limit; -uint16_t max_burst_size; +uint32_t max_burst_size; };/**
drivers/net/dpaa2/mc/fsl_dpni_cmd.h +2 -1
@@ -394,7 +394,8 @@ struct dpni_rsp_get_link_state {struct dpni_cmd_set_tx_shaping {uint16_t tx_cr_max_burst_size;uint16_t tx_er_max_burst_size; -uint32_t pad; +uint16_t tx_cr_max_burst_size_hi; +uint16_t tx_er_max_burst_size_hi;uint32_t tx_cr_rate_limit;uint32_t tx_er_rate_limit;/* from LSB: coupled:1, lni_shaper: 1*/
Signature · 1 line
2.43.0
PATCH 4/13 net/dpaa2: support MPLS and PPPoE flow distribution
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add rte_flow pattern support for MPLS and PPPoE items in the dpaa2 PMD flow engine.
For a pattern with no spec/mask, the frame is identified by its Frame Attribute Flag (FAF_MPLS_FRAM / FAF_PPPOE_PPP_FRAM) for both the QoS and flow steering tables. When a spec is present, the MPLS label (NH_FLD_MPLS_MPLSL_1) or the PPPoE session id (NH_FLD_PPPOE_SID) is added as a header extract rule for both tables.
NH_FLD_MPLS_MPLSL_1 with DPKG_FULL_FIELD causes MC to extract the full 4-byte MPLS LSE (label + TC + S + TTL). The original code passed sizeof(label_tc_s) = 3, so the driver key profile recorded the field as 3 bytes while MC placed 4 bytes in the key; any extract field added after MPLS was off by one byte, corrupting the key layout.
Fix by passing the full struct rte_flow_item_mpls pointer (spec/mask) with sizeof(*mask) = 4, so the key profile width matches the 4-byte field that MC extracts. The TTL byte has mask 0x00 in the default mask and is ignored for matching purposes.
--- doc/guides/nics/features/dpaa2.ini | 2 + drivers/net/dpaa2/dpaa2_flow.c | 196 +++++++++++++++++++++++++++++ 2 files changed, 198 insertions(+)
doc/guides/nics/features/dpaa2.ini +2 -0
@@ -43,6 +43,8 @@ gtp = Y icmp = Y ipv4 = Y ipv6 = Y +mpls = Y +pppoes = Y raw = Y sctp = Y tcp = Y
drivers/net/dpaa2/dpaa2_flow.c +196 -0
228 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 5/13 net/dpaa2: support meter and policing
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add support for the traffic metering and policing (rte_mtr) API. Meters map one-to-one to Rx TCs and are programmed via dpni_set_rx_tc_policing().
Additional corrections over the initial implementation --
- byte-mode rates converted correctly: bytes/s / 125 = Kbps
- packet-mode rates passed unchanged to firmware
- hardware programmed at create/update; policing disabled at destroy
- mtr_id validated against num_rx_tc before use
- color_aware capability cleared (FD[DROPP] not handled)
- duplicate-ID check and insertion both under meter_lock
- removed misleading "Rate limitation" entry from features/dpaa2.ini
--- doc/guides/nics/dpaa2.rst | 1 + doc/guides/rel_notes/release_26_11.rst | 5 + drivers/net/dpaa2/dpaa2_ethdev.c | 3 + drivers/net/dpaa2/dpaa2_ethdev.h | 30 + drivers/net/dpaa2/dpaa2_meter.c | 814 +++++++++++++++++++++++++ drivers/net/dpaa2/mc/fsl_dpni.h | 17 +- drivers/net/dpaa2/meson.build | 1 + 7 files changed, 867 insertions(+), 4 deletions(-) create mode 100644 drivers/net/dpaa2/dpaa2_meter.c
doc/guides/nics/dpaa2.rst +1 -0
@@ -407,6 +407,7 @@ Features of the DPAA2 PMD are: - Link flow control - Scattered and gather for TX and RX - Rx queue interrupts +- Traffic metering and policing - :ref:`dpaa2_dptmapi`
doc/guides/rel_notes/release_26_11.rst +5 -0
@@ -20,6 +20,11 @@ DPDK Release 26.11 ninja -C build doc xdg-open build/doc/guides/html/rel_notes/release_26_11.html +* **Updated NXP DPAA2 net driver.** + + * Added Tx queue based flow control and confirmation queue handling. + * Added software parser based packet dump for debugging. + * Added support for traffic metering and policing (rte_mtr API). New Features ------------
drivers/net/dpaa2/dpaa2_ethdev.c +3 -0
@@ -1665,6 +1665,7 @@ dpaa2_dev_close(struct rte_eth_dev *dev) }dpaa2_tm_deinit (dev); +dpaa2_mtr_deinit (dev);dpaa2_flow_clean (dev);/* Clean the device first */ ret =dpni_reset (dpni,CMD_PRI_LOW , priv->token);
@@ -3317,6 +3318,7 @@ static struct eth_dev_ops dpaa2_ethdev_ops = { .rxq_info_get = dpaa2_rxq_info_get, .txq_info_get = dpaa2_txq_info_get, .tm_ops_get = dpaa2_tm_ops_get, + .mtr_ops_get = dpaa2_mtr_ops_get,#if defined(RTE_LIBRTE_IEEE1588 ) .timesync_enable = dpaa2_timesync_enable, .timesync_disable = dpaa2_timesync_disable,
@@ -3540,6 +3542,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->num_channels = attr.num_channels; priv->channel_inuse =0 ;rte_spinlock_init (&priv->lpbk_qp_lock); +rte_spinlock_init (&priv->meter_lock);/* only if the custom CG is enabled */ if (attr.options &DPNI_OPT_CUSTOM_CG )
drivers/net/dpaa2/dpaa2_ethdev.h +30 -0
@@ -385,6 +385,30 @@ struct extract_s {uint8_t *tc_extract_param[MAX_TCS ]; }; +struct dpaa2_dev_meter_profile { +LIST_ENTRY (dpaa2_dev_meter_profile) next; +uint32_t profile_id; +uint64_t cir; +uint64_t cbs; +uint64_t pir; +uint64_t pbs; +enum dpni_policer_mode mode; +enum dpni_policer_unit policer_unit; +}; + +struct dpaa2_dev_meter_policy { +LIST_ENTRY (dpaa2_dev_meter_policy) next; +uint32_t policy_id; +bool red_drop; +}; + +struct dpaa2_dev_meter { +LIST_ENTRY (dpaa2_dev_meter) next; +uint32_t meter_id; +uint32_t profile_id; +uint32_t policy_id; +}; +struct dpaa2_dev_priv {void *hw;int32_t hw_id;
@@ -411,6 +435,7 @@ struct dpaa2_dev_priv {uint8_t en_loose_ordered;uint8_t max_cgs;uint8_t cgid_in_use[MAX_RX_QUEUES ]; +rte_spinlock_t meter_lock;/* Current hash distribution size per RX TC, written by * dpaa2_setup_flow_dist_size() and read by reta_query / reta_update.
@@ -456,6 +481,9 @@ struct dpaa2_dev_priv {struct dpaa2_dev_flow *curr; LIST_HEAD(, dpaa2_dev_flow) flows; + LIST_HEAD(, dpaa2_dev_meter_profile) profiles; + LIST_HEAD(, dpaa2_dev_meter_policy) policies; + LIST_HEAD(, dpaa2_dev_meter) meters; LIST_HEAD(nodes, dpaa2_tm_node) nodes; LIST_HEAD(shaper_profiles, dpaa2_tm_shaper_profile) shaper_profiles; };
@@ -548,6 +576,8 @@ int dpaa2_timesync_read_tx_timestamp(struct rte_eth_dev *dev,int dpaa2_dev_recycle_config (struct rte_eth_dev *eth_dev);int dpaa2_dev_recycle_deconfig (struct rte_eth_dev *eth_dev); +void dpaa2_mtr_deinit (struct rte_eth_dev *dev); +int dpaa2_mtr_ops_get (struct rte_eth_dev *dev,void *ops);int dpaa2_soft_parser_loaded (void );void
drivers/net/dpaa2/dpaa2_meter.c new file +814 -0
814 lines not on this page · raw message
drivers/net/dpaa2/mc/fsl_dpni.h +13 -4
@@ -1111,6 +1111,10 @@ int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io,*/ #define DPNI_POLICER_OPT_DISCARD_RED 0x00000002 +/** +* Do NOT reset counters generally for policer update +*/ +/** * enum dpni_policer_mode - selecting the policer mode * @DPNI_POLICER_MODE_NONE: Policer is disabled
@@ -1127,12 +1131,17 @@ enum dpni_policer_mode {/** * enum dpni_policer_unit - DPNI policer units -* @DPNI_POLICER_UNIT_BYTES: bytes units +* @DPNI_POLICER_UNIT_BYTES_L3: bytes units (for each frame takes into account +* FD length - L3 offset) * @DPNI_POLICER_UNIT_FRAMES: frames units +* @DPNI_POLICER_UNIT_BYTES_L2_WITHOUT_FCS: bytes units (for each frame takes +* into account FD length - L2 offset, which means L2 size without the 4 bytes +* for the FCS) */ enum dpni_policer_unit { -DPNI_POLICER_UNIT_BYTES =0 , -DPNI_POLICER_UNIT_FRAMES +DPNI_POLICER_UNIT_BYTES_L3 =0 , +DPNI_POLICER_UNIT_FRAMES , +DPNI_POLICER_UNIT_BYTES_L2_WITHOUT_FCS , };/**
@@ -1173,13 +1182,13 @@ struct dpni_rx_tc_policing_cfg {uint32_t ebs; }; -int dpni_set_rx_tc_policing (struct fsl_mc_io *mc_io,uint32_t cmd_flags,uint16_t token,uint8_t tc_id,const struct dpni_rx_tc_policing_cfg *cfg); + int dpni_get_rx_tc_policing(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token,
drivers/net/dpaa2/meson.build +1 -0
@@ -11,6 +11,7 @@ sources = files( 'base/dpaa2_hw_dpni.c', 'base/dpaa2_tlu_hash.c', 'dpaa2_tm.c', + 'dpaa2_meter.c', 'dpaa2_mux.c', 'dpaa2_ethdev.c', 'dpaa2_flow.c',
Signature · 1 line
2.43.0
PATCH 6/13 net/dpaa2: support flow drop action
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add support for the RTE_FLOW_ACTION_TYPE_DROP action in the dpaa2 flow engine. A flow rule with a drop action is programmed into the flow steering (FS) table with the DPNI_FS_OPT_DISCARD option so that matching frames are discarded by hardware.
The drop action is added to the supported action list, accepted during action verification, configured in the FS action path, handled in the generic flow-set action loop, and cleaned up in the flow destroy path.
--- drivers/net/dpaa2/dpaa2_flow.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/dpaa2/dpaa2_flow.c +7 -1
@@ -97,7 +97,8 @@ enum rte_flow_action_type dpaa2_supported_action_type[] = {RTE_FLOW_ACTION_TYPE_QUEUE ,RTE_FLOW_ACTION_TYPE_PORT_ID ,RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT , - RTE_FLOW_ACTION_TYPE_RSS +RTE_FLOW_ACTION_TYPE_RSS , + RTE_FLOW_ACTION_TYPE_DROP };#ifndef __cplusplus
@@ -4421,6 +4422,7 @@ dpaa2_flow_verify_action(struct dpaa2_dev_priv *priv,break ;case RTE_FLOW_ACTION_TYPE_PF :/* Skip this action, have to add for vxlan */ +case RTE_FLOW_ACTION_TYPE_DROP :break ;case RTE_FLOW_ACTION_TYPE_END : end_of_list =1 ;
@@ -4468,6 +4470,8 @@ dpaa2_configure_flow_fs_action(struct dpaa2_dev_priv *priv, flow->fs_action_cfg.redirect_obj_token = dest_priv->token; flow->fs_action_cfg.flow_id = dest_q->flow_id; + }else if (flow->action_type ==RTE_FLOW_ACTION_TYPE_DROP ) { + flow->fs_action_cfg.options =DPNI_FS_OPT_DISCARD ; }return 0 ;
@@ -4945,6 +4949,7 @@ dpaa2_generic_flow_set(struct dpaa2_dev_flow *flow,case RTE_FLOW_ACTION_TYPE_QUEUE :case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT :case RTE_FLOW_ACTION_TYPE_PORT_ID : +case RTE_FLOW_ACTION_TYPE_DROP : ret =dpaa2_configure_flow_fs_action (priv, flow, &actions[j]);if (ret)
@@ -5346,6 +5351,7 @@ dpaa2_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *_flow,case RTE_FLOW_ACTION_TYPE_QUEUE :case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT :case RTE_FLOW_ACTION_TYPE_PORT_ID : +case RTE_FLOW_ACTION_TYPE_DROP :if (priv->num_rx_tc >1 ) {/* Remove entry from QoS table first */ ret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW,
Signature · 1 line
2.43.0
PATCH 7/13 net/dpaa2: set default flow miss action per device
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
The flow steering miss flow id was a file-scope global defaulting to 0 and optionally overridden via the DPAA2_FLOW_CONTROL_MISS_FLOW environment variable. Replace it with a per-device default_flow field in dpaa2_dev_priv, initialised to the lowest-priority flow ID (min(fs_entries, dist_queues) - 1) at probe time, so that each device has its own independent miss-flow setting.
The DPAA2_FLOW_CONTROL_MISS_FLOW environment variable is removed. Users who relied on it must use the rte_flow API instead.
--- doc/guides/rel_notes/release_26_11.rst | 4 ++++ drivers/net/dpaa2/dpaa2_ethdev.c | 2 ++ drivers/net/dpaa2/dpaa2_ethdev.h | 2 ++ drivers/net/dpaa2/dpaa2_flow.c | 14 +------------- 4 files changed, 9 insertions(+), 13 deletions(-)
doc/guides/rel_notes/release_26_11.rst +4 -0
@@ -25,6 +25,10 @@ DPDK Release 26.11 * Added Tx queue based flow control and confirmation queue handling. * Added software parser based packet dump for debugging. * Added support for traffic metering and policing (rte_mtr API). + * Removed ``DPAA2_FLOW_CONTROL_MISS_FLOW`` environment variable. The + per-device FS table miss flow id now defaults to the lowest-priority + flow of the device. Users who previously redirected unmatched frames + to a specific queue via this variable must use the rte_flow API instead. New Features ------------
drivers/net/dpaa2/dpaa2_ethdev.c +2 -0
@@ -3541,6 +3541,8 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->dist_queues = attr.num_queues; priv->num_channels = attr.num_channels; priv->channel_inuse =0 ; + priv->default_flow =RTE_MAX (RTE_MIN (priv->fs_entries, + priv->dist_queues),1 ) -1 ;rte_spinlock_init (&priv->lpbk_qp_lock);rte_spinlock_init (&priv->meter_lock);
drivers/net/dpaa2/dpaa2_ethdev.h +2 -0
@@ -436,6 +436,8 @@ struct dpaa2_dev_priv {uint8_t max_cgs;uint8_t cgid_in_use[MAX_RX_QUEUES ];rte_spinlock_t meter_lock; +/* Lowest priority FS flow id to receive flow steering miss frames. */ +uint16_t default_flow;/* Current hash distribution size per RX TC, written by * dpaa2_setup_flow_dist_size() and read by reta_query / reta_update.
drivers/net/dpaa2/dpaa2_flow.c +1 -13
@@ -24,7 +24,6 @@#include <dpaa2_pmd_logs.h> static char *dpaa2_flow_control_log; -static uint16_t dpaa2_flow_miss_flow_id;/* Default miss flow id is 0. */ static int dpaa2_sp_loaded =-1 ;enum dpaa2_flow_entry_size {
@@ -4590,7 +4589,7 @@ dpaa2_configure_fs_rss_table(struct dpaa2_dev_priv *priv,return 0 ; tc_cfg.enable = true; - tc_cfg.fs_miss_flow_id = dpaa2_flow_miss_flow_id; + tc_cfg.fs_miss_flow_id = priv->default_flow; ret =dpni_set_rx_fs_dist (dpni,CMD_PRI_LOW , priv->token, &tc_cfg);if (ret <0 ) {
@@ -5224,17 +5223,6 @@ dpaa2_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, dpaa2_flow_control_log =getenv ("DPAA2_FLOW_CONTROL_LOG" ); -if (getenv ("DPAA2_FLOW_CONTROL_MISS_FLOW" )) { - dpaa2_flow_miss_flow_id = - (uint16_t )atoi (getenv ("DPAA2_FLOW_CONTROL_MISS_FLOW" )); -if (dpaa2_flow_miss_flow_id >= priv->dist_queues) { -DPAA2_PMD_ERR ("Missed flow ID %d >= dist size(%d)" , - dpaa2_flow_miss_flow_id, - priv->dist_queues); -return NULL ; - } - } - flow =rte_zmalloc (NULL ,sizeof (struct dpaa2_dev_flow ),RTE_CACHE_LINE_SIZE );if (!flow) {
Signature · 1 line
2.43.0
PATCH 8/13 net/dpaa2: identify Rx mbuf hash information by FLC
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
For default RSS distribution, the mbuf is marked with RTE_MBUF_F_RX_RSS_HASH and the hash value is taken from the high word of FLC.
Configure the flow steering action with FLC enabled to align the stashing setting with the RSS configuration. The TC ID and flow ID are packed into the FLC low word by the hardware. An Rx mbuf received from the FS table has the FS_MARK bit set in FLC low word; such mbufs are marked with RTE_MBUF_F_RX_FDIR and the TC and flow ID are stored via rte_mbuf_sched_set() for use by the scheduler.
--- drivers/net/dpaa2/dpaa2_ethdev.h | 12 +++++++++ drivers/net/dpaa2/dpaa2_flow.c | 42 ++++++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 20 +++++++++++++-- 3 files changed, 72 insertions(+), 2 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.h +12 -0
@@ -282,6 +282,18 @@ enum dpaa2_ecpri_fafe_type {/* ECPRI shares SP context with VXLAN*/ #define DPAA2_ECPRI_MSG_OFFSET DPAA2_VXLAN_VNI_OFFSET +#define DPAA2_FS_FLC_FS_MARK_OFFSET \ + (DPAA2_FLC_DATA_STASHING + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_OFFSET \ + (DPAA2_FS_FLC_FS_MARK_OFFSET + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_BIT_SIZE (sizeof(uint8_t) * 8) +#define DPAA2_FS_FLC_TC_MASK ((1 << DPAA2_FS_FLC_TC_BIT_SIZE) - 1) + +#define DPAA2_FS_FLC_FLOW_OFFSET \ + (DPAA2_FS_FLC_TC_OFFSET + DPAA2_FS_FLC_TC_BIT_SIZE) +#define DPAA2_ECPRI_MAX_EXTRACT_NB 8struct ipv4_sd_addr_extract_rule {
drivers/net/dpaa2/dpaa2_flow.c +42 -0
61 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_rxtx.c +18 -2
@@ -58,6 +58,7 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,uint16_t frc =DPAA2_GET_FD_FRC_PARSE_SUM (fd);struct dpaa2_annot_hdr *annotation = (struct dpaa2_annot_hdr *)hw_annot_addr; +uint32_t flc_lo, tc, flow;if (unlikely (dpaa2_print_parser_result))dpaa2_print_parse_result (annotation);
@@ -118,8 +119,23 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,default : m->packet_type =dpaa2_dev_rx_parse_slow (m, annotation); } - m->hash.rss = fd->simple.flc_hi; - m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; + flc_lo = fd->simple.flc_lo; +if (flc_lo & (1 <<DPAA2_FS_FLC_FS_MARK_OFFSET )) { + tc = (flc_lo >>DPAA2_FS_FLC_TC_OFFSET ) & +DPAA2_FS_FLC_TC_MASK ; + flow = flc_lo >>DPAA2_FS_FLC_FLOW_OFFSET ; + m->ol_flags |= +RTE_MBUF_F_RX_FDIR | +RTE_MBUF_F_RX_FDIR_ID ; + m->hash.fdir.hi = (tc <<16 ) | flow; +DPAA2_PMD_DP_DEBUG ("FS frame received from TC[%d]->flow%d" , + tc, flow); + }else { + m->hash.rss = fd->simple.flc_hi; + m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; +DPAA2_PMD_DP_DEBUG ("Hash frame received with RSS(%08x)" , + m->hash.rss); + }if (dpaa2_enable_ts[m->port]) { *dpaa2_timestamp_dynfield (m) = annotation->word2;
Signature · 1 line
2.43.0
PATCH 9/13 net/dpaa2: add minimum key size support
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
The default size for a QoS key is 24 bytes. If the key size is smaller than the maximum, use the default (minimum) key size instead of always returning the maximum size (56 bytes). This allows smaller flow tables to be used when the extracted key fits within the default size.
Support for 24-byte QoS key entries is available from DPNI version 8.7 onwards. For older DPNI versions, the existing 56-byte entry size is retained to maintain compatibility.
--- drivers/net/dpaa2/dpaa2_flow.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/net/dpaa2/dpaa2_flow.c +12 -9
@@ -26,8 +26,11 @@static char *dpaa2_flow_control_log;static int dpaa2_sp_loaded =-1 ; +/* Default size of a key */ +#define DPNI_DEFAULT_KEY_SIZE 24 +enum dpaa2_flow_entry_size { -DPAA2_FLOW_ENTRY_MIN_SIZE = (DPNI_MAX_KEY_SIZE /2 ), +DPAA2_FLOW_ENTRY_MIN_SIZE =DPNI_DEFAULT_KEY_SIZE ,DPAA2_FLOW_ENTRY_MAX_SIZE =DPNI_MAX_KEY_SIZE };
@@ -4519,7 +4522,7 @@ dpaa2_configure_flow_fs_action(struct dpaa2_dev_priv *priv, }static inline uint16_t -dpaa2_flow_entry_size (uint16_t key_max_size) +dpaa2_flow_entry_size (struct dpaa2_dev_priv *priv,uint16_t key_max_size) {if (key_max_size >DPAA2_FLOW_ENTRY_MAX_SIZE ) { DPAA2_PMD_ERR("Key size(%d) > max(%d)",
@@ -4529,11 +4532,11 @@ dpaa2_flow_entry_size(uint16_t key_max_size)return 0 ; } -if (key_max_size >DPAA2_FLOW_ENTRY_MIN_SIZE ) +if (key_max_size >DPAA2_FLOW_ENTRY_MIN_SIZE || +dpaa2_dev_cmp_dpni_ver (priv,8 ,7 ) <0 )return DPAA2_FLOW_ENTRY_MAX_SIZE ; -/* Current MC only support fixed entry size(56)*/ -return DPAA2_FLOW_ENTRY_MAX_SIZE ; +return DPAA2_FLOW_ENTRY_MIN_SIZE ; } static inline int
@@ -4595,7 +4598,7 @@ dpaa2_configure_fs_rss_table(struct dpaa2_dev_priv *priv, } key_max_size = tc_extract->key_profile.key_max_size; - entry_size =dpaa2_flow_entry_size (key_max_size); + entry_size =dpaa2_flow_entry_size (priv, key_max_size);dpaa2_flow_fs_extracts_log (priv, tc_id); ret = dpkg_prepare_key_cfg(&tc_extract->dpkg,
@@ -4686,7 +4689,7 @@ dpaa2_configure_qos_table(struct dpaa2_dev_priv *priv, } key_max_size = qos_extract->key_profile.key_max_size; - entry_size =dpaa2_flow_entry_size (key_max_size); + entry_size =dpaa2_flow_entry_size (priv, key_max_size);dpaa2_flow_qos_extracts_log (priv);
@@ -4977,11 +4980,11 @@ dpaa2_generic_flow_set(struct dpaa2_dev_flow *flow, qos_key_extract = &priv->extract.qos_key_extract; key_size = qos_key_extract->key_profile.key_max_size; - flow->qos_rule.key_size =dpaa2_flow_entry_size (key_size); + flow->qos_rule.key_size =dpaa2_flow_entry_size (priv, key_size); tc_key_extract = &priv->extract.tc_key_extract[flow->tc_id]; key_size = tc_key_extract->key_profile.key_max_size; - flow->fs_rule.key_size =dpaa2_flow_entry_size (key_size); + flow->fs_rule.key_size =dpaa2_flow_entry_size (priv, key_size);/* Let's parse action on matching traffic */ end_of_list =0 ;
Signature · 1 line
2.43.0
PATCH 10/13 net/dpaa2: restructure dpaa2 parser processing
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
Move parse-result decoding into dpaa2_parser_decode.h, shared between the flow code and the Rx path.
IPV4/6_EXT, SCTP and ICMP ptypes are removed from the rx_parse_new fast-path switch and now go through dpaa2_dev_rx_parse_frc().
Also included in this commit are
- Restore Rx timestamp: write annotation->word2 into the dynfield in dpaa2_dev_rx_parse_new() when dpaa2_enable_ts[] is set.
- Drop RTE_MBUF_F_RX_FDIR from dpaa2_dev_rx_mbuf_sched_set(): hash.sched overlaps hash.fdir; only hash.sched is written via rte_mbuf_sched_set().
- Parser dump wired up -- set DPAA2_RX_PRINT_PSR_RESULT_FLAG in priv->flags from the DPAA2_PRINT_RX_PARSER_RESULT env var so the dump helper fires.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.h | 176 ++- drivers/net/dpaa2/dpaa2_parse_dump.h | 374 ------ drivers/net/dpaa2/dpaa2_parser_decode.h | 1551 +++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_pmd_logs.h | 67 + drivers/net/dpaa2/dpaa2_rxtx.c | 410 +++--- 6 files changed, 1990 insertions(+), 590 deletions(-) delete mode 100644 drivers/net/dpaa2/dpaa2_parse_dump.h create mode 100644 drivers/net/dpaa2/dpaa2_parser_decode.h
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -3592,7 +3592,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) }if (getenv ("DPAA2_PRINT_RX_PARSER_RESULT" )) - dpaa2_print_parser_result =1 ; + priv->flags |=DPAA2_RX_PRINT_PSR_RESULT_FLAG ;/* Allocate memory for hardware structure for queues */ ret =dpaa2_alloc_rx_tx_queues (eth_dev);
drivers/net/dpaa2/dpaa2_ethdev.h +118 -58
245 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_parse_dump.h deleted +0 -374
374 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_parser_decode.h new file +1551 -0
1,551 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_pmd_logs.h +67 -0
77 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_rxtx.c +253 -157
570 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 11/13 net/dpaa2: parse tunnel and fragmented packet types
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
Extend dpaa2_dev_rx_parse_new() (LX2160A FRC fast path) to identify IPv4/IPv6 fragmented packets, IPsec ESP, and GTP-U/GTP-C packets.
Map the corresponding parser summary values to DPDK packet types. GTP-U and GTP-C packets are additionally marked with RTE_PTYPE_L4_UDP to reflect the UDP transport used by the outer tunnel header.
Advertise the newly supported packet types through dpaa2_supported_ptypes_get().
--- drivers/net/dpaa2/dpaa2_ethdev.c | 4 ++++ drivers/net/dpaa2/dpaa2_ethdev.h | 16 +++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 41 ++++++++++++++++++++++++++++++-- 3 files changed, 59 insertions(+), 2 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +4 -0
@@ -1371,6 +1371,10 @@ dpaa2_supported_ptypes_get(struct rte_eth_dev *dev, size_t *no_of_elements)RTE_PTYPE_L4_UDP ,RTE_PTYPE_L4_SCTP ,RTE_PTYPE_L4_ICMP , +RTE_PTYPE_L4_FRAG , +RTE_PTYPE_TUNNEL_ESP , +RTE_PTYPE_TUNNEL_GTPU , + RTE_PTYPE_TUNNEL_GTPC, }; if (dev->rx_pkt_burst == dpaa2_dev_prefetch_rx ||
drivers/net/dpaa2/dpaa2_ethdev.h +16 -0
@@ -162,6 +162,10 @@#define DPAA2_PKT_TYPE_IPV6_EXT_GRE_IPV6_UDP_TCP \ (DPAA2_PKT_TYPE_IPV6_EXT | DPAA2_PSR_SUMMARY_GRE_IPV6_UDP_TCP) +#define DPAA2_PKT_TYPE_IPV4_FRAG \ + (DPAA2_PSR_SUMMARY_IP_FRAG | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_FRAG \ + (DPAA2_PSR_SUMMARY_IP_FRAG | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_IPV4_TCP \ (DPAA2_PSR_SUMMARY_TCP | DPAA2_PKT_TYPE_IPV4)#define DPAA2_PKT_TYPE_IPV6_TCP \
@@ -178,6 +182,18 @@ (DPAA2_PSR_SUMMARY_ICMP | DPAA2_PKT_TYPE_IPV4)#define DPAA2_PKT_TYPE_IPV6_ICMP \ (DPAA2_PSR_SUMMARY_ICMP | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_ESP \ + (DPAA2_PSR_SUMMARY_IPSEC_ESP | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_ESP \ + (DPAA2_PSR_SUMMARY_IPSEC_ESP | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPU \ + (DPAA2_PSR_SUMMARY_GTPU | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPU \ + (DPAA2_PSR_SUMMARY_GTPU | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPC \ + (DPAA2_PSR_SUMMARY_GTPC | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPC \ + (DPAA2_PSR_SUMMARY_GTPC | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_VLAN_1 0x0100#define DPAA2_PKT_TYPE_VLAN_2 0x0200
drivers/net/dpaa2/dpaa2_rxtx.c +39 -2
47 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 12/13 net/dpaa2: remove unused soft parser driver
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
The DPAA2 soft parser (SP) byte code has to be installed by the boot firmware before Linux starts; the WRIOP parser cannot be reprogrammed once the MC is up. Loading an SP image at run time from the PMD therefore never took effect, so the loader and its DPNI_SS_INGRESS plumbing were dead code and are removed.
The rte_flow VXLAN and eCPRI pattern items were only ever accepted while an SP image was believed to be loaded. With the SP gone they are rejected by dpaa2_dev_verify_patterns() before the configure switch is reached, so their handlers dpaa2_configure_flow_vxlan() and dpaa2_configure_flow_ecpri(), the switch cases that call them, the mask descriptors and the VXLAN_HF_VNI helper are removed as well. Both items are also dropped from the dpaa2 feature matrix so that the documented capabilities match the code.
--- doc/guides/nics/features/dpaa2.ini | 2 - doc/guides/rel_notes/release_26_11.rst | 9 + drivers/net/dpaa2/dpaa2_ethdev.c | 28 -- drivers/net/dpaa2/dpaa2_ethdev.h | 1 - drivers/net/dpaa2/dpaa2_flow.c | 564 +----------------------- drivers/net/dpaa2/dpaa2_parser_decode.h | 2 - drivers/net/dpaa2/dpaa2_recycle.c | 1 - drivers/net/dpaa2/dpaa2_sparser.c | 137 ------ drivers/net/dpaa2/dpaa2_sparser.h | 202 --------- drivers/net/dpaa2/meson.build | 1 - 10 files changed, 10 insertions(+), 937 deletions(-) delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.c delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.h
doc/guides/nics/features/dpaa2.ini +0 -2
@@ -35,7 +35,6 @@ Usage doc = Y [rte_flow items] ah = Y -ecpri = Y esp = Y eth = P gre = Y
@@ -50,7 +49,6 @@ sctp = Y tcp = Y udp = Y vlan = P -vxlan = Y [rte_flow actions] drop = Y
doc/guides/rel_notes/release_26_11.rst +9 -0
@@ -168,6 +168,15 @@ Removed Items Also, make sure to start the actual text at the margin. ======================================================= +* **Removed soft parser support from the dpaa2 net driver.** + + The DPAA2 soft parser (SP) blob has to be loaded by the boot firmware + before Linux starts, so loading it at run time from the PMD never took + effect. The unused SP loader has been removed, together with the rte_flow + VXLAN and eCPRI pattern items that were only accepted while an SP image + was believed to be loaded. Those two items are no longer advertised in + the dpaa2 feature matrix. + * Removed deprecated symbols: * eal: ``__rte_packed``
drivers/net/dpaa2/dpaa2_ethdev.c +0 -28
@@ -29,7 +29,6 @@#include <mc/fsl_dpmng.h> #include <mc/fsl_dpcon.h> #include "dpaa2_ethdev.h" -#include "dpaa2_sparser.h" #include <fsl_qbman_debug.h> #define DRIVER_LOOPBACK_MODE "drv_loopback"
@@ -3721,33 +3720,6 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) } eth_dev->data->mtu =RTE_ETHER_MTU ; -/*TODO To enable soft parser support DPAA2 driver needs to integrate -* with external entity to receive byte code for software sequence -* and same will be offload to the H/W using MC interface. -* Currently it is assumed that DPAA2 driver has byte code by some -* mean and same if offloaded to H/W. -*/ -if (getenv ("DPAA2_ENABLE_SOFT_PARSER" )) { -WRIOP_SS_INITIALIZER (priv); - ret =dpaa2_eth_load_wriop_soft_parser (priv,DPNI_SS_INGRESS ); -if (ret <0 ) { -DPAA2_PMD_ERR (" Error(%d) in loading softparser" , - ret); - goto init_err; - } - - ret =dpaa2_eth_enable_wriop_soft_parser (priv, -DPNI_SS_INGRESS ); -if (ret <0 ) { -DPAA2_PMD_ERR (" Error(%d) in enabling softparser" , - ret); - goto init_err; - } - } - - ret =dpaa2_soft_parser_loaded (); -if (ret >0 ) -DPAA2_PMD_INFO ("soft parser is loaded" );DPAA2_PMD_INFO ("%s: netdev created, connected to %s" , eth_dev->data->name, dpaa2_dev->ep_name);
drivers/net/dpaa2/dpaa2_ethdev.h +0 -1
@@ -668,7 +668,6 @@ int dpaa2_dev_recycle_config(struct rte_eth_dev *eth_dev);int dpaa2_dev_recycle_deconfig (struct rte_eth_dev *eth_dev);void dpaa2_mtr_deinit (struct rte_eth_dev *dev);int dpaa2_mtr_ops_get (struct rte_eth_dev *dev,void *ops); -int dpaa2_soft_parser_loaded (void );void dpaa2_dev_mac_setup_stats (struct rte_eth_dev *dev);
drivers/net/dpaa2/dpaa2_flow.c +1 -563
629 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_parser_decode.h +0 -2
@@ -625,8 +625,6 @@ union __rte_packed_begin dpaa2_faf_h_parse_64b {#define DPAA2_VXLAN_IN_SADDR5_OFFSET \ offsetof(struct dpaa2_psr_result_parse, word8.vxlan_in_saddr5) -#define DPAA2_VXLAN_VNI_OFFSET \ - offsetof(struct dpaa2_psr_result_parse, word8.vxlan_vni[0])#define DPAA2_VXLAN_IN_TYPE_OFFSET \ offsetof(struct dpaa2_psr_result_parse, word8.vxlan_eth_type)/* Set by SP for vxlan distribution end*/
drivers/net/dpaa2/dpaa2_recycle.c +0 -1
@@ -23,7 +23,6 @@#include <dpaa2_hw_dpio.h> #include <mc/fsl_dpmng.h> #include "dpaa2_ethdev.h" -#include "dpaa2_sparser.h" #include <fsl_qbman_debug.h> #include <rte_io.h>
drivers/net/dpaa2/dpaa2_sparser.c deleted +0 -137
137 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_sparser.h deleted +0 -202
202 lines not on this page · raw message
drivers/net/dpaa2/meson.build +0 -1
@@ -17,7 +17,6 @@ sources = files( 'dpaa2_flow.c', 'dpaa2_recycle.c', 'dpaa2_rxtx.c', - 'dpaa2_sparser.c', 'dpaa2_ptp.c', 'mc/dprtc.c', 'mc/dpkg.c',
Signature · 1 line
2.43.0
PATCH 13/13 net/dpaa2: rename Rx queue flags
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
Rename the Rx-side device flags to a consistent DPAA2_RX_*_FLAG naming:DPAAX_RX_ERROR_QUEUE_FLAG becomes DPAA2_RX_ERROR_QUEUE_FLAG and DPAA2_DATA_STASHING_OFF becomes DPAA2_RX_DATA_STASHING_OFF_FLAG.
This is a mechanical rename with no functional change.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 10 +++++----- drivers/net/dpaa2/dpaa2_ethdev.h | 5 +++-- drivers/net/dpaa2/dpaa2_rxtx.c | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +5 -5
@@ -550,7 +550,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) goto fail; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { priv->rx_err_vq =rte_zmalloc ("dpni_rx_err" ,sizeof (struct dpaa2_queue ),0 );if (!priv->rx_err_vq) {
@@ -1041,7 +1041,7 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, options |=DPNI_QUEUE_OPT_FLC ; cfg.flc.stash_control = true;dpaa2_flc_stashing_clear_all (&cfg.flc.value); -if (priv->flags &DPAA2_DATA_STASHING_OFF ) { +if (priv->flags &DPAA2_RX_DATA_STASHING_OFF_FLAG ) {dpaa2_flc_stashing_set (DPAA2_FLC_DATA_STASHING ,0 , &cfg.flc.value); dpaa2_q->data_stashing_off =1 ;
@@ -1521,7 +1521,7 @@ dpaa2_dev_start(struct rte_eth_dev *dev) dpaa2_q->fqid = qid.fqid; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { ret =dpni_get_queue (dpni,CMD_PRI_LOW , priv->token,DPNI_QUEUE_RX_ERR ,0 ,0 , &cfg, &qid);if (ret) {
@@ -3477,7 +3477,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)if (dpaa2_get_devargs (dev->devargs,DRIVER_NO_DATA_STASHING ) ||getenv ("DPAA2_DATA_STASHING_OFF" )) { - priv->flags |=DPAA2_DATA_STASHING_OFF ; + priv->flags |=DPAA2_RX_DATA_STASHING_OFF_FLAG ;DPAA2_PMD_INFO ("Data stashing disabled" ); }
@@ -3584,7 +3584,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) }if (dpaa2_get_devargs (dev->devargs,DRIVER_ERROR_QUEUE )) { - priv->flags |=DPAAX_RX_ERROR_QUEUE_FLAG ; + priv->flags |=DPAA2_RX_ERROR_QUEUE_FLAG ;DPAA2_PMD_INFO ("Enable error queue" ); }
drivers/net/dpaa2/dpaa2_ethdev.h +3 -2
@@ -100,9 +100,10 @@#define DPAA2_TX_DYNAMIC_CONF_ENABLE RTE_BIT32(9)/* Disable data stashing (prefetch of packet data into CPU cache) */ -#define DPAA2_DATA_STASHING_OFF RTE_BIT32(10) +#define DPAA2_RX_DATA_STASHING_OFF_FLAG RTE_BIT32(10) + +#define DPAA2_RX_ERROR_QUEUE_FLAG RTE_BIT32(11) -#define DPAAX_RX_ERROR_QUEUE_FLAG RTE_BIT32(11)#define DPAA2_RX_PRINT_PSR_RESULT_FLAG RTE_BIT32(12)/* DPDMUX index for DPMAC */
drivers/net/dpaa2/dpaa2_rxtx.c +2 -2
@@ -921,7 +921,7 @@ dpaa2_dev_prefetch_rx_common(void *queue, struct rte_mbuf **bufs, q_storage = dpaa2_q->q_storage[rte_lcore_id ()]; -if (unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq);if (unlikely (!DPAA2_PER_LCORE_ETHRX_DPIO )) {
@@ -1193,7 +1193,7 @@ dpaa2_dev_rx_common(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;struct dpaa2_dev_priv *priv = eth_data->dev_private; -if (!by_channel &&unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (!by_channel &&unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq);if (by_channel) {
Signature · 1 line
2.43.0
Re: [PATCH v8-S2 00/13] net/dpaa2 updates
In reply to Prashant GuptaQuoted 4 lines · On Fri, 9 Oct 2026 16:18:47 +0530 Prashant Gupta <[email protected]>…
This is the second of four series upstreaming the missing NXP dpaa2 driver changes. It does not depend on series 1 and can be applied independently.
Quoted 12 lines
Changes in v8:
- Address review comments for meter and policing support.
- Add meter resource cleanup during device close.
- Add policing capability checks.
- Validate burst size ranges before hardware programming.
- Fix software/hardware state consistency on profile/policy updates.
- Clarify and guard default flow-miss handling.
- Use standard FDIR reporting for flow-steered packets.
- Document and gate minimum DPNI version for 24-byte flow keys.
- Fold parser fixups into originating patches.
- Remove unused VXLAN offset helper following soft parser removal.
- Update release notes placement and content.
Although review of S1 was clean and now in next-net, the second part still has open issues:
Review: [PATCH v8-S2 00/13] net/dpaa2 updates
Applies on top of v7-S1. Most v7 comments are addressed (mtr deinit, policing check, update ordering, FDIR_ID, key size gating, miss flow note). Remaining items below.
[PATCH 05/13] net/dpaa2: support meter and policing
Error: the burst size check in dpaa2_mtr_profile_add() is pasted twice. Remove one copy.
Warning: meter_create still drops meter_lock around dpaa2_mtr_hw_program(). If control operations can be concurrent, there is a race here; if not allowed, what is the point of meter_lock? Either hold it across check, program and insert, or drop the lock.
Info: fsl_dpni.h removes DPNI_POLICER_OPT_DO_NOT_RESET_COUNTERS but leaves its comment ("Do NOT reset counters generally for policer update") and an extra blank line where the _v1 prototype was. Remove both.
Release notes (05/13, 07/13)
Error: not changed from v7. The "Updated NXP DPAA2 net driver" block is still above the "New Features" heading, duplicates the existing "Updated NXP DPAA2 ethernet driver" entry, and still lists "Tx queue based flow control" and "software parser based packet dump", which this series does not add (12/13 removes the soft parser). Move the meter and miss flow bullets into the existing entry under New Features:
* **Updated NXP DPAA2 ethernet driver.**
...
* Added support for traffic metering and policing (rte_mtr API).
* Removed ``DPAA2_FLOW_CONTROL_MISS_FLOW`` environment variable. Use the rte_flow API to steer unmatched frames.
[PATCH 10/13] net/dpaa2: restructure dpaa2 parser processing
Warning: the new code in dpaa2_rxtx.c is indented with spaces (about 100 lines, e.g. dpaa2_dev_rx_mbuf_sched_set()). Use tabs.
Warning: the commit message is stale. It still says "Restore Rx timestamp" and "Drop RTE_MBUF_F_RX_FDIR", but timestamp is already handled at 08/13 and the code now sets RX_FDIR | RX_FDIR_ID. Drop both bullets. Also rename dpaa2_dev_rx_mbuf_sched_set(), it no longer calls rte_mbuf_sched_set(); dpaa2_dev_rx_flc_info() or similar.
cover net/dpaa2 updates
In reply to Prashant GuptaChanges in v9:
- Address review comments for meter and policing support.
- Add meter resource cleanup during device close.
- Add policing capability checks.
- Validate burst size ranges before hardware programming.
- Fix software/hardware state consistency on profile and policy updates.
- Use standard FDIR reporting for flow-steered packets.
- Replace global flow miss configuration with a per-device default flow and remove the DPAA2_FLOW_CONTROL_MISS_FLOW environment variable.
- Document and gate minimum DPNI version requirement for 24-byte flow keys.
- Rework parser decode infrastructure and parser-result dumping.
- Parse additional tunnel and fragmented packet types.
- Fold parser-related fixes into the originating patches.
- Remove unused VXLAN offset helpers after soft parser removal.
- Move release note updates into the existing DPAA2 ethernet driver entry under New Features.
- Fix coding style issues reported during review.
Series overview:
- fix an integer overflow in the CCSR region mapping,
- set Tx confirmation on device init and support a larger burst size,
- support MPLS and PPPoE flow distribution, meter and policing, and the flow drop action, with a per-device default flow miss action,
- identify Rx mbuf hash information by FLC and add minimum key size support,
- restructure parser processing, parse tunnel and fragmented packet types, remove the unused soft parser driver and rename Rx queue flags.
Gagandeep Singh (7):
net/dpaa2: set Tx confirmation on device init net/dpaa2: support larger burst size net/dpaa2: support MPLS and PPPoE flow distribution net/dpaa2: support meter and policing net/dpaa2: support flow drop action net/dpaa2: set default flow miss action per device net/dpaa2: identify Rx mbuf hash information by FLC
Hemant Agrawal (4):
net/dpaa2: fix integer overflow in CCSR region mapping net/dpaa2: add minimum key size support net/dpaa2: restructure dpaa2 parser processing net/dpaa2: parse tunnel and fragmented packet types
Jun Yang (2):
net/dpaa2: remove unused soft parser driver
net/dpaa2: rename Rx queue flags
doc/guides/nics/dpaa2.rst | 1 + doc/guides/nics/features/dpaa2.ini | 4 +- doc/guides/rel_notes/release_26_11.rst | 15 +- drivers/net/dpaa2/dpaa2_ethdev.c | 89 +- drivers/net/dpaa2/dpaa2_ethdev.h | 218 +++- drivers/net/dpaa2/dpaa2_flow.c | 633 +++------ drivers/net/dpaa2/dpaa2_meter.c | 804 ++++++++++++ drivers/net/dpaa2/dpaa2_parse_dump.h | 374 ------ drivers/net/dpaa2/dpaa2_parser_decode.h | 1549 +++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_pmd_logs.h | 67 + drivers/net/dpaa2/dpaa2_recycle.c | 24 +- drivers/net/dpaa2/dpaa2_rxtx.c | 351 +++-- drivers/net/dpaa2/dpaa2_sparser.c | 137 -- drivers/net/dpaa2/dpaa2_sparser.h | 202 --- drivers/net/dpaa2/dpaa2_tm.c | 16 +- drivers/net/dpaa2/mc/dpni.c | 11 +- drivers/net/dpaa2/mc/fsl_dpni.h | 25 +- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 +- drivers/net/dpaa2/meson.build | 2 +- 19 files changed, 3096 insertions(+), 1429 deletions(-) create mode 100644 drivers/net/dpaa2/dpaa2_meter.c delete mode 100644 drivers/net/dpaa2/dpaa2_parse_dump.h create mode 100644 drivers/net/dpaa2/dpaa2_parser_decode.h delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.c delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.h
Signature · 1 line
2.43.0
PATCH 1/13 net/dpaa2: fix integer overflow in CCSR region mapping
From: Hemant Agrawal <[email protected]>
In lsx_ccsr_map_region, PAGE_SIZE is a macro defined as sysconf(_SC_PAGESIZE), which returns a signed long and may be negative on error. The value was used directly in size_t comparisons and passed to mmap, causing an integer overflow (Coverity CID 49765682).
The old round-down "len & PAGE_MASK" ignored the in-page offset: for a 4096-byte or 6656-byte len on a 64K-page kernel the masked result is 0, causing the mapping to fail, where the old code would have bumped len up to PAGE_SIZE. The correct mapping size must cover the region from the page-aligned start through offset + len.
Fix by calling sysconf(_SC_PAGESIZE) explicitly into a signed long, checking for a non-positive return before use, computing page_mask from the verified value, and using RTE_ALIGN_CEIL(offset + len, page_size) for map_len so that the mmap covers the full requested region regardless of page size. The page-aligned start address and the back-pointer offset are both derived from the same page_mask, keeping the three values consistent.
Coverity issue: 49765682
--- drivers/net/dpaa2/dpaa2_recycle.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/net/dpaa2/dpaa2_recycle.c +15 -8
@@ -176,6 +176,9 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)void *tmp;uint64_t start;uint64_t offset; +uint64_t page_mask; +long page_size; +size_t map_len; fd =open ("/dev/mem" ,O_RDWR );if (fd <0 ) {
@@ -183,20 +186,24 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)return NULL ; } - start = addr &PAGE_MASK ; + page_size =sysconf (_SC_PAGESIZE); +if (page_size <=0 ) { +close (fd); +return NULL ; + } + page_mask = ~((uint64_t )page_size -1 ); + start = addr & page_mask; offset = addr - start; - len = len &PAGE_MASK ; -if (len < (size_t )PAGE_SIZE ) - len =PAGE_SIZE ; + map_len =RTE_ALIGN_CEIL (offset + len, (size_t )page_size); - tmp =mmap (NULL , len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start); + tmp =mmap (NULL , map_len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start);close (fd); -if (tmp !=MAP_FAILED ) -return (uint8_t *)tmp + offset; -else +if (tmp ==MAP_FAILED )return NULL ; + +return (uint8_t *)tmp + offset; }static const uint8_t ls_sd1_prot_idx_map[] = {
Signature · 1 line
2.43.0
Re: [PATCH v9-S2 01/13] net/dpaa2: fix integer overflow in CCSR region mapping
Quoted 34 lines · On Mon, 12 Oct 2026 12:34:32 +0530 Prashant Gupta <[email protected]>…
From: Hemant Agrawal <[email protected]>
In
lsx_ccsr_map_region,PAGE_SIZEis a macro defined assysconf(_SC_PAGESIZE), which returns a signed long and may be negative on error. The value was used directly insize_tcomparisons and passed to mmap, causing an integer overflow (Coverity CID 49765682).The old round-down "len &
PAGE_MASK" ignored the in-page offset: for a 4096-byte or 6656-byte len on a 64K-page kernel the masked result is 0, causing the mapping to fail, where the old code would have bumped len up toPAGE_SIZE. The correct mapping size must cover the region from the page-aligned start through offset + len.Fix by calling
sysconf(_SC_PAGESIZE)explicitly into a signed long, checking for a non-positive return before use, computingpage_maskfrom the verified value, and usingRTE_ALIGN_CEIL(offset + len, page_size)formap_lenso that the mmap covers the full requested region regardless of page size. The page-aligned start address and the back-pointer offset are both derived from the samepage_mask, keeping the three values consistent.Coverity issue: 49765682
Fixes f023d059769f ("net/dpaa2: support recycle loopback port")Signed-off-by Hemant Agrawal <[email protected]>--- drivers/net/dpaa2/dpaa2_recycle.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)drivers/net/dpaa2/dpaa2_recycle.c +0
-0
drivers/net/dpaa2/dpaa2_recycle.c static void *lsx_ccsr_map_region(uint64_t addr, size_t len) · line 183
Quoted 8 lines
drivers/net/dpaa2/dpaa2_recycle.c +3
-0@@ -176,6 +176,9 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)void *tmp;uint64_t start;uint64_t offset; +uint64_t page_mask; +long page_size; +size_t map_len; fd =open ("/dev/mem" ,O_RDWR );
Does this driver work with CONFIG_STRICT_DEVMEM and CONFIG_IO_STRICT_DEVMEM? Note it won't work in lockdown mode at all.
drivers/net/dpaa2/dpaa2_recycle.c static void *lsx_ccsr_map_region(uint64_t addr, size_t len) · line 190
Quoted 8 lines
drivers/net/dpaa2/dpaa2_recycle.c +2
-1if (fd <0 ) {@@ -183,20 +186,24 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)return NULL ; } - start = addr &PAGE_MASK ; + page_size =sysconf (_SC_PAGESIZE); +if (page_size <=0 ) {
Something is broken if this happens, should log it?
PATCH 2/13 net/dpaa2: set Tx confirmation on device init
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Move TX confirmation mode setting from TXQ setup to device initialization because TXQ0 is not always set up by the user.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 40 ++++++++++++-------------------- 1 file changed, 15 insertions(+), 25 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +15 -25
@@ -1153,7 +1153,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,struct dpni_queue tx_conf_cfg;struct dpni_queue tx_flow_cfg;uint8_t options =0 , flow_id; -uint8_t ceetm_ch_idx;uint16_t channel_id;struct dpni_queue_id qid;uint32_t tc_id;
@@ -1174,30 +1173,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,memset (&tx_conf_cfg,0 ,sizeof (struct dpni_queue ));memset (&tx_flow_cfg,0 ,sizeof (struct dpni_queue )); -if (!tx_queue_id) { -for (ceetm_ch_idx =0 ; - ceetm_ch_idx <= (priv->num_channels -1 ); - ceetm_ch_idx++) { -/*Set tx-conf and error configuration*/ -if (priv->flags &DPAA2_TX_CONF_ENABLE ) { - ret =dpni_set_tx_confirmation_mode (dpni, -CMD_PRI_LOW , priv->token, - ceetm_ch_idx, -DPNI_CONF_AFFINE ); - }else { - ret =dpni_set_tx_confirmation_mode (dpni, -CMD_PRI_LOW , priv->token, - ceetm_ch_idx, -DPNI_CONF_DISABLE ); - } -if (ret) { -DPAA2_PMD_ERR ("Error(%d) in tx conf setting" , - ret); -return ret; - } - } - } - tc_id = tx_queue_id % priv->num_tx_tc; channel_id = (uint8_t )(tx_queue_id / priv->num_tx_tc) % priv->num_channels; flow_id =0 ;
@@ -3621,6 +3596,21 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) goto init_err; } +for (i =0 ; i < priv->num_channels; i++) { +/*Set tx-conf and error configuration*/ +if (priv->flags &DPAA2_TX_CONF_ENABLE ) { + ret =dpni_set_tx_confirmation_mode (dpni_dev, +CMD_PRI_LOW , priv->token, i,DPNI_CONF_AFFINE ); + }else { + ret =dpni_set_tx_confirmation_mode (dpni_dev, +CMD_PRI_LOW , priv->token, i,DPNI_CONF_DISABLE ); + } +if (ret) { +DPAA2_PMD_ERR ("Error(%d) in tx conf setting" , ret); + goto init_err; + } + } +/* Allocate memory for storing MAC addresses. * Table of mac_filter_entries size is allocated so that RTE ether lib * can add MAC entries when rte_eth_dev_mac_addr_add is called.
Signature · 1 line
2.43.0
PATCH 3/13 net/dpaa2: support larger burst size
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Make burst size checks and MC command fields SoC-aware, enabling bursts larger than 64K on LX2160A with dpni version 8.7+.
The max_burst_size field in dpni_tx_shaping_cfg is widened to uint32_t and the MC command struct is updated to split the value across two 16-bit fields using the new DPNI_BURST_LO/HI macros.
--- drivers/net/dpaa2/dpaa2_tm.c | 16 +++++++++++----- drivers/net/dpaa2/mc/dpni.c | 11 +++++++++-- drivers/net/dpaa2/mc/fsl_dpni.h | 8 ++++++-- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 ++- 4 files changed, 28 insertions(+), 10 deletions(-)
drivers/net/dpaa2/dpaa2_tm.c +11 -5
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright 2020-2024 NXP +* Copyright 2020-2026 NXP */ #include <rte_ethdev.h>
@@ -10,14 +10,20 @@#include "dpaa2_pmd_logs.h" #include <dpaa2_hw_dpio.h> -#define DPAA2_BURST_MAX (64 * 1024) -#define DPAA2_SHAPER_MIN_RATE 0#define DPAA2_SHAPER_MAX_RATE 107374182400ull#define DPAA2_WEIGHT_MAX 24701#define DPAA2_PKT_ADJUST_LEN_MIN 0#define DPAA2_PKT_ADJUST_LEN_MAX 0x7ff +static inline uint32_t dpaa2_get_burst_max (struct dpaa2_dev_priv *priv) +{ +if (dpaa2_dev_cmp_dpni_ver (priv,8 ,7 ) >=0 ) +return (dpaa2_svr_family ==SVR_LX2160A ) ?229375 :0xF7FF ; + +return 0xF7FF ; +} +int dpaa2_tm_init (struct rte_eth_dev *dev) {
@@ -283,7 +289,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE , NULL, "committed rate is out of range\n"); -if (params->committed.size >DPAA2_BURST_MAX ) +if (params->committed.size >dpaa2_get_burst_max (priv))return -rte_tm_error_set (error,EINVAL ,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE ,NULL ,"committed size is out of range\n" );
@@ -293,7 +299,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE , NULL, "Peak rate is out of range\n"); -if (params->peak.size >DPAA2_BURST_MAX ) +if (params->peak.size >dpaa2_get_burst_max (priv))return -rte_tm_error_set (error,EINVAL ,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE ,NULL ,"Peak size is out of range\n" );
drivers/net/dpaa2/mc/dpni.c +9 -2
@@ -1106,6 +1106,7 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io, {struct dpni_cmd_set_tx_shaping *cmd_params;struct mc_command cmd = {0 }; +uint32_t tx_cr_burst, tx_er_burst;int coupled, lni_shaper;uint8_t channel_id;uint16_t oal;
@@ -1115,10 +1116,16 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io, cmd_flags, token); cmd_params = (struct dpni_cmd_set_tx_shaping *)cmd.params; + tx_cr_burst = tx_cr_shaper->max_burst_size; + tx_er_burst = tx_er_shaper->max_burst_size; cmd_params->tx_cr_max_burst_size = -cpu_to_le16 (tx_cr_shaper->max_burst_size); +cpu_to_le16 (DPNI_BURST_LO (tx_cr_burst)); cmd_params->tx_er_max_burst_size = -cpu_to_le16 (tx_er_shaper->max_burst_size); +cpu_to_le16 (DPNI_BURST_LO (tx_er_burst)); + cmd_params->tx_cr_max_burst_size_hi = +cpu_to_le16 (DPNI_BURST_HI (tx_cr_burst)); + cmd_params->tx_er_max_burst_size_hi = +cpu_to_le16 (DPNI_BURST_HI (tx_er_burst)); cmd_params->tx_cr_rate_limit =cpu_to_le32 (tx_cr_shaper->rate_limit); cmd_params->tx_er_rate_limit =
drivers/net/dpaa2/mc/fsl_dpni.h +6 -2
@@ -830,14 +830,18 @@ int dpni_get_link_state(struct fsl_mc_io *mc_io,uint16_t token, struct dpni_link_state *state); +#define DPNI_BURST_LO (burst) ((burst) & GENMASK(15, 0)) +#define DPNI_BURST_HI (burst) ((burst) >> 16) +/** * struct dpni_tx_shaping - Structure representing DPNI tx shaping configuration * @rate_limit: Rate in Mbits/s -* @max_burst_size: Burst size in bytes (up to 64KB) +* @max_burst_size: Burst size in bytes. Limits depend on the SoC (0x37FFF +* for LX2160A, 0xF7FF for all others) */ struct dpni_tx_shaping_cfg {uint32_t rate_limit; -uint16_t max_burst_size; +uint32_t max_burst_size; };/**
drivers/net/dpaa2/mc/fsl_dpni_cmd.h +2 -1
@@ -394,7 +394,8 @@ struct dpni_rsp_get_link_state {struct dpni_cmd_set_tx_shaping {uint16_t tx_cr_max_burst_size;uint16_t tx_er_max_burst_size; -uint32_t pad; +uint16_t tx_cr_max_burst_size_hi; +uint16_t tx_er_max_burst_size_hi;uint32_t tx_cr_rate_limit;uint32_t tx_er_rate_limit;/* from LSB: coupled:1, lni_shaper: 1*/
Signature · 1 line
2.43.0
PATCH 4/13 net/dpaa2: support MPLS and PPPoE flow distribution
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add rte_flow pattern support for MPLS and PPPoE items in the dpaa2 PMD flow engine.
For a pattern with no spec/mask, the frame is identified by its Frame Attribute Flag (FAF_MPLS_FRAM / FAF_PPPOE_PPP_FRAM) for both the QoS and flow steering tables. When a spec is present, the MPLS label (NH_FLD_MPLS_MPLSL_1) or the PPPoE session id (NH_FLD_PPPOE_SID) is added as a header extract rule for both tables.
NH_FLD_MPLS_MPLSL_1 with DPKG_FULL_FIELD causes MC to extract the full 4-byte MPLS LSE (label + TC + S + TTL). The original code passed sizeof(label_tc_s) = 3, so the driver key profile recorded the field as 3 bytes while MC placed 4 bytes in the key; any extract field added after MPLS was off by one byte, corrupting the key layout.
Fix by passing the full struct rte_flow_item_mpls pointer (spec/mask) with sizeof(*mask) = 4, so the key profile width matches the 4-byte field that MC extracts. The TTL byte has mask 0x00 in the default mask and is ignored for matching purposes.
--- doc/guides/nics/features/dpaa2.ini | 2 + drivers/net/dpaa2/dpaa2_flow.c | 196 +++++++++++++++++++++++++++++ 2 files changed, 198 insertions(+)
doc/guides/nics/features/dpaa2.ini +2 -0
@@ -43,6 +43,8 @@ gtp = Y icmp = Y ipv4 = Y ipv6 = Y +mpls = Y +pppoes = Y raw = Y sctp = Y tcp = Y
drivers/net/dpaa2/dpaa2_flow.c +196 -0
228 lines not on this page · raw message
Signature · 1 line
2.43.0
Re: [PATCH v9-S2 04/13] net/dpaa2: support MPLS and PPPoE flow distribution
drivers/net/dpaa2/dpaa2_flow.c dpaa2_configure_flow_gtp(struct dpaa2_dev_flow *flow, · line 4187
Quoted 7 lines · On Mon, 12 Oct 2026 12:34:35 +0530 Prashant Gupta <[email protected]>…
drivers/net/dpaa2/dpaa2_flow.c +7
-0+ ret =dpaa2_flow_identify_by_faf (priv, flow, +FAF_PPPOE_PPP_FRAM ,DPAA2_FLOW_FS_TYPE , + group, &local_cfg); +if (ret) +return ret; + + (*device_configured) |= local_cfg;
Unnecessary extra parenthesis.
PATCH 5/13 net/dpaa2: support meter and policing
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add support for the traffic metering and policing (rte_mtr) API. Meters map one-to-one to Rx TCs and are programmed via dpni_set_rx_tc_policing().
Additional corrections over the initial implementation --
- byte-mode rates converted correctly: bytes/s / 125 = Kbps
- packet-mode rates passed unchanged to firmware
- hardware programmed at create/update; policing disabled at destroy
- mtr_id validated against num_rx_tc before use
- color_aware capability cleared (FD[DROPP] not handled)
- duplicate-ID check and insertion both under meter_lock
- removed misleading "Rate limitation" entry from features/dpaa2.ini
--- doc/guides/nics/dpaa2.rst | 1 + doc/guides/rel_notes/release_26_11.rst | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 3 + drivers/net/dpaa2/dpaa2_ethdev.h | 30 + drivers/net/dpaa2/dpaa2_meter.c | 804 +++++++++++++++++++++++++ drivers/net/dpaa2/mc/fsl_dpni.h | 17 +- drivers/net/dpaa2/meson.build | 1 + 7 files changed, 853 insertions(+), 5 deletions(-) create mode 100644 drivers/net/dpaa2/dpaa2_meter.c
doc/guides/nics/dpaa2.rst +1 -0
@@ -407,6 +407,7 @@ Features of the DPAA2 PMD are: - Link flow control - Scattered and gather for TX and RX - Rx queue interrupts +- Traffic metering and policing - :ref:`dpaa2_dptmapi`
doc/guides/rel_notes/release_26_11.rst +1 -1
@@ -20,7 +20,6 @@ DPDK Release 26.11 ninja -C build doc xdg-open build/doc/guides/html/rel_notes/release_26_11.html - New Features ------------
@@ -105,6 +104,7 @@ New Features * Added the inner IP header to the RSS hash so tunneled traffic is distributed across the Rx queues. + * Added support for traffic metering and policing (rte_mtr API). * **Updated NXP ENETC4 PMD.**
drivers/net/dpaa2/dpaa2_ethdev.c +3 -0
@@ -1665,6 +1665,7 @@ dpaa2_dev_close(struct rte_eth_dev *dev) }dpaa2_tm_deinit (dev); +dpaa2_mtr_deinit (dev);dpaa2_flow_clean (dev);/* Clean the device first */ ret =dpni_reset (dpni,CMD_PRI_LOW , priv->token);
@@ -3317,6 +3318,7 @@ static struct eth_dev_ops dpaa2_ethdev_ops = { .rxq_info_get = dpaa2_rxq_info_get, .txq_info_get = dpaa2_txq_info_get, .tm_ops_get = dpaa2_tm_ops_get, + .mtr_ops_get = dpaa2_mtr_ops_get,#if defined(RTE_LIBRTE_IEEE1588 ) .timesync_enable = dpaa2_timesync_enable, .timesync_disable = dpaa2_timesync_disable,
@@ -3540,6 +3542,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->num_channels = attr.num_channels; priv->channel_inuse =0 ;rte_spinlock_init (&priv->lpbk_qp_lock); +rte_spinlock_init (&priv->meter_lock);/* only if the custom CG is enabled */ if (attr.options &DPNI_OPT_CUSTOM_CG )
drivers/net/dpaa2/dpaa2_ethdev.h +30 -0
@@ -385,6 +385,30 @@ struct extract_s {uint8_t *tc_extract_param[MAX_TCS ]; }; +struct dpaa2_dev_meter_profile { +LIST_ENTRY (dpaa2_dev_meter_profile) next; +uint32_t profile_id; +uint64_t cir; +uint64_t cbs; +uint64_t pir; +uint64_t pbs; +enum dpni_policer_mode mode; +enum dpni_policer_unit policer_unit; +}; + +struct dpaa2_dev_meter_policy { +LIST_ENTRY (dpaa2_dev_meter_policy) next; +uint32_t policy_id; +bool red_drop; +}; + +struct dpaa2_dev_meter { +LIST_ENTRY (dpaa2_dev_meter) next; +uint32_t meter_id; +uint32_t profile_id; +uint32_t policy_id; +}; +struct dpaa2_dev_priv {void *hw;int32_t hw_id;
@@ -411,6 +435,7 @@ struct dpaa2_dev_priv {uint8_t en_loose_ordered;uint8_t max_cgs;uint8_t cgid_in_use[MAX_RX_QUEUES ]; +rte_spinlock_t meter_lock;/* Current hash distribution size per RX TC, written by * dpaa2_setup_flow_dist_size() and read by reta_query / reta_update.
@@ -456,6 +481,9 @@ struct dpaa2_dev_priv {struct dpaa2_dev_flow *curr; LIST_HEAD(, dpaa2_dev_flow) flows; + LIST_HEAD(, dpaa2_dev_meter_profile) profiles; + LIST_HEAD(, dpaa2_dev_meter_policy) policies; + LIST_HEAD(, dpaa2_dev_meter) meters; LIST_HEAD(nodes, dpaa2_tm_node) nodes; LIST_HEAD(shaper_profiles, dpaa2_tm_shaper_profile) shaper_profiles; };
@@ -548,6 +576,8 @@ int dpaa2_timesync_read_tx_timestamp(struct rte_eth_dev *dev,int dpaa2_dev_recycle_config (struct rte_eth_dev *eth_dev);int dpaa2_dev_recycle_deconfig (struct rte_eth_dev *eth_dev); +void dpaa2_mtr_deinit (struct rte_eth_dev *dev); +int dpaa2_mtr_ops_get (struct rte_eth_dev *dev,void *ops);int dpaa2_soft_parser_loaded (void );void
drivers/net/dpaa2/dpaa2_meter.c new file +804 -0
804 lines not on this page · raw message
drivers/net/dpaa2/mc/fsl_dpni.h +13 -4
@@ -1111,6 +1111,10 @@ int dpni_set_rx_tc_dist(struct fsl_mc_io *mc_io,*/ #define DPNI_POLICER_OPT_DISCARD_RED 0x00000002 +/** +* Do NOT reset counters generally for policer update +*/ +/** * enum dpni_policer_mode - selecting the policer mode * @DPNI_POLICER_MODE_NONE: Policer is disabled
@@ -1127,12 +1131,17 @@ enum dpni_policer_mode {/** * enum dpni_policer_unit - DPNI policer units -* @DPNI_POLICER_UNIT_BYTES: bytes units +* @DPNI_POLICER_UNIT_BYTES_L3: bytes units (for each frame takes into account +* FD length - L3 offset) * @DPNI_POLICER_UNIT_FRAMES: frames units +* @DPNI_POLICER_UNIT_BYTES_L2_WITHOUT_FCS: bytes units (for each frame takes +* into account FD length - L2 offset, which means L2 size without the 4 bytes +* for the FCS) */ enum dpni_policer_unit { -DPNI_POLICER_UNIT_BYTES =0 , -DPNI_POLICER_UNIT_FRAMES +DPNI_POLICER_UNIT_BYTES_L3 =0 , +DPNI_POLICER_UNIT_FRAMES , +DPNI_POLICER_UNIT_BYTES_L2_WITHOUT_FCS , };/**
@@ -1173,13 +1182,13 @@ struct dpni_rx_tc_policing_cfg {uint32_t ebs; }; -int dpni_set_rx_tc_policing (struct fsl_mc_io *mc_io,uint32_t cmd_flags,uint16_t token,uint8_t tc_id,const struct dpni_rx_tc_policing_cfg *cfg); + int dpni_get_rx_tc_policing(struct fsl_mc_io *mc_io, uint32_t cmd_flags, uint16_t token,
drivers/net/dpaa2/meson.build +1 -0
@@ -11,6 +11,7 @@ sources = files( 'base/dpaa2_hw_dpni.c', 'base/dpaa2_tlu_hash.c', 'dpaa2_tm.c', + 'dpaa2_meter.c', 'dpaa2_mux.c', 'dpaa2_ethdev.c', 'dpaa2_flow.c',
Signature · 1 line
2.43.0
Re: [PATCH v9-S2 05/13] net/dpaa2: support meter and policing
There is a race here.
Quoted 14 lines
static int
drivers/net/dpaa2/dpaa2_meter.c new file +13
-0+dpaa2_mtr_meter_create(struct rte_eth_dev *dev, + uint32_t mtr_id, struct rte_mtr_params *params, + int shared, struct rte_mtr_error *error) +{ + struct dpaa2_dev_priv *priv = dev->data->dev_private; +struct dpaa2_dev_meter_profile *profile; +struct dpaa2_dev_meter_policy *policy; +struct dpaa2_dev_meter *meter, *curr; +uint32_t profile_id, policy_id; +enum rte_mtr_error_type err_type =RTE_MTR_ERROR_TYPE_NONE ; +bool found = false; +int ret =0 ; +
...
Quoted 47 lines
drivers/net/dpaa2/dpaa2_meter.c new file +47
-0+rte_spinlock_lock (&priv->meter_lock); + profile =LIST_FIRST (&priv->profiles); +while (profile !=NULL ) { +if (profile->profile_id == profile_id) { + found = true; +break ; + } + profile =LIST_NEXT (profile, next); + } +if (!found) { +snprintf (s_err_msg,sizeof (s_err_msg), +"Meter profile ID(%d) not exist!" , profile_id); + ret =ENOENT ; + err_type =RTE_MTR_ERROR_TYPE_METER_PROFILE_ID ; + goto quit; + } + + found = false; + policy =LIST_FIRST (&priv->policies); +while (policy !=NULL ) { +if (policy->policy_id == policy_id) { + found = true; +break ; + } + policy =LIST_NEXT (policy, next); + } +if (!found) { +snprintf (s_err_msg,sizeof (s_err_msg), +"Meter policy ID(%d) not exist!" , policy_id); + ret =ENOENT ; + err_type =RTE_MTR_ERROR_TYPE_METER_POLICY_ID ; + goto quit; + } + meter =LIST_FIRST (&priv->meters); +while (meter !=NULL ) { +if (meter->meter_id == mtr_id) { +snprintf (s_err_msg,sizeof (s_err_msg), +"Meter ID(%d) exist!" , mtr_id); + ret =EEXIST ; + err_type =RTE_MTR_ERROR_TYPE_MTR_ID ; + goto quit; + } + meter =LIST_NEXT (meter, next); + } + meter =rte_zmalloc (NULL ,sizeof (struct dpaa2_dev_meter ),0 ); +if (meter ==NULL ) { + snprintf(s_err_msg, sizeof(s_err_msg),
drivers/net/dpaa2/dpaa2_meter.c line 516
Quoted 10 lines
drivers/net/dpaa2/dpaa2_meter.c new file +10
-0+ "Meter memory alloc failed!"); + ret =ENOMEM ; + err_type =RTE_MTR_ERROR_TYPE_UNSPECIFIED ; + goto quit; + } + meter->meter_id = mtr_id; + meter->profile_id = profile_id; + meter->policy_id = policy_id; + +rte_spinlock_unlock (&priv->meter_lock);
At this point meter is created but not put into any list.
drivers/net/dpaa2/dpaa2_meter.c line 528
Quoted 12 lines
drivers/net/dpaa2/dpaa2_meter.c new file +12
-0+ +/* Program the hardware policing configuration for this TC. */ + ret =dpaa2_mtr_hw_program (dev, mtr_id, profile, policy); +if (ret) { +rte_free (meter); +snprintf (s_err_msg,sizeof (s_err_msg), +"TC[%u] HW policing set failed (%d)!" , mtr_id, ret); +return rte_mtr_error_set (error, -ret, +RTE_MTR_ERROR_TYPE_UNSPECIFIED ,NULL , s_err_msg); + } + +rte_spinlock_lock (&priv->meter_lock);
While HW was being programmed, in theory the policy and mtr_id could have gone away. Either refcount the mtr_id or do a quick rescan to make sure it hasn't disappeared.
Quoted 9 lines
drivers/net/dpaa2/dpaa2_meter.c new file +9
-0+ curr =LIST_FIRST (&priv->meters); +if (curr ==NULL ) { +LIST_INSERT_HEAD (&priv->meters, meter, next); + }else { +while (LIST_NEXT (curr, next) !=NULL ) + curr =LIST_NEXT (curr, next); +LIST_INSERT_AFTER (curr, meter, next); + } +
drivers/net/dpaa2/dpaa2_meter.c line 547
Quoted 10 lines
drivers/net/dpaa2/dpaa2_meter.c new file +10
-0+quit: +rte_spinlock_unlock (&priv->meter_lock); +if (ret !=0 ) { +if (meter !=NULL && ret ==ENOMEM ) +rte_free (meter); +return rte_mtr_error_set (error, ret, err_type,NULL , s_err_msg); + } + +return 0 ; +}
The code would also be easier to read with helper functions that looked up in list rather lots of open coded list walks.
Re: [PATCH v9-S2 05/13] net/dpaa2: support meter and policing
In reply to Prashant Guptadrivers/net/dpaa2/dpaa2_meter.c line 43
Quoted 12 lines · On Mon, 12 Oct 2026 12:34:36 +0530 Prashant Gupta <[email protected]>…
+ *
color_awaremode is not yet implemented: the firmware color input from
+ * FD[DROPP] is not read or acted upon. Advertise only blind (non-aware)
+ * trTCM variants until color-aware handling is added.
+ */drivers/net/dpaa2/dpaa2_meter.c new file +8
-0+static struct rte_mtr_capabilities s_dpaa2_mtr_capa = { + .color_aware_trtcm_rfc2698_supported = false, + .color_aware_trtcm_rfc4115_supported = false, + .trtcm_rfc2698_byte_mode_supported = true, + .trtcm_rfc2698_packet_mode_supported = true, + .trtcm_rfc4115_byte_mode_supported = true, + .trtcm_rfc4115_packet_mode_supported = true +};
Can this be constant?
Re: [PATCH v9-S2 05/13] net/dpaa2: support meter and policing
In reply to Prashant GuptaQuoted 5 lines · On Mon, 12 Oct 2026 12:34:36 +0530 Prashant Gupta <[email protected]>…
drivers/net/dpaa2/dpaa2_meter.c new file +5
-0+ +/* Check for duplicate ID and insert under lock to prevent TOCTOU. */ +rte_spinlock_lock (&priv->meter_lock); + curr =LIST_FIRST (&priv->profiles); +while (curr !=NULL ) {
drivers/net/dpaa2/dpaa2_meter.c line 202
Quoted 10 lines
drivers/net/dpaa2/dpaa2_meter.c new file +10
-0+if (curr->profile_id == profile_id) { +rte_spinlock_unlock (&priv->meter_lock); +rte_mtr_error_set (error,EEXIST , +RTE_MTR_ERROR_TYPE_METER_PROFILE_ID , +NULL ,"Meter profile ID already exists!" ); + ret = -EEXIST ; + goto err; + } + curr =LIST_NEXT (curr, next); + }
You are just open coding LIST_FOREACH() and other places. Better to use the macro.
PATCH 6/13 net/dpaa2: support flow drop action
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add support for the RTE_FLOW_ACTION_TYPE_DROP action in the dpaa2 flow engine. A flow rule with a drop action is programmed into the flow steering (FS) table with the DPNI_FS_OPT_DISCARD option so that matching frames are discarded by hardware.
The drop action is added to the supported action list, accepted during action verification, configured in the FS action path, handled in the generic flow-set action loop, and cleaned up in the flow destroy path.
--- drivers/net/dpaa2/dpaa2_flow.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/dpaa2/dpaa2_flow.c +7 -1
@@ -97,7 +97,8 @@ enum rte_flow_action_type dpaa2_supported_action_type[] = {RTE_FLOW_ACTION_TYPE_QUEUE ,RTE_FLOW_ACTION_TYPE_PORT_ID ,RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT , - RTE_FLOW_ACTION_TYPE_RSS +RTE_FLOW_ACTION_TYPE_RSS , + RTE_FLOW_ACTION_TYPE_DROP };#ifndef __cplusplus
@@ -4421,6 +4422,7 @@ dpaa2_flow_verify_action(struct dpaa2_dev_priv *priv,break ;case RTE_FLOW_ACTION_TYPE_PF :/* Skip this action, have to add for vxlan */ +case RTE_FLOW_ACTION_TYPE_DROP :break ;case RTE_FLOW_ACTION_TYPE_END : end_of_list =1 ;
@@ -4468,6 +4470,8 @@ dpaa2_configure_flow_fs_action(struct dpaa2_dev_priv *priv, flow->fs_action_cfg.redirect_obj_token = dest_priv->token; flow->fs_action_cfg.flow_id = dest_q->flow_id; + }else if (flow->action_type ==RTE_FLOW_ACTION_TYPE_DROP ) { + flow->fs_action_cfg.options =DPNI_FS_OPT_DISCARD ; }return 0 ;
@@ -4945,6 +4949,7 @@ dpaa2_generic_flow_set(struct dpaa2_dev_flow *flow,case RTE_FLOW_ACTION_TYPE_QUEUE :case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT :case RTE_FLOW_ACTION_TYPE_PORT_ID : +case RTE_FLOW_ACTION_TYPE_DROP : ret =dpaa2_configure_flow_fs_action (priv, flow, &actions[j]);if (ret)
@@ -5346,6 +5351,7 @@ dpaa2_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *_flow,case RTE_FLOW_ACTION_TYPE_QUEUE :case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT :case RTE_FLOW_ACTION_TYPE_PORT_ID : +case RTE_FLOW_ACTION_TYPE_DROP :if (priv->num_rx_tc >1 ) {/* Remove entry from QoS table first */ ret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW,
Signature · 1 line
2.43.0
PATCH 7/13 net/dpaa2: set default flow miss action per device
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
The flow steering miss flow id was a file-scope global defaulting to 0 and optionally overridden via the DPAA2_FLOW_CONTROL_MISS_FLOW environment variable. Replace it with a per-device default_flow field in dpaa2_dev_priv, initialised to the lowest-priority flow ID (min(fs_entries, dist_queues) - 1) at probe time, so that each device has its own independent miss-flow setting.
The DPAA2_FLOW_CONTROL_MISS_FLOW environment variable is removed. Users who relied on it must use the rte_flow API instead.
--- doc/guides/rel_notes/release_26_11.rst | 4 ++++ drivers/net/dpaa2/dpaa2_ethdev.c | 2 ++ drivers/net/dpaa2/dpaa2_ethdev.h | 2 ++ drivers/net/dpaa2/dpaa2_flow.c | 14 +------------- 4 files changed, 9 insertions(+), 13 deletions(-)
doc/guides/rel_notes/release_26_11.rst +4 -0
@@ -105,6 +105,10 @@ New Features * Added the inner IP header to the RSS hash so tunneled traffic is distributed across the Rx queues. * Added support for traffic metering and policing (rte_mtr API). + * Removed ``DPAA2_FLOW_CONTROL_MISS_FLOW`` environment variable. The + per-device FS table miss flow id now defaults to the lowest-priority + flow of the device. Users who previously redirected unmatched frames + to a specific queue via this variable must use the rte_flow API instead. * **Updated NXP ENETC4 PMD.**
drivers/net/dpaa2/dpaa2_ethdev.c +2 -0
@@ -3541,6 +3541,8 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->dist_queues = attr.num_queues; priv->num_channels = attr.num_channels; priv->channel_inuse =0 ; + priv->default_flow =RTE_MAX (RTE_MIN (priv->fs_entries, + priv->dist_queues),1 ) -1 ;rte_spinlock_init (&priv->lpbk_qp_lock);rte_spinlock_init (&priv->meter_lock);
drivers/net/dpaa2/dpaa2_ethdev.h +2 -0
@@ -436,6 +436,8 @@ struct dpaa2_dev_priv {uint8_t max_cgs;uint8_t cgid_in_use[MAX_RX_QUEUES ];rte_spinlock_t meter_lock; +/* Lowest priority FS flow id to receive flow steering miss frames. */ +uint16_t default_flow;/* Current hash distribution size per RX TC, written by * dpaa2_setup_flow_dist_size() and read by reta_query / reta_update.
drivers/net/dpaa2/dpaa2_flow.c +1 -13
@@ -24,7 +24,6 @@#include <dpaa2_pmd_logs.h> static char *dpaa2_flow_control_log; -static uint16_t dpaa2_flow_miss_flow_id;/* Default miss flow id is 0. */ static int dpaa2_sp_loaded =-1 ;enum dpaa2_flow_entry_size {
@@ -4590,7 +4589,7 @@ dpaa2_configure_fs_rss_table(struct dpaa2_dev_priv *priv,return 0 ; tc_cfg.enable = true; - tc_cfg.fs_miss_flow_id = dpaa2_flow_miss_flow_id; + tc_cfg.fs_miss_flow_id = priv->default_flow; ret =dpni_set_rx_fs_dist (dpni,CMD_PRI_LOW , priv->token, &tc_cfg);if (ret <0 ) {
@@ -5224,17 +5223,6 @@ dpaa2_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, dpaa2_flow_control_log =getenv ("DPAA2_FLOW_CONTROL_LOG" ); -if (getenv ("DPAA2_FLOW_CONTROL_MISS_FLOW" )) { - dpaa2_flow_miss_flow_id = - (uint16_t )atoi (getenv ("DPAA2_FLOW_CONTROL_MISS_FLOW" )); -if (dpaa2_flow_miss_flow_id >= priv->dist_queues) { -DPAA2_PMD_ERR ("Missed flow ID %d >= dist size(%d)" , - dpaa2_flow_miss_flow_id, - priv->dist_queues); -return NULL ; - } - } - flow =rte_zmalloc (NULL ,sizeof (struct dpaa2_dev_flow ),RTE_CACHE_LINE_SIZE );if (!flow) {
Signature · 1 line
2.43.0
PATCH 8/13 net/dpaa2: identify Rx mbuf hash information by FLC
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
For default RSS distribution, the mbuf is marked with RTE_MBUF_F_RX_RSS_HASH and the hash value is taken from the high word of FLC.
Configure the flow steering action with FLC enabled to align the stashing setting with the RSS configuration. The TC ID and flow ID are packed into the FLC low word by the hardware. An Rx mbuf received from the FS table has the FS_MARK bit set in FLC low word; such mbufs are marked with RTE_MBUF_F_RX_FDIR and the TC and flow ID are stored via rte_mbuf_sched_set() for use by the scheduler.
--- drivers/net/dpaa2/dpaa2_ethdev.h | 12 +++++++++ drivers/net/dpaa2/dpaa2_flow.c | 42 ++++++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 20 +++++++++++++-- 3 files changed, 72 insertions(+), 2 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.h +12 -0
@@ -282,6 +282,18 @@ enum dpaa2_ecpri_fafe_type {/* ECPRI shares SP context with VXLAN*/ #define DPAA2_ECPRI_MSG_OFFSET DPAA2_VXLAN_VNI_OFFSET +#define DPAA2_FS_FLC_FS_MARK_OFFSET \ + (DPAA2_FLC_DATA_STASHING + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_OFFSET \ + (DPAA2_FS_FLC_FS_MARK_OFFSET + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_BIT_SIZE (sizeof(uint8_t) * 8) +#define DPAA2_FS_FLC_TC_MASK ((1 << DPAA2_FS_FLC_TC_BIT_SIZE) - 1) + +#define DPAA2_FS_FLC_FLOW_OFFSET \ + (DPAA2_FS_FLC_TC_OFFSET + DPAA2_FS_FLC_TC_BIT_SIZE) +#define DPAA2_ECPRI_MAX_EXTRACT_NB 8struct ipv4_sd_addr_extract_rule {
drivers/net/dpaa2/dpaa2_flow.c +42 -0
61 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_rxtx.c +18 -2
@@ -58,6 +58,7 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,uint16_t frc =DPAA2_GET_FD_FRC_PARSE_SUM (fd);struct dpaa2_annot_hdr *annotation = (struct dpaa2_annot_hdr *)hw_annot_addr; +uint32_t flc_lo, tc, flow;if (unlikely (dpaa2_print_parser_result))dpaa2_print_parse_result (annotation);
@@ -118,8 +119,23 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,default : m->packet_type =dpaa2_dev_rx_parse_slow (m, annotation); } - m->hash.rss = fd->simple.flc_hi; - m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; + flc_lo = fd->simple.flc_lo; +if (flc_lo & (1 <<DPAA2_FS_FLC_FS_MARK_OFFSET )) { + tc = (flc_lo >>DPAA2_FS_FLC_TC_OFFSET ) & +DPAA2_FS_FLC_TC_MASK ; + flow = flc_lo >>DPAA2_FS_FLC_FLOW_OFFSET ; + m->ol_flags |= +RTE_MBUF_F_RX_FDIR | +RTE_MBUF_F_RX_FDIR_ID ; + m->hash.fdir.hi = (tc <<16 ) | flow; +DPAA2_PMD_DP_DEBUG ("FS frame received from TC[%d]->flow%d" , + tc, flow); + }else { + m->hash.rss = fd->simple.flc_hi; + m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; +DPAA2_PMD_DP_DEBUG ("Hash frame received with RSS(%08x)" , + m->hash.rss); + }if (dpaa2_enable_ts[m->port]) { *dpaa2_timestamp_dynfield (m) = annotation->word2;
Signature · 1 line
2.43.0
PATCH 9/13 net/dpaa2: add minimum key size support
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
The default size for a QoS key is 24 bytes. If the key size is smaller than the maximum, use the default (minimum) key size instead of always returning the maximum size (56 bytes). This allows smaller flow tables to be used when the extracted key fits within the default size.
Support for 24-byte QoS key entries is available from DPNI version 8.7 onwards. For older DPNI versions, the existing 56-byte entry size is retained to maintain compatibility.
--- drivers/net/dpaa2/dpaa2_flow.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/net/dpaa2/dpaa2_flow.c +12 -9
@@ -26,8 +26,11 @@static char *dpaa2_flow_control_log;static int dpaa2_sp_loaded =-1 ; +/* Default size of a key */ +#define DPNI_DEFAULT_KEY_SIZE 24 +enum dpaa2_flow_entry_size { -DPAA2_FLOW_ENTRY_MIN_SIZE = (DPNI_MAX_KEY_SIZE /2 ), +DPAA2_FLOW_ENTRY_MIN_SIZE =DPNI_DEFAULT_KEY_SIZE ,DPAA2_FLOW_ENTRY_MAX_SIZE =DPNI_MAX_KEY_SIZE };
@@ -4519,7 +4522,7 @@ dpaa2_configure_flow_fs_action(struct dpaa2_dev_priv *priv, }static inline uint16_t -dpaa2_flow_entry_size (uint16_t key_max_size) +dpaa2_flow_entry_size (struct dpaa2_dev_priv *priv,uint16_t key_max_size) {if (key_max_size >DPAA2_FLOW_ENTRY_MAX_SIZE ) { DPAA2_PMD_ERR("Key size(%d) > max(%d)",
@@ -4529,11 +4532,11 @@ dpaa2_flow_entry_size(uint16_t key_max_size)return 0 ; } -if (key_max_size >DPAA2_FLOW_ENTRY_MIN_SIZE ) +if (key_max_size >DPAA2_FLOW_ENTRY_MIN_SIZE || +dpaa2_dev_cmp_dpni_ver (priv,8 ,7 ) <0 )return DPAA2_FLOW_ENTRY_MAX_SIZE ; -/* Current MC only support fixed entry size(56)*/ -return DPAA2_FLOW_ENTRY_MAX_SIZE ; +return DPAA2_FLOW_ENTRY_MIN_SIZE ; } static inline int
@@ -4595,7 +4598,7 @@ dpaa2_configure_fs_rss_table(struct dpaa2_dev_priv *priv, } key_max_size = tc_extract->key_profile.key_max_size; - entry_size =dpaa2_flow_entry_size (key_max_size); + entry_size =dpaa2_flow_entry_size (priv, key_max_size);dpaa2_flow_fs_extracts_log (priv, tc_id); ret = dpkg_prepare_key_cfg(&tc_extract->dpkg,
@@ -4686,7 +4689,7 @@ dpaa2_configure_qos_table(struct dpaa2_dev_priv *priv, } key_max_size = qos_extract->key_profile.key_max_size; - entry_size =dpaa2_flow_entry_size (key_max_size); + entry_size =dpaa2_flow_entry_size (priv, key_max_size);dpaa2_flow_qos_extracts_log (priv);
@@ -4977,11 +4980,11 @@ dpaa2_generic_flow_set(struct dpaa2_dev_flow *flow, qos_key_extract = &priv->extract.qos_key_extract; key_size = qos_key_extract->key_profile.key_max_size; - flow->qos_rule.key_size =dpaa2_flow_entry_size (key_size); + flow->qos_rule.key_size =dpaa2_flow_entry_size (priv, key_size); tc_key_extract = &priv->extract.tc_key_extract[flow->tc_id]; key_size = tc_key_extract->key_profile.key_max_size; - flow->fs_rule.key_size =dpaa2_flow_entry_size (key_size); + flow->fs_rule.key_size =dpaa2_flow_entry_size (priv, key_size);/* Let's parse action on matching traffic */ end_of_list =0 ;
Signature · 1 line
2.43.0
PATCH 10/13 net/dpaa2: restructure dpaa2 parser processing
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
Move parse-result decoding into dpaa2_parser_decode.h, shared between the flow code and the Rx path.
IPV4/6_EXT, SCTP and ICMP ptypes are removed from the rx_parse_new fast-path switch and now go through dpaa2_dev_rx_parse_frc().
Also:
- Wire parser result dumping to DPAA2_PRINT_RX_PARSER_RESULT.
- Move parser decode helpers into dpaa2_parser_decode.h for reuse by flow and Rx paths.
- Consolidate FLC RSS/FDIR handling in a common helper.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.h | 176 ++- drivers/net/dpaa2/dpaa2_parse_dump.h | 374 ------ drivers/net/dpaa2/dpaa2_parser_decode.h | 1551 +++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_pmd_logs.h | 67 + drivers/net/dpaa2/dpaa2_rxtx.c | 344 +++-- 6 files changed, 1957 insertions(+), 557 deletions(-) delete mode 100644 drivers/net/dpaa2/dpaa2_parse_dump.h create mode 100644 drivers/net/dpaa2/dpaa2_parser_decode.h
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -3592,7 +3592,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) }if (getenv ("DPAA2_PRINT_RX_PARSER_RESULT" )) - dpaa2_print_parser_result =1 ; + priv->flags |=DPAA2_RX_PRINT_PSR_RESULT_FLAG ;/* Allocate memory for hardware structure for queues */ ret =dpaa2_alloc_rx_tx_queues (eth_dev);
drivers/net/dpaa2/dpaa2_ethdev.h +118 -58
245 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_parse_dump.h deleted +0 -374
374 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_parser_decode.h new file +1551 -0
1,551 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_pmd_logs.h +67 -0
77 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_rxtx.c +220 -124
532 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 11/13 net/dpaa2: parse tunnel and fragmented packet types
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
Extend dpaa2_dev_rx_parse_new() (LX2160A FRC fast path) to identify IPv4/IPv6 fragmented packets, IPsec ESP, and GTP-U/GTP-C packets.
Map the corresponding parser summary values to DPDK packet types. GTP-U and GTP-C packets are additionally marked with RTE_PTYPE_L4_UDP to reflect the UDP transport used by the outer tunnel header.
Advertise the newly supported packet types through dpaa2_supported_ptypes_get().
--- drivers/net/dpaa2/dpaa2_ethdev.c | 4 ++++ drivers/net/dpaa2/dpaa2_ethdev.h | 16 ++++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 37 ++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+)
drivers/net/dpaa2/dpaa2_ethdev.c +4 -0
@@ -1371,6 +1371,10 @@ dpaa2_supported_ptypes_get(struct rte_eth_dev *dev, size_t *no_of_elements)RTE_PTYPE_L4_UDP ,RTE_PTYPE_L4_SCTP ,RTE_PTYPE_L4_ICMP , +RTE_PTYPE_L4_FRAG , +RTE_PTYPE_TUNNEL_ESP , +RTE_PTYPE_TUNNEL_GTPU , + RTE_PTYPE_TUNNEL_GTPC, }; if (dev->rx_pkt_burst == dpaa2_dev_prefetch_rx ||
drivers/net/dpaa2/dpaa2_ethdev.h +16 -0
@@ -162,6 +162,10 @@#define DPAA2_PKT_TYPE_IPV6_EXT_GRE_IPV6_UDP_TCP \ (DPAA2_PKT_TYPE_IPV6_EXT | DPAA2_PSR_SUMMARY_GRE_IPV6_UDP_TCP) +#define DPAA2_PKT_TYPE_IPV4_FRAG \ + (DPAA2_PSR_SUMMARY_IP_FRAG | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_FRAG \ + (DPAA2_PSR_SUMMARY_IP_FRAG | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_IPV4_TCP \ (DPAA2_PSR_SUMMARY_TCP | DPAA2_PKT_TYPE_IPV4)#define DPAA2_PKT_TYPE_IPV6_TCP \
@@ -178,6 +182,18 @@ (DPAA2_PSR_SUMMARY_ICMP | DPAA2_PKT_TYPE_IPV4)#define DPAA2_PKT_TYPE_IPV6_ICMP \ (DPAA2_PSR_SUMMARY_ICMP | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_ESP \ + (DPAA2_PSR_SUMMARY_IPSEC_ESP | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_ESP \ + (DPAA2_PSR_SUMMARY_IPSEC_ESP | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPU \ + (DPAA2_PSR_SUMMARY_GTPU | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPU \ + (DPAA2_PSR_SUMMARY_GTPU | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPC \ + (DPAA2_PSR_SUMMARY_GTPC | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPC \ + (DPAA2_PSR_SUMMARY_GTPC | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_VLAN_1 0x0100#define DPAA2_PKT_TYPE_VLAN_2 0x0200
drivers/net/dpaa2/dpaa2_rxtx.c +37 -0
@@ -174,6 +174,43 @@ dpaa2_dev_rx_parse_new(struct dpaa2_dev_priv *priv,RTE_PTYPE_L3_IPV6 ;break ; +case DPAA2_PKT_TYPE_IPV4_FRAG : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_FRAG ; +break ; +case DPAA2_PKT_TYPE_IPV6_FRAG : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_FRAG ; +break ; +case DPAA2_PKT_TYPE_IPV4_ESP : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_TUNNEL_ESP ; +break ; +case DPAA2_PKT_TYPE_IPV6_ESP : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_TUNNEL_ESP ; +break ; +case DPAA2_PKT_TYPE_IPV4_GTPU : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPU ; +break ; +case DPAA2_PKT_TYPE_IPV6_GTPU : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPU ; +break ; +case DPAA2_PKT_TYPE_IPV4_GTPC : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPC ; +break ; +case DPAA2_PKT_TYPE_IPV6_GTPC : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPC ; +break ; +case DPAA2_PKT_TYPE_ETHER : m->packet_type =RTE_PTYPE_L2_ETHER ;break ;
Signature · 1 line
2.43.0
PATCH 12/13 net/dpaa2: remove unused soft parser driver
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
The DPAA2 soft parser (SP) byte code has to be installed by the boot firmware before Linux starts; the WRIOP parser cannot be reprogrammed once the MC is up. Loading an SP image at run time from the PMD therefore never took effect, so the loader and its DPNI_SS_INGRESS plumbing were dead code and are removed.
The rte_flow VXLAN and eCPRI pattern items were only ever accepted while an SP image was believed to be loaded. With the SP gone they are rejected by dpaa2_dev_verify_patterns() before the configure switch is reached, so their handlers dpaa2_configure_flow_vxlan() and dpaa2_configure_flow_ecpri(), the switch cases that call them, the mask descriptors and the VXLAN_HF_VNI helper are removed as well. Both items are also dropped from the dpaa2 feature matrix so that the documented capabilities match the code.
--- doc/guides/nics/features/dpaa2.ini | 2 - doc/guides/rel_notes/release_26_11.rst | 9 + drivers/net/dpaa2/dpaa2_ethdev.c | 28 -- drivers/net/dpaa2/dpaa2_ethdev.h | 1 - drivers/net/dpaa2/dpaa2_flow.c | 564 +----------------------- drivers/net/dpaa2/dpaa2_parser_decode.h | 2 - drivers/net/dpaa2/dpaa2_recycle.c | 1 - drivers/net/dpaa2/dpaa2_sparser.c | 137 ------ drivers/net/dpaa2/dpaa2_sparser.h | 202 --------- drivers/net/dpaa2/meson.build | 1 - 10 files changed, 10 insertions(+), 937 deletions(-) delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.c delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.h
doc/guides/nics/features/dpaa2.ini +0 -2
@@ -35,7 +35,6 @@ Usage doc = Y [rte_flow items] ah = Y -ecpri = Y esp = Y eth = P gre = Y
@@ -50,7 +49,6 @@ sctp = Y tcp = Y udp = Y vlan = P -vxlan = Y [rte_flow actions] drop = Y
doc/guides/rel_notes/release_26_11.rst +9 -0
@@ -163,6 +163,15 @@ Removed Items Also, make sure to start the actual text at the margin. ======================================================= +* **Removed soft parser support from the dpaa2 net driver.** + + The DPAA2 soft parser (SP) blob has to be loaded by the boot firmware + before Linux starts, so loading it at run time from the PMD never took + effect. The unused SP loader has been removed, together with the rte_flow + VXLAN and eCPRI pattern items that were only accepted while an SP image + was believed to be loaded. Those two items are no longer advertised in + the dpaa2 feature matrix. + * Removed deprecated symbols: * eal: ``__rte_packed``
drivers/net/dpaa2/dpaa2_ethdev.c +0 -28
@@ -29,7 +29,6 @@#include <mc/fsl_dpmng.h> #include <mc/fsl_dpcon.h> #include "dpaa2_ethdev.h" -#include "dpaa2_sparser.h" #include <fsl_qbman_debug.h> #define DRIVER_LOOPBACK_MODE "drv_loopback"
@@ -3721,33 +3720,6 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) } eth_dev->data->mtu =RTE_ETHER_MTU ; -/*TODO To enable soft parser support DPAA2 driver needs to integrate -* with external entity to receive byte code for software sequence -* and same will be offload to the H/W using MC interface. -* Currently it is assumed that DPAA2 driver has byte code by some -* mean and same if offloaded to H/W. -*/ -if (getenv ("DPAA2_ENABLE_SOFT_PARSER" )) { -WRIOP_SS_INITIALIZER (priv); - ret =dpaa2_eth_load_wriop_soft_parser (priv,DPNI_SS_INGRESS ); -if (ret <0 ) { -DPAA2_PMD_ERR (" Error(%d) in loading softparser" , - ret); - goto init_err; - } - - ret =dpaa2_eth_enable_wriop_soft_parser (priv, -DPNI_SS_INGRESS ); -if (ret <0 ) { -DPAA2_PMD_ERR (" Error(%d) in enabling softparser" , - ret); - goto init_err; - } - } - - ret =dpaa2_soft_parser_loaded (); -if (ret >0 ) -DPAA2_PMD_INFO ("soft parser is loaded" );DPAA2_PMD_INFO ("%s: netdev created, connected to %s" , eth_dev->data->name, dpaa2_dev->ep_name);
drivers/net/dpaa2/dpaa2_ethdev.h +0 -1
@@ -668,7 +668,6 @@ int dpaa2_dev_recycle_config(struct rte_eth_dev *eth_dev);int dpaa2_dev_recycle_deconfig (struct rte_eth_dev *eth_dev);void dpaa2_mtr_deinit (struct rte_eth_dev *dev);int dpaa2_mtr_ops_get (struct rte_eth_dev *dev,void *ops); -int dpaa2_soft_parser_loaded (void );void dpaa2_dev_mac_setup_stats (struct rte_eth_dev *dev);
drivers/net/dpaa2/dpaa2_flow.c +1 -563
629 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_parser_decode.h +0 -2
@@ -625,8 +625,6 @@ union __rte_packed_begin dpaa2_faf_h_parse_64b {#define DPAA2_VXLAN_IN_SADDR5_OFFSET \ offsetof(struct dpaa2_psr_result_parse, word8.vxlan_in_saddr5) -#define DPAA2_VXLAN_VNI_OFFSET \ - offsetof(struct dpaa2_psr_result_parse, word8.vxlan_vni[0])#define DPAA2_VXLAN_IN_TYPE_OFFSET \ offsetof(struct dpaa2_psr_result_parse, word8.vxlan_eth_type)/* Set by SP for vxlan distribution end*/
drivers/net/dpaa2/dpaa2_recycle.c +0 -1
@@ -23,7 +23,6 @@#include <dpaa2_hw_dpio.h> #include <mc/fsl_dpmng.h> #include "dpaa2_ethdev.h" -#include "dpaa2_sparser.h" #include <fsl_qbman_debug.h> #include <rte_io.h>
drivers/net/dpaa2/dpaa2_sparser.c deleted +0 -137
137 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_sparser.h deleted +0 -202
202 lines not on this page · raw message
drivers/net/dpaa2/meson.build +0 -1
@@ -17,7 +17,6 @@ sources = files( 'dpaa2_flow.c', 'dpaa2_recycle.c', 'dpaa2_rxtx.c', - 'dpaa2_sparser.c', 'dpaa2_ptp.c', 'mc/dprtc.c', 'mc/dpkg.c',
Signature · 1 line
2.43.0
PATCH 13/13 net/dpaa2: rename Rx queue flags
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
Rename the Rx-side device flags to a consistent DPAA2_RX_*_FLAG naming:DPAAX_RX_ERROR_QUEUE_FLAG becomes DPAA2_RX_ERROR_QUEUE_FLAG and DPAA2_DATA_STASHING_OFF becomes DPAA2_RX_DATA_STASHING_OFF_FLAG.
This is a mechanical rename with no functional change.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 10 +++++----- drivers/net/dpaa2/dpaa2_ethdev.h | 5 +++-- drivers/net/dpaa2/dpaa2_rxtx.c | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +5 -5
@@ -550,7 +550,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) goto fail; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { priv->rx_err_vq =rte_zmalloc ("dpni_rx_err" ,sizeof (struct dpaa2_queue ),0 );if (!priv->rx_err_vq) {
@@ -1041,7 +1041,7 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, options |=DPNI_QUEUE_OPT_FLC ; cfg.flc.stash_control = true;dpaa2_flc_stashing_clear_all (&cfg.flc.value); -if (priv->flags &DPAA2_DATA_STASHING_OFF ) { +if (priv->flags &DPAA2_RX_DATA_STASHING_OFF_FLAG ) {dpaa2_flc_stashing_set (DPAA2_FLC_DATA_STASHING ,0 , &cfg.flc.value); dpaa2_q->data_stashing_off =1 ;
@@ -1521,7 +1521,7 @@ dpaa2_dev_start(struct rte_eth_dev *dev) dpaa2_q->fqid = qid.fqid; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { ret =dpni_get_queue (dpni,CMD_PRI_LOW , priv->token,DPNI_QUEUE_RX_ERR ,0 ,0 , &cfg, &qid);if (ret) {
@@ -3477,7 +3477,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)if (dpaa2_get_devargs (dev->devargs,DRIVER_NO_DATA_STASHING ) ||getenv ("DPAA2_DATA_STASHING_OFF" )) { - priv->flags |=DPAA2_DATA_STASHING_OFF ; + priv->flags |=DPAA2_RX_DATA_STASHING_OFF_FLAG ;DPAA2_PMD_INFO ("Data stashing disabled" ); }
@@ -3584,7 +3584,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) }if (dpaa2_get_devargs (dev->devargs,DRIVER_ERROR_QUEUE )) { - priv->flags |=DPAAX_RX_ERROR_QUEUE_FLAG ; + priv->flags |=DPAA2_RX_ERROR_QUEUE_FLAG ;DPAA2_PMD_INFO ("Enable error queue" ); }
drivers/net/dpaa2/dpaa2_ethdev.h +3 -2
@@ -100,9 +100,10 @@#define DPAA2_TX_DYNAMIC_CONF_ENABLE RTE_BIT32(9)/* Disable data stashing (prefetch of packet data into CPU cache) */ -#define DPAA2_DATA_STASHING_OFF RTE_BIT32(10) +#define DPAA2_RX_DATA_STASHING_OFF_FLAG RTE_BIT32(10) + +#define DPAA2_RX_ERROR_QUEUE_FLAG RTE_BIT32(11) -#define DPAAX_RX_ERROR_QUEUE_FLAG RTE_BIT32(11)#define DPAA2_RX_PRINT_PSR_RESULT_FLAG RTE_BIT32(12)/* DPDMUX index for DPMAC */
drivers/net/dpaa2/dpaa2_rxtx.c +2 -2
@@ -921,7 +921,7 @@ dpaa2_dev_prefetch_rx_common(void *queue, struct rte_mbuf **bufs, q_storage = dpaa2_q->q_storage[rte_lcore_id ()]; -if (unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq);if (unlikely (!DPAA2_PER_LCORE_ETHRX_DPIO )) {
@@ -1193,7 +1193,7 @@ dpaa2_dev_rx_common(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;struct dpaa2_dev_priv *priv = eth_data->dev_private; -if (!by_channel &&unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (!by_channel &&unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq);if (by_channel) {
Signature · 1 line
2.43.0
Re: [PATCH v9-S2 00/13] net/dpaa2 updates
In reply to Prashant GuptaQuoted 64 lines · On Mon, 12 Oct 2026 12:34:31 +0530 Prashant Gupta <[email protected]>…
Changes in v9:
- Address review comments for meter and policing support.
- Add meter resource cleanup during device close.
- Add policing capability checks.
- Validate burst size ranges before hardware programming.
- Fix software/hardware state consistency on profile and policy updates.
- Use standard FDIR reporting for flow-steered packets.
- Replace global flow miss configuration with a per-device default flow and remove theDPAA2_FLOW_CONTROL_MISS_FLOWenvironment variable.
- Document and gate minimum DPNI version requirement for 24-byte flow keys.
- Rework parser decode infrastructure and parser-result dumping.
- Parse additional tunnel and fragmented packet types.
- Fold parser-related fixes into the originating patches.
- Remove unused VXLAN offset helpers after soft parser removal.
- Move release note updates into the existing DPAA2 ethernet driver entry under New Features.
- Fix coding style issues reported during review.Series overview:
- fix an integer overflow in the CCSR region mapping,
- set Tx confirmation on device init and support a larger burst size,
- support MPLS and PPPoE flow distribution, meter and policing, and the flow drop action, with a per-device default flow miss action,
- identify Rx mbuf hash information by FLC and add minimum key size support,
- restructure parser processing, parse tunnel and fragmented packet types, remove the unused soft parser driver and rename Rx queue flags.Gagandeep Singh (7):
net/dpaa2: set Tx confirmation on device init net/dpaa2: support larger burst size net/dpaa2: support MPLS and PPPoE flow distribution net/dpaa2: support meter and policing net/dpaa2: support flow drop action net/dpaa2: set default flow miss action per device net/dpaa2: identify Rx mbuf hash information by FLCHemant Agrawal (4):
net/dpaa2: fix integer overflow in CCSR region mapping net/dpaa2: add minimum key size support net/dpaa2: restructure dpaa2 parser processing net/dpaa2: parse tunnel and fragmented packet typesJun Yang (2):
net/dpaa2: remove unused soft parser driver
net/dpaa2: rename Rx queue flagsdoc/guides/nics/dpaa2.rst | 1 + doc/guides/nics/features/dpaa2.ini | 4 +- doc/guides/rel_notes/release_26_11.rst | 15 +- drivers/net/dpaa2/dpaa2_ethdev.c | 89 +- drivers/net/dpaa2/dpaa2_ethdev.h | 218 +++- drivers/net/dpaa2/dpaa2_flow.c | 633 +++------ drivers/net/dpaa2/dpaa2_meter.c | 804 ++++++++++++ drivers/net/dpaa2/dpaa2_parse_dump.h | 374 ------ drivers/net/dpaa2/dpaa2_parser_decode.h | 1549 +++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_pmd_logs.h | 67 + drivers/net/dpaa2/dpaa2_recycle.c | 24 +- drivers/net/dpaa2/dpaa2_rxtx.c | 351 +++-- drivers/net/dpaa2/dpaa2_sparser.c | 137 -- drivers/net/dpaa2/dpaa2_sparser.h | 202 --- drivers/net/dpaa2/dpaa2_tm.c | 16 +- drivers/net/dpaa2/mc/dpni.c | 11 +- drivers/net/dpaa2/mc/fsl_dpni.h | 25 +-
Quoted 9 lines
drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 +- drivers/net/dpaa2/meson.build | 2 +- 19 files changed, 3096 insertions(+), 1429 deletions(-) create mode 100644 drivers/net/dpaa2/dpaa2_meter.c delete mode 100644 drivers/net/dpaa2/dpaa2_parse_dump.h create mode 100644 drivers/net/dpaa2/dpaa2_parser_decode.h delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.c delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.h
In general looks good but there still is this open question.
Review: [PATCH v9-S2 00/13] net/dpaa2 updates
Applies on top of v7-S1. v8 comments on release notes, the duplicated burst check, and 10/13 indent, naming and commit message are addressed. Two items from v8 remain.
[PATCH 05/13] net/dpaa2: support meter and policing
Warning: no answer yet on meter_lock. meter_create still drops the lock around dpaa2_mtr_hw_program(). If control operations can be concurrent, there is a race here; if not allowed, what is the point of meter_lock? Either hold it across check, program and insert, or drop the lock.
Info: fsl_dpni.h still has the orphaned comment left behind when DPNI_POLICER_OPT_DO_NOT_RESET_COUNTERS was removed:
-/**
- * Do NOT reset counters generally for policer update
- */
-
cover net/dpaa2 updates
In reply to Prashant GuptaChanges in v10:
- Drop meter and policing support patch.
- Drop parser processing rework patch.
- Remove associated meter infrastructure and parser decode changes.
- Update release notes to the existing DPAA2 New Features section.
- Address review comments for per-device default flow miss action.
- Document minimum DPNI version requirement for 24-byte flow keys.
- Fold parser-related fixes into the remaining parser updates.
- Remove unused soft parser files and related build integration.
- Fix coding style issues reported during review.
Series overview:
- fix an integer overflow in the CCSR region mapping,
- set Tx confirmation on device init and support a larger burst size,
- support MPLS and PPPoE flow distribution,
- support the flow drop action and a per-device default flow miss action,
- identify Rx mbuf hash information by FLC and add minimum key size support,
- parse tunnel and fragmented packet types,
- remove the unused soft parser driver and rename Rx queue flags.
Gagandeep Singh (6):
net/dpaa2: set Tx confirmation on device init net/dpaa2: support larger burst size net/dpaa2: support MPLS and PPPoE flow distribution net/dpaa2: support flow drop action net/dpaa2: set default flow miss action per device net/dpaa2: identify Rx mbuf hash information by FLC
Hemant Agrawal (3):
net/dpaa2: fix integer overflow in CCSR region mapping net/dpaa2: add minimum key size support net/dpaa2: parse tunnel and fragmented packet types
Jun Yang (2):
net/dpaa2: remove unused soft parser driver
net/dpaa2: rename Rx queue flags
doc/guides/nics/features/dpaa2.ini | 4 +- doc/guides/rel_notes/release_26_11.rst | 13 + drivers/net/dpaa2/dpaa2_ethdev.c | 84 +--- drivers/net/dpaa2/dpaa2_ethdev.h | 36 +- drivers/net/dpaa2/dpaa2_flow.c | 633 ++++++------------------- drivers/net/dpaa2/dpaa2_recycle.c | 24 +- drivers/net/dpaa2/dpaa2_rxtx.c | 60 ++- drivers/net/dpaa2/dpaa2_sparser.c | 137 ------ drivers/net/dpaa2/dpaa2_sparser.h | 202 -------- drivers/net/dpaa2/dpaa2_tm.c | 16 +- drivers/net/dpaa2/mc/dpni.c | 11 +- drivers/net/dpaa2/mc/fsl_dpni.h | 8 +- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 +- drivers/net/dpaa2/meson.build | 1 - 14 files changed, 327 insertions(+), 905 deletions(-) delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.c delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.h
Signature · 1 line
2.43.0
PATCH 1/11 net/dpaa2: fix integer overflow in CCSR region mapping
From: Hemant Agrawal <[email protected]>
In lsx_ccsr_map_region, PAGE_SIZE is a macro defined as sysconf(_SC_PAGESIZE), which returns a signed long and may be negative on error. The value was used directly in size_t comparisons and passed to mmap, causing an integer overflow (Coverity CID 49765682).
The old round-down "len & PAGE_MASK" ignored the in-page offset: for a 4096-byte or 6656-byte len on a 64K-page kernel the masked result is 0, causing the mapping to fail, where the old code would have bumped len up to PAGE_SIZE. The correct mapping size must cover the region from the page-aligned start through offset + len.
Fix by calling sysconf(_SC_PAGESIZE) explicitly into a signed long, checking for a non-positive return before use, computing page_mask from the verified value, and using RTE_ALIGN_CEIL(offset + len, page_size) for map_len so that the mmap covers the full requested region regardless of page size. The page-aligned start address and the back-pointer offset are both derived from the same page_mask, keeping the three values consistent.
Coverity issue: 49765682
--- drivers/net/dpaa2/dpaa2_recycle.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/net/dpaa2/dpaa2_recycle.c +15 -8
@@ -176,6 +176,9 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)void *tmp;uint64_t start;uint64_t offset; +uint64_t page_mask; +long page_size; +size_t map_len; fd =open ("/dev/mem" ,O_RDWR );if (fd <0 ) {
@@ -183,20 +186,24 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)return NULL ; } - start = addr &PAGE_MASK ; + page_size =sysconf (_SC_PAGESIZE); +if (page_size <=0 ) { +close (fd); +return NULL ; + } + page_mask = ~((uint64_t )page_size -1 ); + start = addr & page_mask; offset = addr - start; - len = len &PAGE_MASK ; -if (len < (size_t )PAGE_SIZE ) - len =PAGE_SIZE ; + map_len =RTE_ALIGN_CEIL (offset + len, (size_t )page_size); - tmp =mmap (NULL , len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start); + tmp =mmap (NULL , map_len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start);close (fd); -if (tmp !=MAP_FAILED ) -return (uint8_t *)tmp + offset; -else +if (tmp ==MAP_FAILED )return NULL ; + +return (uint8_t *)tmp + offset; }static const uint8_t ls_sd1_prot_idx_map[] = {
Signature · 1 line
2.43.0
PATCH 2/11 net/dpaa2: set Tx confirmation on device init
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Move TX confirmation mode setting from TXQ setup to device initialization because TXQ0 is not always set up by the user.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 40 ++++++++++++-------------------- 1 file changed, 15 insertions(+), 25 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +15 -25
@@ -1153,7 +1153,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,struct dpni_queue tx_conf_cfg;struct dpni_queue tx_flow_cfg;uint8_t options =0 , flow_id; -uint8_t ceetm_ch_idx;uint16_t channel_id;struct dpni_queue_id qid;uint32_t tc_id;
@@ -1174,30 +1173,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,memset (&tx_conf_cfg,0 ,sizeof (struct dpni_queue ));memset (&tx_flow_cfg,0 ,sizeof (struct dpni_queue )); -if (!tx_queue_id) { -for (ceetm_ch_idx =0 ; - ceetm_ch_idx <= (priv->num_channels -1 ); - ceetm_ch_idx++) { -/*Set tx-conf and error configuration*/ -if (priv->flags &DPAA2_TX_CONF_ENABLE ) { - ret =dpni_set_tx_confirmation_mode (dpni, -CMD_PRI_LOW , priv->token, - ceetm_ch_idx, -DPNI_CONF_AFFINE ); - }else { - ret =dpni_set_tx_confirmation_mode (dpni, -CMD_PRI_LOW , priv->token, - ceetm_ch_idx, -DPNI_CONF_DISABLE ); - } -if (ret) { -DPAA2_PMD_ERR ("Error(%d) in tx conf setting" , - ret); -return ret; - } - } - } - tc_id = tx_queue_id % priv->num_tx_tc; channel_id = (uint8_t )(tx_queue_id / priv->num_tx_tc) % priv->num_channels; flow_id =0 ;
@@ -3621,6 +3596,21 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) goto init_err; } +for (i =0 ; i < priv->num_channels; i++) { +/*Set tx-conf and error configuration*/ +if (priv->flags &DPAA2_TX_CONF_ENABLE ) { + ret =dpni_set_tx_confirmation_mode (dpni_dev, +CMD_PRI_LOW , priv->token, i,DPNI_CONF_AFFINE ); + }else { + ret =dpni_set_tx_confirmation_mode (dpni_dev, +CMD_PRI_LOW , priv->token, i,DPNI_CONF_DISABLE ); + } +if (ret) { +DPAA2_PMD_ERR ("Error(%d) in tx conf setting" , ret); + goto init_err; + } + } +/* Allocate memory for storing MAC addresses. * Table of mac_filter_entries size is allocated so that RTE ether lib * can add MAC entries when rte_eth_dev_mac_addr_add is called.
Signature · 1 line
2.43.0
PATCH 3/11 net/dpaa2: support larger burst size
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Make burst size checks and MC command fields SoC-aware, enabling bursts larger than 64K on LX2160A with dpni version 8.7+.
The max_burst_size field in dpni_tx_shaping_cfg is widened to uint32_t and the MC command struct is updated to split the value across two 16-bit fields using the new DPNI_BURST_LO/HI macros.
--- drivers/net/dpaa2/dpaa2_tm.c | 16 +++++++++++----- drivers/net/dpaa2/mc/dpni.c | 11 +++++++++-- drivers/net/dpaa2/mc/fsl_dpni.h | 8 ++++++-- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 ++- 4 files changed, 28 insertions(+), 10 deletions(-)
drivers/net/dpaa2/dpaa2_tm.c +11 -5
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright 2020-2024 NXP +* Copyright 2020-2026 NXP */ #include <rte_ethdev.h>
@@ -10,14 +10,20 @@#include "dpaa2_pmd_logs.h" #include <dpaa2_hw_dpio.h> -#define DPAA2_BURST_MAX (64 * 1024) -#define DPAA2_SHAPER_MIN_RATE 0#define DPAA2_SHAPER_MAX_RATE 107374182400ull#define DPAA2_WEIGHT_MAX 24701#define DPAA2_PKT_ADJUST_LEN_MIN 0#define DPAA2_PKT_ADJUST_LEN_MAX 0x7ff +static inline uint32_t dpaa2_get_burst_max (struct dpaa2_dev_priv *priv) +{ +if (dpaa2_dev_cmp_dpni_ver (priv,8 ,7 ) >=0 ) +return (dpaa2_svr_family ==SVR_LX2160A ) ?229375 :0xF7FF ; + +return 0xF7FF ; +} +int dpaa2_tm_init (struct rte_eth_dev *dev) {
@@ -283,7 +289,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE , NULL, "committed rate is out of range\n"); -if (params->committed.size >DPAA2_BURST_MAX ) +if (params->committed.size >dpaa2_get_burst_max (priv))return -rte_tm_error_set (error,EINVAL ,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE ,NULL ,"committed size is out of range\n" );
@@ -293,7 +299,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE , NULL, "Peak rate is out of range\n"); -if (params->peak.size >DPAA2_BURST_MAX ) +if (params->peak.size >dpaa2_get_burst_max (priv))return -rte_tm_error_set (error,EINVAL ,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE ,NULL ,"Peak size is out of range\n" );
drivers/net/dpaa2/mc/dpni.c +9 -2
@@ -1106,6 +1106,7 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io, {struct dpni_cmd_set_tx_shaping *cmd_params;struct mc_command cmd = {0 }; +uint32_t tx_cr_burst, tx_er_burst;int coupled, lni_shaper;uint8_t channel_id;uint16_t oal;
@@ -1115,10 +1116,16 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io, cmd_flags, token); cmd_params = (struct dpni_cmd_set_tx_shaping *)cmd.params; + tx_cr_burst = tx_cr_shaper->max_burst_size; + tx_er_burst = tx_er_shaper->max_burst_size; cmd_params->tx_cr_max_burst_size = -cpu_to_le16 (tx_cr_shaper->max_burst_size); +cpu_to_le16 (DPNI_BURST_LO (tx_cr_burst)); cmd_params->tx_er_max_burst_size = -cpu_to_le16 (tx_er_shaper->max_burst_size); +cpu_to_le16 (DPNI_BURST_LO (tx_er_burst)); + cmd_params->tx_cr_max_burst_size_hi = +cpu_to_le16 (DPNI_BURST_HI (tx_cr_burst)); + cmd_params->tx_er_max_burst_size_hi = +cpu_to_le16 (DPNI_BURST_HI (tx_er_burst)); cmd_params->tx_cr_rate_limit =cpu_to_le32 (tx_cr_shaper->rate_limit); cmd_params->tx_er_rate_limit =
drivers/net/dpaa2/mc/fsl_dpni.h +6 -2
@@ -830,14 +830,18 @@ int dpni_get_link_state(struct fsl_mc_io *mc_io,uint16_t token, struct dpni_link_state *state); +#define DPNI_BURST_LO (burst) ((burst) & GENMASK(15, 0)) +#define DPNI_BURST_HI (burst) ((burst) >> 16) +/** * struct dpni_tx_shaping - Structure representing DPNI tx shaping configuration * @rate_limit: Rate in Mbits/s -* @max_burst_size: Burst size in bytes (up to 64KB) +* @max_burst_size: Burst size in bytes. Limits depend on the SoC (0x37FFF +* for LX2160A, 0xF7FF for all others) */ struct dpni_tx_shaping_cfg {uint32_t rate_limit; -uint16_t max_burst_size; +uint32_t max_burst_size; };/**
drivers/net/dpaa2/mc/fsl_dpni_cmd.h +2 -1
@@ -394,7 +394,8 @@ struct dpni_rsp_get_link_state {struct dpni_cmd_set_tx_shaping {uint16_t tx_cr_max_burst_size;uint16_t tx_er_max_burst_size; -uint32_t pad; +uint16_t tx_cr_max_burst_size_hi; +uint16_t tx_er_max_burst_size_hi;uint32_t tx_cr_rate_limit;uint32_t tx_er_rate_limit;/* from LSB: coupled:1, lni_shaper: 1*/
Signature · 1 line
2.43.0
PATCH 4/11 net/dpaa2: support MPLS and PPPoE flow distribution
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add rte_flow pattern support for MPLS and PPPoE items in the dpaa2 PMD flow engine.
For a pattern with no spec/mask, the frame is identified by its Frame Attribute Flag (FAF_MPLS_FRAM / FAF_PPPOE_PPP_FRAM) for both the QoS and flow steering tables. When a spec is present, the MPLS label (NH_FLD_MPLS_MPLSL_1) or the PPPoE session id (NH_FLD_PPPOE_SID) is added as a header extract rule for both tables.
NH_FLD_MPLS_MPLSL_1 with DPKG_FULL_FIELD causes MC to extract the full 4-byte MPLS LSE (label + TC + S + TTL). The original code passed sizeof(label_tc_s) = 3, so the driver key profile recorded the field as 3 bytes while MC placed 4 bytes in the key; any extract field added after MPLS was off by one byte, corrupting the key layout.
Fix by passing the full struct rte_flow_item_mpls pointer (spec/mask) with sizeof(*mask) = 4, so the key profile width matches the 4-byte field that MC extracts. The TTL byte has mask 0x00 in the default mask and is ignored for matching purposes.
--- doc/guides/nics/features/dpaa2.ini | 2 + drivers/net/dpaa2/dpaa2_flow.c | 196 +++++++++++++++++++++++++++++ 2 files changed, 198 insertions(+)
doc/guides/nics/features/dpaa2.ini +2 -0
@@ -43,6 +43,8 @@ gtp = Y icmp = Y ipv4 = Y ipv6 = Y +mpls = Y +pppoes = Y raw = Y sctp = Y tcp = Y
drivers/net/dpaa2/dpaa2_flow.c +196 -0
228 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 5/11 net/dpaa2: support flow drop action
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add support for the RTE_FLOW_ACTION_TYPE_DROP action in the dpaa2 flow engine. A flow rule with a drop action is programmed into the flow steering (FS) table with the DPNI_FS_OPT_DISCARD option so that matching frames are discarded by hardware.
The drop action is added to the supported action list, accepted during action verification, configured in the FS action path, handled in the generic flow-set action loop, and cleaned up in the flow destroy path.
--- drivers/net/dpaa2/dpaa2_flow.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/dpaa2/dpaa2_flow.c +7 -1
@@ -97,7 +97,8 @@ enum rte_flow_action_type dpaa2_supported_action_type[] = {RTE_FLOW_ACTION_TYPE_QUEUE ,RTE_FLOW_ACTION_TYPE_PORT_ID ,RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT , - RTE_FLOW_ACTION_TYPE_RSS +RTE_FLOW_ACTION_TYPE_RSS , + RTE_FLOW_ACTION_TYPE_DROP };#ifndef __cplusplus
@@ -4421,6 +4422,7 @@ dpaa2_flow_verify_action(struct dpaa2_dev_priv *priv,break ;case RTE_FLOW_ACTION_TYPE_PF :/* Skip this action, have to add for vxlan */ +case RTE_FLOW_ACTION_TYPE_DROP :break ;case RTE_FLOW_ACTION_TYPE_END : end_of_list =1 ;
@@ -4468,6 +4470,8 @@ dpaa2_configure_flow_fs_action(struct dpaa2_dev_priv *priv, flow->fs_action_cfg.redirect_obj_token = dest_priv->token; flow->fs_action_cfg.flow_id = dest_q->flow_id; + }else if (flow->action_type ==RTE_FLOW_ACTION_TYPE_DROP ) { + flow->fs_action_cfg.options =DPNI_FS_OPT_DISCARD ; }return 0 ;
@@ -4945,6 +4949,7 @@ dpaa2_generic_flow_set(struct dpaa2_dev_flow *flow,case RTE_FLOW_ACTION_TYPE_QUEUE :case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT :case RTE_FLOW_ACTION_TYPE_PORT_ID : +case RTE_FLOW_ACTION_TYPE_DROP : ret =dpaa2_configure_flow_fs_action (priv, flow, &actions[j]);if (ret)
@@ -5346,6 +5351,7 @@ dpaa2_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *_flow,case RTE_FLOW_ACTION_TYPE_QUEUE :case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT :case RTE_FLOW_ACTION_TYPE_PORT_ID : +case RTE_FLOW_ACTION_TYPE_DROP :if (priv->num_rx_tc >1 ) {/* Remove entry from QoS table first */ ret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW,
Signature · 1 line
2.43.0
PATCH 6/11 net/dpaa2: set default flow miss action per device
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
The flow steering miss flow id was a file-scope global defaulting to 0 and optionally overridden via the DPAA2_FLOW_CONTROL_MISS_FLOW environment variable. Replace it with a per-device default_flow field in dpaa2_dev_priv, initialised to the lowest-priority flow ID (min(fs_entries, dist_queues) - 1) at probe time, so that each device has its own independent miss-flow setting.
The DPAA2_FLOW_CONTROL_MISS_FLOW environment variable is removed. Users who relied on it must use the rte_flow API instead.
--- doc/guides/rel_notes/release_26_11.rst | 4 ++++ drivers/net/dpaa2/dpaa2_ethdev.c | 2 ++ drivers/net/dpaa2/dpaa2_ethdev.h | 2 ++ drivers/net/dpaa2/dpaa2_flow.c | 14 +------------- 4 files changed, 9 insertions(+), 13 deletions(-)
doc/guides/rel_notes/release_26_11.rst +4 -0
@@ -105,6 +105,10 @@ New Features * Added the inner IP header to the RSS hash so tunneled traffic is distributed across the Rx queues. + * Removed ``DPAA2_FLOW_CONTROL_MISS_FLOW`` environment variable. The + per-device FS table miss flow id now defaults to the lowest-priority + flow of the device. Users who previously redirected unmatched frames + to a specific queue via this variable must use the rte_flow API instead. * **Updated NXP ENETC4 PMD.**
drivers/net/dpaa2/dpaa2_ethdev.c +2 -0
@@ -3539,6 +3539,8 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->dist_queues = attr.num_queues; priv->num_channels = attr.num_channels; priv->channel_inuse =0 ; + priv->default_flow =RTE_MAX (RTE_MIN (priv->fs_entries, + priv->dist_queues),1 ) -1 ;rte_spinlock_init (&priv->lpbk_qp_lock);/* only if the custom CG is enabled */
drivers/net/dpaa2/dpaa2_ethdev.h +2 -0
@@ -411,6 +411,8 @@ struct dpaa2_dev_priv {uint8_t en_loose_ordered;uint8_t max_cgs;uint8_t cgid_in_use[MAX_RX_QUEUES ]; +/* Lowest priority FS flow id to receive flow steering miss frames. */ +uint16_t default_flow;/* Current hash distribution size per RX TC, written by * dpaa2_setup_flow_dist_size() and read by reta_query / reta_update.
drivers/net/dpaa2/dpaa2_flow.c +1 -13
@@ -24,7 +24,6 @@#include <dpaa2_pmd_logs.h> static char *dpaa2_flow_control_log; -static uint16_t dpaa2_flow_miss_flow_id;/* Default miss flow id is 0. */ static int dpaa2_sp_loaded =-1 ;enum dpaa2_flow_entry_size {
@@ -4590,7 +4589,7 @@ dpaa2_configure_fs_rss_table(struct dpaa2_dev_priv *priv,return 0 ; tc_cfg.enable = true; - tc_cfg.fs_miss_flow_id = dpaa2_flow_miss_flow_id; + tc_cfg.fs_miss_flow_id = priv->default_flow; ret =dpni_set_rx_fs_dist (dpni,CMD_PRI_LOW , priv->token, &tc_cfg);if (ret <0 ) {
@@ -5224,17 +5223,6 @@ dpaa2_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, dpaa2_flow_control_log =getenv ("DPAA2_FLOW_CONTROL_LOG" ); -if (getenv ("DPAA2_FLOW_CONTROL_MISS_FLOW" )) { - dpaa2_flow_miss_flow_id = - (uint16_t )atoi (getenv ("DPAA2_FLOW_CONTROL_MISS_FLOW" )); -if (dpaa2_flow_miss_flow_id >= priv->dist_queues) { -DPAA2_PMD_ERR ("Missed flow ID %d >= dist size(%d)" , - dpaa2_flow_miss_flow_id, - priv->dist_queues); -return NULL ; - } - } - flow =rte_zmalloc (NULL ,sizeof (struct dpaa2_dev_flow ),RTE_CACHE_LINE_SIZE );if (!flow) {
Signature · 1 line
2.43.0
PATCH 7/11 net/dpaa2: identify Rx mbuf hash information by FLC
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
For default RSS distribution, the mbuf is marked with RTE_MBUF_F_RX_RSS_HASH and the hash value is taken from the high word of FLC.
Configure the flow steering action with FLC enabled to align the stashing setting with the RSS configuration. The TC ID and flow ID are packed into the FLC low word by the hardware. An Rx mbuf received from the FS table has the FS_MARK bit set in FLC low word; such mbufs are marked with RTE_MBUF_F_RX_FDIR and the TC and flow ID are stored via rte_mbuf_sched_set() for use by the scheduler.
--- drivers/net/dpaa2/dpaa2_ethdev.h | 12 +++++++++ drivers/net/dpaa2/dpaa2_flow.c | 42 ++++++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 20 +++++++++++++-- 3 files changed, 72 insertions(+), 2 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.h +12 -0
@@ -282,6 +282,18 @@ enum dpaa2_ecpri_fafe_type {/* ECPRI shares SP context with VXLAN*/ #define DPAA2_ECPRI_MSG_OFFSET DPAA2_VXLAN_VNI_OFFSET +#define DPAA2_FS_FLC_FS_MARK_OFFSET \ + (DPAA2_FLC_DATA_STASHING + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_OFFSET \ + (DPAA2_FS_FLC_FS_MARK_OFFSET + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_BIT_SIZE (sizeof(uint8_t) * 8) +#define DPAA2_FS_FLC_TC_MASK ((1 << DPAA2_FS_FLC_TC_BIT_SIZE) - 1) + +#define DPAA2_FS_FLC_FLOW_OFFSET \ + (DPAA2_FS_FLC_TC_OFFSET + DPAA2_FS_FLC_TC_BIT_SIZE) +#define DPAA2_ECPRI_MAX_EXTRACT_NB 8struct ipv4_sd_addr_extract_rule {
drivers/net/dpaa2/dpaa2_flow.c +42 -0
61 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_rxtx.c +18 -2
@@ -58,6 +58,7 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,uint16_t frc =DPAA2_GET_FD_FRC_PARSE_SUM (fd);struct dpaa2_annot_hdr *annotation = (struct dpaa2_annot_hdr *)hw_annot_addr; +uint32_t flc_lo, tc, flow;if (unlikely (dpaa2_print_parser_result))dpaa2_print_parse_result (annotation);
@@ -118,8 +119,23 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,default : m->packet_type =dpaa2_dev_rx_parse_slow (m, annotation); } - m->hash.rss = fd->simple.flc_hi; - m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; + flc_lo = fd->simple.flc_lo; +if (flc_lo & (1 <<DPAA2_FS_FLC_FS_MARK_OFFSET )) { + tc = (flc_lo >>DPAA2_FS_FLC_TC_OFFSET ) & +DPAA2_FS_FLC_TC_MASK ; + flow = flc_lo >>DPAA2_FS_FLC_FLOW_OFFSET ; + m->ol_flags |= +RTE_MBUF_F_RX_FDIR | +RTE_MBUF_F_RX_FDIR_ID ; + m->hash.fdir.hi = (tc <<16 ) | flow; +DPAA2_PMD_DP_DEBUG ("FS frame received from TC[%d]->flow%d" , + tc, flow); + }else { + m->hash.rss = fd->simple.flc_hi; + m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; +DPAA2_PMD_DP_DEBUG ("Hash frame received with RSS(%08x)" , + m->hash.rss); + }if (dpaa2_enable_ts[m->port]) { *dpaa2_timestamp_dynfield (m) = annotation->word2;
Signature · 1 line
2.43.0
PATCH 8/11 net/dpaa2: add minimum key size support
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
The default size for a QoS key is 24 bytes. If the key size is smaller than the maximum, use the default (minimum) key size instead of always returning the maximum size (56 bytes). This allows smaller flow tables to be used when the extracted key fits within the default size.
Support for 24-byte QoS key entries is available from DPNI version 8.7 onwards. For older DPNI versions, the existing 56-byte entry size is retained to maintain compatibility.
--- drivers/net/dpaa2/dpaa2_flow.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/net/dpaa2/dpaa2_flow.c +12 -9
@@ -26,8 +26,11 @@static char *dpaa2_flow_control_log;static int dpaa2_sp_loaded =-1 ; +/* Default size of a key */ +#define DPNI_DEFAULT_KEY_SIZE 24 +enum dpaa2_flow_entry_size { -DPAA2_FLOW_ENTRY_MIN_SIZE = (DPNI_MAX_KEY_SIZE /2 ), +DPAA2_FLOW_ENTRY_MIN_SIZE =DPNI_DEFAULT_KEY_SIZE ,DPAA2_FLOW_ENTRY_MAX_SIZE =DPNI_MAX_KEY_SIZE };
@@ -4519,7 +4522,7 @@ dpaa2_configure_flow_fs_action(struct dpaa2_dev_priv *priv, }static inline uint16_t -dpaa2_flow_entry_size (uint16_t key_max_size) +dpaa2_flow_entry_size (struct dpaa2_dev_priv *priv,uint16_t key_max_size) {if (key_max_size >DPAA2_FLOW_ENTRY_MAX_SIZE ) { DPAA2_PMD_ERR("Key size(%d) > max(%d)",
@@ -4529,11 +4532,11 @@ dpaa2_flow_entry_size(uint16_t key_max_size)return 0 ; } -if (key_max_size >DPAA2_FLOW_ENTRY_MIN_SIZE ) +if (key_max_size >DPAA2_FLOW_ENTRY_MIN_SIZE || +dpaa2_dev_cmp_dpni_ver (priv,8 ,7 ) <0 )return DPAA2_FLOW_ENTRY_MAX_SIZE ; -/* Current MC only support fixed entry size(56)*/ -return DPAA2_FLOW_ENTRY_MAX_SIZE ; +return DPAA2_FLOW_ENTRY_MIN_SIZE ; } static inline int
@@ -4595,7 +4598,7 @@ dpaa2_configure_fs_rss_table(struct dpaa2_dev_priv *priv, } key_max_size = tc_extract->key_profile.key_max_size; - entry_size =dpaa2_flow_entry_size (key_max_size); + entry_size =dpaa2_flow_entry_size (priv, key_max_size);dpaa2_flow_fs_extracts_log (priv, tc_id); ret = dpkg_prepare_key_cfg(&tc_extract->dpkg,
@@ -4686,7 +4689,7 @@ dpaa2_configure_qos_table(struct dpaa2_dev_priv *priv, } key_max_size = qos_extract->key_profile.key_max_size; - entry_size =dpaa2_flow_entry_size (key_max_size); + entry_size =dpaa2_flow_entry_size (priv, key_max_size);dpaa2_flow_qos_extracts_log (priv);
@@ -4977,11 +4980,11 @@ dpaa2_generic_flow_set(struct dpaa2_dev_flow *flow, qos_key_extract = &priv->extract.qos_key_extract; key_size = qos_key_extract->key_profile.key_max_size; - flow->qos_rule.key_size =dpaa2_flow_entry_size (key_size); + flow->qos_rule.key_size =dpaa2_flow_entry_size (priv, key_size); tc_key_extract = &priv->extract.tc_key_extract[flow->tc_id]; key_size = tc_key_extract->key_profile.key_max_size; - flow->fs_rule.key_size =dpaa2_flow_entry_size (key_size); + flow->fs_rule.key_size =dpaa2_flow_entry_size (priv, key_size);/* Let's parse action on matching traffic */ end_of_list =0 ;
Signature · 1 line
2.43.0
PATCH 9/11 net/dpaa2: parse tunnel and fragmented packet types
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
Extend dpaa2_dev_rx_parse_new() (LX2160A FRC fast path) to identify IPv4/IPv6 fragmented packets, IPsec ESP, and GTP-U/GTP-C packets.
Map the corresponding parser summary values to DPDK packet types. GTP-U and GTP-C packets are additionally marked with RTE_PTYPE_L4_UDP to reflect the UDP transport used by the outer tunnel header.
Advertise the newly supported packet types through dpaa2_supported_ptypes_get().
--- drivers/net/dpaa2/dpaa2_ethdev.c | 4 ++++ drivers/net/dpaa2/dpaa2_ethdev.h | 16 ++++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 36 ++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+)
drivers/net/dpaa2/dpaa2_ethdev.c +4 -0
@@ -1371,6 +1371,10 @@ dpaa2_supported_ptypes_get(struct rte_eth_dev *dev, size_t *no_of_elements)RTE_PTYPE_L4_UDP ,RTE_PTYPE_L4_SCTP ,RTE_PTYPE_L4_ICMP , +RTE_PTYPE_L4_FRAG , +RTE_PTYPE_TUNNEL_ESP , +RTE_PTYPE_TUNNEL_GTPU , + RTE_PTYPE_TUNNEL_GTPC, }; if (dev->rx_pkt_burst == dpaa2_dev_prefetch_rx ||
drivers/net/dpaa2/dpaa2_ethdev.h +16 -0
@@ -131,6 +131,10 @@ (0x0001 | DPAA2_PKT_TYPE_IPV4)#define DPAA2_PKT_TYPE_IPV6_EXT \ (0x0001 | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_FRAG \ + (0x0002 | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_FRAG \ + (0x0002 | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_IPV4_TCP \ (0x000e | DPAA2_PKT_TYPE_IPV4)#define DPAA2_PKT_TYPE_IPV6_TCP \
@@ -147,6 +151,18 @@ (0x0003 | DPAA2_PKT_TYPE_IPV4_EXT)#define DPAA2_PKT_TYPE_IPV6_ICMP \ (0x0003 | DPAA2_PKT_TYPE_IPV6_EXT) +#define DPAA2_PKT_TYPE_IPV4_ESP \ + (0x0005 | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_ESP \ + (0x0005 | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPU \ + (0x0014 | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPU \ + (0x0014 | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPC \ + (0x0015 | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPC \ + (0x0015 | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_VLAN_1 0x0160#define DPAA2_PKT_TYPE_VLAN_2 0x0260
drivers/net/dpaa2/dpaa2_rxtx.c +36 -0
@@ -116,6 +116,42 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd, m->packet_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_ICMP ;break ; +case DPAA2_PKT_TYPE_IPV4_FRAG : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_FRAG ; +break ; +case DPAA2_PKT_TYPE_IPV6_FRAG : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_FRAG ; +break ; +case DPAA2_PKT_TYPE_IPV4_ESP : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_TUNNEL_ESP ; +break ; +case DPAA2_PKT_TYPE_IPV6_ESP : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_TUNNEL_ESP ; +break ; +case DPAA2_PKT_TYPE_IPV4_GTPU : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPU ; +break ; +case DPAA2_PKT_TYPE_IPV6_GTPU : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPU ; +break ; +case DPAA2_PKT_TYPE_IPV4_GTPC : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPC ; +break ; +case DPAA2_PKT_TYPE_IPV6_GTPC : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPC ; +break ;default : m->packet_type =dpaa2_dev_rx_parse_slow (m, annotation); }
Signature · 1 line
2.43.0
Re: [PATCH v10-S2 09/11] net/dpaa2: parse tunnel and fragmented packet types
Quoted 11 lines · On Wed, 14 Oct 2026 11:13:58 +0530 Prashant Gupta <[email protected]>…
From: Hemant Agrawal <[email protected]>
Extend
dpaa2_dev_rx_parse_new()(LX2160A FRC fast path) to identify IPv4/IPv6 fragmented packets, IPsec ESP, and GTP-U/GTP-C packets.Map the corresponding parser summary values to DPDK packet types. GTP-U and GTP-C packets are additionally marked with
RTE_PTYPE_L4_UDPto reflect the UDP transport used by the outer tunnel header.
Quoted 4 lines
Advertise the newly supported packet types through
dpaa2_supported_ptypes_get().Signed-off-by Hemant Agrawal <[email protected]>
AI saw this is it an issue?
[PATCH 09/11] net/dpaa2: parse tunnel and fragmented packet types
Warning: the fragment value changed. v9 built it from DPAA2_PSR_SUMMARY_IP_FRAG, which is 1. v10 open-codes it as 2:
#define DPAA2_PKT_TYPE_IPV4_FRAG \ (0x0002 | DPAA2_PKT_TYPE_IPV4)
Code 1 is already DPAA2_PKT_TYPE_IPV4_EXT, so this looks like it was picked to avoid a duplicate case label rather than taken from the parser spec. If the hardware reports fragments as 1, the new FRAG cases never match and fragments keep coming up as RTE_PTYPE_L3_IPV4_EXT. Please confirm the summary code. If it is 1, drop the FRAG defines and report L4_FRAG from the existing EXT case:
case DPAA2_PKT_TYPE_IPV4_EXT: m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_FRAG; break;
Info: ESP and GTP values are now bare numbers (0x0005, 0x0014, 0x0015). Name them, as v9 did, so the next reader can check them against the parser summary table.
PATCH 10/11 net/dpaa2: remove unused soft parser driver
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
The DPAA2 soft parser (SP) byte code has to be installed by the boot firmware before Linux starts; the WRIOP parser cannot be reprogrammed once the MC is up. Loading an SP image at run time from the PMD therefore never took effect, so the loader and its DPNI_SS_INGRESS plumbing were dead code and are removed.
The rte_flow VXLAN and eCPRI pattern items were only ever accepted while an SP image was believed to be loaded. With the SP gone they are rejected by dpaa2_dev_verify_patterns() before the configure switch is reached, so their handlers dpaa2_configure_flow_vxlan() and dpaa2_configure_flow_ecpri(), the switch cases that call them, the mask descriptors and the VXLAN_HF_VNI helper are removed as well. Both items are also dropped from the dpaa2 feature matrix so that the documented capabilities match the code.
--- doc/guides/nics/features/dpaa2.ini | 2 - doc/guides/rel_notes/release_26_11.rst | 9 + drivers/net/dpaa2/dpaa2_ethdev.c | 28 -- drivers/net/dpaa2/dpaa2_flow.c | 564 +------------------------ drivers/net/dpaa2/dpaa2_recycle.c | 1 - drivers/net/dpaa2/dpaa2_sparser.c | 137 ------ drivers/net/dpaa2/dpaa2_sparser.h | 202 --------- drivers/net/dpaa2/meson.build | 1 - 8 files changed, 10 insertions(+), 934 deletions(-) delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.c delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.h
doc/guides/nics/features/dpaa2.ini +0 -2
@@ -35,7 +35,6 @@ Usage doc = Y [rte_flow items] ah = Y -ecpri = Y esp = Y eth = P gre = Y
@@ -50,7 +49,6 @@ sctp = Y tcp = Y udp = Y vlan = P -vxlan = Y [rte_flow actions] drop = Y
doc/guides/rel_notes/release_26_11.rst +9 -0
@@ -163,6 +163,15 @@ Removed Items Also, make sure to start the actual text at the margin. ======================================================= +* **Removed soft parser support from the dpaa2 net driver.** + + The DPAA2 soft parser (SP) blob has to be loaded by the boot firmware + before Linux starts, so loading it at run time from the PMD never took + effect. The unused SP loader has been removed, together with the rte_flow + VXLAN and eCPRI pattern items that were only accepted while an SP image + was believed to be loaded. Those two items are no longer advertised in + the dpaa2 feature matrix. + * Removed deprecated symbols: * eal: ``__rte_packed``
drivers/net/dpaa2/dpaa2_ethdev.c +0 -28
@@ -29,7 +29,6 @@#include <mc/fsl_dpmng.h> #include <mc/fsl_dpcon.h> #include "dpaa2_ethdev.h" -#include "dpaa2_sparser.h" #include <fsl_qbman_debug.h> #define DRIVER_LOOPBACK_MODE "drv_loopback"
@@ -3718,33 +3717,6 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) } eth_dev->data->mtu =RTE_ETHER_MTU ; -/*TODO To enable soft parser support DPAA2 driver needs to integrate -* with external entity to receive byte code for software sequence -* and same will be offload to the H/W using MC interface. -* Currently it is assumed that DPAA2 driver has byte code by some -* mean and same if offloaded to H/W. -*/ -if (getenv ("DPAA2_ENABLE_SOFT_PARSER" )) { -WRIOP_SS_INITIALIZER (priv); - ret =dpaa2_eth_load_wriop_soft_parser (priv,DPNI_SS_INGRESS ); -if (ret <0 ) { -DPAA2_PMD_ERR (" Error(%d) in loading softparser" , - ret); - goto init_err; - } - - ret =dpaa2_eth_enable_wriop_soft_parser (priv, -DPNI_SS_INGRESS ); -if (ret <0 ) { -DPAA2_PMD_ERR (" Error(%d) in enabling softparser" , - ret); - goto init_err; - } - } - - ret =dpaa2_soft_parser_loaded (); -if (ret >0 ) -DPAA2_PMD_INFO ("soft parser is loaded" );DPAA2_PMD_INFO ("%s: netdev created, connected to %s" , eth_dev->data->name, dpaa2_dev->ep_name);
drivers/net/dpaa2/dpaa2_flow.c +1 -563
629 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_recycle.c +0 -1
@@ -23,7 +23,6 @@#include <dpaa2_hw_dpio.h> #include <mc/fsl_dpmng.h> #include "dpaa2_ethdev.h" -#include "dpaa2_sparser.h" #include <fsl_qbman_debug.h> #include <rte_io.h>
drivers/net/dpaa2/dpaa2_sparser.c deleted +0 -137
137 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_sparser.h deleted +0 -202
202 lines not on this page · raw message
drivers/net/dpaa2/meson.build +0 -1
@@ -16,7 +16,6 @@ sources = files( 'dpaa2_flow.c', 'dpaa2_recycle.c', 'dpaa2_rxtx.c', - 'dpaa2_sparser.c', 'dpaa2_ptp.c', 'mc/dprtc.c', 'mc/dpkg.c',
Signature · 1 line
2.43.0
PATCH 11/11 net/dpaa2: rename Rx queue flags
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
Rename the Rx-side device flags to a consistent DPAA2_RX_*_FLAG naming:DPAAX_RX_ERROR_QUEUE_FLAG becomes DPAA2_RX_ERROR_QUEUE_FLAG and DPAA2_DATA_STASHING_OFF becomes DPAA2_RX_DATA_STASHING_OFF_FLAG.
This is a mechanical rename with no functional change.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 10 +++++----- drivers/net/dpaa2/dpaa2_ethdev.h | 6 ++++-- drivers/net/dpaa2/dpaa2_rxtx.c | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +5 -5
@@ -550,7 +550,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) goto fail; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { priv->rx_err_vq =rte_zmalloc ("dpni_rx_err" ,sizeof (struct dpaa2_queue ),0 );if (!priv->rx_err_vq) {
@@ -1041,7 +1041,7 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, options |=DPNI_QUEUE_OPT_FLC ; cfg.flc.stash_control = true;dpaa2_flc_stashing_clear_all (&cfg.flc.value); -if (priv->flags &DPAA2_DATA_STASHING_OFF ) { +if (priv->flags &DPAA2_RX_DATA_STASHING_OFF_FLAG ) {dpaa2_flc_stashing_set (DPAA2_FLC_DATA_STASHING ,0 , &cfg.flc.value); dpaa2_q->data_stashing_off =1 ;
@@ -1521,7 +1521,7 @@ dpaa2_dev_start(struct rte_eth_dev *dev) dpaa2_q->fqid = qid.fqid; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { ret =dpni_get_queue (dpni,CMD_PRI_LOW , priv->token,DPNI_QUEUE_RX_ERR ,0 ,0 , &cfg, &qid);if (ret) {
@@ -3475,7 +3475,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)if (dpaa2_get_devargs (dev->devargs,DRIVER_NO_DATA_STASHING ) ||getenv ("DPAA2_DATA_STASHING_OFF" )) { - priv->flags |=DPAA2_DATA_STASHING_OFF ; + priv->flags |=DPAA2_RX_DATA_STASHING_OFF_FLAG ;DPAA2_PMD_INFO ("Data stashing disabled" ); }
@@ -3581,7 +3581,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) }if (dpaa2_get_devargs (dev->devargs,DRIVER_ERROR_QUEUE )) { - priv->flags |=DPAAX_RX_ERROR_QUEUE_FLAG ; + priv->flags |=DPAA2_RX_ERROR_QUEUE_FLAG ;DPAA2_PMD_INFO ("Enable error queue" ); }
drivers/net/dpaa2/dpaa2_ethdev.h +4 -2
@@ -98,9 +98,11 @@#define DPAA2_TX_DYNAMIC_CONF_ENABLE RTE_BIT32(9)/* Disable data stashing (prefetch of packet data into CPU cache) */ -#define DPAA2_DATA_STASHING_OFF RTE_BIT32(10) +#define DPAA2_RX_DATA_STASHING_OFF_FLAG RTE_BIT32(10) -#define DPAAX_RX_ERROR_QUEUE_FLAG RTE_BIT32(11) +#define DPAA2_RX_ERROR_QUEUE_FLAG RTE_BIT32(11) + +#define DPAA2_RX_PRINT_PSR_RESULT_FLAG RTE_BIT32(12)/* DPDMUX index for DPMAC */ #define DPAA2_DPDMUX_DPMAC_IDX 0
drivers/net/dpaa2/dpaa2_rxtx.c +2 -2
@@ -839,7 +839,7 @@ dpaa2_dev_prefetch_rx_common(void *queue, struct rte_mbuf **bufs,if (!by_channel) {struct dpaa2_dev_priv *priv = eth_data->dev_private; -if (unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq); }
@@ -1104,7 +1104,7 @@ dpaa2_dev_rx_common(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;struct dpaa2_dev_priv *priv = eth_data->dev_private; -if (!by_channel &&unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (!by_channel &&unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq);if (by_channel) {
Signature · 1 line
2.43.0
cover net/dpaa2 updates
In reply to Prashant GuptaChanges in v11:
- Fix fragmented packet type handling to match hardware parser summary reporting.
- Address review comments.
Series overview:
- fix an integer overflow in the CCSR region mapping,
- set Tx confirmation on device init and support a larger burst size,
- support MPLS and PPPoE flow distribution,
- support the flow drop action and a per-device default flow miss action,
- identify Rx mbuf hash information by FLC and add minimum key size support,
- parse tunnel and fragmented packet types,
- remove the unused soft parser driver and rename Rx queue flags.
Gagandeep Singh (6):
net/dpaa2: set Tx confirmation on device init net/dpaa2: support larger burst size net/dpaa2: support MPLS and PPPoE flow distribution net/dpaa2: support flow drop action net/dpaa2: set default flow miss action per device net/dpaa2: identify Rx mbuf hash information by FLC
Hemant Agrawal (3):
net/dpaa2: fix integer overflow in CCSR region mapping net/dpaa2: add minimum key size support net/dpaa2: parse tunnel and fragmented packet types
Jun Yang (2):
net/dpaa2: remove unused soft parser driver
net/dpaa2: rename Rx queue flags
doc/guides/nics/features/dpaa2.ini | 4 +- doc/guides/rel_notes/release_26_11.rst | 13 + drivers/net/dpaa2/dpaa2_ethdev.c | 84 +--- drivers/net/dpaa2/dpaa2_ethdev.h | 32 +- drivers/net/dpaa2/dpaa2_flow.c | 633 ++++++------------------- drivers/net/dpaa2/dpaa2_recycle.c | 24 +- drivers/net/dpaa2/dpaa2_rxtx.c | 56 ++- drivers/net/dpaa2/dpaa2_sparser.c | 137 ------ drivers/net/dpaa2/dpaa2_sparser.h | 202 -------- drivers/net/dpaa2/dpaa2_tm.c | 16 +- drivers/net/dpaa2/mc/dpni.c | 11 +- drivers/net/dpaa2/mc/fsl_dpni.h | 8 +- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 +- drivers/net/dpaa2/meson.build | 1 - 14 files changed, 317 insertions(+), 907 deletions(-) delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.c delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.h
Signature · 1 line
2.43.0
PATCH 1/11 net/dpaa2: fix integer overflow in CCSR region mapping
From: Hemant Agrawal <[email protected]>
In lsx_ccsr_map_region, PAGE_SIZE is a macro defined as sysconf(_SC_PAGESIZE), which returns a signed long and may be negative on error. The value was used directly in size_t comparisons and passed to mmap, causing an integer overflow (Coverity CID 49765682).
The old round-down "len & PAGE_MASK" ignored the in-page offset: for a 4096-byte or 6656-byte len on a 64K-page kernel the masked result is 0, causing the mapping to fail, where the old code would have bumped len up to PAGE_SIZE. The correct mapping size must cover the region from the page-aligned start through offset + len.
Fix by calling sysconf(_SC_PAGESIZE) explicitly into a signed long, checking for a non-positive return before use, computing page_mask from the verified value, and using RTE_ALIGN_CEIL(offset + len, page_size) for map_len so that the mmap covers the full requested region regardless of page size. The page-aligned start address and the back-pointer offset are both derived from the same page_mask, keeping the three values consistent.
Coverity issue: 49765682
--- drivers/net/dpaa2/dpaa2_recycle.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/net/dpaa2/dpaa2_recycle.c +15 -8
@@ -176,6 +176,9 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)void *tmp;uint64_t start;uint64_t offset; +uint64_t page_mask; +long page_size; +size_t map_len; fd =open ("/dev/mem" ,O_RDWR );if (fd <0 ) {
@@ -183,20 +186,24 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)return NULL ; } - start = addr &PAGE_MASK ; + page_size =sysconf (_SC_PAGESIZE); +if (page_size <=0 ) { +close (fd); +return NULL ; + } + page_mask = ~((uint64_t )page_size -1 ); + start = addr & page_mask; offset = addr - start; - len = len &PAGE_MASK ; -if (len < (size_t )PAGE_SIZE ) - len =PAGE_SIZE ; + map_len =RTE_ALIGN_CEIL (offset + len, (size_t )page_size); - tmp =mmap (NULL , len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start); + tmp =mmap (NULL , map_len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start);close (fd); -if (tmp !=MAP_FAILED ) -return (uint8_t *)tmp + offset; -else +if (tmp ==MAP_FAILED )return NULL ; + +return (uint8_t *)tmp + offset; }static const uint8_t ls_sd1_prot_idx_map[] = {
Signature · 1 line
2.43.0
PATCH 2/11 net/dpaa2: set Tx confirmation on device init
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Move TX confirmation mode setting from TXQ setup to device initialization because TXQ0 is not always set up by the user.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 40 ++++++++++++-------------------- 1 file changed, 15 insertions(+), 25 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +15 -25
@@ -1153,7 +1153,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,struct dpni_queue tx_conf_cfg;struct dpni_queue tx_flow_cfg;uint8_t options =0 , flow_id; -uint8_t ceetm_ch_idx;uint16_t channel_id;struct dpni_queue_id qid;uint32_t tc_id;
@@ -1174,30 +1173,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,memset (&tx_conf_cfg,0 ,sizeof (struct dpni_queue ));memset (&tx_flow_cfg,0 ,sizeof (struct dpni_queue )); -if (!tx_queue_id) { -for (ceetm_ch_idx =0 ; - ceetm_ch_idx <= (priv->num_channels -1 ); - ceetm_ch_idx++) { -/*Set tx-conf and error configuration*/ -if (priv->flags &DPAA2_TX_CONF_ENABLE ) { - ret =dpni_set_tx_confirmation_mode (dpni, -CMD_PRI_LOW , priv->token, - ceetm_ch_idx, -DPNI_CONF_AFFINE ); - }else { - ret =dpni_set_tx_confirmation_mode (dpni, -CMD_PRI_LOW , priv->token, - ceetm_ch_idx, -DPNI_CONF_DISABLE ); - } -if (ret) { -DPAA2_PMD_ERR ("Error(%d) in tx conf setting" , - ret); -return ret; - } - } - } - tc_id = tx_queue_id % priv->num_tx_tc; channel_id = (uint8_t )(tx_queue_id / priv->num_tx_tc) % priv->num_channels; flow_id =0 ;
@@ -3621,6 +3596,21 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) goto init_err; } +for (i =0 ; i < priv->num_channels; i++) { +/*Set tx-conf and error configuration*/ +if (priv->flags &DPAA2_TX_CONF_ENABLE ) { + ret =dpni_set_tx_confirmation_mode (dpni_dev, +CMD_PRI_LOW , priv->token, i,DPNI_CONF_AFFINE ); + }else { + ret =dpni_set_tx_confirmation_mode (dpni_dev, +CMD_PRI_LOW , priv->token, i,DPNI_CONF_DISABLE ); + } +if (ret) { +DPAA2_PMD_ERR ("Error(%d) in tx conf setting" , ret); + goto init_err; + } + } +/* Allocate memory for storing MAC addresses. * Table of mac_filter_entries size is allocated so that RTE ether lib * can add MAC entries when rte_eth_dev_mac_addr_add is called.
Signature · 1 line
2.43.0
PATCH 3/11 net/dpaa2: support larger burst size
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Make burst size checks and MC command fields SoC-aware, enabling bursts larger than 64K on LX2160A with dpni version 8.7+.
The max_burst_size field in dpni_tx_shaping_cfg is widened to uint32_t and the MC command struct is updated to split the value across two 16-bit fields using the new DPNI_BURST_LO/HI macros.
--- drivers/net/dpaa2/dpaa2_tm.c | 16 +++++++++++----- drivers/net/dpaa2/mc/dpni.c | 11 +++++++++-- drivers/net/dpaa2/mc/fsl_dpni.h | 8 ++++++-- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 ++- 4 files changed, 28 insertions(+), 10 deletions(-)
drivers/net/dpaa2/dpaa2_tm.c +11 -5
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright 2020-2024 NXP +* Copyright 2020-2026 NXP */ #include <rte_ethdev.h>
@@ -10,14 +10,20 @@#include "dpaa2_pmd_logs.h" #include <dpaa2_hw_dpio.h> -#define DPAA2_BURST_MAX (64 * 1024) -#define DPAA2_SHAPER_MIN_RATE 0#define DPAA2_SHAPER_MAX_RATE 107374182400ull#define DPAA2_WEIGHT_MAX 24701#define DPAA2_PKT_ADJUST_LEN_MIN 0#define DPAA2_PKT_ADJUST_LEN_MAX 0x7ff +static inline uint32_t dpaa2_get_burst_max (struct dpaa2_dev_priv *priv) +{ +if (dpaa2_dev_cmp_dpni_ver (priv,8 ,7 ) >=0 ) +return (dpaa2_svr_family ==SVR_LX2160A ) ?229375 :0xF7FF ; + +return 0xF7FF ; +} +int dpaa2_tm_init (struct rte_eth_dev *dev) {
@@ -283,7 +289,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE , NULL, "committed rate is out of range\n"); -if (params->committed.size >DPAA2_BURST_MAX ) +if (params->committed.size >dpaa2_get_burst_max (priv))return -rte_tm_error_set (error,EINVAL ,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE ,NULL ,"committed size is out of range\n" );
@@ -293,7 +299,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE , NULL, "Peak rate is out of range\n"); -if (params->peak.size >DPAA2_BURST_MAX ) +if (params->peak.size >dpaa2_get_burst_max (priv))return -rte_tm_error_set (error,EINVAL ,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE ,NULL ,"Peak size is out of range\n" );
drivers/net/dpaa2/mc/dpni.c +9 -2
@@ -1106,6 +1106,7 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io, {struct dpni_cmd_set_tx_shaping *cmd_params;struct mc_command cmd = {0 }; +uint32_t tx_cr_burst, tx_er_burst;int coupled, lni_shaper;uint8_t channel_id;uint16_t oal;
@@ -1115,10 +1116,16 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io, cmd_flags, token); cmd_params = (struct dpni_cmd_set_tx_shaping *)cmd.params; + tx_cr_burst = tx_cr_shaper->max_burst_size; + tx_er_burst = tx_er_shaper->max_burst_size; cmd_params->tx_cr_max_burst_size = -cpu_to_le16 (tx_cr_shaper->max_burst_size); +cpu_to_le16 (DPNI_BURST_LO (tx_cr_burst)); cmd_params->tx_er_max_burst_size = -cpu_to_le16 (tx_er_shaper->max_burst_size); +cpu_to_le16 (DPNI_BURST_LO (tx_er_burst)); + cmd_params->tx_cr_max_burst_size_hi = +cpu_to_le16 (DPNI_BURST_HI (tx_cr_burst)); + cmd_params->tx_er_max_burst_size_hi = +cpu_to_le16 (DPNI_BURST_HI (tx_er_burst)); cmd_params->tx_cr_rate_limit =cpu_to_le32 (tx_cr_shaper->rate_limit); cmd_params->tx_er_rate_limit =
drivers/net/dpaa2/mc/fsl_dpni.h +6 -2
@@ -830,14 +830,18 @@ int dpni_get_link_state(struct fsl_mc_io *mc_io,uint16_t token, struct dpni_link_state *state); +#define DPNI_BURST_LO (burst) ((burst) & GENMASK(15, 0)) +#define DPNI_BURST_HI (burst) ((burst) >> 16) +/** * struct dpni_tx_shaping - Structure representing DPNI tx shaping configuration * @rate_limit: Rate in Mbits/s -* @max_burst_size: Burst size in bytes (up to 64KB) +* @max_burst_size: Burst size in bytes. Limits depend on the SoC (0x37FFF +* for LX2160A, 0xF7FF for all others) */ struct dpni_tx_shaping_cfg {uint32_t rate_limit; -uint16_t max_burst_size; +uint32_t max_burst_size; };/**
drivers/net/dpaa2/mc/fsl_dpni_cmd.h +2 -1
@@ -394,7 +394,8 @@ struct dpni_rsp_get_link_state {struct dpni_cmd_set_tx_shaping {uint16_t tx_cr_max_burst_size;uint16_t tx_er_max_burst_size; -uint32_t pad; +uint16_t tx_cr_max_burst_size_hi; +uint16_t tx_er_max_burst_size_hi;uint32_t tx_cr_rate_limit;uint32_t tx_er_rate_limit;/* from LSB: coupled:1, lni_shaper: 1*/
Signature · 1 line
2.43.0
PATCH 4/11 net/dpaa2: support MPLS and PPPoE flow distribution
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add rte_flow pattern support for MPLS and PPPoE items in the dpaa2 PMD flow engine.
For a pattern with no spec/mask, the frame is identified by its Frame Attribute Flag (FAF_MPLS_FRAM / FAF_PPPOE_PPP_FRAM) for both the QoS and flow steering tables. When a spec is present, the MPLS label (NH_FLD_MPLS_MPLSL_1) or the PPPoE session id (NH_FLD_PPPOE_SID) is added as a header extract rule for both tables.
NH_FLD_MPLS_MPLSL_1 with DPKG_FULL_FIELD causes MC to extract the full 4-byte MPLS LSE (label + TC + S + TTL). The original code passed sizeof(label_tc_s) = 3, so the driver key profile recorded the field as 3 bytes while MC placed 4 bytes in the key; any extract field added after MPLS was off by one byte, corrupting the key layout.
Fix by passing the full struct rte_flow_item_mpls pointer (spec/mask) with sizeof(*mask) = 4, so the key profile width matches the 4-byte field that MC extracts. The TTL byte has mask 0x00 in the default mask and is ignored for matching purposes.
--- doc/guides/nics/features/dpaa2.ini | 2 + drivers/net/dpaa2/dpaa2_flow.c | 196 +++++++++++++++++++++++++++++ 2 files changed, 198 insertions(+)
doc/guides/nics/features/dpaa2.ini +2 -0
@@ -43,6 +43,8 @@ gtp = Y icmp = Y ipv4 = Y ipv6 = Y +mpls = Y +pppoes = Y raw = Y sctp = Y tcp = Y
drivers/net/dpaa2/dpaa2_flow.c +196 -0
228 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 5/11 net/dpaa2: support flow drop action
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add support for the RTE_FLOW_ACTION_TYPE_DROP action in the dpaa2 flow engine. A flow rule with a drop action is programmed into the flow steering (FS) table with the DPNI_FS_OPT_DISCARD option so that matching frames are discarded by hardware.
The drop action is added to the supported action list, accepted during action verification, configured in the FS action path, handled in the generic flow-set action loop, and cleaned up in the flow destroy path.
--- drivers/net/dpaa2/dpaa2_flow.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/dpaa2/dpaa2_flow.c +7 -1
@@ -97,7 +97,8 @@ enum rte_flow_action_type dpaa2_supported_action_type[] = {RTE_FLOW_ACTION_TYPE_QUEUE ,RTE_FLOW_ACTION_TYPE_PORT_ID ,RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT , - RTE_FLOW_ACTION_TYPE_RSS +RTE_FLOW_ACTION_TYPE_RSS , + RTE_FLOW_ACTION_TYPE_DROP };#ifndef __cplusplus
@@ -4421,6 +4422,7 @@ dpaa2_flow_verify_action(struct dpaa2_dev_priv *priv,break ;case RTE_FLOW_ACTION_TYPE_PF :/* Skip this action, have to add for vxlan */ +case RTE_FLOW_ACTION_TYPE_DROP :break ;case RTE_FLOW_ACTION_TYPE_END : end_of_list =1 ;
@@ -4468,6 +4470,8 @@ dpaa2_configure_flow_fs_action(struct dpaa2_dev_priv *priv, flow->fs_action_cfg.redirect_obj_token = dest_priv->token; flow->fs_action_cfg.flow_id = dest_q->flow_id; + }else if (flow->action_type ==RTE_FLOW_ACTION_TYPE_DROP ) { + flow->fs_action_cfg.options =DPNI_FS_OPT_DISCARD ; }return 0 ;
@@ -4945,6 +4949,7 @@ dpaa2_generic_flow_set(struct dpaa2_dev_flow *flow,case RTE_FLOW_ACTION_TYPE_QUEUE :case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT :case RTE_FLOW_ACTION_TYPE_PORT_ID : +case RTE_FLOW_ACTION_TYPE_DROP : ret =dpaa2_configure_flow_fs_action (priv, flow, &actions[j]);if (ret)
@@ -5346,6 +5351,7 @@ dpaa2_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *_flow,case RTE_FLOW_ACTION_TYPE_QUEUE :case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT :case RTE_FLOW_ACTION_TYPE_PORT_ID : +case RTE_FLOW_ACTION_TYPE_DROP :if (priv->num_rx_tc >1 ) {/* Remove entry from QoS table first */ ret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW,
Signature · 1 line
2.43.0
PATCH 6/11 net/dpaa2: set default flow miss action per device
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
The flow steering miss flow id was a file-scope global defaulting to 0 and optionally overridden via the DPAA2_FLOW_CONTROL_MISS_FLOW environment variable. Replace it with a per-device default_flow field in dpaa2_dev_priv, initialised to the lowest-priority flow ID (min(fs_entries, dist_queues) - 1) at probe time, so that each device has its own independent miss-flow setting.
The DPAA2_FLOW_CONTROL_MISS_FLOW environment variable is removed. Users who relied on it must use the rte_flow API instead.
--- doc/guides/rel_notes/release_26_11.rst | 4 ++++ drivers/net/dpaa2/dpaa2_ethdev.c | 2 ++ drivers/net/dpaa2/dpaa2_ethdev.h | 2 ++ drivers/net/dpaa2/dpaa2_flow.c | 14 +------------- 4 files changed, 9 insertions(+), 13 deletions(-)
doc/guides/rel_notes/release_26_11.rst +4 -0
@@ -105,6 +105,10 @@ New Features * Added the inner IP header to the RSS hash so tunneled traffic is distributed across the Rx queues. + * Removed ``DPAA2_FLOW_CONTROL_MISS_FLOW`` environment variable. The + per-device FS table miss flow id now defaults to the lowest-priority + flow of the device. Users who previously redirected unmatched frames + to a specific queue via this variable must use the rte_flow API instead. * **Updated NXP ENETC4 PMD.**
drivers/net/dpaa2/dpaa2_ethdev.c +2 -0
@@ -3539,6 +3539,8 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->dist_queues = attr.num_queues; priv->num_channels = attr.num_channels; priv->channel_inuse =0 ; + priv->default_flow =RTE_MAX (RTE_MIN (priv->fs_entries, + priv->dist_queues),1 ) -1 ;rte_spinlock_init (&priv->lpbk_qp_lock);/* only if the custom CG is enabled */
drivers/net/dpaa2/dpaa2_ethdev.h +2 -0
@@ -411,6 +411,8 @@ struct dpaa2_dev_priv {uint8_t en_loose_ordered;uint8_t max_cgs;uint8_t cgid_in_use[MAX_RX_QUEUES ]; +/* Lowest priority FS flow id to receive flow steering miss frames. */ +uint16_t default_flow;/* Current hash distribution size per RX TC, written by * dpaa2_setup_flow_dist_size() and read by reta_query / reta_update.
drivers/net/dpaa2/dpaa2_flow.c +1 -13
@@ -24,7 +24,6 @@#include <dpaa2_pmd_logs.h> static char *dpaa2_flow_control_log; -static uint16_t dpaa2_flow_miss_flow_id;/* Default miss flow id is 0. */ static int dpaa2_sp_loaded =-1 ;enum dpaa2_flow_entry_size {
@@ -4590,7 +4589,7 @@ dpaa2_configure_fs_rss_table(struct dpaa2_dev_priv *priv,return 0 ; tc_cfg.enable = true; - tc_cfg.fs_miss_flow_id = dpaa2_flow_miss_flow_id; + tc_cfg.fs_miss_flow_id = priv->default_flow; ret =dpni_set_rx_fs_dist (dpni,CMD_PRI_LOW , priv->token, &tc_cfg);if (ret <0 ) {
@@ -5224,17 +5223,6 @@ dpaa2_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, dpaa2_flow_control_log =getenv ("DPAA2_FLOW_CONTROL_LOG" ); -if (getenv ("DPAA2_FLOW_CONTROL_MISS_FLOW" )) { - dpaa2_flow_miss_flow_id = - (uint16_t )atoi (getenv ("DPAA2_FLOW_CONTROL_MISS_FLOW" )); -if (dpaa2_flow_miss_flow_id >= priv->dist_queues) { -DPAA2_PMD_ERR ("Missed flow ID %d >= dist size(%d)" , - dpaa2_flow_miss_flow_id, - priv->dist_queues); -return NULL ; - } - } - flow =rte_zmalloc (NULL ,sizeof (struct dpaa2_dev_flow ),RTE_CACHE_LINE_SIZE );if (!flow) {
Signature · 1 line
2.43.0
PATCH 7/11 net/dpaa2: identify Rx mbuf hash information by FLC
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
For default RSS distribution, the mbuf is marked with RTE_MBUF_F_RX_RSS_HASH and the hash value is taken from the high word of FLC.
Configure the flow steering action with FLC enabled to align the stashing setting with the RSS configuration. The TC ID and flow ID are packed into the FLC low word by the hardware. An Rx mbuf received from the FS table has the FS_MARK bit set in FLC low word; such mbufs are marked with RTE_MBUF_F_RX_FDIR and the TC and flow ID are stored via rte_mbuf_sched_set() for use by the scheduler.
--- drivers/net/dpaa2/dpaa2_ethdev.h | 12 +++++++++ drivers/net/dpaa2/dpaa2_flow.c | 42 ++++++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 20 +++++++++++++-- 3 files changed, 72 insertions(+), 2 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.h +12 -0
@@ -282,6 +282,18 @@ enum dpaa2_ecpri_fafe_type {/* ECPRI shares SP context with VXLAN*/ #define DPAA2_ECPRI_MSG_OFFSET DPAA2_VXLAN_VNI_OFFSET +#define DPAA2_FS_FLC_FS_MARK_OFFSET \ + (DPAA2_FLC_DATA_STASHING + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_OFFSET \ + (DPAA2_FS_FLC_FS_MARK_OFFSET + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_BIT_SIZE (sizeof(uint8_t) * 8) +#define DPAA2_FS_FLC_TC_MASK ((1 << DPAA2_FS_FLC_TC_BIT_SIZE) - 1) + +#define DPAA2_FS_FLC_FLOW_OFFSET \ + (DPAA2_FS_FLC_TC_OFFSET + DPAA2_FS_FLC_TC_BIT_SIZE) +#define DPAA2_ECPRI_MAX_EXTRACT_NB 8struct ipv4_sd_addr_extract_rule {
drivers/net/dpaa2/dpaa2_flow.c +42 -0
61 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_rxtx.c +18 -2
@@ -58,6 +58,7 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,uint16_t frc =DPAA2_GET_FD_FRC_PARSE_SUM (fd);struct dpaa2_annot_hdr *annotation = (struct dpaa2_annot_hdr *)hw_annot_addr; +uint32_t flc_lo, tc, flow;if (unlikely (dpaa2_print_parser_result))dpaa2_print_parse_result (annotation);
@@ -118,8 +119,23 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,default : m->packet_type =dpaa2_dev_rx_parse_slow (m, annotation); } - m->hash.rss = fd->simple.flc_hi; - m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; + flc_lo = fd->simple.flc_lo; +if (flc_lo & (1 <<DPAA2_FS_FLC_FS_MARK_OFFSET )) { + tc = (flc_lo >>DPAA2_FS_FLC_TC_OFFSET ) & +DPAA2_FS_FLC_TC_MASK ; + flow = flc_lo >>DPAA2_FS_FLC_FLOW_OFFSET ; + m->ol_flags |= +RTE_MBUF_F_RX_FDIR | +RTE_MBUF_F_RX_FDIR_ID ; + m->hash.fdir.hi = (tc <<16 ) | flow; +DPAA2_PMD_DP_DEBUG ("FS frame received from TC[%d]->flow%d" , + tc, flow); + }else { + m->hash.rss = fd->simple.flc_hi; + m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; +DPAA2_PMD_DP_DEBUG ("Hash frame received with RSS(%08x)" , + m->hash.rss); + }if (dpaa2_enable_ts[m->port]) { *dpaa2_timestamp_dynfield (m) = annotation->word2;
Signature · 1 line
2.43.0
PATCH 8/11 net/dpaa2: add minimum key size support
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
The default size for a QoS key is 24 bytes. If the key size is smaller than the maximum, use the default (minimum) key size instead of always returning the maximum size (56 bytes). This allows smaller flow tables to be used when the extracted key fits within the default size.
Support for 24-byte QoS key entries is available from DPNI version 8.7 onwards. For older DPNI versions, the existing 56-byte entry size is retained to maintain compatibility.
--- drivers/net/dpaa2/dpaa2_flow.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/net/dpaa2/dpaa2_flow.c +12 -9
@@ -26,8 +26,11 @@static char *dpaa2_flow_control_log;static int dpaa2_sp_loaded =-1 ; +/* Default size of a key */ +#define DPNI_DEFAULT_KEY_SIZE 24 +enum dpaa2_flow_entry_size { -DPAA2_FLOW_ENTRY_MIN_SIZE = (DPNI_MAX_KEY_SIZE /2 ), +DPAA2_FLOW_ENTRY_MIN_SIZE =DPNI_DEFAULT_KEY_SIZE ,DPAA2_FLOW_ENTRY_MAX_SIZE =DPNI_MAX_KEY_SIZE };
@@ -4519,7 +4522,7 @@ dpaa2_configure_flow_fs_action(struct dpaa2_dev_priv *priv, }static inline uint16_t -dpaa2_flow_entry_size (uint16_t key_max_size) +dpaa2_flow_entry_size (struct dpaa2_dev_priv *priv,uint16_t key_max_size) {if (key_max_size >DPAA2_FLOW_ENTRY_MAX_SIZE ) { DPAA2_PMD_ERR("Key size(%d) > max(%d)",
@@ -4529,11 +4532,11 @@ dpaa2_flow_entry_size(uint16_t key_max_size)return 0 ; } -if (key_max_size >DPAA2_FLOW_ENTRY_MIN_SIZE ) +if (key_max_size >DPAA2_FLOW_ENTRY_MIN_SIZE || +dpaa2_dev_cmp_dpni_ver (priv,8 ,7 ) <0 )return DPAA2_FLOW_ENTRY_MAX_SIZE ; -/* Current MC only support fixed entry size(56)*/ -return DPAA2_FLOW_ENTRY_MAX_SIZE ; +return DPAA2_FLOW_ENTRY_MIN_SIZE ; } static inline int
@@ -4595,7 +4598,7 @@ dpaa2_configure_fs_rss_table(struct dpaa2_dev_priv *priv, } key_max_size = tc_extract->key_profile.key_max_size; - entry_size =dpaa2_flow_entry_size (key_max_size); + entry_size =dpaa2_flow_entry_size (priv, key_max_size);dpaa2_flow_fs_extracts_log (priv, tc_id); ret = dpkg_prepare_key_cfg(&tc_extract->dpkg,
@@ -4686,7 +4689,7 @@ dpaa2_configure_qos_table(struct dpaa2_dev_priv *priv, } key_max_size = qos_extract->key_profile.key_max_size; - entry_size =dpaa2_flow_entry_size (key_max_size); + entry_size =dpaa2_flow_entry_size (priv, key_max_size);dpaa2_flow_qos_extracts_log (priv);
@@ -4977,11 +4980,11 @@ dpaa2_generic_flow_set(struct dpaa2_dev_flow *flow, qos_key_extract = &priv->extract.qos_key_extract; key_size = qos_key_extract->key_profile.key_max_size; - flow->qos_rule.key_size =dpaa2_flow_entry_size (key_size); + flow->qos_rule.key_size =dpaa2_flow_entry_size (priv, key_size); tc_key_extract = &priv->extract.tc_key_extract[flow->tc_id]; key_size = tc_key_extract->key_profile.key_max_size; - flow->fs_rule.key_size =dpaa2_flow_entry_size (key_size); + flow->fs_rule.key_size =dpaa2_flow_entry_size (priv, key_size);/* Let's parse action on matching traffic */ end_of_list =0 ;
Signature · 1 line
2.43.0
PATCH 9/11 net/dpaa2: parse tunnel and fragmented packet types
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
Extend dpaa2_dev_rx_parse_new() (LX2160A FRC fast path) to identify IPv4/IPv6 fragmented packets, IPsec ESP, and GTP-U/GTP-C packets.
Map the corresponding parser summary values to DPDK packet types. GTP-U and GTP-C packets are additionally marked with RTE_PTYPE_L4_UDP to reflect the UDP transport used by the outer tunnel header.
Advertise the newly supported packet types through dpaa2_supported_ptypes_get().
--- drivers/net/dpaa2/dpaa2_ethdev.c | 4 ++++ drivers/net/dpaa2/dpaa2_ethdev.h | 12 ++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 32 ++++++++++++++++++++++++++++++-- 3 files changed, 46 insertions(+), 2 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +4 -0
@@ -1371,6 +1371,10 @@ dpaa2_supported_ptypes_get(struct rte_eth_dev *dev, size_t *no_of_elements)RTE_PTYPE_L4_UDP ,RTE_PTYPE_L4_SCTP ,RTE_PTYPE_L4_ICMP , +RTE_PTYPE_L4_FRAG , +RTE_PTYPE_TUNNEL_ESP , +RTE_PTYPE_TUNNEL_GTPU , + RTE_PTYPE_TUNNEL_GTPC, }; if (dev->rx_pkt_burst == dpaa2_dev_prefetch_rx ||
drivers/net/dpaa2/dpaa2_ethdev.h +12 -0
@@ -147,6 +147,18 @@ (0x0003 | DPAA2_PKT_TYPE_IPV4_EXT)#define DPAA2_PKT_TYPE_IPV6_ICMP \ (0x0003 | DPAA2_PKT_TYPE_IPV6_EXT) +#define DPAA2_PKT_TYPE_IPV4_ESP \ + (0x0005 | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_ESP \ + (0x0005 | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPU \ + (0x0014 | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPU \ + (0x0014 | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPC \ + (0x0015 | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPC \ + (0x0015 | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_VLAN_1 0x0160#define DPAA2_PKT_TYPE_VLAN_2 0x0260
drivers/net/dpaa2/dpaa2_rxtx.c +30 -2
@@ -78,11 +78,11 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,break ;case DPAA2_PKT_TYPE_IPV4_EXT : m->packet_type =RTE_PTYPE_L2_ETHER | -RTE_PTYPE_L3_IPV4_EXT ; +RTE_PTYPE_L3_IPV4_EXT |RTE_PTYPE_L4_FRAG ;break ;case DPAA2_PKT_TYPE_IPV6_EXT : m->packet_type =RTE_PTYPE_L2_ETHER | -RTE_PTYPE_L3_IPV6_EXT ; +RTE_PTYPE_L3_IPV6_EXT |RTE_PTYPE_L4_FRAG ;break ;case DPAA2_PKT_TYPE_IPV4_TCP : m->packet_type = RTE_PTYPE_L2_ETHER |
@@ -116,6 +116,34 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd, m->packet_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_ICMP ;break ; +case DPAA2_PKT_TYPE_IPV4_ESP : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_TUNNEL_ESP ; +break ; +case DPAA2_PKT_TYPE_IPV6_ESP : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_TUNNEL_ESP ; +break ; +case DPAA2_PKT_TYPE_IPV4_GTPU : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPU ; +break ; +case DPAA2_PKT_TYPE_IPV6_GTPU : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPU ; +break ; +case DPAA2_PKT_TYPE_IPV4_GTPC : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPC ; +break ; +case DPAA2_PKT_TYPE_IPV6_GTPC : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPC ; +break ;default : m->packet_type =dpaa2_dev_rx_parse_slow (m, annotation); }
Signature · 1 line
2.43.0
PATCH 10/11 net/dpaa2: remove unused soft parser driver
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
The DPAA2 soft parser (SP) byte code has to be installed by the boot firmware before Linux starts; the WRIOP parser cannot be reprogrammed once the MC is up. Loading an SP image at run time from the PMD therefore never took effect, so the loader and its DPNI_SS_INGRESS plumbing were dead code and are removed.
The rte_flow VXLAN and eCPRI pattern items were only ever accepted while an SP image was believed to be loaded. With the SP gone they are rejected by dpaa2_dev_verify_patterns() before the configure switch is reached, so their handlers dpaa2_configure_flow_vxlan() and dpaa2_configure_flow_ecpri(), the switch cases that call them, the mask descriptors and the VXLAN_HF_VNI helper are removed as well. Both items are also dropped from the dpaa2 feature matrix so that the documented capabilities match the code.
--- doc/guides/nics/features/dpaa2.ini | 2 - doc/guides/rel_notes/release_26_11.rst | 9 + drivers/net/dpaa2/dpaa2_ethdev.c | 28 -- drivers/net/dpaa2/dpaa2_flow.c | 564 +------------------------ drivers/net/dpaa2/dpaa2_recycle.c | 1 - drivers/net/dpaa2/dpaa2_sparser.c | 137 ------ drivers/net/dpaa2/dpaa2_sparser.h | 202 --------- drivers/net/dpaa2/meson.build | 1 - 8 files changed, 10 insertions(+), 934 deletions(-) delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.c delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.h
doc/guides/nics/features/dpaa2.ini +0 -2
@@ -35,7 +35,6 @@ Usage doc = Y [rte_flow items] ah = Y -ecpri = Y esp = Y eth = P gre = Y
@@ -50,7 +49,6 @@ sctp = Y tcp = Y udp = Y vlan = P -vxlan = Y [rte_flow actions] drop = Y
doc/guides/rel_notes/release_26_11.rst +9 -0
@@ -163,6 +163,15 @@ Removed Items Also, make sure to start the actual text at the margin. ======================================================= +* **Removed soft parser support from the dpaa2 net driver.** + + The DPAA2 soft parser (SP) blob has to be loaded by the boot firmware + before Linux starts, so loading it at run time from the PMD never took + effect. The unused SP loader has been removed, together with the rte_flow + VXLAN and eCPRI pattern items that were only accepted while an SP image + was believed to be loaded. Those two items are no longer advertised in + the dpaa2 feature matrix. + * Removed deprecated symbols: * eal: ``__rte_packed``
drivers/net/dpaa2/dpaa2_ethdev.c +0 -28
@@ -29,7 +29,6 @@#include <mc/fsl_dpmng.h> #include <mc/fsl_dpcon.h> #include "dpaa2_ethdev.h" -#include "dpaa2_sparser.h" #include <fsl_qbman_debug.h> #define DRIVER_LOOPBACK_MODE "drv_loopback"
@@ -3718,33 +3717,6 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) } eth_dev->data->mtu =RTE_ETHER_MTU ; -/*TODO To enable soft parser support DPAA2 driver needs to integrate -* with external entity to receive byte code for software sequence -* and same will be offload to the H/W using MC interface. -* Currently it is assumed that DPAA2 driver has byte code by some -* mean and same if offloaded to H/W. -*/ -if (getenv ("DPAA2_ENABLE_SOFT_PARSER" )) { -WRIOP_SS_INITIALIZER (priv); - ret =dpaa2_eth_load_wriop_soft_parser (priv,DPNI_SS_INGRESS ); -if (ret <0 ) { -DPAA2_PMD_ERR (" Error(%d) in loading softparser" , - ret); - goto init_err; - } - - ret =dpaa2_eth_enable_wriop_soft_parser (priv, -DPNI_SS_INGRESS ); -if (ret <0 ) { -DPAA2_PMD_ERR (" Error(%d) in enabling softparser" , - ret); - goto init_err; - } - } - - ret =dpaa2_soft_parser_loaded (); -if (ret >0 ) -DPAA2_PMD_INFO ("soft parser is loaded" );DPAA2_PMD_INFO ("%s: netdev created, connected to %s" , eth_dev->data->name, dpaa2_dev->ep_name);
drivers/net/dpaa2/dpaa2_flow.c +1 -563
629 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_recycle.c +0 -1
@@ -23,7 +23,6 @@#include <dpaa2_hw_dpio.h> #include <mc/fsl_dpmng.h> #include "dpaa2_ethdev.h" -#include "dpaa2_sparser.h" #include <fsl_qbman_debug.h> #include <rte_io.h>
drivers/net/dpaa2/dpaa2_sparser.c deleted +0 -137
137 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_sparser.h deleted +0 -202
202 lines not on this page · raw message
drivers/net/dpaa2/meson.build +0 -1
@@ -16,7 +16,6 @@ sources = files( 'dpaa2_flow.c', 'dpaa2_recycle.c', 'dpaa2_rxtx.c', - 'dpaa2_sparser.c', 'dpaa2_ptp.c', 'mc/dprtc.c', 'mc/dpkg.c',
Signature · 1 line
2.43.0
Re: [PATCH v11-S2 10/11] net/dpaa2: remove unused soft parser driver
Quoted 17 lines · On Thu, 15 Oct 2026 14:55:12 +0530 Prashant Gupta <[email protected]>…
From: Jun Yang <[email protected]>
The DPAA2 soft parser (SP) byte code has to be installed by the boot firmware before Linux starts; the WRIOP parser cannot be reprogrammed once the MC is up. Loading an SP image at run time from the PMD therefore never took effect, so the loader and its
DPNI_SS_INGRESSplumbing were dead code and are removed.The
rte_flowVXLAN and eCPRI pattern items were only ever accepted while an SP image was believed to be loaded. With the SP gone they are rejected bydpaa2_dev_verify_patterns()before the configure switch is reached, so their handlersdpaa2_configure_flow_vxlan()anddpaa2_configure_flow_ecpri(), the switch cases that call them, the mask descriptors and theVXLAN_HF_VNIhelper are removed as well. Both items are also dropped from the dpaa2 feature matrix so that the documented capabilities match the code.
Quoted 3 lines
Signed-off-by Jun Yang <[email protected]>Signed-off-by Prashant Gupta <[email protected]>---
After applying this to next-net, I reran the set of checks. But this patch causes problem:
$ ./devtools/check-doc-vs-code.sh rte_flow doc out of sync for dpaa2 item vxlan
Backed out the whole series, update and resend.
PATCH 11/11 net/dpaa2: rename Rx queue flags
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
Rename the Rx-side device flags to a consistent DPAA2_RX_*_FLAG naming:DPAAX_RX_ERROR_QUEUE_FLAG becomes DPAA2_RX_ERROR_QUEUE_FLAG and DPAA2_DATA_STASHING_OFF becomes DPAA2_RX_DATA_STASHING_OFF_FLAG.
This is a mechanical rename with no functional change.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 10 +++++----- drivers/net/dpaa2/dpaa2_ethdev.h | 6 ++++-- drivers/net/dpaa2/dpaa2_rxtx.c | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +5 -5
@@ -550,7 +550,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) goto fail; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { priv->rx_err_vq =rte_zmalloc ("dpni_rx_err" ,sizeof (struct dpaa2_queue ),0 );if (!priv->rx_err_vq) {
@@ -1041,7 +1041,7 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, options |=DPNI_QUEUE_OPT_FLC ; cfg.flc.stash_control = true;dpaa2_flc_stashing_clear_all (&cfg.flc.value); -if (priv->flags &DPAA2_DATA_STASHING_OFF ) { +if (priv->flags &DPAA2_RX_DATA_STASHING_OFF_FLAG ) {dpaa2_flc_stashing_set (DPAA2_FLC_DATA_STASHING ,0 , &cfg.flc.value); dpaa2_q->data_stashing_off =1 ;
@@ -1521,7 +1521,7 @@ dpaa2_dev_start(struct rte_eth_dev *dev) dpaa2_q->fqid = qid.fqid; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { ret =dpni_get_queue (dpni,CMD_PRI_LOW , priv->token,DPNI_QUEUE_RX_ERR ,0 ,0 , &cfg, &qid);if (ret) {
@@ -3475,7 +3475,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)if (dpaa2_get_devargs (dev->devargs,DRIVER_NO_DATA_STASHING ) ||getenv ("DPAA2_DATA_STASHING_OFF" )) { - priv->flags |=DPAA2_DATA_STASHING_OFF ; + priv->flags |=DPAA2_RX_DATA_STASHING_OFF_FLAG ;DPAA2_PMD_INFO ("Data stashing disabled" ); }
@@ -3581,7 +3581,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) }if (dpaa2_get_devargs (dev->devargs,DRIVER_ERROR_QUEUE )) { - priv->flags |=DPAAX_RX_ERROR_QUEUE_FLAG ; + priv->flags |=DPAA2_RX_ERROR_QUEUE_FLAG ;DPAA2_PMD_INFO ("Enable error queue" ); }
drivers/net/dpaa2/dpaa2_ethdev.h +4 -2
@@ -98,9 +98,11 @@#define DPAA2_TX_DYNAMIC_CONF_ENABLE RTE_BIT32(9)/* Disable data stashing (prefetch of packet data into CPU cache) */ -#define DPAA2_DATA_STASHING_OFF RTE_BIT32(10) +#define DPAA2_RX_DATA_STASHING_OFF_FLAG RTE_BIT32(10) -#define DPAAX_RX_ERROR_QUEUE_FLAG RTE_BIT32(11) +#define DPAA2_RX_ERROR_QUEUE_FLAG RTE_BIT32(11) + +#define DPAA2_RX_PRINT_PSR_RESULT_FLAG RTE_BIT32(12)/* DPDMUX index for DPMAC */ #define DPAA2_DPDMUX_DPMAC_IDX 0
drivers/net/dpaa2/dpaa2_rxtx.c +2 -2
@@ -831,7 +831,7 @@ dpaa2_dev_prefetch_rx_common(void *queue, struct rte_mbuf **bufs,if (!by_channel) {struct dpaa2_dev_priv *priv = eth_data->dev_private; -if (unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq); }
@@ -1096,7 +1096,7 @@ dpaa2_dev_rx_common(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;struct dpaa2_dev_priv *priv = eth_data->dev_private; -if (!by_channel &&unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (!by_channel &&unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq);if (by_channel) {
Signature · 1 line
2.43.0
Stephen Hemminger
AppliedRe: [PATCH v11-S2 00/11] net/dpaa2 updates
In reply to Prashant GuptaQuoted 5 lines · On Thu, 15 Oct 2026 14:55:02 +0530 Prashant Gupta <[email protected]>…
Changes in v11:
- Fix fragmented packet type handling to match hardware parser summary reporting.
- Address review comments.
Quoted 9 lines
Series overview:
- fix an integer overflow in the CCSR region mapping,
- set Tx confirmation on device init and support a larger burst size,
- support MPLS and PPPoE flow distribution,
- support the flow drop action and a per-device default flow miss action,
- identify Rx mbuf hash information by FLC and add minimum key size support,
- parse tunnel and fragmented packet types,
- remove the unused soft parser driver and rename Rx queue flags.
Applied to next-net
cover net/dpaa2 updates
In reply to Prashant GuptaChanges in v12:
- Restore VXLAN rte_flow item documentation in dpaa2.ini to keep documentation aligned with PMD capabilities.
- Fix documentation check failure reported after application to next-net.
Series overview:
- fix an integer overflow in the CCSR region mapping,
- set Tx confirmation on device init and support a larger burst size,
- support MPLS and PPPoE flow distribution,
- support the flow drop action and a per-device default flow miss action,
- identify Rx mbuf hash information by FLC and add minimum key size support,
- parse tunnel and fragmented packet types,
- remove the unused soft parser driver and rename Rx queue flags.
Gagandeep Singh (6):
net/dpaa2: set Tx confirmation on device init net/dpaa2: support larger burst size net/dpaa2: support MPLS and PPPoE flow distribution net/dpaa2: support flow drop action net/dpaa2: set default flow miss action per device net/dpaa2: identify Rx mbuf hash information by FLC
Hemant Agrawal (3):
net/dpaa2: fix integer overflow in CCSR region mapping net/dpaa2: add minimum key size support net/dpaa2: parse tunnel and fragmented packet types
Jun Yang (2):
net/dpaa2: remove unused soft parser driver
net/dpaa2: rename Rx queue flags
doc/guides/nics/features/dpaa2.ini | 3 +- doc/guides/rel_notes/release_26_11.rst | 13 + drivers/net/dpaa2/dpaa2_ethdev.c | 84 +--- drivers/net/dpaa2/dpaa2_ethdev.h | 32 +- drivers/net/dpaa2/dpaa2_flow.c | 633 ++++++------------------- drivers/net/dpaa2/dpaa2_recycle.c | 24 +- drivers/net/dpaa2/dpaa2_rxtx.c | 56 ++- drivers/net/dpaa2/dpaa2_sparser.c | 137 ------ drivers/net/dpaa2/dpaa2_sparser.h | 202 -------- drivers/net/dpaa2/dpaa2_tm.c | 16 +- drivers/net/dpaa2/mc/dpni.c | 11 +- drivers/net/dpaa2/mc/fsl_dpni.h | 8 +- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 +- drivers/net/dpaa2/meson.build | 1 - 14 files changed, 317 insertions(+), 906 deletions(-) delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.c delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.h
Signature · 1 line
2.43.0
PATCH 1/11 net/dpaa2: fix integer overflow in CCSR region mapping
From: Hemant Agrawal <[email protected]>
In lsx_ccsr_map_region, PAGE_SIZE is a macro defined as sysconf(_SC_PAGESIZE), which returns a signed long and may be negative on error. The value was used directly in size_t comparisons and passed to mmap, causing an integer overflow (Coverity CID 49765682).
The old round-down "len & PAGE_MASK" ignored the in-page offset: for a 4096-byte or 6656-byte len on a 64K-page kernel the masked result is 0, causing the mapping to fail, where the old code would have bumped len up to PAGE_SIZE. The correct mapping size must cover the region from the page-aligned start through offset + len.
Fix by calling sysconf(_SC_PAGESIZE) explicitly into a signed long, checking for a non-positive return before use, computing page_mask from the verified value, and using RTE_ALIGN_CEIL(offset + len, page_size) for map_len so that the mmap covers the full requested region regardless of page size. The page-aligned start address and the back-pointer offset are both derived from the same page_mask, keeping the three values consistent.
Coverity issue: 49765682
--- drivers/net/dpaa2/dpaa2_recycle.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/net/dpaa2/dpaa2_recycle.c +15 -8
@@ -176,6 +176,9 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)void *tmp;uint64_t start;uint64_t offset; +uint64_t page_mask; +long page_size; +size_t map_len; fd =open ("/dev/mem" ,O_RDWR );if (fd <0 ) {
@@ -183,20 +186,24 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)return NULL ; } - start = addr &PAGE_MASK ; + page_size =sysconf (_SC_PAGESIZE); +if (page_size <=0 ) { +close (fd); +return NULL ; + } + page_mask = ~((uint64_t )page_size -1 ); + start = addr & page_mask; offset = addr - start; - len = len &PAGE_MASK ; -if (len < (size_t )PAGE_SIZE ) - len =PAGE_SIZE ; + map_len =RTE_ALIGN_CEIL (offset + len, (size_t )page_size); - tmp =mmap (NULL , len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start); + tmp =mmap (NULL , map_len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start);close (fd); -if (tmp !=MAP_FAILED ) -return (uint8_t *)tmp + offset; -else +if (tmp ==MAP_FAILED )return NULL ; + +return (uint8_t *)tmp + offset; }static const uint8_t ls_sd1_prot_idx_map[] = {
Signature · 1 line
2.43.0
PATCH 2/11 net/dpaa2: set Tx confirmation on device init
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Move TX confirmation mode setting from TXQ setup to device initialization because TXQ0 is not always set up by the user.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 40 ++++++++++++-------------------- 1 file changed, 15 insertions(+), 25 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +15 -25
@@ -1153,7 +1153,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,struct dpni_queue tx_conf_cfg;struct dpni_queue tx_flow_cfg;uint8_t options =0 , flow_id; -uint8_t ceetm_ch_idx;uint16_t channel_id;struct dpni_queue_id qid;uint32_t tc_id;
@@ -1174,30 +1173,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,memset (&tx_conf_cfg,0 ,sizeof (struct dpni_queue ));memset (&tx_flow_cfg,0 ,sizeof (struct dpni_queue )); -if (!tx_queue_id) { -for (ceetm_ch_idx =0 ; - ceetm_ch_idx <= (priv->num_channels -1 ); - ceetm_ch_idx++) { -/*Set tx-conf and error configuration*/ -if (priv->flags &DPAA2_TX_CONF_ENABLE ) { - ret =dpni_set_tx_confirmation_mode (dpni, -CMD_PRI_LOW , priv->token, - ceetm_ch_idx, -DPNI_CONF_AFFINE ); - }else { - ret =dpni_set_tx_confirmation_mode (dpni, -CMD_PRI_LOW , priv->token, - ceetm_ch_idx, -DPNI_CONF_DISABLE ); - } -if (ret) { -DPAA2_PMD_ERR ("Error(%d) in tx conf setting" , - ret); -return ret; - } - } - } - tc_id = tx_queue_id % priv->num_tx_tc; channel_id = (uint8_t )(tx_queue_id / priv->num_tx_tc) % priv->num_channels; flow_id =0 ;
@@ -3621,6 +3596,21 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) goto init_err; } +for (i =0 ; i < priv->num_channels; i++) { +/*Set tx-conf and error configuration*/ +if (priv->flags &DPAA2_TX_CONF_ENABLE ) { + ret =dpni_set_tx_confirmation_mode (dpni_dev, +CMD_PRI_LOW , priv->token, i,DPNI_CONF_AFFINE ); + }else { + ret =dpni_set_tx_confirmation_mode (dpni_dev, +CMD_PRI_LOW , priv->token, i,DPNI_CONF_DISABLE ); + } +if (ret) { +DPAA2_PMD_ERR ("Error(%d) in tx conf setting" , ret); + goto init_err; + } + } +/* Allocate memory for storing MAC addresses. * Table of mac_filter_entries size is allocated so that RTE ether lib * can add MAC entries when rte_eth_dev_mac_addr_add is called.
Signature · 1 line
2.43.0
PATCH 3/11 net/dpaa2: support larger burst size
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Make burst size checks and MC command fields SoC-aware, enabling bursts larger than 64K on LX2160A with dpni version 8.7+.
The max_burst_size field in dpni_tx_shaping_cfg is widened to uint32_t and the MC command struct is updated to split the value across two 16-bit fields using the new DPNI_BURST_LO/HI macros.
--- drivers/net/dpaa2/dpaa2_tm.c | 16 +++++++++++----- drivers/net/dpaa2/mc/dpni.c | 11 +++++++++-- drivers/net/dpaa2/mc/fsl_dpni.h | 8 ++++++-- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 ++- 4 files changed, 28 insertions(+), 10 deletions(-)
drivers/net/dpaa2/dpaa2_tm.c +11 -5
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright 2020-2024 NXP +* Copyright 2020-2026 NXP */ #include <rte_ethdev.h>
@@ -10,14 +10,20 @@#include "dpaa2_pmd_logs.h" #include <dpaa2_hw_dpio.h> -#define DPAA2_BURST_MAX (64 * 1024) -#define DPAA2_SHAPER_MIN_RATE 0#define DPAA2_SHAPER_MAX_RATE 107374182400ull#define DPAA2_WEIGHT_MAX 24701#define DPAA2_PKT_ADJUST_LEN_MIN 0#define DPAA2_PKT_ADJUST_LEN_MAX 0x7ff +static inline uint32_t dpaa2_get_burst_max (struct dpaa2_dev_priv *priv) +{ +if (dpaa2_dev_cmp_dpni_ver (priv,8 ,7 ) >=0 ) +return (dpaa2_svr_family ==SVR_LX2160A ) ?229375 :0xF7FF ; + +return 0xF7FF ; +} +int dpaa2_tm_init (struct rte_eth_dev *dev) {
@@ -283,7 +289,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE , NULL, "committed rate is out of range\n"); -if (params->committed.size >DPAA2_BURST_MAX ) +if (params->committed.size >dpaa2_get_burst_max (priv))return -rte_tm_error_set (error,EINVAL ,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE ,NULL ,"committed size is out of range\n" );
@@ -293,7 +299,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE , NULL, "Peak rate is out of range\n"); -if (params->peak.size >DPAA2_BURST_MAX ) +if (params->peak.size >dpaa2_get_burst_max (priv))return -rte_tm_error_set (error,EINVAL ,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE ,NULL ,"Peak size is out of range\n" );
drivers/net/dpaa2/mc/dpni.c +9 -2
@@ -1106,6 +1106,7 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io, {struct dpni_cmd_set_tx_shaping *cmd_params;struct mc_command cmd = {0 }; +uint32_t tx_cr_burst, tx_er_burst;int coupled, lni_shaper;uint8_t channel_id;uint16_t oal;
@@ -1115,10 +1116,16 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io, cmd_flags, token); cmd_params = (struct dpni_cmd_set_tx_shaping *)cmd.params; + tx_cr_burst = tx_cr_shaper->max_burst_size; + tx_er_burst = tx_er_shaper->max_burst_size; cmd_params->tx_cr_max_burst_size = -cpu_to_le16 (tx_cr_shaper->max_burst_size); +cpu_to_le16 (DPNI_BURST_LO (tx_cr_burst)); cmd_params->tx_er_max_burst_size = -cpu_to_le16 (tx_er_shaper->max_burst_size); +cpu_to_le16 (DPNI_BURST_LO (tx_er_burst)); + cmd_params->tx_cr_max_burst_size_hi = +cpu_to_le16 (DPNI_BURST_HI (tx_cr_burst)); + cmd_params->tx_er_max_burst_size_hi = +cpu_to_le16 (DPNI_BURST_HI (tx_er_burst)); cmd_params->tx_cr_rate_limit =cpu_to_le32 (tx_cr_shaper->rate_limit); cmd_params->tx_er_rate_limit =
drivers/net/dpaa2/mc/fsl_dpni.h +6 -2
@@ -830,14 +830,18 @@ int dpni_get_link_state(struct fsl_mc_io *mc_io,uint16_t token, struct dpni_link_state *state); +#define DPNI_BURST_LO (burst) ((burst) & GENMASK(15, 0)) +#define DPNI_BURST_HI (burst) ((burst) >> 16) +/** * struct dpni_tx_shaping - Structure representing DPNI tx shaping configuration * @rate_limit: Rate in Mbits/s -* @max_burst_size: Burst size in bytes (up to 64KB) +* @max_burst_size: Burst size in bytes. Limits depend on the SoC (0x37FFF +* for LX2160A, 0xF7FF for all others) */ struct dpni_tx_shaping_cfg {uint32_t rate_limit; -uint16_t max_burst_size; +uint32_t max_burst_size; };/**
drivers/net/dpaa2/mc/fsl_dpni_cmd.h +2 -1
@@ -394,7 +394,8 @@ struct dpni_rsp_get_link_state {struct dpni_cmd_set_tx_shaping {uint16_t tx_cr_max_burst_size;uint16_t tx_er_max_burst_size; -uint32_t pad; +uint16_t tx_cr_max_burst_size_hi; +uint16_t tx_er_max_burst_size_hi;uint32_t tx_cr_rate_limit;uint32_t tx_er_rate_limit;/* from LSB: coupled:1, lni_shaper: 1*/
Signature · 1 line
2.43.0
PATCH 4/11 net/dpaa2: support MPLS and PPPoE flow distribution
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add rte_flow pattern support for MPLS and PPPoE items in the dpaa2 PMD flow engine.
For a pattern with no spec/mask, the frame is identified by its Frame Attribute Flag (FAF_MPLS_FRAM / FAF_PPPOE_PPP_FRAM) for both the QoS and flow steering tables. When a spec is present, the MPLS label (NH_FLD_MPLS_MPLSL_1) or the PPPoE session id (NH_FLD_PPPOE_SID) is added as a header extract rule for both tables.
NH_FLD_MPLS_MPLSL_1 with DPKG_FULL_FIELD causes MC to extract the full 4-byte MPLS LSE (label + TC + S + TTL). The original code passed sizeof(label_tc_s) = 3, so the driver key profile recorded the field as 3 bytes while MC placed 4 bytes in the key; any extract field added after MPLS was off by one byte, corrupting the key layout.
Fix by passing the full struct rte_flow_item_mpls pointer (spec/mask) with sizeof(*mask) = 4, so the key profile width matches the 4-byte field that MC extracts. The TTL byte has mask 0x00 in the default mask and is ignored for matching purposes.
--- doc/guides/nics/features/dpaa2.ini | 2 + drivers/net/dpaa2/dpaa2_flow.c | 196 +++++++++++++++++++++++++++++ 2 files changed, 198 insertions(+)
doc/guides/nics/features/dpaa2.ini +2 -0
@@ -43,6 +43,8 @@ gtp = Y icmp = Y ipv4 = Y ipv6 = Y +mpls = Y +pppoes = Y raw = Y sctp = Y tcp = Y
drivers/net/dpaa2/dpaa2_flow.c +196 -0
228 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 5/11 net/dpaa2: support flow drop action
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add support for the RTE_FLOW_ACTION_TYPE_DROP action in the dpaa2 flow engine. A flow rule with a drop action is programmed into the flow steering (FS) table with the DPNI_FS_OPT_DISCARD option so that matching frames are discarded by hardware.
The drop action is added to the supported action list, accepted during action verification, configured in the FS action path, handled in the generic flow-set action loop, and cleaned up in the flow destroy path.
--- drivers/net/dpaa2/dpaa2_flow.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/dpaa2/dpaa2_flow.c +7 -1
@@ -97,7 +97,8 @@ enum rte_flow_action_type dpaa2_supported_action_type[] = {RTE_FLOW_ACTION_TYPE_QUEUE ,RTE_FLOW_ACTION_TYPE_PORT_ID ,RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT , - RTE_FLOW_ACTION_TYPE_RSS +RTE_FLOW_ACTION_TYPE_RSS , + RTE_FLOW_ACTION_TYPE_DROP };#ifndef __cplusplus
@@ -4421,6 +4422,7 @@ dpaa2_flow_verify_action(struct dpaa2_dev_priv *priv,break ;case RTE_FLOW_ACTION_TYPE_PF :/* Skip this action, have to add for vxlan */ +case RTE_FLOW_ACTION_TYPE_DROP :break ;case RTE_FLOW_ACTION_TYPE_END : end_of_list =1 ;
@@ -4468,6 +4470,8 @@ dpaa2_configure_flow_fs_action(struct dpaa2_dev_priv *priv, flow->fs_action_cfg.redirect_obj_token = dest_priv->token; flow->fs_action_cfg.flow_id = dest_q->flow_id; + }else if (flow->action_type ==RTE_FLOW_ACTION_TYPE_DROP ) { + flow->fs_action_cfg.options =DPNI_FS_OPT_DISCARD ; }return 0 ;
@@ -4945,6 +4949,7 @@ dpaa2_generic_flow_set(struct dpaa2_dev_flow *flow,case RTE_FLOW_ACTION_TYPE_QUEUE :case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT :case RTE_FLOW_ACTION_TYPE_PORT_ID : +case RTE_FLOW_ACTION_TYPE_DROP : ret =dpaa2_configure_flow_fs_action (priv, flow, &actions[j]);if (ret)
@@ -5346,6 +5351,7 @@ dpaa2_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *_flow,case RTE_FLOW_ACTION_TYPE_QUEUE :case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT :case RTE_FLOW_ACTION_TYPE_PORT_ID : +case RTE_FLOW_ACTION_TYPE_DROP :if (priv->num_rx_tc >1 ) {/* Remove entry from QoS table first */ ret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW,
Signature · 1 line
2.43.0
PATCH 6/11 net/dpaa2: set default flow miss action per device
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
The flow steering miss flow id was a file-scope global defaulting to 0 and optionally overridden via the DPAA2_FLOW_CONTROL_MISS_FLOW environment variable. Replace it with a per-device default_flow field in dpaa2_dev_priv, initialised to the lowest-priority flow ID (min(fs_entries, dist_queues) - 1) at probe time, so that each device has its own independent miss-flow setting.
The DPAA2_FLOW_CONTROL_MISS_FLOW environment variable is removed. Users who relied on it must use the rte_flow API instead.
--- doc/guides/rel_notes/release_26_11.rst | 4 ++++ drivers/net/dpaa2/dpaa2_ethdev.c | 2 ++ drivers/net/dpaa2/dpaa2_ethdev.h | 2 ++ drivers/net/dpaa2/dpaa2_flow.c | 14 +------------- 4 files changed, 9 insertions(+), 13 deletions(-)
doc/guides/rel_notes/release_26_11.rst +4 -0
@@ -105,6 +105,10 @@ New Features * Added the inner IP header to the RSS hash so tunneled traffic is distributed across the Rx queues. + * Removed ``DPAA2_FLOW_CONTROL_MISS_FLOW`` environment variable. The + per-device FS table miss flow id now defaults to the lowest-priority + flow of the device. Users who previously redirected unmatched frames + to a specific queue via this variable must use the rte_flow API instead. * **Updated NXP ENETC4 PMD.**
drivers/net/dpaa2/dpaa2_ethdev.c +2 -0
@@ -3539,6 +3539,8 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) priv->dist_queues = attr.num_queues; priv->num_channels = attr.num_channels; priv->channel_inuse =0 ; + priv->default_flow =RTE_MAX (RTE_MIN (priv->fs_entries, + priv->dist_queues),1 ) -1 ;rte_spinlock_init (&priv->lpbk_qp_lock);/* only if the custom CG is enabled */
drivers/net/dpaa2/dpaa2_ethdev.h +2 -0
@@ -411,6 +411,8 @@ struct dpaa2_dev_priv {uint8_t en_loose_ordered;uint8_t max_cgs;uint8_t cgid_in_use[MAX_RX_QUEUES ]; +/* Lowest priority FS flow id to receive flow steering miss frames. */ +uint16_t default_flow;/* Current hash distribution size per RX TC, written by * dpaa2_setup_flow_dist_size() and read by reta_query / reta_update.
drivers/net/dpaa2/dpaa2_flow.c +1 -13
@@ -24,7 +24,6 @@#include <dpaa2_pmd_logs.h> static char *dpaa2_flow_control_log; -static uint16_t dpaa2_flow_miss_flow_id;/* Default miss flow id is 0. */ static int dpaa2_sp_loaded =-1 ;enum dpaa2_flow_entry_size {
@@ -4590,7 +4589,7 @@ dpaa2_configure_fs_rss_table(struct dpaa2_dev_priv *priv,return 0 ; tc_cfg.enable = true; - tc_cfg.fs_miss_flow_id = dpaa2_flow_miss_flow_id; + tc_cfg.fs_miss_flow_id = priv->default_flow; ret =dpni_set_rx_fs_dist (dpni,CMD_PRI_LOW , priv->token, &tc_cfg);if (ret <0 ) {
@@ -5224,17 +5223,6 @@ dpaa2_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, dpaa2_flow_control_log =getenv ("DPAA2_FLOW_CONTROL_LOG" ); -if (getenv ("DPAA2_FLOW_CONTROL_MISS_FLOW" )) { - dpaa2_flow_miss_flow_id = - (uint16_t )atoi (getenv ("DPAA2_FLOW_CONTROL_MISS_FLOW" )); -if (dpaa2_flow_miss_flow_id >= priv->dist_queues) { -DPAA2_PMD_ERR ("Missed flow ID %d >= dist size(%d)" , - dpaa2_flow_miss_flow_id, - priv->dist_queues); -return NULL ; - } - } - flow =rte_zmalloc (NULL ,sizeof (struct dpaa2_dev_flow ),RTE_CACHE_LINE_SIZE );if (!flow) {
Signature · 1 line
2.43.0
PATCH 7/11 net/dpaa2: identify Rx mbuf hash information by FLC
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
For default RSS distribution, the mbuf is marked with RTE_MBUF_F_RX_RSS_HASH and the hash value is taken from the high word of FLC.
Configure the flow steering action with FLC enabled to align the stashing setting with the RSS configuration. The TC ID and flow ID are packed into the FLC low word by the hardware. An Rx mbuf received from the FS table has the FS_MARK bit set in FLC low word; such mbufs are marked with RTE_MBUF_F_RX_FDIR and the TC and flow ID are stored via rte_mbuf_sched_set() for use by the scheduler.
--- drivers/net/dpaa2/dpaa2_ethdev.h | 12 +++++++++ drivers/net/dpaa2/dpaa2_flow.c | 42 ++++++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 20 +++++++++++++-- 3 files changed, 72 insertions(+), 2 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.h +12 -0
@@ -282,6 +282,18 @@ enum dpaa2_ecpri_fafe_type {/* ECPRI shares SP context with VXLAN*/ #define DPAA2_ECPRI_MSG_OFFSET DPAA2_VXLAN_VNI_OFFSET +#define DPAA2_FS_FLC_FS_MARK_OFFSET \ + (DPAA2_FLC_DATA_STASHING + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_OFFSET \ + (DPAA2_FS_FLC_FS_MARK_OFFSET + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_BIT_SIZE (sizeof(uint8_t) * 8) +#define DPAA2_FS_FLC_TC_MASK ((1 << DPAA2_FS_FLC_TC_BIT_SIZE) - 1) + +#define DPAA2_FS_FLC_FLOW_OFFSET \ + (DPAA2_FS_FLC_TC_OFFSET + DPAA2_FS_FLC_TC_BIT_SIZE) +#define DPAA2_ECPRI_MAX_EXTRACT_NB 8struct ipv4_sd_addr_extract_rule {
drivers/net/dpaa2/dpaa2_flow.c +42 -0
61 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_rxtx.c +18 -2
@@ -58,6 +58,7 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,uint16_t frc =DPAA2_GET_FD_FRC_PARSE_SUM (fd);struct dpaa2_annot_hdr *annotation = (struct dpaa2_annot_hdr *)hw_annot_addr; +uint32_t flc_lo, tc, flow;if (unlikely (dpaa2_print_parser_result))dpaa2_print_parse_result (annotation);
@@ -118,8 +119,23 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,default : m->packet_type =dpaa2_dev_rx_parse_slow (m, annotation); } - m->hash.rss = fd->simple.flc_hi; - m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; + flc_lo = fd->simple.flc_lo; +if (flc_lo & (1 <<DPAA2_FS_FLC_FS_MARK_OFFSET )) { + tc = (flc_lo >>DPAA2_FS_FLC_TC_OFFSET ) & +DPAA2_FS_FLC_TC_MASK ; + flow = flc_lo >>DPAA2_FS_FLC_FLOW_OFFSET ; + m->ol_flags |= +RTE_MBUF_F_RX_FDIR | +RTE_MBUF_F_RX_FDIR_ID ; + m->hash.fdir.hi = (tc <<16 ) | flow; +DPAA2_PMD_DP_DEBUG ("FS frame received from TC[%d]->flow%d" , + tc, flow); + }else { + m->hash.rss = fd->simple.flc_hi; + m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; +DPAA2_PMD_DP_DEBUG ("Hash frame received with RSS(%08x)" , + m->hash.rss); + }if (dpaa2_enable_ts[m->port]) { *dpaa2_timestamp_dynfield (m) = annotation->word2;
Signature · 1 line
2.43.0
PATCH 8/11 net/dpaa2: add minimum key size support
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
The default size for a QoS key is 24 bytes. If the key size is smaller than the maximum, use the default (minimum) key size instead of always returning the maximum size (56 bytes). This allows smaller flow tables to be used when the extracted key fits within the default size.
Support for 24-byte QoS key entries is available from DPNI version 8.7 onwards. For older DPNI versions, the existing 56-byte entry size is retained to maintain compatibility.
--- drivers/net/dpaa2/dpaa2_flow.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/net/dpaa2/dpaa2_flow.c +12 -9
@@ -26,8 +26,11 @@static char *dpaa2_flow_control_log;static int dpaa2_sp_loaded =-1 ; +/* Default size of a key */ +#define DPNI_DEFAULT_KEY_SIZE 24 +enum dpaa2_flow_entry_size { -DPAA2_FLOW_ENTRY_MIN_SIZE = (DPNI_MAX_KEY_SIZE /2 ), +DPAA2_FLOW_ENTRY_MIN_SIZE =DPNI_DEFAULT_KEY_SIZE ,DPAA2_FLOW_ENTRY_MAX_SIZE =DPNI_MAX_KEY_SIZE };
@@ -4519,7 +4522,7 @@ dpaa2_configure_flow_fs_action(struct dpaa2_dev_priv *priv, }static inline uint16_t -dpaa2_flow_entry_size (uint16_t key_max_size) +dpaa2_flow_entry_size (struct dpaa2_dev_priv *priv,uint16_t key_max_size) {if (key_max_size >DPAA2_FLOW_ENTRY_MAX_SIZE ) { DPAA2_PMD_ERR("Key size(%d) > max(%d)",
@@ -4529,11 +4532,11 @@ dpaa2_flow_entry_size(uint16_t key_max_size)return 0 ; } -if (key_max_size >DPAA2_FLOW_ENTRY_MIN_SIZE ) +if (key_max_size >DPAA2_FLOW_ENTRY_MIN_SIZE || +dpaa2_dev_cmp_dpni_ver (priv,8 ,7 ) <0 )return DPAA2_FLOW_ENTRY_MAX_SIZE ; -/* Current MC only support fixed entry size(56)*/ -return DPAA2_FLOW_ENTRY_MAX_SIZE ; +return DPAA2_FLOW_ENTRY_MIN_SIZE ; } static inline int
@@ -4595,7 +4598,7 @@ dpaa2_configure_fs_rss_table(struct dpaa2_dev_priv *priv, } key_max_size = tc_extract->key_profile.key_max_size; - entry_size =dpaa2_flow_entry_size (key_max_size); + entry_size =dpaa2_flow_entry_size (priv, key_max_size);dpaa2_flow_fs_extracts_log (priv, tc_id); ret = dpkg_prepare_key_cfg(&tc_extract->dpkg,
@@ -4686,7 +4689,7 @@ dpaa2_configure_qos_table(struct dpaa2_dev_priv *priv, } key_max_size = qos_extract->key_profile.key_max_size; - entry_size =dpaa2_flow_entry_size (key_max_size); + entry_size =dpaa2_flow_entry_size (priv, key_max_size);dpaa2_flow_qos_extracts_log (priv);
@@ -4977,11 +4980,11 @@ dpaa2_generic_flow_set(struct dpaa2_dev_flow *flow, qos_key_extract = &priv->extract.qos_key_extract; key_size = qos_key_extract->key_profile.key_max_size; - flow->qos_rule.key_size =dpaa2_flow_entry_size (key_size); + flow->qos_rule.key_size =dpaa2_flow_entry_size (priv, key_size); tc_key_extract = &priv->extract.tc_key_extract[flow->tc_id]; key_size = tc_key_extract->key_profile.key_max_size; - flow->fs_rule.key_size =dpaa2_flow_entry_size (key_size); + flow->fs_rule.key_size =dpaa2_flow_entry_size (priv, key_size);/* Let's parse action on matching traffic */ end_of_list =0 ;
Signature · 1 line
2.43.0
PATCH 9/11 net/dpaa2: parse tunnel and fragmented packet types
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
Extend dpaa2_dev_rx_parse_new() (LX2160A FRC fast path) to identify IPv4/IPv6 fragmented packets, IPsec ESP, and GTP-U/GTP-C packets.
Map the corresponding parser summary values to DPDK packet types. GTP-U and GTP-C packets are additionally marked with RTE_PTYPE_L4_UDP to reflect the UDP transport used by the outer tunnel header.
Advertise the newly supported packet types through dpaa2_supported_ptypes_get().
--- drivers/net/dpaa2/dpaa2_ethdev.c | 4 ++++ drivers/net/dpaa2/dpaa2_ethdev.h | 12 ++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 32 ++++++++++++++++++++++++++++++-- 3 files changed, 46 insertions(+), 2 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +4 -0
@@ -1371,6 +1371,10 @@ dpaa2_supported_ptypes_get(struct rte_eth_dev *dev, size_t *no_of_elements)RTE_PTYPE_L4_UDP ,RTE_PTYPE_L4_SCTP ,RTE_PTYPE_L4_ICMP , +RTE_PTYPE_L4_FRAG , +RTE_PTYPE_TUNNEL_ESP , +RTE_PTYPE_TUNNEL_GTPU , + RTE_PTYPE_TUNNEL_GTPC, }; if (dev->rx_pkt_burst == dpaa2_dev_prefetch_rx ||
drivers/net/dpaa2/dpaa2_ethdev.h +12 -0
@@ -147,6 +147,18 @@ (0x0003 | DPAA2_PKT_TYPE_IPV4_EXT)#define DPAA2_PKT_TYPE_IPV6_ICMP \ (0x0003 | DPAA2_PKT_TYPE_IPV6_EXT) +#define DPAA2_PKT_TYPE_IPV4_ESP \ + (0x0005 | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_ESP \ + (0x0005 | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPU \ + (0x0014 | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPU \ + (0x0014 | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPC \ + (0x0015 | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPC \ + (0x0015 | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_VLAN_1 0x0160#define DPAA2_PKT_TYPE_VLAN_2 0x0260
drivers/net/dpaa2/dpaa2_rxtx.c +30 -2
@@ -78,11 +78,11 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,break ;case DPAA2_PKT_TYPE_IPV4_EXT : m->packet_type =RTE_PTYPE_L2_ETHER | -RTE_PTYPE_L3_IPV4_EXT ; +RTE_PTYPE_L3_IPV4_EXT |RTE_PTYPE_L4_FRAG ;break ;case DPAA2_PKT_TYPE_IPV6_EXT : m->packet_type =RTE_PTYPE_L2_ETHER | -RTE_PTYPE_L3_IPV6_EXT ; +RTE_PTYPE_L3_IPV6_EXT |RTE_PTYPE_L4_FRAG ;break ;case DPAA2_PKT_TYPE_IPV4_TCP : m->packet_type = RTE_PTYPE_L2_ETHER |
@@ -116,6 +116,34 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd, m->packet_type =RTE_PTYPE_L2_ETHER |RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_ICMP ;break ; +case DPAA2_PKT_TYPE_IPV4_ESP : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_TUNNEL_ESP ; +break ; +case DPAA2_PKT_TYPE_IPV6_ESP : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_TUNNEL_ESP ; +break ; +case DPAA2_PKT_TYPE_IPV4_GTPU : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPU ; +break ; +case DPAA2_PKT_TYPE_IPV6_GTPU : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPU ; +break ; +case DPAA2_PKT_TYPE_IPV4_GTPC : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV4 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPC ; +break ; +case DPAA2_PKT_TYPE_IPV6_GTPC : + m->packet_type =RTE_PTYPE_L2_ETHER | +RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_UDP | +RTE_PTYPE_TUNNEL_GTPC ; +break ;default : m->packet_type =dpaa2_dev_rx_parse_slow (m, annotation); }
Signature · 1 line
2.43.0
PATCH 10/11 net/dpaa2: remove unused soft parser driver
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
The DPAA2 soft parser (SP) byte code has to be installed by the boot firmware before Linux starts; the WRIOP parser cannot be reprogrammed once the MC is up. Loading an SP image at run time from the PMD therefore never took effect, so the loader and its DPNI_SS_INGRESS plumbing were dead code and are removed.
The rte_flow VXLAN and eCPRI pattern items were only ever accepted while an SP image was believed to be loaded. With the SP gone they are rejected by dpaa2_dev_verify_patterns() before the configure switch is reached, so their handlers dpaa2_configure_flow_vxlan() and dpaa2_configure_flow_ecpri(), the switch cases that call them, the mask descriptors and the VXLAN_HF_VNI helper are removed as well. The eCPRI item is also removed from the dpaa2 feature matrix so that the documented capabilities match the code.
--- doc/guides/nics/features/dpaa2.ini | 1 - doc/guides/rel_notes/release_26_11.rst | 9 + drivers/net/dpaa2/dpaa2_ethdev.c | 28 -- drivers/net/dpaa2/dpaa2_flow.c | 564 +------------------------ drivers/net/dpaa2/dpaa2_recycle.c | 1 - drivers/net/dpaa2/dpaa2_sparser.c | 137 ------ drivers/net/dpaa2/dpaa2_sparser.h | 202 --------- drivers/net/dpaa2/meson.build | 1 - 8 files changed, 10 insertions(+), 933 deletions(-) delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.c delete mode 100644 drivers/net/dpaa2/dpaa2_sparser.h
doc/guides/nics/features/dpaa2.ini +0 -1
@@ -35,7 +35,6 @@ Usage doc = Y [rte_flow items] ah = Y -ecpri = Y esp = Y eth = P gre = Y
doc/guides/rel_notes/release_26_11.rst +9 -0
@@ -163,6 +163,15 @@ Removed Items Also, make sure to start the actual text at the margin. ======================================================= +* **Removed soft parser support from the dpaa2 net driver.** + + The DPAA2 soft parser (SP) blob has to be loaded by the boot firmware + before Linux starts, so loading it at run time from the PMD never took + effect. The unused SP loader has been removed, together with the rte_flow + VXLAN and eCPRI pattern items that were only accepted while an SP image + was believed to be loaded. Those two items are no longer advertised in + the dpaa2 feature matrix. + * Removed deprecated symbols: * eal: ``__rte_packed``
drivers/net/dpaa2/dpaa2_ethdev.c +0 -28
@@ -29,7 +29,6 @@#include <mc/fsl_dpmng.h> #include <mc/fsl_dpcon.h> #include "dpaa2_ethdev.h" -#include "dpaa2_sparser.h" #include <fsl_qbman_debug.h> #define DRIVER_LOOPBACK_MODE "drv_loopback"
@@ -3718,33 +3717,6 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) } eth_dev->data->mtu =RTE_ETHER_MTU ; -/*TODO To enable soft parser support DPAA2 driver needs to integrate -* with external entity to receive byte code for software sequence -* and same will be offload to the H/W using MC interface. -* Currently it is assumed that DPAA2 driver has byte code by some -* mean and same if offloaded to H/W. -*/ -if (getenv ("DPAA2_ENABLE_SOFT_PARSER" )) { -WRIOP_SS_INITIALIZER (priv); - ret =dpaa2_eth_load_wriop_soft_parser (priv,DPNI_SS_INGRESS ); -if (ret <0 ) { -DPAA2_PMD_ERR (" Error(%d) in loading softparser" , - ret); - goto init_err; - } - - ret =dpaa2_eth_enable_wriop_soft_parser (priv, -DPNI_SS_INGRESS ); -if (ret <0 ) { -DPAA2_PMD_ERR (" Error(%d) in enabling softparser" , - ret); - goto init_err; - } - } - - ret =dpaa2_soft_parser_loaded (); -if (ret >0 ) -DPAA2_PMD_INFO ("soft parser is loaded" );DPAA2_PMD_INFO ("%s: netdev created, connected to %s" , eth_dev->data->name, dpaa2_dev->ep_name);
drivers/net/dpaa2/dpaa2_flow.c +1 -563
629 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_recycle.c +0 -1
@@ -23,7 +23,6 @@#include <dpaa2_hw_dpio.h> #include <mc/fsl_dpmng.h> #include "dpaa2_ethdev.h" -#include "dpaa2_sparser.h" #include <fsl_qbman_debug.h> #include <rte_io.h>
drivers/net/dpaa2/dpaa2_sparser.c deleted +0 -137
137 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_sparser.h deleted +0 -202
202 lines not on this page · raw message
drivers/net/dpaa2/meson.build +0 -1
@@ -16,7 +16,6 @@ sources = files( 'dpaa2_flow.c', 'dpaa2_recycle.c', 'dpaa2_rxtx.c', - 'dpaa2_sparser.c', 'dpaa2_ptp.c', 'mc/dprtc.c', 'mc/dpkg.c',
Signature · 1 line
2.43.0
Re: [PATCH v12-S2 10/11] net/dpaa2: remove unused soft parser driver
Quoted 17 lines · On Fri, 16 Oct 2026 12:33:38 +0530 Prashant Gupta <[email protected]>…
From: Jun Yang <[email protected]>
The DPAA2 soft parser (SP) byte code has to be installed by the boot firmware before Linux starts; the WRIOP parser cannot be reprogrammed once the MC is up. Loading an SP image at run time from the PMD therefore never took effect, so the loader and its
DPNI_SS_INGRESSplumbing were dead code and are removed.The
rte_flowVXLAN and eCPRI pattern items were only ever accepted while an SP image was believed to be loaded. With the SP gone they are rejected bydpaa2_dev_verify_patterns()before the configure switch is reached, so their handlersdpaa2_configure_flow_vxlan()anddpaa2_configure_flow_ecpri(), the switch cases that call them, the mask descriptors and theVXLAN_HF_VNIhelper are removed as well. The eCPRI item is also removed from the dpaa2 feature matrix so that the documented capabilities match the code.
Quoted 3 lines
Signed-off-by Jun Yang <[email protected]>Signed-off-by Prashant Gupta <[email protected]>---
Sigh. AI review said "I am sorry last review was wrong.."
Subject: Re: [PATCH v13-S2 00/10] net/dpaa2: ...
Series applies cleanly to 26.11-rc1 and every commit builds with -Dwerror=true. Feature matrix now matches the code. v12 comments on patches 1, 7, 9 and 10 are addressed.
One problem left, in patch 6.
Still needs a separate fix, outside this series:dpaa2_flow_item_convert() allocates num items and writes num + 1 (the END marker).
Patch 06/10 net/dpaa2: set default flow miss action per device
Error:
My v12 comment got the mechanism wrong. priv->nb_rx_queues is the DPNI hardware count (num_rx_tcs * num_queues), not the application's queue count, so dist_size - 1 is always a valid FS flow id. The problem is that the queue may not be set up.
Rx queue i maps to tc = i / dist_size, flow = i % dist_size, and dpni_set_queue() and the taildrop setup only run in dpaa2_dev_rx_queue_setup(). On a 16-queue DPNI where the application configures 4 Rx queues, unmatched frames go to flow 15. Nothing polls that FQ and it has no taildrop, so frames pile up and hold buffers until the pool runs out and Rx stops on every queue. The old default of 0 was always polled.
Use the last queue the application actually configured in this TC:
uint16_t nb_rxq = priv->eth_dev->data->nb_rx_queues; uint16_t first = tc_id * dist_size; tc_cfg.enable = true; tc_cfg.fs_miss_flow_id = nb_rxq > first ? RTE_MIN(dist_size, nb_rxq - first) - 1 : 0;
Warning:
Release note says the miss flow id "defaults to the lowest-priority flow of the device". An FS flow id is a queue index within the TC, not a priority. Say which queue gets unmatched frames, e.g.:
The flow steering miss queue now defaults to the last Rx queue configured in the traffic class.
Patch 09/10 net/dpaa2: parse tunnel and fragmented packet types
Info:
DPAA2_PKT_TYPE_IPV4_ICMP is now (0x0003 | DPAA2_PKT_TYPE_IPV4_FRAG), which reads as if ICMP were a fragment. The value is the same either way; write it as (0x0003 | DPAA2_PKT_TYPE_IPV4), and the same for IPv6.
Patch 01/10 net/dpaa2: fix integer overflow in CCSR region mapping
Info:
PAGE_SIZE and PAGE_MASK in dpaa2_recycle.c are now unused.
PATCH 11/11 net/dpaa2: rename Rx queue flags
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
Rename the Rx-side device flags to a consistent DPAA2_RX_*_FLAG naming:DPAAX_RX_ERROR_QUEUE_FLAG becomes DPAA2_RX_ERROR_QUEUE_FLAG and DPAA2_DATA_STASHING_OFF becomes DPAA2_RX_DATA_STASHING_OFF_FLAG.
This is a mechanical rename with no functional change.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 10 +++++----- drivers/net/dpaa2/dpaa2_ethdev.h | 6 ++++-- drivers/net/dpaa2/dpaa2_rxtx.c | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +5 -5
@@ -550,7 +550,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) goto fail; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { priv->rx_err_vq =rte_zmalloc ("dpni_rx_err" ,sizeof (struct dpaa2_queue ),0 );if (!priv->rx_err_vq) {
@@ -1041,7 +1041,7 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, options |=DPNI_QUEUE_OPT_FLC ; cfg.flc.stash_control = true;dpaa2_flc_stashing_clear_all (&cfg.flc.value); -if (priv->flags &DPAA2_DATA_STASHING_OFF ) { +if (priv->flags &DPAA2_RX_DATA_STASHING_OFF_FLAG ) {dpaa2_flc_stashing_set (DPAA2_FLC_DATA_STASHING ,0 , &cfg.flc.value); dpaa2_q->data_stashing_off =1 ;
@@ -1521,7 +1521,7 @@ dpaa2_dev_start(struct rte_eth_dev *dev) dpaa2_q->fqid = qid.fqid; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { ret =dpni_get_queue (dpni,CMD_PRI_LOW , priv->token,DPNI_QUEUE_RX_ERR ,0 ,0 , &cfg, &qid);if (ret) {
@@ -3475,7 +3475,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)if (dpaa2_get_devargs (dev->devargs,DRIVER_NO_DATA_STASHING ) ||getenv ("DPAA2_DATA_STASHING_OFF" )) { - priv->flags |=DPAA2_DATA_STASHING_OFF ; + priv->flags |=DPAA2_RX_DATA_STASHING_OFF_FLAG ;DPAA2_PMD_INFO ("Data stashing disabled" ); }
@@ -3581,7 +3581,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) }if (dpaa2_get_devargs (dev->devargs,DRIVER_ERROR_QUEUE )) { - priv->flags |=DPAAX_RX_ERROR_QUEUE_FLAG ; + priv->flags |=DPAA2_RX_ERROR_QUEUE_FLAG ;DPAA2_PMD_INFO ("Enable error queue" ); }
drivers/net/dpaa2/dpaa2_ethdev.h +4 -2
@@ -98,9 +98,11 @@#define DPAA2_TX_DYNAMIC_CONF_ENABLE RTE_BIT32(9)/* Disable data stashing (prefetch of packet data into CPU cache) */ -#define DPAA2_DATA_STASHING_OFF RTE_BIT32(10) +#define DPAA2_RX_DATA_STASHING_OFF_FLAG RTE_BIT32(10) -#define DPAAX_RX_ERROR_QUEUE_FLAG RTE_BIT32(11) +#define DPAA2_RX_ERROR_QUEUE_FLAG RTE_BIT32(11) + +#define DPAA2_RX_PRINT_PSR_RESULT_FLAG RTE_BIT32(12)/* DPDMUX index for DPMAC */ #define DPAA2_DPDMUX_DPMAC_IDX 0
drivers/net/dpaa2/dpaa2_rxtx.c +2 -2
@@ -831,7 +831,7 @@ dpaa2_dev_prefetch_rx_common(void *queue, struct rte_mbuf **bufs,if (!by_channel) {struct dpaa2_dev_priv *priv = eth_data->dev_private; -if (unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq); }
@@ -1096,7 +1096,7 @@ dpaa2_dev_rx_common(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;struct dpaa2_dev_priv *priv = eth_data->dev_private; -if (!by_channel &&unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (!by_channel &&unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq);if (by_channel) {
Signature · 1 line
2.43.0
Re: [PATCH v12-S2 00/11] net/dpaa2 updates
In reply to Prashant GuptaQuoted 5 lines · On Fri, 16 Oct 2026 12:33:28 +0530 Prashant Gupta <[email protected]>…
Changes in v12:
- Restore VXLANrte_flowitem documentation in dpaa2.ini to keep documentation aligned with PMD capabilities.
- Fix documentation check failure reported after application to next-net.
This is worse not better.
Subject: Re: [PATCH v12-S2 00/11] net/dpaa2: ...
Series applies cleanly to 26.11-rc1 and every commit builds with -Dwerror=true.
The doc-vs-code problem is not fixed, it is now hidden. Patch 10 removes VXLAN support but leaves "vxlan = Y" in the feature matrix. check-doc-vs-code.sh passes only because a stray RTE_FLOW_ITEM_TYPE_VXLAN reference survives in dpaa2_flow_item_convert().
Pre-existing, separate fix needed: dpaa2_flow_item_convert() allocates one item too few. For "eth / end" num ends at 1, rte_malloc() gets 1 * sizeof(item), then new_pattern[1] is written for the END marker. An empty pattern also reads pattern[1] past the end.
for (num = 0; pattern[num].type != RTE_FLOW_ITEM_TYPE_END; num++) ; new_pattern = rte_malloc(NULL, sizeof(*new_pattern) * (num + 1), RTE_CACHE_LINE_SIZE);
Patch 06/11 net/dpaa2: set default flow miss action per device
Error:
default_flow = min(fs_entries, dist_queues) - 1 is computed at probe from hardware attributes, but fs_miss_flow_id is a queue index inside the TC distribution, and dist_size is nb_rx_queues / num_rx_tc set at configure time. A DPNI with 16 queues where the app configures 4 Rx queues gets fs_miss_flow_id 15 with dist_size 4: either MC rejects dpni_set_rx_fs_dist() and every rte_flow create fails, or unmatched frames go to an unconfigured queue. The old default (0) was always valid. fs_entries is the FS table size, not a flow id, and should not be in this expression at all.
Compute it where dist_size is known and drop the priv field:
tc_cfg.enable = true; tc_cfg.fs_miss_flow_id = dist_size - 1;
Or keep 0. Either way the release note must say which queue gets unmatched frames.
Patch 07/11 net/dpaa2: identify Rx mbuf hash information by FLC
Warning:
Commit message says TC and flow id are stored via rte_mbuf_sched_set(); the code writes m->hash.fdir.hi. Fix the message.
RTE_MBUF_F_RX_FDIR_ID means hash.fdir.hi holds the id from a MARK action. This driver has no MARK action, so applications see a synthetic (tc << 16) | flow value as if it were a mark. Set only RTE_MBUF_F_RX_FDIR, or implement RTE_FLOW_ACTION_TYPE_MARK.
Patch 09/11 net/dpaa2: parse tunnel and fragmented packet types
Warning:
Parse summary 0x0001 was mapped to RTE_PTYPE_L3_IPV4_EXT (options present). Now it is L3_IPV4_EXT | L4_FRAG. The slow path treats options (L3_IP_1_OPT_PRESENT) and fragments (L3_IP_1_*_FRAGMENT) as independent bits, so one summary code cannot mean both. If 0x0001 is the fragment code, the mapping should be:
case DPAA2_PKT_TYPE_IPV4_EXT: m->packet_type = RTE_PTYPE_L2_ETHER | RTE_PTYPE_L3_IPV4 | RTE_PTYPE_L4_FRAG;
and the IPV4_EXT/IPV6_EXT names should be changed to match. If it is the options code, drop L4_FRAG.
Patch 10/11 net/dpaa2: remove unused soft parser driver
Error:
doc/guides/nics/features/dpaa2.ini still has "vxlan = Y". Commit message and release note both say the item is no longer advertised.
-vxlan = Y
The leftover VXLAN check in dpaa2_flow_item_convert() is what keeps the doc-vs-code script quiet. Remove it:
- if (pattern[num].type == RTE_FLOW_ITEM_TYPE_VXLAN) - tunnel_start = 1; - else if (tunnel_start) - new_pattern[num].in_tunnel = 1;
Error:
dpaa2_flow_create() does not call dpaa2_flow_validate(), and the default case in dpaa2_generic_flow_set() sets ret = -ENOTSUP and breaks out of the switch without leaving the loop; the action loop then overwrites ret. With the VXLAN/ECPRI cases removed, "eth / ipv4 / udp / vxlan / end actions queue index 1" now creates a rule matching all UDP. Fix before (or in) this patch:
default:
DPAA2_PMD_ERR("Invalid flow item[%d] type(%d)",
i, pattern[i].type);
ret = -ENOTSUP;
- break;
+ goto end_flow_set;Warning:
Removing the VXLAN/ECPRI cases in dpaa2_flow_extract_support() left two dead "break;" lines after the GRE case.
Leftovers from the removal:
dpaa2_ethdev.h: dpaa2_soft_parser_loaded() prototype dpaa2_ethdev.h: ss_offset, ss_iova, ss_param_iova in dpaa2_dev_priv dpaa2_ethdev.h: DPAA2_ECPRI_MAX_EXTRACT_NB
dpaa2_flow.c: #include <sys/mman.h>
Info:
With VXLAN gone nothing sets in_tunnel, so tunnel_start and every "if (dpaa2_pattern->in_tunnel)" branch in the configure handlers is dead. Fine as a follow-up.
Patch 11/11 net/dpaa2: rename Rx queue flags
Warning:
Commit message says mechanical rename, but it adds DPAA2_RX_PRINT_PSR_RESULT_FLAG, which nothing uses. Drop it.
Patch 01/11 net/dpaa2: fix integer overflow in CCSR region mapping
Warning:
Second paragraph of the commit message is wrong. For len 4096 on a 64K-page kernel the old code masked len to 0 and then bumped it to PAGE_SIZE, so the mapping did not fail. The real defect is that the old length ignored offset, so a region crossing a page boundary was not fully mapped. Since this goes to stable, the message should say that.
Info:
PAGE_SIZE and PAGE_MASK in dpaa2_recycle.c are now unused; remove.
Patch 03/11 net/dpaa2: support larger burst size
Info:
Limit for non-LX2160A (and LX2160A with dpni < 8.7) drops from 65536 to 0xF7FF. Mention that in the commit message. Write 0x37FFF instead of 229375 so it matches the fsl_dpni.h comment.
cover net/dpaa2 updates
In reply to Prashant GuptaChanges in v13:
- Fix CCSR region mapping commit message to describe the actual page-boundary mapping issue.
- Use the configured Rx distribution table size when selecting the default flow miss action.
- Remove incorrect RTE_MBUF_F_RX_FDIR_ID usage and update the associated commit message.
- Rename IPv4/IPv6 fragment parser summary definitions and report fragmented packets using RTE_PTYPE_L4_FRAG.
- Remove unused DPAA2_RX_PRINT_PSR_RESULT_FLAG.
- Drop "net/dpaa2: remove unused soft parser driver".
Series overview:
- fix an integer overflow in the CCSR region mapping,
- set Tx confirmation on device init and support a larger burst size,
- support MPLS and PPPoE flow distribution,
- support the flow drop action and a default flow miss action,
- identify Rx mbuf hash information by FLC and add minimum key size support,
- parse tunnel and fragmented packet types,
- rename Rx queue flags.
Gagandeep Singh (6):
net/dpaa2: set Tx confirmation on device init net/dpaa2: support larger burst size net/dpaa2: support MPLS and PPPoE flow distribution net/dpaa2: support flow drop action net/dpaa2: set default flow miss action per device net/dpaa2: identify Rx mbuf hash information by FLC
Hemant Agrawal (3):
net/dpaa2: fix integer overflow in CCSR region mapping net/dpaa2: add minimum key size support net/dpaa2: parse tunnel and fragmented packet types
Jun Yang (1):
net/dpaa2: rename Rx queue flags
doc/guides/nics/features/dpaa2.ini | 2 + doc/guides/rel_notes/release_26_11.rst | 4 + drivers/net/dpaa2/dpaa2_ethdev.c | 54 +++-- drivers/net/dpaa2/dpaa2_ethdev.h | 32 ++- drivers/net/dpaa2/dpaa2_flow.c | 281 +++++++++++++++++++++++-- drivers/net/dpaa2/dpaa2_recycle.c | 23 +- drivers/net/dpaa2/dpaa2_rxtx.c | 66 ++++-- drivers/net/dpaa2/dpaa2_tm.c | 16 +- drivers/net/dpaa2/mc/dpni.c | 11 +- drivers/net/dpaa2/mc/fsl_dpni.h | 8 +- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 +- 11 files changed, 413 insertions(+), 87 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/10 net/dpaa2: fix integer overflow in CCSR region mapping
From: Hemant Agrawal <[email protected]>
In lsx_ccsr_map_region(), PAGE_SIZE is defined as sysconf(_SC_PAGESIZE), which returns a signed long and may be negative on error. The value was used directly in size_t comparisons and mmap() length calculations, leading to an integer overflow (Coverity CID 49765682).
The old code also computed the mapping length without taking the address offset within the page into account. As a result, regions crossing a page boundary might not be fully mapped. The mapping size must cover the entire range from the page-aligned start address through offset + len.
Fix by validating the page size returned by sysconf(), deriving the page mask from the validated value, and using RTE_ALIGN_CEIL(offset + len, page_size) to calculate the mapping length.
Coverity issue: 49765682
--- drivers/net/dpaa2/dpaa2_recycle.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/net/dpaa2/dpaa2_recycle.c +15 -8
@@ -176,6 +176,9 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)void *tmp;uint64_t start;uint64_t offset; +uint64_t page_mask; +long page_size; +size_t map_len; fd =open ("/dev/mem" ,O_RDWR );if (fd <0 ) {
@@ -183,20 +186,24 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)return NULL ; } - start = addr &PAGE_MASK ; + page_size =sysconf (_SC_PAGESIZE); +if (page_size <=0 ) { +close (fd); +return NULL ; + } + page_mask = ~((uint64_t )page_size -1 ); + start = addr & page_mask; offset = addr - start; - len = len &PAGE_MASK ; -if (len < (size_t )PAGE_SIZE ) - len =PAGE_SIZE ; + map_len =RTE_ALIGN_CEIL (offset + len, (size_t )page_size); - tmp =mmap (NULL , len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start); + tmp =mmap (NULL , map_len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start);close (fd); -if (tmp !=MAP_FAILED ) -return (uint8_t *)tmp + offset; -else +if (tmp ==MAP_FAILED )return NULL ; + +return (uint8_t *)tmp + offset; }static const uint8_t ls_sd1_prot_idx_map[] = {
Signature · 1 line
2.43.0
PATCH 2/10 net/dpaa2: set Tx confirmation on device init
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Move TX confirmation mode setting from TXQ setup to device initialization because TXQ0 is not always set up by the user.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 40 ++++++++++++-------------------- 1 file changed, 15 insertions(+), 25 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +15 -25
@@ -1153,7 +1153,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,struct dpni_queue tx_conf_cfg;struct dpni_queue tx_flow_cfg;uint8_t options =0 , flow_id; -uint8_t ceetm_ch_idx;uint16_t channel_id;struct dpni_queue_id qid;uint32_t tc_id;
@@ -1174,30 +1173,6 @@ dpaa2_dev_tx_queue_setup(struct rte_eth_dev *dev,memset (&tx_conf_cfg,0 ,sizeof (struct dpni_queue ));memset (&tx_flow_cfg,0 ,sizeof (struct dpni_queue )); -if (!tx_queue_id) { -for (ceetm_ch_idx =0 ; - ceetm_ch_idx <= (priv->num_channels -1 ); - ceetm_ch_idx++) { -/*Set tx-conf and error configuration*/ -if (priv->flags &DPAA2_TX_CONF_ENABLE ) { - ret =dpni_set_tx_confirmation_mode (dpni, -CMD_PRI_LOW , priv->token, - ceetm_ch_idx, -DPNI_CONF_AFFINE ); - }else { - ret =dpni_set_tx_confirmation_mode (dpni, -CMD_PRI_LOW , priv->token, - ceetm_ch_idx, -DPNI_CONF_DISABLE ); - } -if (ret) { -DPAA2_PMD_ERR ("Error(%d) in tx conf setting" , - ret); -return ret; - } - } - } - tc_id = tx_queue_id % priv->num_tx_tc; channel_id = (uint8_t )(tx_queue_id / priv->num_tx_tc) % priv->num_channels; flow_id =0 ;
@@ -3621,6 +3596,21 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) goto init_err; } +for (i =0 ; i < priv->num_channels; i++) { +/*Set tx-conf and error configuration*/ +if (priv->flags &DPAA2_TX_CONF_ENABLE ) { + ret =dpni_set_tx_confirmation_mode (dpni_dev, +CMD_PRI_LOW , priv->token, i,DPNI_CONF_AFFINE ); + }else { + ret =dpni_set_tx_confirmation_mode (dpni_dev, +CMD_PRI_LOW , priv->token, i,DPNI_CONF_DISABLE ); + } +if (ret) { +DPAA2_PMD_ERR ("Error(%d) in tx conf setting" , ret); + goto init_err; + } + } +/* Allocate memory for storing MAC addresses. * Table of mac_filter_entries size is allocated so that RTE ether lib * can add MAC entries when rte_eth_dev_mac_addr_add is called.
Signature · 1 line
2.43.0
PATCH 3/10 net/dpaa2: support larger burst size
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Make burst size checks and MC command fields SoC-aware, enabling bursts larger than 64K on LX2160A with dpni version 8.7+.
The max_burst_size field in dpni_tx_shaping_cfg is widened to uint32_t and the MC command struct is updated to split the value across two 16-bit fields using the new DPNI_BURST_LO/HI macros.
--- drivers/net/dpaa2/dpaa2_tm.c | 16 +++++++++++----- drivers/net/dpaa2/mc/dpni.c | 11 +++++++++-- drivers/net/dpaa2/mc/fsl_dpni.h | 8 ++++++-- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 ++- 4 files changed, 28 insertions(+), 10 deletions(-)
drivers/net/dpaa2/dpaa2_tm.c +11 -5
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright 2020-2024 NXP +* Copyright 2020-2026 NXP */ #include <rte_ethdev.h>
@@ -10,14 +10,20 @@#include "dpaa2_pmd_logs.h" #include <dpaa2_hw_dpio.h> -#define DPAA2_BURST_MAX (64 * 1024) -#define DPAA2_SHAPER_MIN_RATE 0#define DPAA2_SHAPER_MAX_RATE 107374182400ull#define DPAA2_WEIGHT_MAX 24701#define DPAA2_PKT_ADJUST_LEN_MIN 0#define DPAA2_PKT_ADJUST_LEN_MAX 0x7ff +static inline uint32_t dpaa2_get_burst_max (struct dpaa2_dev_priv *priv) +{ +if (dpaa2_dev_cmp_dpni_ver (priv,8 ,7 ) >=0 ) +return (dpaa2_svr_family ==SVR_LX2160A ) ?229375 :0xF7FF ; + +return 0xF7FF ; +} +int dpaa2_tm_init (struct rte_eth_dev *dev) {
@@ -283,7 +289,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE , NULL, "committed rate is out of range\n"); -if (params->committed.size >DPAA2_BURST_MAX ) +if (params->committed.size >dpaa2_get_burst_max (priv))return -rte_tm_error_set (error,EINVAL ,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE ,NULL ,"committed size is out of range\n" );
@@ -293,7 +299,7 @@ dpaa2_shaper_profile_add(struct rte_eth_dev *dev, uint32_t shaper_profile_id,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_RATE , NULL, "Peak rate is out of range\n"); -if (params->peak.size >DPAA2_BURST_MAX ) +if (params->peak.size >dpaa2_get_burst_max (priv))return -rte_tm_error_set (error,EINVAL ,RTE_TM_ERROR_TYPE_SHAPER_PROFILE_PEAK_SIZE ,NULL ,"Peak size is out of range\n" );
drivers/net/dpaa2/mc/dpni.c +9 -2
@@ -1106,6 +1106,7 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io, {struct dpni_cmd_set_tx_shaping *cmd_params;struct mc_command cmd = {0 }; +uint32_t tx_cr_burst, tx_er_burst;int coupled, lni_shaper;uint8_t channel_id;uint16_t oal;
@@ -1115,10 +1116,16 @@ int dpni_set_tx_shaping(struct fsl_mc_io *mc_io, cmd_flags, token); cmd_params = (struct dpni_cmd_set_tx_shaping *)cmd.params; + tx_cr_burst = tx_cr_shaper->max_burst_size; + tx_er_burst = tx_er_shaper->max_burst_size; cmd_params->tx_cr_max_burst_size = -cpu_to_le16 (tx_cr_shaper->max_burst_size); +cpu_to_le16 (DPNI_BURST_LO (tx_cr_burst)); cmd_params->tx_er_max_burst_size = -cpu_to_le16 (tx_er_shaper->max_burst_size); +cpu_to_le16 (DPNI_BURST_LO (tx_er_burst)); + cmd_params->tx_cr_max_burst_size_hi = +cpu_to_le16 (DPNI_BURST_HI (tx_cr_burst)); + cmd_params->tx_er_max_burst_size_hi = +cpu_to_le16 (DPNI_BURST_HI (tx_er_burst)); cmd_params->tx_cr_rate_limit =cpu_to_le32 (tx_cr_shaper->rate_limit); cmd_params->tx_er_rate_limit =
drivers/net/dpaa2/mc/fsl_dpni.h +6 -2
@@ -830,14 +830,18 @@ int dpni_get_link_state(struct fsl_mc_io *mc_io,uint16_t token, struct dpni_link_state *state); +#define DPNI_BURST_LO (burst) ((burst) & GENMASK(15, 0)) +#define DPNI_BURST_HI (burst) ((burst) >> 16) +/** * struct dpni_tx_shaping - Structure representing DPNI tx shaping configuration * @rate_limit: Rate in Mbits/s -* @max_burst_size: Burst size in bytes (up to 64KB) +* @max_burst_size: Burst size in bytes. Limits depend on the SoC (0x37FFF +* for LX2160A, 0xF7FF for all others) */ struct dpni_tx_shaping_cfg {uint32_t rate_limit; -uint16_t max_burst_size; +uint32_t max_burst_size; };/**
drivers/net/dpaa2/mc/fsl_dpni_cmd.h +2 -1
@@ -394,7 +394,8 @@ struct dpni_rsp_get_link_state {struct dpni_cmd_set_tx_shaping {uint16_t tx_cr_max_burst_size;uint16_t tx_er_max_burst_size; -uint32_t pad; +uint16_t tx_cr_max_burst_size_hi; +uint16_t tx_er_max_burst_size_hi;uint32_t tx_cr_rate_limit;uint32_t tx_er_rate_limit;/* from LSB: coupled:1, lni_shaper: 1*/
Signature · 1 line
2.43.0
PATCH 4/10 net/dpaa2: support MPLS and PPPoE flow distribution
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add rte_flow pattern support for MPLS and PPPoE items in the dpaa2 PMD flow engine.
For a pattern with no spec/mask, the frame is identified by its Frame Attribute Flag (FAF_MPLS_FRAM / FAF_PPPOE_PPP_FRAM) for both the QoS and flow steering tables. When a spec is present, the MPLS label (NH_FLD_MPLS_MPLSL_1) or the PPPoE session id (NH_FLD_PPPOE_SID) is added as a header extract rule for both tables.
NH_FLD_MPLS_MPLSL_1 with DPKG_FULL_FIELD causes MC to extract the full 4-byte MPLS LSE (label + TC + S + TTL). The original code passed sizeof(label_tc_s) = 3, so the driver key profile recorded the field as 3 bytes while MC placed 4 bytes in the key; any extract field added after MPLS was off by one byte, corrupting the key layout.
Fix by passing the full struct rte_flow_item_mpls pointer (spec/mask) with sizeof(*mask) = 4, so the key profile width matches the 4-byte field that MC extracts. The TTL byte has mask 0x00 in the default mask and is ignored for matching purposes.
--- doc/guides/nics/features/dpaa2.ini | 2 + drivers/net/dpaa2/dpaa2_flow.c | 196 +++++++++++++++++++++++++++++ 2 files changed, 198 insertions(+)
doc/guides/nics/features/dpaa2.ini +2 -0
@@ -43,6 +43,8 @@ gtp = Y icmp = Y ipv4 = Y ipv6 = Y +mpls = Y +pppoes = Y raw = Y sctp = Y tcp = Y
drivers/net/dpaa2/dpaa2_flow.c +196 -0
228 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 5/10 net/dpaa2: support flow drop action
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Add support for the RTE_FLOW_ACTION_TYPE_DROP action in the dpaa2 flow engine. A flow rule with a drop action is programmed into the flow steering (FS) table with the DPNI_FS_OPT_DISCARD option so that matching frames are discarded by hardware.
The drop action is added to the supported action list, accepted during action verification, configured in the FS action path, handled in the generic flow-set action loop, and cleaned up in the flow destroy path.
--- drivers/net/dpaa2/dpaa2_flow.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/net/dpaa2/dpaa2_flow.c +7 -1
@@ -97,7 +97,8 @@ enum rte_flow_action_type dpaa2_supported_action_type[] = {RTE_FLOW_ACTION_TYPE_QUEUE ,RTE_FLOW_ACTION_TYPE_PORT_ID ,RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT , - RTE_FLOW_ACTION_TYPE_RSS +RTE_FLOW_ACTION_TYPE_RSS , + RTE_FLOW_ACTION_TYPE_DROP };#ifndef __cplusplus
@@ -4421,6 +4422,7 @@ dpaa2_flow_verify_action(struct dpaa2_dev_priv *priv,break ;case RTE_FLOW_ACTION_TYPE_PF :/* Skip this action, have to add for vxlan */ +case RTE_FLOW_ACTION_TYPE_DROP :break ;case RTE_FLOW_ACTION_TYPE_END : end_of_list =1 ;
@@ -4468,6 +4470,8 @@ dpaa2_configure_flow_fs_action(struct dpaa2_dev_priv *priv, flow->fs_action_cfg.redirect_obj_token = dest_priv->token; flow->fs_action_cfg.flow_id = dest_q->flow_id; + }else if (flow->action_type ==RTE_FLOW_ACTION_TYPE_DROP ) { + flow->fs_action_cfg.options =DPNI_FS_OPT_DISCARD ; }return 0 ;
@@ -4945,6 +4949,7 @@ dpaa2_generic_flow_set(struct dpaa2_dev_flow *flow,case RTE_FLOW_ACTION_TYPE_QUEUE :case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT :case RTE_FLOW_ACTION_TYPE_PORT_ID : +case RTE_FLOW_ACTION_TYPE_DROP : ret =dpaa2_configure_flow_fs_action (priv, flow, &actions[j]);if (ret)
@@ -5346,6 +5351,7 @@ dpaa2_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *_flow,case RTE_FLOW_ACTION_TYPE_QUEUE :case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT :case RTE_FLOW_ACTION_TYPE_PORT_ID : +case RTE_FLOW_ACTION_TYPE_DROP :if (priv->num_rx_tc >1 ) {/* Remove entry from QoS table first */ ret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW,
Signature · 1 line
2.43.0
PATCH 6/10 net/dpaa2: set default flow miss action per device
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
Remove the DPAA2_FLOW_CONTROL_MISS_FLOW environment variable and use the last entry in the configured Rx distribution table as the default flow steering miss action.
Users who relied on the environment variable must use the rte_flow API instead.
--- doc/guides/rel_notes/release_26_11.rst | 4 ++++ drivers/net/dpaa2/dpaa2_flow.c | 14 +------------- 2 files changed, 5 insertions(+), 13 deletions(-)
doc/guides/rel_notes/release_26_11.rst +4 -0
@@ -105,6 +105,10 @@ New Features * Added the inner IP header to the RSS hash so tunneled traffic is distributed across the Rx queues. + * Removed ``DPAA2_FLOW_CONTROL_MISS_FLOW`` environment variable. The + per-device FS table miss flow id now defaults to the lowest-priority + flow of the device. Users who previously redirected unmatched frames + to a specific queue via this variable must use the rte_flow API instead. * **Updated NXP ENETC4 PMD.**
drivers/net/dpaa2/dpaa2_flow.c +1 -13
@@ -24,7 +24,6 @@#include <dpaa2_pmd_logs.h> static char *dpaa2_flow_control_log; -static uint16_t dpaa2_flow_miss_flow_id;/* Default miss flow id is 0. */ static int dpaa2_sp_loaded =-1 ;enum dpaa2_flow_entry_size {
@@ -4590,7 +4589,7 @@ dpaa2_configure_fs_rss_table(struct dpaa2_dev_priv *priv,return 0 ; tc_cfg.enable = true; - tc_cfg.fs_miss_flow_id = dpaa2_flow_miss_flow_id; + tc_cfg.fs_miss_flow_id = dist_size -1 ; ret =dpni_set_rx_fs_dist (dpni,CMD_PRI_LOW , priv->token, &tc_cfg);if (ret <0 ) {
@@ -5224,17 +5223,6 @@ dpaa2_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, dpaa2_flow_control_log =getenv ("DPAA2_FLOW_CONTROL_LOG" ); -if (getenv ("DPAA2_FLOW_CONTROL_MISS_FLOW" )) { - dpaa2_flow_miss_flow_id = - (uint16_t )atoi (getenv ("DPAA2_FLOW_CONTROL_MISS_FLOW" )); -if (dpaa2_flow_miss_flow_id >= priv->dist_queues) { -DPAA2_PMD_ERR ("Missed flow ID %d >= dist size(%d)" , - dpaa2_flow_miss_flow_id, - priv->dist_queues); -return NULL ; - } - } - flow =rte_zmalloc (NULL ,sizeof (struct dpaa2_dev_flow ),RTE_CACHE_LINE_SIZE );if (!flow) {
Signature · 1 line
2.43.0
PATCH 7/10 net/dpaa2: identify Rx mbuf hash information by FLC
In reply to Prashant GuptaFrom: Gagandeep Singh <[email protected]>
For default RSS distribution, the mbuf is marked with RTE_MBUF_F_RX_RSS_HASH and the hash value is taken from the high word of FLC.
Configure flow steering actions with FLC enabled to align the stashing settings with the RSS configuration. The TC ID and flow ID are packed into the FLC low word by the hardware. An Rx mbuf received from the FS table has the FS_MARK bit set in the FLC low word; such mbufs are marked with RTE_MBUF_F_RX_FDIR and the TC and flow ID are encoded in hash.fdir.hi.
--- drivers/net/dpaa2/dpaa2_ethdev.h | 12 +++++++++ drivers/net/dpaa2/dpaa2_flow.c | 42 ++++++++++++++++++++++++++++++++ drivers/net/dpaa2/dpaa2_rxtx.c | 18 ++++++++++++-- 3 files changed, 70 insertions(+), 2 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.h +12 -0
@@ -282,6 +282,18 @@ enum dpaa2_ecpri_fafe_type {/* ECPRI shares SP context with VXLAN*/ #define DPAA2_ECPRI_MSG_OFFSET DPAA2_VXLAN_VNI_OFFSET +#define DPAA2_FS_FLC_FS_MARK_OFFSET \ + (DPAA2_FLC_DATA_STASHING + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_OFFSET \ + (DPAA2_FS_FLC_FS_MARK_OFFSET + DPAA2_FLC_STASHING_MAX_BIT_SIZE) + +#define DPAA2_FS_FLC_TC_BIT_SIZE (sizeof(uint8_t) * 8) +#define DPAA2_FS_FLC_TC_MASK ((1 << DPAA2_FS_FLC_TC_BIT_SIZE) - 1) + +#define DPAA2_FS_FLC_FLOW_OFFSET \ + (DPAA2_FS_FLC_TC_OFFSET + DPAA2_FS_FLC_TC_BIT_SIZE) +#define DPAA2_ECPRI_MAX_EXTRACT_NB 8struct ipv4_sd_addr_extract_rule {
drivers/net/dpaa2/dpaa2_flow.c +42 -0
61 lines not on this page · raw message
drivers/net/dpaa2/dpaa2_rxtx.c +16 -2
@@ -58,6 +58,7 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,uint16_t frc =DPAA2_GET_FD_FRC_PARSE_SUM (fd);struct dpaa2_annot_hdr *annotation = (struct dpaa2_annot_hdr *)hw_annot_addr; +uint32_t flc_lo, tc, flow;if (unlikely (dpaa2_print_parser_result))dpaa2_print_parse_result (annotation);
@@ -118,8 +119,21 @@ dpaa2_dev_rx_parse_new(struct rte_mbuf *m, const struct qbman_fd *fd,default : m->packet_type =dpaa2_dev_rx_parse_slow (m, annotation); } - m->hash.rss = fd->simple.flc_hi; - m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; + flc_lo = fd->simple.flc_lo; +if (flc_lo & (1 <<DPAA2_FS_FLC_FS_MARK_OFFSET )) { + tc = (flc_lo >>DPAA2_FS_FLC_TC_OFFSET ) & +DPAA2_FS_FLC_TC_MASK ; + flow = flc_lo >>DPAA2_FS_FLC_FLOW_OFFSET ; + m->ol_flags |=RTE_MBUF_F_RX_FDIR ; + m->hash.fdir.hi = (tc <<16 ) | flow; +DPAA2_PMD_DP_DEBUG ("FS frame received from TC[%d]->flow%d" , + tc, flow); + }else { + m->hash.rss = fd->simple.flc_hi; + m->ol_flags |=RTE_MBUF_F_RX_RSS_HASH ; +DPAA2_PMD_DP_DEBUG ("Hash frame received with RSS(%08x)" , + m->hash.rss); + }if (dpaa2_enable_ts[m->port]) { *dpaa2_timestamp_dynfield (m) = annotation->word2;
Signature · 1 line
2.43.0
PATCH 8/10 net/dpaa2: add minimum key size support
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
The default size for a QoS key is 24 bytes. If the key size is smaller than the maximum, use the default (minimum) key size instead of always returning the maximum size (56 bytes). This allows smaller flow tables to be used when the extracted key fits within the default size.
Support for 24-byte QoS key entries is available from DPNI version 8.7 onwards. For older DPNI versions, the existing 56-byte entry size is retained to maintain compatibility.
--- drivers/net/dpaa2/dpaa2_flow.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/net/dpaa2/dpaa2_flow.c +12 -9
@@ -26,8 +26,11 @@static char *dpaa2_flow_control_log;static int dpaa2_sp_loaded =-1 ; +/* Default size of a key */ +#define DPNI_DEFAULT_KEY_SIZE 24 +enum dpaa2_flow_entry_size { -DPAA2_FLOW_ENTRY_MIN_SIZE = (DPNI_MAX_KEY_SIZE /2 ), +DPAA2_FLOW_ENTRY_MIN_SIZE =DPNI_DEFAULT_KEY_SIZE ,DPAA2_FLOW_ENTRY_MAX_SIZE =DPNI_MAX_KEY_SIZE };
@@ -4519,7 +4522,7 @@ dpaa2_configure_flow_fs_action(struct dpaa2_dev_priv *priv, }static inline uint16_t -dpaa2_flow_entry_size (uint16_t key_max_size) +dpaa2_flow_entry_size (struct dpaa2_dev_priv *priv,uint16_t key_max_size) {if (key_max_size >DPAA2_FLOW_ENTRY_MAX_SIZE ) { DPAA2_PMD_ERR("Key size(%d) > max(%d)",
@@ -4529,11 +4532,11 @@ dpaa2_flow_entry_size(uint16_t key_max_size)return 0 ; } -if (key_max_size >DPAA2_FLOW_ENTRY_MIN_SIZE ) +if (key_max_size >DPAA2_FLOW_ENTRY_MIN_SIZE || +dpaa2_dev_cmp_dpni_ver (priv,8 ,7 ) <0 )return DPAA2_FLOW_ENTRY_MAX_SIZE ; -/* Current MC only support fixed entry size(56)*/ -return DPAA2_FLOW_ENTRY_MAX_SIZE ; +return DPAA2_FLOW_ENTRY_MIN_SIZE ; } static inline int
@@ -4595,7 +4598,7 @@ dpaa2_configure_fs_rss_table(struct dpaa2_dev_priv *priv, } key_max_size = tc_extract->key_profile.key_max_size; - entry_size =dpaa2_flow_entry_size (key_max_size); + entry_size =dpaa2_flow_entry_size (priv, key_max_size);dpaa2_flow_fs_extracts_log (priv, tc_id); ret = dpkg_prepare_key_cfg(&tc_extract->dpkg,
@@ -4686,7 +4689,7 @@ dpaa2_configure_qos_table(struct dpaa2_dev_priv *priv, } key_max_size = qos_extract->key_profile.key_max_size; - entry_size =dpaa2_flow_entry_size (key_max_size); + entry_size =dpaa2_flow_entry_size (priv, key_max_size);dpaa2_flow_qos_extracts_log (priv);
@@ -4977,11 +4980,11 @@ dpaa2_generic_flow_set(struct dpaa2_dev_flow *flow, qos_key_extract = &priv->extract.qos_key_extract; key_size = qos_key_extract->key_profile.key_max_size; - flow->qos_rule.key_size =dpaa2_flow_entry_size (key_size); + flow->qos_rule.key_size =dpaa2_flow_entry_size (priv, key_size); tc_key_extract = &priv->extract.tc_key_extract[flow->tc_id]; key_size = tc_key_extract->key_profile.key_max_size; - flow->fs_rule.key_size =dpaa2_flow_entry_size (key_size); + flow->fs_rule.key_size =dpaa2_flow_entry_size (priv, key_size);/* Let's parse action on matching traffic */ end_of_list =0 ;
Signature · 1 line
2.43.0
PATCH 9/10 net/dpaa2: parse tunnel and fragmented packet types
In reply to Prashant GuptaFrom: Hemant Agrawal <[email protected]>
Extend dpaa2_dev_rx_parse_new() (LX2160A FRC fast path) to identify IPv4/IPv6 fragmented packets, IPsec ESP, and GTP-U/GTP-C packets.
Map the corresponding parser summary values to DPDK packet types. Fragmented IPv4/IPv6 packets are reported with RTE_PTYPE_L4_FRAG. GTP-U and GTP-C packets are additionally marked with RTE_PTYPE_L4_UDP to reflect the UDP transport used by the outer tunnel header.
Advertise the newly supported packet types through dpaa2_supported_ptypes_get().
--- drivers/net/dpaa2/dpaa2_ethdev.c | 4 +++ drivers/net/dpaa2/dpaa2_ethdev.h | 20 ++++++++++++--- drivers/net/dpaa2/dpaa2_rxtx.c | 44 ++++++++++++++++++++++++++------ 3 files changed, 56 insertions(+), 12 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +4 -0
@@ -1371,6 +1371,10 @@ dpaa2_supported_ptypes_get(struct rte_eth_dev *dev, size_t *no_of_elements)RTE_PTYPE_L4_UDP ,RTE_PTYPE_L4_SCTP ,RTE_PTYPE_L4_ICMP , +RTE_PTYPE_L4_FRAG , +RTE_PTYPE_TUNNEL_ESP , +RTE_PTYPE_TUNNEL_GTPU , + RTE_PTYPE_TUNNEL_GTPC, }; if (dev->rx_pkt_burst == dpaa2_dev_prefetch_rx ||
drivers/net/dpaa2/dpaa2_ethdev.h +16 -4
@@ -127,9 +127,9 @@#define DPAA2_PKT_TYPE_ETHER 0x0060#define DPAA2_PKT_TYPE_IPV4 0x0000#define DPAA2_PKT_TYPE_IPV6 0x0020 -#define DPAA2_PKT_TYPE_IPV4_EXT \ +#define DPAA2_PKT_TYPE_IPV4_FRAG \ (0x0001 | DPAA2_PKT_TYPE_IPV4) -#define DPAA2_PKT_TYPE_IPV6_EXT \ +#define DPAA2_PKT_TYPE_IPV6_FRAG \ (0x0001 | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_IPV4_TCP \ (0x000e | DPAA2_PKT_TYPE_IPV4)
@@ -144,9 +144,21 @@#define DPAA2_PKT_TYPE_IPV6_SCTP \ (0x000f | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_IPV4_ICMP \ - (0x0003 | DPAA2_PKT_TYPE_IPV4_EXT) + (0x0003 | DPAA2_PKT_TYPE_IPV4_FRAG)#define DPAA2_PKT_TYPE_IPV6_ICMP \ - (0x0003 | DPAA2_PKT_TYPE_IPV6_EXT) + (0x0003 | DPAA2_PKT_TYPE_IPV6_FRAG) +#define DPAA2_PKT_TYPE_IPV4_ESP \ + (0x0005 | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_ESP \ + (0x0005 | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPU \ + (0x0014 | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPU \ + (0x0014 | DPAA2_PKT_TYPE_IPV6) +#define DPAA2_PKT_TYPE_IPV4_GTPC \ + (0x0015 | DPAA2_PKT_TYPE_IPV4) +#define DPAA2_PKT_TYPE_IPV6_GTPC \ + (0x0015 | DPAA2_PKT_TYPE_IPV6)#define DPAA2_PKT_TYPE_VLAN_1 0x0160#define DPAA2_PKT_TYPE_VLAN_2 0x0260
drivers/net/dpaa2/dpaa2_rxtx.c +36 -8
56 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH 10/10 net/dpaa2: rename Rx queue flags
In reply to Prashant GuptaFrom: Jun Yang <[email protected]>
Rename the Rx-side device flags to a consistent DPAA2_RX_*_FLAG naming:DPAAX_RX_ERROR_QUEUE_FLAG becomes DPAA2_RX_ERROR_QUEUE_FLAG and DPAA2_DATA_STASHING_OFF becomes DPAA2_RX_DATA_STASHING_OFF_FLAG.
This is a mechanical rename with no functional change.
--- drivers/net/dpaa2/dpaa2_ethdev.c | 10 +++++----- drivers/net/dpaa2/dpaa2_ethdev.h | 4 ++-- drivers/net/dpaa2/dpaa2_rxtx.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-)
drivers/net/dpaa2/dpaa2_ethdev.c +5 -5
@@ -551,7 +551,7 @@ dpaa2_alloc_rx_tx_queues(struct rte_eth_dev *dev) goto fail; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { priv->rx_err_vq =rte_zmalloc ("dpni_rx_err" ,sizeof (struct dpaa2_queue ),0 );if (!priv->rx_err_vq) {
@@ -1042,7 +1042,7 @@ dpaa2_dev_rx_queue_setup(struct rte_eth_dev *dev, options |=DPNI_QUEUE_OPT_FLC ; cfg.flc.stash_control = true;dpaa2_flc_stashing_clear_all (&cfg.flc.value); -if (priv->flags &DPAA2_DATA_STASHING_OFF ) { +if (priv->flags &DPAA2_RX_DATA_STASHING_OFF_FLAG ) {dpaa2_flc_stashing_set (DPAA2_FLC_DATA_STASHING ,0 , &cfg.flc.value); dpaa2_q->data_stashing_off =1 ;
@@ -1522,7 +1522,7 @@ dpaa2_dev_start(struct rte_eth_dev *dev) dpaa2_q->fqid = qid.fqid; } -if (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG ) { +if (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ) { ret =dpni_get_queue (dpni,CMD_PRI_LOW , priv->token,DPNI_QUEUE_RX_ERR ,0 ,0 , &cfg, &qid);if (ret) {
@@ -3476,7 +3476,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)if (dpaa2_get_devargs (dev->devargs,DRIVER_NO_DATA_STASHING ) ||getenv ("DPAA2_DATA_STASHING_OFF" )) { - priv->flags |=DPAA2_DATA_STASHING_OFF ; + priv->flags |=DPAA2_RX_DATA_STASHING_OFF_FLAG ;DPAA2_PMD_INFO ("Data stashing disabled" ); }
@@ -3580,7 +3580,7 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev) }if (dpaa2_get_devargs (dev->devargs,DRIVER_ERROR_QUEUE )) { - priv->flags |=DPAAX_RX_ERROR_QUEUE_FLAG ; + priv->flags |=DPAA2_RX_ERROR_QUEUE_FLAG ;DPAA2_PMD_INFO ("Enable error queue" ); }
drivers/net/dpaa2/dpaa2_ethdev.h +2 -2
@@ -98,9 +98,9 @@#define DPAA2_TX_DYNAMIC_CONF_ENABLE RTE_BIT32(9)/* Disable data stashing (prefetch of packet data into CPU cache) */ -#define DPAA2_DATA_STASHING_OFF RTE_BIT32(10) +#define DPAA2_RX_DATA_STASHING_OFF_FLAG RTE_BIT32(10) -#define DPAAX_RX_ERROR_QUEUE_FLAG RTE_BIT32(11) +#define DPAA2_RX_ERROR_QUEUE_FLAG RTE_BIT32(11)/* DPDMUX index for DPMAC */ #define DPAA2_DPDMUX_DPMAC_IDX 0
drivers/net/dpaa2/dpaa2_rxtx.c +2 -2
@@ -829,7 +829,7 @@ dpaa2_dev_prefetch_rx_common(void *queue, struct rte_mbuf **bufs,if (!by_channel) {struct dpaa2_dev_priv *priv = eth_data->dev_private; -if (unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq); }
@@ -1094,7 +1094,7 @@ dpaa2_dev_rx_common(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;struct dpaa2_dev_priv *priv = eth_data->dev_private; -if (!by_channel &&unlikely (priv->flags &DPAAX_RX_ERROR_QUEUE_FLAG )) +if (!by_channel &&unlikely (priv->flags &DPAA2_RX_ERROR_QUEUE_FLAG ))dump_err_pkts (priv->rx_err_vq);if (by_channel) {
Signature · 1 line
2.43.0
cover net/dpaa2 updates
In reply to Prashant GuptaChanges in v14:
- Use the last Rx queue configured in each traffic class as the default flow steering miss queue.
- Update the release note accordingly.
Series overview:
- fix an integer overflow in the CCSR region mapping,
- set Tx confirmation on device init and support a larger burst size,
- support MPLS and PPPoE flow distribution,
- support the flow drop action and a default flow miss action,
- identify Rx mbuf hash information by FLC and add minimum key size support,
- parse tunnel and fragmented packet types,
- rename Rx queue flags.
Gagandeep Singh (6):
net/dpaa2: set Tx confirmation on device init net/dpaa2: support larger burst size net/dpaa2: support MPLS and PPPoE flow distribution net/dpaa2: support flow drop action net/dpaa2: set default flow miss action per device net/dpaa2: identify Rx mbuf hash information by FLC
Hemant Agrawal (3):
net/dpaa2: fix integer overflow in CCSR region mapping net/dpaa2: add minimum key size support net/dpaa2: parse tunnel and fragmented packet types
Jun Yang (1):
net/dpaa2: rename Rx queue flags
doc/guides/nics/features/dpaa2.ini | 2 + doc/guides/rel_notes/release_26_11.rst | 5 + drivers/net/dpaa2/dpaa2_ethdev.c | 54 +++-- drivers/net/dpaa2/dpaa2_ethdev.h | 36 +++- drivers/net/dpaa2/dpaa2_flow.c | 285 +++++++++++++++++++++++-- drivers/net/dpaa2/dpaa2_recycle.c | 23 +- drivers/net/dpaa2/dpaa2_rxtx.c | 66 ++++-- drivers/net/dpaa2/dpaa2_tm.c | 16 +- drivers/net/dpaa2/mc/dpni.c | 11 +- drivers/net/dpaa2/mc/fsl_dpni.h | 8 +- drivers/net/dpaa2/mc/fsl_dpni_cmd.h | 3 +- 11 files changed, 420 insertions(+), 89 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/10 net/dpaa2: fix integer overflow in CCSR region mapping
From: Hemant Agrawal <[email protected]>
In lsx_ccsr_map_region(), PAGE_SIZE is defined as sysconf(_SC_PAGESIZE), which returns a signed long and may be negative on error. The value was used directly in size_t comparisons and mmap() length calculations, leading to an integer overflow (Coverity CID 49765682).
The old code also computed the mapping length without taking the address offset within the page into account. As a result, regions crossing a page boundary might not be fully mapped. The mapping size must cover the entire range from the page-aligned start address through offset + len.
Fix by validating the page size returned by sysconf(), deriving the page mask from the validated value, and using RTE_ALIGN_CEIL(offset + len, page_size) to calculate the mapping length.
Coverity issue: 49765682
--- drivers/net/dpaa2/dpaa2_recycle.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/net/dpaa2/dpaa2_recycle.c +15 -8
@@ -176,6 +176,9 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)void *tmp;uint64_t start;uint64_t offset; +uint64_t page_mask; +long page_size; +size_t map_len; fd =open ("/dev/mem" ,O_RDWR );if (fd <0 ) {
@@ -183,20 +186,24 @@ static void *lsx_ccsr_map_region(uint64_t addr, size_t len)return NULL ; } - start = addr &PAGE_MASK ; + page_size =sysconf (_SC_PAGESIZE); +if (page_size <=0 ) { +close (fd); +return NULL ; + } + page_mask = ~((uint64_t )page_size -1 ); + start = addr & page_mask; offset = addr - start; - len = len &PAGE_MASK ; -if (len < (size_t )PAGE_SIZE ) - len =PAGE_SIZE ; + map_len =RTE_ALIGN_CEIL (offset + len, (size_t )page_size); - tmp =mmap (NULL , len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start); + tmp =mmap (NULL , map_len,PROT_READ |PROT_WRITE ,MAP_SHARED , fd, start);close (fd); -if (tmp !=MAP_FAILED ) -return (uint8_t *)tmp + offset; -else +if (tmp ==MAP_FAILED )return NULL ; + +return (uint8_t *)tmp + offset; }static const uint8_t ls_sd1_prot_idx_map[] = {
Signature · 1 line
2.43.0