Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

macvlan: unify macvlan_pcpu_stats and vlan_pcpu_stats

They are same, so unify them as one; since macvlan is a kind of vlan,
vlan_pcpu_stats should be a proper name for vlan and macvlan.

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Li RongQing and committed by
David S. Miller
cdf3e274 8f84985f

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