[dpdk-dev] contigmem: include <sys/vmmeter.h> to fix FreeBSD build

Message ID CAJE9aOO9J954eT3zNsUagsWu7oiPxvwnh2zRuu7LKO2DdcuZnw@mail.gmail.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Kefu Chai Dec. 1, 2017, 11:22 a.m. UTC
  otherwise the build fails with FreeBSD 12, like

In file included from contigmem.c:57:
/usr/srcs/head/src/sys/vm/vm_phys.h:122:10: error: use of undeclared
identifier 'vm_cnt'
        return (vm_cnt.v_free_count += adj);
                ^
1 error generated.
*** Error code 1

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
---
 lib/librte_eal/bsdapp/contigmem/contigmem.c | 1 +
 1 file changed, 1 insertion(+)

--
2.15.0
  

Comments

Bruce Richardson Dec. 1, 2017, 1:20 p.m. UTC | #1
On Fri, Dec 01, 2017 at 07:22:39PM +0800, kefu chai wrote:
> otherwise the build fails with FreeBSD 12, like
> 
> In file included from contigmem.c:57:
> /usr/srcs/head/src/sys/vm/vm_phys.h:122:10: error: use of undeclared
> identifier 'vm_cnt'
>         return (vm_cnt.v_free_count += adj);
>                 ^
> 1 error generated.
> *** Error code 1
> 
> Signed-off-by: Kefu Chai <tchaikov@gmail.com>
> ---
As before:

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

NOTE: for minor changes to patches, feel free to include an acked-by tag
on the patch submission if the previous version had already been acked.
Also, it's good practice to have updated versions marked with a V2
number and posted in reply to the original submission. See dev page on
dpdk.org for more details. http://dpdk.org/dev/
  
Thomas Monjalon Jan. 9, 2018, 3:38 p.m. UTC | #2
01/12/2017 14:20, Bruce Richardson:
> On Fri, Dec 01, 2017 at 07:22:39PM +0800, kefu chai wrote:
> > otherwise the build fails with FreeBSD 12, like
> > 
> > In file included from contigmem.c:57:
> > /usr/srcs/head/src/sys/vm/vm_phys.h:122:10: error: use of undeclared
> > identifier 'vm_cnt'
> >         return (vm_cnt.v_free_count += adj);
> >                 ^
> > 1 error generated.
> > *** Error code 1
> > 
> > Signed-off-by: Kefu Chai <tchaikov@gmail.com>
> > ---
> As before:
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_eal/bsdapp/contigmem/contigmem.c
b/lib/librte_eal/bsdapp/contigmem/contigmem.c
index e8fb9087d..9676d8b35 100644
--- a/lib/librte_eal/bsdapp/contigmem/contigmem.c
+++ b/lib/librte_eal/bsdapp/contigmem/contigmem.c
@@ -45,6 +45,7 @@  __FBSDID("$FreeBSD$");
 #include <sys/rwlock.h>
 #include <sys/systm.h>
 #include <sys/sysctl.h>
+#include <sys/vmmeter.h>

 #include <machine/bus.h>