From: Jakub Kicinski <kuba@kernel.org>
To: anthony.l.nguyen@intel.com
Cc: Jakub Kicinski <kuba@kernel.org>,
edumazet@google.com, davem@davemloft.net,
aleksandr.loktionov@intel.com, netdev@vger.kernel.org,
Samuel.salin@intel.com, pabeni@redhat.com,
madhu.chittim@intel.com, andrew+netdev@lunn.ch,
milena.olech@intel.com, joshua.a.hay@intel.com
Subject: Re: [net-next,08/10] idpf: generalize send virtchnl message API
Date: Sat, 17 Jan 2026 18:28:03 -0800 [thread overview]
Message-ID: <20260118022803.1106110-1-kuba@kernel.org> (raw)
In-Reply-To: <20260115234749.2365504-9-anthony.l.nguyen@intel.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
idpf: generalize send virtchnl message API
This patch changes virtchnl send message functions to take adapter and
vport_id instead of vport pointer, allowing these functions to be used
for configuring vport independent queues.
> diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
> index b937d93117c0..eb4654d3a1ff 100644
[ ... ]
> @@ -2831,8 +2844,9 @@ int idpf_send_get_stats_msg(struct idpf_vport *vport)
>
> /**
> * idpf_send_get_set_rss_lut_msg - Send virtchnl get or set RSS lut message
> - * @vport: virtual port data structure
> + * @adapter: adapter pointer used to send virtchnl message
> * @rss_data: pointer to RSS key and lut info
> + * @vport_id: vport identifier used while preparing the virtchnl message
> * @get: flag to set or get RSS look up table
> *
> * When rxhash is disabled, RSS LUT will be configured with zeros. If rxhash
> @@ -2841,18 +2855,20 @@ int idpf_send_get_stats_msg(struct idpf_vport *vport)
> *
> * Return: 0 on success, negative on failure.
> */
> -int idpf_send_get_set_rss_lut_msg(struct idpf_vport *vport,
> +int idpf_send_get_set_rss_lut_msg(struct idpf_adapter *adapter,
> struct idpf_rss_data *rss_data,
> - bool get)
> + u32 vport_id, bool get)
> {
> struct virtchnl2_rss_lut *recv_rl __free(kfree) = NULL;
> struct virtchnl2_rss_lut *rl __free(kfree) = NULL;
> struct idpf_vc_xn_params xn_params = {};
> int buf_size, lut_buf_size;
> + struct idpf_vport *vport;
> ssize_t reply_sz;
> bool rxhash_ena;
> int i;
>
> + vport = idpf_vid_to_vport(adapter, vport_id);
> rxhash_ena = idpf_is_feature_ena(vport, NETIF_F_RXHASH);
Can vport be NULL here? idpf_vid_to_vport() returns NULL if it cannot
find a matching vport_id, but idpf_is_feature_ena() dereferences
vport->netdev without a NULL check.
Other callers of idpf_vid_to_vport() in this file do check for NULL:
idpf_mac_filter_async_handler():
vport = idpf_vid_to_vport(adapter, le32_to_cpu(ma_list->vport_id));
if (!vport)
goto invalid_payload;
idpf_handle_event_link():
vport = idpf_vid_to_vport(adapter, le32_to_cpu(v2e->vport_id));
if (!vport) {
dev_err_ratelimited(...);
return;
}
Should there be a similar NULL check before calling idpf_is_feature_ena()?
next prev parent reply other threads:[~2026-01-18 2:28 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
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 ` Jakub Kicinski [this message]
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=20260118022803.1106110-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=Samuel.salin@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=joshua.a.hay@intel.com \
--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 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.