Skip to content

Commit

Permalink
Pull percpu256K into release branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Luck committed Aug 4, 2010
2 parents 13a1e6e + a95f9ac commit 38e14a7
Show file tree
Hide file tree
Showing 22 changed files with 169 additions and 55 deletions.
2 changes: 1 addition & 1 deletion arch/ia64/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#define PAGE_SIZE (__IA64_UL_CONST(1) << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE - 1))

#define PERCPU_PAGE_SHIFT 16 /* log2() of max. size of per-CPU area */
#define PERCPU_PAGE_SHIFT 18 /* log2() of max. size of per-CPU area */
#define PERCPU_PAGE_SIZE (__IA64_UL_CONST(1) << PERCPU_PAGE_SHIFT)


Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/kernel/perf_event_fsl_emb.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,9 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
* Finally record data if requested.
*/
if (record) {
struct perf_sample_data data = {
.period = event->hw.last_period,
};
struct perf_sample_data data;

perf_sample_data_init(&data, 0);

if (perf_event_overflow(event, nmi, &data, regs)) {
/*
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/bnx2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,10 @@ struct bnx2x {

/* used to synchronize stats collecting */
int stats_state;

/* used for synchronization of concurrent threads statistics handling */
spinlock_t stats_lock;

/* used by dmae command loader */
struct dmae_command stats_dmae;
int executer_idx;
Expand Down
42 changes: 27 additions & 15 deletions drivers/net/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
#include "bnx2x_init_ops.h"
#include "bnx2x_dump.h"

#define DRV_MODULE_VERSION "1.52.53-1"
#define DRV_MODULE_RELDATE "2010/18/04"
#define DRV_MODULE_VERSION "1.52.53-2"
#define DRV_MODULE_RELDATE "2010/21/07"
#define BNX2X_BC_VER 0x040200

#include <linux/firmware.h>
Expand Down Expand Up @@ -3789,6 +3789,8 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp)
struct eth_query_ramrod_data ramrod_data = {0};
int i, rc;

spin_lock_bh(&bp->stats_lock);

ramrod_data.drv_counter = bp->stats_counter++;
ramrod_data.collect_port = bp->port.pmf ? 1 : 0;
for_each_queue(bp, i)
Expand All @@ -3802,6 +3804,8 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp)
bp->spq_left++;
bp->stats_pending = 1;
}

spin_unlock_bh(&bp->stats_lock);
}
}

Expand Down Expand Up @@ -4367,6 +4371,14 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp)
struct host_func_stats *fstats = bnx2x_sp(bp, func_stats);
struct bnx2x_eth_stats *estats = &bp->eth_stats;
int i;
u16 cur_stats_counter;

/* Make sure we use the value of the counter
* used for sending the last stats ramrod.
*/
spin_lock_bh(&bp->stats_lock);
cur_stats_counter = bp->stats_counter - 1;
spin_unlock_bh(&bp->stats_lock);

memcpy(&(fstats->total_bytes_received_hi),
&(bnx2x_sp(bp, func_stats_base)->total_bytes_received_hi),
Expand Down Expand Up @@ -4394,25 +4406,22 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp)
u32 diff;

/* are storm stats valid? */
if ((u16)(le16_to_cpu(xclient->stats_counter) + 1) !=
bp->stats_counter) {
if (le16_to_cpu(xclient->stats_counter) != cur_stats_counter) {
DP(BNX2X_MSG_STATS, "[%d] stats not updated by xstorm"
" xstorm counter (0x%x) != stats_counter (0x%x)\n",
i, xclient->stats_counter, bp->stats_counter);
i, xclient->stats_counter, cur_stats_counter + 1);
return -1;
}
if ((u16)(le16_to_cpu(tclient->stats_counter) + 1) !=
bp->stats_counter) {
if (le16_to_cpu(tclient->stats_counter) != cur_stats_counter) {
DP(BNX2X_MSG_STATS, "[%d] stats not updated by tstorm"
" tstorm counter (0x%x) != stats_counter (0x%x)\n",
i, tclient->stats_counter, bp->stats_counter);
i, tclient->stats_counter, cur_stats_counter + 1);
return -2;
}
if ((u16)(le16_to_cpu(uclient->stats_counter) + 1) !=
bp->stats_counter) {
if (le16_to_cpu(uclient->stats_counter) != cur_stats_counter) {
DP(BNX2X_MSG_STATS, "[%d] stats not updated by ustorm"
" ustorm counter (0x%x) != stats_counter (0x%x)\n",
i, uclient->stats_counter, bp->stats_counter);
i, uclient->stats_counter, cur_stats_counter + 1);
return -4;
}

Expand Down Expand Up @@ -4849,16 +4858,18 @@ static const struct {

static void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event)
{
enum bnx2x_stats_state state = bp->stats_state;
enum bnx2x_stats_state state;

if (unlikely(bp->panic))
return;

bnx2x_stats_stm[state][event].action(bp);
/* Protect a state change flow */
spin_lock_bh(&bp->stats_lock);
state = bp->stats_state;
bp->stats_state = bnx2x_stats_stm[state][event].next_state;
spin_unlock_bh(&bp->stats_lock);

/* Make sure the state has been "changed" */
smp_wmb();
bnx2x_stats_stm[state][event].action(bp);

if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp))
DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n",
Expand Down Expand Up @@ -9908,6 +9919,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp)

mutex_init(&bp->port.phy_mutex);
mutex_init(&bp->fw_mb_mutex);
spin_lock_init(&bp->stats_lock);
#ifdef BCM_CNIC
mutex_init(&bp->cnic_mutex);
#endif
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/bonding/bond_alb.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ static int rlb_initialize(struct bonding *bond)

/*initialize packet type*/
pk_type->type = cpu_to_be16(ETH_P_ARP);
pk_type->dev = NULL;
pk_type->dev = bond->dev;
pk_type->func = rlb_arp_recv;

/* register to receive ARPs */
Expand Down
9 changes: 9 additions & 0 deletions drivers/net/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1722,6 +1722,15 @@ static int __devinit igb_probe(struct pci_dev *pdev,
u16 eeprom_apme_mask = IGB_EEPROM_APME;
u32 part_num;

/* Catch broken hardware that put the wrong VF device ID in
* the PCIe SR-IOV capability.
*/
if (pdev->is_virtfn) {
WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n",
pci_name(pdev), pdev->vendor, pdev->device);
return -EINVAL;
}

err = pci_enable_device_mem(pdev);
if (err)
return err;
Expand Down
9 changes: 9 additions & 0 deletions drivers/net/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6492,6 +6492,15 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
#endif
u32 part_num, eec;

/* Catch broken hardware that put the wrong VF device ID in
* the PCIe SR-IOV capability.
*/
if (pdev->is_virtfn) {
WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n",
pci_name(pdev), pdev->vendor, pdev->device);
return -EINVAL;
}

err = pci_enable_device_mem(pdev);
if (err)
return err;
Expand Down
10 changes: 8 additions & 2 deletions drivers/net/macvlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ static const struct net_device_ops macvlan_netdev_ops = {
.ndo_validate_addr = eth_validate_addr,
};

static void macvlan_setup(struct net_device *dev)
void macvlan_common_setup(struct net_device *dev)
{
ether_setup(dev);

Expand All @@ -508,6 +508,12 @@ static void macvlan_setup(struct net_device *dev)
dev->destructor = free_netdev;
dev->header_ops = &macvlan_hard_header_ops,
dev->ethtool_ops = &macvlan_ethtool_ops;
}
EXPORT_SYMBOL_GPL(macvlan_common_setup);

static void macvlan_setup(struct net_device *dev)
{
macvlan_common_setup(dev);
dev->tx_queue_len = 0;
}

Expand Down Expand Up @@ -705,7 +711,6 @@ int macvlan_link_register(struct rtnl_link_ops *ops)
/* common fields */
ops->priv_size = sizeof(struct macvlan_dev);
ops->get_tx_queues = macvlan_get_tx_queues;
ops->setup = macvlan_setup;
ops->validate = macvlan_validate;
ops->maxtype = IFLA_MACVLAN_MAX;
ops->policy = macvlan_policy;
Expand All @@ -719,6 +724,7 @@ EXPORT_SYMBOL_GPL(macvlan_link_register);

static struct rtnl_link_ops macvlan_link_ops = {
.kind = "macvlan",
.setup = macvlan_setup,
.newlink = macvlan_newlink,
.dellink = macvlan_dellink,
};
Expand Down
18 changes: 16 additions & 2 deletions drivers/net/macvtap.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,18 @@ static int macvtap_forward(struct net_device *dev, struct sk_buff *skb)
{
struct macvtap_queue *q = macvtap_get_queue(dev, skb);
if (!q)
return -ENOLINK;
goto drop;

if (skb_queue_len(&q->sk.sk_receive_queue) >= dev->tx_queue_len)
goto drop;

skb_queue_tail(&q->sk.sk_receive_queue, skb);
wake_up_interruptible_poll(sk_sleep(&q->sk), POLLIN | POLLRDNORM | POLLRDBAND);
return 0;
return NET_RX_SUCCESS;

drop:
kfree_skb(skb);
return NET_RX_DROP;
}

/*
Expand Down Expand Up @@ -235,8 +242,15 @@ static void macvtap_dellink(struct net_device *dev,
macvlan_dellink(dev, head);
}

static void macvtap_setup(struct net_device *dev)
{
macvlan_common_setup(dev);
dev->tx_queue_len = TUN_READQ_SIZE;
}

static struct rtnl_link_ops macvtap_link_ops __read_mostly = {
.kind = "macvtap",
.setup = macvtap_setup,
.newlink = macvtap_newlink,
.dellink = macvtap_dellink,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/s2io.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static int debug_level = ERR_DBG;

/* DEBUG message print. */
#define DBG_PRINT(dbg_level, fmt, args...) do { \
if (dbg_level >= debug_level) \
if (dbg_level <= debug_level) \
pr_info(fmt, ##args); \
} while (0)

Expand Down
14 changes: 12 additions & 2 deletions drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,8 +736,18 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6;
else if (sinfo->gso_type & SKB_GSO_UDP)
gso.gso_type = VIRTIO_NET_HDR_GSO_UDP;
else
BUG();
else {
printk(KERN_ERR "tun: unexpected GSO type: "
"0x%x, gso_size %d, hdr_len %d\n",
sinfo->gso_type, gso.gso_size,
gso.hdr_len);
print_hex_dump(KERN_ERR, "tun: ",
DUMP_PREFIX_NONE,
16, 1, skb->head,
min((int)gso.hdr_len, 64), true);
WARN_ON_ONCE(1);
return -EINVAL;
}
if (sinfo->gso_type & SKB_GSO_TCP_ECN)
gso.gso_type |= VIRTIO_NET_HDR_GSO_ECN;
} else
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wimax/i2400m/i2400m-usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ enum {
/* Device IDs */
USB_DEVICE_ID_I6050 = 0x0186,
USB_DEVICE_ID_I6050_2 = 0x0188,
USB_DEVICE_ID_I6250 = 0x0187,
};


Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wimax/i2400m/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ int i2400mu_probe(struct usb_interface *iface,
switch (id->idProduct) {
case USB_DEVICE_ID_I6050:
case USB_DEVICE_ID_I6050_2:
case USB_DEVICE_ID_I6250:
i2400mu->i6050 = 1;
break;
default:
Expand Down Expand Up @@ -739,6 +740,7 @@ static
struct usb_device_id i2400mu_id_table[] = {
{ USB_DEVICE(0x8086, USB_DEVICE_ID_I6050) },
{ USB_DEVICE(0x8086, USB_DEVICE_ID_I6050_2) },
{ USB_DEVICE(0x8086, USB_DEVICE_ID_I6250) },
{ USB_DEVICE(0x8086, 0x0181) },
{ USB_DEVICE(0x8086, 0x1403) },
{ USB_DEVICE(0x8086, 0x1405) },
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/ath9k/recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,9 +844,9 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
int dma_type;

if (edma)
dma_type = DMA_FROM_DEVICE;
else
dma_type = DMA_BIDIRECTIONAL;
else
dma_type = DMA_FROM_DEVICE;

qtype = hp ? ATH9K_RX_QUEUE_HP : ATH9K_RX_QUEUE_LP;
spin_lock_bh(&sc->rx.rxbuflock);
Expand Down
29 changes: 14 additions & 15 deletions drivers/power/ds2782_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@
struct ds278x_info;

struct ds278x_battery_ops {
int (*get_current)(struct ds278x_info *info, int *current_uA);
int (*get_voltage)(struct ds278x_info *info, int *voltage_uA);
int (*get_capacity)(struct ds278x_info *info, int *capacity_uA);

int (*get_battery_current)(struct ds278x_info *info, int *current_uA);
int (*get_battery_voltage)(struct ds278x_info *info, int *voltage_uA);
int (*get_battery_capacity)(struct ds278x_info *info, int *capacity_uA);
};

#define to_ds278x_info(x) container_of(x, struct ds278x_info, battery)
Expand Down Expand Up @@ -213,11 +212,11 @@ static int ds278x_get_status(struct ds278x_info *info, int *status)
int current_uA;
int capacity;

err = info->ops->get_current(info, &current_uA);
err = info->ops->get_battery_current(info, &current_uA);
if (err)
return err;

err = info->ops->get_capacity(info, &capacity);
err = info->ops->get_battery_capacity(info, &capacity);
if (err)
return err;

Expand Down Expand Up @@ -246,15 +245,15 @@ static int ds278x_battery_get_property(struct power_supply *psy,
break;

case POWER_SUPPLY_PROP_CAPACITY:
ret = info->ops->get_capacity(info, &val->intval);
ret = info->ops->get_battery_capacity(info, &val->intval);
break;

case POWER_SUPPLY_PROP_VOLTAGE_NOW:
ret = info->ops->get_voltage(info, &val->intval);
ret = info->ops->get_battery_voltage(info, &val->intval);
break;

case POWER_SUPPLY_PROP_CURRENT_NOW:
ret = info->ops->get_current(info, &val->intval);
ret = info->ops->get_battery_current(info, &val->intval);
break;

case POWER_SUPPLY_PROP_TEMP:
Expand Down Expand Up @@ -307,14 +306,14 @@ enum ds278x_num_id {

static struct ds278x_battery_ops ds278x_ops[] = {
[DS2782] = {
.get_current = ds2782_get_current,
.get_voltage = ds2782_get_voltage,
.get_capacity = ds2782_get_capacity,
.get_battery_current = ds2782_get_current,
.get_battery_voltage = ds2782_get_voltage,
.get_battery_capacity = ds2782_get_capacity,
},
[DS2786] = {
.get_current = ds2786_get_current,
.get_voltage = ds2786_get_voltage,
.get_capacity = ds2786_get_capacity,
.get_battery_current = ds2786_get_current,
.get_battery_voltage = ds2786_get_voltage,
.get_battery_capacity = ds2786_get_capacity,
}
};

Expand Down
2 changes: 2 additions & 0 deletions include/linux/if_macvlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
}
}

extern void macvlan_common_setup(struct net_device *dev);

extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
struct nlattr *tb[], struct nlattr *data[],
int (*receive)(struct sk_buff *skb),
Expand Down
Loading

0 comments on commit 38e14a7

Please sign in to comment.