From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 737114CE7 for ; Wed, 20 Jul 2016 19:11:55 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id o80so7932102wme.0 for ; Wed, 20 Jul 2016 10:11:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=schaman-hu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to; bh=mbUWLu7v2hmj7txZe+xy0k8uTQMaGwOv7Jfnp8rlA9I=; b=T+RiIf35r0XuA7GLW1HqqGQGsjaTg8tU2ypkz/X7PNq1spwtapCNftWvQsLxrRZ82S KSkmsTmUV4jE2+j+GJeze8hHYUTUEE6WN5uockF+cPdPz8O2DImmqoJoh/n+raEsxdub YNNMaM7XP8C2gtmzGAzvdhw3Twy2ttKvw2pQCL+NnoP7GYOOZT1gTXafTHY23A2mySo0 a6jzISvVNjcldKgQ/UiGybZVWokM/rhG2BZyWkB7roDqLXTs0Aie2sjb6EsSeIYYDgHj KZyMkryad7BRJS0j6OETAVF9EwfMN7AAVzpOvOp/byZUsSoHPBnuMyacdFcJRfSeFIXz A7pA== 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:in-reply-to; bh=mbUWLu7v2hmj7txZe+xy0k8uTQMaGwOv7Jfnp8rlA9I=; b=F45XK2uKSqnK8Wj8FkX+jAw5d61gojVa2zDnjWykR/5xIIyxtslObwsCYk63Ia3ezJ ILQM1ZsVXaV//zdYiS5He3mnqjSAXZEaeo7umJElwszWDFPgYQwri59GxkO3g3WsswHQ l5jWVrHbYCz4q3ECLJ2eA2QkplctKfvRxK2D2WbgZMu0mYEI695/lK39FY6fhDe10kjo CbFqyLQZbSTphskCjLZB7hg92jsXfTVq51vHGDz08aMpwn5jwykW+CR++MwnjkPm4YH/ Ch/BhMmWXIhX6CHZK8OY2WIHb6dR3oipYtAWgrQ0uOfcKM8CL4a49vdsniB8CbmXWi62 udEQ== X-Gm-Message-State: ALyK8tLvci3ogTNn1Y1AzuvZ8VZhrFviqVm0uCvUA1UotEyLapLc20zQJZLnp7lCMpCquw== X-Received: by 10.28.56.132 with SMTP id f126mr854153wma.13.1469034715010; Wed, 20 Jul 2016 10:11:55 -0700 (PDT) Received: from localhost.localdomain ([195.11.233.227]) by smtp.googlemail.com with ESMTPSA id b130sm32457723wmg.3.2016.07.20.10.11.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Jul 2016 10:11:54 -0700 (PDT) From: Zoltan Kiss To: dev@dpdk.org Cc: Matias Elo , sergio.gonzalez.monroy@intel.com, ferruh.yigit@intel.com, damarion@cisco.com, thomas.monjalon@6wind.com Date: Wed, 20 Jul 2016 18:11:16 +0100 Message-Id: <1469034676-2424-1-git-send-email-zoltan.kiss@schaman.hu> X-Mailer: git-send-email 1.9.1 In-reply-to: <1468938920-19679-1-git-send-email-zoltan.kiss@schaman.hu> Subject: [dpdk-dev] [PATCH v2] net/i40e: remove weak symbols 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: Wed, 20 Jul 2016 17:11:55 -0000 Using weak symbols have a few issues with static linking: - normally the linker searches the .o files already linked, if your weak one is there, it won't check if there is a strong version - unless the symbol is directly referred, but it's not the right thing to rely on - or --whole-archive specified in the command line, which pulls in a lot of unwanted stuff - whole-archive also makes libtool dropping the library from the command line, which is what should happen with dynamic linking, but not with static (observed on Ubuntu 14.04). This is an important bug if you build a static library depending on DPDK This patch merges the two version and make the behaviour rely on the config. If we can agree in the concept, I can send a series to fix this for the other weak functions. Signed-off-by: Zoltan Kiss --- Notes: v2: fix commit message drivers/net/i40e/i40e_rxtx.c | 36 +++++++++++++++++++++++++++++++++++- drivers/net/i40e/i40e_rxtx_vec.c | 36 ------------------------------------ 2 files changed, 35 insertions(+), 37 deletions(-) diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index d3cfb98..ad34d3a 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -3278,10 +3278,44 @@ i40e_set_tx_function(struct rte_eth_dev *dev) } /* Stubs needed for linkage when CONFIG_RTE_I40E_INC_VECTOR is set to 'n' */ -int __attribute__((weak)) +int __attribute__((cold)) i40e_rx_vec_dev_conf_condition_check(struct rte_eth_dev __rte_unused *dev) { +#ifndef RTE_LIBRTE_I40E_INC_VECTOR return -1; +#else +#ifndef RTE_LIBRTE_IEEE1588 + struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode; + struct rte_fdir_conf *fconf = &dev->data->dev_conf.fdir_conf; + + /* need SSE4.1 support */ + if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1)) + return -1; + +#ifndef RTE_LIBRTE_I40E_RX_OLFLAGS_ENABLE + /* whithout rx ol_flags, no VP flag report */ + if (rxmode->hw_vlan_strip != 0 || + rxmode->hw_vlan_extend != 0) + return -1; +#endif /* RTE_LIBRTE_I40E_RX_OLFLAGS_ENABLE */ + + /* no fdir support */ + if (fconf->mode != RTE_FDIR_MODE_NONE) + return -1; + + /* - no csum error report support + * - no header split support + */ + if (rxmode->hw_ip_checksum == 1 || + rxmode->header_split == 1) + return -1; + + return 0; +#else + RTE_SET_USED(dev); + return -1; +#endif /* RTE_LIBRTE_IEEE1588 */ +#endif /* RTE_LIBRTE_I40E_INC_VECTOR */ } uint16_t __attribute__((weak)) diff --git a/drivers/net/i40e/i40e_rxtx_vec.c b/drivers/net/i40e/i40e_rxtx_vec.c index 05cb415..983b2c0 100644 --- a/drivers/net/i40e/i40e_rxtx_vec.c +++ b/drivers/net/i40e/i40e_rxtx_vec.c @@ -723,39 +723,3 @@ i40e_txq_vec_setup(struct i40e_tx_queue __rte_unused *txq) { return 0; } - -int __attribute__((cold)) -i40e_rx_vec_dev_conf_condition_check(struct rte_eth_dev *dev) -{ -#ifndef RTE_LIBRTE_IEEE1588 - struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode; - struct rte_fdir_conf *fconf = &dev->data->dev_conf.fdir_conf; - - /* need SSE4.1 support */ - if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_1)) - return -1; - -#ifndef RTE_LIBRTE_I40E_RX_OLFLAGS_ENABLE - /* whithout rx ol_flags, no VP flag report */ - if (rxmode->hw_vlan_strip != 0 || - rxmode->hw_vlan_extend != 0) - return -1; -#endif - - /* no fdir support */ - if (fconf->mode != RTE_FDIR_MODE_NONE) - return -1; - - /* - no csum error report support - * - no header split support - */ - if (rxmode->hw_ip_checksum == 1 || - rxmode->header_split == 1) - return -1; - - return 0; -#else - RTE_SET_USED(dev); - return -1; -#endif -} -- 1.9.1