diff options
Diffstat (limited to 'drivers/net/ethernet/intel/igbvf/netdev.c')
-rw-r--r-- | drivers/net/ethernet/intel/igbvf/netdev.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c index 63c807c9b21c..edea13b0ee85 100644 --- a/drivers/net/ethernet/intel/igbvf/netdev.c +++ b/drivers/net/ethernet/intel/igbvf/netdev.c | |||
@@ -1907,7 +1907,8 @@ static void igbvf_watchdog_task(struct work_struct *work) | |||
1907 | 1907 | ||
1908 | static int igbvf_tso(struct igbvf_adapter *adapter, | 1908 | static int igbvf_tso(struct igbvf_adapter *adapter, |
1909 | struct igbvf_ring *tx_ring, | 1909 | struct igbvf_ring *tx_ring, |
1910 | struct sk_buff *skb, u32 tx_flags, u8 *hdr_len) | 1910 | struct sk_buff *skb, u32 tx_flags, u8 *hdr_len, |
1911 | __be16 protocol) | ||
1911 | { | 1912 | { |
1912 | struct e1000_adv_tx_context_desc *context_desc; | 1913 | struct e1000_adv_tx_context_desc *context_desc; |
1913 | struct igbvf_buffer *buffer_info; | 1914 | struct igbvf_buffer *buffer_info; |
@@ -1927,7 +1928,7 @@ static int igbvf_tso(struct igbvf_adapter *adapter, | |||
1927 | l4len = tcp_hdrlen(skb); | 1928 | l4len = tcp_hdrlen(skb); |
1928 | *hdr_len += l4len; | 1929 | *hdr_len += l4len; |
1929 | 1930 | ||
1930 | if (skb->protocol == htons(ETH_P_IP)) { | 1931 | if (protocol == htons(ETH_P_IP)) { |
1931 | struct iphdr *iph = ip_hdr(skb); | 1932 | struct iphdr *iph = ip_hdr(skb); |
1932 | iph->tot_len = 0; | 1933 | iph->tot_len = 0; |
1933 | iph->check = 0; | 1934 | iph->check = 0; |
@@ -1958,7 +1959,7 @@ static int igbvf_tso(struct igbvf_adapter *adapter, | |||
1958 | /* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */ | 1959 | /* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */ |
1959 | tu_cmd |= (E1000_TXD_CMD_DEXT | E1000_ADVTXD_DTYP_CTXT); | 1960 | tu_cmd |= (E1000_TXD_CMD_DEXT | E1000_ADVTXD_DTYP_CTXT); |
1960 | 1961 | ||
1961 | if (skb->protocol == htons(ETH_P_IP)) | 1962 | if (protocol == htons(ETH_P_IP)) |
1962 | tu_cmd |= E1000_ADVTXD_TUCMD_IPV4; | 1963 | tu_cmd |= E1000_ADVTXD_TUCMD_IPV4; |
1963 | tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP; | 1964 | tu_cmd |= E1000_ADVTXD_TUCMD_L4T_TCP; |
1964 | 1965 | ||
@@ -1984,7 +1985,8 @@ static int igbvf_tso(struct igbvf_adapter *adapter, | |||
1984 | 1985 | ||
1985 | static inline bool igbvf_tx_csum(struct igbvf_adapter *adapter, | 1986 | static inline bool igbvf_tx_csum(struct igbvf_adapter *adapter, |
1986 | struct igbvf_ring *tx_ring, | 1987 | struct igbvf_ring *tx_ring, |
1987 | struct sk_buff *skb, u32 tx_flags) | 1988 | struct sk_buff *skb, u32 tx_flags, |
1989 | __be16 protocol) | ||
1988 | { | 1990 | { |
1989 | struct e1000_adv_tx_context_desc *context_desc; | 1991 | struct e1000_adv_tx_context_desc *context_desc; |
1990 | unsigned int i; | 1992 | unsigned int i; |
@@ -2011,7 +2013,7 @@ static inline bool igbvf_tx_csum(struct igbvf_adapter *adapter, | |||
2011 | tu_cmd |= (E1000_TXD_CMD_DEXT | E1000_ADVTXD_DTYP_CTXT); | 2013 | tu_cmd |= (E1000_TXD_CMD_DEXT | E1000_ADVTXD_DTYP_CTXT); |
2012 | 2014 | ||
2013 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 2015 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
2014 | switch (skb->protocol) { | 2016 | switch (protocol) { |
2015 | case htons(ETH_P_IP): | 2017 | case htons(ETH_P_IP): |
2016 | tu_cmd |= E1000_ADVTXD_TUCMD_IPV4; | 2018 | tu_cmd |= E1000_ADVTXD_TUCMD_IPV4; |
2017 | if (ip_hdr(skb)->protocol == IPPROTO_TCP) | 2019 | if (ip_hdr(skb)->protocol == IPPROTO_TCP) |
@@ -2211,6 +2213,7 @@ static netdev_tx_t igbvf_xmit_frame_ring_adv(struct sk_buff *skb, | |||
2211 | u8 hdr_len = 0; | 2213 | u8 hdr_len = 0; |
2212 | int count = 0; | 2214 | int count = 0; |
2213 | int tso = 0; | 2215 | int tso = 0; |
2216 | __be16 protocol = vlan_get_protocol(skb); | ||
2214 | 2217 | ||
2215 | if (test_bit(__IGBVF_DOWN, &adapter->state)) { | 2218 | if (test_bit(__IGBVF_DOWN, &adapter->state)) { |
2216 | dev_kfree_skb_any(skb); | 2219 | dev_kfree_skb_any(skb); |
@@ -2239,13 +2242,13 @@ static netdev_tx_t igbvf_xmit_frame_ring_adv(struct sk_buff *skb, | |||
2239 | tx_flags |= (vlan_tx_tag_get(skb) << IGBVF_TX_FLAGS_VLAN_SHIFT); | 2242 | tx_flags |= (vlan_tx_tag_get(skb) << IGBVF_TX_FLAGS_VLAN_SHIFT); |
2240 | } | 2243 | } |
2241 | 2244 | ||
2242 | if (skb->protocol == htons(ETH_P_IP)) | 2245 | if (protocol == htons(ETH_P_IP)) |
2243 | tx_flags |= IGBVF_TX_FLAGS_IPV4; | 2246 | tx_flags |= IGBVF_TX_FLAGS_IPV4; |
2244 | 2247 | ||
2245 | first = tx_ring->next_to_use; | 2248 | first = tx_ring->next_to_use; |
2246 | 2249 | ||
2247 | tso = skb_is_gso(skb) ? | 2250 | tso = skb_is_gso(skb) ? |
2248 | igbvf_tso(adapter, tx_ring, skb, tx_flags, &hdr_len) : 0; | 2251 | igbvf_tso(adapter, tx_ring, skb, tx_flags, &hdr_len, protocol) : 0; |
2249 | if (unlikely(tso < 0)) { | 2252 | if (unlikely(tso < 0)) { |
2250 | dev_kfree_skb_any(skb); | 2253 | dev_kfree_skb_any(skb); |
2251 | return NETDEV_TX_OK; | 2254 | return NETDEV_TX_OK; |
@@ -2253,7 +2256,7 @@ static netdev_tx_t igbvf_xmit_frame_ring_adv(struct sk_buff *skb, | |||
2253 | 2256 | ||
2254 | if (tso) | 2257 | if (tso) |
2255 | tx_flags |= IGBVF_TX_FLAGS_TSO; | 2258 | tx_flags |= IGBVF_TX_FLAGS_TSO; |
2256 | else if (igbvf_tx_csum(adapter, tx_ring, skb, tx_flags) && | 2259 | else if (igbvf_tx_csum(adapter, tx_ring, skb, tx_flags, protocol) && |
2257 | (skb->ip_summed == CHECKSUM_PARTIAL)) | 2260 | (skb->ip_summed == CHECKSUM_PARTIAL)) |
2258 | tx_flags |= IGBVF_TX_FLAGS_CSUM; | 2261 | tx_flags |= IGBVF_TX_FLAGS_CSUM; |
2259 | 2262 | ||