[PATCH v2 05/15] common/idpf: add vport init/deinit

Zhang, Qi Z qi.z.zhang at intel.com
Sun Jan 8 13:10:47 CET 2023



> -----Original Message-----
> From: Xing, Beilei <beilei.xing at intel.com>
> Sent: Friday, January 6, 2023 5:16 PM
> To: Wu, Jingjing <jingjing.wu at intel.com>
> Cc: dev at dpdk.org; Zhang, Qi Z <qi.z.zhang at intel.com>; Xing, Beilei
> <beilei.xing at intel.com>; Wu, Wenjun1 <wenjun1.wu at intel.com>
> Subject: [PATCH v2 05/15] common/idpf: add vport init/deinit
> 
> From: Beilei Xing <beilei.xing at intel.com>
> 
> Add vport init/deinit in common module.
> 
> Signed-off-by: Wenjun Wu <wenjun1.wu at intel.com>
> Signed-off-by: Beilei Xing <beilei.xing at intel.com>
> ---
>  drivers/common/idpf/idpf_common_device.c   | 128 +++++++++++++++++++
>  drivers/common/idpf/idpf_common_device.h   |   8 ++
>  drivers/common/idpf/idpf_common_virtchnl.c |  16 +--
>  drivers/common/idpf/idpf_common_virtchnl.h |   2 -
>  drivers/common/idpf/version.map            |   4 +-
>  drivers/net/idpf/idpf_ethdev.c             | 138 ++-------------------
>  6 files changed, 156 insertions(+), 140 deletions(-)
> 
> diff --git a/drivers/common/idpf/idpf_common_device.c
> b/drivers/common/idpf/idpf_common_device.c
> index b2b42443e4..2aad9bcdd3 100644
> --- a/drivers/common/idpf/idpf_common_device.c
> +++ b/drivers/common/idpf/idpf_common_device.c
> @@ -158,4 +158,132 @@ idpf_adapter_deinit(struct idpf_adapter *adapter)
>  	return 0;
>  }
> 
> +int
> +idpf_vport_init(struct idpf_vport *vport,
> +		struct virtchnl2_create_vport *create_vport_info,
> +		void *dev_data)
> +{
> +	struct virtchnl2_create_vport *vport_info;
> +	int i, type, ret;
> +
> +	vport->vport_info = rte_zmalloc(NULL, IDPF_DFLT_MBX_BUF_SIZE, 0);

Can we embed vport_info structure into the vport structure?
Seems its not necessary to malloc/free the vport_info which always associated with a vport structure?




More information about the dev mailing list