diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2006-07-08 16:34:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-07-08 16:34:32 -0400 |
commit | 89114afd435a486deb8583e89f490fc274444d18 (patch) | |
tree | 800e784ba59755f9f3c9926a6992e1d0f5b8eec7 /drivers/net | |
parent | 9c6c6795eda34e4dc38ecac912a16b6314082beb (diff) |
[NET] gso: Add skb_is_gso
This patch adds the wrapper function skb_is_gso which can be used instead
of directly testing skb_shinfo(skb)->gso_size. This makes things a little
nicer and allows us to change the primary key for indicating whether an skb
is GSO (if we ever want to do that).
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bnx2.c | 2 | ||||
-rw-r--r-- | drivers/net/chelsio/sge.c | 2 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 7 | ||||
-rw-r--r-- | drivers/net/forcedeth.c | 2 | ||||
-rw-r--r-- | drivers/net/ixgb/ixgb_main.c | 2 | ||||
-rw-r--r-- | drivers/net/loopback.c | 2 | ||||
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 2 | ||||
-rw-r--r-- | drivers/net/sky2.c | 2 | ||||
-rw-r--r-- | drivers/net/typhoon.c | 4 |
9 files changed, 12 insertions, 13 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 64b6a72b4f6a..db73de0d2511 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -1639,7 +1639,7 @@ bnx2_tx_int(struct bnx2 *bp) | |||
1639 | skb = tx_buf->skb; | 1639 | skb = tx_buf->skb; |
1640 | #ifdef BCM_TSO | 1640 | #ifdef BCM_TSO |
1641 | /* partial BD completions possible with TSO packets */ | 1641 | /* partial BD completions possible with TSO packets */ |
1642 | if (skb_shinfo(skb)->gso_size) { | 1642 | if (skb_is_gso(skb)) { |
1643 | u16 last_idx, last_ring_idx; | 1643 | u16 last_idx, last_ring_idx; |
1644 | 1644 | ||
1645 | last_idx = sw_cons + | 1645 | last_idx = sw_cons + |
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c index 87f94d939ff8..61b3754f50ff 100644 --- a/drivers/net/chelsio/sge.c +++ b/drivers/net/chelsio/sge.c | |||
@@ -1417,7 +1417,7 @@ int t1_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1417 | struct cpl_tx_pkt *cpl; | 1417 | struct cpl_tx_pkt *cpl; |
1418 | 1418 | ||
1419 | #ifdef NETIF_F_TSO | 1419 | #ifdef NETIF_F_TSO |
1420 | if (skb_shinfo(skb)->gso_size) { | 1420 | if (skb_is_gso(skb)) { |
1421 | int eth_type; | 1421 | int eth_type; |
1422 | struct cpl_tx_pkt_lso *hdr; | 1422 | struct cpl_tx_pkt_lso *hdr; |
1423 | 1423 | ||
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index f77624f5f17b..1f34d06d01b0 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)->gso_size) { | 2397 | if (skb_is_gso(skb)) { |
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) |
@@ -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)->gso_size) { | 2522 | !skb_is_gso(skb)) { |
2523 | tx_ring->last_tx_tso = 0; | 2523 | tx_ring->last_tx_tso = 0; |
2524 | size -= 4; | 2524 | size -= 4; |
2525 | } | 2525 | } |
@@ -2806,8 +2806,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
2806 | 2806 | ||
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 && !skb_is_gso(skb)) |
2810 | !skb_shinfo(skb)->gso_size) | ||
2811 | count++; | 2810 | count++; |
2812 | #endif | 2811 | #endif |
2813 | 2812 | ||
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 037d870712ff..ad81ec68f887 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -1495,7 +1495,7 @@ 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)->gso_size) | 1498 | if (skb_is_gso(skb)) |
1499 | tx_flags_extra = NV_TX2_TSO | (skb_shinfo(skb)->gso_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 |
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index b91e082483f6..7eb08d929139 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)->gso_size)) { | 1176 | if (likely(skb_is_gso(skb))) { |
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) |
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 43fef7de8cb9..997cbce9af6e 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -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)->gso_size) { | 142 | if (skb_is_gso(skb)) { |
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/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index f4c8fd373b9b..ee1de971a712 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -2116,7 +2116,7 @@ abort_linearize: | |||
2116 | } | 2116 | } |
2117 | idx = (idx + 1) & tx->mask; | 2117 | idx = (idx + 1) & tx->mask; |
2118 | } while (idx != last_idx); | 2118 | } while (idx != last_idx); |
2119 | if (skb_shinfo(skb)->gso_size) { | 2119 | if (skb_is_gso(skb)) { |
2120 | printk(KERN_ERR | 2120 | printk(KERN_ERR |
2121 | "myri10ge: %s: TSO but wanted to linearize?!?!?\n", | 2121 | "myri10ge: %s: TSO but wanted to linearize?!?!?\n", |
2122 | mgp->dev->name); | 2122 | mgp->dev->name); |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 418f169a6a31..31093760aa1e 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1159,7 +1159,7 @@ static unsigned tx_le_req(const struct sk_buff *skb) | |||
1159 | count = sizeof(dma_addr_t) / sizeof(u32); | 1159 | count = sizeof(dma_addr_t) / sizeof(u32); |
1160 | count += skb_shinfo(skb)->nr_frags * count; | 1160 | count += skb_shinfo(skb)->nr_frags * count; |
1161 | 1161 | ||
1162 | if (skb_shinfo(skb)->gso_size) | 1162 | if (skb_is_gso(skb)) |
1163 | ++count; | 1163 | ++count; |
1164 | 1164 | ||
1165 | if (skb->ip_summed == CHECKSUM_HW) | 1165 | if (skb->ip_summed == CHECKSUM_HW) |
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c index 063816f2b11e..4103c37172f9 100644 --- a/drivers/net/typhoon.c +++ b/drivers/net/typhoon.c | |||
@@ -805,7 +805,7 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev) | |||
805 | * If problems develop with TSO, check this first. | 805 | * If problems develop with TSO, check this first. |
806 | */ | 806 | */ |
807 | numDesc = skb_shinfo(skb)->nr_frags + 1; | 807 | numDesc = skb_shinfo(skb)->nr_frags + 1; |
808 | if(skb_tso_size(skb)) | 808 | if (skb_is_gso(skb)) |
809 | numDesc++; | 809 | numDesc++; |
810 | 810 | ||
811 | /* When checking for free space in the ring, we need to also | 811 | /* When checking for free space in the ring, we need to also |
@@ -845,7 +845,7 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev) | |||
845 | TYPHOON_TX_PF_VLAN_TAG_SHIFT); | 845 | TYPHOON_TX_PF_VLAN_TAG_SHIFT); |
846 | } | 846 | } |
847 | 847 | ||
848 | if(skb_tso_size(skb)) { | 848 | if (skb_is_gso(skb)) { |
849 | first_txd->processFlags |= TYPHOON_TX_PF_TCP_SEGMENT; | 849 | first_txd->processFlags |= TYPHOON_TX_PF_TCP_SEGMENT; |
850 | first_txd->numDesc++; | 850 | first_txd->numDesc++; |
851 | 851 | ||