net/dpaa2: features and fixes for NXP DPAA2 drivers
Subsystems (4)
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 Rx queue configured in the traffic class as the default flow steering miss queue.
Users who relied on the environment variable must use the rte_flow API instead.
--- doc/guides/rel_notes/release_26_11.rst | 5 +++++ drivers/net/dpaa2/dpaa2_flow.c | 18 +++++------------- 2 files changed, 10 insertions(+), 13 deletions(-)
doc/guides/rel_notes/release_26_11.rst +5 -0
@@ -105,6 +105,11 @@ 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 + flow steering miss queue now defaults to the last Rx queue configured + in the traffic class. 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 +5 -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 {
@@ -4589,8 +4588,12 @@ dpaa2_configure_fs_rss_table(struct dpaa2_dev_priv *priv,if (rss_dist)return 0 ; +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 = dpaa2_flow_miss_flow_id; + tc_cfg.fs_miss_flow_id = nb_rxq > first ? +RTE_MIN (dist_size, nb_rxq - first) -1 :0 ; ret =dpni_set_rx_fs_dist (dpni,CMD_PRI_LOW , priv->token, &tc_cfg);if (ret <0 ) {
@@ -5224,17 +5227,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,
@@ -4690,7 +4693,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);
@@ -4981,11 +4984,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
Re: [PATCH v14-S2 00/10] net/dpaa2 updates
In reply to Prashant GuptaQuoted 4 lines · On Tue, 20 Oct 2026 20:18:31 +0530 Prashant Gupta <[email protected]>…
Changes in v14:
- Use the last Rx queue configured in each traffic class as the default flow steering miss queue.
- Update the release note accordingly.
Looks good applied to next-net
Re: [PATCH v2 00/47] NXP DPAA2 driver updates and fixes
In reply to Prashant GuptaQuoted 25 lines · On Thu, 10 Sep 2026 19:21:11 +0530 Prashant Gupta <[email protected]>…
This series brings the NXP DPAA2 drivers (net, crypto, dma, event, mempool and the fslmc bus) up to date with the current internal tree. It carries bug fixes, a reworked flow engine, an extended parser, meter and policer support, PTP enhancements, and a number of performance improvements in the Rx/Tx and DQRR handling paths.
The series is based on commit
c1a46b9d9243and is intended for 26.11.Changes in v2:
- Dropped the header-only patches; every remaining patch now contains the implementation together with its declarations.
- Addressed all findings reported by checkpatch; the series is clean against the current checkpatch.
- Removed the per-device Tx scatter/gather pool member that was never assigned, and used the existing global pool instead.
- Widened the DQRR held-mask shift to 64-bit to avoid undefined behaviour when the DQRR index exceeds 31.
- Bounded the MAC xstats collection loop by the size of the statistics array.
- Treated the traffic class priority mask as a bitmask rather than an index.
- Added a per-entry DQRR consume fallback for portals whose DQRR ring does not fit the vectored consume encoding.
Quoted 2 lines
Each of the review fixes above has been folded into the patch that introduced the code in question, so the series remains bisectable.
Still get lots of issues when running this through Fable for review.
Subject: Re: [PATCH v2 00/47] DPAA2 driver updates
Reviewed all 47 patches against upstream main (d55ccd4) and diffed each against its v1 counterpart. Series applies cleanly.
Summary: five v1 findings were fixed, two new ones were introduced, and eleven patches still carry the errors reported on v1. Every change in v2 was to something called out in the cover letter or to a one-line site; nothing that required reading a v1 per-patch comment was addressed. Details below, then the process points.
Fixed since v1
--------------
31: sg_mbuf allocated from the global dpaa2_tx_sg_pool (priv member
was never assigned); UINT64_C(1) << dqrr_index restored.
35: mac_num bounded by DPAA2_MAC_XSTAT_MAX_NUM.
40: priority_mask = RTE_BIT32(tc_id).
41: vector consume gated to dqrr_size <= 16.
Flow engine split into 36 + 37/38/39; the broken "double free on uninit" patch was dropped. AES-GMAC got its string table and note.
New in v2
---------
1: Unrelated hunks squashed into a Cc: stable fix. Besides the GCM
change it now carries dpaa2_sec_parse_int() and the drv_dump_mode handler rewrite (patch 6's), fle_sdd_pre_populate() void->int and the long_copy mempool_put (patch 10's), and an unused #include <rte_string_fns.h> in dpaa2_flow.c. Backported as-is it drags dma and net into stable under a crypto tag.
31: struct dpaa2_queue * RTE_ATOMIC(next_txq_to_cnf);
Under -Denable_stdatomic=true (the GitHub CI stdatomic job) this expands to _Atomic(next_txq_to_cnf) and does not compile. v1 had RTE_ATOMIC(struct dpaa2_queue *) next_txq_to_cnf; which is right. 32 also dropped v1's rte_atomic_load_explicit() on it.
23/27/32: Regression. The DPAA2_PMD_DEBUG line-buffered dumps from v1
are back to fprintf(rte_log_get_stream(), ...), bypassing log type and level (and a checkpatch forbidden token). 32 also uses %ld for time_t. v1 was correct here.
Still open from v1 (errors)
---------------------------
6: Env vars override devargs. dpaa2_sec_get_devargs() is called once
per key; whichever key is absent falls to env_set:, which reads both variables and overwrites what the other call took from devargs. Parsing was hardened; the control flow is the same. getenv() in a driver stands.
13: rte_dpaa2_mpool_get_ops_idx() returns 0, not the index, after a
successful IPC round trip. mp_req is uninitialised (len_param, num_fds are stack garbage; send_msg() attaches num_fds fds). rte_mp_action_register() failure returns past bp_list/bp_info/ dpbp allocations instead of goto err4.
15: nb_rx_queues/nb_tx_queues are uint8_t; num_rx_tcs * num_queues is
truncated before the > MAX_RX_QUEUES check (8 x 32 -> 0). The new fqid != DPAA2_INVALID_FQ_ID early return in rx_queue_setup fires on every reconfigure because rx_queue_release never resets fqid, so new mb_pool/nb_desc/offloads are ignored and the CGID that release cleared is never re-installed.
18: dpaa2_mtr_ops_get() re-initialises priv->meter_lock on every call;
rte_mtr_ops_get() invokes it at the start of every rte_mtr_*(). profile/policy delete silently frees meters in use; rte_mtr.h says EBUSY.
23: priv->psr_dynfield_offset is never assigned in 47 patches; priv is
zeroed, so dpaa2_dev_rx_parse_offset() writes l3/l4/l5 offsets into mbuf byte 0..2 (buf_addr) on every received packet. Rx timestamp path removed here and not restored until 32; the IEEE1588 build is broken in between (call to a deleted dpaa2_timestamp_dynfield()). The !by_channel guard from upstream 57b8ce0 is still dropped in prefetch_rx_common.
26: num_rx in dpaa2_dev_rx_common() is uint8_t; wraps at 256 while
next_pull keeps the loop going. cluster_sdest divides before the zero check.
27: mmap() result tested against NULL, not MAP_FAILED, in scan(), so
any host with STRICT_DEVMEM dereferences (void *)-1 at EAL init.
28: dpaa2_eth_eventq_detach() clears DPNI_QUEUE_OPT_DEST before the
dpni_set_queue(), so DEST_NONE is never sent and the FQ stays on the DPCON. Taildrop failure in rx_queue_setup returns instead of goto err_free_dpcon.
31: dpaa2_dev_tx_mbuf_to_simple_fd() frees the mbuf on copy failure
(goto quit; rte_pktmbuf_free(mbuf)) and dpaa2_dev_tx() then goto send_n_return, returning a count that excludes it; the app retries a freed mbuf. Same shape for the cloned branch, the mid-chain -ENOMEM from no_conf_mbuf_to_sge() (chain already mutated, sg_mbuf leaked), and multi_txq_ordered via send_frames. A per-packet failure is either drop-and-continue or leave-and- return-short, not both.
32: rte_pmd_dpaa2_set_one_step_ts()/get_one_step_ts() (exported
experimental, 24.11) deleted from dpaa2_ethdev.c; prototypes remain in installed rte_pmd_dpaa2.h. Link failure, no deprecation.
Still open from v1 (warnings, short form)
-----------------------------------------
3: lib/cryptodev hunk should be its own patch; AES-GMAC still
advertised in the plain-sym capability table while only the IPsec path accepts it.
7: Byte-identical; PAGE_MASK on the two lines above the new check is
still the unvalidated sysconf() value.
8: Byte-identical; the -Warray-bounds it "fixes" is created by patch
11, so Fixes:/Cc: stable are wrong, and 8 KB idxs[4096] per VQ for idxs[0].
10: Commit message now says rte_panic(); the code returns -ENOMEM. 12: BMT flag applied only when a pooled context is first initialised
(sg_entry_post_populate() never writes ctrl.bmt); long-FD path ignores it entirely. New public flag undocumented.
16: dpni version gate is == 8 && >= 7; use dpaa2_dev_cmp_dpni_ver().
Header says 0xF7FF, code returns 0x10000.
23: "No functional change" while packet_type on LX2160A changes. 24: dpaa2_supported_ptypes_get() not updated for any new ptype. 34: Callers moved to V3/V3/V2 MC command ids with no version gate
until 36; older MC breaks every flow rule in between.
35: xstats_get_names() returns limit, not the available count, when
limit < count.
36: RTE_DPAA2_FLOW_GROUP_TYPE_GET and friends are #ifndef stubs for
macros nothing upstream defines; the QoS/FS group paths (and 39's miss-action group handling) are unreachable. getenv() still read on every flow_create(); 13 rte_memcpy() on the control path.
Docs: the only change under doc/ in 47 patches is the AES-GMAC note.
Missing: three new devargs and a changed drv_tx_conf meaning, mpls/pppoes/geneve/meter/meter_mark in dpaa2.ini, metering, the Removed Items entry for 32.
Fold-ins: 33 carries edits to 31's code; 44 cleans up 36; 46 removes
the duplicate mc_get_soc_version() that 26 adds.
Process
-------
The v1 -> v2 delta looks like a re-export from the internal tree with a few fixes applied there, not an edit of the posted series: patch 1 picked up hunks from 6 and 10, three patches lost the logging cleanup v1 had, and 31's atomic declaration went from right to wrong. Working that way means every review comment has to be re-applied twice, and upstream changes under you (57b8ce0 is still lost) have to be re-done each time.
Recommendation unchanged: split by tree so the parts that are close can go in. bus/fslmc first, then crypto, dma, mempool and net as separate series, with the Cc: stable fixes at the front of each and containing nothing else. Per-commit builds with -Denable_stdatomic and RTE_LIBRTE_IEEE1588 before posting. Docs with the code, not in a follow-up.