DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wu, Jingjing" <jingjing.wu@intel.com>
To: "Xing, Beilei" <beilei.xing@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH v4 1/2] common/idpf: move PF specific functions from common init
Date: Sun, 23 Apr 2023 08:25:43 +0000	[thread overview]
Message-ID: <MW3PR11MB4587930DE08BCC9F04340AE5E3669@MW3PR11MB4587.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230406074245.82991-2-beilei.xing@intel.com>



> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Thursday, April 6, 2023 3:43 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>
> Subject: [PATCH v4 1/2] common/idpf: move PF specific functions from common init
> 
> From: Beilei Xing <beilei.xing@intel.com>
> 
> Move PF reset and PF mailbox initialization functions from
> idpf_adapter_init function to xxxx_adapter_ext_init function,
> since they're different between PF and VF support.
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> ---
>  drivers/common/idpf/idpf_common_device.c | 72 +++++-------------------
>  drivers/common/idpf/idpf_common_device.h | 11 ++++
>  drivers/common/idpf/version.map          |  5 ++
>  drivers/net/cpfl/cpfl_ethdev.c           | 51 +++++++++++++++++
>  drivers/net/idpf/idpf_ethdev.c           | 51 +++++++++++++++++
>  5 files changed, 131 insertions(+), 59 deletions(-)
> 
> diff --git a/drivers/common/idpf/idpf_common_device.c
> b/drivers/common/idpf/idpf_common_device.c
> index c5e7bbf66c..3b58bdd41e 100644
> --- a/drivers/common/idpf/idpf_common_device.c
> +++ b/drivers/common/idpf/idpf_common_device.c
> @@ -6,8 +6,8 @@
>  #include <idpf_common_device.h>
>  #include <idpf_common_virtchnl.h>
> 
> -static void
> -idpf_reset_pf(struct idpf_hw *hw)
> +void
> +idpf_hw_pf_reset(struct idpf_hw *hw)
>  {
>  	uint32_t reg;
> 
> @@ -15,9 +15,8 @@ idpf_reset_pf(struct idpf_hw *hw)
>  	IDPF_WRITE_REG(hw, PFGEN_CTRL, (reg | PFGEN_CTRL_PFSWR));
>  }
> 
> -#define IDPF_RESET_WAIT_CNT 100
> -static int
> -idpf_check_pf_reset_done(struct idpf_hw *hw)
> +int
> +idpf_hw_pf_reset_check(struct idpf_hw *hw)
>  {
>  	uint32_t reg;
>  	int i;
> @@ -33,48 +32,13 @@ idpf_check_pf_reset_done(struct idpf_hw *hw)
>  	return -EBUSY;
>  }
> 
> -#define CTLQ_NUM 2
> -static int
> -idpf_init_mbx(struct idpf_hw *hw)
> +int
> +idpf_hw_mbx_init(struct idpf_hw *hw, struct idpf_ctlq_create_info *ctlq_info)
>  {
> -	struct idpf_ctlq_create_info ctlq_info[CTLQ_NUM] = {
> -		{
> -			.type = IDPF_CTLQ_TYPE_MAILBOX_TX,
> -			.id = IDPF_CTLQ_ID,
> -			.len = IDPF_CTLQ_LEN,
> -			.buf_size = IDPF_DFLT_MBX_BUF_SIZE,
> -			.reg = {
> -				.head = PF_FW_ATQH,
> -				.tail = PF_FW_ATQT,
> -				.len = PF_FW_ATQLEN,
> -				.bah = PF_FW_ATQBAH,
> -				.bal = PF_FW_ATQBAL,
> -				.len_mask = PF_FW_ATQLEN_ATQLEN_M,
> -				.len_ena_mask = PF_FW_ATQLEN_ATQENABLE_M,
> -				.head_mask = PF_FW_ATQH_ATQH_M,
> -			}
> -		},
> -		{
> -			.type = IDPF_CTLQ_TYPE_MAILBOX_RX,
> -			.id = IDPF_CTLQ_ID,
> -			.len = IDPF_CTLQ_LEN,
> -			.buf_size = IDPF_DFLT_MBX_BUF_SIZE,
> -			.reg = {
> -				.head = PF_FW_ARQH,
> -				.tail = PF_FW_ARQT,
> -				.len = PF_FW_ARQLEN,
> -				.bah = PF_FW_ARQBAH,
> -				.bal = PF_FW_ARQBAL,
> -				.len_mask = PF_FW_ARQLEN_ARQLEN_M,
> -				.len_ena_mask = PF_FW_ARQLEN_ARQENABLE_M,
> -				.head_mask = PF_FW_ARQH_ARQH_M,
> -			}
> -		}
> -	};
>  	struct idpf_ctlq_info *ctlq;
>  	int ret;
> 
> -	ret = idpf_ctlq_init(hw, CTLQ_NUM, ctlq_info);
> +	ret = idpf_ctlq_init(hw, IDPF_CTLQ_NUM, ctlq_info);
>  	if (ret != 0)
>  		return ret;
> 
> @@ -96,6 +60,12 @@ idpf_init_mbx(struct idpf_hw *hw)
>  	return ret;
>  }

You can check the device id if idpf_hw, and then decide how to init ctlq and then this function can also be consumed by VF driver. No need to move them out from common. The same as other functions.
> 


  reply	other threads:[~2023-04-23  8:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-21  6:53 [PATCH] " beilei.xing
2023-03-21  7:07 ` [PATCH v2] " beilei.xing
2023-04-04 12:41   ` [PATCH v3 0/2] refine common module beilei.xing
2023-04-04 12:41     ` [PATCH v3 1/2] common/idpf: move PF specific functions from common init beilei.xing
2023-04-04 12:41     ` [PATCH v3 2/2] common/idpf: refine capability get beilei.xing
2023-04-06  7:42     ` [PATCH v4 0/2] refine common module beilei.xing
2023-04-06  7:42       ` [PATCH v4 1/2] common/idpf: move PF specific functions from common init beilei.xing
2023-04-23  8:25         ` Wu, Jingjing [this message]
2023-04-06  7:42       ` [PATCH v4 2/2] common/idpf: refine capability get beilei.xing
2023-04-24  8:08       ` [PATCH v5] " beilei.xing
2023-04-26  5:17         ` Wu, Jingjing
2023-04-26  8:11           ` 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=MW3PR11MB4587930DE08BCC9F04340AE5E3669@MW3PR11MB4587.namprd11.prod.outlook.com \
    --to=jingjing.wu@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    /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).