mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
net: mana: Fix TX CQE error handling
[ Upstream commitb2b000069a] For an unknown TX CQE error type (probably from a newer hardware), still free the SKB, update the queue tail, etc., otherwise the accounting will be wrong. Also, TX errors can be triggered by injecting corrupted packets, so replace the WARN_ONCE to ratelimited error logging. Cc: stable@vger.kernel.org Fixes:ca9c54d2d6("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)") Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Shradha Gupta <shradhagupta@linux.microsoft.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
adc4d740ad
commit
b67d7b1bfc
@@ -1003,17 +1003,21 @@ static void mana_poll_tx_cq(struct mana_cq *cq)
|
|||||||
case CQE_TX_VPORT_IDX_OUT_OF_RANGE:
|
case CQE_TX_VPORT_IDX_OUT_OF_RANGE:
|
||||||
case CQE_TX_VPORT_DISABLED:
|
case CQE_TX_VPORT_DISABLED:
|
||||||
case CQE_TX_VLAN_TAGGING_VIOLATION:
|
case CQE_TX_VLAN_TAGGING_VIOLATION:
|
||||||
WARN_ONCE(1, "TX: CQE error %d: ignored.\n",
|
if (net_ratelimit())
|
||||||
cqe_oob->cqe_hdr.cqe_type);
|
netdev_err(ndev, "TX: CQE error %d\n",
|
||||||
|
cqe_oob->cqe_hdr.cqe_type);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* If the CQE type is unexpected, log an error, assert,
|
/* If the CQE type is unknown, log an error,
|
||||||
* and go through the error path.
|
* and still free the SKB, update tail, etc.
|
||||||
*/
|
*/
|
||||||
WARN_ONCE(1, "TX: Unexpected CQE type %d: HW BUG?\n",
|
if (net_ratelimit())
|
||||||
cqe_oob->cqe_hdr.cqe_type);
|
netdev_err(ndev, "TX: unknown CQE type %d\n",
|
||||||
return;
|
cqe_oob->cqe_hdr.cqe_type);
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WARN_ON_ONCE(txq->gdma_txq_id != completions[i].wq_num))
|
if (WARN_ON_ONCE(txq->gdma_txq_id != completions[i].wq_num))
|
||||||
|
|||||||
Reference in New Issue
Block a user