X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=datapath%2Fdp_dev.c;h=2bbd6fecf8d05a52f851b3562b2ad9663a1fbff8;hb=f0c689263a0424c83663b8466a64a051a012c757;hp=5417114fd3c0fdbb8f0d3e76a0019bd880bbc1d0;hpb=43a6c464efaf271411c8e2d19357e11bf6ff5afa;p=openvswitch diff --git a/datapath/dp_dev.c b/datapath/dp_dev.c index 5417114f..2bbd6fec 100644 --- a/datapath/dp_dev.c +++ b/datapath/dp_dev.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009 Nicira Networks. + * Copyright (c) 2009, 2010 Nicira Networks. * Distributed under the terms of the GNU GPL version 2. * * Significant portions of this file may be copied from parts of the Linux @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -62,9 +63,13 @@ int dp_dev_recv(struct net_device *netdev, struct sk_buff *skb) else netif_rx_ni(skb); netdev->last_rx = jiffies; + + preempt_disable(); lb_stats = per_cpu_ptr(dp_dev->lstats, smp_processor_id()); lb_stats->rx_packets++; lb_stats->rx_bytes += len; + preempt_enable(); + return len; } @@ -118,7 +123,7 @@ static void dp_getinfo(struct net_device *netdev, struct ethtool_drvinfo *info) { struct dp_dev *dp_dev = dp_dev_priv(netdev); strcpy(info->driver, "openvswitch"); - sprintf(info->bus_info, "%d", dp_dev->dp->dp_idx); + sprintf(info->bus_info, "%d.%d", dp_dev->dp->dp_idx, dp_dev->port_no); } static struct ethtool_ops dp_ethtool_ops = { @@ -209,8 +214,8 @@ do_setup(struct net_device *netdev) netdev->dev_addr[1] = 0x23; netdev->dev_addr[2] = 0x20; - /* Set the top bits to indicate random Nicira address. */ - netdev->dev_addr[3] |= 0xc0; + /* Set the top bit to indicate random Nicira address. */ + netdev->dev_addr[3] |= 0x80; } /* Create a datapath device associated with 'dp'. If 'dp_name' is null,