mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-15 12:54:27 +00:00
mana: Fix TX CQE error handling
For an unknown TX CQE error type (probably from a newer hardware), still free the mbuf, update the queue tail, etc., otherwise the accounting will be wrong. Also, TX errors can be triggered by injecting corrupted packets, so replace the mana_err to mana_dbg logging. Reported by: NetApp MFC after: 1 week Sponsored by: Microsoft
This commit is contained in:
parent
e0dfe185cb
commit
516b505970
|
@ -137,6 +137,8 @@ struct mana_stats {
|
||||||
counter_u64_t mbuf_alloc_fail; /* rx */
|
counter_u64_t mbuf_alloc_fail; /* rx */
|
||||||
counter_u64_t alt_chg; /* tx */
|
counter_u64_t alt_chg; /* tx */
|
||||||
counter_u64_t alt_reset; /* tx */
|
counter_u64_t alt_reset; /* tx */
|
||||||
|
counter_u64_t cqe_err; /* tx */
|
||||||
|
counter_u64_t cqe_unknown_type; /* tx */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mana_txq {
|
struct mana_txq {
|
||||||
|
|
|
@ -1487,21 +1487,23 @@ mana_poll_tx_cq(struct mana_cq *cq)
|
||||||
case CQE_TX_VPORT_DISABLED:
|
case CQE_TX_VPORT_DISABLED:
|
||||||
case CQE_TX_VLAN_TAGGING_VIOLATION:
|
case CQE_TX_VLAN_TAGGING_VIOLATION:
|
||||||
sa_drop ++;
|
sa_drop ++;
|
||||||
mana_err(NULL,
|
mana_dbg(NULL,
|
||||||
"TX: txq %d CQE error %d, ntc = %d, "
|
"TX: txq %d CQE error %d, ntc = %d, "
|
||||||
"pending sends = %d: err ignored.\n",
|
"pending sends = %d: err ignored.\n",
|
||||||
txq_idx, cqe_oob->cqe_hdr.cqe_type,
|
txq_idx, cqe_oob->cqe_hdr.cqe_type,
|
||||||
next_to_complete, txq->pending_sends);
|
next_to_complete, txq->pending_sends);
|
||||||
|
counter_u64_add(txq->stats.cqe_err, 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* If the CQE type is unexpected, log an error,
|
/* If the CQE type is unknown, log a debug msg,
|
||||||
* and go through the error path.
|
* and still free the mbuf, etc.
|
||||||
*/
|
*/
|
||||||
mana_err(NULL,
|
mana_dbg(NULL,
|
||||||
"ERROR: TX: Unexpected CQE type %d: HW BUG?\n",
|
"ERROR: TX: Unknown CQE type %d\n",
|
||||||
cqe_oob->cqe_hdr.cqe_type);
|
cqe_oob->cqe_hdr.cqe_type);
|
||||||
return;
|
counter_u64_add(txq->stats.cqe_unknown_type, 1);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (txq->gdma_txq_id != completions[i].wq_num) {
|
if (txq->gdma_txq_id != completions[i].wq_num) {
|
||||||
mana_dbg(NULL,
|
mana_dbg(NULL,
|
||||||
|
|
|
@ -292,6 +292,12 @@ mana_sysctl_add_queues(struct mana_port_context *apc)
|
||||||
SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO,
|
SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO,
|
||||||
"alt_reset", CTLFLAG_RD,
|
"alt_reset", CTLFLAG_RD,
|
||||||
&tx_stats->alt_reset, "Reset to self txq");
|
&tx_stats->alt_reset, "Reset to self txq");
|
||||||
|
SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO,
|
||||||
|
"cqe_err", CTLFLAG_RD,
|
||||||
|
&tx_stats->cqe_err, "Error CQE count");
|
||||||
|
SYSCTL_ADD_COUNTER_U64(ctx, tx_list, OID_AUTO,
|
||||||
|
"cqe_unknown_type", CTLFLAG_RD,
|
||||||
|
&tx_stats->cqe_unknown_type, "Unknown CQE count");
|
||||||
|
|
||||||
/* RX stats */
|
/* RX stats */
|
||||||
rx_node = SYSCTL_ADD_NODE(ctx, queue_list, OID_AUTO,
|
rx_node = SYSCTL_ADD_NODE(ctx, queue_list, OID_AUTO,
|
||||||
|
|
Loading…
Reference in a new issue