Skip to content

Commit 399c98c

Browse files
michalx-jaronanguy11
authored andcommitted
iavf: Fix set max MTU size with port VLAN and jumbo frames
After setting port VLAN and MTU to 9000 on VF with ice driver there was an iavf error "PF returned error -5 (IAVF_ERR_PARAM) to our request 6". During queue configuration, VF's max packet size was set to IAVF_MAX_RXBUFFER but on ice max frame size was smaller by VLAN_HLEN due to making some space for port VLAN as VF is not aware whether it's in a port VLAN. This mismatch in sizes caused ice to reject queue configuration with ERR_PARAM error. Proper max_mtu is sent from ice PF to VF with GET_VF_RESOURCES msg but VF does not look at this. In iavf change max_frame from IAVF_MAX_RXBUFFER to max_mtu received from pf with GET_VF_RESOURCES msg to make vf's max_frame_size dependent from pf. Add check if received max_mtu is not in eligible range then set it to IAVF_MAX_RXBUFFER. Fixes: dab86af ("i40e/i40evf: Change the way we limit the maximum frame size for Rx") Signed-off-by: Michal Jaron <[email protected]> Signed-off-by: Mateusz Palczewski <[email protected]> Tested-by: Konrad Jankowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 66039eb commit 399c98c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/net/ethernet/intel/iavf/iavf_virtchnl.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,14 @@ int iavf_get_vf_vlan_v2_caps(struct iavf_adapter *adapter)
269269
void iavf_configure_queues(struct iavf_adapter *adapter)
270270
{
271271
struct virtchnl_vsi_queue_config_info *vqci;
272-
struct virtchnl_queue_pair_info *vqpi;
272+
int i, max_frame = adapter->vf_res->max_mtu;
273273
int pairs = adapter->num_active_queues;
274-
int i, max_frame = IAVF_MAX_RXBUFFER;
274+
struct virtchnl_queue_pair_info *vqpi;
275275
size_t len;
276276

277+
if (max_frame > IAVF_MAX_RXBUFFER || !max_frame)
278+
max_frame = IAVF_MAX_RXBUFFER;
279+
277280
if (adapter->current_op != VIRTCHNL_OP_UNKNOWN) {
278281
/* bail because we already have a command pending */
279282
dev_err(&adapter->pdev->dev, "Cannot configure queues, command %d pending\n",

0 commit comments

Comments
 (0)