[PATCH v2 1/4] ethdev: add function to check representor port
Ferruh Yigit
ferruh.yigit at amd.com
Fri Feb 23 10:29:10 CET 2024
On 2/23/2024 2:42 AM, Chaoyong He wrote:
> From: Long Wu <long.wu at corigine.com>
>
> Add a function to check if a device is representor port, also
> modified the related codes for PMDs.
>
Thanks Long for the patch.
> Signed-off-by: Long Wu <long.wu at corigine.com>
> Reviewed-by: Chaoyong He <chaoyong.he at corigine.com>
> Reviewed-by: Peng Zhang <peng.zhang at corigine.com>
> ---
> doc/guides/rel_notes/release_24_03.rst | 3 +++
> drivers/net/bnxt/bnxt.h | 3 ---
> drivers/net/bnxt/bnxt_ethdev.c | 4 ++--
> drivers/net/bnxt/tf_ulp/bnxt_tf_pmd_shim.c | 12 ++++++------
> drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 4 ++--
> drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 4 ++--
> drivers/net/cpfl/cpfl_representor.c | 2 +-
> drivers/net/enic/enic.h | 5 -----
> drivers/net/enic/enic_ethdev.c | 2 +-
> drivers/net/enic/enic_fm_flow.c | 20 ++++++++++----------
> drivers/net/enic/enic_main.c | 4 ++--
> drivers/net/i40e/i40e_ethdev.c | 2 +-
> drivers/net/ice/ice_dcf_ethdev.c | 2 +-
> drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
> drivers/net/nfp/flower/nfp_flower_flow.c | 2 +-
> drivers/net/nfp/nfp_mtr.c | 2 +-
> drivers/net/nfp/nfp_net_common.c | 4 ++--
> drivers/net/nfp/nfp_net_flow.c | 2 +-
> lib/ethdev/ethdev_driver.h | 17 +++++++++++++++++
> 19 files changed, 54 insertions(+), 42 deletions(-)
>
There are two more instance in 'rte_class_eth.c'
> diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst
> index 879bb4944c..8178417b98 100644
> --- a/doc/guides/rel_notes/release_24_03.rst
> +++ b/doc/guides/rel_notes/release_24_03.rst
> @@ -185,6 +185,9 @@ API Changes
> * ethdev: Renamed structure ``rte_flow_action_modify_data`` to be
> ``rte_flow_field_data`` for more generic usage.
>
> +* ethdev: Add new function ``rte_eth_dev_is_repr()`` to check if a device is
> + representor port.
> +
>
This is not user facing API, no need to update the release notes.
<...>
> +/**
> + * @internal
> + * Check if the ethdev is a representor port.
> + *
> + * @param dev
> + * Pointer to struct rte_eth_dev.
> + *
> + * @return
> + * false the ethdev is not a representor port.
> + * true the ethdev is a representor port.
> + */
> +static inline bool
> +rte_eth_dev_is_repr(const struct rte_eth_dev *dev)
> +{
> + return ((dev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR) != 0);
> +}
> +
There is a 'rte_eth_representor_id_get()' API above, can you move this
new one below it to group them together?
More information about the dev
mailing list