patches for DPDK stable branches
 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 10:05 ` Gao, DaxueX
  0 siblings, 1 reply; 2+ 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] 2+ 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 10:05 ` Gao, DaxueX
  0 siblings, 0 replies; 2+ 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] 2+ messages in thread

end of thread, other threads:[~2022-10-26 10:05 UTC | newest]

Thread overview: 2+ 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 10:05 ` 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).