* [PATCH net-next] packet: Fix compile error
@ 2013-03-19 22:01 Daniel Baluta
2013-03-19 22:07 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Baluta @ 2013-03-19 22:01 UTC (permalink / raw)
To: willemb, edumazet, davem, netdev; +Cc: Daniel Baluta
PACKET_FANOUT_ROLLOVER and PACKET_FANOUT_FLAG_ROLLOVER are not declared in
<tree>/usr/include/linux/if_packet.h together with the other PACKET_FANOUT_* macros
as one would expect. This causes the following compilation error:
<snip>
psock_fanout.c: In function ‘test_control_single’:
psock_fanout.c:230:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared (first use in this function)
</snip>
Signed-off-by: Daniel Baluta <dbaluta@ixiacom.com>
---
.../testing/selftests/net-afpacket/psock_fanout.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net-afpacket/psock_fanout.c b/tools/testing/selftests/net-afpacket/psock_fanout.c
index 09dbf93..c827415 100644
--- a/tools/testing/selftests/net-afpacket/psock_fanout.c
+++ b/tools/testing/selftests/net-afpacket/psock_fanout.c
@@ -63,6 +63,7 @@
#define PACKET_FANOUT_LB 1
#define PACKET_FANOUT_CPU 2
#define PACKET_FANOUT_FLAG_DEFRAG 0x8000
+#endif
#ifndef PACKET_FANOUT_ROLLOVER
#define PACKET_FANOUT_ROLLOVER 3
@@ -72,8 +73,6 @@
#define PACKET_FANOUT_FLAG_ROLLOVER 0x1000
#endif
-#endif
-
#define DATA_LEN 100
#define DATA_CHAR 'a'
--
1.7.5.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] packet: Fix compile error
2013-03-19 22:01 [PATCH net-next] packet: Fix compile error Daniel Baluta
@ 2013-03-19 22:07 ` David Miller
2013-03-19 22:46 ` Daniel Baluta
0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2013-03-19 22:07 UTC (permalink / raw)
To: dbaluta; +Cc: willemb, edumazet, netdev
From: Daniel Baluta <dbaluta@ixiacom.com>
Date: Wed, 20 Mar 2013 00:01:21 +0200
> PACKET_FANOUT_ROLLOVER and PACKET_FANOUT_FLAG_ROLLOVER are not declared in
> <tree>/usr/include/linux/if_packet.h together with the other PACKET_FANOUT_* macros
> as one would expect. This causes the following compilation error:
> <snip>
> psock_fanout.c: In function ‘test_control_single’:
> psock_fanout.c:230:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared (first use in this function)
> </snip>
>
> Signed-off-by: Daniel Baluta <dbaluta@ixiacom.com>
No, in fact, all of these should be removed completely.
They are provided by the header files under linux/usr/include which
get created by the "make headers_install" rule.
So you either need to run the "make headers_install" rule before
building the tests, or install the updated headers under /usr/include
on your test machine.
I'll remove the defines from the test, thanks for pointing this
out.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] packet: Fix compile error
2013-03-19 22:07 ` David Miller
@ 2013-03-19 22:46 ` Daniel Baluta
2013-03-19 23:06 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Baluta @ 2013-03-19 22:46 UTC (permalink / raw)
To: David Miller; +Cc: willemb, edumazet, netdev
On Wed, Mar 20, 2013 at 12:07 AM, David Miller <davem@davemloft.net> wrote:
> From: Daniel Baluta <dbaluta@ixiacom.com>
> Date: Wed, 20 Mar 2013 00:01:21 +0200
>
>> PACKET_FANOUT_ROLLOVER and PACKET_FANOUT_FLAG_ROLLOVER are not declared in
>> <tree>/usr/include/linux/if_packet.h together with the other PACKET_FANOUT_* macros
>> as one would expect. This causes the following compilation error:
>> <snip>
>> psock_fanout.c: In function ‘test_control_single’:
>> psock_fanout.c:230:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared (first use in this function)
>> </snip>
>>
>> Signed-off-by: Daniel Baluta <dbaluta@ixiacom.com>
>
> No, in fact, all of these should be removed completely.
>
> They are provided by the header files under linux/usr/include which
> get created by the "make headers_install" rule.
>
> So you either need to run the "make headers_install" rule before
> building the tests, or install the updated headers under /usr/include
> on your test machine.
>
> I'll remove the defines from the test, thanks for pointing this
> out.
Sorry if I am missing something but I don't think it's necessary to
"make headers_install" because selftests compilaton target already
include -I../../../../usr/include/ that points to linux/usr/include.
Anyhow, this is not an issue :). The problem is that there is no definition
for PACKET_FANOUT_ROLLOVER or PACKET_FANOUT_FLAG_ROLLOVER,
and the compilation still fails:
$ make
gcc -Wall -I../../../../usr/include/ -o psock_fanout psock_fanout.c
psock_fanout.c: In function ‘test_control_single’:
psock_fanout.c:212:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared
(first use in this function)
On your system where does PACKET_FANOUT_ROLLOVER gets defined?
thanks,
Daniel.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] packet: Fix compile error
2013-03-19 22:46 ` Daniel Baluta
@ 2013-03-19 23:06 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-03-19 23:06 UTC (permalink / raw)
To: daniel.baluta; +Cc: willemb, edumazet, netdev
From: Daniel Baluta <daniel.baluta@gmail.com>
Date: Wed, 20 Mar 2013 00:46:38 +0200
> On Wed, Mar 20, 2013 at 12:07 AM, David Miller <davem@davemloft.net> wrote:
>> From: Daniel Baluta <dbaluta@ixiacom.com>
>> Date: Wed, 20 Mar 2013 00:01:21 +0200
>>
>>> PACKET_FANOUT_ROLLOVER and PACKET_FANOUT_FLAG_ROLLOVER are not declared in
>>> <tree>/usr/include/linux/if_packet.h together with the other PACKET_FANOUT_* macros
>>> as one would expect. This causes the following compilation error:
>>> <snip>
>>> psock_fanout.c: In function ‘test_control_single’:
>>> psock_fanout.c:230:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared (first use in this function)
>>> </snip>
>>>
>>> Signed-off-by: Daniel Baluta <dbaluta@ixiacom.com>
>>
>> No, in fact, all of these should be removed completely.
>>
>> They are provided by the header files under linux/usr/include which
>> get created by the "make headers_install" rule.
>>
>> So you either need to run the "make headers_install" rule before
>> building the tests, or install the updated headers under /usr/include
>> on your test machine.
>>
>> I'll remove the defines from the test, thanks for pointing this
>> out.
>
> Sorry if I am missing something but I don't think it's necessary to
> "make headers_install" because selftests compilaton target already
> include -I../../../../usr/include/ that points to linux/usr/include.
"make headers_install" populates the top-level usr/include/ with
actual header files.
You need to do this, unless you have the header check kconfig option
enabled.
That's how the tests can obtain the version of the headers in the
kernel tree in which they live, rather than the system headers.
> Anyhow, this is not an issue :). The problem is that there is no definition
> for PACKET_FANOUT_ROLLOVER or PACKET_FANOUT_FLAG_ROLLOVER,
> and the compilation still fails:
>
> $ make
> gcc -Wall -I../../../../usr/include/ -o psock_fanout psock_fanout.c
> psock_fanout.c: In function ‘test_control_single’:
> psock_fanout.c:212:23: error: ‘PACKET_FANOUT_ROLLOVER’ undeclared
> (first use in this function)
>
> On your system where does PACKET_FANOUT_ROLLOVER gets defined?
In include/uapi/linux/if_packet.h via usr/include/linux/if_packet.h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-03-19 23:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-19 22:01 [PATCH net-next] packet: Fix compile error Daniel Baluta
2013-03-19 22:07 ` David Miller
2013-03-19 22:46 ` Daniel Baluta
2013-03-19 23:06 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox