[Intel-wired-lan] [PATCH iwl-next 3/3] virtchnl, iavf, ice, i40e: add extended generic VF capability flags
Loktionov, Aleksandr
aleksandr.loktionov at intel.com
Wed Apr 29 09:21:03 UTC 2026
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf
> Of Marcin Szycik
> Sent: Tuesday, April 28, 2026 4:37 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: netdev at vger.kernel.org; Greenwalt, Paul
> <paul.greenwalt at intel.com>; Keller, Jacob E
> <jacob.e.keller at intel.com>; Marcin Szycik
> <marcin.szycik at linux.intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel at intel.com>
> Subject: [Intel-wired-lan] [PATCH iwl-next 3/3] virtchnl, iavf, ice,
> i40e: add extended generic VF capability flags
>
> VF capability flags in struct virtchnl_vf_resource::vf_cap_flags have
> all been used up, preventing new flags from being added. Note that
> despite not all bits being defined here, they are used by out-of-tree
> releases of Intel drivers, therefore cannot be taken.
>
> virtchnl message size and structure must remain unchanged to not break
> reverse compatibility, therefore the existing virtchnl structure
> cannot be extended with additional fields (e.g. flags2). vf_cap_flags
> type cannot be changed to a larger one for the same reason.
>
> Bit 2 of vf_cap_flags was reserved for exactly this case. Its presence
> in message initially sent from VF shall now signal that there are more
> capability flags to be parsed. If the PF driver acknowledges that via
> VIRTCHNL_OP_GET_VF_RESOURCES response, the VF will send a separate
> message: VIRTCHNL_OP_GET_VF_CAPS2, containing more capability flags.
> Note: this mechanism is similar for VIRTCHNL_OP_1588_PTP_GET_CAPS.
>
> The new message supports flexible size, so more flags can be added
> without any architectural changes. Care was taken to ensure that no
> out-of-bounds reads happen in case the bitmap is shorter in one of the
> drivers.
>
> The new message includes the original 32 bits too, for consistency and
> more straightforward parsing.
>
> Signed-off-by: Marcin Szycik <marcin.szycik at linux.intel.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel at intel.com>
> Reviewed-by: Jacob Keller <jacob.e.keller at intel.com>
> ---
> drivers/net/ethernet/intel/iavf/iavf.h | 19 ++-
> .../net/ethernet/intel/ice/virt/virtchnl.h | 2 +
> include/linux/intel/virtchnl.h | 55 ++++++-
> .../ethernet/intel/i40e/i40e_virtchnl_pf.c | 84 +++++++++++
> drivers/net/ethernet/intel/iavf/iavf_main.c | 60 ++++++++
> .../net/ethernet/intel/iavf/iavf_virtchnl.c | 138
> +++++++++++++++++-
> .../net/ethernet/intel/ice/virt/allowlist.c | 6 +
> .../net/ethernet/intel/ice/virt/virtchnl.c | 86 +++++++++++
> 8 files changed, 444 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/iavf/iavf.h
> b/drivers/net/ethernet/intel/iavf/iavf.h
> index 64576cba3a01..5d812b0a52a3 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf.h
> +++ b/drivers/net/ethernet/intel/iavf/iavf.h
> @@ -343,6 +343,7 @@ struct iavf_adapter {
> #define IAVF_FLAG_AQ_GET_SUPPORTED_RXDIDS BIT_ULL(42)
> #define IAVF_FLAG_AQ_GET_PTP_CAPS BIT_ULL(43)
> #define IAVF_FLAG_AQ_SEND_PTP_CMD BIT_ULL(44)
...
> case VIRTCHNL_OP_UNKNOWN:
> default:
> dev_err(dev, "Unsupported opcode %d from VF %d\n",
> v_opcode,
> --
> 2.49.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov at intel.com>
More information about the Intel-wired-lan
mailing list