Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184253
b: refs/heads/master
c: 47d7427
h: refs/heads/master
i:
  184251: 168bc93
v: v3
  • Loading branch information
Tejun Heo authored and David S. Miller committed Feb 17, 2010
1 parent 15a8e23 commit cf48b23
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7d720c3e4f0c4fc152a6bf17e24244a3c85412d2
refs/heads/master: 47d742752df4c1088589d4424840bc761613ab2a
2 changes: 1 addition & 1 deletion trunk/drivers/net/chelsio/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ struct sge {
struct sk_buff *espibug_skb[MAX_NPORTS];
u32 sge_control; /* shadow value of sge control reg */
struct sge_intr_counts stats;
struct sge_port_stats *port_stats[MAX_NPORTS];
struct sge_port_stats __percpu *port_stats[MAX_NPORTS];
struct sched *tx_sched;
struct cmdQ cmdQ[SGE_CMDQ_N] ____cacheline_aligned_in_smp;
};
Expand Down
16 changes: 9 additions & 7 deletions trunk/drivers/net/loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,16 @@ struct pcpu_lstats {
static netdev_tx_t loopback_xmit(struct sk_buff *skb,
struct net_device *dev)
{
struct pcpu_lstats *pcpu_lstats, *lb_stats;
struct pcpu_lstats __percpu *pcpu_lstats;
struct pcpu_lstats *lb_stats;
int len;

skb_orphan(skb);

skb->protocol = eth_type_trans(skb, dev);

/* it's OK to use per_cpu_ptr() because BHs are off */
pcpu_lstats = dev->ml_priv;
pcpu_lstats = (void __percpu __force *)dev->ml_priv;
lb_stats = this_cpu_ptr(pcpu_lstats);

len = skb->len;
Expand All @@ -95,14 +96,14 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb,

static struct net_device_stats *loopback_get_stats(struct net_device *dev)
{
const struct pcpu_lstats *pcpu_lstats;
const struct pcpu_lstats __percpu *pcpu_lstats;
struct net_device_stats *stats = &dev->stats;
unsigned long bytes = 0;
unsigned long packets = 0;
unsigned long drops = 0;
int i;

pcpu_lstats = dev->ml_priv;
pcpu_lstats = (void __percpu __force *)dev->ml_priv;
for_each_possible_cpu(i) {
const struct pcpu_lstats *lb_stats;

Expand Down Expand Up @@ -135,19 +136,20 @@ static const struct ethtool_ops loopback_ethtool_ops = {

static int loopback_dev_init(struct net_device *dev)
{
struct pcpu_lstats *lstats;
struct pcpu_lstats __percpu *lstats;

lstats = alloc_percpu(struct pcpu_lstats);
if (!lstats)
return -ENOMEM;

dev->ml_priv = lstats;
dev->ml_priv = (void __force *)lstats;
return 0;
}

static void loopback_dev_free(struct net_device *dev)
{
struct pcpu_lstats *lstats = dev->ml_priv;
struct pcpu_lstats __percpu *lstats =
(void __percpu __force *)dev->ml_priv;

free_percpu(lstats);
free_netdev(dev);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/veth.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct veth_net_stats {

struct veth_priv {
struct net_device *peer;
struct veth_net_stats *stats;
struct veth_net_stats __percpu *stats;
unsigned ip_summed;
};

Expand Down Expand Up @@ -263,7 +263,7 @@ static int veth_change_mtu(struct net_device *dev, int new_mtu)

static int veth_dev_init(struct net_device *dev)
{
struct veth_net_stats *stats;
struct veth_net_stats __percpu *stats;
struct veth_priv *priv;

stats = alloc_percpu(struct veth_net_stats);
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/if_macvlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct macvlan_dev {
struct hlist_node hlist;
struct macvlan_port *port;
struct net_device *lowerdev;
struct macvlan_rx_stats *rx_stats;
struct macvlan_rx_stats __percpu *rx_stats;
enum macvlan_mode mode;
int (*receive)(struct sk_buff *skb);
int (*forward)(struct net_device *dev, struct sk_buff *skb);
Expand Down

0 comments on commit cf48b23

Please sign in to comment.