From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 15F3FA04BC for ; Thu, 8 Oct 2020 15:13:06 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D3FAF1C11E; Thu, 8 Oct 2020 15:13:04 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 1DB4C1BF63; Thu, 8 Oct 2020 15:12:59 +0200 (CEST) IronPort-SDR: 9SPvp1feGQA7Bg+kicP1+rKoZ9s3PnDnw/OdDgyFJ29vT0e/QWZo/xLSJmp6/2cwOggpFKP18d 28saJSLK6esA== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="165440817" X-IronPort-AV: E=Sophos;i="5.77,350,1596524400"; d="scan'208";a="165440817" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2020 06:12:57 -0700 IronPort-SDR: BPeEXiqpGbAOtQIE3cqATcsV8n3KPAcpw2MVu+J5QZTN/nFLkjQ6WFChcYiY4d1eX3UMOes7ki kI798P9LgnrQ== X-IronPort-AV: E=Sophos;i="5.77,350,1596524400"; d="scan'208";a="312204771" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.226.103]) ([10.213.226.103]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2020 06:12:56 -0700 To: "Sachin Saxena (OSS)" , Hemant Agrawal , Chenxu Di Cc: Priyanka Jain , dev@dpdk.org, stable@dpdk.org References: <20200917084357.14717-1-chenxux.di@intel.com> <20201006171638.2636145-1-ferruh.yigit@intel.com> From: Ferruh Yigit Message-ID: <99c18cb1-855b-f034-ede7-4f9686d80110@intel.com> Date: Thu, 8 Oct 2020 14:12:52 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-stable] [PATCH v3] net/dpaa2: fix build error about timesync functions X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On 10/8/2020 3:24 AM, Sachin Saxena (OSS) wrote: [please don't top post, I moved reply to down] > > On 06-Oct-20 10:46 PM, Ferruh Yigit wrote: >> From: Chenxu Di >> >> Some timesync related source files are built only when >> 'RTE_LIBRTE_IEEE1588' config is set, which is missing in meson. >> >> Building with '-DRTE_LIBRTE_IEEE1588' cflag will enable timesync >> functionality in the files that are build, but it won't build files >> that require 'RTE_LIBRTE_IEEE1588' config. >> This causes the build error. >> >> Fixing by removing config check in meson file and build all .c files by >> default, but wrap relevant code part with 'RTE_LIBRTE_IEEE1588' macro. >> >> Also removing 'RTE_LIBRTE_IEEE1588' ifdef around some fields of the data >> structures, to not require finer grained macro wraps on the functions >> using them. >> Since the registration of the function disabled with macro check, having >> functions compiled shouldn't affect the functionality. >> >> Fixes: 184c39d16568 ("net/dpaa2: add DPRTC sub-module") >> Cc:stable@dpdk.org >> >> Signed-off-by: Chenxu Di >> Signed-off-by: Ferruh Yigit >> --- >> drivers/net/dpaa2/dpaa2_ethdev.h | 4 ---- >> drivers/net/dpaa2/dpaa2_ptp.c | 2 ++ >> drivers/net/dpaa2/meson.build | 7 ++----- >> 3 files changed, 4 insertions(+), 9 deletions(-) >> >> diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h >> index e577355d57..94cf253827 100644 >> --- a/drivers/net/dpaa2/dpaa2_ethdev.h >> +++ b/drivers/net/dpaa2/dpaa2_ethdev.h >> @@ -160,7 +160,6 @@ struct dpaa2_dev_priv { >> uint16_t ss_offset; >> uint64_t ss_iova; >> uint64_t ss_param_iova; >> -#if defined(RTE_LIBRTE_IEEE1588) >> /*stores timestamp of last received packet on dev*/ >> uint64_t rx_timestamp; >> /*stores timestamp of last received tx confirmation packet on dev*/ >> @@ -169,7 +168,6 @@ struct dpaa2_dev_priv { >> * it corresponds to last packet transmitted >> */ >> struct dpaa2_queue *next_tx_conf_queue; >> -#endif >> >> struct rte_eth_dev *eth_dev; /**< Pointer back to holding ethdev */ >> >> @@ -227,7 +225,6 @@ void dpaa2_dev_free_eqresp_buf(uint16_t eqresp_ci); >> void dpaa2_flow_clean(struct rte_eth_dev *dev); >> uint16_t dpaa2_dev_tx_conf(void *queue) __rte_unused; >> >> -#if defined(RTE_LIBRTE_IEEE1588) >> int dpaa2_timesync_enable(struct rte_eth_dev *dev); >> int dpaa2_timesync_disable(struct rte_eth_dev *dev); >> int dpaa2_timesync_read_time(struct rte_eth_dev *dev, >> @@ -240,5 +237,4 @@ int dpaa2_timesync_read_rx_timestamp(struct rte_eth_dev *dev, >> uint32_t flags __rte_unused); >> int dpaa2_timesync_read_tx_timestamp(struct rte_eth_dev *dev, >> struct timespec *timestamp); >> -#endif >> #endif /* _DPAA2_ETHDEV_H */ >> diff --git a/drivers/net/dpaa2/dpaa2_ptp.c b/drivers/net/dpaa2/dpaa2_ptp.c >> index f58eedb314..899dd5d442 100644 >> --- a/drivers/net/dpaa2/dpaa2_ptp.c >> +++ b/drivers/net/dpaa2/dpaa2_ptp.c >> @@ -129,6 +129,7 @@ int dpaa2_timesync_read_rx_timestamp(struct rte_eth_dev *dev, >> return 0; >> } >> >> +#if defined(RTE_LIBRTE_IEEE1588) >> static int >> dpaa2_create_dprtc_device(int vdev_fd __rte_unused, >> struct vfio_device_info *obj_info __rte_unused, >> @@ -179,3 +180,4 @@ static struct rte_dpaa2_object rte_dpaa2_dprtc_obj = { >> }; >> >> RTE_PMD_REGISTER_DPAA2_OBJECT(dprtc, rte_dpaa2_dprtc_obj); >> +#endif >> diff --git a/drivers/net/dpaa2/meson.build b/drivers/net/dpaa2/meson.build >> index 6dd0eb274c..4312aa73f7 100644 >> --- a/drivers/net/dpaa2/meson.build >> +++ b/drivers/net/dpaa2/meson.build >> @@ -13,15 +13,12 @@ sources = files('base/dpaa2_hw_dpni.c', >> 'dpaa2_flow.c', >> 'dpaa2_rxtx.c', >> 'dpaa2_sparser.c', >> + 'dpaa2_ptp.c', >> + 'mc/dprtc.c', >> 'mc/dpkg.c', >> 'mc/dpdmux.c', >> 'mc/dpni.c') >> >> -if dpdk_conf.has('RTE_LIBRTE_IEEE1588') >> - sources += files('mc/dprtc.c') >> - sources += files('dpaa2_ptp.c') >> -endif >> - >> includes += include_directories('base', 'mc') >> >> install_headers('rte_pmd_dpaa2.h') > > Following change should also be handled as suggested by Ferruh in earlier. > > diff --git a/drivers/net/dpaa2/dpaa2_ptp.c b/drivers/net/dpaa2/dpaa2_ptp.c > index 9f755e84bf..0e44d4c6bf 100644 > --- a/drivers/net/dpaa2/dpaa2_ptp.c > +++ b/drivers/net/dpaa2/dpaa2_ptp.c > @@ -178,4 +178,6 @@ static struct rte_dpaa2_object rte_dpaa2_dprtc_obj = { > .create = dpaa2_create_dprtc_device, > }; > > +#if defined(RTE_LIBRTE_IEEE1588) > RTE_PMD_REGISTER_DPAA2_OBJECT(dprtc, rte_dpaa2_dprtc_obj); > +#endif > I think it is already covered in the patch. Since just wrapping the macro cause a warning on unused static variable/function, I need to wrap 'rte_dpaa2_dprtc_obj' & 'dpaa2_create_dprtc_device()' too along with above macro you mentioned.