[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7effec89-1f94-4313-b68f-c653ee07a6b2@redhat.com>
Date: Tue, 16 Sep 2025 13:19:00 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Michael Chan <michael.chan@...adcom.com>, davem@...emloft.net
Cc: netdev@...r.kernel.org, edumazet@...gle.com, kuba@...nel.org,
andrew+netdev@...n.ch, pavan.chebbi@...adcom.com,
andrew.gospodarek@...adcom.com,
Kalesh AP <kalesh-anakkur.purayil@...adcom.com>,
Somnath Kotur <somnath.kotur@...adcom.com>
Subject: Re: [PATCH net-next 04/11] bnxt_en: Improve
bnxt_hwrm_func_backing_store_cfg_v2()
On 9/15/25 5:04 AM, Michael Chan wrote:
> Optimize the loop inside this function that sends the FW message
> to configure backing store memory for each instance of a memory
> type. It uses 2 loop counters i and j, but both counters advance
> at the same time so we can eliminate one of them.
The above statement does not look correct.
> @@ -9128,20 +9128,20 @@ static int bnxt_hwrm_func_backing_store_cfg_v2(struct bnxt *bp,
> req->subtype_valid_cnt = ctxm->split_entry_cnt;
> for (i = 0, p = &req->split_entry_0; i < ctxm->split_entry_cnt; i++)
> p[i] = cpu_to_le32(ctxm->split[i]);
> - for (i = 0, j = 0; j < n && !rc; i++) {
> + for (i = 0; i < n && !rc; i++) {
> struct bnxt_ctx_pg_info *ctx_pg;
>
> if (!(instance_bmap & (1 << i)))
> continue;
> req->instance = cpu_to_le16(i);
> - ctx_pg = &ctxm->pg_info[j++];
> + ctx_pg = &ctxm->pg_info[i];
`j` is incremented only for bit set in `instance_bmap`, AFAICS this does
not introduces functional changes only if `instance_bmap` has all the
bit set.
/P
Powered by blists - more mailing lists