drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c- Extension
.c- Size
- 20105 bytes
- Lines
- 704
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
net/netdev_lock.hhealth.hparams.htxrx.hdevlink.hptp.hlib/tout.h
Detected Declarations
function mlx5e_query_rq_statefunction mlx5e_wait_for_icosq_flushfunction mlx5e_reset_icosq_cc_pcfunction mlx5e_rx_reporter_err_icosq_cqe_recoverfunction mlx5e_rx_reporter_err_rq_cqe_recoverfunction mlx5e_rx_reporter_timeout_recoverfunction mlx5e_rx_reporter_recover_from_ctxfunction mlx5e_rx_reporter_recoverfunction mlx5e_reporter_icosq_diagnosefunction mlx5e_health_rq_put_sw_statefunction mlx5e_rx_reporter_build_diagnose_output_rq_commonfunction mlx5e_rx_reporter_build_diagnose_outputfunction mlx5e_rx_reporter_diagnose_generic_rqfunction mlx5e_rx_reporter_diagnose_common_ptp_configfunction mlx5e_rx_reporter_diagnose_common_configfunction mlx5e_rx_reporter_build_diagnose_output_ptp_rqfunction mlx5e_rx_reporter_diagnose_rx_res_dir_tirnsfunction mlx5e_rx_reporter_diagnose_rx_res_rss_tirnfunction mlx5e_rx_reporter_diagnose_rx_res_rss_ixfunction mlx5e_rx_reporter_diagnose_rx_res_rssfunction mlx5e_rx_reporter_diagnose_rx_resfunction mlx5e_rx_reporter_diagnose_rqsfunction mlx5e_rx_reporter_diagnosefunction mlx5e_rx_reporter_dump_icosqfunction mlx5e_rx_reporter_dump_rqfunction mlx5e_rx_reporter_dump_all_rqsfunction mlx5e_rx_reporter_dump_from_ctxfunction mlx5e_rx_reporter_dumpfunction mlx5e_reporter_rx_timeoutfunction mlx5e_reporter_rq_cqe_errfunction mlx5e_reporter_icosq_cqe_errfunction mlx5e_reporter_icosq_suspend_recoveryfunction mlx5e_reporter_icosq_resume_recoveryfunction mlx5e_reporter_rx_createfunction mlx5e_reporter_rx_destroy
Annotated Snippet
if (!found_valid_tir) {
char *tir_msg = inner ? "Inner TIRs Numbers" : "TIRs Numbers";
found_valid_tir = true;
devlink_fmsg_arr_pair_nest_start(fmsg, tir_msg);
}
devlink_fmsg_obj_nest_start(fmsg);
devlink_fmsg_string_pair_put(fmsg, "tt", mlx5_ttc_get_name(tt));
devlink_fmsg_u32_pair_put(fmsg, "tirn", mlx5e_rss_get_tirn(rss, tt, inner));
devlink_fmsg_obj_nest_end(fmsg);
}
if (found_valid_tir)
devlink_fmsg_arr_pair_nest_end(fmsg);
}
static void mlx5e_rx_reporter_diagnose_rx_res_rss_ix(struct mlx5e_rx_res *rx_res, u32 rss_idx,
struct devlink_fmsg *fmsg)
{
struct mlx5e_rss *rss = mlx5e_rx_res_rss_get(rx_res, rss_idx);
if (!rss)
return;
devlink_fmsg_obj_nest_start(fmsg);
devlink_fmsg_u32_pair_put(fmsg, "Index", rss_idx);
devlink_fmsg_u32_pair_put(fmsg, "rqtn", mlx5e_rss_get_rqtn(rss));
mlx5e_rx_reporter_diagnose_rx_res_rss_tirn(rss, false, fmsg);
if (mlx5e_rss_get_inner_ft_support(rss))
mlx5e_rx_reporter_diagnose_rx_res_rss_tirn(rss, true, fmsg);
devlink_fmsg_obj_nest_end(fmsg);
}
static void mlx5e_rx_reporter_diagnose_rx_res_rss(struct mlx5e_rx_res *rx_res,
struct devlink_fmsg *fmsg)
{
int rss_ix;
devlink_fmsg_arr_pair_nest_start(fmsg, "RSS");
for (rss_ix = 0; rss_ix < MLX5E_MAX_NUM_RSS; rss_ix++)
mlx5e_rx_reporter_diagnose_rx_res_rss_ix(rx_res, rss_ix, fmsg);
devlink_fmsg_arr_pair_nest_end(fmsg);
}
static void mlx5e_rx_reporter_diagnose_rx_res(struct mlx5e_priv *priv,
struct devlink_fmsg *fmsg)
{
struct mlx5e_rx_res *rx_res = priv->rx_res;
mlx5e_health_fmsg_named_obj_nest_start(fmsg, "RX resources");
mlx5e_rx_reporter_diagnose_rx_res_dir_tirns(rx_res, fmsg);
mlx5e_rx_reporter_diagnose_rx_res_rss(rx_res, fmsg);
mlx5e_health_fmsg_named_obj_nest_end(fmsg);
}
static void mlx5e_rx_reporter_diagnose_rqs(struct mlx5e_priv *priv, struct devlink_fmsg *fmsg)
{
struct mlx5e_ptp *ptp_ch = priv->channels.ptp;
int i;
devlink_fmsg_arr_pair_nest_start(fmsg, "RQs");
for (i = 0; i < priv->channels.num; i++) {
struct mlx5e_channel *c = priv->channels.c[i];
struct mlx5e_rq *rq;
rq = test_bit(MLX5E_CHANNEL_STATE_XSK, c->state) ?
&c->xskrq : &c->rq;
mlx5e_rx_reporter_build_diagnose_output(rq, fmsg);
}
if (ptp_ch && test_bit(MLX5E_PTP_STATE_RX, ptp_ch->state))
mlx5e_rx_reporter_build_diagnose_output_ptp_rq(&ptp_ch->rq, fmsg);
devlink_fmsg_arr_pair_nest_end(fmsg);
}
static int mlx5e_rx_reporter_diagnose(struct devlink_health_reporter *reporter,
struct devlink_fmsg *fmsg,
struct netlink_ext_ack *extack)
{
struct mlx5e_priv *priv = devlink_health_reporter_priv(reporter);
mutex_lock(&priv->state_lock);
if (!test_bit(MLX5E_STATE_OPENED, &priv->state))
goto unlock;
Annotation
- Immediate include surface: `net/netdev_lock.h`, `health.h`, `params.h`, `txrx.h`, `devlink.h`, `ptp.h`, `lib/tout.h`.
- Detected declarations: `function mlx5e_query_rq_state`, `function mlx5e_wait_for_icosq_flush`, `function mlx5e_reset_icosq_cc_pc`, `function mlx5e_rx_reporter_err_icosq_cqe_recover`, `function mlx5e_rx_reporter_err_rq_cqe_recover`, `function mlx5e_rx_reporter_timeout_recover`, `function mlx5e_rx_reporter_recover_from_ctx`, `function mlx5e_rx_reporter_recover`, `function mlx5e_reporter_icosq_diagnose`, `function mlx5e_health_rq_put_sw_state`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.