Patch "ice: Fix ice_cfg_rdma_fltr() to only update relevant fields" has been added to the 6.2-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ice: Fix ice_cfg_rdma_fltr() to only update relevant fields

to the 6.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ice-fix-ice_cfg_rdma_fltr-to-only-update-relevant-fi.patch
and it can be found in the queue-6.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit aaf51c81bfb407cba33c327622c8372cc1f43cb2
Author: Brett Creeley <brett.creeley@xxxxxxxxx>
Date:   Mon Mar 13 13:36:08 2023 -0700

    ice: Fix ice_cfg_rdma_fltr() to only update relevant fields
    
    [ Upstream commit d94dbdc4e0209b5e7d736ab696f8d635b034e3ee ]
    
    The current implementation causes ice_vsi_update() to update all VSI
    fields based on the cached VSI context. This also assumes that the
    ICE_AQ_VSI_PROP_Q_OPT_VALID bit is set. This can cause problems if the
    VSI context is not correctly synced by the driver. Fix this by only
    updating the fields that correspond to ICE_AQ_VSI_PROP_Q_OPT_VALID.
    Also, make sure to save the updated result in the cached VSI context
    on success.
    
    Fixes: 348048e724a0 ("ice: Implement iidc operations")
    Co-developed-by: Robert Malz <robertx.malz@xxxxxxxxx>
    Signed-off-by: Robert Malz <robertx.malz@xxxxxxxxx>
    Signed-off-by: Brett Creeley <brett.creeley@xxxxxxxxx>
    Signed-off-by: Jesse Brandeburg <jesse.brandeburg@xxxxxxxxx>
    Reviewed-by: Piotr Raczynski <piotr.raczynski@xxxxxxxxx>
    Tested-by: Jakub Andrysiak <jakub.andrysiak@xxxxxxxxx>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c
index 61f844d225123..46b36851af460 100644
--- a/drivers/net/ethernet/intel/ice/ice_switch.c
+++ b/drivers/net/ethernet/intel/ice/ice_switch.c
@@ -1780,18 +1780,36 @@ ice_update_vsi(struct ice_hw *hw, u16 vsi_handle, struct ice_vsi_ctx *vsi_ctx,
 int
 ice_cfg_rdma_fltr(struct ice_hw *hw, u16 vsi_handle, bool enable)
 {
-	struct ice_vsi_ctx *ctx;
+	struct ice_vsi_ctx *ctx, *cached_ctx;
+	int status;
+
+	cached_ctx = ice_get_vsi_ctx(hw, vsi_handle);
+	if (!cached_ctx)
+		return -ENOENT;
 
-	ctx = ice_get_vsi_ctx(hw, vsi_handle);
+	ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
 	if (!ctx)
-		return -EIO;
+		return -ENOMEM;
+
+	ctx->info.q_opt_rss = cached_ctx->info.q_opt_rss;
+	ctx->info.q_opt_tc = cached_ctx->info.q_opt_tc;
+	ctx->info.q_opt_flags = cached_ctx->info.q_opt_flags;
+
+	ctx->info.valid_sections = cpu_to_le16(ICE_AQ_VSI_PROP_Q_OPT_VALID);
 
 	if (enable)
 		ctx->info.q_opt_flags |= ICE_AQ_VSI_Q_OPT_PE_FLTR_EN;
 	else
 		ctx->info.q_opt_flags &= ~ICE_AQ_VSI_Q_OPT_PE_FLTR_EN;
 
-	return ice_update_vsi(hw, vsi_handle, ctx, NULL);
+	status = ice_update_vsi(hw, vsi_handle, ctx, NULL);
+	if (!status) {
+		cached_ctx->info.q_opt_flags = ctx->info.q_opt_flags;
+		cached_ctx->info.valid_sections |= ctx->info.valid_sections;
+	}
+
+	kfree(ctx);
+	return status;
 }
 
 /**



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux