[dpdk-dev] [PATCH v4 1/9] ethdev: introduce representor type
Ajit Khaparde
ajit.khaparde at broadcom.com
Mon Jan 18 18:42:34 CET 2021
On Mon, Jan 18, 2021 at 3:17 AM Xueming Li <xuemingl at nvidia.com> wrote:
>
> To support more representor type, this patch introduces representor type
> enum. The enum is subject to extend for new types upcoming.
>
> Signed-off-by: Xueming Li <xuemingl at nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
> ---
> drivers/net/bnxt/bnxt_ethdev.c | 7 +++++++
> drivers/net/enic/enic_ethdev.c | 7 +++++++
> drivers/net/i40e/i40e_ethdev.c | 8 ++++++++
> drivers/net/ixgbe/ixgbe_ethdev.c | 8 ++++++++
> drivers/net/mlx5/linux/mlx5_os.c | 11 +++++++++++
> lib/librte_ethdev/ethdev_private.c | 5 +++++
> lib/librte_ethdev/rte_ethdev_driver.h | 9 +++++++++
> 7 files changed, 55 insertions(+)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index 74b0f3d1dc..d7c8b3ec07 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -5586,6 +5586,13 @@ static int bnxt_rep_port_probe(struct rte_pci_device *pci_dev,
> int i, ret = 0;
> struct rte_kvargs *kvlist = NULL;
>
> + if (eth_da->type == RTE_ETH_REPRESENTOR_NONE)
> + return 0;
> + if (eth_da->type != RTE_ETH_REPRESENTOR_VF) {
> + PMD_DRV_LOG(ERR, "unsupported representor type %d\n",
> + eth_da->type);
> + return -ENOTSUP;
> + }
> num_rep = eth_da->nb_representor_ports;
> if (num_rep > BNXT_MAX_VF_REPS) {
> PMD_DRV_LOG(ERR, "nb_representor_ports = %d > %d MAX VF REPS\n",
Ack. Thanks
:::: snip ::::
> +/** Ethernet device representor type */
> +enum rte_eth_representor_type {
> + RTE_ETH_REPRESENTOR_NONE, /**< not a representor. */
> + RTE_ETH_REPRESENTOR_VF, /**< representor of VF. */
> + RTE_ETH_REPRESENTOR_SF, /**< representor of SF. */
Till we get used to the terminology...
Can we also have SF = "Sub Function" mentioned in the docs or comments?
> + RTE_ETH_REPRESENTOR_PF, /**< representor of host PF. */
> +};
> +
> /** Generic Ethernet device arguments */
> struct rte_eth_devargs {
> uint16_t ports[RTE_MAX_ETHPORTS];
> @@ -1203,6 +1211,7 @@ struct rte_eth_devargs {
> /** representor port/s identifier to enable on device */
> uint16_t nb_representor_ports;
> /** number of ports in representor port field */
> + enum rte_eth_representor_type type; /* type of representor */
> };
>
> /**
> --
> 2.25.1
>
More information about the dev
mailing list