summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnxt/bnxt.c
diff options
context:
space:
mode:
authorMichael Chan2017-06-23 20:01:00 +0200
committerDavid S. Miller2017-06-23 20:48:27 +0200
commit69c149e2e39e8d66437c9034bb4926ef2c1f7c23 (patch)
tree2e8e3a4eb06b9d0272df7349a2f25a4ee4a8cdf6 /drivers/net/ethernet/broadcom/bnxt/bnxt.c
parentnet: dp83640: Avoid NULL pointer dereference. (diff)
downloadkernel-qcow2-linux-69c149e2e39e8d66437c9034bb4926ef2c1f7c23.tar.gz
kernel-qcow2-linux-69c149e2e39e8d66437c9034bb4926ef2c1f7c23.tar.xz
kernel-qcow2-linux-69c149e2e39e8d66437c9034bb4926ef2c1f7c23.zip
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: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnxt/bnxt.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 03f55daecb20..f5ba8ec1b67f 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -1301,10 +1301,11 @@ static inline struct sk_buff *bnxt_tpa_end(struct bnxt *bp,
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);
- netdev_warn(bp->dev, "TPA frags %d exceeded MAX_SKB_FRAGS %d\n",
- agg_bufs, (int)MAX_SKB_FRAGS);
+ if (agg_bufs > MAX_SKB_FRAGS)
+ netdev_warn(bp->dev, "TPA frags %d exceeded MAX_SKB_FRAGS %d\n",
+ agg_bufs, (int)MAX_SKB_FRAGS);
return NULL;
}