From: "Xing, Beilei" <beilei.xing@intel.com>
To: "Zhang, Qi Z" <qi.z.zhang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH] common/idpf: remove unnecessary field in vport
Date: Wed, 26 Apr 2023 06:45:35 +0000 [thread overview]
Message-ID: <LV2PR11MB5997D63E452C8685F09436A5F7659@LV2PR11MB5997.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230420162038.637079-1-qi.z.zhang@intel.com>
> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Friday, April 21, 2023 12:21 AM
> To: Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>
> Subject: [PATCH] common/idpf: remove unnecessary field in vport
>
> Remove the pointer to rte_eth_dev instance, as 1. there is already a pointer to
> rte_eth_dev_data.
> 2. a pointer to rte_eth_dev will break multi-process usage.
Basically it's OK for me, do we need to add fix line?
>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
> drivers/common/idpf/idpf_common_device.h | 1 -
> drivers/net/cpfl/cpfl_ethdev.c | 4 ++--
> drivers/net/idpf/idpf_ethdev.c | 4 ++--
> 3 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/common/idpf/idpf_common_device.h
> b/drivers/common/idpf/idpf_common_device.h
> index 7a54f7c937..d29bcc71ab 100644
> --- a/drivers/common/idpf/idpf_common_device.h
> +++ b/drivers/common/idpf/idpf_common_device.h
> @@ -117,7 +117,6 @@ struct idpf_vport {
>
> struct virtchnl2_vport_stats eth_stats_offset;
>
> - void *dev;
> /* Event from ipf */
> bool link_up;
> uint32_t link_speed;
> diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c
> index f1d4425ce2..680c2326ec 100644
> --- a/drivers/net/cpfl/cpfl_ethdev.c
> +++ b/drivers/net/cpfl/cpfl_ethdev.c
> @@ -1061,7 +1061,8 @@ static void
> cpfl_handle_event_msg(struct idpf_vport *vport, uint8_t *msg, uint16_t
> msglen) {
> struct virtchnl2_event *vc_event = (struct virtchnl2_event *)msg;
> - struct rte_eth_dev *dev = (struct rte_eth_dev *)vport->dev;
> + struct rte_eth_dev_data *data = vport->dev_data;
> + struct rte_eth_dev *dev = &rte_eth_devices[data->port_id];
>
> if (msglen < sizeof(struct virtchnl2_event)) {
> PMD_DRV_LOG(ERR, "Error event");
> @@ -1245,7 +1246,6 @@ cpfl_dev_vport_init(struct rte_eth_dev *dev, void
> *init_params)
> vport->adapter = &adapter->base;
> vport->sw_idx = param->idx;
> vport->devarg_id = param->devarg_id;
> - vport->dev = dev;
>
> memset(&create_vport_info, 0, sizeof(create_vport_info));
> ret = idpf_vport_info_init(vport, &create_vport_info); diff --git
> a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c index
> e01eb3a2ec..38ad4e7ac0 100644
> --- a/drivers/net/idpf/idpf_ethdev.c
> +++ b/drivers/net/idpf/idpf_ethdev.c
> @@ -1024,7 +1024,8 @@ static void
> idpf_handle_event_msg(struct idpf_vport *vport, uint8_t *msg, uint16_t
> msglen) {
> struct virtchnl2_event *vc_event = (struct virtchnl2_event *)msg;
> - struct rte_eth_dev *dev = (struct rte_eth_dev *)vport->dev;
> + struct rte_eth_dev_data *data = vport->dev_data;
> + struct rte_eth_dev *dev = &rte_eth_devices[data->port_id];
>
> if (msglen < sizeof(struct virtchnl2_event)) {
> PMD_DRV_LOG(ERR, "Error event");
> @@ -1235,7 +1236,6 @@ idpf_dev_vport_init(struct rte_eth_dev *dev, void
> *init_params)
> vport->adapter = &adapter->base;
> vport->sw_idx = param->idx;
> vport->devarg_id = param->devarg_id;
> - vport->dev = dev;
>
> memset(&create_vport_info, 0, sizeof(create_vport_info));
> ret = idpf_vport_info_init(vport, &create_vport_info);
> --
> 2.31.1
next prev parent reply other threads:[~2023-04-26 6:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-20 16:20 Qi Zhang
2023-04-26 6:45 ` Xing, Beilei [this message]
2023-04-26 6:53 ` Zhang, Qi Z
2023-04-26 7:38 ` Xing, Beilei
2023-04-26 8:04 ` Zhang, Qi Z
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=LV2PR11MB5997D63E452C8685F09436A5F7659@LV2PR11MB5997.namprd11.prod.outlook.com \
--to=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=qi.z.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).