From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <jingjing.wu@intel.com>
Received: from mga03.intel.com (mga03.intel.com [134.134.136.65])
 by dpdk.org (Postfix) with ESMTP id 280B456AB
 for <dev@dpdk.org>; Fri,  8 May 2015 05:26:03 +0200 (CEST)
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga103.jf.intel.com with ESMTP; 07 May 2015 20:26:03 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.13,387,1427785200"; d="scan'208";a="707074709"
Received: from kmsmsx153.gar.corp.intel.com ([172.21.73.88])
 by fmsmga001.fm.intel.com with ESMTP; 07 May 2015 20:26:01 -0700
Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by
 KMSMSX153.gar.corp.intel.com (172.21.73.88) with Microsoft SMTP Server (TLS)
 id 14.3.224.2; Fri, 8 May 2015 11:26:01 +0800
Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.162]) by
 shsmsx102.ccr.corp.intel.com ([10.239.4.154]) with mapi id 14.03.0224.002;
 Fri, 8 May 2015 11:25:59 +0800
From: "Wu, Jingjing" <jingjing.wu@intel.com>
To: "Zhang, Helin" <helin.zhang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Thread-Topic: [PATCH v2 05/33] i40e/base: support of building both PF and VF
 driver together
Thread-Index: AQHQg1bm9h8CyB4SCE229tyzm4yQ6Z1xdrIQ
Date: Fri, 8 May 2015 03:25:59 +0000
Message-ID: <9BB6961774997848B5B42BEC655768F8C183CD@SHSMSX104.ccr.corp.intel.com>
References: <1429518150-28098-1-git-send-email-helin.zhang@intel.com>
 <1430406219-23901-1-git-send-email-helin.zhang@intel.com>
 <1430406219-23901-6-git-send-email-helin.zhang@intel.com>
In-Reply-To: <1430406219-23901-6-git-send-email-helin.zhang@intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Cc: "Kenguva, Monica" <monica.kenguva@intel.com>, "Murray,
 Steven J" <steven.j.murray@intel.com>, "Nelson,
 Shannon" <shannon.nelson@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2 05/33] i40e/base: support of building both
 PF and VF driver together
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 08 May 2015 03:26:03 -0000

Acked-by: Jingjing Wu <jingjing.wu@intel.com>

> -----Original Message-----
> From: Zhang, Helin
> Sent: Thursday, April 30, 2015 11:03 PM
> To: dev@dpdk.org
> Cc: Cao, Min; Xu, Qian Q; Wu, Jingjing; Liu, Jijiang; Kenguva, Monica; Pa=
tel,
> Rashmin N; Murray, Steven J; Nelson, Shannon; Zhang, Helin
> Subject: [PATCH v2 05/33] i40e/base: support of building both PF and VF
> driver together
>=20
> Macros of PF_DRIVER, VF_DRIVER and INTEGRATED_VF were defined to
> support building both PF and VF driver together. PF_DRIVER needs to be
> defined if a build is for PF only, while VF_DRIVER for VF only. PF_DRIVER=
,
> VF_DRIVER and INTEGRATED_VF are all needed for building both PF and VF
> driver together.
>=20
> Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> ---
>  lib/librte_pmd_i40e/Makefile              |  2 +-
>  lib/librte_pmd_i40e/i40e/i40e_adminq.c    | 20 ++++++++++----------
>  lib/librte_pmd_i40e/i40e/i40e_common.c    |  6 ++++--
>  lib/librte_pmd_i40e/i40e/i40e_prototype.h |  4 ++--
>  4 files changed, 17 insertions(+), 15 deletions(-)
>=20
> diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makefile
> index 86be3f7..75b5120 100644
> --- a/lib/librte_pmd_i40e/Makefile
> +++ b/lib/librte_pmd_i40e/Makefile
> @@ -37,7 +37,7 @@ include $(RTE_SDK)/mk/rte.vars.mk  LIB =3D
> librte_pmd_i40e.a
>=20
>  CFLAGS +=3D -O3
> -CFLAGS +=3D $(WERROR_FLAGS)
> +CFLAGS +=3D $(WERROR_FLAGS) -DPF_DRIVER -DVF_DRIVER -
> DINTEGRATED_VF
>=20
>  EXPORT_MAP :=3D rte_pmd_i40e_version.map
>=20
> diff --git a/lib/librte_pmd_i40e/i40e/i40e_adminq.c
> b/lib/librte_pmd_i40e/i40e/i40e_adminq.c
> index e8e762f..bbc6b65 100644
> --- a/lib/librte_pmd_i40e/i40e/i40e_adminq.c
> +++ b/lib/librte_pmd_i40e/i40e/i40e_adminq.c
> @@ -37,7 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
>  #include "i40e_adminq.h"
>  #include "i40e_prototype.h"
>=20
> -#ifndef VF_DRIVER
> +#ifdef PF_DRIVER
>  /**
>   * i40e_is_nvm_update_op - return true if this is an NVM update operatio=
n
>   * @desc: API request descriptor
> @@ -48,7 +48,7 @@ STATIC INLINE bool i40e_is_nvm_update_op(struct
> i40e_aq_desc *desc)
>  		desc->opcode =3D=3D
> CPU_TO_LE16(i40e_aqc_opc_nvm_update));
>  }
>=20
> -#endif /* VF_DRIVER */
> +#endif /* PF_DRIVER */
>  /**
>   *  i40e_adminq_init_regs - Initialize AdminQ registers
>   *  @hw: pointer to the hardware structure @@ -559,7 +559,7 @@ enum
> i40e_status_code i40e_shutdown_arq(struct i40e_hw *hw)  enum
> i40e_status_code i40e_init_adminq(struct i40e_hw *hw)  {
>  	enum i40e_status_code ret_code;
> -#ifndef VF_DRIVER
> +#ifdef PF_DRIVER
>  	u16 eetrack_lo, eetrack_hi;
>  	int retry =3D 0;
>  #endif
> @@ -593,7 +593,7 @@ enum i40e_status_code i40e_init_adminq(struct
> i40e_hw *hw)
>  	if (ret_code !=3D I40E_SUCCESS)
>  		goto init_adminq_free_asq;
>=20
> -#ifndef VF_DRIVER
> +#ifdef PF_DRIVER
>  	/* There are some cases where the firmware may not be quite
> ready
>  	 * for AdminQ operations, so we retry the AdminQ setup a few times
>  	 * if we see timeouts in this first AQ call.
> @@ -633,13 +633,13 @@ enum i40e_status_code i40e_init_adminq(struct
> i40e_hw *hw)
>=20
> I40E_HMC_PROFILE_DEFAULT,
>  						    0,
>  						    NULL);
> +#endif /* PF_DRIVER */
>  	ret_code =3D I40E_SUCCESS;
>=20
> -#endif /* VF_DRIVER */
>  	/* success! */
>  	goto init_adminq_exit;
>=20
> -#ifndef VF_DRIVER
> +#ifdef PF_DRIVER
>  init_adminq_free_arq:
>  	i40e_shutdown_arq(hw);
>  #endif
> @@ -772,7 +772,7 @@ enum i40e_status_code
> i40e_asq_send_command(struct i40e_hw *hw,
>  		goto asq_send_command_exit;
>  	}
>=20
> -#ifndef VF_DRIVER
> +#ifdef PF_DRIVER
>  	if (i40e_is_nvm_update_op(desc) && hw->aq.nvm_busy) {
>  		i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: NVM
> busy.\n");
>  		status =3D I40E_ERR_NVM;
> @@ -931,11 +931,11 @@ enum i40e_status_code
> i40e_asq_send_command(struct i40e_hw *hw,
>  		status =3D I40E_ERR_ADMIN_QUEUE_TIMEOUT;
>  	}
>=20
> -#ifndef VF_DRIVER
> +#ifdef PF_DRIVER
>  	if (!status && i40e_is_nvm_update_op(desc))
>  		hw->aq.nvm_busy =3D true;
>=20
> -#endif /* VF_DRIVER */
> +#endif /* PF_DRIVER */
>  asq_send_command_error:
>  	i40e_release_spinlock(&hw->aq.asq_spinlock);
>  asq_send_command_exit:
> @@ -1053,7 +1053,7 @@ clean_arq_element_out:
>  		*pending =3D (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc);
>  	i40e_release_spinlock(&hw->aq.arq_spinlock);
>=20
> -#ifndef VF_DRIVER
> +#ifdef PF_DRIVER
>  	if (i40e_is_nvm_update_op(&e->desc)) {
>  		hw->aq.nvm_busy =3D false;
>  		if (hw->aq.nvm_release_on_done) {
> diff --git a/lib/librte_pmd_i40e/i40e/i40e_common.c
> b/lib/librte_pmd_i40e/i40e/i40e_common.c
> index 23f14c1..491ffa8 100644
> --- a/lib/librte_pmd_i40e/i40e/i40e_common.c
> +++ b/lib/librte_pmd_i40e/i40e/i40e_common.c
> @@ -43,7 +43,7 @@ POSSIBILITY OF SUCH DAMAGE.
>   * This function sets the mac type of the adapter based on the
>   * vendor ID and device ID stored in the hw structure.
>   **/
> -#ifdef VF_DRIVER
> +#if defined(INTEGRATED_VF) || defined(VF_DRIVER)
>  enum i40e_status_code i40e_set_mac_type(struct i40e_hw *hw)  #else
> STATIC enum i40e_status_code i40e_set_mac_type(struct i40e_hw *hw)
> @@ -547,7 +547,7 @@ struct i40e_rx_ptype_decoded i40e_ptype_lookup[]
> =3D {
>  	I40E_PTT_UNUSED_ENTRY(255)
>  };
>=20
> -#ifndef VF_DRIVER
> +#ifdef PF_DRIVER
>=20
>  /**
>   * i40e_init_shared_code - Initialize the shared code @@ -4692,6 +4692,8
> @@ enum i40e_status_code i40e_aq_configure_partition_bw(struct
> i40e_hw *hw,
>=20
>  	return status;
>  }
> +#endif /* PF_DRIVER */
> +#ifdef VF_DRIVER
>=20
>  /**
>   * i40e_aq_send_msg_to_pf
> diff --git a/lib/librte_pmd_i40e/i40e/i40e_prototype.h
> b/lib/librte_pmd_i40e/i40e/i40e_prototype.h
> index 24e8d21..979adb9 100644
> --- a/lib/librte_pmd_i40e/i40e/i40e_prototype.h
> +++ b/lib/librte_pmd_i40e/i40e/i40e_prototype.h
> @@ -77,7 +77,7 @@ void i40e_resume_aq(struct i40e_hw *hw);  bool
> i40e_check_asq_alive(struct i40e_hw *hw);  enum i40e_status_code
> i40e_aq_queue_shutdown(struct i40e_hw *hw, bool unloading);
>=20
> -#ifndef VF_DRIVER
> +#ifdef PF_DRIVER
>=20
>  u32 i40e_led_get(struct i40e_hw *hw);
>  void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink); @@ -392,7
> +392,7 @@ enum i40e_status_code i40e_nvmupd_command(struct
> i40e_hw *hw,
>  					  struct i40e_nvm_access *cmd,
>  					  u8 *bytes, int *);
>  void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status); -#en=
dif
> /* VF_DRIVER */
> +#endif /* PF_DRIVER */
>=20
>  #if defined(I40E_QV) || defined(VF_DRIVER)  enum i40e_status_code
> i40e_set_mac_type(struct i40e_hw *hw);
> --
> 1.8.1.4