The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=69bb592fa3daed00982bbdf75c3b41898e476d9b
commit 69bb592fa3daed00982bbdf75c3b41898e476d9b Author: Krzysztof Galazka <krzysztof.gala...@intel.com> AuthorDate: 2025-03-12 07:50:46 +0000 Commit: Warner Losh <i...@freebsd.org> CommitDate: 2025-07-18 19:16:17 +0000 ice(4): Fix set RSS hena virtchnl op handler Remove existing RSS HENA configuration to make sure that only config requested by VF is applied and allow VFs to disable RSS completely. Signed-off-by: Krzysztof Galazka <krzysztof.gala...@intel.com> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 --- sys/dev/ice/ice_iov.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c index 3785a6c8dd13..05393083af16 100644 --- a/sys/dev/ice/ice_iov.c +++ b/sys/dev/ice/ice_iov.c @@ -1139,17 +1139,34 @@ ice_vc_set_rss_hena_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) enum virtchnl_status_code v_status = VIRTCHNL_STATUS_SUCCESS; struct ice_vsi *vsi = vf->vsi; + MPASS(vsi != NULL); + vrh = (struct virtchnl_rss_hena *)msg_buf; - status = ice_add_avf_rss_cfg(hw, vsi->idx, vrh->hena); - if (status) { - device_printf(sc->dev, - "ice_add_avf_rss_cfg status %s, error %s\n", - ice_status_str(status), - ice_aq_str(hw->adminq.sq_last_status)); - v_status = ice_iov_err_to_virt_err(status); + /* + * Remove existing configuration to make sure only requested + * config is applied and allow VFs to disable RSS completly. + */ + status = ice_rem_vsi_rss_cfg(hw, vsi->idx); + if (vrh->hena) { + /* + * Problem with removing config is not fatal, when new one + * is requested. Warn about it but try to apply new config + * anyway. + */ + if (status) + device_printf(sc->dev, + "ice_rem_vsi_rss_cfg status %s, error %s\n", + ice_status_str(status), + ice_aq_str(hw->adminq.sq_last_status)); + status = ice_add_avf_rss_cfg(hw, vsi->idx, vrh->hena); + if (status) + device_printf(sc->dev, + "ice_add_avf_rss_cfg status %s, error %s\n", + ice_status_str(status), + ice_aq_str(hw->adminq.sq_last_status)); } - + v_status = ice_iov_err_to_virt_err(status); ice_aq_send_msg_to_vf(hw, vf->vf_num, VIRTCHNL_OP_SET_RSS_HENA, v_status, NULL, 0, NULL); }