> -----Original Message-----
> From: Zhang, Qi Z <[email protected]>
> Sent: Sunday, January 8, 2023 8:11 PM
> To: Xing, Beilei <[email protected]>; Wu, Jingjing <[email protected]>
> Cc: [email protected]; Wu, Wenjun1 <[email protected]>
> Subject: RE: [PATCH v2 05/15] common/idpf: add vport init/deinit
>
>
>
> > -----Original Message-----
> > From: Xing, Beilei <[email protected]>
> > Sent: Friday, January 6, 2023 5:16 PM
> > To: Wu, Jingjing <[email protected]>
> > Cc: [email protected]; Zhang, Qi Z <[email protected]>; Xing, Beilei
> > <[email protected]>; Wu, Wenjun1 <[email protected]>
> > Subject: [PATCH v2 05/15] common/idpf: add vport init/deinit
> >
> > From: Beilei Xing <[email protected]>
> >
> > Add vport init/deinit in common module.
> >
> > Signed-off-by: Wenjun Wu <[email protected]>
> > Signed-off-by: Beilei Xing <[email protected]>
> > ---
> > 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?
>
Make sense, will update in the next version.