* [PATCH net-next 0/4] net: dev: Make protocol ptr dependent on CONFIG
@ 2018-02-13 16:51 David Ahern
2018-02-13 16:52 ` [PATCH net-next 1/4] net: Make dn_ptr depend on CONFIG_DECNET David Ahern
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: David Ahern @ 2018-02-13 16:51 UTC (permalink / raw)
To: netdev; +Cc: David Ahern
Found these in a branch from 3-years ago. Still relevant today.
Make decnet, ax25, and atalk ptrs in net_device based on their
respective CONFIG.
David Ahern (4):
net: Make dn_ptr depend on CONFIG_DECNET
net: Make ax25_ptr depend on CONFIG_AX25
net: Make atalk_ptr depend on ATALK or IRDA
net: Remove atalk header from socket.c
include/linux/atalk.h | 2 ++
include/linux/netdevice.h | 6 ++++++
include/net/ax25.h | 2 ++
net/core/dev.c | 3 ++-
net/socket.c | 1 -
5 files changed, 12 insertions(+), 2 deletions(-)
--
2.11.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next 1/4] net: Make dn_ptr depend on CONFIG_DECNET
2018-02-13 16:51 [PATCH net-next 0/4] net: dev: Make protocol ptr dependent on CONFIG David Ahern
@ 2018-02-13 16:52 ` David Ahern
2018-02-13 16:52 ` [PATCH net-next 2/4] net: Make ax25_ptr depend on CONFIG_AX25 David Ahern
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: David Ahern @ 2018-02-13 16:52 UTC (permalink / raw)
To: netdev; +Cc: David Ahern
Signed-off-by: David Ahern <dsahern@gmail.com>
---
include/linux/netdevice.h | 2 ++
net/core/dev.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 4c77f39ebd65..f99cf3bb4690 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1800,7 +1800,9 @@ struct net_device {
#endif
void *atalk_ptr;
struct in_device __rcu *ip_ptr;
+#if IS_ENABLED(CONFIG_DECNET)
struct dn_dev __rcu *dn_ptr;
+#endif
struct inet6_dev __rcu *ip6_ptr;
void *ax25_ptr;
struct wireless_dev *ieee80211_ptr;
diff --git a/net/core/dev.c b/net/core/dev.c
index dda9d7b9a840..f8c105c22b7f 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -8134,8 +8134,9 @@ void netdev_run_todo(void)
BUG_ON(!list_empty(&dev->ptype_specific));
WARN_ON(rcu_access_pointer(dev->ip_ptr));
WARN_ON(rcu_access_pointer(dev->ip6_ptr));
+#if IS_ENABLED(CONFIG_DECNET)
WARN_ON(dev->dn_ptr);
-
+#endif
if (dev->priv_destructor)
dev->priv_destructor(dev);
if (dev->needs_free_netdev)
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next 2/4] net: Make ax25_ptr depend on CONFIG_AX25
2018-02-13 16:51 [PATCH net-next 0/4] net: dev: Make protocol ptr dependent on CONFIG David Ahern
2018-02-13 16:52 ` [PATCH net-next 1/4] net: Make dn_ptr depend on CONFIG_DECNET David Ahern
@ 2018-02-13 16:52 ` David Ahern
2018-02-13 16:52 ` [PATCH net-next 3/4] net: Make atalk_ptr depend on ATALK or IRDA David Ahern
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: David Ahern @ 2018-02-13 16:52 UTC (permalink / raw)
To: netdev; +Cc: David Ahern
Signed-off-by: David Ahern <dsahern@gmail.com>
---
include/linux/netdevice.h | 2 ++
include/net/ax25.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index f99cf3bb4690..8e2e86c851f4 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1804,7 +1804,9 @@ struct net_device {
struct dn_dev __rcu *dn_ptr;
#endif
struct inet6_dev __rcu *ip6_ptr;
+#if IS_ENABLED(CONFIG_AX25)
void *ax25_ptr;
+#endif
struct wireless_dev *ieee80211_ptr;
struct wpan_dev *ieee802154_ptr;
#if IS_ENABLED(CONFIG_MPLS_ROUTING)
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 76fb39c272a7..c91bc87931c7 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -318,10 +318,12 @@ void ax25_digi_invert(const ax25_digi *, ax25_digi *);
extern ax25_dev *ax25_dev_list;
extern spinlock_t ax25_dev_lock;
+#if IS_ENABLED(CONFIG_AX25)
static inline ax25_dev *ax25_dev_ax25dev(struct net_device *dev)
{
return dev->ax25_ptr;
}
+#endif
ax25_dev *ax25_addr_ax25dev(ax25_address *);
void ax25_dev_device_up(struct net_device *);
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next 3/4] net: Make atalk_ptr depend on ATALK or IRDA
2018-02-13 16:51 [PATCH net-next 0/4] net: dev: Make protocol ptr dependent on CONFIG David Ahern
2018-02-13 16:52 ` [PATCH net-next 1/4] net: Make dn_ptr depend on CONFIG_DECNET David Ahern
2018-02-13 16:52 ` [PATCH net-next 2/4] net: Make ax25_ptr depend on CONFIG_AX25 David Ahern
@ 2018-02-13 16:52 ` David Ahern
2018-02-13 16:52 ` [PATCH net-next 4/4] net: Remove atalk header from socket.c David Ahern
2018-02-13 19:56 ` [PATCH net-next 0/4] net: dev: Make protocol ptr dependent on CONFIG David Miller
4 siblings, 0 replies; 6+ messages in thread
From: David Ahern @ 2018-02-13 16:52 UTC (permalink / raw)
To: netdev; +Cc: David Ahern
From: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
---
include/linux/atalk.h | 2 ++
include/linux/netdevice.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/include/linux/atalk.h b/include/linux/atalk.h
index 4d356e168692..40373920ea58 100644
--- a/include/linux/atalk.h
+++ b/include/linux/atalk.h
@@ -113,10 +113,12 @@ extern void aarp_proto_init(void);
/* Inter module exports */
/* Give a device find its atif control structure */
+#if IS_ENABLED(CONFIG_IRDA) || IS_ENABLED(CONFIG_ATALK)
static inline struct atalk_iface *atalk_find_dev(struct net_device *dev)
{
return dev->atalk_ptr;
}
+#endif
extern struct atalk_addr *atalk_find_dev_addr(struct net_device *dev);
extern struct net_device *atrtr_get_dev(struct atalk_addr *sa);
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 8e2e86c851f4..cc39f49cc95c 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1798,7 +1798,9 @@ struct net_device {
#if IS_ENABLED(CONFIG_TIPC)
struct tipc_bearer __rcu *tipc_ptr;
#endif
+#if IS_ENABLED(CONFIG_IRDA) || IS_ENABLED(CONFIG_ATALK)
void *atalk_ptr;
+#endif
struct in_device __rcu *ip_ptr;
#if IS_ENABLED(CONFIG_DECNET)
struct dn_dev __rcu *dn_ptr;
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net-next 4/4] net: Remove atalk header from socket.c
2018-02-13 16:51 [PATCH net-next 0/4] net: dev: Make protocol ptr dependent on CONFIG David Ahern
` (2 preceding siblings ...)
2018-02-13 16:52 ` [PATCH net-next 3/4] net: Make atalk_ptr depend on ATALK or IRDA David Ahern
@ 2018-02-13 16:52 ` David Ahern
2018-02-13 19:56 ` [PATCH net-next 0/4] net: dev: Make protocol ptr dependent on CONFIG David Miller
4 siblings, 0 replies; 6+ messages in thread
From: David Ahern @ 2018-02-13 16:52 UTC (permalink / raw)
To: netdev; +Cc: David Ahern
Signed-off-by: David Ahern <dsahern@gmail.com>
---
net/socket.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/socket.c b/net/socket.c
index a93c99b518ca..302fa3fc17b7 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -104,7 +104,6 @@
#include <linux/ipv6_route.h>
#include <linux/route.h>
#include <linux/sockios.h>
-#include <linux/atalk.h>
#include <net/busy_poll.h>
#include <linux/errqueue.h>
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next 0/4] net: dev: Make protocol ptr dependent on CONFIG
2018-02-13 16:51 [PATCH net-next 0/4] net: dev: Make protocol ptr dependent on CONFIG David Ahern
` (3 preceding siblings ...)
2018-02-13 16:52 ` [PATCH net-next 4/4] net: Remove atalk header from socket.c David Ahern
@ 2018-02-13 19:56 ` David Miller
4 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2018-02-13 19:56 UTC (permalink / raw)
To: dsahern; +Cc: netdev
From: David Ahern <dsahern@gmail.com>
Date: Tue, 13 Feb 2018 08:51:59 -0800
> Found these in a branch from 3-years ago. Still relevant today.
> Make decnet, ax25, and atalk ptrs in net_device based on their
> respective CONFIG.
Looks good, series applied.
That decnet pointer WARN_ON() in net/core/dev.c can problem be simply
removed.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-02-13 19:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-13 16:51 [PATCH net-next 0/4] net: dev: Make protocol ptr dependent on CONFIG David Ahern
2018-02-13 16:52 ` [PATCH net-next 1/4] net: Make dn_ptr depend on CONFIG_DECNET David Ahern
2018-02-13 16:52 ` [PATCH net-next 2/4] net: Make ax25_ptr depend on CONFIG_AX25 David Ahern
2018-02-13 16:52 ` [PATCH net-next 3/4] net: Make atalk_ptr depend on ATALK or IRDA David Ahern
2018-02-13 16:52 ` [PATCH net-next 4/4] net: Remove atalk header from socket.c David Ahern
2018-02-13 19:56 ` [PATCH net-next 0/4] net: dev: Make protocol ptr dependent on CONFIG David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).