learn: Correct example in nicira-ext.h and add examples as test cases.
[openvswitch] / datapath / vport.c
index 71fdd841159584137799b9b574c7cc2127b069f9..ad5a10e7adefdb34b6ad31b089e465d78ac412ab 100644 (file)
@@ -176,7 +176,7 @@ struct vport *vport_alloc(int priv_size, const struct vport_ops *ops, const stru
 
        vport->dp = parms->dp;
        vport->port_no = parms->port_no;
-       atomic_set(&vport->sflow_pool, 0);
+       vport->upcall_pid = parms->upcall_pid;
        vport->ops = ops;
 
        /* Initialize kobject for bridge.  This will be added as
@@ -563,7 +563,6 @@ void vport_receive(struct vport *vport, struct sk_buff *skb)
 {
        struct vport_percpu_stats *stats;
 
-       local_bh_disable();
        stats = per_cpu_ptr(vport->percpu_stats, smp_processor_id());
 
        write_seqcount_begin(&stats->seqlock);
@@ -571,8 +570,6 @@ void vport_receive(struct vport *vport, struct sk_buff *skb)
        stats->rx_bytes += skb->len;
        write_seqcount_end(&stats->seqlock);
 
-       local_bh_enable();
-
        if (!(vport->ops->flags & VPORT_F_FLOW))
                OVS_CB(skb)->flow = NULL;
 
@@ -596,7 +593,6 @@ int vport_send(struct vport *vport, struct sk_buff *skb)
        struct vport_percpu_stats *stats;
        int sent = vport->ops->send(vport, skb);
 
-       local_bh_disable();
        stats = per_cpu_ptr(vport->percpu_stats, smp_processor_id());
 
        write_seqcount_begin(&stats->seqlock);
@@ -604,8 +600,6 @@ int vport_send(struct vport *vport, struct sk_buff *skb)
        stats->tx_bytes += sent;
        write_seqcount_end(&stats->seqlock);
 
-       local_bh_enable();
-
        return sent;
 }
 
@@ -620,7 +614,7 @@ int vport_send(struct vport *vport, struct sk_buff *skb)
  */
 void vport_record_error(struct vport *vport, enum vport_err_type err_type)
 {
-       spin_lock_bh(&vport->stats_lock);
+       spin_lock(&vport->stats_lock);
 
        switch (err_type) {
        case VPORT_E_RX_DROPPED:
@@ -640,5 +634,5 @@ void vport_record_error(struct vport *vport, enum vport_err_type err_type)
                break;
        };
 
-       spin_unlock_bh(&vport->stats_lock);
+       spin_unlock(&vport->stats_lock);
 }