From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by dpdk.org (Postfix) with ESMTP id 6BA0DC464 for ; Mon, 27 Apr 2015 19:25:59 +0200 (CEST) Received: by wiun10 with SMTP id n10so98314085wiu.1 for ; Mon, 27 Apr 2015 10:25:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=ckMCYt2sy6PdzVHJLcJavTdzIGgihXOc61JU/ucc74o=; b=MvK5XUi9tmpWKYWlnso4p51pkU+6Y+nlrmhnaYmrCeSPdk2pRvefKsW7rDGjcysIRt 5Gbe8CWCcavzPBUz1ZrsuCQ/2JxnC8yU63080fQyhpF5qFrMbDgZHVAFND+WUHTG03qf RrFjg5Wbfw57pNmjGvTzvj8oWxpq43aOIsCEZcpS7TPYs4qvsL+3TR7eQSJiFjEPg9/0 LNSOmUmscwITrL7On78+WFHdiMK/uprDyo33Or2iBAv/xo+OYJC21EbQJpf3Zmr+Dwoi UJuM8Kq9HFw3px3uXrFMgltas/SJyBb0QVVVUzKNmtN/C710nt5EkDSEPhYPyf9OmUC+ nB+A== X-Gm-Message-State: ALoCoQlMirX3KBD/GLloe7Sge8q8a1cusWj75l7ShdBZ4+0BO28F3p+TCMwMpvv6avyXAdch46+S X-Received: by 10.194.190.49 with SMTP id gn17mr25013798wjc.11.1430155559196; Mon, 27 Apr 2015 10:25:59 -0700 (PDT) Received: from xps13.localnet (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id dz4sm12503478wib.17.2015.04.27.10.25.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Apr 2015 10:25:58 -0700 (PDT) From: Thomas Monjalon To: Helin Zhang Date: Mon, 27 Apr 2015 19:25:16 +0200 Message-ID: <1673322.EHLn9aXppT@xps13> Organization: 6WIND User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; ) In-Reply-To: <1429518150-28098-12-git-send-email-helin.zhang@intel.com> References: <1429518150-28098-1-git-send-email-helin.zhang@intel.com> <1429518150-28098-12-git-send-email-helin.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Cc: dev@dpdk.org, steven.j.murray@intel.com, chiu-pi.shih@intel.com, monica.kenguva@intel.com Subject: Re: [dpdk-dev] [PATCH 11/18] i40e: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Apr 2015 17:25:59 -0000 2015-04-20 16:22, Helin Zhang: > 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 PF and VF driver together. >=20 > Signed-off-by: Helin Zhang As this patch is mostly reversing the logic #=EEfndef to #ifdef, it seems the title is not accurate. Is it really adding a new support or is it only changing the compilation logic? About title, please use i40e/base: to distinguish patches on the base d= river from the specific PMD ones. > --- > lib/librte_pmd_i40e/Makefile | 2 +- > lib/librte_pmd_i40e/i40e/i40e_adminq.c | 14 +++++++------- > lib/librte_pmd_i40e/i40e/i40e_common.c | 6 ++++-- > lib/librte_pmd_i40e/i40e/i40e_prototype.h | 4 ++-- > 4 files changed, 14 insertions(+), 12 deletions(-) >=20 > diff --git a/lib/librte_pmd_i40e/Makefile b/lib/librte_pmd_i40e/Makef= ile > index a921bf1..22f0716 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 91b3568..8f9e870 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 oper= ation > * @desc: API request descriptor > @@ -48,7 +48,7 @@ STATIC INLINE bool i40e_is_nvm_update_op(struct i40= e_aq_desc *desc) > =09=09desc->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 i4= 0e_hw *hw) > enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw) > { > =09enum i40e_status_code ret_code; > -#ifndef VF_DRIVER > +#ifdef PF_DRIVER > =09u16 eetrack_lo, eetrack_hi; > =09int retry =3D 0; > #endif > @@ -592,7 +592,7 @@ enum i40e_status_code i40e_init_adminq(struct i40= e_hw *hw) > =09if (ret_code !=3D I40E_SUCCESS) > =09=09goto init_adminq_free_asq; > =20 > -#ifndef VF_DRIVER > +#ifdef PF_DRIVER > #ifdef INTEGRATED_VF > =09/* VF has no need of firmware */ > =09if (i40e_is_vf(hw)) > @@ -640,13 +640,13 @@ enum i40e_status_code i40e_init_adminq(struct i= 40e_hw *hw) > =09=09=09=09=09=09 I40E_HMC_PROFILE_DEFAULT, > =09=09=09=09=09=09 0, > =09=09=09=09=09=09 NULL); > +#endif /* PF_DRIVER */ > =09ret_code =3D I40E_SUCCESS; > =20 > -#endif /* VF_DRIVER */ > =09/* success! */ > =09goto init_adminq_exit; > =20 > -#ifndef VF_DRIVER > +#ifdef PF_DRIVER > init_adminq_free_arq: > =09i40e_shutdown_arq(hw); > #endif > @@ -1044,7 +1044,7 @@ clean_arq_element_out: > =09=09*pending =3D (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc);= > =09i40e_release_spinlock(&hw->aq.arq_spinlock); > =20 > -#ifndef VF_DRIVER > +#ifdef PF_DRIVER > =09if (i40e_is_nvm_update_op(&e->desc)) { > =09=09if (hw->aq.nvm_release_on_done) { > =09=09=09i40e_release_nvm(hw); > diff --git a/lib/librte_pmd_i40e/i40e/i40e_common.c b/lib/librte_pmd_= i40e/i40e/i40e_common.c > index 3dd8f04..7a322f1 100644 > --- a/lib/librte_pmd_i40e/i40e/i40e_common.c > +++ b/lib/librte_pmd_i40e/i40e/i40e_common.c > @@ -44,7 +44,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) > @@ -564,7 +564,7 @@ struct i40e_rx_ptype_decoded i40e_ptype_lookup[] = =3D { > =09I40E_PTT_UNUSED_ENTRY(255) > }; > =20 > -#ifndef VF_DRIVER > +#ifdef PF_DRIVER > =20 > /** > * i40e_init_shared_code - Initialize the shared code > @@ -4771,6 +4771,8 @@ enum i40e_status_code i40e_aq_configure_partiti= on_bw(struct i40e_hw *hw, > =20 > =09return 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_p= md_i40e/i40e/i40e_prototype.h > index 79f4e38..d143183 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, boo= l 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); > @@ -401,7 +401,7 @@ enum i40e_status_code i40e_nvmupd_command(struct = i40e_hw *hw, > =09=09=09=09=09 struct i40e_nvm_access *cmd, > =09=09=09=09=09 u8 *bytes, int *); > void i40e_set_pci_config_data(struct i40e_hw *hw, u16 link_status); > -#endif /* 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); >=20