From: Zhu Yanjun <yanjun.zhu@linux.dev>
To: Tariq Toukan <ttoukan.linux@gmail.com>,
saeedm@nvidia.com, leon@kernel.org, tariqt@nvidia.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, netdev@vger.kernel.org,
linux-rdma@vger.kernel.org
Cc: Junxian Huang <huangjunxian6@hisilicon.com>
Subject: Re: [PATCHv4 net-next 1/1] net/mlx5: Fix build -Wframe-larger-than warnings
Date: Tue, 22 Jul 2025 22:53:00 -0700 [thread overview]
Message-ID: <a7f7d147-b401-4964-bec5-37786538fe11@linux.dev> (raw)
In-Reply-To: <3fb3a939-4e4c-4fb1-8bb8-d0affe06a92c@gmail.com>
在 2025/7/22 6:08, Tariq Toukan 写道:
>> + auto_desc = kvzalloc(sizeof(*auto_desc), GFP_KERNEL);
>> + if (!auto_desc)
>> + return ERR_PTR(-ENOMEM);
>
> Missing xa_erase.
It's a minor oversight. I will address it and resend the patch without
incrementing the version number.
Zhu Yanjun>
>> +
>> if (pool->irqs_per_cpu) {
>> if (cpumask_weight(&af_desc->mask) > 1)
>> /* if req_mask contain more then one CPU, set the least
>> loadad CPU
>> * of req_mask
>> */
>> cpumask_set_cpu(cpu_get_least_loaded(pool, &af_desc->mask),
>> - &auto_desc.mask);
>> + &auto_desc->mask);
>> else
>> cpu_get(pool, cpumask_first(&af_desc->mask));
>> }
>> +
>> irq = mlx5_irq_alloc(pool, irq_index,
>> - cpumask_empty(&auto_desc.mask) ? af_desc : &auto_desc,
>> + cpumask_empty(&auto_desc->mask) ? af_desc : auto_desc,
>> NULL);
>> if (IS_ERR(irq))
>> xa_erase(&pool->irqs, irq_index);
>> +
>> + kvfree(auto_desc);
>> +
>> return irq;
>> }
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c b/
>> drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
>> index 40024cfa3099..692ef9c2f729 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
>> @@ -470,26 +470,32 @@ void mlx5_ctrl_irq_release(struct mlx5_core_dev
>> *dev, struct mlx5_irq *ctrl_irq)
>> struct mlx5_irq *mlx5_ctrl_irq_request(struct mlx5_core_dev *dev)
>> {
>> struct mlx5_irq_pool *pool = ctrl_irq_pool_get(dev);
>> - struct irq_affinity_desc af_desc;
>> + struct irq_affinity_desc *af_desc;
>> struct mlx5_irq *irq;
>> - cpumask_copy(&af_desc.mask, cpu_online_mask);
>> - af_desc.is_managed = false;
>> + af_desc = kvzalloc(sizeof(*af_desc), GFP_KERNEL);
>> + if (!af_desc)
>> + return ERR_PTR(-ENOMEM);
>> +
>> + cpumask_copy(&af_desc->mask, cpu_online_mask);
>> + af_desc->is_managed = false;
>> if (!mlx5_irq_pool_is_sf_pool(pool)) {
>> /* In case we are allocating a control IRQ from a pci
>> device's pool.
>> * This can happen also for a SF if the SFs pool is empty.
>> */
>> if (!pool->xa_num_irqs.max) {
>> - cpumask_clear(&af_desc.mask);
>> + cpumask_clear(&af_desc->mask);
>> /* In case we only have a single IRQ for PF/VF */
>> - cpumask_set_cpu(cpumask_first(cpu_online_mask),
>> &af_desc.mask);
>> + cpumask_set_cpu(cpumask_first(cpu_online_mask), &af_desc-
>> >mask);
>> }
>> /* Allocate the IRQ in index 0. The vector was already
>> allocated */
>> - irq = irq_pool_request_vector(pool, 0, &af_desc, NULL);
>> + irq = irq_pool_request_vector(pool, 0, af_desc, NULL);
>> } else {
>> - irq = mlx5_irq_affinity_request(dev, pool, &af_desc);
>> + irq = mlx5_irq_affinity_request(dev, pool, af_desc);
>> }
>> + kvfree(af_desc);
>> +
>> return irq;
>> }
>> @@ -548,16 +554,26 @@ struct mlx5_irq *mlx5_irq_request_vector(struct
>> mlx5_core_dev *dev, u16 cpu,
>> {
>> struct mlx5_irq_table *table = mlx5_irq_table_get(dev);
>> struct mlx5_irq_pool *pool = table->pcif_pool;
>> - struct irq_affinity_desc af_desc;
>> int offset = MLX5_IRQ_VEC_COMP_BASE;
>> + struct irq_affinity_desc *af_desc;
>> + struct mlx5_irq *irq;
>> +
>> + af_desc = kvzalloc(sizeof(*af_desc), GFP_KERNEL);
>> + if (!af_desc)
>> + return ERR_PTR(-ENOMEM);
>> if (!pool->xa_num_irqs.max)
>> offset = 0;
>> - af_desc.is_managed = false;
>> - cpumask_clear(&af_desc.mask);
>> - cpumask_set_cpu(cpu, &af_desc.mask);
>> - return mlx5_irq_request(dev, vecidx + offset, &af_desc, rmap);
>> + af_desc->is_managed = false;
>> + cpumask_clear(&af_desc->mask);
>> + cpumask_set_cpu(cpu, &af_desc->mask);
>> +
>> + irq = mlx5_irq_request(dev, vecidx + offset, af_desc, rmap);
>> +
>> + kvfree(af_desc);
>> +
>> + return irq;
>> }
>> static struct mlx5_irq_pool *
>
next prev parent reply other threads:[~2025-07-23 5:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-22 3:13 [PATCHv4 net-next 1/1] net/mlx5: Fix build -Wframe-larger-than warnings Zhu Yanjun
2025-07-22 13:08 ` Tariq Toukan
2025-07-23 5:53 ` Zhu Yanjun [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-07-22 21:20 Zhu Yanjun
2025-07-23 5:13 ` Tariq Toukan
2025-07-25 2:00 ` patchwork-bot+netdevbpf
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=a7f7d147-b401-4964-bec5-37786538fe11@linux.dev \
--to=yanjun.zhu@linux.dev \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=huangjunxian6@hisilicon.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
--cc=ttoukan.linux@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.