can: convert statistic functions to support network namespaces
Subsystems (3)
Oliver Hartkopp
maintainerRFC 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).
Signed-off-by Oliver Hartkopp <[email protected]>
--- 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
@@ -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
@@ -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