Skip to content

Commit c7cb9df

Browse files
Marcin Szycikanguy11
authored andcommitted
ice: Fix configuring VIRTCHNL_OP_CONFIG_VSI_QUEUES with unbalanced queues
Currently the VIRTCHNL_OP_CONFIG_VSI_QUEUES command may fail if there are less RX queues than TX queues requested. To fix it, only configure RXDID if RX queue exists. Fixes: e753df8 ("ice: Add support Flex RXD") Signed-off-by: Marcin Szycik <[email protected]> Tested-by: Konrad Jankowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 288ecf4 commit c7cb9df

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

drivers/net/ethernet/intel/ice/ice_virtchnl.c

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,9 +1621,6 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
16211621
}
16221622

16231623
for (i = 0; i < qci->num_queue_pairs; i++) {
1624-
struct ice_hw *hw;
1625-
u32 rxdid;
1626-
u16 pf_q;
16271624
qpi = &qci->qpair[i];
16281625
if (qpi->txq.vsi_id != qci->vsi_id ||
16291626
qpi->rxq.vsi_id != qci->vsi_id ||
@@ -1664,6 +1661,7 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
16641661
/* copy Rx queue info from VF into VSI */
16651662
if (qpi->rxq.ring_len > 0) {
16661663
u16 max_frame_size = ice_vc_get_max_frame_size(vf);
1664+
u32 rxdid;
16671665

16681666
vsi->rx_rings[i]->dma = qpi->rxq.dma_ring_addr;
16691667
vsi->rx_rings[i]->count = qpi->rxq.ring_len;
@@ -1691,26 +1689,25 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
16911689
vf->vf_id, i);
16921690
goto error_param;
16931691
}
1694-
}
16951692

1696-
/* VF Rx queue RXDID configuration */
1697-
pf_q = vsi->rxq_map[qpi->rxq.queue_id];
1698-
rxdid = qpi->rxq.rxdid;
1699-
hw = &vsi->back->hw;
1693+
/* If Rx flex desc is supported, select RXDID for Rx
1694+
* queues. Otherwise, use legacy 32byte descriptor
1695+
* format. Legacy 16byte descriptor is not supported.
1696+
* If this RXDID is selected, return error.
1697+
*/
1698+
if (vf->driver_caps &
1699+
VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) {
1700+
rxdid = qpi->rxq.rxdid;
1701+
if (!(BIT(rxdid) & pf->supported_rxdids))
1702+
goto error_param;
1703+
} else {
1704+
rxdid = ICE_RXDID_LEGACY_1;
1705+
}
17001706

1701-
/* If Rx flex desc is supported, select RXDID for Rx queues.
1702-
* Otherwise, use legacy 32byte descriptor format.
1703-
* Legacy 16byte descriptor is not supported. If this RXDID
1704-
* is selected, return error.
1705-
*/
1706-
if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC) {
1707-
if (!(BIT(rxdid) & pf->supported_rxdids))
1708-
goto error_param;
1709-
} else {
1710-
rxdid = ICE_RXDID_LEGACY_1;
1707+
ice_write_qrxflxp_cntxt(&vsi->back->hw,
1708+
vsi->rxq_map[q_idx],
1709+
rxdid, 0x03, false);
17111710
}
1712-
1713-
ice_write_qrxflxp_cntxt(hw, pf_q, rxdid, 0x03, false);
17141711
}
17151712

17161713
/* send the response to the VF */

0 commit comments

Comments
 (0)