DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Iremonger, Bernard" <bernard.iremonger@intel.com>
To: "Zhao1, Wei" <wei.zhao1@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "stable@dpdk.org" <stable@dpdk.org>, "Zhao1, Wei" <wei.zhao1@intel.com>
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix to add offloads confguration	for queue
Date: Wed, 3 Jul 2019 11:46:21 +0000	[thread overview]
Message-ID: <8CEF83825BEC744B83065625E567D7C260DC1399@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <1562131464-58732-1-git-send-email-wei.zhao1@intel.com>


Hi Wei,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wei Zhao
> Sent: Wednesday, July 3, 2019 6:24 AM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhao1, Wei <wei.zhao1@intel.com>
> Subject: [dpdk-dev] [PATCH] app/testpmd: fix to add offloads confguration
> for queue
> 
> When adding offloads from commandline, not only port related configuration
> bits should be set, but also queue related offloads configuration bits, or it will
> cause error.
> For example, test in this process for ixgbe:
> (1)./x86_64-native-linuxapp-gcc/app/testpmd -c 0x6 -n 4
> -- -i --portmask=0x1 --port-topology=loop --disable-crc-strip (2)port stop all
> (3)port config all crc-strip on (4)port start all we will see "Fail to configure port
> 0 rx queues" of warning info.
> 
> Fixes: 0074d02fca21 ("app/testpmd: convert to new Rx offloads API")


./devtools/check-git-log.sh -1
Is it candidate for Cc: stable@dpdk.org backport?
        app/testpmd: fix to add offloads confguration for queue

> 
> Signed-off-by: wei zhao <wei.zhao1@intel.com>
> ---
>  app/test-pmd/cmdline.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> d1e0d44..1b2daa1 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -2047,6 +2047,7 @@ cmd_config_rx_mode_flag_parsed(void
> *parsed_result,  {
>  	struct cmd_config_rx_mode_flag *res = parsed_result;
>  	portid_t pid;
> +	int k;
> 
>  	if (!all_ports_stopped()) {
>  		printf("Please stop all ports first\n"); @@ -2147,6 +2148,10
> @@ cmd_config_rx_mode_flag_parsed(void *parsed_result,
>  			return;
>  		}
>  		port->dev_conf.rxmode.offloads = rx_offloads;
> +		/* Apply Rx offloads configuration */
> +		for (k = 0; k < port->dev_info.max_rx_queues; k++)
> +			port->rx_conf[k].offloads =
> +				port->dev_conf.rxmode.offloads;
>  	}
> 
>  	init_port_config();
> @@ -4368,6 +4373,7 @@ cmd_csum_parsed(void *parsed_result,
>  	int hw = 0;
>  	uint64_t csum_offloads = 0;
>  	struct rte_eth_dev_info dev_info;
> +	int k;
> 
>  	if (port_id_is_invalid(res->port_id, ENABLED_WARN)) {
>  		printf("invalid port %d\n", res->port_id); @@ -4443,6
> +4449,10 @@ cmd_csum_parsed(void *parsed_result,
>  			ports[res->port_id].dev_conf.txmode.offloads &=
>  							(~csum_offloads);
>  		}
> +		/* Apply Tx offloads configuration */
> +		for (k = 0; k < ports[res->port_id].dev_info.max_tx_queues;
> k++)
> +			ports[res->port_id].tx_conf[k].offloads =
> +				ports[res-
> >port_id].dev_conf.txmode.offloads;
>  	}

The above block of code seems to be duplicated 3 times in this patch.
It would probably be better to put it in a function and call the function 3 times.

>  	csum_show(res->port_id);
> 
> @@ -4565,6 +4575,7 @@ cmd_tso_set_parsed(void *parsed_result,  {
>  	struct cmd_tso_set_result *res = parsed_result;
>  	struct rte_eth_dev_info dev_info;
> +	int k;
> 
>  	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
>  		return;
> @@ -4594,6 +4605,10 @@ cmd_tso_set_parsed(void *parsed_result,
>  		printf("TSO segment size for non-tunneled packets is %d\n",
>  			ports[res->port_id].tso_segsz);
>  	}
> +	/* Apply Tx offloads configuration */
> +	for (k = 0; k < ports[res->port_id].dev_info.max_tx_queues; k++)
> +		ports[res->port_id].tx_conf[k].offloads =
> +			ports[res->port_id].dev_conf.txmode.offloads;

The above block of code seems to be duplicated 3 times in this patch.

> 
>  	/* display warnings if configuration is not supported by the NIC */
>  	rte_eth_dev_info_get(res->port_id, &dev_info); @@ -4694,6
> +4709,7 @@ cmd_tunnel_tso_set_parsed(void *parsed_result,  {
>  	struct cmd_tunnel_tso_set_result *res = parsed_result;
>  	struct rte_eth_dev_info dev_info;
> +	int k;
> 
>  	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
>  		return;
> @@ -4747,6 +4763,10 @@ cmd_tunnel_tso_set_parsed(void
> *parsed_result,
>  		      DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM))
>  			printf("Warning: csum set outer-ip must be set to hw
> "
>  				"if outer L3 is IPv4; not necessary for
> IPv6\n");
> +		/* Apply Tx offloads configuration */
> +		for (k = 0; k < ports[res->port_id].dev_info.max_tx_queues;
> k++)
> +			ports[res->port_id].tx_conf[k].offloads =
> +				ports[res-
> >port_id].dev_conf.txmode.offloads;
>  	}

The above block of code seems to be duplicated 3 times in this patch.

> 
>  	cmd_reconfig_device_queue(res->port_id, 1, 1);
> --
> 2.7.5

Regards,

Bernard.


  reply	other threads:[~2019-07-03 11:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03  5:24 Wei Zhao
2019-07-03 11:46 ` Iremonger, Bernard [this message]
2019-07-04  5:35 ` [dpdk-dev] [PATCH v2] " Wei Zhao
2019-07-04  8:53   ` Iremonger, Bernard
2019-07-04 23:54     ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2019-07-06 16:24   ` Thomas Monjalon
2019-07-06 16:25     ` Thomas Monjalon
2019-07-08  9:09       ` David Marchand
2019-07-08  9:16         ` Zhao1, Wei
2019-07-08  9:22         ` Zhao1, Wei

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=8CEF83825BEC744B83065625E567D7C260DC1399@IRSMSX108.ger.corp.intel.com \
    --to=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=wei.zhao1@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).