Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310783
b: refs/heads/master
c: d6cb3e4
h: refs/heads/master
i:
  310781: 3824c37
  310779: 3970f10
  310775: a713da8
  310767: ee036f1
  310751: 45bdc50
  310719: 7d94017
  310655: 7d3a195
  310527: d40fcc4
  310271: 97f304f
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jun 13, 2012
1 parent a1d0c00 commit 53570ff
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 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: 954fba0274058d27c7c07b5ea07c41b3b7477894
refs/heads/master: d6cb3e41386f20fb0777d0b59a2def82c65d37f7
15 changes: 0 additions & 15 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
Original file line number Diff line number Diff line change
Expand Up @@ -747,21 +747,6 @@ struct bnx2x_fastpath {

#define ETH_RX_ERROR_FALGS ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG

#define BNX2X_IP_CSUM_ERR(cqe) \
(!((cqe)->fast_path_cqe.status_flags & \
ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG) && \
((cqe)->fast_path_cqe.type_error_flags & \
ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG))

#define BNX2X_L4_CSUM_ERR(cqe) \
(!((cqe)->fast_path_cqe.status_flags & \
ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG) && \
((cqe)->fast_path_cqe.type_error_flags & \
ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG))

#define BNX2X_RX_CSUM_OK(cqe) \
(!(BNX2X_L4_CSUM_ERR(cqe) || BNX2X_IP_CSUM_ERR(cqe)))

#define BNX2X_PRS_FLAG_OVERETH_IPV4(flags) \
(((le16_to_cpu(flags) & \
PARSING_FLAGS_OVER_ETHERNET_PROTOCOL) >> \
Expand Down
27 changes: 21 additions & 6 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,25 @@ static int bnx2x_alloc_rx_data(struct bnx2x *bp,
return 0;
}

static void bnx2x_csum_validate(struct sk_buff *skb, union eth_rx_cqe *cqe,
struct bnx2x_fastpath *fp)
{
/* Do nothing if no IP/L4 csum validation was done */

if (cqe->fast_path_cqe.status_flags &
(ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG |
ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG))
return;

/* If both IP/L4 validation were done, check if an error was found. */

if (cqe->fast_path_cqe.type_error_flags &
(ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG |
ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG))
fp->eth_q_stats.hw_csum_err++;
else
skb->ip_summed = CHECKSUM_UNNECESSARY;
}

int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
{
Expand Down Expand Up @@ -806,13 +825,9 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)

skb_checksum_none_assert(skb);

if (bp->dev->features & NETIF_F_RXCSUM) {
if (bp->dev->features & NETIF_F_RXCSUM)
bnx2x_csum_validate(skb, cqe, fp);

if (likely(BNX2X_RX_CSUM_OK(cqe)))
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
fp->eth_q_stats.hw_csum_err++;
}

skb_record_rx_queue(skb, fp->rx_queue);

Expand Down

0 comments on commit 53570ff

Please sign in to comment.