X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=datapath%2Fvport.c;h=2673b817893eb58a9c9ace487c2814006ab8fb36;hb=cb25142c50cd3a92e779ca1ce6f61380ffc75927;hp=2882cc7ff7557d20cb6e2f2186c3e811f1c7be7d;hpb=75d0d3feaae1852dffb4c4597256073574c1b6f5;p=sliver-openvswitch.git diff --git a/datapath/vport.c b/datapath/vport.c index 2882cc7ff..2673b8178 100644 --- a/datapath/vport.c +++ b/datapath/vport.c @@ -35,6 +35,9 @@ #include "vport.h" #include "vport-internal_dev.h" +static void ovs_vport_record_error(struct vport *, + enum vport_err_type err_type); + /* List of statically compiled vport implementations. Don't forget to also * add yours to the list at the bottom of vport.h. */ static const struct vport_ops *vport_ops_list[] = { @@ -119,6 +122,7 @@ struct vport *ovs_vport_alloc(int priv_size, const struct vport_ops *ops, { struct vport *vport; size_t alloc_size; + int i; alloc_size = sizeof(struct vport); if (priv_size) { @@ -142,6 +146,12 @@ struct vport *ovs_vport_alloc(int priv_size, const struct vport_ops *ops, return ERR_PTR(-ENOMEM); } + for_each_possible_cpu(i) { + struct pcpu_tstats *vport_stats; + vport_stats = per_cpu_ptr(vport->percpu_stats, i); + u64_stats_init(&vport_stats->syncp); + } + spin_lock_init(&vport->stats_lock); return vport; @@ -411,7 +421,8 @@ int ovs_vport_send(struct vport *vport, struct sk_buff *skb) * If using the vport generic stats layer indicate that an error of the given * type has occurred. */ -void ovs_vport_record_error(struct vport *vport, enum vport_err_type err_type) +static void ovs_vport_record_error(struct vport *vport, + enum vport_err_type err_type) { spin_lock(&vport->stats_lock);