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;
--
2.56.1