mirror of
https://github.com/opnsense/src.git
synced 2026-06-03 22:02:58 -04:00
ena: Add reset reason for corrupted RX cdescs
RX completion descriptors may sometimes contain errors due to corruption. Upon identifying such a case, the driver will trigger a reset with an explicit reset reason ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED. Approved by: cperciva (mentor) Sponsored by: Amazon, Inc. (cherry picked from commit 4af71159db3cd4a37055b2b3d982ec53703c5c3d)
This commit is contained in:
parent
189bc23fd0
commit
e445e3afde
4 changed files with 8 additions and 0 deletions
|
|
@ -390,6 +390,7 @@ struct ena_stats_dev {
|
|||
counter_u64_t invalid_state;
|
||||
counter_u64_t missing_intr;
|
||||
counter_u64_t tx_desc_malformed;
|
||||
counter_u64_t rx_desc_malformed;
|
||||
};
|
||||
|
||||
struct ena_hw_stats {
|
||||
|
|
@ -550,6 +551,7 @@ static const struct ena_reset_stats_offset resets_to_stats_offset_map[ENA_REGS_R
|
|||
ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_DRIVER_INVALID_STATE, invalid_state),
|
||||
ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_MISS_INTERRUPT, missing_intr),
|
||||
ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_TX_DESCRIPTOR_MALFORMED, tx_desc_malformed),
|
||||
ENA_RESET_STATS_ENTRY(ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED, rx_desc_malformed),
|
||||
};
|
||||
|
||||
int ena_up(struct ena_adapter *adapter);
|
||||
|
|
|
|||
|
|
@ -599,6 +599,8 @@ ena_rx_cleanup(struct ena_ring *rx_ring)
|
|||
counter_u64_add(rx_ring->rx_stats.bad_desc_num,
|
||||
1);
|
||||
reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS;
|
||||
} else if (rc == ENA_COM_FAULT) {
|
||||
reset_reason = ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED;
|
||||
} else {
|
||||
counter_u64_add(rx_ring->rx_stats.bad_req_id,
|
||||
1);
|
||||
|
|
|
|||
|
|
@ -938,6 +938,8 @@ ena_netmap_rx_frame(struct ena_netmap_ctx *ctx)
|
|||
if (rc == ENA_COM_NO_SPACE) {
|
||||
counter_u64_add(ctx->ring->rx_stats.bad_desc_num, 1);
|
||||
reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS;
|
||||
} else if (rc == ENA_COM_FAULT) {
|
||||
reset_reason = ENA_REGS_RESET_RX_DESCRIPTOR_MALFORMED;
|
||||
} else {
|
||||
counter_u64_add(ctx->ring->rx_stats.bad_req_id, 1);
|
||||
reset_reason = ENA_REGS_RESET_INV_RX_REQ_ID;
|
||||
|
|
|
|||
|
|
@ -296,6 +296,8 @@ ena_sysctl_add_stats(struct ena_adapter *adapter)
|
|||
&dev_stats->missing_intr, "Missing interrupt count");
|
||||
SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "tx_desc_malformed", CTLFLAG_RD,
|
||||
&dev_stats->tx_desc_malformed, "TX descriptors malformed count");
|
||||
SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "rx_desc_malformed", CTLFLAG_RD,
|
||||
&dev_stats->rx_desc_malformed, "RX descriptors malformed count");
|
||||
SYSCTL_ADD_COUNTER_U64(ctx, child, OID_AUTO, "total_resets", CTLFLAG_RD,
|
||||
&dev_stats->total_resets, "Total resets count");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue