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

Message ID CAJE9aOOzDfytgQXxKQ5nN0DRrm_nxGGj=7AuTdFxYm2755-ApQ@mail.gmail.com (mailing list archive)
State Superseded, archived
Headers

Checks

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

Commit Message

Kefu Chai Nov. 30, 2017, 6 a.m. UTC
  otherwise the build fails with

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 Nov. 30, 2017, 9:56 a.m. UTC | #1
On Thu, Nov 30, 2017 at 02:00:38PM +0800, kefu chai wrote:
> otherwise the build fails with
> 
> 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>
> ---

Hi,

what version of FreeBSD does this error occur on? Though it's been a few
weeks since I last tested, I haven't seen it before on other FreeBSD 10
or 11.

Regards,
/Bruce
  
Kefu Chai Dec. 1, 2017, 2 a.m. UTC | #2
+ Willem, he reported this issue

On Thu, Nov 30, 2017 at 5:56 PM, Bruce Richardson
<bruce.richardson@intel.com> wrote:
> On Thu, Nov 30, 2017 at 02:00:38PM +0800, kefu chai wrote:
>> otherwise the build fails with
>>
>> 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>
>> ---
>
> Hi,
>
> what version of FreeBSD does this error occur on? Though it's been a few
> weeks since I last tested, I haven't seen it before on other FreeBSD 10
> or 11.

Bruce,

wjw@cephdev:~ % uname -a
FreeBSD cephdev.digiware.nl 12.0-CURRENT FreeBSD 12.0-CURRENT #15
r324142M: Sun Oct  1 08:19:29 CEST 2017
root@cephdev.digiware.nl:/usr/obj/usr/srcs/head/src/sys/GENERIC-NODEBUG
 amd64

>
> Regards,
> /Bruce
  
Bruce Richardson Dec. 1, 2017, 10:20 a.m. UTC | #3
On Thu, Nov 30, 2017 at 02:00:38PM +0800, kefu chai wrote:
> otherwise the build fails with
> 
> 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>
> ---

The commit log could do with being updated to note that the error occurs
with, currently unreleased, FreeBSD 12  Otherwise:

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

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>