Skip to contentSkip to conversation

can: convert statistic functions to support network namespaces

RFC PATCH New Oliver Hartkopp 1 participant 1 message Apr 9, 2017

Subsystems (3)
lore
Share & tools
lore

Oliver Hartkopp

author maintainer
#0 lore raw

RFC PATCH 1/1 can: convert statistic functions to support network namespaces

The statistics and its proc output was not implemented as per-net in the initial network namespace support by Mario Kicherer (8e8cda6d737d).

---
 include/net/netns/can.h |   5 ++
 net/can/af_can.c        |  67 ++++++++++++------------
 net/can/af_can.h        |   9 ----
 net/can/proc.c          | 135 ++++++++++++++++++++++++++----------------------
 4 files changed, 112 insertions(+), 104 deletions(-)
include/net/netns/can.h +5 -0
index e8beba772f1a..574157dbc43a 100644
@@ -8,6 +8,8 @@
 #include <linux/spinlock.h>
 
 struct dev_rcv_lists;
+struct s_stats;
+struct s_pstats;
 
 struct netns_can {
 #if IS_ENABLED(CONFIG_PROC_FS)
@@ -26,6 +28,9 @@ struct netns_can {
 	/* receive filters subscribed for 'all' CAN devices */
 	struct dev_rcv_lists *can_rx_alldev_list;
 	spinlock_t can_rcvlists_lock;
+	struct timer_list can_stattimer;/* timer for statistics update */
+	struct s_stats *can_stats;	/* packet statistics */
+	struct s_pstats *can_pstats;	/* receive list statistics */
 };
 
 #endif /* __NETNS_CAN_H__ */
net/can/af_can.c +34 -33

158 lines not on this page · raw message

net/can/af_can.h +0 -9
index f273c9d9b129..d0ef45bb2a72 100644
@@ -110,18 +110,9 @@ struct s_pstats {
 	unsigned long rcv_entries_max;
 };
 
-/* receive filters subscribed for 'all' CAN devices */
-extern struct dev_rcv_lists can_rx_alldev_list;
-
 /* function prototypes for the CAN networklayer procfs (proc.c) */
 void can_init_proc(struct net *net);
 void can_remove_proc(struct net *net);
 void can_stat_update(unsigned long data);
 
-/* structures and variables from af_can.c needed in proc.c for reading */
-extern struct timer_list can_stattimer;    /* timer for statistics update */
-extern struct s_stats    can_stats;        /* packet statistics */
-extern struct s_pstats   can_pstats;       /* receive list statistics */
-extern struct hlist_head can_rx_dev_list;  /* rx dispatcher structures */
-
 #endif /* AF_CAN_H */
net/can/proc.c +73 -62

233 lines not on this page · raw message

Signature · 1 line
2.11.0