Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83657
b: refs/heads/master
c: e59bd25
h: refs/heads/master
i:
  83655: 0214c16
v: v3
  • Loading branch information
Ayyappan Veeraiyan authored and Jeff Garzik committed Feb 5, 2008
1 parent 6fa4623 commit 5a32f4f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5eba3699a3b2e0d7afa0d4594980bafb1e47e2b4
refs/heads/master: e59bd25d579c143f1b93a33d3243d67abbb15abe
29 changes: 22 additions & 7 deletions trunk/drivers/net/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,25 +304,40 @@ static void ixgbe_receive_skb(struct ixgbe_adapter *adapter,
}
}

/**
* ixgbe_rx_checksum - indicate in skb if hw indicated a good cksum
* @adapter: address of board private structure
* @status_err: hardware indication of status of receive
* @skb: skb currently being received and modified
**/
static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter,
u32 status_err,
struct sk_buff *skb)
{
skb->ip_summed = CHECKSUM_NONE;

/* Ignore Checksum bit is set */
/* Ignore Checksum bit is set, or rx csum disabled */
if ((status_err & IXGBE_RXD_STAT_IXSM) ||
!(adapter->flags & IXGBE_FLAG_RX_CSUM_ENABLED))
!(adapter->flags & IXGBE_FLAG_RX_CSUM_ENABLED))
return;
/* TCP/UDP checksum error bit is set */
if (status_err & (IXGBE_RXDADV_ERR_TCPE | IXGBE_RXDADV_ERR_IPE)) {
/* let the stack verify checksum errors */

/* if IP and error */
if ((status_err & IXGBE_RXD_STAT_IPCS) &&
(status_err & IXGBE_RXDADV_ERR_IPE)) {
adapter->hw_csum_rx_error++;
return;
}

if (!(status_err & IXGBE_RXD_STAT_L4CS))
return;

if (status_err & IXGBE_RXDADV_ERR_TCPE) {
adapter->hw_csum_rx_error++;
return;
}

/* It must be a TCP or UDP packet with a valid checksum */
if (status_err & (IXGBE_RXD_STAT_L4CS | IXGBE_RXD_STAT_UDPCS))
skb->ip_summed = CHECKSUM_UNNECESSARY;
skb->ip_summed = CHECKSUM_UNNECESSARY;
adapter->hw_csum_rx_good++;
}

Expand Down

0 comments on commit 5a32f4f

Please sign in to comment.