summaryrefslogtreecommitdiffstats
path: root/net/openvswitch/vport.h
diff options
context:
space:
mode:
authorLi RongQing <roy.qing.li@gmail.com>2014-09-06 19:06:11 +0800
committerDavid S. Miller <davem@davemloft.net>2014-09-09 11:48:07 -0700
commite403aded79a1bfb610adc53490ded8d2058f9daf (patch)
treedd65f6d8b16bb8c64e4c1c47cf0f3cb36d5e5584 /net/openvswitch/vport.h
parent5aaa62d608464bedb30afc62e5073629de505afb (diff)
downloadlinux-0-day-e403aded79a1bfb610adc53490ded8d2058f9daf.tar.gz
linux-0-day-e403aded79a1bfb610adc53490ded8d2058f9daf.tar.xz
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 35f89d84b45e2..0d95b9f5f9c4b 100644
--- a/net/openvswitch/vport.h
+++ b/net/openvswitch/vport.h
@@ -62,10 +62,10 @@ int ovs_vport_send(struct vport *, struct sk_buff *);
/* The following definitions are for implementers of vport devices: */
struct vport_err_stats {
- u64 rx_dropped;
- u64 rx_errors;
- u64 tx_dropped;
- u64 tx_errors;
+ atomic_long_t rx_dropped;
+ atomic_long_t rx_errors;
+ atomic_long_t tx_dropped;
+ atomic_long_t tx_errors;
};
/**
* struct vport_portids - array of netlink portids of a vport.
@@ -93,7 +93,6 @@ struct vport_portids {
* @dp_hash_node: Element in @datapath->ports hash table in datapath.c.
* @ops: Class structure.
* @percpu_stats: Points to per-CPU statistics used and maintained by vport
- * @stats_lock: Protects @err_stats;
* @err_stats: Points to error statistics used and maintained by vport
*/
struct vport {
@@ -108,7 +107,6 @@ struct vport {
struct pcpu_sw_netstats __percpu *percpu_stats;
- spinlock_t stats_lock;
struct vport_err_stats err_stats;
};