[dpdk-dev] [PATCH v4] ethdev: fix representor port ID search by name

Wang, Haiyue haiyue.wang at intel.com
Tue Aug 31 18:32:03 CEST 2021


> -----Original Message-----
> From: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
> Sent: Wednesday, September 1, 2021 00:06
> To: Ajit Khaparde <ajit.khaparde at broadcom.com>; Somnath Kotur <somnath.kotur at broadcom.com>; Daley,
> John <johndale at cisco.com>; Hyong Youb Kim <hyonkim at cisco.com>; Xing, Beilei <beilei.xing at intel.com>;
> Yang, Qiming <qiming.yang at intel.com>; Zhang, Qi Z <qi.z.zhang at intel.com>; Wang, Haiyue
> <haiyue.wang at intel.com>; Matan Azrad <matan at nvidia.com>; Shahaf Shuler <shahafs at nvidia.com>;
> Viacheslav Ovsiienko <viacheslavo at nvidia.com>; Thomas Monjalon <thomas at monjalon.net>; Yigit, Ferruh
> <ferruh.yigit at intel.com>
> Cc: dev at dpdk.org; Viacheslav Galaktionov <viacheslav.galaktionov at oktetlabs.ru>
> Subject: [PATCH v4] ethdev: fix representor port ID search by name
> 
> From: Viacheslav Galaktionov <viacheslav.galaktionov at oktetlabs.ru>
> 
> Getting a list of representors from a representor does not make sense.
> Instead, a parent device should be used.
> 
> To this end, extend the rte_eth_dev_data structure to include the port ID
> of the backing device for representors.
> 
> Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov at oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
> ---
> The new field is added into the hole in rte_eth_dev_data structure.
> The patch does not change ABI, but extra care is required since ABI
> check is disabled for the structure because of the libabigail bug [1].
> 
> Potentially it is bad for out-of-tree drivers which implement
> representors but do not fill in a new parert_port_id field in
> rte_eth_dev_data structure. Do we care?

Set the `parent_port_id` to ' RTE_MAX_ETHPORTS' as an invalid port ID
in rte_eth_dev_allocate ?

> 
> mlx5 changes should be reviwed by maintainers very carefully, since
> we are not sure if we patch it correctly.
> 
> [1] https://sourceware.org/bugzilla/show_bug.cgi?id=28060
> 
> v4:
>     - apply mlx5 review notes: remove fallback from generic ethdev
>       code and add fallback to mlx5 code to handle legacy usecase
> 
> v3:
>     - fix mlx5 build breakage
> 
> v2:
>     - fix mlx5 review notes
>     - try device port ID first before parent in order to address
>       backward compatibility issue
> 
>  drivers/net/bnxt/bnxt_reps.c             |  1 +
>  drivers/net/enic/enic_vf_representor.c   |  1 +
>  drivers/net/i40e/i40e_vf_representor.c   |  1 +
>  drivers/net/ice/ice_dcf_vf_representor.c |  1 +
>  drivers/net/ixgbe/ixgbe_vf_representor.c |  1 +
>  drivers/net/mlx5/linux/mlx5_os.c         | 13 +++++++++++++
>  drivers/net/mlx5/windows/mlx5_os.c       | 13 +++++++++++++
>  lib/ethdev/ethdev_driver.h               |  6 +++---
>  lib/ethdev/rte_class_eth.c               |  2 +-
>  lib/ethdev/rte_ethdev.c                  |  8 ++++----
>  lib/ethdev/rte_ethdev_core.h             |  6 ++++++
>  11 files changed, 45 insertions(+), 8 deletions(-)
> 

For ixgbe_vf, ice_dcf

Acked-by: Haiyue Wang <haiyue.wang at intel.com>

> --
> 2.30.2



More information about the dev mailing list