diff options
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index c814d9bfbca7..ee5ee10c918f 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -304,25 +304,40 @@ static void ixgbe_receive_skb(struct ixgbe_adapter *adapter, | |||
304 | } | 304 | } |
305 | } | 305 | } |
306 | 306 | ||
307 | /** | ||
308 | * ixgbe_rx_checksum - indicate in skb if hw indicated a good cksum | ||
309 | * @adapter: address of board private structure | ||
310 | * @status_err: hardware indication of status of receive | ||
311 | * @skb: skb currently being received and modified | ||
312 | **/ | ||
307 | static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter, | 313 | static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter, |
308 | u32 status_err, | 314 | u32 status_err, |
309 | struct sk_buff *skb) | 315 | struct sk_buff *skb) |
310 | { | 316 | { |
311 | skb->ip_summed = CHECKSUM_NONE; | 317 | skb->ip_summed = CHECKSUM_NONE; |
312 | 318 | ||
313 | /* Ignore Checksum bit is set */ | 319 | /* Ignore Checksum bit is set, or rx csum disabled */ |
314 | if ((status_err & IXGBE_RXD_STAT_IXSM) || | 320 | if ((status_err & IXGBE_RXD_STAT_IXSM) || |
315 | !(adapter->flags & IXGBE_FLAG_RX_CSUM_ENABLED)) | 321 | !(adapter->flags & IXGBE_FLAG_RX_CSUM_ENABLED)) |
316 | return; | 322 | return; |
317 | /* TCP/UDP checksum error bit is set */ | 323 | |
318 | if (status_err & (IXGBE_RXDADV_ERR_TCPE | IXGBE_RXDADV_ERR_IPE)) { | 324 | /* if IP and error */ |
319 | /* let the stack verify checksum errors */ | 325 | if ((status_err & IXGBE_RXD_STAT_IPCS) && |
326 | (status_err & IXGBE_RXDADV_ERR_IPE)) { | ||
320 | adapter->hw_csum_rx_error++; | 327 | adapter->hw_csum_rx_error++; |
321 | return; | 328 | return; |
322 | } | 329 | } |
330 | |||
331 | if (!(status_err & IXGBE_RXD_STAT_L4CS)) | ||
332 | return; | ||
333 | |||
334 | if (status_err & IXGBE_RXDADV_ERR_TCPE) { | ||
335 | adapter->hw_csum_rx_error++; | ||
336 | return; | ||
337 | } | ||
338 | |||
323 | /* It must be a TCP or UDP packet with a valid checksum */ | 339 | /* It must be a TCP or UDP packet with a valid checksum */ |
324 | if (status_err & (IXGBE_RXD_STAT_L4CS | IXGBE_RXD_STAT_UDPCS)) | 340 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
325 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
326 | adapter->hw_csum_rx_good++; | 341 | adapter->hw_csum_rx_good++; |
327 | } | 342 | } |
328 | 343 | ||