* [dpdk-dev] [PATCH] eal: fix build
@ 2015-07-28 22:48 Helin Zhang
2015-07-29 8:19 ` Thomas Monjalon
0 siblings, 1 reply; 10+ messages in thread
From: Helin Zhang @ 2015-07-28 22:48 UTC (permalink / raw)
To: dev
It fixes the build error of implicit declaration of function.
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
lib/librte_eal/common/include/rte_pci.h | 11 +++++++++++
lib/librte_eal/linuxapp/eal/eal_pci.c | 2 +-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h
index 34cafa6..3fb2d3a 100644
--- a/lib/librte_eal/common/include/rte_pci.h
+++ b/lib/librte_eal/common/include/rte_pci.h
@@ -487,6 +487,17 @@ int rte_eal_pci_read_config(const struct rte_pci_device *device,
int rte_eal_pci_write_config(const struct rte_pci_device *device,
const void *buf, size_t len, off_t offset);
+#ifdef RTE_PCI_CONFIG
+/**
+ * Set special config space registers for performance purpose.
+ *
+ * @param dev
+ * A pointer to a rte_pci_device structure describing the device
+ * to use
+ */
+void pci_config_space_set(struct rte_pci_device *dev);
+#endif /* RTE_PCI_CONFIG */
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c
index df21846..0e62f65 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c
@@ -557,7 +557,7 @@ pci_config_max_read_request_size(struct rte_pci_device *dev)
return 0;
}
-static void
+void
pci_config_space_set(struct rte_pci_device *dev)
{
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
--
1.9.3
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: fix build
2015-07-28 22:48 [dpdk-dev] [PATCH] eal: fix build Helin Zhang
@ 2015-07-29 8:19 ` Thomas Monjalon
2015-07-29 15:00 ` Zhang, Helin
0 siblings, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2015-07-29 8:19 UTC (permalink / raw)
To: Helin Zhang; +Cc: dev
2015-07-29 06:48, Helin Zhang:
> It fixes the build error of implicit declaration of function.
What is the error?
Please show the build log and describe the case when it happens
(compiler, version).
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: fix build
2015-07-29 8:19 ` Thomas Monjalon
@ 2015-07-29 15:00 ` Zhang, Helin
2015-07-29 15:05 ` Gonzalez Monroy, Sergio
2015-07-29 15:08 ` Thomas Monjalon
0 siblings, 2 replies; 10+ messages in thread
From: Zhang, Helin @ 2015-07-29 15:00 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
Hi Thomas
It was just an implicit declaration of function, when set CONFIG_RTE_PCI_CONFIG=y, as follows. Nobody else cares about it.
/home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pci.c: In function �rte_eal_pci_probe_one_driver’:
/home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pci.c:188:4: error: implicit declaration of function �pci_config_space_set’ [-Werror=implicit-function-declaration]
pci_config_space_set(dev);
^
/home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pci.c:188:4: error: nested extern declaration of �pci_config_space_set’ [-Werror=nested-externs]
cc1: all warnings being treated as errors
/home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/linuxapp/eal/eal_pci.c:561:1: error: �pci_config_space_set’ defined but not used [-Werror=unused-function]
pci_config_space_set(struct rte_pci_device *dev)
^
cc1: all warnings being treated as errors
Regards,
Helin
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Wednesday, July 29, 2015 1:20 AM
> To: Zhang, Helin
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] eal: fix build
>
> 2015-07-29 06:48, Helin Zhang:
> > It fixes the build error of implicit declaration of function.
>
> What is the error?
> Please show the build log and describe the case when it happens (compiler,
> version).
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: fix build
2015-07-29 15:00 ` Zhang, Helin
@ 2015-07-29 15:05 ` Gonzalez Monroy, Sergio
2015-07-29 15:09 ` Zhang, Helin
2015-07-29 15:08 ` Thomas Monjalon
1 sibling, 1 reply; 10+ messages in thread
From: Gonzalez Monroy, Sergio @ 2015-07-29 15:05 UTC (permalink / raw)
To: Zhang, Helin; +Cc: dev
On 29/07/2015 16:00, Zhang, Helin wrote:
> Hi Thomas
>
> It was just an implicit declaration of function, when set CONFIG_RTE_PCI_CONFIG=y, as follows. Nobody else cares about it.
>
> /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pci.c: In function �rte_eal_pci_probe_one_driver’:
> /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pci.c:188:4: error: implicit declaration of function �pci_config_space_set’ [-Werror=implicit-function-declaration]
> pci_config_space_set(dev);
> ^
> /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pci.c:188:4: error: nested extern declaration of �pci_config_space_set’ [-Werror=nested-externs]
> cc1: all warnings being treated as errors
> /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/linuxapp/eal/eal_pci.c:561:1: error: �pci_config_space_set’ defined but not used [-Werror=unused-function]
> pci_config_space_set(struct rte_pci_device *dev)
> ^
> cc1: all warnings being treated as errors
>
> Regards,
> Helin
>
>> -----Original Message-----
>> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
>> Sent: Wednesday, July 29, 2015 1:20 AM
>> To: Zhang, Helin
>> Cc: dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH] eal: fix build
>>
>> 2015-07-29 06:48, Helin Zhang:
>>> It fixes the build error of implicit declaration of function.
>> What is the error?
>> Please show the build log and describe the case when it happens (compiler,
>> version).
Fixes: 4d4ebca4 ("pci: merge probing and closing functions for linux and
bsd")
The function rte_eal_pci_probe_one_driver, which calls
pci_config_space_set, was moved to eal_common_pci.c,
but pci_config_space_set was left in eal_pci.c with static specifier.
Sergio
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: fix build
2015-07-29 15:00 ` Zhang, Helin
2015-07-29 15:05 ` Gonzalez Monroy, Sergio
@ 2015-07-29 15:08 ` Thomas Monjalon
2015-07-29 15:18 ` Zhang, Helin
2015-07-30 0:10 ` Thomas Monjalon
1 sibling, 2 replies; 10+ messages in thread
From: Thomas Monjalon @ 2015-07-29 15:08 UTC (permalink / raw)
To: Zhang, Helin; +Cc: dev
2015-07-29 15:00, Zhang, Helin:
> Hi Thomas
>
> It was just an implicit declaration of function, when set
> CONFIG_RTE_PCI_CONFIG=y, as follows. Nobody else cares about it.
Why do we have this config option?
Please remove these useless ifdef's.
> /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pci.c: In function �rte_eal_pci_probe_one_driver’:
> /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pci.c:188:4: error: implicit declaration of function �pci_config_space_set’ [-Werror=implicit-function-declaration]
> pci_config_space_set(dev);
> ^
> /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pci.c:188:4: error: nested extern declaration of �pci_config_space_set’ [-Werror=nested-externs]
> cc1: all warnings being treated as errors
> /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/linuxapp/eal/eal_pci.c:561:1: error: �pci_config_space_set’ defined but not used [-Werror=unused-function]
> pci_config_space_set(struct rte_pci_device *dev)
> ^
> cc1: all warnings being treated as errors
So I will change the title to:
eal: fix build with pci config enabled
and add this into the message:
Build log:
lib/librte_eal/common/eal_common_pci.c:188:4: error:
implicit declaration of function pci_config_space_set
> > -----Original Message-----
> > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > Sent: Wednesday, July 29, 2015 1:20 AM
> > To: Zhang, Helin
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH] eal: fix build
> >
> > 2015-07-29 06:48, Helin Zhang:
> > > It fixes the build error of implicit declaration of function.
> >
> > What is the error?
> > Please show the build log and describe the case when it happens (compiler,
> > version).
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: fix build
2015-07-29 15:05 ` Gonzalez Monroy, Sergio
@ 2015-07-29 15:09 ` Zhang, Helin
2015-07-29 16:05 ` Thomas Monjalon
0 siblings, 1 reply; 10+ messages in thread
From: Zhang, Helin @ 2015-07-29 15:09 UTC (permalink / raw)
To: Gonzalez Monroy, Sergio; +Cc: dev
> -----Original Message-----
> From: Gonzalez Monroy, Sergio
> Sent: Wednesday, July 29, 2015 8:06 AM
> To: Zhang, Helin
> Cc: dev@dpdk.org; Thomas Monjalon
> Subject: Re: [dpdk-dev] [PATCH] eal: fix build
>
> On 29/07/2015 16:00, Zhang, Helin wrote:
> > Hi Thomas
> >
> > It was just an implicit declaration of function, when set
> CONFIG_RTE_PCI_CONFIG=y, as follows. Nobody else cares about it.
> >
> >
> /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pci.
> c: In function �rte_eal_pci_probe_one_driver’:
> >
> /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pci.
> c:188:4: error: implicit declaration of function �pci_config_space_set’
> [-Werror=implicit-function-declaration]
> > pci_config_space_set(dev);
> > ^
> >
> /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pc
> > i.c:188:4: error: nested extern declaration of
> > �pci_config_space_set’ [-Werror=nested-externs]
> > cc1: all warnings being treated as errors
> >
> /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/linuxapp/eal/eal_pci.c:561:
> 1: error: �pci_config_space_set’ defined but not used
> [-Werror=unused-function]
> > pci_config_space_set(struct rte_pci_device *dev)
> > ^
> > cc1: all warnings being treated as errors
> >
> > Regards,
> > Helin
> >
> >> -----Original Message-----
> >> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> >> Sent: Wednesday, July 29, 2015 1:20 AM
> >> To: Zhang, Helin
> >> Cc: dev@dpdk.org
> >> Subject: Re: [dpdk-dev] [PATCH] eal: fix build
> >>
> >> 2015-07-29 06:48, Helin Zhang:
> >>> It fixes the build error of implicit declaration of function.
> >> What is the error?
> >> Please show the build log and describe the case when it happens
> >> (compiler, version).
> Fixes: 4d4ebca4 ("pci: merge probing and closing functions for linux and
> bsd")
>
> The function rte_eal_pci_probe_one_driver, which calls pci_config_space_set,
> was moved to eal_common_pci.c, but pci_config_space_set was left in eal_pci.c
> with static specifier.
Yes, that's the root cause.
I am just have a thought that we may need to move all of those three functions
together into eal_common_pci.c, which can avoid exporting that function.
Helin
>
> Sergio
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: fix build
2015-07-29 15:08 ` Thomas Monjalon
@ 2015-07-29 15:18 ` Zhang, Helin
2015-07-30 0:10 ` Thomas Monjalon
1 sibling, 0 replies; 10+ messages in thread
From: Zhang, Helin @ 2015-07-29 15:18 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Wednesday, July 29, 2015 8:09 AM
> To: Zhang, Helin
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] eal: fix build
>
> 2015-07-29 15:00, Zhang, Helin:
> > Hi Thomas
> >
> > It was just an implicit declaration of function, when set
> > CONFIG_RTE_PCI_CONFIG=y, as follows. Nobody else cares about it.
>
> Why do we have this config option?
> Please remove these useless ifdef's.
>
> >
> /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pci.
> c: In function �rte_eal_pci_probe_one_driver’:
> >
> /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pci.
> c:188:4: error: implicit declaration of function �pci_config_space_set’
> [-Werror=implicit-function-declaration]
> > pci_config_space_set(dev);
> > ^
> >
> /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pc
> > i.c:188:4: error: nested extern declaration of
> > �pci_config_space_set’ [-Werror=nested-externs]
> > cc1: all warnings being treated as errors
> > /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/linuxapp/eal/eal_pci
> > .c:561:1: error: �pci_config_space_set’ defined but not used
> > [-Werror=unused-function] pci_config_space_set(struct rte_pci_device
> > *dev) ^
> > cc1: all warnings being treated as errors
>
> So I will change the title to:
> eal: fix build with pci config enabled
>
> and add this into the message:
> Build log:
> lib/librte_eal/common/eal_common_pci.c:188:4: error:
> implicit declaration of function pci_config_space_set
OK. Please help to do it. Thank you very much!
Regards,
Helin
>
>
> > > -----Original Message-----
> > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > > Sent: Wednesday, July 29, 2015 1:20 AM
> > > To: Zhang, Helin
> > > Cc: dev@dpdk.org
> > > Subject: Re: [dpdk-dev] [PATCH] eal: fix build
> > >
> > > 2015-07-29 06:48, Helin Zhang:
> > > > It fixes the build error of implicit declaration of function.
> > >
> > > What is the error?
> > > Please show the build log and describe the case when it happens
> > > (compiler, version).
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: fix build
2015-07-29 15:09 ` Zhang, Helin
@ 2015-07-29 16:05 ` Thomas Monjalon
2015-07-29 16:10 ` Zhang, Helin
0 siblings, 1 reply; 10+ messages in thread
From: Thomas Monjalon @ 2015-07-29 16:05 UTC (permalink / raw)
To: Zhang, Helin; +Cc: dev
2015-07-29 15:09, Zhang, Helin:
> From: Gonzalez Monroy, Sergio
> > Fixes: 4d4ebca4 ("pci: merge probing and closing functions for linux and bsd")
> >
> > The function rte_eal_pci_probe_one_driver, which calls pci_config_space_set,
> > was moved to eal_common_pci.c, but pci_config_space_set was left in eal_pci.c
> > with static specifier.
>
> Yes, that's the root cause.
> I am just have a thought that we may need to move all of those three functions
> together into eal_common_pci.c, which can avoid exporting that function.
No it is specific to Linux (implemented in igb_uio only).
But it may be moved to eal_common if you remove the igb_uio patch and use
the new functions to access to PCI config with UIO or VFIO:
http://dpdk.org/browse/dpdk/commit/?id=632b2d1deeed
This build fix will be applied for 2.1.
It is expected the above rework will be done for 2.2.
Thanks
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: fix build
2015-07-29 16:05 ` Thomas Monjalon
@ 2015-07-29 16:10 ` Zhang, Helin
0 siblings, 0 replies; 10+ messages in thread
From: Zhang, Helin @ 2015-07-29 16:10 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Wednesday, July 29, 2015 9:06 AM
> To: Zhang, Helin
> Cc: Gonzalez Monroy, Sergio; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] eal: fix build
>
> 2015-07-29 15:09, Zhang, Helin:
> > From: Gonzalez Monroy, Sergio
> > > Fixes: 4d4ebca4 ("pci: merge probing and closing functions for linux
> > > and bsd")
> > >
> > > The function rte_eal_pci_probe_one_driver, which calls
> > > pci_config_space_set, was moved to eal_common_pci.c, but
> > > pci_config_space_set was left in eal_pci.c with static specifier.
> >
> > Yes, that's the root cause.
> > I am just have a thought that we may need to move all of those three
> > functions together into eal_common_pci.c, which can avoid exporting that
> function.
>
> No it is specific to Linux (implemented in igb_uio only).
> But it may be moved to eal_common if you remove the igb_uio patch and use
> the new functions to access to PCI config with UIO or VFIO:
> http://dpdk.org/browse/dpdk/commit/?id=632b2d1deeed
Yes, I agree. It should be moved into i40e PMD only according to the user configurations.
Regards,
Helin
>
> This build fix will be applied for 2.1.
> It is expected the above rework will be done for 2.2.
> Thanks
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [dpdk-dev] [PATCH] eal: fix build
2015-07-29 15:08 ` Thomas Monjalon
2015-07-29 15:18 ` Zhang, Helin
@ 2015-07-30 0:10 ` Thomas Monjalon
1 sibling, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2015-07-30 0:10 UTC (permalink / raw)
To: Zhang, Helin; +Cc: dev
2015-07-29 17:08, Thomas Monjalon:
> 2015-07-29 15:00, Zhang, Helin:
> > /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pci.c: In function �rte_eal_pci_probe_one_driver’:
> > /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pci.c:188:4: error: implicit declaration of function �pci_config_space_set’ [-Werror=implicit-function-declaration]
> > pci_config_space_set(dev);
> > ^
> > /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/common/eal_common_pci.c:188:4: error: nested extern declaration of �pci_config_space_set’ [-Werror=nested-externs]
> > cc1: all warnings being treated as errors
> > /home/hzhan75/r22/isg_cid-dpdk_org/lib/librte_eal/linuxapp/eal/eal_pci.c:561:1: error: �pci_config_space_set’ defined but not used [-Werror=unused-function]
> > pci_config_space_set(struct rte_pci_device *dev)
> > ^
> > cc1: all warnings being treated as errors
>
> So I will change the title to:
> eal: fix build with pci config enabled
>
> and add this into the message:
> Build log:
> lib/librte_eal/common/eal_common_pci.c:188:4: error:
> implicit declaration of function pci_config_space_set
>
>
> > > 2015-07-29 06:48, Helin Zhang:
> > > > It fixes the build error of implicit declaration of function.
Applied, thanks
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-07-30 0:11 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-28 22:48 [dpdk-dev] [PATCH] eal: fix build Helin Zhang
2015-07-29 8:19 ` Thomas Monjalon
2015-07-29 15:00 ` Zhang, Helin
2015-07-29 15:05 ` Gonzalez Monroy, Sergio
2015-07-29 15:09 ` Zhang, Helin
2015-07-29 16:05 ` Thomas Monjalon
2015-07-29 16:10 ` Zhang, Helin
2015-07-29 15:08 ` Thomas Monjalon
2015-07-29 15:18 ` Zhang, Helin
2015-07-30 0:10 ` Thomas Monjalon
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).