DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/gve: fix meson build failure on non-Linux platforms
@ 2022-10-26  8:42 Junfeng Guo
  2022-10-26  8:51 ` David Marchand
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Junfeng Guo @ 2022-10-26  8:42 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, ferruh.yigit, beilei.xing
  Cc: dev, xiaoyun.li, awogbemila, bruce.richardson, hemant.agrawal,
	stephen, chenbo.xia, helin.zhang, Junfeng Guo, stable

Meson build may fail on FreeBSD with gcc and clang, due to missing
the header file linux/pci_regs.h on non-Linux platform. Thus, in
this patch, we removed the file include and added the used Macros
derived from linux/pci_regs.h.

Fixes: 3047a5ac8e66 ("net/gve: add support for device initialization")
Cc: stable@dpdk.org

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
---
 drivers/net/gve/gve_ethdev.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index b0f7b98daa..e968317737 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -1,12 +1,24 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(C) 2022 Intel Corporation
  */
-#include <linux/pci_regs.h>
 
 #include "gve_ethdev.h"
 #include "base/gve_adminq.h"
 #include "base/gve_register.h"
 
+/*
+ * Following macros are derived from linux/pci_regs.h, however,
+ * we can't simply include that header here, as there is no such
+ * file for non-Linux platform.
+ */
+#define PCI_CFG_SPACE_SIZE	256
+#define PCI_CAPABILITY_LIST	0x34	/* Offset of first capability list entry */
+#define PCI_STD_HEADER_SIZEOF	64
+#define PCI_CAP_SIZEOF		4
+#define PCI_CAP_ID_MSIX		0x11	/* MSI-X */
+#define PCI_MSIX_FLAGS		2	/* Message Control */
+#define PCI_MSIX_FLAGS_QSIZE	0x07FF	/* Table size */
+
 const char gve_version_str[] = GVE_VERSION;
 static const char gve_version_prefix[] = GVE_VERSION_PREFIX;
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] net/gve: fix meson build failure on non-Linux platforms
  2022-10-26  8:42 [PATCH] net/gve: fix meson build failure on non-Linux platforms Junfeng Guo
@ 2022-10-26  8:51 ` David Marchand
  2022-10-26  9:10   ` Ferruh Yigit
  2022-10-26 10:05 ` Gao, DaxueX
  2022-10-26 10:23 ` [PATCH v2] " Junfeng Guo
  2 siblings, 1 reply; 10+ messages in thread
From: David Marchand @ 2022-10-26  8:51 UTC (permalink / raw)
  To: Junfeng Guo
  Cc: qi.z.zhang, jingjing.wu, ferruh.yigit, beilei.xing, dev,
	xiaoyun.li, awogbemila, bruce.richardson, hemant.agrawal,
	stephen, chenbo.xia, helin.zhang

On Wed, Oct 26, 2022 at 10:44 AM Junfeng Guo <junfeng.guo@intel.com> wrote:
>
> Meson build may fail on FreeBSD with gcc and clang, due to missing
> the header file linux/pci_regs.h on non-Linux platform. Thus, in
> this patch, we removed the file include and added the used Macros
> derived from linux/pci_regs.h.
>
> Fixes: 3047a5ac8e66 ("net/gve: add support for device initialization")
> Cc: stable@dpdk.org

...
No need for Cc: stable.


>
> Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
> ---
>  drivers/net/gve/gve_ethdev.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
> index b0f7b98daa..e968317737 100644
> --- a/drivers/net/gve/gve_ethdev.c
> +++ b/drivers/net/gve/gve_ethdev.c
> @@ -1,12 +1,24 @@
>  /* SPDX-License-Identifier: BSD-3-Clause
>   * Copyright(C) 2022 Intel Corporation
>   */
> -#include <linux/pci_regs.h>
>
>  #include "gve_ethdev.h"
>  #include "base/gve_adminq.h"
>  #include "base/gve_register.h"
>
> +/*
> + * Following macros are derived from linux/pci_regs.h, however,
> + * we can't simply include that header here, as there is no such
> + * file for non-Linux platform.
> + */
> +#define PCI_CFG_SPACE_SIZE     256
> +#define PCI_CAPABILITY_LIST    0x34    /* Offset of first capability list entry */
> +#define PCI_STD_HEADER_SIZEOF  64
> +#define PCI_CAP_SIZEOF         4
> +#define PCI_CAP_ID_MSIX                0x11    /* MSI-X */
> +#define PCI_MSIX_FLAGS         2       /* Message Control */
> +#define PCI_MSIX_FLAGS_QSIZE   0x07FF  /* Table size */

No, don't introduce such defines in a driver.
We have a PCI library, that provides some defines.
So fix your driver to use them.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] net/gve: fix meson build failure on non-Linux platforms
  2022-10-26  8:51 ` David Marchand
@ 2022-10-26  9:10   ` Ferruh Yigit
  2022-10-26  9:33     ` David Marchand
  0 siblings, 1 reply; 10+ messages in thread
From: Ferruh Yigit @ 2022-10-26  9:10 UTC (permalink / raw)
  To: David Marchand, Junfeng Guo
  Cc: qi.z.zhang, jingjing.wu, ferruh.yigit, beilei.xing, dev,
	xiaoyun.li, awogbemila, bruce.richardson, hemant.agrawal,
	stephen, chenbo.xia, helin.zhang

On 10/26/2022 9:51 AM, David Marchand wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
> 
> 
> On Wed, Oct 26, 2022 at 10:44 AM Junfeng Guo <junfeng.guo@intel.com> wrote:
>>
>> Meson build may fail on FreeBSD with gcc and clang, due to missing
>> the header file linux/pci_regs.h on non-Linux platform. Thus, in
>> this patch, we removed the file include and added the used Macros
>> derived from linux/pci_regs.h.
>>
>> Fixes: 3047a5ac8e66 ("net/gve: add support for device initialization")
>> Cc: stable@dpdk.org
> 
> ...
> No need for Cc: stable.
> 
> 
>>
>> Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
>> ---
>>   drivers/net/gve/gve_ethdev.c | 14 +++++++++++++-
>>   1 file changed, 13 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
>> index b0f7b98daa..e968317737 100644
>> --- a/drivers/net/gve/gve_ethdev.c
>> +++ b/drivers/net/gve/gve_ethdev.c
>> @@ -1,12 +1,24 @@
>>   /* SPDX-License-Identifier: BSD-3-Clause
>>    * Copyright(C) 2022 Intel Corporation
>>    */
>> -#include <linux/pci_regs.h>
>>
>>   #include "gve_ethdev.h"
>>   #include "base/gve_adminq.h"
>>   #include "base/gve_register.h"
>>
>> +/*
>> + * Following macros are derived from linux/pci_regs.h, however,
>> + * we can't simply include that header here, as there is no such
>> + * file for non-Linux platform.
>> + */
>> +#define PCI_CFG_SPACE_SIZE     256
>> +#define PCI_CAPABILITY_LIST    0x34    /* Offset of first capability list entry */
>> +#define PCI_STD_HEADER_SIZEOF  64
>> +#define PCI_CAP_SIZEOF         4
>> +#define PCI_CAP_ID_MSIX                0x11    /* MSI-X */
>> +#define PCI_MSIX_FLAGS         2       /* Message Control */
>> +#define PCI_MSIX_FLAGS_QSIZE   0x07FF  /* Table size */
> 
> No, don't introduce such defines in a driver.
> We have a PCI library, that provides some defines.
> So fix your driver to use them.
> 

I can see 'bnx2x' driver is using some flags from 'dev/pci/pcireg.h' 
header for FreeBSD, unfortunately macro names are not same so a #ifdef 
is required. Also I don't know it has all macros or if the header is 
available in all versions etc..

Other option can be to define them all for DPDK in common pci header? As 
far as I can see we don't have all defined right now.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] net/gve: fix meson build failure on non-Linux platforms
  2022-10-26  9:10   ` Ferruh Yigit
@ 2022-10-26  9:33     ` David Marchand
  2022-10-26 10:01       ` Ferruh Yigit
  0 siblings, 1 reply; 10+ messages in thread
From: David Marchand @ 2022-10-26  9:33 UTC (permalink / raw)
  To: Ferruh Yigit, Junfeng Guo
  Cc: qi.z.zhang, jingjing.wu, ferruh.yigit, beilei.xing, dev,
	xiaoyun.li, awogbemila, bruce.richardson, hemant.agrawal,
	stephen, chenbo.xia, helin.zhang

On Wed, Oct 26, 2022 at 11:10 AM Ferruh Yigit <ferruh.yigit@amd.com> wrote:
> >> diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
> >> index b0f7b98daa..e968317737 100644
> >> --- a/drivers/net/gve/gve_ethdev.c
> >> +++ b/drivers/net/gve/gve_ethdev.c
> >> @@ -1,12 +1,24 @@
> >>   /* SPDX-License-Identifier: BSD-3-Clause
> >>    * Copyright(C) 2022 Intel Corporation
> >>    */
> >> -#include <linux/pci_regs.h>
> >>
> >>   #include "gve_ethdev.h"
> >>   #include "base/gve_adminq.h"
> >>   #include "base/gve_register.h"
> >>
> >> +/*
> >> + * Following macros are derived from linux/pci_regs.h, however,
> >> + * we can't simply include that header here, as there is no such
> >> + * file for non-Linux platform.
> >> + */
> >> +#define PCI_CFG_SPACE_SIZE     256
> >> +#define PCI_CAPABILITY_LIST    0x34    /* Offset of first capability list entry */
> >> +#define PCI_STD_HEADER_SIZEOF  64
> >> +#define PCI_CAP_SIZEOF         4
> >> +#define PCI_CAP_ID_MSIX                0x11    /* MSI-X */
> >> +#define PCI_MSIX_FLAGS         2       /* Message Control */
> >> +#define PCI_MSIX_FLAGS_QSIZE   0x07FF  /* Table size */
> >
> > No, don't introduce such defines in a driver.
> > We have a PCI library, that provides some defines.
> > So fix your driver to use them.
> >

After chat with Ferruh, I am ok if we take this compilation fix for
now and unblock the CI..


>
> I can see 'bnx2x' driver is using some flags from 'dev/pci/pcireg.h'
> header for FreeBSD, unfortunately macro names are not same so a #ifdef
> is required. Also I don't know it has all macros or if the header is
> available in all versions etc..
>
> Other option can be to define them all for DPDK in common pci header? As
> far as I can see we don't have all defined right now.
>

If there are some missing definitions we can add them in the pci header indeed.
Those are constants, defined in the PCIE standard.

I can post a cleanup later, but I would be happy if someone else handles it.

Thanks.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] net/gve: fix meson build failure on non-Linux platforms
  2022-10-26  9:33     ` David Marchand
@ 2022-10-26 10:01       ` Ferruh Yigit
  2022-10-26 10:24         ` Guo, Junfeng
  0 siblings, 1 reply; 10+ messages in thread
From: Ferruh Yigit @ 2022-10-26 10:01 UTC (permalink / raw)
  To: David Marchand, Junfeng Guo
  Cc: qi.z.zhang, jingjing.wu, beilei.xing, dev, xiaoyun.li,
	awogbemila, bruce.richardson, hemant.agrawal, stephen,
	chenbo.xia, helin.zhang

On 10/26/2022 10:33 AM, David Marchand wrote:
> On Wed, Oct 26, 2022 at 11:10 AM Ferruh Yigit <ferruh.yigit@amd.com> wrote:
>>>> diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
>>>> index b0f7b98daa..e968317737 100644
>>>> --- a/drivers/net/gve/gve_ethdev.c
>>>> +++ b/drivers/net/gve/gve_ethdev.c
>>>> @@ -1,12 +1,24 @@
>>>>    /* SPDX-License-Identifier: BSD-3-Clause
>>>>     * Copyright(C) 2022 Intel Corporation
>>>>     */
>>>> -#include <linux/pci_regs.h>
>>>>
>>>>    #include "gve_ethdev.h"
>>>>    #include "base/gve_adminq.h"
>>>>    #include "base/gve_register.h"
>>>>
>>>> +/*
>>>> + * Following macros are derived from linux/pci_regs.h, however,
>>>> + * we can't simply include that header here, as there is no such
>>>> + * file for non-Linux platform.
>>>> + */
>>>> +#define PCI_CFG_SPACE_SIZE     256
>>>> +#define PCI_CAPABILITY_LIST    0x34    /* Offset of first capability list entry */
>>>> +#define PCI_STD_HEADER_SIZEOF  64
>>>> +#define PCI_CAP_SIZEOF         4
>>>> +#define PCI_CAP_ID_MSIX                0x11    /* MSI-X */
>>>> +#define PCI_MSIX_FLAGS         2       /* Message Control */
>>>> +#define PCI_MSIX_FLAGS_QSIZE   0x07FF  /* Table size */
>>>

@Junfeng,

Can you please move these defines to 'gve_ethdev.h'?
Beginning of 'gve_ethdev.c' seems too unrelated for PCI defines.

>>> No, don't introduce such defines in a driver.
>>> We have a PCI library, that provides some defines.
>>> So fix your driver to use them.
>>>
> 
> After chat with Ferruh, I am ok if we take this compilation fix for
> now and unblock the CI..
> 

ack

> 
>>
>> I can see 'bnx2x' driver is using some flags from 'dev/pci/pcireg.h'
>> header for FreeBSD, unfortunately macro names are not same so a #ifdef
>> is required. Also I don't know it has all macros or if the header is
>> available in all versions etc..
>>
>> Other option can be to define them all for DPDK in common pci header? As
>> far as I can see we don't have all defined right now.
>>
> 
> If there are some missing definitions we can add them in the pci header indeed.
> Those are constants, defined in the PCIE standard.
> 
> I can post a cleanup later, but I would be happy if someone else handles it.
> 

@Junfeng,

Can you have bandwidth for this cleanup?

Task is to define PCI macros in common pci header, ('bus_pci_driver.h' I 
guess ?), and update drivers to use new common ones, remove local 
definition from drivers.

DPDK macros can use Linux macro names with RTE_ prefix and with a define 
guard, as done in following:
https://elixir.bootlin.com/dpdk/v22.07/source/drivers/bus/pci/linux/pci_init.h#L50


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH] net/gve: fix meson build failure on non-Linux platforms
  2022-10-26  8:42 [PATCH] net/gve: fix meson build failure on non-Linux platforms Junfeng Guo
  2022-10-26  8:51 ` David Marchand
@ 2022-10-26 10:05 ` Gao, DaxueX
  2022-10-26 10:23 ` [PATCH v2] " Junfeng Guo
  2 siblings, 0 replies; 10+ messages in thread
From: Gao, DaxueX @ 2022-10-26 10:05 UTC (permalink / raw)
  To: Guo, Junfeng, Zhang, Qi Z, Wu, Jingjing, ferruh.yigit, Xing, Beilei
  Cc: dev, Li, Xiaoyun, awogbemila, Richardson, Bruce, hemant.agrawal,
	stephen, Xia, Chenbo, Zhang, Helin, Guo, Junfeng, stable

> From: Junfeng Guo <junfeng.guo@intel.com>
> Sent: 2022年10月26日 16:43
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> ferruh.yigit@xilinx.com; Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Li, Xiaoyun <xiaoyun.li@intel.com>;
> awogbemila@google.com; Richardson, Bruce <bruce.richardson@intel.com>;
> hemant.agrawal@nxp.com; stephen@networkplumber.org; Xia, Chenbo
> <chenbo.xia@intel.com>; Zhang, Helin <helin.zhang@intel.com>; Guo, Junfeng
> <junfeng.guo@intel.com>; stable@dpdk.org
> Subject: [PATCH] net/gve: fix meson build failure on non-Linux platforms
> 
> Meson build may fail on FreeBSD with gcc and clang, due to missing the header
> file linux/pci_regs.h on non-Linux platform. Thus, in this patch, we removed the
> file include and added the used Macros derived from linux/pci_regs.h.
> 
> Fixes: 3047a5ac8e66 ("net/gve: add support for device initialization")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>

Tested-by: Daxue Gao <daxuex.gao@intel.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2] net/gve: fix meson build failure on non-Linux platforms
  2022-10-26  8:42 [PATCH] net/gve: fix meson build failure on non-Linux platforms Junfeng Guo
  2022-10-26  8:51 ` David Marchand
  2022-10-26 10:05 ` Gao, DaxueX
@ 2022-10-26 10:23 ` Junfeng Guo
  2022-10-26 11:11   ` Ferruh Yigit
  2022-10-27  3:08   ` Gao, DaxueX
  2 siblings, 2 replies; 10+ messages in thread
From: Junfeng Guo @ 2022-10-26 10:23 UTC (permalink / raw)
  To: qi.z.zhang, jingjing.wu, ferruh.yigit, beilei.xing
  Cc: dev, xiaoyun.li, awogbemila, bruce.richardson, hemant.agrawal,
	stephen, chenbo.xia, helin.zhang, Junfeng Guo

Meson build may fail on FreeBSD with gcc and clang, due to missing
the header file linux/pci_regs.h on non-Linux platform. Thus, in
this patch, we removed the file include and added the used Macros
derived from linux/pci_regs.h.

Fixes: 3047a5ac8e66 ("net/gve: add support for device initialization")

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
---
 drivers/net/gve/gve_ethdev.c |  1 -
 drivers/net/gve/gve_ethdev.h | 13 +++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index b0f7b98daa..18c879b8d1 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -1,7 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(C) 2022 Intel Corporation
  */
-#include <linux/pci_regs.h>
 
 #include "gve_ethdev.h"
 #include "base/gve_adminq.h"
diff --git a/drivers/net/gve/gve_ethdev.h b/drivers/net/gve/gve_ethdev.h
index 36b334c36b..f6cac3ff2b 100644
--- a/drivers/net/gve/gve_ethdev.h
+++ b/drivers/net/gve/gve_ethdev.h
@@ -11,6 +11,19 @@
 
 #include "base/gve.h"
 
+/*
+ * Following macros are derived from linux/pci_regs.h, however,
+ * we can't simply include that header here, as there is no such
+ * file for non-Linux platform.
+ */
+#define PCI_CFG_SPACE_SIZE	256
+#define PCI_CAPABILITY_LIST	0x34	/* Offset of first capability list entry */
+#define PCI_STD_HEADER_SIZEOF	64
+#define PCI_CAP_SIZEOF		4
+#define PCI_CAP_ID_MSIX		0x11	/* MSI-X */
+#define PCI_MSIX_FLAGS		2	/* Message Control */
+#define PCI_MSIX_FLAGS_QSIZE	0x07FF	/* Table size */
+
 #define GVE_DEFAULT_RX_FREE_THRESH  512
 #define GVE_DEFAULT_TX_FREE_THRESH  256
 #define GVE_TX_MAX_FREE_SZ          512
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH] net/gve: fix meson build failure on non-Linux platforms
  2022-10-26 10:01       ` Ferruh Yigit
@ 2022-10-26 10:24         ` Guo, Junfeng
  0 siblings, 0 replies; 10+ messages in thread
From: Guo, Junfeng @ 2022-10-26 10:24 UTC (permalink / raw)
  To: Ferruh Yigit, David Marchand
  Cc: Zhang, Qi Z, Wu, Jingjing, Xing, Beilei, dev, Li, Xiaoyun,
	awogbemila, Richardson, Bruce, hemant.agrawal, stephen, Xia,
	Chenbo, Zhang, Helin



> -----Original Message-----
> From: Ferruh Yigit <ferruh.yigit@amd.com>
> Sent: Wednesday, October 26, 2022 18:01
> To: David Marchand <david.marchand@redhat.com>; Guo, Junfeng
> <junfeng.guo@intel.com>
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> dev@dpdk.org; Li, Xiaoyun <xiaoyun.li@intel.com>;
> awogbemila@google.com; Richardson, Bruce
> <bruce.richardson@intel.com>; hemant.agrawal@nxp.com;
> stephen@networkplumber.org; Xia, Chenbo <chenbo.xia@intel.com>;
> Zhang, Helin <helin.zhang@intel.com>
> Subject: Re: [PATCH] net/gve: fix meson build failure on non-Linux
> platforms
> 
> On 10/26/2022 10:33 AM, David Marchand wrote:
> > On Wed, Oct 26, 2022 at 11:10 AM Ferruh Yigit <ferruh.yigit@amd.com>
> wrote:
> >>>> diff --git a/drivers/net/gve/gve_ethdev.c
> b/drivers/net/gve/gve_ethdev.c
> >>>> index b0f7b98daa..e968317737 100644
> >>>> --- a/drivers/net/gve/gve_ethdev.c
> >>>> +++ b/drivers/net/gve/gve_ethdev.c
> >>>> @@ -1,12 +1,24 @@
> >>>>    /* SPDX-License-Identifier: BSD-3-Clause
> >>>>     * Copyright(C) 2022 Intel Corporation
> >>>>     */
> >>>> -#include <linux/pci_regs.h>
> >>>>
> >>>>    #include "gve_ethdev.h"
> >>>>    #include "base/gve_adminq.h"
> >>>>    #include "base/gve_register.h"
> >>>>
> >>>> +/*
> >>>> + * Following macros are derived from linux/pci_regs.h, however,
> >>>> + * we can't simply include that header here, as there is no such
> >>>> + * file for non-Linux platform.
> >>>> + */
> >>>> +#define PCI_CFG_SPACE_SIZE     256
> >>>> +#define PCI_CAPABILITY_LIST    0x34    /* Offset of first capability
> list entry */
> >>>> +#define PCI_STD_HEADER_SIZEOF  64
> >>>> +#define PCI_CAP_SIZEOF         4
> >>>> +#define PCI_CAP_ID_MSIX                0x11    /* MSI-X */
> >>>> +#define PCI_MSIX_FLAGS         2       /* Message Control */
> >>>> +#define PCI_MSIX_FLAGS_QSIZE   0x07FF  /* Table size */
> >>>
> 
> @Junfeng,
> 
> Can you please move these defines to 'gve_ethdev.h'?
> Beginning of 'gve_ethdev.c' seems too unrelated for PCI defines.

Sure, will update this in v2. Thanks!

> 
> >>> No, don't introduce such defines in a driver.
> >>> We have a PCI library, that provides some defines.
> >>> So fix your driver to use them.
> >>>
> >
> > After chat with Ferruh, I am ok if we take this compilation fix for
> > now and unblock the CI..
> >
> 
> ack
> 
> >
> >>
> >> I can see 'bnx2x' driver is using some flags from 'dev/pci/pcireg.h'
> >> header for FreeBSD, unfortunately macro names are not same so a
> #ifdef
> >> is required. Also I don't know it has all macros or if the header is
> >> available in all versions etc..
> >>
> >> Other option can be to define them all for DPDK in common pci header?
> As
> >> far as I can see we don't have all defined right now.
> >>
> >
> > If there are some missing definitions we can add them in the pci header
> indeed.
> > Those are constants, defined in the PCIE standard.
> >
> > I can post a cleanup later, but I would be happy if someone else handles
> it.
> >
> 
> @Junfeng,
> 
> Can you have bandwidth for this cleanup?
> 
> Task is to define PCI macros in common pci header, ('bus_pci_driver.h' I
> guess ?), and update drivers to use new common ones, remove local
> definition from drivers.

Yes, the task makes sense and is quite clear. 
How about doing this cleanup later, maybe next week with a new patch?
Quite busy this week due to RC2...
Thanks! :)

> 
> DPDK macros can use Linux macro names with RTE_ prefix and with a
> define
> guard, as done in following:
> https://elixir.bootlin.com/dpdk/v22.07/source/drivers/bus/pci/linux/pci_i
> nit.h#L50

I'll try with this, thanks for the comments!


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] net/gve: fix meson build failure on non-Linux platforms
  2022-10-26 10:23 ` [PATCH v2] " Junfeng Guo
@ 2022-10-26 11:11   ` Ferruh Yigit
  2022-10-27  3:08   ` Gao, DaxueX
  1 sibling, 0 replies; 10+ messages in thread
From: Ferruh Yigit @ 2022-10-26 11:11 UTC (permalink / raw)
  To: Junfeng Guo, qi.z.zhang, jingjing.wu, beilei.xing
  Cc: dev, xiaoyun.li, awogbemila, bruce.richardson, hemant.agrawal,
	stephen, chenbo.xia, helin.zhang

On 10/26/2022 11:23 AM, Junfeng Guo wrote:
> Meson build may fail on FreeBSD with gcc and clang, due to missing
> the header file linux/pci_regs.h on non-Linux platform. Thus, in
> this patch, we removed the file include and added the used Macros
> derived from linux/pci_regs.h.
> 
> Fixes: 3047a5ac8e66 ("net/gve: add support for device initialization")
> 
> Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>


Squashed into relevant commit in next-net, thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH v2] net/gve: fix meson build failure on non-Linux platforms
  2022-10-26 10:23 ` [PATCH v2] " Junfeng Guo
  2022-10-26 11:11   ` Ferruh Yigit
@ 2022-10-27  3:08   ` Gao, DaxueX
  1 sibling, 0 replies; 10+ messages in thread
From: Gao, DaxueX @ 2022-10-27  3:08 UTC (permalink / raw)
  To: Guo, Junfeng, Zhang, Qi Z, Wu, Jingjing, ferruh.yigit, Xing,
	Beilei, Ferruh Yigit
  Cc: dev, Li, Xiaoyun, awogbemila, Richardson, Bruce, hemant.agrawal,
	stephen, Xia, Chenbo, Zhang, Helin, Guo, Junfeng

> From: Junfeng Guo <junfeng.guo@intel.com>
> Sent: 2022年10月26日 18:23
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> ferruh.yigit@xilinx.com; Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Li, Xiaoyun <xiaoyun.li@intel.com>;
> awogbemila@google.com; Richardson, Bruce <bruce.richardson@intel.com>;
> hemant.agrawal@nxp.com; stephen@networkplumber.org; Xia, Chenbo
> <chenbo.xia@intel.com>; Zhang, Helin <helin.zhang@intel.com>; Guo, Junfeng
> <junfeng.guo@intel.com>
> Subject: [PATCH v2] net/gve: fix meson build failure on non-Linux platforms
> 
> Meson build may fail on FreeBSD with gcc and clang, due to missing the header
> file linux/pci_regs.h on non-Linux platform. Thus, in this patch, we removed the
> file include and added the used Macros derived from linux/pci_regs.h.
> 
> Fixes: 3047a5ac8e66 ("net/gve: add support for device initialization")
> 
> Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>

Tested-by: Daxue Gao <daxuex.gao@intel.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-10-27  3:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26  8:42 [PATCH] net/gve: fix meson build failure on non-Linux platforms Junfeng Guo
2022-10-26  8:51 ` David Marchand
2022-10-26  9:10   ` Ferruh Yigit
2022-10-26  9:33     ` David Marchand
2022-10-26 10:01       ` Ferruh Yigit
2022-10-26 10:24         ` Guo, Junfeng
2022-10-26 10:05 ` Gao, DaxueX
2022-10-26 10:23 ` [PATCH v2] " Junfeng Guo
2022-10-26 11:11   ` Ferruh Yigit
2022-10-27  3:08   ` Gao, DaxueX

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).