From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 388D7423BA; Thu, 12 Jan 2023 21:37:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C189442DD3; Thu, 12 Jan 2023 21:37:38 +0100 (CET) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by mails.dpdk.org (Postfix) with ESMTP id 8FAFF42DAD for ; Thu, 12 Jan 2023 21:37:36 +0100 (CET) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 79FB13200684; Thu, 12 Jan 2023 15:37:35 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 12 Jan 2023 15:37:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1673555855; x=1673642255; bh=XM ZTc5cEUu4ENPfOgynVjhl500gKzMR0wLrJh5ATKA8=; b=ttV97lkJ+yuBmc20G4 gT3WECY10ausztIyJe/GS0H1hOzUatjBIo4bwIo6pqSNcnHH1Hp0LUYpmsJkkeqy lMTPs6Pvyp5BKTmIHHsF1q3zQf0bPGyC57Rqvd9s+tzlrt9ejKP3WVvkT0SbP77H /8KkJK8ZK3xTHcg5+m4XNvIWw7H5MWM/luApdSlgxEVZGjooBPDCGGtSFqnrZW5Q T76ya1RalWOFCgaC+gaDajR0+eTdDyGwXO45b/63s4ydw14IgNWeilg6FYpED1nU Bi8U0Aa+6fCgmoxyWcJ0TtYsA6yGxKIzoHLGW350iU96k/i3qt2Clrwi7TVqyb2W mzww== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1673555855; x=1673642255; bh=XMZTc5cEUu4EN PfOgynVjhl500gKzMR0wLrJh5ATKA8=; b=MLcVRQjohgZh1FcHuD4io986RZNtc ZT3kd+OKcr8fN6fIujQocfsgeCopC5HV1Of1ZqhGhap4UJ1T1aOchsYMiUJ4zCPR X4mAUdoP2FwQ7Lrud3bgOQ6anpu1RIHOT9ly0d8YHxkWlCjwjEUeTSU9X5nTp+lI Fz2czL/9Y4o9N2FW3axR11k5NnGX6N3RxiDAh+X23GlSs6MvLYcFOTPXHEDrZWT2 smjv2+/znu8MxYMPEAMYC37t+uy9MnYAcqsghCgMwmq/ggfTEZvDDySFXwux6Zps Rf+p21zImtB/1VAWu9pMESOiSKMP/uAHBWQuHJhczz0BByLAT6bVjhdiw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrleeigddugeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedvjefhudeghedvtdeijeeigeetuedugfejueekieeltdfhteev keehhfeilefhtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 Jan 2023 15:37:34 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: Tal Shnaiderman , Matan Azrad , Viacheslav Ovsiienko Subject: [PATCH v2 3/4] net/mlx5: remove weak stub functions Date: Thu, 12 Jan 2023 21:37:17 +0100 Message-Id: <20230112203719.1528619-4-thomas@monjalon.net> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112203719.1528619-1-thomas@monjalon.net> References: <20230105161020.247780-1-thomas@monjalon.net> <20230112203719.1528619-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The vector Rx functions are conditionally compiled. Some stub functions were also always compiled with weak attribute. If there is no vector support, the weak functions were linked. These weak functions are moved in a specific file which is compiled only if there is no vector support. This way it is simpler to understand, and the weak attributes can be removed. This change helps to compile with MinGW GCC which has no support for weak functions. Signed-off-by: Thomas Monjalon --- drivers/net/mlx5/meson.build | 13 +++++---- drivers/net/mlx5/mlx5_rx.c | 35 ------------------------ drivers/net/mlx5/mlx5_rxtx_vec_null.c | 38 +++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 40 deletions(-) create mode 100644 drivers/net/mlx5/mlx5_rxtx_vec_null.c diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build index abd507bd88..dba911693e 100644 --- a/drivers/net/mlx5/meson.build +++ b/drivers/net/mlx5/meson.build @@ -49,11 +49,14 @@ if is_linux 'mlx5_hws_cnt.c', 'mlx5_flow_verbs.c', ) - if (dpdk_conf.has('RTE_ARCH_X86_64') - or dpdk_conf.has('RTE_ARCH_ARM64') - or dpdk_conf.has('RTE_ARCH_PPC_64')) - sources += files('mlx5_rxtx_vec.c') - endif +endif + +if is_linux and (dpdk_conf.has('RTE_ARCH_X86_64') + or dpdk_conf.has('RTE_ARCH_ARM64') + or dpdk_conf.has('RTE_ARCH_PPC_64')) + sources += files('mlx5_rxtx_vec.c') +else + sources += files('mlx5_rxtx_vec_null.c') endif cflags_options = [ diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c index 917c517b83..d054f9728a 100644 --- a/drivers/net/mlx5/mlx5_rx.c +++ b/drivers/net/mlx5/mlx5_rx.c @@ -1185,41 +1185,6 @@ mlx5_rx_burst_mprq(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n) return i; } -/* - * Vectorized Rx routines are not compiled in when required vector instructions - * are not supported on a target architecture. - * The following null stubs are needed for linkage when those are not included - * outside of this file (e.g. mlx5_rxtx_vec_sse.c for x86). - */ - -__rte_weak uint16_t -mlx5_rx_burst_vec(void *dpdk_rxq __rte_unused, - struct rte_mbuf **pkts __rte_unused, - uint16_t pkts_n __rte_unused) -{ - return 0; -} - -__rte_weak uint16_t -mlx5_rx_burst_mprq_vec(void *dpdk_rxq __rte_unused, - struct rte_mbuf **pkts __rte_unused, - uint16_t pkts_n __rte_unused) -{ - return 0; -} - -__rte_weak int -mlx5_rxq_check_vec_support(struct mlx5_rxq_data *rxq __rte_unused) -{ - return -ENOTSUP; -} - -__rte_weak int -mlx5_check_vec_rx_support(struct rte_eth_dev *dev __rte_unused) -{ - return -ENOTSUP; -} - int mlx5_rx_queue_lwm_query(struct rte_eth_dev *dev, uint16_t *queue_id, uint8_t *lwm) diff --git a/drivers/net/mlx5/mlx5_rxtx_vec_null.c b/drivers/net/mlx5/mlx5_rxtx_vec_null.c new file mode 100644 index 0000000000..03d6629e24 --- /dev/null +++ b/drivers/net/mlx5/mlx5_rxtx_vec_null.c @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 NVIDIA Corporation & Affiliates + */ + +#include + +#include "mlx5_rx.h" + +struct rte_mbuf; +struct rte_eth_dev; + +uint16_t +mlx5_rx_burst_vec(void *dpdk_rxq __rte_unused, + struct rte_mbuf **pkts __rte_unused, + uint16_t pkts_n __rte_unused) +{ + return 0; +} + +uint16_t +mlx5_rx_burst_mprq_vec(void *dpdk_rxq __rte_unused, + struct rte_mbuf **pkts __rte_unused, + uint16_t pkts_n __rte_unused) +{ + return 0; +} + +int +mlx5_rxq_check_vec_support(struct mlx5_rxq_data *rxq __rte_unused) +{ + return -ENOTSUP; +} + +int +mlx5_check_vec_rx_support(struct rte_eth_dev *dev __rte_unused) +{ + return -ENOTSUP; +} -- 2.39.0