Skip to contentSkip to conversation

rte_cpu_to_le_32 nit in drivers/net/bnxt/bnxt_hwrm.c

DISCUSSION Vita Batrla 2 participants 2 messages Feb 28, 2023

lore
Share & tools
lore
#0 lore raw

Hi all,

I don't know where to report this nit. It's not a real bug and I don't want to even send a patch for it. I'm looking if someone could just fix it in the source code. Here's the problem:

drivers/net/bnxt/bnxt_hwrm.c

	if (enables & HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_STAT) {
		ctx_pg = &ctx->stat_mem;
		req.stat_num_entries = rte_cpu_to_le_16(ctx->stat_max_entries);

^ this line should be rte_cpu_to_le_32, see [1] for reason

		req.stat_entry_size = rte_cpu_to_le_16(ctx->stat_entry_size);
		bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem,
				      &req.stat_pg_size_stat_lvl,
				      &req.stat_page_dir);
	}

I hope that bnxt driver maintainer can pick it from here or please forward this email to him/her. Thanks in advance,

Vita

[1] Both stat_num_entries and stat_max_entries are defined as uint32_t in header file drivers/net/bnxt/hsi_struct_def_dpdk.h, see:

/* Number of Stats. */
uint32_t stat_num_entries;

...

/* Maximum number of statistic context entries supported for this function. */
uint32_t stat_max_entries;

#1 lore raw
Quoted 15 lines · Vita Batrla

Hi all,

I don't know where to report this nit. It's not a real bug and I don't want to even send a patch for it. I'm looking if someone could just fix it in the source code. Here's the problem:

drivers/net/bnxt/bnxt_hwrm.c

        if (enables & HWRM_FUNC_BACKING_STORE_CFG_INPUT_ENABLES_STAT) {
                ctx_pg = &ctx->stat_mem;
                req.stat_num_entries = rte_cpu_to_le_16(ctx->stat_max_entries);

^ this line should be rte_cpu_to_le_32, see [1] for reason

Quoted 8 lines
                req.stat_entry_size = rte_cpu_to_le_16(ctx->stat_entry_size);
                bnxt_hwrm_set_pg_attr(&ctx_pg->ring_mem,
                                      &req.stat_pg_size_stat_lvl,
                                      &req.stat_page_dir);
        }

I hope that bnxt driver maintainer can pick it from here or please forward this email to him/her. Thanks in advance,

Yes, what you have pointed out is correct. Thanks for bringing it to our attention

Quoted 13 lines

Vita

[1] Both stat_num_entries and stat_max_entries are defined as uint32_t in header file drivers/net/bnxt/hsi_struct_def_dpdk.h, see:

/* Number of Stats. */
uint32_t stat_num_entries;

...

/* Maximum number of statistic context entries supported for this function. */
uint32_t stat_max_entries;