DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Liu, Mingxia" <mingxia.liu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Wu, Jingjing" <jingjing.wu@intel.com>,
	"Xing, Beilei" <beilei.xing@intel.com>,
	"Liu, Mingxia" <mingxia.liu@intel.com>
Subject: RE: [PATCH] net/idpf: refine idpf_dev_vport_init() function
Date: Fri, 30 Jun 2023 08:13:06 +0000	[thread overview]
Message-ID: <DM4PR11MB59945B30C79364F800D6F693D72AA@DM4PR11MB5994.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230626140606.490871-1-mingxia.liu@intel.com>



> -----Original Message-----
> From: Mingxia Liu <mingxia.liu@intel.com>
> Sent: Monday, June 26, 2023 10:06 PM
> To: dev@dpdk.org
> Cc: Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> Liu, Mingxia <mingxia.liu@intel.com>
> Subject: [PATCH] net/idpf: refine idpf_dev_vport_init() function
> 
> This patch adds 'cur_vports' and 'cur_vport_nb' updation in error path.
> 
> Signed-off-by: Mingxia Liu <mingxia.liu@intel.com>
> ---
>  drivers/net/idpf/idpf_ethdev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
> index 801da57472..3e66898aaf 100644
> --- a/drivers/net/idpf/idpf_ethdev.c
> +++ b/drivers/net/idpf/idpf_ethdev.c
> @@ -1300,6 +1300,8 @@ idpf_dev_vport_init(struct rte_eth_dev *dev, void
> *init_params)
>  err_mac_addrs:
>  	adapter->vports[param->idx] = NULL;  /* reset */
>  	idpf_vport_deinit(vport);
> +	adapter->cur_vports &= ~RTE_BIT32(param->devarg_id);
> +	adapter->cur_vport_nb--;

Can we move below two lines to the last?

adapter->cur_vports |= RTE_BIT32(param->devarg_id);
adapter->cur_vport_nb++;

so we don't need to revert them in error handle

>  err:
>  	return ret;
>  }
> --
> 2.34.1


  reply	other threads:[~2023-06-30  8:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26 14:06 Mingxia Liu
2023-06-30  8:13 ` Zhang, Qi Z [this message]
2023-06-30  8:14   ` Zhang, Qi Z
2023-06-30 10:46     ` Liu, Mingxia
2023-06-30 18:54 ` [PATCH v2] net/idpf: fix error path processing Mingxia Liu
2023-07-03  2:19   ` 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=DM4PR11MB59945B30C79364F800D6F693D72AA@DM4PR11MB5994.namprd11.prod.outlook.com \
    --to=qi.z.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=mingxia.liu@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).