public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: <davem@davemloft.net>, <pabeni@redhat.com>, <edumazet@google.com>,
	<andrew+netdev@lunn.ch>, <netdev@vger.kernel.org>,
	Madhu Chittim <madhu.chittim@intel.com>, <joshua.a.hay@intel.com>,
	Milena Olech <milena.olech@intel.com>,
	Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
	Samuel Salin <Samuel.salin@intel.com>
Subject: Re: [PATCH net-next 01/10] idpf: introduce local idpf structure to store virtchnl queue chunks
Date: Tue, 20 Jan 2026 11:36:53 -0800	[thread overview]
Message-ID: <52cc5ddb-cea3-4502-936e-4f8a6d45b09a@intel.com> (raw)
In-Reply-To: <20260117182523.6b6c91e7@kernel.org>



On 1/17/2026 6:25 PM, Jakub Kicinski wrote:
> On Thu, 15 Jan 2026 15:47:38 -0800 Tony Nguyen wrote:
>> +/**
>> + * idpf_queue_id_reg_chunk - individual queue ID and register chunk
> 
> missing the word struct

Oof, will fix this.

>> + * @qtail_reg_start: queue tail register offset
>> + * @qtail_reg_spacing: queue tail register spacing
>> + * @type: queue type of the queues in the chunk
>> + * @start_queue_id: starting queue ID in the chunk
>> + * @num_queues: number of queues in the chunk
>> + */
>> +struct idpf_queue_id_reg_chunk {
>> +	u64 qtail_reg_start;
>> +	u32 qtail_reg_spacing;
>> +	u32 type;
>> +	u32 start_queue_id;
>> +	u32 num_queues;
>> +};
>> +
>> +/**
>> + * idpf_queue_id_reg_info - struct to store the queue ID and register chunk
> 
> ditto

This as well.

> 
>> + *			    info received over the mailbox
>> + * @num_chunks: number of chunks
>> + * @queue_chunks: array of chunks
>> + */
>> +struct idpf_queue_id_reg_info {
>> +	u16 num_chunks;
>> +	struct idpf_queue_id_reg_chunk *queue_chunks;
>> +};
> 
>> +static int
>> +idpf_vport_init_queue_reg_chunks(struct idpf_vport_config *vport_config,
>> +				 struct virtchnl2_queue_reg_chunks *schunks)
>> +{
>> +	struct idpf_queue_id_reg_info *q_info = &vport_config->qid_reg_info;
>> +	u16 num_chunks = le16_to_cpu(schunks->num_chunks);
>> +
>> +	kfree(q_info->queue_chunks);
>> +
>> +	q_info->num_chunks = num_chunks;
> 
> AI review complains that this is set before the alloc, so if alloc
> fails the struct is in inconsistent state. I didn't check if this is
> defensive programming or the callers handle this error correctly.
> But seems easy to fix, so maybe let's?

Yep, will make the change.

Also, we'll adjust the other two in this series that the AI review 
commented on as well.

Thanks,
Tony

>> +	q_info->queue_chunks = kcalloc(num_chunks, sizeof(*q_info->queue_chunks),
>> +				       GFP_KERNEL);
>> +	if (!q_info->queue_chunks)
>> +		return -ENOMEM;
>> +
>> +	for (u16 i = 0; i < num_chunks; i++) {
>> +		struct idpf_queue_id_reg_chunk *dchunk = &q_info->queue_chunks[i];
>> +		struct virtchnl2_queue_reg_chunk *schunk = &schunks->chunks[i];
>> +
>> +		dchunk->qtail_reg_start = le64_to_cpu(schunk->qtail_reg_start);
>> +		dchunk->qtail_reg_spacing = le32_to_cpu(schunk->qtail_reg_spacing);
>> +		dchunk->type = le32_to_cpu(schunk->type);
>> +		dchunk->start_queue_id = le32_to_cpu(schunk->start_queue_id);
>> +		dchunk->num_queues = le32_to_cpu(schunk->num_queues);
>> +	}
>> +


  reply	other threads:[~2026-01-20 19:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15 23:47 [PATCH net-next 00/10][pull request] refactor IDPF resource access Tony Nguyen
2026-01-15 23:47 ` [PATCH net-next 01/10] idpf: introduce local idpf structure to store virtchnl queue chunks Tony Nguyen
2026-01-18  2:25   ` Jakub Kicinski
2026-01-20 19:36     ` Tony Nguyen [this message]
2026-01-15 23:47 ` [PATCH net-next 02/10] idpf: introduce idpf_q_vec_rsrc struct and move vector resources to it Tony Nguyen
2026-01-15 23:47 ` [PATCH net-next 03/10] idpf: move queue resources to idpf_q_vec_rsrc structure Tony Nguyen
2026-01-18  2:27   ` [net-next,03/10] " Jakub Kicinski
2026-01-15 23:47 ` [PATCH net-next 04/10] idpf: move some iterator declarations inside for loops Tony Nguyen
2026-01-15 23:47 ` [PATCH net-next 05/10] idpf: reshuffle idpf_vport struct members to avoid holes Tony Nguyen
2026-01-15 23:47 ` [PATCH net-next 06/10] idpf: add rss_data field to RSS function parameters Tony Nguyen
2026-01-15 23:47 ` [PATCH net-next 07/10] idpf: remove vport pointer from queue sets Tony Nguyen
2026-01-15 23:47 ` [PATCH net-next 08/10] idpf: generalize send virtchnl message API Tony Nguyen
2026-01-18  2:28   ` [net-next,08/10] " Jakub Kicinski
2026-01-15 23:47 ` [PATCH net-next 09/10] idpf: avoid calling get_rx_ptypes for each vport Tony Nguyen
2026-01-15 23:47 ` [PATCH net-next 10/10] idpf: generalize mailbox API Tony Nguyen

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=52cc5ddb-cea3-4502-936e-4f8a6d45b09a@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=Samuel.salin@intel.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=joshua.a.hay@intel.com \
    --cc=kuba@kernel.org \
    --cc=madhu.chittim@intel.com \
    --cc=milena.olech@intel.com \
    --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