]> www.infradead.org Git - users/hch/dma-mapping.git/commitdiff
ice: Fix recipe read procedure
authorWojciech Drewek <wojciech.drewek@intel.com>
Mon, 1 Jul 2024 09:05:46 +0000 (11:05 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 23 Jul 2024 22:26:41 +0000 (15:26 -0700)
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>
Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_switch.c

index 3caafcdc301fc2301ec0245b1b5066d72289802f..fe8847184cb1aff8f985c961b4eed5776f119ee5 100644 (file)
@@ -2400,10 +2400,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].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) {
                        set_bit(root_bufs.content.result_indx &