Hi Shahaf,

> -----Original Message-----
> From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Shahaf Shuler
> Sent: Tuesday, December 26, 2017 5:44 PM
> To: Wu, Jingjing <jingjing...@intel.com>; Yigit, Ferruh
> <ferruh.yi...@intel.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3 04/10] app/testpmd: convert to new Ethdev
> Tx offloads API
> 
> Ethdev Tx offloads API has changed since:
> 
> commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")
> 
> Convert the application to use the new API.
> 
> This patch mandates the port to be stopped when configure the Tx offloads.
> This is because the PMD must be aware to the offloads changes on the
> device and queue configuration.
> 
> Signed-off-by: Shahaf Shuler <shah...@mellanox.com>
> ---
>  app/test-pmd/cmdline.c | 90
> ++++++++++++++++++++++++++++++++++++++++++---
>  app/test-pmd/config.c  | 55 ++++++++++++++++++---------  app/test-
> pmd/testpmd.c |  3 ++
>  3 files changed, 124 insertions(+), 24 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> d8c73a9b1..58125839a 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -3439,7 +3439,14 @@ cmd_tx_vlan_set_parsed(void *parsed_result,  {
>       struct cmd_tx_vlan_set_result *res = parsed_result;
> 
> +     if (!port_is_stopped(res->port_id)) {
> +             printf("Please stop port %d first\n", res->port_id);
> +             return;
> +     }
> +
>       tx_vlan_set(res->port_id, res->vlan_id);
> +
> +     cmd_reconfig_device_queue(res->port_id, 1, 1);
>  }
> 
I do have some concern about this behavior change, 'port_is_stopped' and ' 
cmd_reconfig_device_queue '.
1, seems this behavior change is not necessary for using the new offload API. 
Maybe splitting this patch to 2 is better.
2, some NICs doesn't need to be stopped or re-configured to make vlan functions 
enabled. That's why the original code doesn't have this restriction. Maybe 
figuring out a way to do the restriction in the driver layer is better.

Reply via email to