Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
s2io: fixing DBG_PRINT() macro
ath9k: fix dma direction for map/unmap in ath_rx_tasklet
net: dev_forward_skb should call nf_reset
net sched: fix race in mirred device removal
tun: avoid BUG, dump packet on GSO errors
bonding: set device in RLB ARP packet handler
wimax/i2400m: Add PID & VID for Intel WiMAX 6250
ipv6: Don't add routes to ipv6 disabled interfaces.
net: Fix skb_copy_expand() handling of ->csum_start
net: Fix corruption of skb csum field in pskb_expand_head() of net/core/skbuff.c
macvtap: Limit packet queue length
ixgbe/igb: catch invalid VF settings
bnx2x: Advance a module version
bnx2x: Protect statistics ramrod and sequence number
bnx2x: Protect a SM state change
wireless: use netif_rx_ni in ieee80211_send_layer2_update

+151 -36
+4
drivers/net/bnx2x.h
··· 1062 1062 1063 1063 /* used to synchronize stats collecting */ 1064 1064 int stats_state; 1065 + 1066 + /* used for synchronization of concurrent threads statistics handling */ 1067 + spinlock_t stats_lock; 1068 + 1065 1069 /* used by dmae command loader */ 1066 1070 struct dmae_command stats_dmae; 1067 1071 int executer_idx;
+27 -15
drivers/net/bnx2x_main.c
··· 57 57 #include "bnx2x_init_ops.h" 58 58 #include "bnx2x_dump.h" 59 59 60 - #define DRV_MODULE_VERSION "1.52.53-1" 61 - #define DRV_MODULE_RELDATE "2010/18/04" 60 + #define DRV_MODULE_VERSION "1.52.53-2" 61 + #define DRV_MODULE_RELDATE "2010/21/07" 62 62 #define BNX2X_BC_VER 0x040200 63 63 64 64 #include <linux/firmware.h> ··· 3789 3789 struct eth_query_ramrod_data ramrod_data = {0}; 3790 3790 int i, rc; 3791 3791 3792 + spin_lock_bh(&bp->stats_lock); 3793 + 3792 3794 ramrod_data.drv_counter = bp->stats_counter++; 3793 3795 ramrod_data.collect_port = bp->port.pmf ? 1 : 0; 3794 3796 for_each_queue(bp, i) ··· 3804 3802 bp->spq_left++; 3805 3803 bp->stats_pending = 1; 3806 3804 } 3805 + 3806 + spin_unlock_bh(&bp->stats_lock); 3807 3807 } 3808 3808 } 3809 3809 ··· 4371 4367 struct host_func_stats *fstats = bnx2x_sp(bp, func_stats); 4372 4368 struct bnx2x_eth_stats *estats = &bp->eth_stats; 4373 4369 int i; 4370 + u16 cur_stats_counter; 4371 + 4372 + /* Make sure we use the value of the counter 4373 + * used for sending the last stats ramrod. 4374 + */ 4375 + spin_lock_bh(&bp->stats_lock); 4376 + cur_stats_counter = bp->stats_counter - 1; 4377 + spin_unlock_bh(&bp->stats_lock); 4374 4378 4375 4379 memcpy(&(fstats->total_bytes_received_hi), 4376 4380 &(bnx2x_sp(bp, func_stats_base)->total_bytes_received_hi), ··· 4406 4394 u32 diff; 4407 4395 4408 4396 /* are storm stats valid? */ 4409 - if ((u16)(le16_to_cpu(xclient->stats_counter) + 1) != 4410 - bp->stats_counter) { 4397 + if (le16_to_cpu(xclient->stats_counter) != cur_stats_counter) { 4411 4398 DP(BNX2X_MSG_STATS, "[%d] stats not updated by xstorm" 4412 4399 " xstorm counter (0x%x) != stats_counter (0x%x)\n", 4413 - i, xclient->stats_counter, bp->stats_counter); 4400 + i, xclient->stats_counter, cur_stats_counter + 1); 4414 4401 return -1; 4415 4402 } 4416 - if ((u16)(le16_to_cpu(tclient->stats_counter) + 1) != 4417 - bp->stats_counter) { 4403 + if (le16_to_cpu(tclient->stats_counter) != cur_stats_counter) { 4418 4404 DP(BNX2X_MSG_STATS, "[%d] stats not updated by tstorm" 4419 4405 " tstorm counter (0x%x) != stats_counter (0x%x)\n", 4420 - i, tclient->stats_counter, bp->stats_counter); 4406 + i, tclient->stats_counter, cur_stats_counter + 1); 4421 4407 return -2; 4422 4408 } 4423 - if ((u16)(le16_to_cpu(uclient->stats_counter) + 1) != 4424 - bp->stats_counter) { 4409 + if (le16_to_cpu(uclient->stats_counter) != cur_stats_counter) { 4425 4410 DP(BNX2X_MSG_STATS, "[%d] stats not updated by ustorm" 4426 4411 " ustorm counter (0x%x) != stats_counter (0x%x)\n", 4427 - i, uclient->stats_counter, bp->stats_counter); 4412 + i, uclient->stats_counter, cur_stats_counter + 1); 4428 4413 return -4; 4429 4414 } 4430 4415 ··· 4858 4849 4859 4850 static void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event) 4860 4851 { 4861 - enum bnx2x_stats_state state = bp->stats_state; 4852 + enum bnx2x_stats_state state; 4862 4853 4863 4854 if (unlikely(bp->panic)) 4864 4855 return; 4865 4856 4866 - bnx2x_stats_stm[state][event].action(bp); 4857 + /* Protect a state change flow */ 4858 + spin_lock_bh(&bp->stats_lock); 4859 + state = bp->stats_state; 4867 4860 bp->stats_state = bnx2x_stats_stm[state][event].next_state; 4861 + spin_unlock_bh(&bp->stats_lock); 4868 4862 4869 - /* Make sure the state has been "changed" */ 4870 - smp_wmb(); 4863 + bnx2x_stats_stm[state][event].action(bp); 4871 4864 4872 4865 if ((event != STATS_EVENT_UPDATE) || netif_msg_timer(bp)) 4873 4866 DP(BNX2X_MSG_STATS, "state %d -> event %d -> state %d\n", ··· 9919 9908 9920 9909 mutex_init(&bp->port.phy_mutex); 9921 9910 mutex_init(&bp->fw_mb_mutex); 9911 + spin_lock_init(&bp->stats_lock); 9922 9912 #ifdef BCM_CNIC 9923 9913 mutex_init(&bp->cnic_mutex); 9924 9914 #endif
+1 -1
drivers/net/bonding/bond_alb.c
··· 822 822 823 823 /*initialize packet type*/ 824 824 pk_type->type = cpu_to_be16(ETH_P_ARP); 825 - pk_type->dev = NULL; 825 + pk_type->dev = bond->dev; 826 826 pk_type->func = rlb_arp_recv; 827 827 828 828 /* register to receive ARPs */
+9
drivers/net/igb/igb_main.c
··· 1722 1722 u16 eeprom_apme_mask = IGB_EEPROM_APME; 1723 1723 u32 part_num; 1724 1724 1725 + /* Catch broken hardware that put the wrong VF device ID in 1726 + * the PCIe SR-IOV capability. 1727 + */ 1728 + if (pdev->is_virtfn) { 1729 + WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n", 1730 + pci_name(pdev), pdev->vendor, pdev->device); 1731 + return -EINVAL; 1732 + } 1733 + 1725 1734 err = pci_enable_device_mem(pdev); 1726 1735 if (err) 1727 1736 return err;
+9
drivers/net/ixgbe/ixgbe_main.c
··· 6492 6492 #endif 6493 6493 u32 part_num, eec; 6494 6494 6495 + /* Catch broken hardware that put the wrong VF device ID in 6496 + * the PCIe SR-IOV capability. 6497 + */ 6498 + if (pdev->is_virtfn) { 6499 + WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n", 6500 + pci_name(pdev), pdev->vendor, pdev->device); 6501 + return -EINVAL; 6502 + } 6503 + 6495 6504 err = pci_enable_device_mem(pdev); 6496 6505 if (err) 6497 6506 return err;
+8 -2
drivers/net/macvlan.c
··· 499 499 .ndo_validate_addr = eth_validate_addr, 500 500 }; 501 501 502 - static void macvlan_setup(struct net_device *dev) 502 + void macvlan_common_setup(struct net_device *dev) 503 503 { 504 504 ether_setup(dev); 505 505 ··· 508 508 dev->destructor = free_netdev; 509 509 dev->header_ops = &macvlan_hard_header_ops, 510 510 dev->ethtool_ops = &macvlan_ethtool_ops; 511 + } 512 + EXPORT_SYMBOL_GPL(macvlan_common_setup); 513 + 514 + static void macvlan_setup(struct net_device *dev) 515 + { 516 + macvlan_common_setup(dev); 511 517 dev->tx_queue_len = 0; 512 518 } 513 519 ··· 711 705 /* common fields */ 712 706 ops->priv_size = sizeof(struct macvlan_dev); 713 707 ops->get_tx_queues = macvlan_get_tx_queues; 714 - ops->setup = macvlan_setup; 715 708 ops->validate = macvlan_validate; 716 709 ops->maxtype = IFLA_MACVLAN_MAX; 717 710 ops->policy = macvlan_policy; ··· 724 719 725 720 static struct rtnl_link_ops macvlan_link_ops = { 726 721 .kind = "macvlan", 722 + .setup = macvlan_setup, 727 723 .newlink = macvlan_newlink, 728 724 .dellink = macvlan_dellink, 729 725 };
+16 -2
drivers/net/macvtap.c
··· 180 180 { 181 181 struct macvtap_queue *q = macvtap_get_queue(dev, skb); 182 182 if (!q) 183 - return -ENOLINK; 183 + goto drop; 184 + 185 + if (skb_queue_len(&q->sk.sk_receive_queue) >= dev->tx_queue_len) 186 + goto drop; 184 187 185 188 skb_queue_tail(&q->sk.sk_receive_queue, skb); 186 189 wake_up_interruptible_poll(sk_sleep(&q->sk), POLLIN | POLLRDNORM | POLLRDBAND); 187 - return 0; 190 + return NET_RX_SUCCESS; 191 + 192 + drop: 193 + kfree_skb(skb); 194 + return NET_RX_DROP; 188 195 } 189 196 190 197 /* ··· 242 235 macvlan_dellink(dev, head); 243 236 } 244 237 238 + static void macvtap_setup(struct net_device *dev) 239 + { 240 + macvlan_common_setup(dev); 241 + dev->tx_queue_len = TUN_READQ_SIZE; 242 + } 243 + 245 244 static struct rtnl_link_ops macvtap_link_ops __read_mostly = { 246 245 .kind = "macvtap", 246 + .setup = macvtap_setup, 247 247 .newlink = macvtap_newlink, 248 248 .dellink = macvtap_dellink, 249 249 };
+1 -1
drivers/net/s2io.h
··· 65 65 66 66 /* DEBUG message print. */ 67 67 #define DBG_PRINT(dbg_level, fmt, args...) do { \ 68 - if (dbg_level >= debug_level) \ 68 + if (dbg_level <= debug_level) \ 69 69 pr_info(fmt, ##args); \ 70 70 } while (0) 71 71
+12 -2
drivers/net/tun.c
··· 736 736 gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6; 737 737 else if (sinfo->gso_type & SKB_GSO_UDP) 738 738 gso.gso_type = VIRTIO_NET_HDR_GSO_UDP; 739 - else 740 - BUG(); 739 + else { 740 + printk(KERN_ERR "tun: unexpected GSO type: " 741 + "0x%x, gso_size %d, hdr_len %d\n", 742 + sinfo->gso_type, gso.gso_size, 743 + gso.hdr_len); 744 + print_hex_dump(KERN_ERR, "tun: ", 745 + DUMP_PREFIX_NONE, 746 + 16, 1, skb->head, 747 + min((int)gso.hdr_len, 64), true); 748 + WARN_ON_ONCE(1); 749 + return -EINVAL; 750 + } 741 751 if (sinfo->gso_type & SKB_GSO_TCP_ECN) 742 752 gso.gso_type |= VIRTIO_NET_HDR_GSO_ECN; 743 753 } else
+1
drivers/net/wimax/i2400m/i2400m-usb.h
··· 152 152 /* Device IDs */ 153 153 USB_DEVICE_ID_I6050 = 0x0186, 154 154 USB_DEVICE_ID_I6050_2 = 0x0188, 155 + USB_DEVICE_ID_I6250 = 0x0187, 155 156 }; 156 157 157 158
+2
drivers/net/wimax/i2400m/usb.c
··· 491 491 switch (id->idProduct) { 492 492 case USB_DEVICE_ID_I6050: 493 493 case USB_DEVICE_ID_I6050_2: 494 + case USB_DEVICE_ID_I6250: 494 495 i2400mu->i6050 = 1; 495 496 break; 496 497 default: ··· 740 739 struct usb_device_id i2400mu_id_table[] = { 741 740 { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050) }, 742 741 { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050_2) }, 742 + { USB_DEVICE(0x8086, USB_DEVICE_ID_I6250) }, 743 743 { USB_DEVICE(0x8086, 0x0181) }, 744 744 { USB_DEVICE(0x8086, 0x1403) }, 745 745 { USB_DEVICE(0x8086, 0x1405) },
+2 -2
drivers/net/wireless/ath/ath9k/recv.c
··· 844 844 int dma_type; 845 845 846 846 if (edma) 847 - dma_type = DMA_FROM_DEVICE; 848 - else 849 847 dma_type = DMA_BIDIRECTIONAL; 848 + else 849 + dma_type = DMA_FROM_DEVICE; 850 850 851 851 qtype = hp ? ATH9K_RX_QUEUE_HP : ATH9K_RX_QUEUE_LP; 852 852 spin_lock_bh(&sc->rx.rxbuflock);
+2
include/linux/if_macvlan.h
··· 67 67 } 68 68 } 69 69 70 + extern void macvlan_common_setup(struct net_device *dev); 71 + 70 72 extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, 71 73 struct nlattr *tb[], struct nlattr *data[], 72 74 int (*receive)(struct sk_buff *skb),
+1
include/net/tc_act/tc_mirred.h
··· 9 9 int tcfm_ifindex; 10 10 int tcfm_ok_push; 11 11 struct net_device *tcfm_dev; 12 + struct list_head tcfm_list; 12 13 }; 13 14 #define to_mirred(pc) \ 14 15 container_of(pc, struct tcf_mirred, common)
+1
net/core/dev.c
··· 1488 1488 int dev_forward_skb(struct net_device *dev, struct sk_buff *skb) 1489 1489 { 1490 1490 skb_orphan(skb); 1491 + nf_reset(skb); 1491 1492 1492 1493 if (!(dev->flags & IFF_UP) || 1493 1494 (skb->len > (dev->mtu + dev->hard_header_len))) {
+5 -2
net/core/skbuff.c
··· 843 843 skb->network_header += off; 844 844 if (skb_mac_header_was_set(skb)) 845 845 skb->mac_header += off; 846 - skb->csum_start += nhead; 846 + /* Only adjust this if it actually is csum_start rather than csum */ 847 + if (skb->ip_summed == CHECKSUM_PARTIAL) 848 + skb->csum_start += nhead; 847 849 skb->cloned = 0; 848 850 skb->hdr_len = 0; 849 851 skb->nohdr = 0; ··· 932 930 copy_skb_header(n, skb); 933 931 934 932 off = newheadroom - oldheadroom; 935 - n->csum_start += off; 933 + if (n->ip_summed == CHECKSUM_PARTIAL) 934 + n->csum_start += off; 936 935 #ifdef NET_SKBUFF_DATA_USES_OFFSET 937 936 n->transport_header += off; 938 937 n->network_header += off;
+9 -5
net/ipv6/addrconf.c
··· 1760 1760 1761 1761 idev = ipv6_find_idev(dev); 1762 1762 if (!idev) 1763 - return NULL; 1763 + return ERR_PTR(-ENOBUFS); 1764 + 1765 + if (idev->cnf.disable_ipv6) 1766 + return ERR_PTR(-EACCES); 1764 1767 1765 1768 /* Add default multicast route */ 1766 1769 addrconf_add_mroute(dev); ··· 2132 2129 if (!dev) 2133 2130 return -ENODEV; 2134 2131 2135 - if ((idev = addrconf_add_dev(dev)) == NULL) 2136 - return -ENOBUFS; 2132 + idev = addrconf_add_dev(dev); 2133 + if (IS_ERR(idev)) 2134 + return PTR_ERR(idev); 2137 2135 2138 2136 scope = ipv6_addr_scope(pfx); 2139 2137 ··· 2381 2377 } 2382 2378 2383 2379 idev = addrconf_add_dev(dev); 2384 - if (idev == NULL) 2380 + if (IS_ERR(idev)) 2385 2381 return; 2386 2382 2387 2383 memset(&addr, 0, sizeof(struct in6_addr)); ··· 2472 2468 ASSERT_RTNL(); 2473 2469 2474 2470 idev = addrconf_add_dev(dev); 2475 - if (!idev) { 2471 + if (IS_ERR(idev)) { 2476 2472 printk(KERN_DEBUG "init ip6-ip6: add_dev failed\n"); 2477 2473 return; 2478 2474 }
+1 -1
net/mac80211/cfg.c
··· 632 632 skb->dev = sta->sdata->dev; 633 633 skb->protocol = eth_type_trans(skb, sta->sdata->dev); 634 634 memset(skb->cb, 0, sizeof(skb->cb)); 635 - netif_rx(skb); 635 + netif_rx_ni(skb); 636 636 } 637 637 638 638 static void sta_apply_parameters(struct ieee80211_local *local,
+40 -3
net/sched/act_mirred.c
··· 33 33 static struct tcf_common *tcf_mirred_ht[MIRRED_TAB_MASK + 1]; 34 34 static u32 mirred_idx_gen; 35 35 static DEFINE_RWLOCK(mirred_lock); 36 + static LIST_HEAD(mirred_list); 36 37 37 38 static struct tcf_hashinfo mirred_hash_info = { 38 39 .htab = tcf_mirred_ht, ··· 48 47 m->tcf_bindcnt--; 49 48 m->tcf_refcnt--; 50 49 if(!m->tcf_bindcnt && m->tcf_refcnt <= 0) { 51 - dev_put(m->tcfm_dev); 50 + list_del(&m->tcfm_list); 51 + if (m->tcfm_dev) 52 + dev_put(m->tcfm_dev); 52 53 tcf_hash_destroy(&m->common, &mirred_hash_info); 53 54 return 1; 54 55 } ··· 137 134 m->tcfm_ok_push = ok_push; 138 135 } 139 136 spin_unlock_bh(&m->tcf_lock); 140 - if (ret == ACT_P_CREATED) 137 + if (ret == ACT_P_CREATED) { 138 + list_add(&m->tcfm_list, &mirred_list); 141 139 tcf_hash_insert(pc, &mirred_hash_info); 140 + } 142 141 143 142 return ret; 144 143 } ··· 167 162 m->tcf_tm.lastuse = jiffies; 168 163 169 164 dev = m->tcfm_dev; 165 + if (!dev) { 166 + printk_once(KERN_NOTICE "tc mirred: target device is gone\n"); 167 + goto out; 168 + } 169 + 170 170 if (!(dev->flags & IFF_UP)) { 171 171 if (net_ratelimit()) 172 - pr_notice("tc mirred to Houston: device %s is gone!\n", 172 + pr_notice("tc mirred to Houston: device %s is down\n", 173 173 dev->name); 174 174 goto out; 175 175 } ··· 242 232 return -1; 243 233 } 244 234 235 + static int mirred_device_event(struct notifier_block *unused, 236 + unsigned long event, void *ptr) 237 + { 238 + struct net_device *dev = ptr; 239 + struct tcf_mirred *m; 240 + 241 + if (event == NETDEV_UNREGISTER) 242 + list_for_each_entry(m, &mirred_list, tcfm_list) { 243 + if (m->tcfm_dev == dev) { 244 + dev_put(dev); 245 + m->tcfm_dev = NULL; 246 + } 247 + } 248 + 249 + return NOTIFY_DONE; 250 + } 251 + 252 + static struct notifier_block mirred_device_notifier = { 253 + .notifier_call = mirred_device_event, 254 + }; 255 + 256 + 245 257 static struct tc_action_ops act_mirred_ops = { 246 258 .kind = "mirred", 247 259 .hinfo = &mirred_hash_info, ··· 284 252 285 253 static int __init mirred_init_module(void) 286 254 { 255 + int err = register_netdevice_notifier(&mirred_device_notifier); 256 + if (err) 257 + return err; 258 + 287 259 pr_info("Mirror/redirect action on\n"); 288 260 return tcf_register_action(&act_mirred_ops); 289 261 } 290 262 291 263 static void __exit mirred_cleanup_module(void) 292 264 { 265 + unregister_netdevice_notifier(&mirred_device_notifier); 293 266 tcf_unregister_action(&act_mirred_ops); 294 267 } 295 268