diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 11:00:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 11:00:01 -0400 |
commit | 199f4c9f76fd8b030405abddf294e771f888de03 (patch) | |
tree | ee4f104a7562e1fd76882bc40f2de7d90812e1df /drivers/net | |
parent | 37224470c8c6d90a4062e76a08d4dc1fcf91fc89 (diff) | |
parent | ca6bb5d7ab22ac79f608fe6cbc6b12de6a5a19f0 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[NET]: Require CAP_NET_ADMIN to create tuntap devices.
[NET]: fix net-core kernel-doc
[TCP]: Move inclusion of <linux/dmaengine.h> to correct place in <linux/tcp.h>
[IPSEC]: Handle GSO packets
[NET]: Added GSO toggle
[NET]: Add software TSOv4
[NET]: Add generic segmentation offload
[NET]: Merge TSO/UFO fields in sk_buff
[NET]: Prevent transmission after dev_deactivate
[IPV6] ADDRCONF: Fix default source address selection without CONFIG_IPV6_PRIVACY
[IPV6]: Fix source address selection.
[NET]: Avoid allocating skb in skb_pad
Diffstat (limited to 'drivers/net')
46 files changed, 78 insertions, 119 deletions
diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c index 1b1cb0026072..157eda573925 100644 --- a/drivers/net/3c527.c +++ b/drivers/net/3c527.c | |||
@@ -1031,8 +1031,7 @@ static int mc32_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1031 | return 1; | 1031 | return 1; |
1032 | } | 1032 | } |
1033 | 1033 | ||
1034 | skb = skb_padto(skb, ETH_ZLEN); | 1034 | if (skb_padto(skb, ETH_ZLEN)) { |
1035 | if (skb == NULL) { | ||
1036 | netif_wake_queue(dev); | 1035 | netif_wake_queue(dev); |
1037 | return 0; | 1036 | return 0; |
1038 | } | 1037 | } |
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index a26077a175ad..0cdc830449d8 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -797,7 +797,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
797 | entry = cp->tx_head; | 797 | entry = cp->tx_head; |
798 | eor = (entry == (CP_TX_RING_SIZE - 1)) ? RingEnd : 0; | 798 | eor = (entry == (CP_TX_RING_SIZE - 1)) ? RingEnd : 0; |
799 | if (dev->features & NETIF_F_TSO) | 799 | if (dev->features & NETIF_F_TSO) |
800 | mss = skb_shinfo(skb)->tso_size; | 800 | mss = skb_shinfo(skb)->gso_size; |
801 | 801 | ||
802 | if (skb_shinfo(skb)->nr_frags == 0) { | 802 | if (skb_shinfo(skb)->nr_frags == 0) { |
803 | struct cp_desc *txd = &cp->tx_ring[entry]; | 803 | struct cp_desc *txd = &cp->tx_ring[entry]; |
diff --git a/drivers/net/82596.c b/drivers/net/82596.c index da0c878dcba8..8a9f7d61b9b1 100644 --- a/drivers/net/82596.c +++ b/drivers/net/82596.c | |||
@@ -1070,8 +1070,7 @@ static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1070 | skb->len, (unsigned int)skb->data)); | 1070 | skb->len, (unsigned int)skb->data)); |
1071 | 1071 | ||
1072 | if (skb->len < ETH_ZLEN) { | 1072 | if (skb->len < ETH_ZLEN) { |
1073 | skb = skb_padto(skb, ETH_ZLEN); | 1073 | if (skb_padto(skb, ETH_ZLEN)) |
1074 | if (skb == NULL) | ||
1075 | return 0; | 1074 | return 0; |
1076 | length = ETH_ZLEN; | 1075 | length = ETH_ZLEN; |
1077 | } | 1076 | } |
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c index 79bb56b8dcef..71165ac0257a 100644 --- a/drivers/net/a2065.c +++ b/drivers/net/a2065.c | |||
@@ -573,8 +573,7 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
573 | 573 | ||
574 | if (len < ETH_ZLEN) { | 574 | if (len < ETH_ZLEN) { |
575 | len = ETH_ZLEN; | 575 | len = ETH_ZLEN; |
576 | skb = skb_padto(skb, ETH_ZLEN); | 576 | if (skb_padto(skb, ETH_ZLEN)) |
577 | if (skb == NULL) | ||
578 | return 0; | 577 | return 0; |
579 | } | 578 | } |
580 | 579 | ||
diff --git a/drivers/net/ariadne.c b/drivers/net/ariadne.c index d1b6b1f794e2..a9bb7a4aff98 100644 --- a/drivers/net/ariadne.c +++ b/drivers/net/ariadne.c | |||
@@ -607,8 +607,7 @@ static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
607 | /* FIXME: is the 79C960 new enough to do its own padding right ? */ | 607 | /* FIXME: is the 79C960 new enough to do its own padding right ? */ |
608 | if (skb->len < ETH_ZLEN) | 608 | if (skb->len < ETH_ZLEN) |
609 | { | 609 | { |
610 | skb = skb_padto(skb, ETH_ZLEN); | 610 | if (skb_padto(skb, ETH_ZLEN)) |
611 | if (skb == NULL) | ||
612 | return 0; | 611 | return 0; |
613 | len = ETH_ZLEN; | 612 | len = ETH_ZLEN; |
614 | } | 613 | } |
diff --git a/drivers/net/arm/ether1.c b/drivers/net/arm/ether1.c index 36475eb2727f..312955d07b28 100644 --- a/drivers/net/arm/ether1.c +++ b/drivers/net/arm/ether1.c | |||
@@ -700,8 +700,7 @@ ether1_sendpacket (struct sk_buff *skb, struct net_device *dev) | |||
700 | } | 700 | } |
701 | 701 | ||
702 | if (skb->len < ETH_ZLEN) { | 702 | if (skb->len < ETH_ZLEN) { |
703 | skb = skb_padto(skb, ETH_ZLEN); | 703 | if (skb_padto(skb, ETH_ZLEN)) |
704 | if (skb == NULL) | ||
705 | goto out; | 704 | goto out; |
706 | } | 705 | } |
707 | 706 | ||
diff --git a/drivers/net/arm/ether3.c b/drivers/net/arm/ether3.c index f1d5b1027ff7..081074180e62 100644 --- a/drivers/net/arm/ether3.c +++ b/drivers/net/arm/ether3.c | |||
@@ -518,8 +518,7 @@ ether3_sendpacket(struct sk_buff *skb, struct net_device *dev) | |||
518 | 518 | ||
519 | length = (length + 1) & ~1; | 519 | length = (length + 1) & ~1; |
520 | if (length != skb->len) { | 520 | if (length != skb->len) { |
521 | skb = skb_padto(skb, length); | 521 | if (skb_padto(skb, length)) |
522 | if (skb == NULL) | ||
523 | goto out; | 522 | goto out; |
524 | } | 523 | } |
525 | 524 | ||
diff --git a/drivers/net/atarilance.c b/drivers/net/atarilance.c index 442b2cbeb58a..91783a8008be 100644 --- a/drivers/net/atarilance.c +++ b/drivers/net/atarilance.c | |||
@@ -804,8 +804,7 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev ) | |||
804 | ++len; | 804 | ++len; |
805 | 805 | ||
806 | if (len > skb->len) { | 806 | if (len > skb->len) { |
807 | skb = skb_padto(skb, len); | 807 | if (skb_padto(skb, len)) |
808 | if (skb == NULL) | ||
809 | return 0; | 808 | return 0; |
810 | } | 809 | } |
811 | 810 | ||
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 702d546567ad..7635736cc791 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -1640,7 +1640,7 @@ bnx2_tx_int(struct bnx2 *bp) | |||
1640 | skb = tx_buf->skb; | 1640 | skb = tx_buf->skb; |
1641 | #ifdef BCM_TSO | 1641 | #ifdef BCM_TSO |
1642 | /* partial BD completions possible with TSO packets */ | 1642 | /* partial BD completions possible with TSO packets */ |
1643 | if (skb_shinfo(skb)->tso_size) { | 1643 | if (skb_shinfo(skb)->gso_size) { |
1644 | u16 last_idx, last_ring_idx; | 1644 | u16 last_idx, last_ring_idx; |
1645 | 1645 | ||
1646 | last_idx = sw_cons + | 1646 | last_idx = sw_cons + |
@@ -4428,7 +4428,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
4428 | (TX_BD_FLAGS_VLAN_TAG | (vlan_tx_tag_get(skb) << 16)); | 4428 | (TX_BD_FLAGS_VLAN_TAG | (vlan_tx_tag_get(skb) << 16)); |
4429 | } | 4429 | } |
4430 | #ifdef BCM_TSO | 4430 | #ifdef BCM_TSO |
4431 | if ((mss = skb_shinfo(skb)->tso_size) && | 4431 | if ((mss = skb_shinfo(skb)->gso_size) && |
4432 | (skb->len > (bp->dev->mtu + ETH_HLEN))) { | 4432 | (skb->len > (bp->dev->mtu + ETH_HLEN))) { |
4433 | u32 tcp_opt_len, ip_tcp_len; | 4433 | u32 tcp_opt_len, ip_tcp_len; |
4434 | 4434 | ||
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index 39f36aa05aa8..565a54f1d06a 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c | |||
@@ -2915,8 +2915,7 @@ static int cas_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2915 | */ | 2915 | */ |
2916 | static int ring; | 2916 | static int ring; |
2917 | 2917 | ||
2918 | skb = skb_padto(skb, cp->min_frame_size); | 2918 | if (skb_padto(skb, cp->min_frame_size)) |
2919 | if (!skb) | ||
2920 | return 0; | 2919 | return 0; |
2921 | 2920 | ||
2922 | /* XXX: we need some higher-level QoS hooks to steer packets to | 2921 | /* XXX: we need some higher-level QoS hooks to steer packets to |
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c index 4391bf4bf573..53efff6da784 100644 --- a/drivers/net/chelsio/sge.c +++ b/drivers/net/chelsio/sge.c | |||
@@ -1418,7 +1418,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1418 | struct cpl_tx_pkt *cpl; | 1418 | struct cpl_tx_pkt *cpl; |
1419 | 1419 | ||
1420 | #ifdef NETIF_F_TSO | 1420 | #ifdef NETIF_F_TSO |
1421 | if (skb_shinfo(skb)->tso_size) { | 1421 | if (skb_shinfo(skb)->gso_size) { |
1422 | int eth_type; | 1422 | int eth_type; |
1423 | struct cpl_tx_pkt_lso *hdr; | 1423 | struct cpl_tx_pkt_lso *hdr; |
1424 | 1424 | ||
@@ -1433,7 +1433,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1433 | hdr->ip_hdr_words = skb->nh.iph->ihl; | 1433 | hdr->ip_hdr_words = skb->nh.iph->ihl; |
1434 | hdr->tcp_hdr_words = skb->h.th->doff; | 1434 | hdr->tcp_hdr_words = skb->h.th->doff; |
1435 | hdr->eth_type_mss = htons(MK_ETH_TYPE_MSS(eth_type, | 1435 | hdr->eth_type_mss = htons(MK_ETH_TYPE_MSS(eth_type, |
1436 | skb_shinfo(skb)->tso_size)); | 1436 | skb_shinfo(skb)->gso_size)); |
1437 | hdr->len = htonl(skb->len - sizeof(*hdr)); | 1437 | hdr->len = htonl(skb->len - sizeof(*hdr)); |
1438 | cpl = (struct cpl_tx_pkt *)hdr; | 1438 | cpl = (struct cpl_tx_pkt *)hdr; |
1439 | sge->stats.tx_lso_pkts++; | 1439 | sge->stats.tx_lso_pkts++; |
diff --git a/drivers/net/declance.c b/drivers/net/declance.c index f130bdab3fd3..d3d958e7ac56 100644 --- a/drivers/net/declance.c +++ b/drivers/net/declance.c | |||
@@ -885,8 +885,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
885 | len = skblen; | 885 | len = skblen; |
886 | 886 | ||
887 | if (len < ETH_ZLEN) { | 887 | if (len < ETH_ZLEN) { |
888 | skb = skb_padto(skb, ETH_ZLEN); | 888 | if (skb_padto(skb, ETH_ZLEN)) |
889 | if (skb == NULL) | ||
890 | return 0; | 889 | return 0; |
891 | len = ETH_ZLEN; | 890 | len = ETH_ZLEN; |
892 | } | 891 | } |
diff --git a/drivers/net/depca.c b/drivers/net/depca.c index 0941d40f046f..e946c43d3b10 100644 --- a/drivers/net/depca.c +++ b/drivers/net/depca.c | |||
@@ -938,11 +938,8 @@ static int depca_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
938 | if (skb->len < 1) | 938 | if (skb->len < 1) |
939 | goto out; | 939 | goto out; |
940 | 940 | ||
941 | if (skb->len < ETH_ZLEN) { | 941 | if (skb_padto(skb, ETH_ZLEN)) |
942 | skb = skb_padto(skb, ETH_ZLEN); | 942 | goto out; |
943 | if (skb == NULL) | ||
944 | goto out; | ||
945 | } | ||
946 | 943 | ||
947 | netif_stop_queue(dev); | 944 | netif_stop_queue(dev); |
948 | 945 | ||
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index a373ccb308d8..32b7d444b374 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -2394,7 +2394,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
2394 | uint8_t ipcss, ipcso, tucss, tucso, hdr_len; | 2394 | uint8_t ipcss, ipcso, tucss, tucso, hdr_len; |
2395 | int err; | 2395 | int err; |
2396 | 2396 | ||
2397 | if (skb_shinfo(skb)->tso_size) { | 2397 | if (skb_shinfo(skb)->gso_size) { |
2398 | if (skb_header_cloned(skb)) { | 2398 | if (skb_header_cloned(skb)) { |
2399 | err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); | 2399 | err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); |
2400 | if (err) | 2400 | if (err) |
@@ -2402,7 +2402,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
2402 | } | 2402 | } |
2403 | 2403 | ||
2404 | hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2)); | 2404 | hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2)); |
2405 | mss = skb_shinfo(skb)->tso_size; | 2405 | mss = skb_shinfo(skb)->gso_size; |
2406 | if (skb->protocol == htons(ETH_P_IP)) { | 2406 | if (skb->protocol == htons(ETH_P_IP)) { |
2407 | skb->nh.iph->tot_len = 0; | 2407 | skb->nh.iph->tot_len = 0; |
2408 | skb->nh.iph->check = 0; | 2408 | skb->nh.iph->check = 0; |
@@ -2519,7 +2519,7 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
2519 | * tso gets written back prematurely before the data is fully | 2519 | * tso gets written back prematurely before the data is fully |
2520 | * DMA'd to the controller */ | 2520 | * DMA'd to the controller */ |
2521 | if (!skb->data_len && tx_ring->last_tx_tso && | 2521 | if (!skb->data_len && tx_ring->last_tx_tso && |
2522 | !skb_shinfo(skb)->tso_size) { | 2522 | !skb_shinfo(skb)->gso_size) { |
2523 | tx_ring->last_tx_tso = 0; | 2523 | tx_ring->last_tx_tso = 0; |
2524 | size -= 4; | 2524 | size -= 4; |
2525 | } | 2525 | } |
@@ -2757,7 +2757,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
2757 | } | 2757 | } |
2758 | 2758 | ||
2759 | #ifdef NETIF_F_TSO | 2759 | #ifdef NETIF_F_TSO |
2760 | mss = skb_shinfo(skb)->tso_size; | 2760 | mss = skb_shinfo(skb)->gso_size; |
2761 | /* The controller does a simple calculation to | 2761 | /* The controller does a simple calculation to |
2762 | * make sure there is enough room in the FIFO before | 2762 | * make sure there is enough room in the FIFO before |
2763 | * initiating the DMA for each buffer. The calc is: | 2763 | * initiating the DMA for each buffer. The calc is: |
@@ -2807,7 +2807,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
2807 | #ifdef NETIF_F_TSO | 2807 | #ifdef NETIF_F_TSO |
2808 | /* Controller Erratum workaround */ | 2808 | /* Controller Erratum workaround */ |
2809 | if (!skb->data_len && tx_ring->last_tx_tso && | 2809 | if (!skb->data_len && tx_ring->last_tx_tso && |
2810 | !skb_shinfo(skb)->tso_size) | 2810 | !skb_shinfo(skb)->gso_size) |
2811 | count++; | 2811 | count++; |
2812 | #endif | 2812 | #endif |
2813 | 2813 | ||
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c index a806dfe54d23..e70f172699db 100644 --- a/drivers/net/eepro.c +++ b/drivers/net/eepro.c | |||
@@ -1154,8 +1154,7 @@ static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
1154 | printk(KERN_DEBUG "%s: entering eepro_send_packet routine.\n", dev->name); | 1154 | printk(KERN_DEBUG "%s: entering eepro_send_packet routine.\n", dev->name); |
1155 | 1155 | ||
1156 | if (length < ETH_ZLEN) { | 1156 | if (length < ETH_ZLEN) { |
1157 | skb = skb_padto(skb, ETH_ZLEN); | 1157 | if (skb_padto(skb, ETH_ZLEN)) |
1158 | if (skb == NULL) | ||
1159 | return 0; | 1158 | return 0; |
1160 | length = ETH_ZLEN; | 1159 | length = ETH_ZLEN; |
1161 | } | 1160 | } |
diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c index 82bd356e4f3a..a74b20715755 100644 --- a/drivers/net/eexpress.c +++ b/drivers/net/eexpress.c | |||
@@ -677,8 +677,7 @@ static int eexp_xmit(struct sk_buff *buf, struct net_device *dev) | |||
677 | #endif | 677 | #endif |
678 | 678 | ||
679 | if (buf->len < ETH_ZLEN) { | 679 | if (buf->len < ETH_ZLEN) { |
680 | buf = skb_padto(buf, ETH_ZLEN); | 680 | if (skb_padto(buf, ETH_ZLEN)) |
681 | if (buf == NULL) | ||
682 | return 0; | 681 | return 0; |
683 | length = ETH_ZLEN; | 682 | length = ETH_ZLEN; |
684 | } | 683 | } |
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c index 8d680ce600d7..724d7dc35fa3 100644 --- a/drivers/net/epic100.c +++ b/drivers/net/epic100.c | |||
@@ -1027,11 +1027,8 @@ static int epic_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1027 | u32 ctrl_word; | 1027 | u32 ctrl_word; |
1028 | unsigned long flags; | 1028 | unsigned long flags; |
1029 | 1029 | ||
1030 | if (skb->len < ETH_ZLEN) { | 1030 | if (skb_padto(skb, ETH_ZLEN)) |
1031 | skb = skb_padto(skb, ETH_ZLEN); | 1031 | return 0; |
1032 | if (skb == NULL) | ||
1033 | return 0; | ||
1034 | } | ||
1035 | 1032 | ||
1036 | /* Caution: the write order is important here, set the field with the | 1033 | /* Caution: the write order is important here, set the field with the |
1037 | "ownership" bit last. */ | 1034 | "ownership" bit last. */ |
diff --git a/drivers/net/eth16i.c b/drivers/net/eth16i.c index b67545be2caa..4bf76f86d8e9 100644 --- a/drivers/net/eth16i.c +++ b/drivers/net/eth16i.c | |||
@@ -1064,8 +1064,7 @@ static int eth16i_tx(struct sk_buff *skb, struct net_device *dev) | |||
1064 | unsigned long flags; | 1064 | unsigned long flags; |
1065 | 1065 | ||
1066 | if (length < ETH_ZLEN) { | 1066 | if (length < ETH_ZLEN) { |
1067 | skb = skb_padto(skb, ETH_ZLEN); | 1067 | if (skb_padto(skb, ETH_ZLEN)) |
1068 | if (skb == NULL) | ||
1069 | return 0; | 1068 | return 0; |
1070 | length = ETH_ZLEN; | 1069 | length = ETH_ZLEN; |
1071 | } | 1070 | } |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 191383d461d7..21be4fa071b5 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -1495,8 +1495,8 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1495 | np->tx_skbuff[nr] = skb; | 1495 | np->tx_skbuff[nr] = skb; |
1496 | 1496 | ||
1497 | #ifdef NETIF_F_TSO | 1497 | #ifdef NETIF_F_TSO |
1498 | if (skb_shinfo(skb)->tso_size) | 1498 | if (skb_shinfo(skb)->gso_size) |
1499 | tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)->tso_size << NV_TX2_TSO_SHIFT); | 1499 | tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)->gso_size << NV_TX2_TSO_SHIFT); |
1500 | else | 1500 | else |
1501 | #endif | 1501 | #endif |
1502 | tx_flags_extra = (skb->ip_summed == CHECKSUM_HW ? (NV_TX2_CHECKSUM_L3|NV_TX2_CHECKSUM_L4) : 0); | 1502 | tx_flags_extra = (skb->ip_summed == CHECKSUM_HW ? (NV_TX2_CHECKSUM_L3|NV_TX2_CHECKSUM_L4) : 0); |
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index 247c8ca86033..dd1dc32dc98d 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c | |||
@@ -1487,11 +1487,8 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev) | |||
1487 | if (skb->len <= 0) | 1487 | if (skb->len <= 0) |
1488 | return 0; | 1488 | return 0; |
1489 | 1489 | ||
1490 | if (skb->len < ETH_ZLEN && lp->chip == HP100_CHIPID_SHASTA) { | 1490 | if (lp->chip == HP100_CHIPID_SHASTA && skb_padto(skb, ETH_ZLEN)) |
1491 | skb = skb_padto(skb, ETH_ZLEN); | 1491 | return 0; |
1492 | if (skb == NULL) | ||
1493 | return 0; | ||
1494 | } | ||
1495 | 1492 | ||
1496 | /* Get Tx ring tail pointer */ | 1493 | /* Get Tx ring tail pointer */ |
1497 | if (lp->txrtail->next == lp->txrhead) { | 1494 | if (lp->txrtail->next == lp->txrhead) { |
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index 57006fb8840e..8bb32f946993 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -1173,7 +1173,7 @@ ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb) | |||
1173 | uint16_t ipcse, tucse, mss; | 1173 | uint16_t ipcse, tucse, mss; |
1174 | int err; | 1174 | int err; |
1175 | 1175 | ||
1176 | if(likely(skb_shinfo(skb)->tso_size)) { | 1176 | if(likely(skb_shinfo(skb)->gso_size)) { |
1177 | if (skb_header_cloned(skb)) { | 1177 | if (skb_header_cloned(skb)) { |
1178 | err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); | 1178 | err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); |
1179 | if (err) | 1179 | if (err) |
@@ -1181,7 +1181,7 @@ ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb) | |||
1181 | } | 1181 | } |
1182 | 1182 | ||
1183 | hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2)); | 1183 | hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2)); |
1184 | mss = skb_shinfo(skb)->tso_size; | 1184 | mss = skb_shinfo(skb)->gso_size; |
1185 | skb->nh.iph->tot_len = 0; | 1185 | skb->nh.iph->tot_len = 0; |
1186 | skb->nh.iph->check = 0; | 1186 | skb->nh.iph->check = 0; |
1187 | skb->h.th->check = ~csum_tcpudp_magic(skb->nh.iph->saddr, | 1187 | skb->h.th->check = ~csum_tcpudp_magic(skb->nh.iph->saddr, |
diff --git a/drivers/net/lance.c b/drivers/net/lance.c index bb5ad479210b..c1c3452c90ca 100644 --- a/drivers/net/lance.c +++ b/drivers/net/lance.c | |||
@@ -968,8 +968,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
968 | /* The old LANCE chips doesn't automatically pad buffers to min. size. */ | 968 | /* The old LANCE chips doesn't automatically pad buffers to min. size. */ |
969 | if (chip_table[lp->chip_version].flags & LANCE_MUST_PAD) { | 969 | if (chip_table[lp->chip_version].flags & LANCE_MUST_PAD) { |
970 | if (skb->len < ETH_ZLEN) { | 970 | if (skb->len < ETH_ZLEN) { |
971 | skb = skb_padto(skb, ETH_ZLEN); | 971 | if (skb_padto(skb, ETH_ZLEN)) |
972 | if (skb == NULL) | ||
973 | goto out; | 972 | goto out; |
974 | lp->tx_ring[entry].length = -ETH_ZLEN; | 973 | lp->tx_ring[entry].length = -ETH_ZLEN; |
975 | } | 974 | } |
diff --git a/drivers/net/lasi_82596.c b/drivers/net/lasi_82596.c index 957888de3d7e..1ab09447baa5 100644 --- a/drivers/net/lasi_82596.c +++ b/drivers/net/lasi_82596.c | |||
@@ -1083,8 +1083,7 @@ static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1083 | skb->len, skb->data)); | 1083 | skb->len, skb->data)); |
1084 | 1084 | ||
1085 | if (length < ETH_ZLEN) { | 1085 | if (length < ETH_ZLEN) { |
1086 | skb = skb_padto(skb, ETH_ZLEN); | 1086 | if (skb_padto(skb, ETH_ZLEN)) |
1087 | if (skb == NULL) | ||
1088 | return 0; | 1087 | return 0; |
1089 | length = ETH_ZLEN; | 1088 | length = ETH_ZLEN; |
1090 | } | 1089 | } |
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index b79d6e8d3045..43fef7de8cb9 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -74,7 +74,7 @@ static void emulate_large_send_offload(struct sk_buff *skb) | |||
74 | struct iphdr *iph = skb->nh.iph; | 74 | struct iphdr *iph = skb->nh.iph; |
75 | struct tcphdr *th = (struct tcphdr*)(skb->nh.raw + (iph->ihl * 4)); | 75 | struct tcphdr *th = (struct tcphdr*)(skb->nh.raw + (iph->ihl * 4)); |
76 | unsigned int doffset = (iph->ihl + th->doff) * 4; | 76 | unsigned int doffset = (iph->ihl + th->doff) * 4; |
77 | unsigned int mtu = skb_shinfo(skb)->tso_size + doffset; | 77 | unsigned int mtu = skb_shinfo(skb)->gso_size + doffset; |
78 | unsigned int offset = 0; | 78 | unsigned int offset = 0; |
79 | u32 seq = ntohl(th->seq); | 79 | u32 seq = ntohl(th->seq); |
80 | u16 id = ntohs(iph->id); | 80 | u16 id = ntohs(iph->id); |
@@ -139,7 +139,7 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev) | |||
139 | #endif | 139 | #endif |
140 | 140 | ||
141 | #ifdef LOOPBACK_TSO | 141 | #ifdef LOOPBACK_TSO |
142 | if (skb_shinfo(skb)->tso_size) { | 142 | if (skb_shinfo(skb)->gso_size) { |
143 | BUG_ON(skb->protocol != htons(ETH_P_IP)); | 143 | BUG_ON(skb->protocol != htons(ETH_P_IP)); |
144 | BUG_ON(skb->nh.iph->protocol != IPPROTO_TCP); | 144 | BUG_ON(skb->nh.iph->protocol != IPPROTO_TCP); |
145 | 145 | ||
diff --git a/drivers/net/lp486e.c b/drivers/net/lp486e.c index 94d5ea1ce8bd..bf3f343ae715 100644 --- a/drivers/net/lp486e.c +++ b/drivers/net/lp486e.c | |||
@@ -877,8 +877,7 @@ static int i596_start_xmit (struct sk_buff *skb, struct net_device *dev) { | |||
877 | length = skb->len; | 877 | length = skb->len; |
878 | 878 | ||
879 | if (length < ETH_ZLEN) { | 879 | if (length < ETH_ZLEN) { |
880 | skb = skb_padto(skb, ETH_ZLEN); | 880 | if (skb_padto(skb, ETH_ZLEN)) |
881 | if (skb == NULL) | ||
882 | return 0; | 881 | return 0; |
883 | length = ETH_ZLEN; | 882 | length = ETH_ZLEN; |
884 | } | 883 | } |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 5a74f63618bc..dbdf189436fa 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -1879,7 +1879,7 @@ again: | |||
1879 | 1879 | ||
1880 | #ifdef NETIF_F_TSO | 1880 | #ifdef NETIF_F_TSO |
1881 | if (skb->len > (dev->mtu + ETH_HLEN)) { | 1881 | if (skb->len > (dev->mtu + ETH_HLEN)) { |
1882 | mss = skb_shinfo(skb)->tso_size; | 1882 | mss = skb_shinfo(skb)->gso_size; |
1883 | if (mss != 0) | 1883 | if (mss != 0) |
1884 | max_segments = MYRI10GE_MAX_SEND_DESC_TSO; | 1884 | max_segments = MYRI10GE_MAX_SEND_DESC_TSO; |
1885 | } | 1885 | } |
@@ -1939,8 +1939,7 @@ again: | |||
1939 | 1939 | ||
1940 | /* pad frames to at least ETH_ZLEN bytes */ | 1940 | /* pad frames to at least ETH_ZLEN bytes */ |
1941 | if (unlikely(skb->len < ETH_ZLEN)) { | 1941 | if (unlikely(skb->len < ETH_ZLEN)) { |
1942 | skb = skb_padto(skb, ETH_ZLEN); | 1942 | if (skb_padto(skb, ETH_ZLEN)) { |
1943 | if (skb == NULL) { | ||
1944 | /* The packet is gone, so we must | 1943 | /* The packet is gone, so we must |
1945 | * return 0 */ | 1944 | * return 0 */ |
1946 | mgp->stats.tx_dropped += 1; | 1945 | mgp->stats.tx_dropped += 1; |
@@ -2113,7 +2112,7 @@ abort_linearize: | |||
2113 | } | 2112 | } |
2114 | idx = (idx + 1) & tx->mask; | 2113 | idx = (idx + 1) & tx->mask; |
2115 | } while (idx != last_idx); | 2114 | } while (idx != last_idx); |
2116 | if (skb_shinfo(skb)->tso_size) { | 2115 | if (skb_shinfo(skb)->gso_size) { |
2117 | printk(KERN_ERR | 2116 | printk(KERN_ERR |
2118 | "myri10ge: %s: TSO but wanted to linearize?!?!?\n", | 2117 | "myri10ge: %s: TSO but wanted to linearize?!?!?\n", |
2119 | mgp->dev->name); | 2118 | mgp->dev->name); |
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 09b11761cdfa..ea93b8f18605 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c | |||
@@ -831,8 +831,7 @@ static int fjn_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
831 | 831 | ||
832 | if (length < ETH_ZLEN) | 832 | if (length < ETH_ZLEN) |
833 | { | 833 | { |
834 | skb = skb_padto(skb, ETH_ZLEN); | 834 | if (skb_padto(skb, ETH_ZLEN)) |
835 | if (skb == NULL) | ||
836 | return 0; | 835 | return 0; |
837 | length = ETH_ZLEN; | 836 | length = ETH_ZLEN; |
838 | } | 837 | } |
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index e80d1e3aec68..9bae77ce1314 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
@@ -1374,8 +1374,7 @@ do_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1374 | */ | 1374 | */ |
1375 | if (pktlen < ETH_ZLEN) | 1375 | if (pktlen < ETH_ZLEN) |
1376 | { | 1376 | { |
1377 | skb = skb_padto(skb, ETH_ZLEN); | 1377 | if (skb_padto(skb, ETH_ZLEN)) |
1378 | if (skb == NULL) | ||
1379 | return 0; | 1378 | return 0; |
1380 | pktlen = ETH_ZLEN; | 1379 | pktlen = ETH_ZLEN; |
1381 | } | 1380 | } |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 9945cc6b8d90..12d1cb289bb0 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -2172,7 +2172,7 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb, | |||
2172 | static inline u32 rtl8169_tso_csum(struct sk_buff *skb, struct net_device *dev) | 2172 | static inline u32 rtl8169_tso_csum(struct sk_buff *skb, struct net_device *dev) |
2173 | { | 2173 | { |
2174 | if (dev->features & NETIF_F_TSO) { | 2174 | if (dev->features & NETIF_F_TSO) { |
2175 | u32 mss = skb_shinfo(skb)->tso_size; | 2175 | u32 mss = skb_shinfo(skb)->gso_size; |
2176 | 2176 | ||
2177 | if (mss) | 2177 | if (mss) |
2178 | return LargeSend | ((mss & MSSMask) << MSSShift); | 2178 | return LargeSend | ((mss & MSSMask) << MSSShift); |
@@ -2222,8 +2222,7 @@ static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2222 | len = skb->len; | 2222 | len = skb->len; |
2223 | 2223 | ||
2224 | if (unlikely(len < ETH_ZLEN)) { | 2224 | if (unlikely(len < ETH_ZLEN)) { |
2225 | skb = skb_padto(skb, ETH_ZLEN); | 2225 | if (skb_padto(skb, ETH_ZLEN)) |
2226 | if (!skb) | ||
2227 | goto err_update_stats; | 2226 | goto err_update_stats; |
2228 | len = ETH_ZLEN; | 2227 | len = ETH_ZLEN; |
2229 | } | 2228 | } |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 11daed495b97..3defe5d4f7d3 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -3959,8 +3959,8 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3959 | txdp->Control_1 = 0; | 3959 | txdp->Control_1 = 0; |
3960 | txdp->Control_2 = 0; | 3960 | txdp->Control_2 = 0; |
3961 | #ifdef NETIF_F_TSO | 3961 | #ifdef NETIF_F_TSO |
3962 | mss = skb_shinfo(skb)->tso_size; | 3962 | mss = skb_shinfo(skb)->gso_size; |
3963 | if (mss) { | 3963 | if (skb_shinfo(skb)->gso_type == SKB_GSO_TCPV4) { |
3964 | txdp->Control_1 |= TXD_TCP_LSO_EN; | 3964 | txdp->Control_1 |= TXD_TCP_LSO_EN; |
3965 | txdp->Control_1 |= TXD_TCP_LSO_MSS(mss); | 3965 | txdp->Control_1 |= TXD_TCP_LSO_MSS(mss); |
3966 | } | 3966 | } |
@@ -3980,10 +3980,10 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3980 | } | 3980 | } |
3981 | 3981 | ||
3982 | frg_len = skb->len - skb->data_len; | 3982 | frg_len = skb->len - skb->data_len; |
3983 | if (skb_shinfo(skb)->ufo_size) { | 3983 | if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) { |
3984 | int ufo_size; | 3984 | int ufo_size; |
3985 | 3985 | ||
3986 | ufo_size = skb_shinfo(skb)->ufo_size; | 3986 | ufo_size = skb_shinfo(skb)->gso_size; |
3987 | ufo_size &= ~7; | 3987 | ufo_size &= ~7; |
3988 | txdp->Control_1 |= TXD_UFO_EN; | 3988 | txdp->Control_1 |= TXD_UFO_EN; |
3989 | txdp->Control_1 |= TXD_UFO_MSS(ufo_size); | 3989 | txdp->Control_1 |= TXD_UFO_MSS(ufo_size); |
@@ -4009,7 +4009,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) | |||
4009 | txdp->Host_Control = (unsigned long) skb; | 4009 | txdp->Host_Control = (unsigned long) skb; |
4010 | txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len); | 4010 | txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len); |
4011 | 4011 | ||
4012 | if (skb_shinfo(skb)->ufo_size) | 4012 | if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) |
4013 | txdp->Control_1 |= TXD_UFO_EN; | 4013 | txdp->Control_1 |= TXD_UFO_EN; |
4014 | 4014 | ||
4015 | frg_cnt = skb_shinfo(skb)->nr_frags; | 4015 | frg_cnt = skb_shinfo(skb)->nr_frags; |
@@ -4024,12 +4024,12 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) | |||
4024 | (sp->pdev, frag->page, frag->page_offset, | 4024 | (sp->pdev, frag->page, frag->page_offset, |
4025 | frag->size, PCI_DMA_TODEVICE); | 4025 | frag->size, PCI_DMA_TODEVICE); |
4026 | txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size); | 4026 | txdp->Control_1 = TXD_BUFFER0_SIZE(frag->size); |
4027 | if (skb_shinfo(skb)->ufo_size) | 4027 | if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) |
4028 | txdp->Control_1 |= TXD_UFO_EN; | 4028 | txdp->Control_1 |= TXD_UFO_EN; |
4029 | } | 4029 | } |
4030 | txdp->Control_1 |= TXD_GATHER_CODE_LAST; | 4030 | txdp->Control_1 |= TXD_GATHER_CODE_LAST; |
4031 | 4031 | ||
4032 | if (skb_shinfo(skb)->ufo_size) | 4032 | if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) |
4033 | frg_cnt++; /* as Txd0 was used for inband header */ | 4033 | frg_cnt++; /* as Txd0 was used for inband header */ |
4034 | 4034 | ||
4035 | tx_fifo = mac_control->tx_FIFO_start[queue]; | 4035 | tx_fifo = mac_control->tx_FIFO_start[queue]; |
@@ -4043,7 +4043,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) | |||
4043 | if (mss) | 4043 | if (mss) |
4044 | val64 |= TX_FIFO_SPECIAL_FUNC; | 4044 | val64 |= TX_FIFO_SPECIAL_FUNC; |
4045 | #endif | 4045 | #endif |
4046 | if (skb_shinfo(skb)->ufo_size) | 4046 | if (skb_shinfo(skb)->gso_type == SKB_GSO_UDPV4) |
4047 | val64 |= TX_FIFO_SPECIAL_FUNC; | 4047 | val64 |= TX_FIFO_SPECIAL_FUNC; |
4048 | writeq(val64, &tx_fifo->List_Control); | 4048 | writeq(val64, &tx_fifo->List_Control); |
4049 | 4049 | ||
diff --git a/drivers/net/seeq8005.c b/drivers/net/seeq8005.c index bcef03feb2fc..efd0f235020f 100644 --- a/drivers/net/seeq8005.c +++ b/drivers/net/seeq8005.c | |||
@@ -396,8 +396,7 @@ static int seeq8005_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
396 | unsigned char *buf; | 396 | unsigned char *buf; |
397 | 397 | ||
398 | if (length < ETH_ZLEN) { | 398 | if (length < ETH_ZLEN) { |
399 | skb = skb_padto(skb, ETH_ZLEN); | 399 | if (skb_padto(skb, ETH_ZLEN)) |
400 | if (skb == NULL) | ||
401 | return 0; | 400 | return 0; |
402 | length = ETH_ZLEN; | 401 | length = ETH_ZLEN; |
403 | } | 402 | } |
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c index 31dd3f036fa8..df39f3447655 100644 --- a/drivers/net/sis190.c +++ b/drivers/net/sis190.c | |||
@@ -1156,8 +1156,7 @@ static int sis190_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1156 | dma_addr_t mapping; | 1156 | dma_addr_t mapping; |
1157 | 1157 | ||
1158 | if (unlikely(skb->len < ETH_ZLEN)) { | 1158 | if (unlikely(skb->len < ETH_ZLEN)) { |
1159 | skb = skb_padto(skb, ETH_ZLEN); | 1159 | if (skb_padto(skb, ETH_ZLEN)) { |
1160 | if (!skb) { | ||
1161 | tp->stats.tx_dropped++; | 1160 | tp->stats.tx_dropped++; |
1162 | goto out; | 1161 | goto out; |
1163 | } | 1162 | } |
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c index 38a26df4095f..f3efbd177ae7 100644 --- a/drivers/net/sk98lin/skge.c +++ b/drivers/net/sk98lin/skge.c | |||
@@ -1525,7 +1525,7 @@ struct sk_buff *pMessage) /* pointer to send-message */ | |||
1525 | ** This is to resolve faulty padding by the HW with 0xaa bytes. | 1525 | ** This is to resolve faulty padding by the HW with 0xaa bytes. |
1526 | */ | 1526 | */ |
1527 | if (BytesSend < C_LEN_ETHERNET_MINSIZE) { | 1527 | if (BytesSend < C_LEN_ETHERNET_MINSIZE) { |
1528 | if ((pMessage = skb_padto(pMessage, C_LEN_ETHERNET_MINSIZE)) == NULL) { | 1528 | if (skb_padto(pMessage, C_LEN_ETHERNET_MINSIZE)) { |
1529 | spin_unlock_irqrestore(&pTxPort->TxDesRingLock, Flags); | 1529 | spin_unlock_irqrestore(&pTxPort->TxDesRingLock, Flags); |
1530 | return 0; | 1530 | return 0; |
1531 | } | 1531 | } |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 536dd1cf7f79..19a4a16055dc 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -2310,8 +2310,7 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev) | |||
2310 | u64 map; | 2310 | u64 map; |
2311 | unsigned long flags; | 2311 | unsigned long flags; |
2312 | 2312 | ||
2313 | skb = skb_padto(skb, ETH_ZLEN); | 2313 | if (skb_padto(skb, ETH_ZLEN)) |
2314 | if (!skb) | ||
2315 | return NETDEV_TX_OK; | 2314 | return NETDEV_TX_OK; |
2316 | 2315 | ||
2317 | if (!spin_trylock_irqsave(&skge->tx_lock, flags)) | 2316 | if (!spin_trylock_irqsave(&skge->tx_lock, flags)) |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index fba1e4d4d83d..d3577871be28 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1160,7 +1160,7 @@ static unsigned tx_le_req(const struct sk_buff *skb) | |||
1160 | count = sizeof(dma_addr_t) / sizeof(u32); | 1160 | count = sizeof(dma_addr_t) / sizeof(u32); |
1161 | count += skb_shinfo(skb)->nr_frags * count; | 1161 | count += skb_shinfo(skb)->nr_frags * count; |
1162 | 1162 | ||
1163 | if (skb_shinfo(skb)->tso_size) | 1163 | if (skb_shinfo(skb)->gso_size) |
1164 | ++count; | 1164 | ++count; |
1165 | 1165 | ||
1166 | if (skb->ip_summed == CHECKSUM_HW) | 1166 | if (skb->ip_summed == CHECKSUM_HW) |
@@ -1232,7 +1232,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) | |||
1232 | } | 1232 | } |
1233 | 1233 | ||
1234 | /* Check for TCP Segmentation Offload */ | 1234 | /* Check for TCP Segmentation Offload */ |
1235 | mss = skb_shinfo(skb)->tso_size; | 1235 | mss = skb_shinfo(skb)->gso_size; |
1236 | if (mss != 0) { | 1236 | if (mss != 0) { |
1237 | /* just drop the packet if non-linear expansion fails */ | 1237 | /* just drop the packet if non-linear expansion fails */ |
1238 | if (skb_header_cloned(skb) && | 1238 | if (skb_header_cloned(skb) && |
diff --git a/drivers/net/smc9194.c b/drivers/net/smc9194.c index 6cf16f322ad5..8b0321f1976c 100644 --- a/drivers/net/smc9194.c +++ b/drivers/net/smc9194.c | |||
@@ -523,8 +523,7 @@ static int smc_wait_to_send_packet( struct sk_buff * skb, struct net_device * de | |||
523 | length = skb->len; | 523 | length = skb->len; |
524 | 524 | ||
525 | if (length < ETH_ZLEN) { | 525 | if (length < ETH_ZLEN) { |
526 | skb = skb_padto(skb, ETH_ZLEN); | 526 | if (skb_padto(skb, ETH_ZLEN)) { |
527 | if (skb == NULL) { | ||
528 | netif_wake_queue(dev); | 527 | netif_wake_queue(dev); |
529 | return 0; | 528 | return 0; |
530 | } | 529 | } |
diff --git a/drivers/net/sonic.c b/drivers/net/sonic.c index 90b818a8de6e..cab0dd958492 100644 --- a/drivers/net/sonic.c +++ b/drivers/net/sonic.c | |||
@@ -231,8 +231,7 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
231 | 231 | ||
232 | length = skb->len; | 232 | length = skb->len; |
233 | if (length < ETH_ZLEN) { | 233 | if (length < ETH_ZLEN) { |
234 | skb = skb_padto(skb, ETH_ZLEN); | 234 | if (skb_padto(skb, ETH_ZLEN)) |
235 | if (skb == NULL) | ||
236 | return 0; | 235 | return 0; |
237 | length = ETH_ZLEN; | 236 | length = ETH_ZLEN; |
238 | } | 237 | } |
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index 9b7805be21da..c158eedc7813 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c | |||
@@ -1349,8 +1349,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev) | |||
1349 | 1349 | ||
1350 | #if defined(ZEROCOPY) && defined(HAS_BROKEN_FIRMWARE) | 1350 | #if defined(ZEROCOPY) && defined(HAS_BROKEN_FIRMWARE) |
1351 | if (skb->ip_summed == CHECKSUM_HW) { | 1351 | if (skb->ip_summed == CHECKSUM_HW) { |
1352 | skb = skb_padto(skb, (skb->len + PADDING_MASK) & ~PADDING_MASK); | 1352 | if (skb_padto(skb, (skb->len + PADDING_MASK) & ~PADDING_MASK)) |
1353 | if (skb == NULL) | ||
1354 | return NETDEV_TX_OK; | 1353 | return NETDEV_TX_OK; |
1355 | } | 1354 | } |
1356 | #endif /* ZEROCOPY && HAS_BROKEN_FIRMWARE */ | 1355 | #endif /* ZEROCOPY && HAS_BROKEN_FIRMWARE */ |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index b2ddd4522a87..e3e380f90f86 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -3780,7 +3780,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3780 | #if TG3_TSO_SUPPORT != 0 | 3780 | #if TG3_TSO_SUPPORT != 0 |
3781 | mss = 0; | 3781 | mss = 0; |
3782 | if (skb->len > (tp->dev->mtu + ETH_HLEN) && | 3782 | if (skb->len > (tp->dev->mtu + ETH_HLEN) && |
3783 | (mss = skb_shinfo(skb)->tso_size) != 0) { | 3783 | (mss = skb_shinfo(skb)->gso_size) != 0) { |
3784 | int tcp_opt_len, ip_tcp_len; | 3784 | int tcp_opt_len, ip_tcp_len; |
3785 | 3785 | ||
3786 | if (skb_header_cloned(skb) && | 3786 | if (skb_header_cloned(skb) && |
@@ -3905,7 +3905,7 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev) | |||
3905 | #if TG3_TSO_SUPPORT != 0 | 3905 | #if TG3_TSO_SUPPORT != 0 |
3906 | mss = 0; | 3906 | mss = 0; |
3907 | if (skb->len > (tp->dev->mtu + ETH_HLEN) && | 3907 | if (skb->len > (tp->dev->mtu + ETH_HLEN) && |
3908 | (mss = skb_shinfo(skb)->tso_size) != 0) { | 3908 | (mss = skb_shinfo(skb)->gso_size) != 0) { |
3909 | int tcp_opt_len, ip_tcp_len; | 3909 | int tcp_opt_len, ip_tcp_len; |
3910 | 3910 | ||
3911 | if (skb_header_cloned(skb) && | 3911 | if (skb_header_cloned(skb) && |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index a1ed2d983740..6c62d5c88268 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -490,6 +490,9 @@ static int tun_set_iff(struct file *file, struct ifreq *ifr) | |||
490 | 490 | ||
491 | err = -EINVAL; | 491 | err = -EINVAL; |
492 | 492 | ||
493 | if (!capable(CAP_NET_ADMIN)) | ||
494 | return -EPERM; | ||
495 | |||
493 | /* Set dev type */ | 496 | /* Set dev type */ |
494 | if (ifr->ifr_flags & IFF_TUN) { | 497 | if (ifr->ifr_flags & IFF_TUN) { |
495 | /* TUN device */ | 498 | /* TUN device */ |
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c index d9258d42090c..e49e8b520c28 100644 --- a/drivers/net/typhoon.c +++ b/drivers/net/typhoon.c | |||
@@ -340,7 +340,7 @@ enum state_values { | |||
340 | #endif | 340 | #endif |
341 | 341 | ||
342 | #if defined(NETIF_F_TSO) | 342 | #if defined(NETIF_F_TSO) |
343 | #define skb_tso_size(x) (skb_shinfo(x)->tso_size) | 343 | #define skb_tso_size(x) (skb_shinfo(x)->gso_size) |
344 | #define TSO_NUM_DESCRIPTORS 2 | 344 | #define TSO_NUM_DESCRIPTORS 2 |
345 | #define TSO_OFFLOAD_ON TYPHOON_OFFLOAD_TCP_SEGMENT | 345 | #define TSO_OFFLOAD_ON TYPHOON_OFFLOAD_TCP_SEGMENT |
346 | #else | 346 | #else |
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index fdc21037f6dc..c80a4f1d5f7a 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c | |||
@@ -1284,11 +1284,8 @@ static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev) | |||
1284 | /* Calculate the next Tx descriptor entry. */ | 1284 | /* Calculate the next Tx descriptor entry. */ |
1285 | entry = rp->cur_tx % TX_RING_SIZE; | 1285 | entry = rp->cur_tx % TX_RING_SIZE; |
1286 | 1286 | ||
1287 | if (skb->len < ETH_ZLEN) { | 1287 | if (skb_padto(skb, ETH_ZLEN)) |
1288 | skb = skb_padto(skb, ETH_ZLEN); | 1288 | return 0; |
1289 | if (skb == NULL) | ||
1290 | return 0; | ||
1291 | } | ||
1292 | 1289 | ||
1293 | rp->tx_skbuff[entry] = skb; | 1290 | rp->tx_skbuff[entry] = skb; |
1294 | 1291 | ||
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 879eb427607c..a915fe6c6aa5 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
@@ -924,8 +924,7 @@ static int ray_dev_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
924 | 924 | ||
925 | if (length < ETH_ZLEN) | 925 | if (length < ETH_ZLEN) |
926 | { | 926 | { |
927 | skb = skb_padto(skb, ETH_ZLEN); | 927 | if (skb_padto(skb, ETH_ZLEN)) |
928 | if (skb == NULL) | ||
929 | return 0; | 928 | return 0; |
930 | length = ETH_ZLEN; | 929 | length = ETH_ZLEN; |
931 | } | 930 | } |
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index f7724eb2fa7e..561250f73fd3 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c | |||
@@ -3194,11 +3194,8 @@ wavelan_packet_xmit(struct sk_buff * skb, | |||
3194 | * and we don't have the Ethernet specific requirement of beeing | 3194 | * and we don't have the Ethernet specific requirement of beeing |
3195 | * able to detect collisions, therefore in theory we don't really | 3195 | * able to detect collisions, therefore in theory we don't really |
3196 | * need to pad. Jean II */ | 3196 | * need to pad. Jean II */ |
3197 | if (skb->len < ETH_ZLEN) { | 3197 | if (skb_padto(skb, ETH_ZLEN)) |
3198 | skb = skb_padto(skb, ETH_ZLEN); | 3198 | return 0; |
3199 | if (skb == NULL) | ||
3200 | return 0; | ||
3201 | } | ||
3202 | 3199 | ||
3203 | wv_packet_write(dev, skb->data, skb->len); | 3200 | wv_packet_write(dev, skb->data, skb->len); |
3204 | 3201 | ||
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c index fd0f43b7db5b..ecec8e5db786 100644 --- a/drivers/net/yellowfin.c +++ b/drivers/net/yellowfin.c | |||
@@ -862,13 +862,11 @@ static int yellowfin_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
862 | /* Fix GX chipset errata. */ | 862 | /* Fix GX chipset errata. */ |
863 | if (cacheline_end > 24 || cacheline_end == 0) { | 863 | if (cacheline_end > 24 || cacheline_end == 0) { |
864 | len = skb->len + 32 - cacheline_end + 1; | 864 | len = skb->len + 32 - cacheline_end + 1; |
865 | if (len != skb->len) | 865 | if (skb_padto(skb, len)) { |
866 | skb = skb_padto(skb, len); | 866 | yp->tx_skbuff[entry] = NULL; |
867 | } | 867 | netif_wake_queue(dev); |
868 | if (skb == NULL) { | 868 | return 0; |
869 | yp->tx_skbuff[entry] = NULL; | 869 | } |
870 | netif_wake_queue(dev); | ||
871 | return 0; | ||
872 | } | 870 | } |
873 | } | 871 | } |
874 | yp->tx_skbuff[entry] = skb; | 872 | yp->tx_skbuff[entry] = skb; |
diff --git a/drivers/net/znet.c b/drivers/net/znet.c index 3ac047bc727d..a7c089df66e6 100644 --- a/drivers/net/znet.c +++ b/drivers/net/znet.c | |||
@@ -544,8 +544,7 @@ static int znet_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
544 | printk(KERN_DEBUG "%s: ZNet_send_packet.\n", dev->name); | 544 | printk(KERN_DEBUG "%s: ZNet_send_packet.\n", dev->name); |
545 | 545 | ||
546 | if (length < ETH_ZLEN) { | 546 | if (length < ETH_ZLEN) { |
547 | skb = skb_padto(skb, ETH_ZLEN); | 547 | if (skb_padto(skb, ETH_ZLEN)) |
548 | if (skb == NULL) | ||
549 | return 0; | 548 | return 0; |
550 | length = ETH_ZLEN; | 549 | length = ETH_ZLEN; |
551 | } | 550 | } |