DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Dharmik Thakkar <dharmik.thakkar@arm.com>,
	Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>
Cc: dev@dpdk.org, Aaron Conole <aconole@redhat.com>,
	Ali Alnubani <alialnu@mellanox.com>,
	"Chen, Zhaoyan" <zhaoyan.chen@intel.com>,
	Jeremy Plsek <jplsek@iol.unh.edu>
Subject: Re: [dpdk-dev] [PATCH v2 1/7] net/ixgbe: avoid multpile definitions of 'bool'
Date: Fri, 10 Jan 2020 09:22:01 +0000	[thread overview]
Message-ID: <f35f93ba-90e4-e580-60ef-4f92b9cc46a2@intel.com> (raw)
In-Reply-To: <20200102174838.12908-2-dharmik.thakkar@arm.com>

On 1/2/2020 5:48 PM, Dharmik Thakkar wrote:
> Compilation issue arises due to multiple definitions of 'bool'
> in 'ixgbe_ethdev.h'.
> 
> Error:
> '/dpdk/drivers/net/ixgbe/ixgbe_ethdev.c: In function
> ‘ixgbe_dev_setup_link_alarm_handler’:
> /dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:4075:43:
> error: passing argument 3 of ‘ixgbe_get_link_capabilities’ from
> incompatible pointer type [-Werror=incompatible-pointer-types]
>    ixgbe_get_link_capabilities(hw, &speed, &autoneg);
>                                            ^
> In file included from /dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:41:0:
> /dpdk/drivers/net/ixgbe/base/ixgbe_api.h:63:5: note: expected
> ‘bool * {aka int *}’ but argument is of type ‘_Bool *’'
> 
> Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
> Reviewed-by: Phil Yang <phil.yang@arm.com>
> Reviewed-by: Gavin Hu <gavin.hu@arm.com>
> ---
>  drivers/net/ixgbe/base/ixgbe_osdep.h | 4 +---
>  drivers/net/ixgbe/ixgbe_ethdev.c     | 7 ++++---
>  2 files changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/base/ixgbe_osdep.h b/drivers/net/ixgbe/base/ixgbe_osdep.h
> index ea8dc1cbe570..844d1701f595 100644
> --- a/drivers/net/ixgbe/base/ixgbe_osdep.h
> +++ b/drivers/net/ixgbe/base/ixgbe_osdep.h
> @@ -9,6 +9,7 @@
>  #include <stdint.h>
>  #include <stdio.h>
>  #include <stdarg.h>
> +#include <stdbool.h>
>  #include <rte_common.h>
>  #include <rte_debug.h>
>  #include <rte_cycles.h>
> @@ -82,9 +83,6 @@ typedef int16_t		s16;
>  typedef uint32_t	u32;
>  typedef int32_t		s32;
>  typedef uint64_t	u64;
> -#ifndef __cplusplus
> -typedef int		bool;
> -#endif
>  
>  #define mb()	rte_mb()
>  #define wmb()	rte_wmb()
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 2c6fd0f13128..6cbd783e3a21 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -2544,7 +2544,8 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
>  	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
>  	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
>  	uint32_t intr_vector = 0;
> -	int err, link_up = 0, negotiate = 0;
> +	int err;
> +	bool link_up = 0, negotiate = 0;
>  	uint32_t speed = 0;
>  	uint32_t allowed_speeds = 0;
>  	int mask = 0;
> @@ -3993,7 +3994,7 @@ ixgbevf_dev_info_get(struct rte_eth_dev *dev,
>  
>  static int
>  ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
> -		   int *link_up, int wait_to_complete)
> +		   bool *link_up, int wait_to_complete)
>  {
>  	struct ixgbe_adapter *adapter = container_of(hw,
>  						     struct ixgbe_adapter, hw);
> @@ -4124,7 +4125,7 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
>  	ixgbe_link_speed link_speed = IXGBE_LINK_SPEED_UNKNOWN;
>  	struct ixgbe_interrupt *intr =
>  		IXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
> -	int link_up;
> +	bool link_up;
>  	int diag;
>  	int wait = 1;
>  	u32 esdp_reg;
> 

Can you please rebase the patchset on of next-net, getting following build error
[1] because of a commit in next-net [2], the fix should be trivial [3].

CI seems not able to catch this, Cc'ed Aaron, Ali & Zhaoyan & Jeremy if they
want to investigate the issue.



[1]
.../drivers/net/ixgbe/ixgbe_ethdev.c:4137:38: error: incompatible pointer types
passing 'int *' to parameter of type 'bool *' [-Werror,-Wincompatible-pointer-types]
                err = ixgbe_check_link(hw, &speed, &link_up, 0);
                                                   ^~~~~~~~
.../drivers/net/ixgbe/base/ixgbe_api.h:62:14: note: passing argument to
parameter 'link_up' here
                     bool *link_up, bool link_up_wait_to_complete);
                           ^

[2]
commit 2f2639c872c8 ("net/ixgbe: fix port can not link up in FreeBSD")


[3]
 diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
 index 414b73c97..4f1704e79 100644
 --- a/drivers/net/ixgbe/ixgbe_ethdev.c
 +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
 @@ -4130,7 +4130,8 @@ ixgbe_wait_for_link_up(struct ixgbe_hw *hw)
  #else
         const int nb_iter = 0;
  #endif
 -       int err, i, link_up = 0;
 +       int err, i = 0;
 +       bool link_up = false;
         uint32_t speed = 0;

         for (i = 0; i < nb_iter; i++) {


  reply	other threads:[~2020-01-10  9:22 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 22:44 [dpdk-dev] [PATCH] " Dharmik Thakkar
2019-10-16  6:23 ` Ye Xiaolong
2019-10-16 16:22   ` Dharmik Thakkar
2020-01-02 17:48 ` [dpdk-dev] [PATCH v2 0/7] remove 'typedef int bool' Dharmik Thakkar
2020-01-02 17:48   ` [dpdk-dev] [PATCH v2 1/7] net/ixgbe: avoid multpile definitions of 'bool' Dharmik Thakkar
2020-01-10  9:22     ` Ferruh Yigit [this message]
2020-01-10 20:55       ` Dharmik Thakkar
2020-01-02 17:48   ` [dpdk-dev] [PATCH v2 2/7] net/cxgbe: remove 'typedef int bool' Dharmik Thakkar
2020-01-02 17:48   ` [dpdk-dev] [PATCH v2 3/7] net/vmxnet3: " Dharmik Thakkar
2020-01-02 19:53     ` Yong Wang
2020-01-02 17:48   ` [dpdk-dev] [PATCH v2 4/7] net/bnx2x: " Dharmik Thakkar
2020-01-02 17:48   ` [dpdk-dev] [PATCH v2 5/7] net/e1000: " Dharmik Thakkar
2020-01-02 17:48   ` [dpdk-dev] [PATCH v2 6/7] net/fm10k: " Dharmik Thakkar
2020-01-03  1:34     ` Wang, Xiao W
2020-01-02 17:48   ` [dpdk-dev] [PATCH v2 7/7] net/qede: " Dharmik Thakkar
2020-01-10 20:51   ` [dpdk-dev] [PATCH v3 0/7] " Dharmik Thakkar
2020-01-10 20:51     ` [dpdk-dev] [PATCH v3 1/7] net/ixgbe: avoid multpile definitions of 'bool' Dharmik Thakkar
2020-01-10 20:51     ` [dpdk-dev] [PATCH v3 2/7] net/cxgbe: remove 'typedef int bool' Dharmik Thakkar
2020-01-10 20:51     ` [dpdk-dev] [PATCH v3 3/7] net/vmxnet3: " Dharmik Thakkar
2020-01-10 20:51     ` [dpdk-dev] [PATCH v3 4/7] net/bnx2x: " Dharmik Thakkar
2020-01-10 20:51     ` [dpdk-dev] [PATCH v3 5/7] net/e1000: " Dharmik Thakkar
2020-01-10 20:51     ` [dpdk-dev] [PATCH v3 6/7] net/fm10k: " Dharmik Thakkar
2020-01-10 20:51     ` [dpdk-dev] [PATCH v3 7/7] net/qede: " Dharmik Thakkar
2020-01-13 11:14     ` [dpdk-dev] [PATCH v3 0/7] " Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f35f93ba-90e4-e580-60ef-4f92b9cc46a2@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=aconole@redhat.com \
    --cc=alialnu@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=dharmik.thakkar@arm.com \
    --cc=jplsek@iol.unh.edu \
    --cc=konstantin.ananyev@intel.com \
    --cc=wenzhuo.lu@intel.com \
    --cc=zhaoyan.chen@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).