aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/vport.h
diff options
context:
space:
mode:
authorLi RongQing <roy.qing.li@gmail.com>2014-09-06 07:06:11 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-09 14:48:07 -0400
commite403aded79a1bfb610adc53490ded8d2058f9daf (patch)
treedd65f6d8b16bb8c64e4c1c47cf0f3cb36d5e5584 /net/openvswitch/vport.h
parent5aaa62d608464bedb30afc62e5073629de505afb (diff)
openvswitch: change the data type of error status to atomic_long_t
Change the date type of error status from u64 to atomic_long_t, and use atomic operation, then remove the lock which is used to protect the error status. The operation of atomic maybe faster than spin lock. Cc: Pravin Shelar <pshelar@nicira.com> Signed-off-by: Li RongQing <roy.qing.li@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/vport.h')
-rw-r--r--net/openvswitch/vport.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/openvswitch/vport.h b/net/openvswitch/vport.h
index 35f89d84b45e..0d95b9f5f9c4 100644
--- a/net/openvswitch/vport.h
+++ b/net/openvswitch/vport.h
@@ -62,10 +62,10 @@ int ovs_vport_send(struct vport *, struct sk_buff *);
62/* The following definitions are for implementers of vport devices: */ 62/* The following definitions are for implementers of vport devices: */
63 63
64struct vport_err_stats { 64struct vport_err_stats {
65 u64 rx_dropped; 65 atomic_long_t rx_dropped;
66 u64 rx_errors; 66 atomic_long_t rx_errors;
67 u64 tx_dropped; 67 atomic_long_t tx_dropped;
68 u64 tx_errors; 68 atomic_long_t tx_errors;
69}; 69};
70/** 70/**
71 * struct vport_portids - array of netlink portids of a vport. 71 * struct vport_portids - array of netlink portids of a vport.
@@ -93,7 +93,6 @@ struct vport_portids {
93 * @dp_hash_node: Element in @datapath->ports hash table in datapath.c. 93 * @dp_hash_node: Element in @datapath->ports hash table in datapath.c.
94 * @ops: Class structure. 94 * @ops: Class structure.
95 * @percpu_stats: Points to per-CPU statistics used and maintained by vport 95 * @percpu_stats: Points to per-CPU statistics used and maintained by vport
96 * @stats_lock: Protects @err_stats;
97 * @err_stats: Points to error statistics used and maintained by vport 96 * @err_stats: Points to error statistics used and maintained by vport
98 */ 97 */
99struct vport { 98struct vport {
@@ -108,7 +107,6 @@ struct vport {
108 107
109 struct pcpu_sw_netstats __percpu *percpu_stats; 108 struct pcpu_sw_netstats __percpu *percpu_stats;
110 109
111 spinlock_t stats_lock;
112 struct vport_err_stats err_stats; 110 struct vport_err_stats err_stats;
113}; 111};
114 112