From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from alln-iport-1.cisco.com (alln-iport-1.cisco.com [173.37.142.88]) by dpdk.org (Postfix) with ESMTP id D37075A6E for ; Wed, 15 May 2019 15:05:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=4020; q=dns/txt; s=iport; t=1557925535; x=1559135135; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=s+ytVIe2TbWl+SAmxUTw8lx60cxxUnTecEzu3ArCAAY=; b=Gb+Ip9Ic19pb/YOl5rDB9ClsGH0S5U/DU2iablaRdAx7vLGpGtZxSuR4 zeZjxx/DGJpQqZslh0lw4C12krRCQfjZ3p8d2P/G1MU/1fycif8tvlf/I cuzVLXFBeiQOH71kTLouCJkt49NljmL8IF0W4NqV2nfE0OsB1QX3WTaVV A=; X-IronPort-AV: E=Sophos;i="5.60,472,1549929600"; d="scan'208";a="271463183" Received: from rcdn-core-3.cisco.com ([173.37.93.154]) by alln-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 15 May 2019 13:05:33 +0000 Received: from cpp-rtpbld-31.cisco.com (cpp-rtpbld-31.cisco.com [172.18.5.114]) by rcdn-core-3.cisco.com (8.15.2/8.15.2) with ESMTP id x4FD5Xox031393; Wed, 15 May 2019 13:05:33 GMT Received: by cpp-rtpbld-31.cisco.com (Postfix, from userid 140087) id 8850DA9C; Wed, 15 May 2019 09:05:33 -0400 (EDT) From: David Harton To: dev@dpdk.org, beilei.xing@intel.com, qi.z.zhang@intel.com, bruce.richardson@intel.com Cc: David Harton Date: Wed, 15 May 2019 09:05:12 -0400 Message-Id: <20190515130512.6366-1-dharton@cisco.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Outbound-SMTP-Client: 172.18.5.114, cpp-rtpbld-31.cisco.com X-Outbound-Node: rcdn-core-3.cisco.com Subject: [dpdk-dev] [PATCH] net/i40e: Eliminate weak symbols in i40e_rxtx.c X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 May 2019 13:05:35 -0000 Use of weak symbols can hide makefile errors especially when custom makefiles are used. Removing the use of weak symbols to avoid a stub function being linked in production code. Signed-off-by: David Harton --- drivers/net/i40e/Makefile | 1 + drivers/net/i40e/i40e_rxtx.c | 52 +++++++++++++++++++----------------- drivers/net/i40e/meson.build | 2 ++ 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile index 3f869a8d6..cbcfce099 100644 --- a/drivers/net/i40e/Makefile +++ b/drivers/net/i40e/Makefile @@ -106,6 +106,7 @@ endif ifeq ($(CC_AVX2_SUPPORT), 1) SRCS-$(CONFIG_RTE_LIBRTE_I40E_INC_VECTOR) += i40e_rxtx_vec_avx2.c + CFLAGS_i40e_rxtx.o += -DCC_AVX2_SUPPORT endif # install this header file diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 1489552da..cbf31ec88 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -3181,14 +3181,15 @@ i40e_set_default_pctype_table(struct rte_eth_dev *dev) } } +#ifndef RTE_LIBRTE_I40E_INC_VECTOR /* Stubs needed for linkage when CONFIG_RTE_LIBRTE_I40E_INC_VECTOR is set to 'n' */ -__rte_weak int +int i40e_rx_vec_dev_conf_condition_check(struct rte_eth_dev __rte_unused *dev) { return -1; } -__rte_weak uint16_t +uint16_t i40e_recv_pkts_vec( void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts, @@ -3197,7 +3198,7 @@ i40e_recv_pkts_vec( return 0; } -__rte_weak uint16_t +uint16_t i40e_recv_scattered_pkts_vec( void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts, @@ -3206,52 +3207,55 @@ i40e_recv_scattered_pkts_vec( return 0; } -__rte_weak uint16_t -i40e_recv_pkts_vec_avx2(void __rte_unused *rx_queue, - struct rte_mbuf __rte_unused **rx_pkts, - uint16_t __rte_unused nb_pkts) -{ - return 0; -} - -__rte_weak uint16_t -i40e_recv_scattered_pkts_vec_avx2(void __rte_unused *rx_queue, - struct rte_mbuf __rte_unused **rx_pkts, - uint16_t __rte_unused nb_pkts) -{ - return 0; -} - -__rte_weak int +int i40e_rxq_vec_setup(struct i40e_rx_queue __rte_unused *rxq) { return -1; } -__rte_weak int +int i40e_txq_vec_setup(struct i40e_tx_queue __rte_unused *txq) { return -1; } -__rte_weak void +void i40e_rx_queue_release_mbufs_vec(struct i40e_rx_queue __rte_unused*rxq) { return; } -__rte_weak uint16_t +uint16_t i40e_xmit_fixed_burst_vec(void __rte_unused * tx_queue, struct rte_mbuf __rte_unused **tx_pkts, uint16_t __rte_unused nb_pkts) { return 0; } +#endif /* ifndef RTE_LIBRTE_I40E_INC_VECTOR */ + +#ifndef CC_AVX2_SUPPORT +uint16_t +i40e_recv_pkts_vec_avx2(void __rte_unused *rx_queue, + struct rte_mbuf __rte_unused **rx_pkts, + uint16_t __rte_unused nb_pkts) +{ + return 0; +} -__rte_weak uint16_t +uint16_t +i40e_recv_scattered_pkts_vec_avx2(void __rte_unused *rx_queue, + struct rte_mbuf __rte_unused **rx_pkts, + uint16_t __rte_unused nb_pkts) +{ + return 0; +} + +uint16_t i40e_xmit_pkts_vec_avx2(void __rte_unused * tx_queue, struct rte_mbuf __rte_unused **tx_pkts, uint16_t __rte_unused nb_pkts) { return 0; } +#endif /* ifndef CC_AVX2_SUPPORT */ diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build index d783f3626..dcbca39bf 100644 --- a/drivers/net/i40e/meson.build +++ b/drivers/net/i40e/meson.build @@ -35,8 +35,10 @@ if arch_subdir == 'x86' # a. we have AVX supported in minimum instruction set baseline # b. it's not minimum instruction set, but supported by compiler if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX2') + cflags += ['-DCC_AVX2_SUPPORT'] sources += files('i40e_rxtx_vec_avx2.c') elif cc.has_argument('-mavx2') + cflags += ['-DCC_AVX2_SUPPORT'] i40e_avx2_lib = static_library('i40e_avx2_lib', 'i40e_rxtx_vec_avx2.c', dependencies: [static_rte_ethdev, -- 2.19.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id DD4A1A00E6 for ; Wed, 15 May 2019 15:05:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 83D935F2E; Wed, 15 May 2019 15:05:36 +0200 (CEST) Received: from alln-iport-1.cisco.com (alln-iport-1.cisco.com [173.37.142.88]) by dpdk.org (Postfix) with ESMTP id D37075A6E for ; Wed, 15 May 2019 15:05:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=4020; q=dns/txt; s=iport; t=1557925535; x=1559135135; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=s+ytVIe2TbWl+SAmxUTw8lx60cxxUnTecEzu3ArCAAY=; b=Gb+Ip9Ic19pb/YOl5rDB9ClsGH0S5U/DU2iablaRdAx7vLGpGtZxSuR4 zeZjxx/DGJpQqZslh0lw4C12krRCQfjZ3p8d2P/G1MU/1fycif8tvlf/I cuzVLXFBeiQOH71kTLouCJkt49NljmL8IF0W4NqV2nfE0OsB1QX3WTaVV A=; X-IronPort-AV: E=Sophos;i="5.60,472,1549929600"; d="scan'208";a="271463183" Received: from rcdn-core-3.cisco.com ([173.37.93.154]) by alln-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 15 May 2019 13:05:33 +0000 Received: from cpp-rtpbld-31.cisco.com (cpp-rtpbld-31.cisco.com [172.18.5.114]) by rcdn-core-3.cisco.com (8.15.2/8.15.2) with ESMTP id x4FD5Xox031393; Wed, 15 May 2019 13:05:33 GMT Received: by cpp-rtpbld-31.cisco.com (Postfix, from userid 140087) id 8850DA9C; Wed, 15 May 2019 09:05:33 -0400 (EDT) From: David Harton To: dev@dpdk.org, beilei.xing@intel.com, qi.z.zhang@intel.com, bruce.richardson@intel.com Cc: David Harton Date: Wed, 15 May 2019 09:05:12 -0400 Message-Id: <20190515130512.6366-1-dharton@cisco.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Outbound-SMTP-Client: 172.18.5.114, cpp-rtpbld-31.cisco.com X-Outbound-Node: rcdn-core-3.cisco.com Subject: [dpdk-dev] [PATCH] net/i40e: Eliminate weak symbols in i40e_rxtx.c X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190515130512.xFGWEQzFPoT3_G5v2UffJQbG0T3D2scn45WSEzTqYi0@z> Use of weak symbols can hide makefile errors especially when custom makefiles are used. Removing the use of weak symbols to avoid a stub function being linked in production code. Signed-off-by: David Harton --- drivers/net/i40e/Makefile | 1 + drivers/net/i40e/i40e_rxtx.c | 52 +++++++++++++++++++----------------- drivers/net/i40e/meson.build | 2 ++ 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile index 3f869a8d6..cbcfce099 100644 --- a/drivers/net/i40e/Makefile +++ b/drivers/net/i40e/Makefile @@ -106,6 +106,7 @@ endif ifeq ($(CC_AVX2_SUPPORT), 1) SRCS-$(CONFIG_RTE_LIBRTE_I40E_INC_VECTOR) += i40e_rxtx_vec_avx2.c + CFLAGS_i40e_rxtx.o += -DCC_AVX2_SUPPORT endif # install this header file diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 1489552da..cbf31ec88 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -3181,14 +3181,15 @@ i40e_set_default_pctype_table(struct rte_eth_dev *dev) } } +#ifndef RTE_LIBRTE_I40E_INC_VECTOR /* Stubs needed for linkage when CONFIG_RTE_LIBRTE_I40E_INC_VECTOR is set to 'n' */ -__rte_weak int +int i40e_rx_vec_dev_conf_condition_check(struct rte_eth_dev __rte_unused *dev) { return -1; } -__rte_weak uint16_t +uint16_t i40e_recv_pkts_vec( void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts, @@ -3197,7 +3198,7 @@ i40e_recv_pkts_vec( return 0; } -__rte_weak uint16_t +uint16_t i40e_recv_scattered_pkts_vec( void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts, @@ -3206,52 +3207,55 @@ i40e_recv_scattered_pkts_vec( return 0; } -__rte_weak uint16_t -i40e_recv_pkts_vec_avx2(void __rte_unused *rx_queue, - struct rte_mbuf __rte_unused **rx_pkts, - uint16_t __rte_unused nb_pkts) -{ - return 0; -} - -__rte_weak uint16_t -i40e_recv_scattered_pkts_vec_avx2(void __rte_unused *rx_queue, - struct rte_mbuf __rte_unused **rx_pkts, - uint16_t __rte_unused nb_pkts) -{ - return 0; -} - -__rte_weak int +int i40e_rxq_vec_setup(struct i40e_rx_queue __rte_unused *rxq) { return -1; } -__rte_weak int +int i40e_txq_vec_setup(struct i40e_tx_queue __rte_unused *txq) { return -1; } -__rte_weak void +void i40e_rx_queue_release_mbufs_vec(struct i40e_rx_queue __rte_unused*rxq) { return; } -__rte_weak uint16_t +uint16_t i40e_xmit_fixed_burst_vec(void __rte_unused * tx_queue, struct rte_mbuf __rte_unused **tx_pkts, uint16_t __rte_unused nb_pkts) { return 0; } +#endif /* ifndef RTE_LIBRTE_I40E_INC_VECTOR */ + +#ifndef CC_AVX2_SUPPORT +uint16_t +i40e_recv_pkts_vec_avx2(void __rte_unused *rx_queue, + struct rte_mbuf __rte_unused **rx_pkts, + uint16_t __rte_unused nb_pkts) +{ + return 0; +} -__rte_weak uint16_t +uint16_t +i40e_recv_scattered_pkts_vec_avx2(void __rte_unused *rx_queue, + struct rte_mbuf __rte_unused **rx_pkts, + uint16_t __rte_unused nb_pkts) +{ + return 0; +} + +uint16_t i40e_xmit_pkts_vec_avx2(void __rte_unused * tx_queue, struct rte_mbuf __rte_unused **tx_pkts, uint16_t __rte_unused nb_pkts) { return 0; } +#endif /* ifndef CC_AVX2_SUPPORT */ diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build index d783f3626..dcbca39bf 100644 --- a/drivers/net/i40e/meson.build +++ b/drivers/net/i40e/meson.build @@ -35,8 +35,10 @@ if arch_subdir == 'x86' # a. we have AVX supported in minimum instruction set baseline # b. it's not minimum instruction set, but supported by compiler if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX2') + cflags += ['-DCC_AVX2_SUPPORT'] sources += files('i40e_rxtx_vec_avx2.c') elif cc.has_argument('-mavx2') + cflags += ['-DCC_AVX2_SUPPORT'] i40e_avx2_lib = static_library('i40e_avx2_lib', 'i40e_rxtx_vec_avx2.c', dependencies: [static_rte_ethdev, -- 2.19.1