public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Pengpeng Hou <pengpeng@iscas.ac.cn>
To: andrew+netdev@lunn.ch
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, pengpeng@iscas.ac.cn
Subject: Re: [PATCH] qed: iscsi: limit command queue array fill to the ramrod array size
Date: Fri, 27 Mar 2026 08:53:02 +0800	[thread overview]
Message-ID: <20260327005302.70741-1-pengpeng@iscas.ac.cn> (raw)
In-Reply-To: <20260324105629.61282-1-pengpeng@iscas.ac.cn>

Hi,

No, I do not think the existing feat_num-based check is sufficient here.

That check only verifies that num_queues does not exceed the iSCSI CQ
resources reported by the hardware:

    p_params->num_queues <= p_hwfn->hw_info.feat_num[QED_ISCSI_CQ]

But the ramrod field being filled afterwards is a fixed-size array:

    cq_cmdq_sb_num_arr[SCSI_MAX_NUM_OF_CMDQS]

and SCSI_MAX_NUM_OF_CMDQS is 64 in the current tree.

The in-tree qedi caller derives num_queues from the device-reported CQ
count and the online CPU count:

    dev_info.num_cqs = FEAT_NUM(hwfn, QED_ISCSI_CQ)
    num_queues = min(dev_info.num_cqs, num_online_cpus())

So the existing resource check and the ramrod array capacity are not the
same bound. If the hardware reports more than 64 iSCSI CQs, current-tree
callers can still pass a num_queues value that satisfies the feat_num
check but exceeds ARRAY_SIZE(cq_cmdq_sb_num_arr).

I can resend with this clarified in the commit message.

Best regards,
Pengpeng


      parent reply	other threads:[~2026-03-27  0:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24 10:56 [PATCH] qed: iscsi: limit command queue array fill to the ramrod array size Pengpeng Hou
2026-03-26 17:47 ` Simon Horman
2026-03-27  0:53 ` Pengpeng Hou [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260327005302.70741-1-pengpeng@iscas.ac.cn \
    --to=pengpeng@iscas.ac.cn \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox