[dpdk-dev] [PATCH v5 7/7] app/testpmd: adjust ethdev port ownership
Lu, Wenzhuo
wenzhuo.lu at intel.com
Thu Jan 25 02:47:21 CET 2018
Hi Matan,
> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Matan Azrad
> Sent: Tuesday, January 23, 2018 12:38 AM
> To: Thomas Monjalon <thomas at monjalon.net>; Gaetan Rivet
> <gaetan.rivet at 6wind.com>; Wu, Jingjing <jingjing.wu at intel.com>
> Cc: dev at dpdk.org; Neil Horman <nhorman at tuxdriver.com>; Richardson,
> Bruce <bruce.richardson at intel.com>; Ananyev, Konstantin
> <konstantin.ananyev at intel.com>
> Subject: [dpdk-dev] [PATCH v5 7/7] app/testpmd: adjust ethdev port
> ownership
>
> Testpmd should not use ethdev ports which are managed by other DPDK
> entities.
>
> Set Testpmd ownership to each port which is not used by other entity and
> prevent any usage of ethdev ports which are not owned by Testpmd.
>
> Signed-off-by: Matan Azrad <matan at mellanox.com>
> ---
> app/test-pmd/cmdline.c | 89 +++++++++++++++++++--------------------------
> app/test-pmd/cmdline_flow.c | 2 +-
> app/test-pmd/config.c | 37 ++++++++++---------
> app/test-pmd/parameters.c | 4 +-
> app/test-pmd/testpmd.c | 63 ++++++++++++++++++++------------
> app/test-pmd/testpmd.h | 3 ++
> 6 files changed, 103 insertions(+), 95 deletions(-)
>
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> 9f12c0f..36dba6c 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -1394,7 +1394,7 @@ struct cmd_config_speed_all {
> &link_speed) < 0)
> return;
>
> - RTE_ETH_FOREACH_DEV(pid) {
> + RTE_ETH_FOREACH_DEV_OWNED_BY(pid, my_owner.id) {
I see my_owner is a global variable, so, don't know why we need the parameter 'my_owner.id' here. I think we can still use RTE_ETH_FOREACH_DEV and check 'my_owner' in it. If there's some reason and you don't want change RTE_ETH_FOREACH_DEV, I think ' RTE_ETH_FOREACH_DEV_OWNED(pid) {' is better.
More information about the dev
mailing list