Message ID | 20240701090546.31243-1-wojciech.drewek@intel.com (mailing list archive) |
---|---|
State | Awaiting Upstream |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [iwl-net] ice: Fix recipe read procedure | expand |
On Mon, Jul 01, 2024 at 11:05:46AM +0200, Wojciech Drewek wrote: > When ice driver reads recipes from firmware information about > need_pass_l2 and allow_pass_l2 flags is not stored correctly. > Those flags are stored as one bit each in ice_sw_recipe structure. > Because of that, the result of checking a flag has to be casted to bool. > Note that the need_pass_l2 flag currently works correctly, because > it's stored in the first bit. > > Fixes: bccd9bce29e0 ("ice: Add guard rule when creating FDB in switchdev") > Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com> > Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> > Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com> Reviewed-by: Simon Horman <horms@kernel.org>
> -----Original Message----- > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of > Wojciech Drewek > Sent: Monday, July 1, 2024 2:36 PM > To: intel-wired-lan@lists.osuosl.org > Cc: Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>; > marcin.szycik@linux.intel.com; netdev@vger.kernel.org > Subject: [Intel-wired-lan] [PATCH iwl-net] ice: Fix recipe read procedure > > When ice driver reads recipes from firmware information about > need_pass_l2 and allow_pass_l2 flags is not stored correctly. > Those flags are stored as one bit each in ice_sw_recipe structure. > Because of that, the result of checking a flag has to be casted to bool. > Note that the need_pass_l2 flag currently works correctly, because it's stored > in the first bit. > > Fixes: bccd9bce29e0 ("ice: Add guard rule when creating FDB in switchdev") > Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com> > Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> > Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com> > --- > drivers/net/ethernet/intel/ice/ice_switch.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c index 1191031b2a43..ffd6c42bda1e 100644 --- a/drivers/net/ethernet/intel/ice/ice_switch.c +++ b/drivers/net/ethernet/intel/ice/ice_switch.c @@ -2413,10 +2413,10 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid, /* Propagate some data to the recipe database */ recps[idx].is_root = !!is_root; recps[idx].priority = root_bufs.content.act_ctrl_fwd_priority; - recps[idx].need_pass_l2 = root_bufs.content.act_ctrl & - ICE_AQ_RECIPE_ACT_NEED_PASS_L2; - recps[idx].allow_pass_l2 = root_bufs.content.act_ctrl & - ICE_AQ_RECIPE_ACT_ALLOW_PASS_L2; + recps[idx].need_pass_l2 = !!(root_bufs.content.act_ctrl & + ICE_AQ_RECIPE_ACT_NEED_PASS_L2); + recps[idx].allow_pass_l2 = !!(root_bufs.content.act_ctrl & + ICE_AQ_RECIPE_ACT_ALLOW_PASS_L2); bitmap_zero(recps[idx].res_idxs, ICE_MAX_FV_WORDS); if (root_bufs.content.result_indx & ICE_AQ_RECIPE_RESULT_EN) { recps[idx].chain_idx = root_bufs.content.result_indx &