> -----Original Message-----
> From: dev <[email protected]> On Behalf Of Qiming Yang
> Sent: Wednesday, September 2, 2020 2:38 PM
> To: [email protected]
> Cc: Zhang, Qi Z <[email protected]>; Yang, Qiming
> <[email protected]>
> Subject: [dpdk-dev] [PATCH 1/2] net/ice: add dcf port representor
> infrastructure
> 
> Defines data structures and code to init/uninit VF representors during
> pci_probe and pci_remove respectively.
> Most of the dev_ops for the VF representor are just stubs for now and will be
> will be filled out in next patch
> 
> Signed-off-by: Qiming Yang <[email protected]>
> ---
>  drivers/net/ice/Makefile                 |   1 +
>  drivers/net/ice/ice_dcf_ethdev.c         |  66 +++++-
>  drivers/net/ice/ice_dcf_ethdev.h         |  11 +
>  drivers/net/ice/ice_dcf_vf_representor.c | 245 +++++++++++++++++++++++
>  4 files changed, 321 insertions(+), 2 deletions(-)  create mode 100644
> drivers/net/ice/ice_dcf_vf_representor.c
> 
> diff --git a/drivers/net/ice/Makefile b/drivers/net/ice/Makefile index
> 34cd4024b..f9eb34a87 100644
> --- a/drivers/net/ice/Makefile
> +++ b/drivers/net/ice/Makefile
> @@ -88,6 +88,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) +=
> ice_generic_flow.c
> 
>  SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_dcf.c
>  SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_dcf_ethdev.c
> +SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_dcf_vf_representor.c
>  SRCS-$(CONFIG_RTE_LIBRTE_ICE_PMD) += ice_dcf_parent.c
> 

<...>

> +
> +static int
> +ice_dcf_representor_tx_queue_setup(__rte_unused struct rte_eth_dev *dev,
> +                     __rte_unused uint16_t rx_queue_id,
Should be tx_queue_id which is more readable?

> +                     __rte_unused uint16_t nb_rx_desc,
Should be nb_tx_desc?

> +                     __rte_unused unsigned int socket_id,
> +                     __rte_unused const struct rte_eth_txconf *tx_conf) {
> +     return 0;
> +}
> +

<...>

> +
> +     /* No data-path, but need stub Rx/Tx functions to avoid crash
> +      * when testing with the likes of testpmd.
> +      */
> +     ethdev->rx_pkt_burst = ice_dcf_representor_rx_burst;
> +     ethdev->tx_pkt_burst = ice_dcf_representor_tx_burst;
> +
> +     ethdev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
> +     ethdev->data->representor_id = representor->vf_id;
> +
> +     struct rte_ether_addr mac_addr;
Why not move this to the beginning of the function?

> +
> +     memset(&mac_addr, 0, sizeof(mac_addr));
> +     ethdev->data->mac_addrs = &mac_addr;
> +
> +     return 0;
> +}
> +
> +int
> +ice_dcf_vf_representor_uninit(struct rte_eth_dev *ethdev) {
> +     ethdev->data->mac_addrs = NULL;
> +
> +     return 0;
> +}
> +
> --
> 2.17.1

Reply via email to