Netdev List
 help / color / mirror / Atom feed
From: Joe Damato <jdamato@fastly.com>
To: Alexander Duyck <alexander.duyck@gmail.com>
Cc: netdev@vger.kernel.org, Alexander Duyck <alexanderduyck@fb.com>,
	kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com
Subject: Re: [net-next PATCH v2 07/15] eth: fbnic: Allocate a netdevice and napi vectors with queues
Date: Tue, 25 Jun 2024 17:18:34 -0400	[thread overview]
Message-ID: <Zns0Kjv02mjC-6oU@LQ3V64L9R2> (raw)
In-Reply-To: <171932616332.3072535.5928220031237925415.stgit@ahduyck-xeon-server.home.arpa>

On Tue, Jun 25, 2024 at 07:36:03AM -0700, Alexander Duyck wrote:
> From: Alexander Duyck <alexanderduyck@fb.com>

[...]

> +int fbnic_alloc_napi_vectors(struct fbnic_net *fbn)
> +{
> +	unsigned int txq_idx = 0, rxq_idx = 0, v_idx = FBNIC_NON_NAPI_VECTORS;
> +	unsigned int num_tx = fbn->num_tx_queues;
> +	unsigned int num_rx = fbn->num_rx_queues;
> +	unsigned int num_napi = fbn->num_napi;
> +	struct fbnic_dev *fbd = fbn->fbd;
> +	int err;
> +
> +	/* Allocate 1 Tx queue per napi vector */
> +	if (num_napi < FBNIC_MAX_TXQS && num_napi == num_tx + num_rx) {
> +		while (num_tx) {
> +			err = fbnic_alloc_napi_vector(fbd, fbn,
> +						      num_napi, v_idx,
> +						      1, txq_idx, 0, 0);
> +			if (err)
> +				goto free_vectors;
> +
> +			/* Update counts and index */
> +			num_tx--;
> +			txq_idx++;
> +
> +			v_idx++;
> +		}
> +	}
> +
> +	/* Allocate Tx/Rx queue pairs per vector, or allocate remaining Rx */
> +	while (num_rx | num_tx) {
> +		int tqpv = DIV_ROUND_UP(num_tx, num_napi - txq_idx);
> +		int rqpv = DIV_ROUND_UP(num_rx, num_napi - rxq_idx);
> +
> +		err = fbnic_alloc_napi_vector(fbd, fbn, num_napi, v_idx,
> +					      tqpv, txq_idx, rqpv, rxq_idx);

Mostly a nit / suggestion (and not a reason to hold this back): In
the future, adding support for netif_queue_set_napi would be great,
as would netif_napi_set_irq.

Apologies if you've already added that in a future patch that I
missed.

  reply	other threads:[~2024-06-25 21:18 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 14:35 [net-next PATCH v2 00/15] eth: fbnic: Add network driver for Meta Platforms Host Network Interface Alexander Duyck
2024-06-25 14:35 ` [net-next PATCH v2 01/15] PCI: Add Meta Platforms vendor ID Alexander Duyck
2024-06-25 14:35 ` [net-next PATCH v2 02/15] eth: fbnic: Add scaffolding for Meta's NIC driver Alexander Duyck
2024-06-26 14:16   ` Jakub Kicinski
2024-06-26 15:20     ` Alexander Duyck
2024-06-25 14:35 ` [net-next PATCH v2 03/15] eth: fbnic: Allocate core device specific structures and devlink interface Alexander Duyck
2024-06-25 14:35 ` [net-next PATCH v2 04/15] eth: fbnic: Add register init to set PCIe/Ethernet device config Alexander Duyck
2024-06-25 15:01   ` Andrew Lunn
2024-06-25 16:07     ` Alexander Duyck
2024-06-25 14:35 ` [net-next PATCH v2 05/15] eth: fbnic: Add message parsing for FW messages Alexander Duyck
2024-06-25 14:35 ` [net-next PATCH v2 06/15] eth: fbnic: Add FW communication mechanism Alexander Duyck
2024-06-25 14:36 ` [net-next PATCH v2 07/15] eth: fbnic: Allocate a netdevice and napi vectors with queues Alexander Duyck
2024-06-25 21:18   ` Joe Damato [this message]
2024-06-25 23:13     ` Alexander Duyck
2024-06-25 14:36 ` [net-next PATCH v2 08/15] eth: fbnic: Implement Tx queue alloc/start/stop/free Alexander Duyck
2024-06-25 14:36 ` [net-next PATCH v2 09/15] eth: fbnic: Implement Rx " Alexander Duyck
2024-06-28 15:14   ` Simon Horman
2024-06-28 15:36     ` Alexander Duyck
2024-06-25 14:36 ` [net-next PATCH v2 10/15] eth: fbnic: Add initial messaging to notify FW of our presence Alexander Duyck
2024-06-25 14:36 ` [net-next PATCH v2 11/15] eth: fbnic: Add link detection Alexander Duyck
2024-06-25 15:25   ` Andrew Lunn
2024-06-25 16:29     ` Alexander Duyck
2024-06-25 17:05       ` Andrew Lunn
2024-06-25 14:36 ` [net-next PATCH v2 12/15] eth: fbnic: Add basic Tx handling Alexander Duyck
2024-06-26 14:18   ` Jakub Kicinski
2024-06-25 14:36 ` [net-next PATCH v2 13/15] eth: fbnic: Add basic Rx handling Alexander Duyck
2024-06-25 14:36 ` [net-next PATCH v2 14/15] eth: fbnic: Add L2 address programming Alexander Duyck
2024-06-25 14:36 ` [net-next PATCH v2 15/15] eth: fbnic: Write the TCAM tables used for RSS control and Rx to host Alexander Duyck

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=Zns0Kjv02mjC-6oU@LQ3V64L9R2 \
    --to=jdamato@fastly.com \
    --cc=alexander.duyck@gmail.com \
    --cc=alexanderduyck@fb.com \
    --cc=davem@davemloft.net \
    --cc=kuba@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