Skip to content

Commit 730cb74

Browse files
haiyuewaanguy11
authored andcommitted
ice: Support FCS/CRC strip disable for VF
To support CRC strip enable/disable functionality, VF needs the explicit request VIRTCHNL_VF_OFFLOAD_CRC offload. Then according to crc_disable flag of Rx queue configuration information to set up the queue context. Signed-off-by: Haiyue Wang <[email protected]> Reviewed-by: Jesse Brandeburg <[email protected]> Signed-off-by: Ahmed Zaki <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 89de992 commit 730cb74

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,9 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg)
486486
if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_REQ_QUEUES)
487487
vfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_REQ_QUEUES;
488488

489+
if (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_CRC)
490+
vfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_CRC;
491+
489492
if (vf->driver_caps & VIRTCHNL_VF_CAP_ADV_LINK_SPEED)
490493
vfres->vf_cap_flags |= VIRTCHNL_VF_CAP_ADV_LINK_SPEED;
491494

@@ -1666,6 +1669,18 @@ static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
16661669
vsi->rx_rings[i]->dma = qpi->rxq.dma_ring_addr;
16671670
vsi->rx_rings[i]->count = qpi->rxq.ring_len;
16681671

1672+
if (qpi->rxq.crc_disable &&
1673+
!(vf->driver_caps & VIRTCHNL_VF_OFFLOAD_CRC)) {
1674+
goto error_param;
1675+
}
1676+
1677+
if (qpi->rxq.crc_disable)
1678+
vsi->rx_rings[q_idx]->flags |=
1679+
ICE_RX_FLAGS_CRC_STRIP_DIS;
1680+
else
1681+
vsi->rx_rings[q_idx]->flags &=
1682+
~ICE_RX_FLAGS_CRC_STRIP_DIS;
1683+
16691684
if (qpi->rxq.databuffer_size != 0 &&
16701685
(qpi->rxq.databuffer_size > ((16 * 1024) - 128) ||
16711686
qpi->rxq.databuffer_size < 1024))

0 commit comments

Comments
 (0)