On Thu, Nov 26, 2026 at 06:00:55PM +0100, Georg Müller wrote:
> Linux PFs report the max frame size in max_mtu of the VF resources,
> minus 4 bytes for a port VLAN, and reject VIRTCHNL_OP_CONFIG_VSI_QUEUES
> with a larger max_pkt_size. With a port VLAN on an ice PF and an MTU of
> 9702, starting the port failed with "Failed to execute command
> VIRTCHNL_OP_CONFIG_VSI_QUEUES".
> 
> Cap the max_pkt_size sent to the PF to the reported value, like the Linux
> iavf driver does (399c98c4dc50 "iavf: Fix set max MTU size with port VLAN
> and jumbo frames"). A reported 0 is ignored. ice adds the port VLAN tag
> back on its side, so frames at the full MTU still fit.
> 
> Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
> Cc: [email protected]
> 
> Signed-off-by: Georg Müller <[email protected]>
> ---
>  drivers/net/intel/iavf/iavf_ethdev.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/intel/iavf/iavf_ethdev.c 
> b/drivers/net/intel/iavf/iavf_ethdev.c
> index 10069feae2..dd0f4cfa9a 100644
> --- a/drivers/net/intel/iavf/iavf_ethdev.c
> +++ b/drivers/net/intel/iavf/iavf_ethdev.c
> @@ -1046,6 +1046,9 @@ iavf_dev_start(struct rte_eth_dev *dev)
>       wb_on_itr = (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) 
> != 0;
>  
>       vf->max_pkt_len = dev->data->mtu + IAVF_ETH_OVERHEAD;
> +     /* the PF reports its max frame size in max_mtu, 0 if unknown */
> +     if (vf->vf_res->max_mtu != 0 && vf->vf_res->max_mtu < vf->max_pkt_len)
> +             vf->max_pkt_len = vf->vf_res->max_mtu;
>       vf->num_queue_pairs = RTE_MAX(dev->data->nb_rx_queues,
>                                     dev->data->nb_tx_queues);
>       num_queue_pairs = vf->num_queue_pairs;
> -- 

While I agree that ignoring the PF advertised limit is a problem, I don't
think this is necessarily the best way to fix things. Silently clamping the
MTU/max_pkt_len at start could lead to an app expecting one packet size to
be supported, but having a lesser one in practice.

Instead, I'd suggest that we should look to use the PF-provided length as
the max length reported by the driver to ethdev (and app) as part of the
port information. That would allow rejection of unsupported pkg lengths at
configuration time, rather than silently truncating at start.

/Bruce

Reply via email to