diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bnx2.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index d4a3dac21dcf..7a610b1b7737 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -2910,18 +2910,8 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) | |||
2910 | 2910 | ||
2911 | rx_hdr = (struct l2_fhdr *) skb->data; | 2911 | rx_hdr = (struct l2_fhdr *) skb->data; |
2912 | len = rx_hdr->l2_fhdr_pkt_len; | 2912 | len = rx_hdr->l2_fhdr_pkt_len; |
2913 | status = rx_hdr->l2_fhdr_status; | ||
2913 | 2914 | ||
2914 | if ((status = rx_hdr->l2_fhdr_status) & | ||
2915 | (L2_FHDR_ERRORS_BAD_CRC | | ||
2916 | L2_FHDR_ERRORS_PHY_DECODE | | ||
2917 | L2_FHDR_ERRORS_ALIGNMENT | | ||
2918 | L2_FHDR_ERRORS_TOO_SHORT | | ||
2919 | L2_FHDR_ERRORS_GIANT_FRAME)) { | ||
2920 | |||
2921 | bnx2_reuse_rx_skb(bp, rxr, skb, sw_ring_cons, | ||
2922 | sw_ring_prod); | ||
2923 | goto next_rx; | ||
2924 | } | ||
2925 | hdr_len = 0; | 2915 | hdr_len = 0; |
2926 | if (status & L2_FHDR_STATUS_SPLIT) { | 2916 | if (status & L2_FHDR_STATUS_SPLIT) { |
2927 | hdr_len = rx_hdr->l2_fhdr_ip_xsum; | 2917 | hdr_len = rx_hdr->l2_fhdr_ip_xsum; |
@@ -2931,6 +2921,24 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) | |||
2931 | pg_ring_used = 1; | 2921 | pg_ring_used = 1; |
2932 | } | 2922 | } |
2933 | 2923 | ||
2924 | if (unlikely(status & (L2_FHDR_ERRORS_BAD_CRC | | ||
2925 | L2_FHDR_ERRORS_PHY_DECODE | | ||
2926 | L2_FHDR_ERRORS_ALIGNMENT | | ||
2927 | L2_FHDR_ERRORS_TOO_SHORT | | ||
2928 | L2_FHDR_ERRORS_GIANT_FRAME))) { | ||
2929 | |||
2930 | bnx2_reuse_rx_skb(bp, rxr, skb, sw_ring_cons, | ||
2931 | sw_ring_prod); | ||
2932 | if (pg_ring_used) { | ||
2933 | int pages; | ||
2934 | |||
2935 | pages = PAGE_ALIGN(len - hdr_len) >> PAGE_SHIFT; | ||
2936 | |||
2937 | bnx2_reuse_rx_skb_pages(bp, rxr, NULL, pages); | ||
2938 | } | ||
2939 | goto next_rx; | ||
2940 | } | ||
2941 | |||
2934 | len -= 4; | 2942 | len -= 4; |
2935 | 2943 | ||
2936 | if (len <= bp->rx_copy_thresh) { | 2944 | if (len <= bp->rx_copy_thresh) { |