dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: "Iremonger, Bernard" <bernard.iremonger@intel.com>
To: "Xu, Ting" <ting.xu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>,
	"Wu, Jingjing" <jingjing.wu@intel.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v1] app/testpmd: fix CRC strip config error
Date: Mon, 14 Oct 2019 11:25:30 +0000	[thread overview]
Message-ID: <8CEF83825BEC744B83065625E567D7C260E0C9BB@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <22fa727a2ce09834133530c40cb02666e0be10ba.1570882485.git.ting.xu@intel.com>

Hi Ting,

> -----Original Message-----
> From: Xu, Ting
> Sent: Saturday, October 12, 2019 1:19 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Iremonger, Bernard
> <bernard.iremonger@intel.com>; stable@dpdk.org
> Subject: [PATCH v1] app/testpmd: fix CRC strip config error
> 
> This patch fixed the bug that an error appears when config rx_offload
> crc_strip using command "port config all crc-strip on|off". The reason is that
> this command was removed previously. However, the current command
> does not enable "crc_strip" option properly, so that testpmd returns error
> when config crc_strip.
> 
> In this patch, an additional operation is added to recognize "crc_strip"
> option, since "crc_strip" and "keep_crc" are using the same flag
> "DEV_RX_OFFLOAD_KEEP_CRC". The current command is "port config
> <port_id> rx_offload crc_strip on|off".
> 
> Fixes: e5db17a1e54e ("app/testpmd: remove duplicated Rx offload
> commands")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ting Xu <ting.xu@intel.com>
> ---
>  app/test-pmd/cmdline.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> def471d97..31dbe4a07 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -18084,6 +18084,9 @@ search_rx_offload(const char *name)
>  	int found = 0;
>  	unsigned int bit;
> 
> +	if (!strcmp(name, "crc_strip"))
> +		name = "keep_crc";
> +
>  	single_offload = 1;
>  	for (bit = 0; bit < sizeof(single_offload) * CHAR_BIT; bit++) {
>  		single_name =
> rte_eth_dev_rx_offload_name(single_offload);
> @@ -18113,6 +18116,7 @@ cmd_config_per_port_rx_offload_parsed(void
> *parsed_result,
>  	uint16_t nb_rx_queues;
>  	int q;
>  	int ret;
> +	int res_on_off = 1;
> 
>  	if (port->port_status != RTE_PORT_STOPPED) {
>  		printf("Error: Can't config offload when Port %d "
> @@ -18131,7 +18135,11 @@ cmd_config_per_port_rx_offload_parsed(void
> *parsed_result,
>  		return;
> 
>  	nb_rx_queues = dev_info.nb_rx_queues;
> -	if (!strcmp(res->on_off, "on")) {
> +	res_on_off = strcmp(res->on_off, "on");
> +
> +	if (!strcmp(res->offload, "crc_strip"))
> +		res_on_off = ~res_on_off;

It looks as if res_on_off is intended to have a value of 0 or 1.
The above line gives it a value of -1, is this intended ? 

> +	if (!res_on_off) {
>  		port->dev_conf.rxmode.offloads |= single_offload;
>  		for (q = 0; q < nb_rx_queues; q++)
>  			port->rx_conf[q].offloads |= single_offload;
> --
> 2.17.1

Regards,

Bernard.


  reply	other threads:[~2019-10-14 11:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-12 12:18 [dpdk-dev] [PATCH v1] app/testpmd: fix CRC strip config error Ting Xu
2019-10-14 11:25 ` Iremonger, Bernard [this message]
2019-10-14 11:41   ` Iremonger, Bernard
2019-10-15  1:03     ` Xu, Ting
2019-10-14 12:28 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2019-10-15  0:49   ` Xu, Ting
2019-10-15  9:14 ` [dpdk-dev] [PATCH v2] app/testpmd: fix CRC strip command failure Ting Xu
2019-10-15  9:40   ` Iremonger, Bernard
2019-10-15 13:13     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

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=8CEF83825BEC744B83065625E567D7C260E0C9BB@IRSMSX108.ger.corp.intel.com \
    --to=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=stable@dpdk.org \
    --cc=ting.xu@intel.com \
    --cc=wenzhuo.lu@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).