mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Joshua Washington <joshwash@google.com>, netdev@vger.kernel.org
Cc: Harshitha Ramamurthy <hramamurthy@google.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Willem de Bruijn <willemb@google.com>,
	Praveen Kaligineedi <pkaligineedi@google.com>,
	Ziwei Xiao <ziweixiao@google.com>,
	John Fraker <jfraker@google.com>, Matt Olson <maolson@google.com>,
	Bailey Forrest <bcf@google.com>,
	Tim Hostetler <thostet@google.com>,
	Jordan Rhee <jordanrhee@google.com>,
	linux-kernel@vger.kernel.org, Max Yuan <maxyuan@google.com>
Subject: Re: [PATCH net-next 1/2] gve: Update QPL page registration logic
Date: Wed, 11 Feb 2026 10:34:12 +0100	[thread overview]
Message-ID: <53ae4a20-aadc-434a-b056-65b306e64278@redhat.com> (raw)
In-Reply-To: <20260207011734.437205-2-joshwash@google.com>

On 2/7/26 2:17 AM, Joshua Washington wrote:
> +void gve_update_num_qpl_pages(struct gve_priv *priv,
> +			      struct gve_rx_alloc_rings_cfg *rx_alloc_cfg,
> +			      struct gve_tx_alloc_rings_cfg *tx_alloc_cfg)
> +{
> +	u64 ideal_tx_pages, ideal_rx_pages;
> +	u16 tx_num_queues, rx_num_queues;
> +	u64 max_pages, tx_pages;
> +
> +	if (priv->queue_format == GVE_GQI_QPL_FORMAT) {
> +		rx_alloc_cfg->pages_per_qpl = rx_alloc_cfg->ring_size;
> +	} else if (priv->queue_format == GVE_DQO_QPL_FORMAT) {
> +		/*
> +		 * We want 2 pages per RX descriptor and half a page per TX
> +		 * descriptor, which means the fraction ideal_tx_pages /
> +		 * (ideal_tx_pages + ideal_rx_pages) of the pages we allocate
> +		 * should be for TX. Shrink proportionally as necessary to avoid
> +		 * allocating more than max_registered_pages total pages.
> +		 */
> +		tx_num_queues = tx_alloc_cfg->qcfg->num_queues;
> +		rx_num_queues = rx_alloc_cfg->qcfg_rx->num_queues;
> +
> +		ideal_tx_pages = tx_alloc_cfg->ring_size * tx_num_queues / 2;
> +		ideal_rx_pages = rx_alloc_cfg->ring_size * rx_num_queues * 2;
> +		max_pages = min(priv->max_registered_pages,
> +				ideal_tx_pages + ideal_rx_pages);
> +
> +		tx_pages = (max_pages * ideal_tx_pages) /
> +			   (ideal_tx_pages + ideal_rx_pages);
> +		tx_alloc_cfg->pages_per_qpl = tx_pages / tx_num_queues;
> +		rx_alloc_cfg->pages_per_qpl = (max_pages - tx_pages) /
> +					      rx_num_queues;

Does not build on 32 bits systems:

RROR: modpost: "__udivdi3" [drivers/net/ethernet/google/gve/gve.ko]
undefined!
make[3]: *** [../scripts/Makefile.modpost:147: Module.symvers] Error 1
make[2]: *** [/srv/nipa-poller/net-next/wt-1/Makefile:2005: modpost] Error 2
make[1]: *** [/srv/nipa-poller/net-next/wt-1/Makefile:248: __sub-make]
Error 2
make: *** [Makefile:248: __sub-make] Error 2

AFAICS because above 'rx_num_queues' is implicitly promoted to u64, and
the statement yield a 64 bits division. You need to use a div64* variant
here (and possibly somewhere else, too).

/P


  reply	other threads:[~2026-02-11  9:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-07  1:17 [PATCH net-next 0/2] gve: Support larger ring sizes in DQO-QPL mode Joshua Washington
2026-02-07  1:17 ` [PATCH net-next 1/2] gve: Update QPL page registration logic Joshua Washington
2026-02-11  9:34   ` Paolo Abeni [this message]
2026-02-13 21:43   ` kernel test robot
2026-02-07  1:17 ` [PATCH net-next 2/2] gve: Enable reading max ring size from the device in DQO-QPL mode Joshua Washington

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=53ae4a20-aadc-434a-b056-65b306e64278@redhat.com \
    --to=pabeni@redhat.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bcf@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hramamurthy@google.com \
    --cc=jfraker@google.com \
    --cc=jordanrhee@google.com \
    --cc=joshwash@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maolson@google.com \
    --cc=maxyuan@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pkaligineedi@google.com \
    --cc=thostet@google.com \
    --cc=willemb@google.com \
    --cc=ziweixiao@google.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

all inboxes | Powered by JetHome®