[PATCH v2] net/iavf: add diagnostic support in TX path

Zhang, Qi Z qi.z.zhang at intel.com
Fri Dec 22 12:37:31 CET 2023



> -----Original Message-----
> From: Mingjin Ye <mingjinx.ye at intel.com>
> Sent: Friday, December 22, 2023 6:45 PM
> To: dev at dpdk.org
> Cc: Yang, Qiming <qiming.yang at intel.com>; Ye, MingjinX
> <mingjinx.ye at intel.com>; Wu, Jingjing <jingjing.wu at intel.com>; Xing, Beilei
> <beilei.xing at intel.com>
> Subject: [PATCH v2] net/iavf: add diagnostic support in TX path
> 
> The only way to enable diagnostics for TX paths is to modify the application
> source code. Making it difficult to diagnose faults.
> 
> In this patch, the devarg option "mbuf_check" is introduced and the
> parameters are configured to enable the corresponding diagnostics.
> 
> supported cases: mbuf, size, segment, offload, strict.
>  1. mbuf: check for corrupted mbuf.
>  2. size: check min/max packet length according to hw spec.
>  3. segment: check number of mbuf segments not exceed hw limitation.
>  4. offload: check any unsupported offload flag.
>  5. strict: check protocol headers.
> 
> parameter format: mbuf_check=[mbuf,<case1>,<case2>]
> eg: dpdk-testpmd -a 0000:81:01.0,mbuf_check=[mbuf,size] -- -i
> 
> Signed-off-by: Mingjin Ye <mingjinx.ye at intel.com>
> ---
> v2: Remove call chain.

...

> 
> +static struct iavf_pkt_burst iavf_rxtx_pkt_burst[RTE_MAX_ETHPORTS];

Global array is not necessary, I assume we can get adapter with rxq->vsi->adapter.

> +
>  static inline void
>  iavf_rxd_to_pkt_fields_by_comms_ovs(__rte_unused struct iavf_rx_queue
> *rxq,
>  				    struct rte_mbuf *mb,
> @@ -3394,34 +3396,34 @@ check_mbuf_len(struct offload_info *info,
> struct rte_mbuf *m)  {
>  	if (m->ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) {
>  		if (info->outer_l2_len != m->outer_l2_len) {
> -			PMD_TX_LOG(ERR, "outer_l2_len error in mbuf.
> Original "
> -			"length: %hu, calculated length: %u", m-
> >outer_l2_len,
> +			PMD_DRV_LOG(ERR, "outer_l2_len error in mbuf.
> Original "
> +			"length: %d, calculated length: %u", m-
> >outer_l2_len,
>  			info->outer_l2_len);
>  			return -1;
>  		}
>  		if (info->outer_l3_len != m->outer_l3_len) {
> -			PMD_TX_LOG(ERR, "outer_l3_len error in mbuf.
> Original "
> -			"length: %hu,calculated length: %u", m-
> >outer_l3_len,
> +			PMD_DRV_LOG(ERR, "outer_l3_len error in mbuf.
> Original "
> +			"length: %d,calculated length: %u", m->outer_l3_len,
>  			info->outer_l3_len);
>  			return -1;
>  		}
>  	}
> 
>  	if (info->l2_len != m->l2_len) {
> -		PMD_TX_LOG(ERR, "l2_len error in mbuf. Original "
> -		"length: %hu, calculated length: %u", m->l2_len,
> +		PMD_DRV_LOG(ERR, "l2_len error in mbuf. Original "
> +		"length: %d, calculated length: %u", m->l2_len,
>  		info->l2_len);
>  		return -1;

Can you explain why need to change all the log type here? basically the diagnose check is for Tx only , we don't need to touch existing Rx implementation.  it could be a separate patch if you think something need to be refactor.




More information about the dev mailing list