Commit 69c149e2 authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

bnxt_en: Add missing logic to handle TPA end error conditions.

When we get a TPA_END completion to handle a completed LRO packet, it
is possible that hardware would indicate errors.  The current code is
not checking for the error condition.  Define the proper error bits and
the macro to check for this error and abort properly.
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent db9d8b29
...@@ -1301,8 +1301,9 @@ static inline struct sk_buff *bnxt_tpa_end(struct bnxt *bp, ...@@ -1301,8 +1301,9 @@ static inline struct sk_buff *bnxt_tpa_end(struct bnxt *bp,
cp_cons = NEXT_CMP(cp_cons); cp_cons = NEXT_CMP(cp_cons);
} }
if (unlikely(agg_bufs > MAX_SKB_FRAGS)) { if (unlikely(agg_bufs > MAX_SKB_FRAGS || TPA_END_ERRORS(tpa_end1))) {
bnxt_abort_tpa(bp, bnapi, cp_cons, agg_bufs); bnxt_abort_tpa(bp, bnapi, cp_cons, agg_bufs);
if (agg_bufs > MAX_SKB_FRAGS)
netdev_warn(bp->dev, "TPA frags %d exceeded MAX_SKB_FRAGS %d\n", netdev_warn(bp->dev, "TPA frags %d exceeded MAX_SKB_FRAGS %d\n",
agg_bufs, (int)MAX_SKB_FRAGS); agg_bufs, (int)MAX_SKB_FRAGS);
return NULL; return NULL;
......
...@@ -374,12 +374,16 @@ struct rx_tpa_end_cmp_ext { ...@@ -374,12 +374,16 @@ struct rx_tpa_end_cmp_ext {
__le32 rx_tpa_end_cmp_errors_v2; __le32 rx_tpa_end_cmp_errors_v2;
#define RX_TPA_END_CMP_V2 (0x1 << 0) #define RX_TPA_END_CMP_V2 (0x1 << 0)
#define RX_TPA_END_CMP_ERRORS (0x7fff << 1) #define RX_TPA_END_CMP_ERRORS (0x3 << 1)
#define RX_TPA_END_CMPL_ERRORS_SHIFT 1 #define RX_TPA_END_CMPL_ERRORS_SHIFT 1
u32 rx_tpa_end_cmp_start_opaque; u32 rx_tpa_end_cmp_start_opaque;
}; };
#define TPA_END_ERRORS(rx_tpa_end_ext) \
((rx_tpa_end_ext)->rx_tpa_end_cmp_errors_v2 & \
cpu_to_le32(RX_TPA_END_CMP_ERRORS))
#define DB_IDX_MASK 0xffffff #define DB_IDX_MASK 0xffffff
#define DB_IDX_VALID (0x1 << 26) #define DB_IDX_VALID (0x1 << 26)
#define DB_IRQ_DIS (0x1 << 27) #define DB_IRQ_DIS (0x1 << 27)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment