err_kfree_skb:
kfree_skb(skb);
err:
- stats = percpu_ptr(dp->stats_percpu, get_cpu());
+ local_bh_disable();
+ stats = per_cpu_ptr(dp->stats_percpu, smp_processor_id());
stats->n_lost++;
- put_cpu();
+ local_bh_enable();
return err;
}
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/percpu.h>
-#include <linux/preempt.h>
#include <linux/rcupdate.h>
#include <linux/skbuff.h>
-#include <linux/workqueue.h>
#include "datapath.h"
#include "openvswitch/internal_dev.h"
return 0;
}
-/* Not reentrant (because it is called with BHs disabled), but may be called
- * simultaneously on different CPUs. */
+/* Called with rcu_read_lock and bottom-halves disabled. */
static int internal_dev_xmit(struct sk_buff *skb, struct net_device *netdev)
{
struct internal_dev *internal_dev = internal_dev_priv(netdev);
skb_reset_mac_header(skb);
compute_ip_summed(skb, true);
- rcu_read_lock_bh();
vport_receive(vport, skb);
- rcu_read_unlock_bh();
return 0;
}
netif_rx_ni(skb);
netdev->last_rx = jiffies;
- preempt_disable();
+ local_bh_disable();
lb_stats = per_cpu_ptr(internal_dev->lstats, smp_processor_id());
lb_stats->rx_packets++;
lb_stats->rx_bytes += len;
- preempt_enable();
+ local_bh_enable();
return len;
}