Loading drivers/net/bnx2x/bnx2x.h +4 −0 Original line number Diff line number Diff line Loading @@ -863,6 +863,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; Loading drivers/net/bnx2x/bnx2x_main.c +1 −0 Original line number Diff line number Diff line Loading @@ -6714,6 +6714,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 Loading drivers/net/bnx2x/bnx2x_stats.c +24 −13 Original line number Diff line number Diff line Loading @@ -156,6 +156,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) Loading @@ -169,6 +171,8 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp) bp->spq_left++; bp->stats_pending = 1; } spin_unlock_bh(&bp->stats_lock); } } Loading Loading @@ -734,6 +738,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), Loading Loading @@ -761,25 +773,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; } Loading Loading @@ -1216,16 +1225,18 @@ static const struct { 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", Loading drivers/net/bonding/bond_alb.c +1 −1 Original line number Diff line number Diff line Loading @@ -815,7 +815,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 */ Loading drivers/net/igb/igb_main.c +9 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading
drivers/net/bnx2x/bnx2x.h +4 −0 Original line number Diff line number Diff line Loading @@ -863,6 +863,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; Loading
drivers/net/bnx2x/bnx2x_main.c +1 −0 Original line number Diff line number Diff line Loading @@ -6714,6 +6714,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 Loading
drivers/net/bnx2x/bnx2x_stats.c +24 −13 Original line number Diff line number Diff line Loading @@ -156,6 +156,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) Loading @@ -169,6 +171,8 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp) bp->spq_left++; bp->stats_pending = 1; } spin_unlock_bh(&bp->stats_lock); } } Loading Loading @@ -734,6 +738,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), Loading Loading @@ -761,25 +773,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; } Loading Loading @@ -1216,16 +1225,18 @@ static const struct { 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", Loading
drivers/net/bonding/bond_alb.c +1 −1 Original line number Diff line number Diff line Loading @@ -815,7 +815,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 */ Loading
drivers/net/igb/igb_main.c +9 −0 Original line number Diff line number Diff line Loading @@ -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; Loading