From fc66e84d6dafad36fe09df7900c4bc533d00de58 Mon Sep 17 00:00:00 2001 From: Ivan Ilchenko Date: Tue, 28 Sep 2021 14:29:06 +0300 Subject: [PATCH] net/sfc: fix missing const of SW stats descriptions Description is a global variable shared by all adapters and must not be modified. Fixes: fdd7719eb3c1 ("net/sfc: add xstats for Rx/Tx doorbells") Cc: stable@dpdk.org Signed-off-by: Ivan Ilchenko Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/sfc_sw_stats.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/sfc/sfc_sw_stats.c b/drivers/net/sfc/sfc_sw_stats.c index c297bb8294..de99e1cfaf 100644 --- a/drivers/net/sfc/sfc_sw_stats.c +++ b/drivers/net/sfc/sfc_sw_stats.c @@ -49,7 +49,7 @@ sfc_get_sw_stat_val_tx_dbells(struct sfc_adapter *sa, uint16_t qid) return 0; } -struct sfc_sw_stat_descr sfc_sw_stats_descr[] = { +const struct sfc_sw_stat_descr sfc_sw_stats_descr[] = { { .name = "dbells", .type = SFC_SW_STATS_RX, @@ -452,7 +452,8 @@ sfc_sw_xstats_get_names_by_id(struct sfc_adapter *sa, } static void -sfc_sw_xstat_reset(struct sfc_adapter *sa, struct sfc_sw_stat_descr *sw_stat, +sfc_sw_xstat_reset(struct sfc_adapter *sa, + const struct sfc_sw_stat_descr *sw_stat, uint64_t *reset_vals) { unsigned int nb_queues; @@ -483,7 +484,7 @@ void sfc_sw_xstats_reset(struct sfc_adapter *sa) { uint64_t *reset_vals = sa->sw_stats.reset_vals; - struct sfc_sw_stat_descr *sw_stat; + const struct sfc_sw_stat_descr *sw_stat; unsigned int i; SFC_ASSERT(sfc_adapter_is_locked(sa)); -- 2.20.1