[S24,v2,07/12] ice: reject VF attempts to enable head writeback
diff mbox series

Message ID 20190729090454.5501-7-anthony.l.nguyen@intel.com
State Under Review
Delegated to: Jeff Kirsher
Headers show
Series
  • [S24,v2,01/12] ice: Allow egress control packets from PF_VSI
Related show

Commit Message

Tony Nguyen July 29, 2019, 9:04 a.m. UTC
From: Jacob Keller <jacob.e.keller@intel.com>

The virtchnl interface provides a mechanism for a VF driver to request
head writeback support. This feature is deprecated as of AVF 1.0, but
older versions of a VF driver may still attempt to request the mode.

Since the ice hardware does not support head writeback, we should not
accept Tx queue configuration which attempts to enable it.

Currently, the driver simply assumes that the headwb_enabled bit will
never be set.

If a VF driver does request head writeback, the configuration will
return successfully, even though head writeback is not enabled. This
leaves the VF driver in a non functional state since it is assuming to
be operating in head writeback mode.

Fix the PF driver to reject any attempt to setup headwb_enabled.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Bowers, AndrewX July 31, 2019, 5:11 p.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On
> Behalf Of Tony Nguyen
> Sent: Monday, July 29, 2019 2:05 AM
> To: intel-wired-lan@lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH S24 v2 07/12] ice: reject VF attempts to
> enable head writeback
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> The virtchnl interface provides a mechanism for a VF driver to request head
> writeback support. This feature is deprecated as of AVF 1.0, but older
> versions of a VF driver may still attempt to request the mode.
> 
> Since the ice hardware does not support head writeback, we should not
> accept Tx queue configuration which attempts to enable it.
> 
> Currently, the driver simply assumes that the headwb_enabled bit will never
> be set.
> 
> If a VF driver does request head writeback, the configuration will return
> successfully, even though head writeback is not enabled. This leaves the VF
> driver in a non functional state since it is assuming to be operating in head
> writeback mode.
> 
> Fix the PF driver to reject any attempt to setup headwb_enabled.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 1 +
>  1 file changed, 1 insertion(+)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>

Patch
diff mbox series

diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
index 1b1d1ea0c8f9..73ab6222d29b 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c
@@ -2109,6 +2109,7 @@  static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)
 		if (qpi->txq.vsi_id != qci->vsi_id ||
 		    qpi->rxq.vsi_id != qci->vsi_id ||
 		    qpi->rxq.queue_id != qpi->txq.queue_id ||
+		    qpi->txq.headwb_enabled ||
 		    !ice_vc_isvalid_q_id(vf, qci->vsi_id, qpi->txq.queue_id)) {
 			v_ret = VIRTCHNL_STATUS_ERR_PARAM;
 			goto error_param;