Skip to contentSkip to conversation

6lowpan: few changes to help with backports

PATCH In review Luis R. Rodriguez 5 participants 12 messages Apr 18, 2014 – Apr 22, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover 6lowpan: few changes to help with backports

Here's a few changes that can help automate the backport of 6lowpan. I've been carrying them around for a while, I think its best to just merge these upstream as its nothing controversial.

Luis R. Rodriguez (3):
6lowpan: add helper to get 6lowpan namespace
6lowpan: make lowpan_cb static
6lowpan: include net/net_namespace.h on 6lowpan namepsace header

 include/net/6lowpan.h       |  1 +
 include/net/net_namespace.h | 15 ++++++++++++++
 net/ieee802154/reassembly.c | 48 +++++++++++++++++++++++++++++----------------
 3 files changed, 47 insertions(+), 17 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/3 6lowpan: add helper to get 6lowpan namespace

From: "Luis R. Rodriguez" <mcgrof-IBi9RG/[email protected]>

This will simplify the new reassembly backport
with no code changes being required.

CC Alexander Smirnov <[email protected]>
Cc Dmitry Eremin-Solenikov <[email protected]>
Cc linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc David S. Miller" <davem-fT/PcQaiUtIeIZ0/[email protected]>
---
 include/net/net_namespace.h | 15 +++++++++++++++
 net/ieee802154/reassembly.c | 46 +++++++++++++++++++++++++++++----------------
 2 files changed, 45 insertions(+), 16 deletions(-)
include/net/net_namespace.h +15 -0
index 5f9eb26..bc4118e 100644
@@ -373,6 +373,21 @@ static inline void rt_genid_bump_ipv6(struct net *net)
 }
 #endif
 
+#if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN)
+static inline struct netns_ieee802154_lowpan *
+net_ieee802154_lowpan(struct net *net)
+{
+	return &net->ieee802154_lowpan;
+}
+#else
+static inline struct netns_ieee802154_lowpan *
+net_ieee802154_lowpan(struct net *net)
+{
+	return NULL;
+}
+#endif
+
+
 /* For callers who don't really care about whether it's IPv4 or IPv6 */
 static inline void rt_genid_bump_all(struct net *net)
 {
net/ieee802154/reassembly.c +30 -16

111 lines not on this page · raw message

Signature · 9 lines
1.9.1


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
#2 lore raw

Re: [PATCH 1/3] 6lowpan: add helper to get 6lowpan namespace

include/net/net_namespace.h static inline void rt_genid_bump_ipv6(struct net *net) · line 388

Quoted 9 lines · Luis R. Rodriguez
include/net/net_namespace.h +8 -0
+#if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN)
[...]
+#else
+static inline struct netns_ieee802154_lowpan *
+net_ieee802154_lowpan(struct net *net)
+{
+	return NULL;
+}
+#endif

Why would that be needed? If nobody compiles 802.15.4 then it seems nothing should reference it?

johannes

maintainer
#3 lore raw

Re: [PATCH 1/3] 6lowpan: add helper to get 6lowpan namespace

Hi,

Quoted 15 lines · Johannes Berg

include/net/net_namespace.h static inline void rt_genid_bump_ipv6(struct net *net) · line 388

Quoted 9 lines · Luis R. Rodriguez
include/net/net_namespace.h +8 -0
+#if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN)
[...]
+#else
+static inline struct netns_ieee802154_lowpan *
+net_ieee802154_lowpan(struct net *net)
+{
+	return NULL;
+}
+#endif

Why would that be needed? If nobody compiles 802.15.4 then it seems nothing should reference it?

Indeed I think this is unnecessary, also.

- Alex

#4 lore raw

Re: [PATCH 1/3] 6lowpan: add helper to get 6lowpan namespace

Quoted 18 lines · Alexander Aring

Hi,

Quoted 15 lines · Johannes Berg

include/net/net_namespace.h static inline void rt_genid_bump_ipv6(struct net *net) · line 388

Quoted 9 lines · Luis R. Rodriguez
include/net/net_namespace.h +8 -0
+#if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN)
[...]
+#else
+static inline struct netns_ieee802154_lowpan *
+net_ieee802154_lowpan(struct net *net)
+{
+	return NULL;
+}
+#endif

Why would that be needed? If nobody compiles 802.15.4 then it seems nothing should reference it?

Quoted 1 line

Indeed I think this is unnecessary, also.

I wanted to be sure, and I was not. Right now 6lowpan does not depend on CONFIG_NET_NS, is this intentional? I think its fine without it but I was not sure.

Luis

#5 lore raw

Re: [PATCH 1/3] 6lowpan: add helper to get 6lowpan namespace

Quoted 13 lines · Luis R. Rodriguez
Quoted 13 lines
Quoted 13 lines

include/net/net_namespace.h static inline void rt_genid_bump_ipv6(struct net *net) · line 388

Quoted 9 lines
include/net/net_namespace.h +8 -0
+#if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN)
[...]
+#else
+static inline struct netns_ieee802154_lowpan *
+net_ieee802154_lowpan(struct net *net)
+{
+	return NULL;
+}
+#endif

Why would that be needed? If nobody compiles 802.15.4 then it seems nothing should reference it?

Quoted 5 lines
Quoted 1 line

Indeed I think this is unnecessary, also.

I wanted to be sure, and I was not. Right now 6lowpan does not depend on CONFIG_NET_NS, is this intentional? I think its fine without it but I was not sure.

I fail to see how !CONFIG_LOWPAN is related CONFIG_NET_NS?

johannes

maintainer
#6 lore raw

Re: [PATCH 1/3] 6lowpan: add helper to get 6lowpan namespace

Quoted 15 lines · Johannes Berg
Quoted 13 lines · Luis R. Rodriguez
Quoted 13 lines
Quoted 13 lines

include/net/net_namespace.h static inline void rt_genid_bump_ipv6(struct net *net) · line 388

Quoted 9 lines
include/net/net_namespace.h +8 -0
+#if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN)
[...]
+#else
+static inline struct netns_ieee802154_lowpan *
+net_ieee802154_lowpan(struct net *net)
+{
+	return NULL;
+}
+#endif

Why would that be needed? If nobody compiles 802.15.4 then it seems nothing should reference it?

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Indeed I think this is unnecessary, also.

I wanted to be sure, and I was not. Right now 6lowpan does not depend on CONFIG_NET_NS, is this intentional? I think its fine without it but I was not sure.

I fail to see how !CONFIG_LOWPAN is related CONFIG_NET_NS?

mhh, IEEE802154_6LOWPAN depends on IPV6 and I think IPV6 is related to CONFIG_NET_NS.

- Alex

#7 lore raw

Re: [PATCH 1/3] 6lowpan: add helper to get 6lowpan namespace

Quoted 22 lines · Alexander Aring
Quoted 21 lines · Johannes Berg
Quoted 18 lines · Luis R. Rodriguez
Quoted 13 lines
Quoted 4 lines
Quoted 4 lines
include/net/net_namespace.h +3 -0
+#if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN)
[...]
+#else
+static inline struct netns_ieee802154_lowpan *
Quoted 9 lines

include/net/net_namespace.h static inline void rt_genid_bump_ipv6(struct net *net) · line 388

Quoted 5 lines
include/net/net_namespace.h +5 -0
+net_ieee802154_lowpan(struct net *net)
+{
+     return NULL;
+}
+#endif

Why would that be needed? If nobody compiles 802.15.4 then it seems nothing should reference it?

Quoted 1 line

Indeed I think this is unnecessary, also.

I wanted to be sure, and I was not. Right now 6lowpan does not depend on CONFIG_NET_NS, is this intentional? I think its fine without it but I was not sure.

Quoted 5 lines
Quoted 2 lines

I fail to see how !CONFIG_LOWPAN is related CONFIG_NET_NS?

mhh, IEEE802154_6LOWPAN depends on IPV6 and I think IPV6 is related to CONFIG_NET_NS.

Just test compiled IEEE802154_6LOWPAN without NET_NS and then also disabled IPV6 and it compiles, IEEE802154_6LOWPAN already depends on IPV6.

Luis

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform

#8 lore raw

Re: [PATCH 1/3] 6lowpan: add helper to get 6lowpan namespace

In reply to Johannes Berg
Quoted 15 lines · Johannes Berg
Quoted 13 lines · Luis R. Rodriguez
Quoted 13 lines
Quoted 13 lines

include/net/net_namespace.h static inline void rt_genid_bump_ipv6(struct net *net) · line 388

Quoted 9 lines
include/net/net_namespace.h +8 -0
+#if IS_ENABLED(CONFIG_IEEE802154_6LOWPAN)
[...]
+#else
+static inline struct netns_ieee802154_lowpan *
+net_ieee802154_lowpan(struct net *net)
+{
+       return NULL;
+}
+#endif

Why would that be needed? If nobody compiles 802.15.4 then it seems nothing should reference it?

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Indeed I think this is unnecessary, also.

I wanted to be sure, and I was not. Right now 6lowpan does not depend on CONFIG_NET_NS, is this intentional? I think its fine without it but I was not sure.

I fail to see how !CONFIG_LOWPAN is related CONFIG_NET_NS?

I concerned about the inverse but I just test compiled it and it seems fine, will send a follow up to nuke this hunk.

Luis

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform

#9 lore raw

PATCH 2/3 6lowpan: make lowpan_cb static

In reply to Luis R. Rodriguez

From: "Luis R. Rodriguez" <mcgrof-IBi9RG/[email protected]>

CC Alexander Smirnov <[email protected]>
Cc Dmitry Eremin-Solenikov <[email protected]>
Cc linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
---
 net/ieee802154/reassembly.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ieee802154/reassembly.c +1 -1
index 132b65b..6f1428c 100644
@@ -36,7 +36,7 @@ struct lowpan_frag_info {
 	u8 d_offset;
 };
 
-struct lowpan_frag_info *lowpan_cb(struct sk_buff *skb)
+static struct lowpan_frag_info *lowpan_cb(struct sk_buff *skb)
 {
 	return (struct lowpan_frag_info *)skb->cb;
 }
Signature · 9 lines
1.9.1


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
#10 lore raw

PATCH 3/3 6lowpan: include net/net_namespace.h on 6lowpan namepsace header

In reply to Luis R. Rodriguez

From: "Luis R. Rodriguez" <mcgrof-IBi9RG/[email protected]>

Don't rely on driver files or other headers having this file included.

CC Alexander Smirnov <[email protected]>
Cc Dmitry Eremin-Solenikov <[email protected]>
Cc linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
---
 include/net/6lowpan.h | 1 +
 1 file changed, 1 insertion(+)
include/net/6lowpan.h +1 -0
index f7d372b..79b530f 100644
@@ -54,6 +54,7 @@
 #define __6LOWPAN_H__
 
 #include <net/ipv6.h>
+#include <net/net_namespace.h>
 
 #define UIP_802154_SHORTADDR_LEN	2  /* compressed ipv6 address length */
 #define UIP_IPH_LEN			40 /* ipv6 fixed header size */
Signature · 9 lines
1.9.1


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
maintainer
#11 lore raw
In reply to Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>
Date: Thu, 17 Apr 2014 18:22:53 -0700

Quoted 3 lines

Here's a few changes that can help automate the backport of 6lowpan. I've been carrying them around for a while, I think its best to just merge these upstream as its nothing controversial.

Series applied.