aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_main.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c42
1 files changed, 17 insertions, 25 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index a215350c1969..41aede55233e 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3213,8 +3213,8 @@ static int ixgbe_tso(struct ixgbe_adapter *adapter,
3213 unsigned int i; 3213 unsigned int i;
3214 int err; 3214 int err;
3215 struct ixgbe_tx_buffer *tx_buffer_info; 3215 struct ixgbe_tx_buffer *tx_buffer_info;
3216 u32 vlan_macip_lens = 0, type_tucmd_mlhl = 0; 3216 u32 vlan_macip_lens = 0, type_tucmd_mlhl;
3217 u32 mss_l4len_idx = 0, l4len; 3217 u32 mss_l4len_idx, l4len;
3218 3218
3219 if (skb_is_gso(skb)) { 3219 if (skb_is_gso(skb)) {
3220 if (skb_header_cloned(skb)) { 3220 if (skb_header_cloned(skb)) {
@@ -3263,7 +3263,7 @@ static int ixgbe_tso(struct ixgbe_adapter *adapter,
3263 context_desc->seqnum_seed = 0; 3263 context_desc->seqnum_seed = 0;
3264 3264
3265 /* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */ 3265 /* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */
3266 type_tucmd_mlhl |= (IXGBE_TXD_CMD_DEXT | 3266 type_tucmd_mlhl = (IXGBE_TXD_CMD_DEXT |
3267 IXGBE_ADVTXD_DTYP_CTXT); 3267 IXGBE_ADVTXD_DTYP_CTXT);
3268 3268
3269 if (skb->protocol == htons(ETH_P_IP)) 3269 if (skb->protocol == htons(ETH_P_IP))
@@ -3272,7 +3272,7 @@ static int ixgbe_tso(struct ixgbe_adapter *adapter,
3272 context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd_mlhl); 3272 context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd_mlhl);
3273 3273
3274 /* MSS L4LEN IDX */ 3274 /* MSS L4LEN IDX */
3275 mss_l4len_idx |= 3275 mss_l4len_idx =
3276 (skb_shinfo(skb)->gso_size << IXGBE_ADVTXD_MSS_SHIFT); 3276 (skb_shinfo(skb)->gso_size << IXGBE_ADVTXD_MSS_SHIFT);
3277 mss_l4len_idx |= (l4len << IXGBE_ADVTXD_L4LEN_SHIFT); 3277 mss_l4len_idx |= (l4len << IXGBE_ADVTXD_L4LEN_SHIFT);
3278 /* use index 1 for TSO */ 3278 /* use index 1 for TSO */
@@ -3330,14 +3330,12 @@ static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter,
3330 type_tucmd_mlhl |= 3330 type_tucmd_mlhl |=
3331 IXGBE_ADVTXD_TUCMD_L4T_TCP; 3331 IXGBE_ADVTXD_TUCMD_L4T_TCP;
3332 break; 3332 break;
3333
3334 case __constant_htons(ETH_P_IPV6): 3333 case __constant_htons(ETH_P_IPV6):
3335 /* XXX what about other V6 headers?? */ 3334 /* XXX what about other V6 headers?? */
3336 if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) 3335 if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP)
3337 type_tucmd_mlhl |= 3336 type_tucmd_mlhl |=
3338 IXGBE_ADVTXD_TUCMD_L4T_TCP; 3337 IXGBE_ADVTXD_TUCMD_L4T_TCP;
3339 break; 3338 break;
3340
3341 default: 3339 default:
3342 if (unlikely(net_ratelimit())) { 3340 if (unlikely(net_ratelimit())) {
3343 DPRINTK(PROBE, WARNING, 3341 DPRINTK(PROBE, WARNING,
@@ -3354,6 +3352,7 @@ static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter,
3354 3352
3355 tx_buffer_info->time_stamp = jiffies; 3353 tx_buffer_info->time_stamp = jiffies;
3356 tx_buffer_info->next_to_watch = i; 3354 tx_buffer_info->next_to_watch = i;
3355
3357 adapter->hw_csum_tx_good++; 3356 adapter->hw_csum_tx_good++;
3358 i++; 3357 i++;
3359 if (i == tx_ring->count) 3358 if (i == tx_ring->count)
@@ -3362,6 +3361,7 @@ static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter,
3362 3361
3363 return true; 3362 return true;
3364 } 3363 }
3364
3365 return false; 3365 return false;
3366} 3366}
3367 3367
@@ -3533,43 +3533,35 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
3533{ 3533{
3534 struct ixgbe_adapter *adapter = netdev_priv(netdev); 3534 struct ixgbe_adapter *adapter = netdev_priv(netdev);
3535 struct ixgbe_ring *tx_ring; 3535 struct ixgbe_ring *tx_ring;
3536 unsigned int len = skb->len;
3537 unsigned int first; 3536 unsigned int first;
3538 unsigned int tx_flags = 0; 3537 unsigned int tx_flags = 0;
3539 u8 hdr_len = 0; 3538 u8 hdr_len = 0;
3540 int r_idx = 0, tso; 3539 int r_idx = 0, tso;
3541 unsigned int mss = 0;
3542 int count = 0; 3540 int count = 0;
3543 unsigned int f; 3541 unsigned int f;
3544 unsigned int nr_frags = skb_shinfo(skb)->nr_frags; 3542
3545 len -= skb->data_len;
3546 r_idx = (adapter->num_tx_queues - 1) & skb->queue_mapping; 3543 r_idx = (adapter->num_tx_queues - 1) & skb->queue_mapping;
3547 tx_ring = &adapter->tx_ring[r_idx]; 3544 tx_ring = &adapter->tx_ring[r_idx];
3548 3545
3549 3546 if (adapter->vlgrp && vlan_tx_tag_present(skb)) {
3550 if (skb->len <= 0) { 3547 tx_flags |= vlan_tx_tag_get(skb);
3551 dev_kfree_skb(skb); 3548 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT;
3552 return NETDEV_TX_OK; 3549 tx_flags |= IXGBE_TX_FLAGS_VLAN;
3553 } 3550 }
3554 mss = skb_shinfo(skb)->gso_size; 3551 /* three things can cause us to need a context descriptor */
3555 3552 if (skb_is_gso(skb) ||
3556 if (mss) 3553 (skb->ip_summed == CHECKSUM_PARTIAL) ||
3557 count++; 3554 (tx_flags & IXGBE_TX_FLAGS_VLAN))
3558 else if (skb->ip_summed == CHECKSUM_PARTIAL)
3559 count++; 3555 count++;
3560 3556
3561 count += TXD_USE_COUNT(len); 3557 count += TXD_USE_COUNT(skb_headlen(skb));
3562 for (f = 0; f < nr_frags; f++) 3558 for (f = 0; f < skb_shinfo(skb)->nr_frags; f++)
3563 count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size); 3559 count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size);
3564 3560
3565 if (ixgbe_maybe_stop_tx(netdev, tx_ring, count)) { 3561 if (ixgbe_maybe_stop_tx(netdev, tx_ring, count)) {
3566 adapter->tx_busy++; 3562 adapter->tx_busy++;
3567 return NETDEV_TX_BUSY; 3563 return NETDEV_TX_BUSY;
3568 } 3564 }
3569 if (adapter->vlgrp && vlan_tx_tag_present(skb)) {
3570 tx_flags |= IXGBE_TX_FLAGS_VLAN;
3571 tx_flags |= (vlan_tx_tag_get(skb) << IXGBE_TX_FLAGS_VLAN_SHIFT);
3572 }
3573 3565
3574 if (skb->protocol == htons(ETH_P_IP)) 3566 if (skb->protocol == htons(ETH_P_IP))
3575 tx_flags |= IXGBE_TX_FLAGS_IPV4; 3567 tx_flags |= IXGBE_TX_FLAGS_IPV4;