aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/if_macvlan.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/if_macvlan.h')
-rw-r--r--include/linux/if_macvlan.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index 1ffaeffeff74..35280b302290 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -6,6 +6,7 @@
6#include <linux/netdevice.h> 6#include <linux/netdevice.h>
7#include <linux/netlink.h> 7#include <linux/netlink.h>
8#include <net/netlink.h> 8#include <net/netlink.h>
9#include <linux/u64_stats_sync.h>
9 10
10#if defined(CONFIG_MACVTAP) || defined(CONFIG_MACVTAP_MODULE) 11#if defined(CONFIG_MACVTAP) || defined(CONFIG_MACVTAP_MODULE)
11struct socket *macvtap_get_socket(struct file *); 12struct socket *macvtap_get_socket(struct file *);
@@ -27,14 +28,16 @@ struct macvtap_queue;
27 * struct macvlan_rx_stats - MACVLAN percpu rx stats 28 * struct macvlan_rx_stats - MACVLAN percpu rx stats
28 * @rx_packets: number of received packets 29 * @rx_packets: number of received packets
29 * @rx_bytes: number of received bytes 30 * @rx_bytes: number of received bytes
30 * @multicast: number of received multicast packets 31 * @rx_multicast: number of received multicast packets
32 * @syncp: synchronization point for 64bit counters
31 * @rx_errors: number of errors 33 * @rx_errors: number of errors
32 */ 34 */
33struct macvlan_rx_stats { 35struct macvlan_rx_stats {
34 unsigned long rx_packets; 36 u64 rx_packets;
35 unsigned long rx_bytes; 37 u64 rx_bytes;
36 unsigned long multicast; 38 u64 rx_multicast;
37 unsigned long rx_errors; 39 struct u64_stats_sync syncp;
40 unsigned long rx_errors;
38}; 41};
39 42
40struct macvlan_dev { 43struct macvlan_dev {
@@ -56,12 +59,14 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
56{ 59{
57 struct macvlan_rx_stats *rx_stats; 60 struct macvlan_rx_stats *rx_stats;
58 61
59 rx_stats = per_cpu_ptr(vlan->rx_stats, smp_processor_id()); 62 rx_stats = this_cpu_ptr(vlan->rx_stats);
60 if (likely(success)) { 63 if (likely(success)) {
64 u64_stats_update_begin(&rx_stats->syncp);
61 rx_stats->rx_packets++;; 65 rx_stats->rx_packets++;;
62 rx_stats->rx_bytes += len; 66 rx_stats->rx_bytes += len;
63 if (multicast) 67 if (multicast)
64 rx_stats->multicast++; 68 rx_stats->rx_multicast++;
69 u64_stats_update_end(&rx_stats->syncp);
65 } else { 70 } else {
66 rx_stats->rx_errors++; 71 rx_stats->rx_errors++;
67 } 72 }
@@ -86,8 +91,4 @@ extern int macvlan_link_register(struct rtnl_link_ops *ops);
86extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, 91extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
87 struct net_device *dev); 92 struct net_device *dev);
88 93
89
90extern struct sk_buff *(*macvlan_handle_frame_hook)(struct macvlan_port *,
91 struct sk_buff *);
92
93#endif /* _LINUX_IF_MACVLAN_H */ 94#endif /* _LINUX_IF_MACVLAN_H */