netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iwl-net] ice: Fix recipe read procedure
@ 2024-07-01  9:05 Wojciech Drewek
  2024-07-01 16:52 ` Simon Horman
  2024-07-10 12:15 ` [Intel-wired-lan] " Buvaneswaran, Sujai
  0 siblings, 2 replies; 3+ messages in thread
From: Wojciech Drewek @ 2024-07-01  9:05 UTC (permalink / raw)
  To: intel-wired-lan; +Cc: przemyslaw.kitszel, marcin.szycik, netdev

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(-)

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 &
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH iwl-net] ice: Fix recipe read procedure
  2024-07-01  9:05 [PATCH iwl-net] ice: Fix recipe read procedure Wojciech Drewek
@ 2024-07-01 16:52 ` Simon Horman
  2024-07-10 12:15 ` [Intel-wired-lan] " Buvaneswaran, Sujai
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-07-01 16:52 UTC (permalink / raw)
  To: Wojciech Drewek
  Cc: intel-wired-lan, przemyslaw.kitszel, marcin.szycik, netdev

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>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [Intel-wired-lan] [PATCH iwl-net] ice: Fix recipe read procedure
  2024-07-01  9:05 [PATCH iwl-net] ice: Fix recipe read procedure Wojciech Drewek
  2024-07-01 16:52 ` Simon Horman
@ 2024-07-10 12:15 ` Buvaneswaran, Sujai
  1 sibling, 0 replies; 3+ messages in thread
From: Buvaneswaran, Sujai @ 2024-07-10 12:15 UTC (permalink / raw)
  To: Drewek, Wojciech, intel-wired-lan@lists.osuosl.org
  Cc: Kitszel, Przemyslaw, marcin.szycik@linux.intel.com,
	netdev@vger.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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-10 12:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-01  9:05 [PATCH iwl-net] ice: Fix recipe read procedure Wojciech Drewek
2024-07-01 16:52 ` Simon Horman
2024-07-10 12:15 ` [Intel-wired-lan] " Buvaneswaran, Sujai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).