DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Mingjin Ye <mingjinx.ye@intel.com>, <dev@dpdk.org>
Cc: <qiming.yang@intel.com>, Yuying Zhang <Yuying.Zhang@intel.com>,
	"Beilei Xing" <beilei.xing@intel.com>,
	Wenjun Wu <wenjun1.wu@intel.com>, Simei Su <simei.su@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>
Subject: Re: [PATCH v11] net/iavf: add diagnostic support in TX path
Date: Fri, 9 Feb 2024 15:43:47 +0100	[thread overview]
Message-ID: <ff924bcf-16b6-430e-8270-ccfec1221cd2@intel.com> (raw)
In-Reply-To: <20240110022555.3084426-1-mingjinx.ye@intel.com>

On 1/10/2024 3:25 AM, Mingjin Ye wrote:
> Implemented a Tx wrapper to perform a thorough check on mbufs,
> categorizing and counting invalid cases by types for diagnostic
> purposes. The count of invalid cases is accessible through xstats_get.
> 
> Also, the devarg option "mbuf_check" was introduced to configure the
> diagnostic parameters to enable the appropriate diagnostic features.
> 
> supported cases: mbuf, size, segment, offload.
>   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.
> 
> parameter format: "mbuf_check=<case>" or "mbuf_check=[<case1>,<case2>]"
> eg: dpdk-testpmd -a 0000:81:01.0,mbuf_check=[mbuf,size] -- -i
> 
> Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
> ---

<snip>

> 
> diff --git a/doc/guides/nics/intel_vf.rst b/doc/guides/nics/intel_vf.rst
> index ce96c2e1f8..f62bb4233c 100644
> --- a/doc/guides/nics/intel_vf.rst
> +++ b/doc/guides/nics/intel_vf.rst
> @@ -111,6 +111,17 @@ For more detail on SR-IOV, please refer to the following documents:
>       by setting the ``devargs`` parameter like ``-a 18:01.0,no-poll-on-link-down=1``
>       when IAVF is backed by an Intel\ |reg| E810 device or an Intel\ |reg| 700 Series Ethernet device.
>   
> +    When IAVF is backed by an Intel\ |reg| E810 device or an Intel\ |reg| 700 series Ethernet devices.

This looks like a duplicate line of the one above it, so probably needs 
to be removed?

> +    Set the ``devargs`` parameter ``mbuf_check`` to enable TX diagnostics. For example,
> +    ``-a 18:01.0,mbuf_check=<case>`` or ``-a 18:01.0,mbuf_check=[<case1>,<case2>...]``. Also,
> +    ``xstats_get`` can be used to get the error counts, which are collected in ``tx_mbuf_error_packets``
> +    xstats. For example, ``testpmd> show port xstats all``. Supported cases:
> +
> +    *   mbuf: Check for corrupted mbuf.
> +    *   size: Check min/max packet length according to hw spec.
> +    *   segment: Check number of mbuf segments not exceed hw limitation.
> +    *   offload: Check any unsupported offload flag.
> +

<snip>

> +
> +	int ret = 0;
> +	uint64_t *mc_flags = args;
> +	char *str2 = strdup(value);
> +	if (str2 == NULL)
> +		return -1;
> +
> +	str_len = strlen(str2);
> +	if (str2[0] == '[' && str2[str_len - 1] == ']') {
> +		if (str_len < 3) {
> +			ret = -1;
> +			goto mdd_end;
> +		}
> +		valid_len = str_len - 2;
> +		memmove(str2, str2 + 1, valid_len);
> +		memset(str2 + valid_len, '\0', 2);
> +	}

I would suggest adding a comment mentioning that we're removing outer 
square brackets from the value. Even better would be to factor it out 
into a separate function, so that code for this function is not polluted 
with implementation details of brackets removal.

> +	cur = strtok_r(str2, ",", &tmp);
> +	while (cur != NULL) {
> +		if (!strcmp(cur, "mbuf"))
> +			*mc_flags |= IAVF_MBUF_CHECK_F_TX_MBUF;
> +		else if (!strcmp(cur, "size"))
> +			*mc_flags |= IAVF_MBUF_CHECK_F_TX_SIZE;
> +		else if (!strcmp(cur, "segment"))
> +			*mc_flags |= IAVF_MBUF_CHECK_F_TX_SEGMENT;
> +		else if (!strcmp(cur, "offload"))
> +			*mc_flags |= IAVF_MBUF_CHECK_F_TX_OFFLOAD;
> +		else
> +			PMD_DRV_LOG(ERR, "Unsupported mdd check type: %s", cur);

I suspect 'mdd' is an artifact of earlier versions? What does it mean, 
and can the error message be made more meaningful?

> +		cur = strtok_r(NULL, ",", &tmp);
> +	}
> +
> +mdd_end:
> +	free(str2);
> +	return ret;
> +}
> +
>   static int iavf_parse_devargs(struct rte_eth_dev *dev)
>   {
>   	struct iavf_adapter *ad =
> @@ -2344,6 +2411,11 @@ static int iavf_parse_devargs(struct rte_eth_dev *dev)
>   		goto bail;
>   	}
>   

<snip>

> +		}
> +	}
> +
> +	if (pkt_error) {
> +		txq->mbuf_errors++;
> +		good_pkts = idx;
> +		if (good_pkts == 0)
> +			return 0;
> +	}
> +
> +	return iavf_tx_pkt_burst_ops[tx_burst_type](tx_queue,
> +								tx_pkts, good_pkts);

The indentation here is a bit odd.


The above suggestions are not blocking, so overall

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
-- 
Thanks,
Anatoly


  reply	other threads:[~2024-02-09 14:44 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21 10:12 [PATCH] " Mingjin Ye
2023-12-21 12:00 ` Zhang, Qi Z
2023-12-22 10:44 ` [PATCH v2] " Mingjin Ye
2023-12-22 11:37   ` Zhang, Qi Z
2023-12-25  2:48     ` Ye, MingjinX
2023-12-26 10:07   ` [PATCH v3] " Mingjin Ye
2023-12-27 10:16     ` [PATCH v4 1/2] " Mingjin Ye
2023-12-27 11:30       ` Zhang, Qi Z
2023-12-28 10:26       ` [PATCH v5 0/2] net/iavf: add diagnostics and fix error Mingjin Ye
2023-12-28 10:26         ` [PATCH v5 1/2] net/iavf: fix Tx path error in multi-process Mingjin Ye
2023-12-28 10:50           ` Zhang, Qi Z
2023-12-29 10:11           ` [PATCH v6 0/2] net/iavf: fix Rx/Tx burst and add diagnostics Mingjin Ye
2023-12-29 10:11             ` [PATCH v6 1/2] net/iavf: fix Rx/Tx burst in multi-process Mingjin Ye
2023-12-31  6:41               ` Zhang, Qi Z
2024-01-02 10:52               ` [PATCH v7 0/2] net/iavf: fix Rx/Tx burst and add diagnostics Mingjin Ye
2024-01-02 10:52                 ` [PATCH v7 1/2] net/iavf: fix Rx/Tx burst in multi-process Mingjin Ye
2024-01-03  2:22                   ` Zhang, Qi Z
2024-01-02 10:52                 ` [PATCH v7 2/2] net/iavf: add diagnostic support in TX path Mingjin Ye
2024-01-03  2:54                   ` Zhang, Qi Z
2024-01-03 10:10                   ` [PATCH v8 0/2] net/iavf: fix Rx/Tx burst and add diagnostics Mingjin Ye
2024-01-03 10:10                     ` [PATCH v8 1/2] net/iavf: fix Rx/Tx burst in multi-process Mingjin Ye
2024-01-03 10:10                     ` [PATCH v8 2/2] net/iavf: add diagnostic support in TX path Mingjin Ye
2024-01-04 10:18                       ` [PATCH v9 0/2] net/iavf: fix Rx/Tx burst and add diagnostics Mingjin Ye
2024-01-04 10:18                         ` [PATCH v9 1/2] net/iavf: fix Rx/Tx burst in multi-process Mingjin Ye
2024-01-04 10:18                         ` [PATCH v9 2/2] net/iavf: add diagnostic support in TX path Mingjin Ye
2024-01-05  9:58                           ` [PATCH v10] " Mingjin Ye
2024-01-09 10:09                             ` [PATCH v11] " Mingjin Ye
2024-01-10  2:25                             ` Mingjin Ye
2024-02-09 14:43                               ` Burakov, Anatoly [this message]
2024-02-09 15:20                               ` Burakov, Anatoly
2024-02-19  9:55                               ` [PATCH v12] " Mingjin Ye
2024-02-29 18:38                                 ` Bruce Richardson
2024-03-04 12:34                                   ` Bruce Richardson
2024-01-05  0:44                       ` [PATCH v8 2/2] " Zhang, Qi Z
2023-12-29 10:11             ` [PATCH v6 " Mingjin Ye
2023-12-28 10:26         ` [PATCH v5 " Mingjin Ye

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ff924bcf-16b6-430e-8270-ccfec1221cd2@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=Yuying.Zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=mingjinx.ye@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=simei.su@intel.com \
    --cc=wenjun1.wu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).