From: Jakub Kicinski <kuba@kernel.org>
To: Nelson Escobar via B4 Relay <devnull+neescoba.cisco.com@kernel.org>
Cc: neescoba@cisco.com, John Daley <johndale@cisco.com>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Christian Benvenuti <benve@cisco.com>,
Satish Kharat <satishkh@cisco.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Simon Horman <horms@kernel.org>
Subject: Re: [PATCH net-next v2 5/5] enic: Adjust used MSI-X wq/rq/cq/interrupt resources in a more robust way
Date: Thu, 31 Oct 2024 18:19:09 -0700 [thread overview]
Message-ID: <20241031181909.4f12b240@kernel.org> (raw)
In-Reply-To: <20241024-remove_vic_resource_limits-v2-5-039b8cae5fdd@cisco.com>
On Thu, 24 Oct 2024 18:19:47 -0700 Nelson Escobar via B4 Relay wrote:
> To accomplish this do the following:
> - Make enic_set_intr_mode() only set up interrupt related stuff.
> - Move resource adjustment out of enic_set_intr_mode() into its own
> function, and basing the resources used on the most constrained
> resource.
> - Move the kdump resources limitations into the new function too.
Please try to split the pure code moves / refactors to separate
commits, this change is quite hard to review.
> + case VNIC_DEV_INTR_MODE_MSIX:
> + /* Adjust the number of wqs/rqs/cqs/interrupts that will be
> + * used based on which resource is the most constrained
> + */
> + wq_avail = min(enic->wq_avail, ENIC_WQ_MAX);
> + rq_avail = min(enic->rq_avail, ENIC_RQ_MAX);
> + max_queues = min(enic->cq_avail,
> + enic->intr_avail - ENIC_MSIX_RESERVED_INTR);
> + if (wq_avail + rq_avail <= max_queues) {
> + /* we have enough cq and interrupt resources to cover
> + * the number of wqs and rqs
> + */
> + enic->rq_count = rq_avail;
> + enic->wq_count = wq_avail;
> + } else {
> + /* recalculate wq/rq count */
> + if (rq_avail < wq_avail) {
> + enic->rq_count = min(rq_avail, max_queues / 2);
> + enic->wq_count = max_queues - enic->rq_count;
> + } else {
> + enic->wq_count = min(wq_avail, max_queues / 2);
> + enic->rq_count = max_queues - enic->wq_count;
> + }
> + }
I don't see netif_get_num_default_rss_queues() being used and you're
now moving into the "serious queue count" territory. Please cap the
default number of allocated Rx rings to what the helper returns.
--
pw-bot: cr
prev parent reply other threads:[~2024-11-01 1:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-25 1:19 [PATCH net-next v2 0/5] enic: Use all the resources configured on VIC Nelson Escobar via B4 Relay
2024-10-25 1:19 ` [PATCH net-next v2 1/5] enic: Create enic_wq/rq structures to bundle per wq/rq data Nelson Escobar via B4 Relay
2024-10-25 1:19 ` [PATCH net-next v2 2/5] enic: Make MSI-X I/O interrupts come after the other required ones Nelson Escobar via B4 Relay
2024-10-25 1:19 ` [PATCH net-next v2 3/5] enic: Save resource counts we read from HW Nelson Escobar via B4 Relay
2024-10-25 1:19 ` [PATCH net-next v2 4/5] enic: Allocate arrays in enic struct based on VIC config Nelson Escobar via B4 Relay
2024-10-25 1:19 ` [PATCH net-next v2 5/5] enic: Adjust used MSI-X wq/rq/cq/interrupt resources in a more robust way Nelson Escobar via B4 Relay
2024-11-01 1:19 ` Jakub Kicinski [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=20241031181909.4f12b240@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=benve@cisco.com \
--cc=davem@davemloft.net \
--cc=devnull+neescoba.cisco.com@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=johndale@cisco.com \
--cc=linux-kernel@vger.kernel.org \
--cc=neescoba@cisco.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=satishkh@cisco.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;
as well as URLs for NNTP newsgroup(s).