diff mbox

linux-next: Tree for Jan 14 (lowpan, 802.15.4)

Message ID CALT56yPzfkz7=WdT0p6EYXdsQJUT+Ld9gdd72z6_czn0YaKUWA@mail.gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Dmitry Baryshkov Jan. 14, 2014, 10:54 p.m. UTC
Hello,


On Tue, Jan 14, 2014 at 9:49 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
>
> On 01/13/2014 09:51 PM, Stephen Rothwell wrote:
> > Hi all,
> >
> > This tree fails (more than usual) the powerpc allyesconfig build.
> >
> > Changes since 20140113:
> >
>
>
> on i386:
>
> net/built-in.o: In function `header_create':
> 6lowpan.c:(.text+0x166149): undefined reference to `lowpan_header_compress'
> net/built-in.o: In function `bt_6lowpan_recv':
> (.text+0x166b3c): undefined reference to `lowpan_process_data'

Ah, nice Makefile hack there.
David, Marcel, could you please consider the attached patch.

Comments

Alexander Aring Jan. 15, 2014, 9:45 a.m. UTC | #1
Hi Dmitry,

On Wed, Jan 15, 2014 at 02:54:56AM +0400, Dmitry Eremin-Solenikov wrote:
> Hello,
> 
> 
> On Tue, Jan 14, 2014 at 9:49 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
> >
> > On 01/13/2014 09:51 PM, Stephen Rothwell wrote:
> > > Hi all,
> > >
> > > This tree fails (more than usual) the powerpc allyesconfig build.
> > >
> > > Changes since 20140113:
> > >
> >
> >
> > on i386:
> >
> > net/built-in.o: In function `header_create':
> > 6lowpan.c:(.text+0x166149): undefined reference to `lowpan_header_compress'
> > net/built-in.o: In function `bt_6lowpan_recv':
> > (.text+0x166b3c): undefined reference to `lowpan_process_data'
> 
> Ah, nice Makefile hack there.
> David, Marcel, could you please consider the attached patch.

oops, thanks for fixing this fast!

- Alex
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Jan. 15, 2014, 11:36 p.m. UTC | #2
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Date: Wed, 15 Jan 2014 02:54:56 +0400

> David, Marcel, could you please consider the attached patch.

Applied, thanks Dmitry.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Randy Dunlap Jan. 17, 2014, 6:49 p.m. UTC | #3
On 01/14/2014 02:54 PM, Dmitry Eremin-Solenikov wrote:
> Hello,
> 
> 
> On Tue, Jan 14, 2014 at 9:49 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>> On 01/13/2014 09:51 PM, Stephen Rothwell wrote:
>>> Hi all,
>>>
>>> This tree fails (more than usual) the powerpc allyesconfig build.
>>>
>>> Changes since 20140113:
>>>
>>
>>
>> on i386:
>>
>> net/built-in.o: In function `header_create':
>> 6lowpan.c:(.text+0x166149): undefined reference to `lowpan_header_compress'
>> net/built-in.o: In function `bt_6lowpan_recv':
>> (.text+0x166b3c): undefined reference to `lowpan_process_data'
> 
> Ah, nice Makefile hack there.
> David, Marcel, could you please consider the attached patch.
> 
> 

Hi,
I guess that the Makefile hack is still causing problems.
With today's linux-next (20140117), I see these build errors (or warnings
in the case of loadable modules):


when 802.15.4 and Bluetooth are built as loadable modules:

WARNING: net/ieee802154/6lowpan_iphc: 'lowpan_header_compress' exported twice. Previous export was in net/bluetooth/bluetooth.ko
WARNING: net/ieee802154/6lowpan_iphc: 'lowpan_process_data' exported twice. Previous export was in net/bluetooth/bluetooth.ko

when they are builtin to the kernel image:

net/ieee802154/built-in.o: In function `lowpan_header_compress':
(.text+0x3d00): multiple definition of `lowpan_header_compress'
net/bluetooth/built-in.o:(.text+0x2e8f0): first defined here
net/ieee802154/built-in.o: In function `lowpan_process_data':
(.text+0x3230): multiple definition of `lowpan_process_data'
net/bluetooth/built-in.o:(.text+0x2de20): first defined here
Stephen Warren Jan. 17, 2014, 7:13 p.m. UTC | #4
On 01/14/2014 03:54 PM, Dmitry Eremin-Solenikov wrote:
> Hello,
> 
> 
> On Tue, Jan 14, 2014 at 9:49 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>> On 01/13/2014 09:51 PM, Stephen Rothwell wrote:
>>> Hi all,
>>>
>>> This tree fails (more than usual) the powerpc allyesconfig build.
>>>
>>> Changes since 20140113:
>>>
>>
>>
>> on i386:
>>
>> net/built-in.o: In function `header_create':
>> 6lowpan.c:(.text+0x166149): undefined reference to `lowpan_header_compress'
>> net/built-in.o: In function `bt_6lowpan_recv':
>> (.text+0x166b3c): undefined reference to `lowpan_process_data'
> 
> Ah, nice Makefile hack there.
> David, Marcel, could you please consider the attached patch.

I think you forgot to "git add net/bluetooth/Makefile" into that patch;
don't you need the following too (I certainly do, to build next-20140117)

> diff --git a/net/bluetooth/Makefile b/net/bluetooth/Makefile
> index cc6827e2ce68..80cb215826e8 100644
> --- a/net/bluetooth/Makefile
> +++ b/net/bluetooth/Makefile
> @@ -12,8 +12,4 @@ bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \
>  	hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o sco.o lib.o \
>  	a2mp.o amp.o 6lowpan.o
>  
> -ifeq ($(CONFIG_IEEE802154_6LOWPAN),)
> -  bluetooth-y +=  ../ieee802154/6lowpan_iphc.o
> -endif
> -
>  subdir-ccflags-y += -D__CHECK_ENDIAN__

Should I send this as a separate followup patch?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Randy Dunlap Jan. 17, 2014, 7:20 p.m. UTC | #5
On 01/17/2014 11:13 AM, Stephen Warren wrote:
> On 01/14/2014 03:54 PM, Dmitry Eremin-Solenikov wrote:
>> Hello,
>>
>>
>> On Tue, Jan 14, 2014 at 9:49 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
>>>
>>> On 01/13/2014 09:51 PM, Stephen Rothwell wrote:
>>>> Hi all,
>>>>
>>>> This tree fails (more than usual) the powerpc allyesconfig build.
>>>>
>>>> Changes since 20140113:
>>>>
>>>
>>>
>>> on i386:
>>>
>>> net/built-in.o: In function `header_create':
>>> 6lowpan.c:(.text+0x166149): undefined reference to `lowpan_header_compress'
>>> net/built-in.o: In function `bt_6lowpan_recv':
>>> (.text+0x166b3c): undefined reference to `lowpan_process_data'
>>
>> Ah, nice Makefile hack there.
>> David, Marcel, could you please consider the attached patch.
> 
> I think you forgot to "git add net/bluetooth/Makefile" into that patch;
> don't you need the following too (I certainly do, to build next-20140117)

Yes, that fixes the problems.

>> diff --git a/net/bluetooth/Makefile b/net/bluetooth/Makefile
>> index cc6827e2ce68..80cb215826e8 100644
>> --- a/net/bluetooth/Makefile
>> +++ b/net/bluetooth/Makefile
>> @@ -12,8 +12,4 @@ bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \
>>  	hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o sco.o lib.o \
>>  	a2mp.o amp.o 6lowpan.o
>>  
>> -ifeq ($(CONFIG_IEEE802154_6LOWPAN),)
>> -  bluetooth-y +=  ../ieee802154/6lowpan_iphc.o
>> -endif
>> -
>>  subdir-ccflags-y += -D__CHECK_ENDIAN__
> 
> Should I send this as a separate followup patch?
> --

I think so.  It was not part of the posted patch.

Thanks.
Dmitry Baryshkov Jan. 17, 2014, 8:59 p.m. UTC | #6
Hello,

On Fri, Jan 17, 2014 at 11:13 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 01/14/2014 03:54 PM, Dmitry Eremin-Solenikov wrote:
>> Hello,
>>
>>
>> On Tue, Jan 14, 2014 at 9:49 PM, Randy Dunlap <rdunlap@infradead.org> wrote:
>>>
>>> On 01/13/2014 09:51 PM, Stephen Rothwell wrote:
>>>> Hi all,
>>>>
>>>> This tree fails (more than usual) the powerpc allyesconfig build.
>>>>
>>>> Changes since 20140113:
>>>>
>>>
>>>
>>> on i386:
>>>
>>> net/built-in.o: In function `header_create':
>>> 6lowpan.c:(.text+0x166149): undefined reference to `lowpan_header_compress'
>>> net/built-in.o: In function `bt_6lowpan_recv':
>>> (.text+0x166b3c): undefined reference to `lowpan_process_data'
>>
>> Ah, nice Makefile hack there.
>> David, Marcel, could you please consider the attached patch.
>
> I think you forgot to "git add net/bluetooth/Makefile" into that patch;
> don't you need the following too (I certainly do, to build next-20140117)
>
>> diff --git a/net/bluetooth/Makefile b/net/bluetooth/Makefile
>> index cc6827e2ce68..80cb215826e8 100644
>> --- a/net/bluetooth/Makefile
>> +++ b/net/bluetooth/Makefile
>> @@ -12,8 +12,4 @@ bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \
>>       hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o sco.o lib.o \
>>       a2mp.o amp.o 6lowpan.o
>>
>> -ifeq ($(CONFIG_IEEE802154_6LOWPAN),)
>> -  bluetooth-y +=  ../ieee802154/6lowpan_iphc.o
>> -endif
>> -
>>  subdir-ccflags-y += -D__CHECK_ENDIAN__
>
> Should I send this as a separate followup patch?

Yes, please. I forgot to add it to the patch.
diff mbox

Patch

From 4c3db6d3c244decf434665c30c1bf75aad1f94b2 Mon Sep 17 00:00:00 2001
From: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
Date: Wed, 15 Jan 2014 02:50:40 +0400
Subject: [PATCH] net: move 6lowpan compression code to separate module

IEEE 802.15.4 and Bluetooth networking stacks share 6lowpan compression
code. Instead of introducing Makefile/Kconfig hacks, build this code as
a separate module referenced from both ieee802154 and bluetooth modules.

This fixes the following build error observed in some kernel
configurations:

net/built-in.o: In function `header_create': 6lowpan.c:(.text+0x166149): undefined reference to `lowpan_header_compress'
net/built-in.o: In function `bt_6lowpan_recv': (.text+0x166b3c): undefined reference to `lowpan_process_data'

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
---
 net/Makefile            | 2 +-
 net/bluetooth/Kconfig   | 1 +
 net/ieee802154/Kconfig  | 7 +++++++
 net/ieee802154/Makefile | 3 ++-
 4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/net/Makefile b/net/Makefile
index 8fa2f91..cbbbe6d 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -57,7 +57,7 @@  obj-$(CONFIG_CAIF)		+= caif/
 ifneq ($(CONFIG_DCB),)
 obj-y				+= dcb/
 endif
-obj-$(CONFIG_IEEE802154)	+= ieee802154/
+obj-y				+= ieee802154/
 obj-$(CONFIG_MAC802154)		+= mac802154/
 
 ifeq ($(CONFIG_NET),y)
diff --git a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig
index d3f3f7b..985b560 100644
--- a/net/bluetooth/Kconfig
+++ b/net/bluetooth/Kconfig
@@ -12,6 +12,7 @@  menuconfig BT
 	select CRYPTO_AES
 	select CRYPTO_ECB
 	select CRYPTO_SHA256
+	select 6LOWPAN_IPHC
 	help
 	  Bluetooth is low-cost, low-power, short-range wireless technology.
 	  It was designed as a replacement for cables and other short-range
diff --git a/net/ieee802154/Kconfig b/net/ieee802154/Kconfig
index b2e06df..9c9879d 100644
--- a/net/ieee802154/Kconfig
+++ b/net/ieee802154/Kconfig
@@ -13,5 +13,12 @@  config IEEE802154
 config IEEE802154_6LOWPAN
 	tristate "6lowpan support over IEEE 802.15.4"
 	depends on IEEE802154 && IPV6
+	select 6LOWPAN_IPHC
 	---help---
 	IPv6 compression over IEEE 802.15.4.
+
+config 6LOWPAN_IPHC
+	tristate
+	---help---
+	  6lowpan compression code which is shared between IEEE 802.15.4 and Bluetooth
+	  stacks.
diff --git a/net/ieee802154/Makefile b/net/ieee802154/Makefile
index 951a83e..e8f0588 100644
--- a/net/ieee802154/Makefile
+++ b/net/ieee802154/Makefile
@@ -1,5 +1,6 @@ 
 obj-$(CONFIG_IEEE802154) += ieee802154.o af_802154.o
-obj-$(CONFIG_IEEE802154_6LOWPAN) += 6lowpan.o 6lowpan_iphc.o
+obj-$(CONFIG_IEEE802154_6LOWPAN) += 6lowpan.o
+obj-$(CONFIG_6LOWPAN_IPHC) += 6lowpan_iphc.o
 
 ieee802154-y := netlink.o nl-mac.o nl-phy.o nl_policy.o wpan-class.o
 af_802154-y := af_ieee802154.o raw.o dgram.o
-- 
1.8.5.2