diff options
| -rw-r--r-- | drivers/net/macvlan.c | 8 | ||||
| -rw-r--r-- | include/linux/if_macvlan.h | 27 |
2 files changed, 7 insertions, 28 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 10406dbc35b3..94198366de7f 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
| @@ -305,7 +305,7 @@ static netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, | |||
| 305 | } | 305 | } |
| 306 | 306 | ||
| 307 | if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN)) { | 307 | if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN)) { |
| 308 | struct macvlan_pcpu_stats *pcpu_stats; | 308 | struct vlan_pcpu_stats *pcpu_stats; |
| 309 | 309 | ||
| 310 | pcpu_stats = this_cpu_ptr(vlan->pcpu_stats); | 310 | pcpu_stats = this_cpu_ptr(vlan->pcpu_stats); |
| 311 | u64_stats_update_begin(&pcpu_stats->syncp); | 311 | u64_stats_update_begin(&pcpu_stats->syncp); |
| @@ -545,12 +545,12 @@ static int macvlan_init(struct net_device *dev) | |||
| 545 | 545 | ||
| 546 | macvlan_set_lockdep_class(dev); | 546 | macvlan_set_lockdep_class(dev); |
| 547 | 547 | ||
| 548 | vlan->pcpu_stats = alloc_percpu(struct macvlan_pcpu_stats); | 548 | vlan->pcpu_stats = alloc_percpu(struct vlan_pcpu_stats); |
| 549 | if (!vlan->pcpu_stats) | 549 | if (!vlan->pcpu_stats) |
| 550 | return -ENOMEM; | 550 | return -ENOMEM; |
| 551 | 551 | ||
| 552 | for_each_possible_cpu(i) { | 552 | for_each_possible_cpu(i) { |
| 553 | struct macvlan_pcpu_stats *mvlstats; | 553 | struct vlan_pcpu_stats *mvlstats; |
| 554 | mvlstats = per_cpu_ptr(vlan->pcpu_stats, i); | 554 | mvlstats = per_cpu_ptr(vlan->pcpu_stats, i); |
| 555 | u64_stats_init(&mvlstats->syncp); | 555 | u64_stats_init(&mvlstats->syncp); |
| 556 | } | 556 | } |
| @@ -576,7 +576,7 @@ static struct rtnl_link_stats64 *macvlan_dev_get_stats64(struct net_device *dev, | |||
| 576 | struct macvlan_dev *vlan = netdev_priv(dev); | 576 | struct macvlan_dev *vlan = netdev_priv(dev); |
| 577 | 577 | ||
| 578 | if (vlan->pcpu_stats) { | 578 | if (vlan->pcpu_stats) { |
| 579 | struct macvlan_pcpu_stats *p; | 579 | struct vlan_pcpu_stats *p; |
| 580 | u64 rx_packets, rx_bytes, rx_multicast, tx_packets, tx_bytes; | 580 | u64 rx_packets, rx_bytes, rx_multicast, tx_packets, tx_bytes; |
| 581 | u32 rx_errors = 0, tx_dropped = 0; | 581 | u32 rx_errors = 0, tx_dropped = 0; |
| 582 | unsigned int start; | 582 | unsigned int start; |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 551bdd3722a2..7c8b20b120ea 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _LINUX_IF_MACVLAN_H | 2 | #define _LINUX_IF_MACVLAN_H |
| 3 | 3 | ||
| 4 | #include <linux/if_link.h> | 4 | #include <linux/if_link.h> |
| 5 | #include <linux/if_vlan.h> | ||
| 5 | #include <linux/list.h> | 6 | #include <linux/list.h> |
| 6 | #include <linux/netdevice.h> | 7 | #include <linux/netdevice.h> |
| 7 | #include <linux/netlink.h> | 8 | #include <linux/netlink.h> |
| @@ -24,28 +25,6 @@ static inline struct socket *macvtap_get_socket(struct file *f) | |||
| 24 | struct macvlan_port; | 25 | struct macvlan_port; |
| 25 | struct macvtap_queue; | 26 | struct macvtap_queue; |
| 26 | 27 | ||
| 27 | /** | ||
| 28 | * struct macvlan_pcpu_stats - MACVLAN percpu stats | ||
| 29 | * @rx_packets: number of received packets | ||
| 30 | * @rx_bytes: number of received bytes | ||
| 31 | * @rx_multicast: number of received multicast packets | ||
| 32 | * @tx_packets: number of transmitted packets | ||
| 33 | * @tx_bytes: number of transmitted bytes | ||
| 34 | * @syncp: synchronization point for 64bit counters | ||
| 35 | * @rx_errors: number of rx errors | ||
| 36 | * @tx_dropped: number of tx dropped packets | ||
| 37 | */ | ||
| 38 | struct macvlan_pcpu_stats { | ||
| 39 | u64 rx_packets; | ||
| 40 | u64 rx_bytes; | ||
| 41 | u64 rx_multicast; | ||
| 42 | u64 tx_packets; | ||
| 43 | u64 tx_bytes; | ||
| 44 | struct u64_stats_sync syncp; | ||
| 45 | u32 rx_errors; | ||
| 46 | u32 tx_dropped; | ||
| 47 | }; | ||
| 48 | |||
| 49 | /* | 28 | /* |
| 50 | * Maximum times a macvtap device can be opened. This can be used to | 29 | * Maximum times a macvtap device can be opened. This can be used to |
| 51 | * configure the number of receive queue, e.g. for multiqueue virtio. | 30 | * configure the number of receive queue, e.g. for multiqueue virtio. |
| @@ -62,7 +41,7 @@ struct macvlan_dev { | |||
| 62 | struct macvlan_port *port; | 41 | struct macvlan_port *port; |
| 63 | struct net_device *lowerdev; | 42 | struct net_device *lowerdev; |
| 64 | void *fwd_priv; | 43 | void *fwd_priv; |
| 65 | struct macvlan_pcpu_stats __percpu *pcpu_stats; | 44 | struct vlan_pcpu_stats __percpu *pcpu_stats; |
| 66 | 45 | ||
| 67 | DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ); | 46 | DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ); |
| 68 | 47 | ||
| @@ -84,7 +63,7 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan, | |||
| 84 | bool multicast) | 63 | bool multicast) |
| 85 | { | 64 | { |
| 86 | if (likely(success)) { | 65 | if (likely(success)) { |
| 87 | struct macvlan_pcpu_stats *pcpu_stats; | 66 | struct vlan_pcpu_stats *pcpu_stats; |
| 88 | 67 | ||
| 89 | pcpu_stats = this_cpu_ptr(vlan->pcpu_stats); | 68 | pcpu_stats = this_cpu_ptr(vlan->pcpu_stats); |
| 90 | u64_stats_update_begin(&pcpu_stats->syncp); | 69 | u64_stats_update_begin(&pcpu_stats->syncp); |
