[{"id":3675329,"web_url":"http://patchwork.ozlabs.org/comment/3675329/","msgid":"<IA3PR11MB898666B7AB0330B3C29DC630E5582@IA3PR11MB8986.namprd11.prod.outlook.com>","list_archive_url":null,"date":"2026-04-09T13:35:59","subject":"Re: [Intel-wired-lan] [PATCH iwl-next v2 08/10] ice: program ACL\n entry","submitter":{"id":75597,"url":"http://patchwork.ozlabs.org/api/people/75597/","name":"Loktionov, Aleksandr","email":"aleksandr.loktionov@intel.com"},"content":"> -----Original Message-----\n> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf\n> Of Marcin Szycik\n> Sent: Thursday, April 9, 2026 2:00 PM\n> To: intel-wired-lan@lists.osuosl.org\n> Cc: netdev@vger.kernel.org; Penigalapati, Sandeep\n> <sandeep.penigalapati@intel.com>; S, Ananth <ananth.s@intel.com>;\n> alexander.duyck@gmail.com; Marcin Szycik\n> <marcin.szycik@linux.intel.com>; Cao, Chinh T <chinh.t.cao@intel.com>;\n> Nguyen, Anthony L <anthony.l.nguyen@intel.com>\n> Subject: [Intel-wired-lan] [PATCH iwl-next v2 08/10] ice: program ACL\n> entry\n> \n> From: Real Valiquette <real.valiquette@intel.com>\n> \n> Complete the filter programming process; set the flow entry and action\n> into the scenario and write it to hardware. Configure the VSI for ACL\n> filters.\n> \n> Co-developed-by: Chinh Cao <chinh.t.cao@intel.com>\n> Signed-off-by: Chinh Cao <chinh.t.cao@intel.com>\n> Signed-off-by: Real Valiquette <real.valiquette@intel.com>\n> Co-developed-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n> Signed-off-by: Marcin Szycik <marcin.szycik@linux.intel.com>\n> ---\n> v2:\n> * Use plain alloc instead of devm_ for ice_flow_entry::acts\n> * Use FIELD_PREP_CONST() for ICE_ACL_RX_*_MISS_CNTR\n> * Fix wrong struct ice_acl_act_entry alloc count in\n>   ice_flow_acl_add_scen_entry_sync() - was e->entry_sz, which is an\n>   unrelated value\n> * Only set acts_cnt after successful allocation in\n>   ice_flow_acl_add_scen_entry_sync()\n> * Return -EINVAL instead of -ENOSPC on wrong index in\n>   ice_acl_scen_free_entry_idx()\n> ---\n>  drivers/net/ethernet/intel/ice/ice.h          |   2 +\n>  drivers/net/ethernet/intel/ice/ice_acl.h      |  21 +\n>  .../net/ethernet/intel/ice/ice_adminq_cmd.h   |   2 +\n>  drivers/net/ethernet/intel/ice/ice_flow.h     |   3 +\n>  drivers/net/ethernet/intel/ice/ice_acl.c      |  53 ++-\n>  drivers/net/ethernet/intel/ice/ice_acl_ctrl.c | 251 +++++++++++\n>  drivers/net/ethernet/intel/ice/ice_acl_main.c |   4 +\n>  .../ethernet/intel/ice/ice_ethtool_ntuple.c   |  48 ++-\n>  drivers/net/ethernet/intel/ice/ice_flow.c     | 395\n> ++++++++++++++++++\n>  drivers/net/ethernet/intel/ice/ice_lib.c      |  10 +-\n>  10 files changed, 782 insertions(+), 7 deletions(-)\n> \n> diff --git a/drivers/net/ethernet/intel/ice/ice.h\n> b/drivers/net/ethernet/intel/ice/ice.h\n> index 9e6643931022..f9a43daf04fe 100644\n> --- a/drivers/net/ethernet/intel/ice/ice.h\n> +++ b/drivers/net/ethernet/intel/ice/ice.h\n> @@ -1061,6 +1061,8 @@ void ice_aq_prep_for_event(struct ice_pf *pf,\n> struct ice_aq_task *task,\n>  \t\t\t   u16 opcode);\n>  int ice_aq_wait_for_event(struct ice_pf *pf, struct ice_aq_task\n> *task,\n>  \t\t\t  unsigned long timeout);\n> +int ice_ntuple_update_list_entry(struct ice_pf *pf,\n> +\t\t\t\t struct ice_ntuple_fltr *input, int\n> fltr_idx);\n>  int ice_open(struct net_device *netdev);  int\n> ice_open_internal(struct net_device *netdev);  int ice_stop(struct\n> net_device *netdev); diff --git\n> a/drivers/net/ethernet/intel/ice/ice_acl.h\n> b/drivers/net/ethernet/intel/ice/ice_acl.h\n> index 3a4adcf368cf..0b5651401eb7 100644\n> --- a/drivers/net/ethernet/intel/ice/ice_acl.h\n> +++ b/drivers/net/ethernet/intel/ice/ice_acl.h\n> @@ -39,6 +39,7 @@ struct ice_acl_tbl {\n>  \tDECLARE_BITMAP(avail, ICE_AQC_ACL_ALLOC_UNITS);  };\n> \n> +#define ICE_MAX_ACL_TCAM_ENTRY (ICE_AQC_ACL_TCAM_DEPTH *\n> +ICE_AQC_ACL_SLICES)\n>  enum ice_acl_entry_prio {\n>  \tICE_ACL_PRIO_LOW = 0,\n>  \tICE_ACL_PRIO_NORMAL,\n> @@ -65,6 +66,11 @@ struct ice_acl_scen {\n>  \t * participate in this scenario\n>  \t */\n>  \tDECLARE_BITMAP(act_mem_bitmap, ICE_AQC_MAX_ACTION_MEMORIES);\n\n...\n\n> +\t/* Determine number of cascaded TCAMs */\n> +\tnum_cscd = DIV_ROUND_UP(scen->width,\n> ICE_AQC_ACL_KEY_WIDTH_BYTES);\n> +\n> +\tentry_tcam = ICE_ACL_TBL_TCAM_IDX(scen->start);\n> +\tidx = ICE_ACL_TBL_TCAM_ENTRY_IDX(scen->start + *entry_idx);\n> +\n> +\tfor (u8 i = 0; i < num_cscd; i++) {\n> +\t\t/* If the key spans more than one TCAM in the case of\n> cascaded\n> +\t\t * TCAMs, the key and key inverts need to be properly\n> split\n> +\t\t * among TCAMs.E.g.bytes 0 - 4 go to an index in the\n> first TCAM\n\"E.g.bytes\" -> \"E.g. bytes\"\n\n> +\t\t * and bytes 5 - 9 go to the same index in the next\n> TCAM, etc.\n> +\t\t * If the entry spans more than one TCAM in a cascaded\n> TCAM\n> +\t\t * mode, the programming of the entries in the TCAMs\n> must be in\n> +\t\t * reversed order - the TCAM entry of the rightmost TCAM\n> should\n> +\t\t * be programmed first; the TCAM entry of the leftmost\n> TCAM\n> +\t\t * should be programmed last.\n> +\t\t */\n> +\t\toffset = num_cscd - i - 1;\n> +\t\tmemcpy(&buf.entry_key.val,\n> +\t\t       &keys[offset * sizeof(buf.entry_key.val)],\n> +\t\t       sizeof(buf.entry_key.val));\n> +\t\tmemcpy(&buf.entry_key_invert.val,\n> +\t\t       &inverts[offset *\n> sizeof(buf.entry_key_invert.val)],\n> +\t\t       sizeof(buf.entry_key_invert.val));\n> +\t\terr = ice_aq_program_acl_entry(hw, entry_tcam + offset,\n> idx,\n> +\t\t\t\t\t       &buf, NULL);\n> +\t\tif (err) {\n> +\t\t\tice_debug(hw, ICE_DBG_ACL, \"aq program acl entry\n> failed status: %d\\n\",\n> +\t\t\t\t  err);\n> +\t\t\tgoto out;\n> +\t\t}\n> +\t}\n> +\n> +\terr = ice_acl_prog_act(hw, scen, acts, acts_cnt, *entry_idx);\n> +\n> +out:\n> +\tif (err) {\n> +\t\tice_acl_rem_entry(hw, scen, *entry_idx);\n> +\t\t*entry_idx = 0;\n> +\t}\n> +\n> +\treturn err;\n> +}\n> +\n> +/**\n> + * ice_acl_prog_act - Program a scenario's action memory\n> + * @hw: pointer to the HW struct\n> + * @scen: scenario to add the entry to\n> + * @acts: pointer to a buffer containing formatted actions\n> + * @acts_cnt: indicates the number of actions stored in \"acts\"\n> + * @entry_idx: scenario relative index of the added flow entry\n> + *\n> + * Return: 0 on success, negative on error  */ int\n> +ice_acl_prog_act(struct ice_hw *hw, struct ice_acl_scen *scen,\n> +\t\t     struct ice_acl_act_entry *acts, u8 acts_cnt, u16\n> entry_idx) {\n> +\tu8 entry_tcam, num_cscd, i, actx_idx = 0;\n> +\tstruct ice_aqc_actpair act_buf = {};\n> +\tint err = 0;\n> +\tu16 idx;\n> +\n> +\tif (entry_idx >= scen->num_entry)\n> +\t\treturn -ENOSPC;\n> +\n> +\t/* Determine number of cascaded TCAMs */\n> +\tnum_cscd = DIV_ROUND_UP(scen->width,\n> ICE_AQC_ACL_KEY_WIDTH_BYTES);\n> +\n> +\tentry_tcam = ICE_ACL_TBL_TCAM_IDX(scen->start);\n> +\tidx = ICE_ACL_TBL_TCAM_ENTRY_IDX(scen->start + entry_idx);\n> +\n> +\tfor_each_set_bit(i, scen->act_mem_bitmap,\n> ICE_AQC_MAX_ACTION_MEMORIES) {\n> +\t\tstruct ice_acl_act_mem *mem = &hw->acl_tbl->act_mems[i];\n> +\n> +\t\tif (actx_idx >= acts_cnt)\n> +\t\t\tbreak;\n> +\t\tif (mem->member_of_tcam >= entry_tcam &&\n> +\t\t    mem->member_of_tcam < entry_tcam + num_cscd) {\n> +\t\t\tmemcpy(&act_buf.act[0], &acts[actx_idx],\n> +\t\t\t       sizeof(struct ice_acl_act_entry));\n> +\n> +\t\t\tif (++actx_idx < acts_cnt) {\n> +\t\t\t\tmemcpy(&act_buf.act[1], &acts[actx_idx],\n> +\t\t\t\t       sizeof(struct ice_acl_act_entry));\n> +\t\t\t}\n> +\n> +\t\t\terr = ice_aq_program_actpair(hw, i, idx,\n> &act_buf,\n> +\t\t\t\t\t\t     NULL);\n> +\t\t\tif (err) {\n> +\t\t\t\tice_debug(hw, ICE_DBG_ACL, \"program actpair\n> failed status: %d\\n\",\n> +\t\t\t\t\t  err);\n> +\t\t\t\tbreak;\n> +\t\t\t}\n> +\t\t\tactx_idx++;\n> +\t\t}\n> +\t}\n> +\n> +\tif (!err && actx_idx < acts_cnt)\n> +\t\terr = -ENOSPC;\n> +\n> +\treturn err;\n> +}\n> +\n> +/**\n> + * ice_acl_rem_entry - Remove a flow entry from an ACL scenario\n> + * @hw: pointer to the HW struct\n> + * @scen: scenario to remove the entry from\n> + * @entry_idx: the scenario-relative index of the flow entry being\n> +removed\n> + *\n> + * Return: 0 on success, negative on error  */ int\n> +ice_acl_rem_entry(struct ice_hw *hw, struct ice_acl_scen *scen,\n> +\t\t      u16 entry_idx)\n> +{\n> +\tstruct ice_aqc_actpair act_buf = {};\n> +\tstruct ice_aqc_acl_data buf;\n> +\tu8 entry_tcam, num_cscd, i;\n> +\tint err = 0;\n> +\tu16 idx;\n> +\n> +\tif (!scen)\n> +\t\treturn -ENOENT;\n> +\n> +\tif (entry_idx >= scen->num_entry)\n> +\t\treturn -ENOSPC;\n> +\n> +\tif (!test_bit(entry_idx, scen->entry_bitmap))\n> +\t\treturn -ENOENT;\n> +\n> +\t/* Determine number of cascaded TCAMs */\n> +\tnum_cscd = DIV_ROUND_UP(scen->width,\n> ICE_AQC_ACL_KEY_WIDTH_BYTES);\n> +\n> +\tentry_tcam = ICE_ACL_TBL_TCAM_IDX(scen->start);\n> +\tidx = ICE_ACL_TBL_TCAM_ENTRY_IDX(scen->start + entry_idx);\n> +\n> +\t/* invalidate the flow entry */\n> +\tmemset(&buf, 0, sizeof(buf));\n> +\tfor (i = 0; i < num_cscd; i++) {\n> +\t\terr = ice_aq_program_acl_entry(hw, entry_tcam + i, idx,\n> &buf,\n> +\t\t\t\t\t       NULL);\n> +\t\tif (err)\n> +\t\t\tice_debug(hw, ICE_DBG_ACL, \"AQ program ACL entry\n> failed status: %d\\n\",\n> +\t\t\t\t  err);\n> +\t}\n> +\n> +\tfor_each_set_bit(i, scen->act_mem_bitmap,\n> ICE_AQC_MAX_ACTION_MEMORIES) {\n> +\t\tstruct ice_acl_act_mem *mem = &hw->acl_tbl->act_mems[i];\n> +\n> +\t\tif (mem->member_of_tcam >= entry_tcam &&\n> +\t\t    mem->member_of_tcam < entry_tcam + num_cscd) {\n> +\t\t\t/* Invalidate allocated action pairs */\n> +\t\t\terr = ice_aq_program_actpair(hw, i, idx,\n> &act_buf,\n> +\t\t\t\t\t\t     NULL);\n> +\t\t\tif (err)\n> +\t\t\t\tice_debug(hw, ICE_DBG_ACL, \"program actpair\n> failed status: %d\\n\",\n> +\t\t\t\t\t  err);\n> +\t\t}\n> +\t}\n> +\n> +\tice_acl_scen_free_entry_idx(scen, entry_idx);\n> +\n> +\treturn err;\n> +}\n> diff --git a/drivers/net/ethernet/intel/ice/ice_acl_main.c\n> b/drivers/net/ethernet/intel/ice/ice_acl_main.c\n> index 53cca0526756..16228be574ed 100644\n> --- a/drivers/net/ethernet/intel/ice/ice_acl_main.c\n> +++ b/drivers/net/ethernet/intel/ice/ice_acl_main.c\n> @@ -280,6 +280,10 @@ int ice_acl_add_rule_ethtool(struct ice_vsi *vsi,\n> struct ethtool_rxnfc *cmd)\n>  \t\thw_prof->entry_h[hw_prof->cnt++][0] = entry_h;\n>  \t}\n> \n> +\tinput->acl_fltr = true;\n> +\t/* input struct is added to the HW filter list */\n> +\tice_ntuple_update_list_entry(pf, input, fsp->location);\n> +\n>  \treturn 0;\n> \n>  free_input:\n> diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c\n> b/drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c\n> index 3e79c0bf40f4..21d4f4e3a1d0 100644\n> --- a/drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c\n> +++ b/drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c\n> @@ -1791,6 +1791,21 @@ void ice_vsi_manage_fdir(struct ice_vsi *vsi,\n> bool ena)\n>  \tmutex_unlock(&hw->fdir_fltr_lock);\n>  }\n> \n> +/**\n> + * ice_del_acl_ethtool - delete an ACL rule entry\n> + * @hw: pointer to HW instance\n> + * @fltr: filter structure\n> + *\n> + * Return: 0 on success, negative on error  */ static int\n> +ice_del_acl_ethtool(struct ice_hw *hw, struct ice_ntuple_fltr *fltr)\n> {\n> +\tu64 entry;\n> +\n> +\tentry = ice_flow_find_entry(hw, ICE_BLK_ACL, fltr->fltr_id);\n> +\treturn ice_flow_rem_entry(hw, ICE_BLK_ACL, entry); }\n> +\n>  /**\n>   * ice_fdir_do_rem_flow - delete flow and possibly add perfect flow\n>   * @pf: PF structure\n> @@ -1824,7 +1839,7 @@ ice_fdir_do_rem_flow(struct ice_pf *pf, enum\n> ice_fltr_ptype flow_type)\n>   *\n>   * Return: 0 on success and negative on errors\n>   */\n> -static int\n> +int\n>  ice_ntuple_update_list_entry(struct ice_pf *pf, struct\n> ice_ntuple_fltr *input,\n>  \t\t\t     int fltr_idx)\n>  {\n> @@ -1843,13 +1858,36 @@ ice_ntuple_update_list_entry(struct ice_pf\n> *pf, struct ice_ntuple_fltr *input,\n> \n>  \told_fltr = ice_fdir_find_fltr_by_idx(hw, fltr_idx);\n>  \tif (old_fltr) {\n> -\t\terr = ice_fdir_write_all_fltr(pf, old_fltr, false);\n> -\t\tif (err)\n> -\t\t\treturn err;\n> +\t\tif (old_fltr->acl_fltr) {\n> +\t\t\t/* ACL filter - if the input buffer is present\n> +\t\t\t * then this is an update and we don't want to\n> +\t\t\t * delete the filter from the HW. We've already\n> +\t\t\t * written the change to the HW at this point, so\n> +\t\t\t * just update the SW structures to make sure\n> +\t\t\t * everything is hunky-dory. If no input then\n> this\n> +\t\t\t * is a delete so we should delete the filter\n> from\n> +\t\t\t * the HW and clean up our SW structures.\n> +\t\t\t */\n> +\t\t\tif (!input) {\n> +\t\t\t\terr = ice_del_acl_ethtool(hw, old_fltr);\n> +\t\t\t\tif (err)\n> +\t\t\t\t\treturn err;\n> +\t\t\t}\n> +\t\t} else {\n> +\t\t\t/* FD filter */\n> +\t\t\terr = ice_fdir_write_all_fltr(pf, old_fltr,\n> false);\n> +\t\t\tif (err)\n> +\t\t\t\treturn err;\n> +\t\t}\n> +\n>  \t\tice_fdir_update_cntrs(hw, old_fltr->flow_type, false,\n> false);\n>  \t\t/* update sb-filters count, specific to ring->channel */\n>  \t\tice_update_per_q_fltr(vsi, old_fltr->orig_q_index,\n> false);\n> -\t\tif (!input && !hw->fdir_fltr_cnt[old_fltr->flow_type])\n> +\t\t/* Also delete the HW filter info if we have just\n> deleted the\n> +\t\t * last filter of flow_type.\n> +\t\t */\n> +\t\tif (!old_fltr->acl_fltr && !input &&\n> +\t\t    !hw->fdir_fltr_cnt[old_fltr->flow_type])\n>  \t\t\t/* we just deleted the last filter of flow_type\n> so we\n>  \t\t\t * should also delete the HW filter info.\n>  \t\t\t */\n> diff --git a/drivers/net/ethernet/intel/ice/ice_flow.c\n> b/drivers/net/ethernet/intel/ice/ice_flow.c\n> index dce6d2ffcb15..144d8326d4f9 100644\n> --- a/drivers/net/ethernet/intel/ice/ice_flow.c\n> +++ b/drivers/net/ethernet/intel/ice/ice_flow.c\n> @@ -1744,6 +1744,16 @@ static int ice_flow_rem_entry_sync(struct\n> ice_hw *hw, enum ice_block blk,\n>  \t\treturn -EINVAL;\n> \n>  \tif (blk == ICE_BLK_ACL) {\n> +\t\tint err;\n> +\n> +\t\tif (!entry->prof)\n> +\t\t\treturn -EINVAL;\n> +\n> +\t\terr = ice_acl_rem_entry(hw, entry->prof->cfg.scen,\n> +\t\t\t\t\tentry->scen_entry_idx);\n> +\t\tif (err)\n> +\t\t\treturn err;\n> +\n>  \t\tif (entry->acts_cnt && entry->acts)\n>  \t\t\tice_flow_acl_free_act_cntr(hw, entry->acts,\n>  \t\t\t\t\t\t   entry->acts_cnt);\n> @@ -1879,10 +1889,34 @@ ice_flow_rem_prof_sync(struct ice_hw *hw, enum\n> ice_block blk,\n>  \t}\n> \n>  \tif (blk == ICE_BLK_ACL) {\n> +\t\tstruct ice_aqc_acl_prof_generic_frmt buf;\n> +\t\tu8 prof_id = 0;\n> +\n>  \t\t/* Disassociate the scenario from the profile for the PF\n> */\n>  \t\tstatus = ice_flow_acl_disassoc_scen(hw, prof);\n>  \t\tif (status)\n>  \t\t\treturn status;\n> +\n> +\t\tstatus = ice_flow_get_hw_prof(hw, blk, prof->id,\n> &prof_id);\n> +\t\tif (status)\n> +\t\t\treturn status;\n> +\n> +\t\tstatus = ice_query_acl_prof(hw, prof_id, &buf, NULL);\n> +\t\tif (status)\n> +\t\t\treturn status;\n> +\n> +\t\t/* Clear the range-checker if the profile ID is no\n> longer\n> +\t\t * used by any PF\n> +\t\t */\n> +\t\tif (!ice_flow_acl_is_prof_in_use(&buf)) {\n> +\t\t\t/* Clear the range-checker value for profile ID\n> */\n> +\t\t\tstruct ice_aqc_acl_profile_ranges query_rng_buf =\n> {};\n> +\n> +\t\t\tstatus = ice_prog_acl_prof_ranges(hw, prof_id,\n> +\t\t\t\t\t\t\t  &query_rng_buf,\n> NULL);\n> +\t\t\tif (status)\n> +\t\t\t\treturn status;\n> +\t\t}\n>  \t}\n> \n>  \t/* Remove all hardware profiles associated with this flow\n> profile */ @@ -2214,6 +2248,44 @@ int ice_flow_rem_prof(struct ice_hw\n> *hw, enum ice_block blk, u64 prof_id)\n>  \treturn status;\n>  }\n> \n> +/**\n> + * ice_flow_find_entry - look for a flow entry using its unique ID\n> + * @hw: pointer to the HW struct\n> + * @blk: classification stage\n> + * @entry_id: unique ID to identify this flow entry\n> + *\n> + * Look for the flow entry with the specified unique ID in all flow\n> +profiles of\n> + * the specified classification stage.\n> + *\n> + * Return: flow entry handle if entry found, ICE_FLOW_ENTRY_ID_INVAL\n> +otherwise  */\n> +u64 ice_flow_find_entry(struct ice_hw *hw, enum ice_block blk, u64\n> +entry_id) {\n> +\tstruct ice_flow_entry *found = NULL;\n> +\tstruct ice_flow_prof *p;\n> +\n> +\tmutex_lock(&hw->fl_profs_locks[blk]);\n> +\n> +\tlist_for_each_entry(p, &hw->fl_profs[blk], l_entry) {\n> +\t\tstruct ice_flow_entry *e;\n> +\n> +\t\tmutex_lock(&p->entries_lock);\n> +\t\tlist_for_each_entry(e, &p->entries, l_entry)\n> +\t\t\tif (e->id == entry_id) {\n> +\t\t\t\tfound = e;\n> +\t\t\t\tbreak;\n> +\t\t\t}\n> +\t\tmutex_unlock(&p->entries_lock);\n> +\n> +\t\tif (found)\n> +\t\t\tbreak;\n> +\t}\n> +\n> +\tmutex_unlock(&hw->fl_profs_locks[blk]);\n> +\n> +\treturn found ? ICE_FLOW_ENTRY_HNDL(found) :\n> +ICE_FLOW_ENTRY_HANDLE_INVAL; }\n> +\n>  /**\n>   * ice_flow_acl_check_actions - Checks the ACL rule's actions\n>   * @hw: pointer to the hardware structure @@ -2541,6 +2613,325 @@\n> static int ice_flow_acl_frmt_entry(struct ice_hw *hw,\n> \n>  \treturn err;\n>  }\n> +\n> +/**\n> + * ice_flow_acl_find_scen_entry_cond - Find an ACL scenario entry\n> that matches\n> + *\t\t\t\t       the compared data\n> + * @prof: pointer to flow profile\n> + * @e: pointer to the comparing flow entry\n> + * @do_chg_action: decide if we want to change the ACL action\n> + * @do_add_entry: decide if we want to add the new ACL entry\n> + * @do_rem_entry: decide if we want to remove the current ACL entry\n> + *\n> + * Find an ACL scenario entry that matches the compared data. Also\n> figure out:\n> + * a) If we want to change the ACL action\n> + * b) If we want to add the new ACL entry\n> + * c) If we want to remove the current ACL entry\n> + *\n> + * Return: ACL scenario entry, or NULL if not found  */ static struct\n> +ice_flow_entry * ice_flow_acl_find_scen_entry_cond(struct\n> ice_flow_prof\n> +*prof,\n> +\t\t\t\t  struct ice_flow_entry *e, bool\n> *do_chg_action,\n> +\t\t\t\t  bool *do_add_entry, bool *do_rem_entry) {\n> +\tstruct ice_flow_entry *p, *return_entry = NULL;\n> +\n> +\t/* Check if:\n> +\t * a) There exists an entry with same matching data, but\n> different\n> +\t *    priority, then we remove this existing ACL entry. Then,\n> we\n> +\t *    will add the new entry to the ACL scenario.\n> +\t * b) There exists an entry with same matching data, priority,\n> and\n> +\t *    result action, then we do nothing\n> +\t * c) There exists an entry with same matching data, priority,\n> but\n> +\t *    different, action, then do only change the action's\n> entry.\nToo much of commas, please reduce the number.\n\n\n> +\t * d) Else, we add this new entry to the ACL scenario.\n> +\t */\n> +\t*do_chg_action = false;\n> +\t*do_add_entry = true;\n> +\t*do_rem_entry = false;\n> +\tlist_for_each_entry(p, &prof->entries, l_entry) {\n> +\t\tif (memcmp(p->entry, e->entry, p->entry_sz))\n> +\t\t\tcontinue;\n> +\n> +\t\t/* From this point, we have the same matching_data. */\n> +\t\t*do_add_entry = false;\n> +\t\treturn_entry = p;\n> +\n> +\t\tif (p->priority != e->priority) {\n> +\t\t\t/* matching data && !priority */\n> +\t\t\t*do_add_entry = true;\n> +\t\t\t*do_rem_entry = true;\n> +\t\t\tbreak;\n> +\t\t}\n> +\n> +\t\t/* From this point, we will have matching_data &&\n> priority */\n> +\t\tif (p->acts_cnt != e->acts_cnt)\n> +\t\t\t*do_chg_action = true;\n> +\t\tfor (int i = 0; i < p->acts_cnt; i++) {\n> +\t\t\tbool found_not_match = false;\n> +\n> +\t\t\tfor (int j = 0; j < e->acts_cnt; j++)\n> +\t\t\t\tif (memcmp(&p->acts[i], &e->acts[j],\n> +\t\t\t\t\t   sizeof(struct ice_flow_action)))\nDue to comment above it should be if (!memcmp(&p->acts[i], &e->acts[j],\nPlease fix the comment or code.\n\nOtherwise, it looks good.\nReviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>\n\n> {\n> +\t\t\t\t\tfound_not_match = true;\n> +\t\t\t\t\tbreak;\n\n...\n\n>  }\n> \n>  /**\n> --\n> 2.49.0","headers":{"Return-Path":"<intel-wired-lan-bounces@osuosl.org>","X-Original-To":["incoming@patchwork.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256\n header.s=default header.b=OmnqKKc/;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fs1DC2PJ0z1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 23:36:10 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 7BF036069C;\n\tThu,  9 Apr 2026 13:36:09 +0000 (UTC)","from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id bGMDDk-zUTt0; Thu,  9 Apr 2026 13:36:08 +0000 (UTC)","from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 58B1B60FB7;\n\tThu,  9 Apr 2026 13:36:08 +0000 (UTC)","from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n by lists1.osuosl.org (Postfix) with ESMTP id 5273D1F6\n for <intel-wired-lan@lists.osuosl.org>; Thu,  9 Apr 2026 13:36:07 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n by smtp3.osuosl.org (Postfix) with ESMTP id 3799660FB7\n for <intel-wired-lan@lists.osuosl.org>; Thu,  9 Apr 2026 13:36:07 +0000 (UTC)","from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id uHa2BTnznSzT for <intel-wired-lan@lists.osuosl.org>;\n Thu,  9 Apr 2026 13:36:06 +0000 (UTC)","from mgamail.intel.com (mgamail.intel.com [198.175.65.9])\n by smtp3.osuosl.org (Postfix) with ESMTPS id 6A55F6069C\n for <intel-wired-lan@lists.osuosl.org>; Thu,  9 Apr 2026 13:36:04 +0000 (UTC)","from fmviesa007.fm.intel.com ([10.60.135.147])\n by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Apr 2026 06:36:04 -0700","from fmsmsx903.amr.corp.intel.com ([10.18.126.92])\n by fmviesa007.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Apr 2026 06:36:04 -0700","from FMSMSX902.amr.corp.intel.com (10.18.126.91) by\n fmsmsx903.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.2562.37; Thu, 9 Apr 2026 06:36:03 -0700","from fmsedg902.ED.cps.intel.com (10.1.192.144) by\n FMSMSX902.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.2562.37 via Frontend Transport; Thu, 9 Apr 2026 06:36:03 -0700","from BN1PR04CU002.outbound.protection.outlook.com (52.101.56.61) by\n edgegateway.intel.com (192.55.55.82) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.2562.37; Thu, 9 Apr 2026 06:36:03 -0700","from IA3PR11MB8986.namprd11.prod.outlook.com (2603:10b6:208:577::21)\n by IA3PR11MB9184.namprd11.prod.outlook.com (2603:10b6:208:570::6)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.15; Thu, 9 Apr\n 2026 13:36:00 +0000","from IA3PR11MB8986.namprd11.prod.outlook.com\n ([fe80::e6f0:6afb:6ef9:ab5c]) by IA3PR11MB8986.namprd11.prod.outlook.com\n ([fe80::e6f0:6afb:6ef9:ab5c%5]) with mapi id 15.20.9745.012; Thu, 9 Apr 2026\n 13:35:59 +0000"],"X-Virus-Scanned":["amavis at osuosl.org","amavis at osuosl.org"],"X-Comment":"SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=<UNKNOWN> ","DKIM-Filter":["OpenDKIM Filter v2.11.0 smtp3.osuosl.org 58B1B60FB7","OpenDKIM Filter v2.11.0 smtp3.osuosl.org 6A55F6069C"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1775741768;\n\tbh=y8hJ1WNmKubFUT634AASGA9+DUD5tNWkY5OswynQk8o=;\n\th=From:To:CC:Date:References:In-Reply-To:Subject:List-Id:\n\t List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:\n\t From;\n\tb=OmnqKKc/ZY4y74jeTKHbB3vJyeWbgt3Epb7FGScreR5SKI5ylqYEk51uM9lNwxkKG\n\t HvuCrUjtbu6Ov64PALR3V7FhkCf4nr7XkPVys2UI/ys/V5xyShiltG5Fto8V0eIlkJ\n\t C9wcvWcRRrv17IGDRFYay0wSjFk34wwuBsY1QkmS5ZZvg36wv3605Lry8u5X9kOTbN\n\t If9E5neZtl+vL+wMpYXMEQRcDd2HvxjTX5sMvoRvE5EUPVba4jmSELC5T6HgteS8Gv\n\t gESaVdvzNM8m+5B+kiL3lJ7S4TC8pXG8zbxnmNqu1wwLYp/5yc4VWOfjTNYdfpXHI+\n\t sMxobcI0hsCVw==","Received-SPF":"Pass (mailfrom) identity=mailfrom; client-ip=198.175.65.9;\n helo=mgamail.intel.com; envelope-from=aleksandr.loktionov@intel.com;\n receiver=<UNKNOWN>","DMARC-Filter":"OpenDMARC Filter v1.4.2 smtp3.osuosl.org 6A55F6069C","X-CSE-ConnectionGUID":["4t9HGOmBQ5CHmFhRu7SjkA==","zMxgCwGwS8mpoEVR1Q3crw=="],"X-CSE-MsgGUID":["MCuXgI5bR72g/ExqAy0/5g==","fX3bIL2mRVKtjolkRukEtQ=="],"X-IronPort-AV":["E=McAfee;i=\"6800,10657,11754\"; a=\"99373247\"","E=Sophos;i=\"6.23,169,1770624000\"; d=\"scan'208\";a=\"99373247\"","E=Sophos;i=\"6.23,169,1770624000\"; d=\"scan'208\";a=\"225616227\""],"X-ExtLoop1":"1","ARC-Seal":"i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=Md12czbaWAe/c+tL70O2SkgzkUA1FRA2kh7eEXtRLbjwj0QAdNApmIraJJBnEagzTMOiZvOQoXwDUf8sDejII55cOaSZ7rrm8SntIQ1dRiWGrlyvEesa5/K9UHp/hHQEhpd1pbHris7B125VWb5l7lNO8GmxuXHLCBZ6KwUzvHjum+y+ROm07WbU0S954LBOmREvKHG5MfYugucLUA+gfjeWRP9X2zZfgdftSgUf5+053Mh+cWozd3EnFpjD+MU2OJTTPD5gkjlRLqV2fjAl4cQQv06br4OTfiy2gWSJlLBGAlm32ls68FL2eZTAj/5O86uRGYfwHCIryWFf0T72vA==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=y8hJ1WNmKubFUT634AASGA9+DUD5tNWkY5OswynQk8o=;\n b=MmjSq/nsPZJjRW/FNzELl/JF5V2JroJB8WLmvsrI12vz2jMKVChpYFQuOMNbdU6DekIQe17L5Edc807fbJqrF3p6pqFc2vXGsFmjhz9Fjlwx8W6S+Drc41tyCwzzzHdjxcLBJZ6ovI/2fOFC4mCcJQiglT1aYZBJWfT+yLEoGSEw4CP3u7+qtuSfTBuwQUbeIotm/hTFy/4KsF07cjG1FXm2NY4cWtJIiKDzKc5cVqJqce7yE9mITu0ovNeKKFG5L5f2UFpb4bJi1rgE7ZjfkydZr0Nr6RPXwGhtDHTlh1yCTFj/R+Dw3JJWNNM7uPZRYGdm6S9tUmGPp2FroO3dFw==","ARC-Authentication-Results":"i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com;\n dkim=pass header.d=intel.com; arc=none","From":"\"Loktionov, Aleksandr\" <aleksandr.loktionov@intel.com>","To":"Marcin Szycik <marcin.szycik@linux.intel.com>,\n \"intel-wired-lan@lists.osuosl.org\" <intel-wired-lan@lists.osuosl.org>","CC":"\"netdev@vger.kernel.org\" <netdev@vger.kernel.org>, \"Penigalapati, Sandeep\"\n <sandeep.penigalapati@intel.com>, \"S, Ananth\" <ananth.s@intel.com>,\n \"alexander.duyck@gmail.com\" <alexander.duyck@gmail.com>, \"Cao, Chinh T\"\n <chinh.t.cao@intel.com>, \"Nguyen, Anthony L\" <anthony.l.nguyen@intel.com>","Thread-Topic":"[Intel-wired-lan] [PATCH iwl-next v2 08/10] ice: program ACL\n entry","Thread-Index":"AQHcyCD95yn8KG9keU2R+fED82p+TrXWuk2g","Date":"Thu, 9 Apr 2026 13:35:59 +0000","Message-ID":"\n <IA3PR11MB898666B7AB0330B3C29DC630E5582@IA3PR11MB8986.namprd11.prod.outlook.com>","References":"<20260409120003.2719-1-marcin.szycik@linux.intel.com>\n <20260409120003.2719-9-marcin.szycik@linux.intel.com>","In-Reply-To":"<20260409120003.2719-9-marcin.szycik@linux.intel.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","x-ms-publictraffictype":"Email","x-ms-traffictypediagnostic":"IA3PR11MB8986:EE_|IA3PR11MB9184:EE_","x-ms-office365-filtering-correlation-id":"69b94d52-9118-4c8c-fa73-08de963cefd8","x-ms-exchange-senderadcheck":"1","x-ms-exchange-antispam-relay":"0","x-microsoft-antispam":"BCL:0;\n ARA:13230040|376014|1800799024|366016|38070700021|22082099003|18002099003|56012099003;","x-microsoft-antispam-message-info":"\n K/XjLFNsjpmNJAEwSKdEH9483D+/1rV+e24kZrmy/07UwK4hijl7phdYjhqGDanEaUS2FcQ7Du7oRXKHF84oZ7vqmO5e/lf2/EtpLzsQ8wk/uVkoKOjgyxfrn7cg25W24CbkaZXTLINWm29TZOZpy53veiiMgzNlIsITolFJKP7H7bQrbyDTbTATOgaI8ZwEFx3kuEtLAYA3YSZvtCDNRSAx8GzkquY0u7jdOUrzgwDQ1QL25oPhHrK4rCx41FeY8rDdCzxGqTY7OwmehkkxVtcl4kAUXU1DBm/V7sVkzjJGHesjw01LBARwpTlvGvKTyR8+vGWAI6fUDY/jlX60qbNAoqoLDfuGilueT3CA26xsUSbs1So0fQNdgXTwKykOlR+G5qnWXVR1UN8iJ+AnXfnt5ryCOoB1ACt6mIzck9wcbL2FHPFefZPq+aw6YaPR40wsFNBqulGHQ2J5f0//JGkRms/Rnm10DNtOZ2513A+NA5k+mn9nZEf4yslpVruagVnb8Np7AzEoP5Y+F8W7jQDVoNY/vdHunV5jD9xvA4o6g9cGSAv3d82LROOTRkkOdp3ORpb6xD0bbxWuFRpvL5S4WvyhLpVu+BwCawzsRL+T6M6npat3P4Rf3xBTD/IsUNYSc7AG/Iyw1uJT33r4y+z4LuV0c+JqBIVyG29L+Is6PZ5arKEmWXg1D+pnoIaOMnat3u83m9PNzBFihJiOxzI0rgjrJH6r9F1UEY6opfqCN7Jf6cP1BcXBuuv1lLbe9+TdoyWrDhlm9UCrPFLjQGc8dkGoL6lbdU+kfeMUil4=","x-forefront-antispam-report":"CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:IA3PR11MB8986.namprd11.prod.outlook.com; PTR:; CAT:NONE;\n SFS:(13230040)(376014)(1800799024)(366016)(38070700021)(22082099003)(18002099003)(56012099003);\n DIR:OUT; SFP:1101;","x-ms-exchange-antispam-messagedata-chunkcount":"1","x-ms-exchange-antispam-messagedata-0":"\n Pf9ny4zouKdRsS7dMf5ha4vdzvNMzDLh21xGTzJSHsELcn4qXI5c0mC9WIqza5tIgOe7Ac9ggxVhq3IscqA477vAkyyf3H9ILGSQ+EWyUUzbEBZNhyMFummGWhZrc7iuDPRgBf2qHnbe2E4KW/YD16zGH6gnCAklGewA3nCox2Nd5c2VVQjYKQ2fEwOalfo5nlPsgwAk7Kx9WjOi5WUv0ijY4V35m13lh021y9Ahs4l0pgm+5o5D0SSQ5mviQZArcGg/KI93+aCaSur+Kq6O0J6LCPNS2vpBSXwMSDDpv+hNmS7Yr/JbZCJPWKomiZUkJzttLX1K80+lLGlzcsN6aiSyvvyzAznZCULd5Br1PyM00g9Ypx5+/glkUDc3lAoArufK29HMgQ9GeMkimJ3azoek6Wwlqp7SfdAiE+VelPQdcB+wjN+gyB61yKpTndfQIZTwmZNHBrbtSNXP3UjQo7oCuKWmhEurGiLnvC1Zew/RODsxJN1RPjUB65/xpjVglel5Q3UpZx0co2FeFhqHB4WI+eeIcF6fGqHlEy1bhXgexfn5bwVAGxkRGto6SlruD1FCHq3eOn8BDLC2JuYDqu0OdQX2ZuPoFi0GGNnOoqiCMZVS162bJAxCztPV7SNUiTOGGdLHWTBQUXrDPAo2NODSqahu3gntEXCnDs0tLCgj/7qhOs9zMdXIUPJQLM/sBpuZecobbYFc7h7tMsrjCbjub3B++d5mNTDvgOkUlBzF+pg5zuqFDn5Nxr01qxL8L9A8jOO+wqhqLhV3Hx9T27T/3dDyQNFcVzc11d0s0oCYOMZ2YvFQmG8mrFC2aNk3XeUAXbnPkr5HZ4TE0wkQmHrJQZ5V94NSO8495hnspIb2Fc5OE/inUGxTneaiP02AaifBa8KlqHQ8L7c6ic0d7i2dGrX7qd7wTj9leE9aFJuQNP6IsM3yOmRH9LxPjjW/H3P8KQPR8sQtWe1T8n+3ojFsFa8sQMBDKAcuKudUq5krDf0SEyM6R1TTt4fwKaHkIyY/ItOKHZggABNNAA0mPn1JYJeOKEjwNpnwRtCBRsB8+5F3Qvzj92vpNlJQAgf7HL/uc4WtUwBfylYNcZjsOXyr0xBdUaeHi21DRtuMNxom2pMRv8uQsYQNVQc8VFHeT29McU95+YJofyAlZ96Em/RUC825Anykm2OpB1cFyrCWt3SgRsitc/6XV6bdxYf5OUpgpVR5MM1mPJ7ynGh3RGQGp+3lDLcVNkGm2KrE25M85jLIpn1vcP/8s2Oghz5cZ6b6yawJg66kIIFOPPj5cv0iXBeqxedQlSCzhuND5o7mXv+TiXzqU01c9DZg3p2aiiUU08cQ4EI8uRhEqfbvKiKR/mZd4C8VO9VvNJTOYh0YzQh5grS60x15Pb/AgsFk56jjIsblOguKnKAkHNO4/9Xe8GKjfvrjjXx2OZqjE2uAD6FmIuA5F7g+NN8oOplDVpxM0MxVuxklj9/fDHnNkN6h1a4HAI6WgCylOv28T2q+vE1VtMuG5s32ENoq2GiS7fjxyjDDc5lLSKNfYdJ8M4FOecfWHLR3XvBbRhqnzJ8W5krjYz3iDEiofiiDguUXDFk5OziQihN12D1pgRXqkSqIBbkRPZzYY4Jyyd8YWIrhYptXQ43f/V5FBQmZ1bUygzOv99Pfyql8MtYd9jBbxu8Vcvgu8hp/lG+tPmu1BcogH8WZl3sqtS5RmTmP95dhphTRvQJxSUr8qZ1mBOIATqyJvV80DAycOnQrTQ0fnY0=","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-Exchange-RoutingPolicyChecked":"\n bVu+yCphImgwHn6rKKCONUOEZGq0xaMUitkyInvMtT98tprAOvaSMxpZTjoFu6IXphcCM1myVWERdcaKPlu5TKlcCZ9XTIZi6kHrb1G2u9eUatgNMBdqZg/0xiHlM3JRnQcRAVB00tA33cQOrRgNjECajza3WcQTtTUbParnWNx1XHwulsCB/6oD7hLgMEKNBMA+yAzxMYaGUYolP+qJgWtHG/DAFKoVzSJAMD6lXJs6xeXFkIO1NUOrHhX1HIhJj2MIJv6zRkkcheXiZdjfl8UtGADAHQBu1/Ve0RxRmuctQtHN2DODzt5ePLrTfCL1oRTaO3+Rk1nr8F19HMpp5A==","X-MS-Exchange-CrossTenant-AuthAs":"Internal","X-MS-Exchange-CrossTenant-AuthSource":"IA3PR11MB8986.namprd11.prod.outlook.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n 69b94d52-9118-4c8c-fa73-08de963cefd8","X-MS-Exchange-CrossTenant-originalarrivaltime":"09 Apr 2026 13:35:59.9313 (UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"46c98d88-e344-4ed4-8496-4ed7712e255d","X-MS-Exchange-CrossTenant-mailboxtype":"HOSTED","X-MS-Exchange-CrossTenant-userprincipalname":"\n 3eotatjdgZbMCf4oecPUUQm2YhWxfxfX6k87an+4XfPZ3zgenatgzLRircpZtmdOhRG/FsOAMFoRa+sIA7MqZrO5FSRUU2xWSpQdgP9QExU=","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"IA3PR11MB9184","X-OriginatorOrg":"intel.com","X-Mailman-Original-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1775741766; x=1807277766;\n h=from:to:cc:subject:date:message-id:references:\n in-reply-to:content-transfer-encoding:mime-version;\n bh=VkZcj+BqyQKuVznzfGTPv3HIaIDFqIEkreF48vv+NnE=;\n b=jmkT+RNXfV7pq1wTd0UsKhwl6J2VmwlEhQg6oTV/U58li8oPup7trcrl\n 6QRSO2w7VvBXVOAOlP1kfnofStKbLOsCVvEjVRuOOu3q9sOTsE4y8pJi4\n 9Jtrde+lSMt0XIkRIa8IEANDrFIi6OKf8q0qhdQW8jhCyOmy5iSgEJRQ9\n Ep6MfaJw8GqubEooxN49ExdDD/ufPzEOn7HO5fbQIGsmKVa2NZX37aRnX\n mbIsPPmOfTmJnB5oC56VB75CVplz1ipEkzasTXhuCoJWPMckVtUb1Q4Fz\n eEYJNrGNGcPH+ajr69vYgF4xGckZI+SY2zvDJ+Wf1bmlkPDN9sSLdnfhh\n w==;","X-Mailman-Original-Authentication-Results":["smtp3.osuosl.org;\n dmarc=pass (p=none dis=none)\n header.from=intel.com","smtp3.osuosl.org;\n dkim=pass (2048-bit key,\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=jmkT+RNX","dkim=none (message not signed)\n header.d=none;dmarc=none action=none header.from=intel.com;"],"Subject":"Re: [Intel-wired-lan] [PATCH iwl-next v2 08/10] ice: program ACL\n entry","X-BeenThere":"intel-wired-lan@osuosl.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>","List-Unsubscribe":"<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>","List-Archive":"<http://lists.osuosl.org/pipermail/intel-wired-lan/>","List-Post":"<mailto:intel-wired-lan@osuosl.org>","List-Help":"<mailto:intel-wired-lan-request@osuosl.org?subject=help>","List-Subscribe":"<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>","Errors-To":"intel-wired-lan-bounces@osuosl.org","Sender":"\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"}},{"id":3676649,"web_url":"http://patchwork.ozlabs.org/comment/3676649/","msgid":"<44f2e76c-d573-4eb0-87f5-0c91e6340715@linux.intel.com>","list_archive_url":null,"date":"2026-04-13T10:57:30","subject":"Re: [Intel-wired-lan] [PATCH iwl-next v2 08/10] ice: program ACL\n entry","submitter":{"id":82782,"url":"http://patchwork.ozlabs.org/api/people/82782/","name":"Marcin Szycik","email":"marcin.szycik@linux.intel.com"},"content":"On 09.04.2026 15:35, Loktionov, Aleksandr wrote:\n> \n> \n>> -----Original Message-----\n>> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf\n>> Of Marcin Szycik\n>> Sent: Thursday, April 9, 2026 2:00 PM\n>> To: intel-wired-lan@lists.osuosl.org\n>> Cc: netdev@vger.kernel.org; Penigalapati, Sandeep\n>> <sandeep.penigalapati@intel.com>; S, Ananth <ananth.s@intel.com>;\n>> alexander.duyck@gmail.com; Marcin Szycik\n>> <marcin.szycik@linux.intel.com>; Cao, Chinh T <chinh.t.cao@intel.com>;\n>> Nguyen, Anthony L <anthony.l.nguyen@intel.com>\n>> Subject: [Intel-wired-lan] [PATCH iwl-next v2 08/10] ice: program ACL\n>> entry\n>>\n>> From: Real Valiquette <real.valiquette@intel.com>\n>>\n>> Complete the filter programming process; set the flow entry and action\n>> into the scenario and write it to hardware. Configure the VSI for ACL\n>> filters.\n>>\n>> Co-developed-by: Chinh Cao <chinh.t.cao@intel.com>\n>> Signed-off-by: Chinh Cao <chinh.t.cao@intel.com>\n>> Signed-off-by: Real Valiquette <real.valiquette@intel.com>\n>> Co-developed-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n>> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n>> Signed-off-by: Marcin Szycik <marcin.szycik@linux.intel.com>\n>> ---\n>> v2:\n>> * Use plain alloc instead of devm_ for ice_flow_entry::acts\n>> * Use FIELD_PREP_CONST() for ICE_ACL_RX_*_MISS_CNTR\n>> * Fix wrong struct ice_acl_act_entry alloc count in\n>>   ice_flow_acl_add_scen_entry_sync() - was e->entry_sz, which is an\n>>   unrelated value\n>> * Only set acts_cnt after successful allocation in\n>>   ice_flow_acl_add_scen_entry_sync()\n>> * Return -EINVAL instead of -ENOSPC on wrong index in\n>>   ice_acl_scen_free_entry_idx()\n>> ---\n>>  drivers/net/ethernet/intel/ice/ice.h          |   2 +\n>>  drivers/net/ethernet/intel/ice/ice_acl.h      |  21 +\n>>  .../net/ethernet/intel/ice/ice_adminq_cmd.h   |   2 +\n>>  drivers/net/ethernet/intel/ice/ice_flow.h     |   3 +\n>>  drivers/net/ethernet/intel/ice/ice_acl.c      |  53 ++-\n>>  drivers/net/ethernet/intel/ice/ice_acl_ctrl.c | 251 +++++++++++\n>>  drivers/net/ethernet/intel/ice/ice_acl_main.c |   4 +\n>>  .../ethernet/intel/ice/ice_ethtool_ntuple.c   |  48 ++-\n>>  drivers/net/ethernet/intel/ice/ice_flow.c     | 395\n>> ++++++++++++++++++\n>>  drivers/net/ethernet/intel/ice/ice_lib.c      |  10 +-\n>>  10 files changed, 782 insertions(+), 7 deletions(-)\n>>\n>> diff --git a/drivers/net/ethernet/intel/ice/ice.h\n>> b/drivers/net/ethernet/intel/ice/ice.h\n>> index 9e6643931022..f9a43daf04fe 100644\n>> --- a/drivers/net/ethernet/intel/ice/ice.h\n>> +++ b/drivers/net/ethernet/intel/ice/ice.h\n>> @@ -1061,6 +1061,8 @@ void ice_aq_prep_for_event(struct ice_pf *pf,\n>> struct ice_aq_task *task,\n>>  \t\t\t   u16 opcode);\n>>  int ice_aq_wait_for_event(struct ice_pf *pf, struct ice_aq_task\n>> *task,\n>>  \t\t\t  unsigned long timeout);\n>> +int ice_ntuple_update_list_entry(struct ice_pf *pf,\n>> +\t\t\t\t struct ice_ntuple_fltr *input, int\n>> fltr_idx);\n>>  int ice_open(struct net_device *netdev);  int\n>> ice_open_internal(struct net_device *netdev);  int ice_stop(struct\n>> net_device *netdev); diff --git\n>> a/drivers/net/ethernet/intel/ice/ice_acl.h\n>> b/drivers/net/ethernet/intel/ice/ice_acl.h\n>> index 3a4adcf368cf..0b5651401eb7 100644\n>> --- a/drivers/net/ethernet/intel/ice/ice_acl.h\n>> +++ b/drivers/net/ethernet/intel/ice/ice_acl.h\n>> @@ -39,6 +39,7 @@ struct ice_acl_tbl {\n>>  \tDECLARE_BITMAP(avail, ICE_AQC_ACL_ALLOC_UNITS);  };\n>>\n>> +#define ICE_MAX_ACL_TCAM_ENTRY (ICE_AQC_ACL_TCAM_DEPTH *\n>> +ICE_AQC_ACL_SLICES)\n>>  enum ice_acl_entry_prio {\n>>  \tICE_ACL_PRIO_LOW = 0,\n>>  \tICE_ACL_PRIO_NORMAL,\n>> @@ -65,6 +66,11 @@ struct ice_acl_scen {\n>>  \t * participate in this scenario\n>>  \t */\n>>  \tDECLARE_BITMAP(act_mem_bitmap, ICE_AQC_MAX_ACTION_MEMORIES);\n> \n> ...\n> \n>> +\t/* Determine number of cascaded TCAMs */\n>> +\tnum_cscd = DIV_ROUND_UP(scen->width,\n>> ICE_AQC_ACL_KEY_WIDTH_BYTES);\n>> +\n>> +\tentry_tcam = ICE_ACL_TBL_TCAM_IDX(scen->start);\n>> +\tidx = ICE_ACL_TBL_TCAM_ENTRY_IDX(scen->start + *entry_idx);\n>> +\n>> +\tfor (u8 i = 0; i < num_cscd; i++) {\n>> +\t\t/* If the key spans more than one TCAM in the case of\n>> cascaded\n>> +\t\t * TCAMs, the key and key inverts need to be properly\n>> split\n>> +\t\t * among TCAMs.E.g.bytes 0 - 4 go to an index in the\n>> first TCAM\n> \"E.g.bytes\" -> \"E.g. bytes\"\n> \n>> +\t\t * and bytes 5 - 9 go to the same index in the next\n>> TCAM, etc.\n>> +\t\t * If the entry spans more than one TCAM in a cascaded\n>> TCAM\n>> +\t\t * mode, the programming of the entries in the TCAMs\n>> must be in\n>> +\t\t * reversed order - the TCAM entry of the rightmost TCAM\n>> should\n>> +\t\t * be programmed first; the TCAM entry of the leftmost\n>> TCAM\n>> +\t\t * should be programmed last.\n>> +\t\t */\n>> +\t\toffset = num_cscd - i - 1;\n>> +\t\tmemcpy(&buf.entry_key.val,\n>> +\t\t       &keys[offset * sizeof(buf.entry_key.val)],\n>> +\t\t       sizeof(buf.entry_key.val));\n>> +\t\tmemcpy(&buf.entry_key_invert.val,\n>> +\t\t       &inverts[offset *\n>> sizeof(buf.entry_key_invert.val)],\n>> +\t\t       sizeof(buf.entry_key_invert.val));\n>> +\t\terr = ice_aq_program_acl_entry(hw, entry_tcam + offset,\n>> idx,\n>> +\t\t\t\t\t       &buf, NULL);\n>> +\t\tif (err) {\n>> +\t\t\tice_debug(hw, ICE_DBG_ACL, \"aq program acl entry\n>> failed status: %d\\n\",\n>> +\t\t\t\t  err);\n>> +\t\t\tgoto out;\n>> +\t\t}\n>> +\t}\n>> +\n>> +\terr = ice_acl_prog_act(hw, scen, acts, acts_cnt, *entry_idx);\n>> +\n>> +out:\n>> +\tif (err) {\n>> +\t\tice_acl_rem_entry(hw, scen, *entry_idx);\n>> +\t\t*entry_idx = 0;\n>> +\t}\n>> +\n>> +\treturn err;\n>> +}\n>> +\n>> +/**\n>> + * ice_acl_prog_act - Program a scenario's action memory\n>> + * @hw: pointer to the HW struct\n>> + * @scen: scenario to add the entry to\n>> + * @acts: pointer to a buffer containing formatted actions\n>> + * @acts_cnt: indicates the number of actions stored in \"acts\"\n>> + * @entry_idx: scenario relative index of the added flow entry\n>> + *\n>> + * Return: 0 on success, negative on error  */ int\n>> +ice_acl_prog_act(struct ice_hw *hw, struct ice_acl_scen *scen,\n>> +\t\t     struct ice_acl_act_entry *acts, u8 acts_cnt, u16\n>> entry_idx) {\n>> +\tu8 entry_tcam, num_cscd, i, actx_idx = 0;\n>> +\tstruct ice_aqc_actpair act_buf = {};\n>> +\tint err = 0;\n>> +\tu16 idx;\n>> +\n>> +\tif (entry_idx >= scen->num_entry)\n>> +\t\treturn -ENOSPC;\n>> +\n>> +\t/* Determine number of cascaded TCAMs */\n>> +\tnum_cscd = DIV_ROUND_UP(scen->width,\n>> ICE_AQC_ACL_KEY_WIDTH_BYTES);\n>> +\n>> +\tentry_tcam = ICE_ACL_TBL_TCAM_IDX(scen->start);\n>> +\tidx = ICE_ACL_TBL_TCAM_ENTRY_IDX(scen->start + entry_idx);\n>> +\n>> +\tfor_each_set_bit(i, scen->act_mem_bitmap,\n>> ICE_AQC_MAX_ACTION_MEMORIES) {\n>> +\t\tstruct ice_acl_act_mem *mem = &hw->acl_tbl->act_mems[i];\n>> +\n>> +\t\tif (actx_idx >= acts_cnt)\n>> +\t\t\tbreak;\n>> +\t\tif (mem->member_of_tcam >= entry_tcam &&\n>> +\t\t    mem->member_of_tcam < entry_tcam + num_cscd) {\n>> +\t\t\tmemcpy(&act_buf.act[0], &acts[actx_idx],\n>> +\t\t\t       sizeof(struct ice_acl_act_entry));\n>> +\n>> +\t\t\tif (++actx_idx < acts_cnt) {\n>> +\t\t\t\tmemcpy(&act_buf.act[1], &acts[actx_idx],\n>> +\t\t\t\t       sizeof(struct ice_acl_act_entry));\n>> +\t\t\t}\n>> +\n>> +\t\t\terr = ice_aq_program_actpair(hw, i, idx,\n>> &act_buf,\n>> +\t\t\t\t\t\t     NULL);\n>> +\t\t\tif (err) {\n>> +\t\t\t\tice_debug(hw, ICE_DBG_ACL, \"program actpair\n>> failed status: %d\\n\",\n>> +\t\t\t\t\t  err);\n>> +\t\t\t\tbreak;\n>> +\t\t\t}\n>> +\t\t\tactx_idx++;\n>> +\t\t}\n>> +\t}\n>> +\n>> +\tif (!err && actx_idx < acts_cnt)\n>> +\t\terr = -ENOSPC;\n>> +\n>> +\treturn err;\n>> +}\n>> +\n>> +/**\n>> + * ice_acl_rem_entry - Remove a flow entry from an ACL scenario\n>> + * @hw: pointer to the HW struct\n>> + * @scen: scenario to remove the entry from\n>> + * @entry_idx: the scenario-relative index of the flow entry being\n>> +removed\n>> + *\n>> + * Return: 0 on success, negative on error  */ int\n>> +ice_acl_rem_entry(struct ice_hw *hw, struct ice_acl_scen *scen,\n>> +\t\t      u16 entry_idx)\n>> +{\n>> +\tstruct ice_aqc_actpair act_buf = {};\n>> +\tstruct ice_aqc_acl_data buf;\n>> +\tu8 entry_tcam, num_cscd, i;\n>> +\tint err = 0;\n>> +\tu16 idx;\n>> +\n>> +\tif (!scen)\n>> +\t\treturn -ENOENT;\n>> +\n>> +\tif (entry_idx >= scen->num_entry)\n>> +\t\treturn -ENOSPC;\n>> +\n>> +\tif (!test_bit(entry_idx, scen->entry_bitmap))\n>> +\t\treturn -ENOENT;\n>> +\n>> +\t/* Determine number of cascaded TCAMs */\n>> +\tnum_cscd = DIV_ROUND_UP(scen->width,\n>> ICE_AQC_ACL_KEY_WIDTH_BYTES);\n>> +\n>> +\tentry_tcam = ICE_ACL_TBL_TCAM_IDX(scen->start);\n>> +\tidx = ICE_ACL_TBL_TCAM_ENTRY_IDX(scen->start + entry_idx);\n>> +\n>> +\t/* invalidate the flow entry */\n>> +\tmemset(&buf, 0, sizeof(buf));\n>> +\tfor (i = 0; i < num_cscd; i++) {\n>> +\t\terr = ice_aq_program_acl_entry(hw, entry_tcam + i, idx,\n>> &buf,\n>> +\t\t\t\t\t       NULL);\n>> +\t\tif (err)\n>> +\t\t\tice_debug(hw, ICE_DBG_ACL, \"AQ program ACL entry\n>> failed status: %d\\n\",\n>> +\t\t\t\t  err);\n>> +\t}\n>> +\n>> +\tfor_each_set_bit(i, scen->act_mem_bitmap,\n>> ICE_AQC_MAX_ACTION_MEMORIES) {\n>> +\t\tstruct ice_acl_act_mem *mem = &hw->acl_tbl->act_mems[i];\n>> +\n>> +\t\tif (mem->member_of_tcam >= entry_tcam &&\n>> +\t\t    mem->member_of_tcam < entry_tcam + num_cscd) {\n>> +\t\t\t/* Invalidate allocated action pairs */\n>> +\t\t\terr = ice_aq_program_actpair(hw, i, idx,\n>> &act_buf,\n>> +\t\t\t\t\t\t     NULL);\n>> +\t\t\tif (err)\n>> +\t\t\t\tice_debug(hw, ICE_DBG_ACL, \"program actpair\n>> failed status: %d\\n\",\n>> +\t\t\t\t\t  err);\n>> +\t\t}\n>> +\t}\n>> +\n>> +\tice_acl_scen_free_entry_idx(scen, entry_idx);\n>> +\n>> +\treturn err;\n>> +}\n>> diff --git a/drivers/net/ethernet/intel/ice/ice_acl_main.c\n>> b/drivers/net/ethernet/intel/ice/ice_acl_main.c\n>> index 53cca0526756..16228be574ed 100644\n>> --- a/drivers/net/ethernet/intel/ice/ice_acl_main.c\n>> +++ b/drivers/net/ethernet/intel/ice/ice_acl_main.c\n>> @@ -280,6 +280,10 @@ int ice_acl_add_rule_ethtool(struct ice_vsi *vsi,\n>> struct ethtool_rxnfc *cmd)\n>>  \t\thw_prof->entry_h[hw_prof->cnt++][0] = entry_h;\n>>  \t}\n>>\n>> +\tinput->acl_fltr = true;\n>> +\t/* input struct is added to the HW filter list */\n>> +\tice_ntuple_update_list_entry(pf, input, fsp->location);\n>> +\n>>  \treturn 0;\n>>\n>>  free_input:\n>> diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c\n>> b/drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c\n>> index 3e79c0bf40f4..21d4f4e3a1d0 100644\n>> --- a/drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c\n>> +++ b/drivers/net/ethernet/intel/ice/ice_ethtool_ntuple.c\n>> @@ -1791,6 +1791,21 @@ void ice_vsi_manage_fdir(struct ice_vsi *vsi,\n>> bool ena)\n>>  \tmutex_unlock(&hw->fdir_fltr_lock);\n>>  }\n>>\n>> +/**\n>> + * ice_del_acl_ethtool - delete an ACL rule entry\n>> + * @hw: pointer to HW instance\n>> + * @fltr: filter structure\n>> + *\n>> + * Return: 0 on success, negative on error  */ static int\n>> +ice_del_acl_ethtool(struct ice_hw *hw, struct ice_ntuple_fltr *fltr)\n>> {\n>> +\tu64 entry;\n>> +\n>> +\tentry = ice_flow_find_entry(hw, ICE_BLK_ACL, fltr->fltr_id);\n>> +\treturn ice_flow_rem_entry(hw, ICE_BLK_ACL, entry); }\n>> +\n>>  /**\n>>   * ice_fdir_do_rem_flow - delete flow and possibly add perfect flow\n>>   * @pf: PF structure\n>> @@ -1824,7 +1839,7 @@ ice_fdir_do_rem_flow(struct ice_pf *pf, enum\n>> ice_fltr_ptype flow_type)\n>>   *\n>>   * Return: 0 on success and negative on errors\n>>   */\n>> -static int\n>> +int\n>>  ice_ntuple_update_list_entry(struct ice_pf *pf, struct\n>> ice_ntuple_fltr *input,\n>>  \t\t\t     int fltr_idx)\n>>  {\n>> @@ -1843,13 +1858,36 @@ ice_ntuple_update_list_entry(struct ice_pf\n>> *pf, struct ice_ntuple_fltr *input,\n>>\n>>  \told_fltr = ice_fdir_find_fltr_by_idx(hw, fltr_idx);\n>>  \tif (old_fltr) {\n>> -\t\terr = ice_fdir_write_all_fltr(pf, old_fltr, false);\n>> -\t\tif (err)\n>> -\t\t\treturn err;\n>> +\t\tif (old_fltr->acl_fltr) {\n>> +\t\t\t/* ACL filter - if the input buffer is present\n>> +\t\t\t * then this is an update and we don't want to\n>> +\t\t\t * delete the filter from the HW. We've already\n>> +\t\t\t * written the change to the HW at this point, so\n>> +\t\t\t * just update the SW structures to make sure\n>> +\t\t\t * everything is hunky-dory. If no input then\n>> this\n>> +\t\t\t * is a delete so we should delete the filter\n>> from\n>> +\t\t\t * the HW and clean up our SW structures.\n>> +\t\t\t */\n>> +\t\t\tif (!input) {\n>> +\t\t\t\terr = ice_del_acl_ethtool(hw, old_fltr);\n>> +\t\t\t\tif (err)\n>> +\t\t\t\t\treturn err;\n>> +\t\t\t}\n>> +\t\t} else {\n>> +\t\t\t/* FD filter */\n>> +\t\t\terr = ice_fdir_write_all_fltr(pf, old_fltr,\n>> false);\n>> +\t\t\tif (err)\n>> +\t\t\t\treturn err;\n>> +\t\t}\n>> +\n>>  \t\tice_fdir_update_cntrs(hw, old_fltr->flow_type, false,\n>> false);\n>>  \t\t/* update sb-filters count, specific to ring->channel */\n>>  \t\tice_update_per_q_fltr(vsi, old_fltr->orig_q_index,\n>> false);\n>> -\t\tif (!input && !hw->fdir_fltr_cnt[old_fltr->flow_type])\n>> +\t\t/* Also delete the HW filter info if we have just\n>> deleted the\n>> +\t\t * last filter of flow_type.\n>> +\t\t */\n>> +\t\tif (!old_fltr->acl_fltr && !input &&\n>> +\t\t    !hw->fdir_fltr_cnt[old_fltr->flow_type])\n>>  \t\t\t/* we just deleted the last filter of flow_type\n>> so we\n>>  \t\t\t * should also delete the HW filter info.\n>>  \t\t\t */\n>> diff --git a/drivers/net/ethernet/intel/ice/ice_flow.c\n>> b/drivers/net/ethernet/intel/ice/ice_flow.c\n>> index dce6d2ffcb15..144d8326d4f9 100644\n>> --- a/drivers/net/ethernet/intel/ice/ice_flow.c\n>> +++ b/drivers/net/ethernet/intel/ice/ice_flow.c\n>> @@ -1744,6 +1744,16 @@ static int ice_flow_rem_entry_sync(struct\n>> ice_hw *hw, enum ice_block blk,\n>>  \t\treturn -EINVAL;\n>>\n>>  \tif (blk == ICE_BLK_ACL) {\n>> +\t\tint err;\n>> +\n>> +\t\tif (!entry->prof)\n>> +\t\t\treturn -EINVAL;\n>> +\n>> +\t\terr = ice_acl_rem_entry(hw, entry->prof->cfg.scen,\n>> +\t\t\t\t\tentry->scen_entry_idx);\n>> +\t\tif (err)\n>> +\t\t\treturn err;\n>> +\n>>  \t\tif (entry->acts_cnt && entry->acts)\n>>  \t\t\tice_flow_acl_free_act_cntr(hw, entry->acts,\n>>  \t\t\t\t\t\t   entry->acts_cnt);\n>> @@ -1879,10 +1889,34 @@ ice_flow_rem_prof_sync(struct ice_hw *hw, enum\n>> ice_block blk,\n>>  \t}\n>>\n>>  \tif (blk == ICE_BLK_ACL) {\n>> +\t\tstruct ice_aqc_acl_prof_generic_frmt buf;\n>> +\t\tu8 prof_id = 0;\n>> +\n>>  \t\t/* Disassociate the scenario from the profile for the PF\n>> */\n>>  \t\tstatus = ice_flow_acl_disassoc_scen(hw, prof);\n>>  \t\tif (status)\n>>  \t\t\treturn status;\n>> +\n>> +\t\tstatus = ice_flow_get_hw_prof(hw, blk, prof->id,\n>> &prof_id);\n>> +\t\tif (status)\n>> +\t\t\treturn status;\n>> +\n>> +\t\tstatus = ice_query_acl_prof(hw, prof_id, &buf, NULL);\n>> +\t\tif (status)\n>> +\t\t\treturn status;\n>> +\n>> +\t\t/* Clear the range-checker if the profile ID is no\n>> longer\n>> +\t\t * used by any PF\n>> +\t\t */\n>> +\t\tif (!ice_flow_acl_is_prof_in_use(&buf)) {\n>> +\t\t\t/* Clear the range-checker value for profile ID\n>> */\n>> +\t\t\tstruct ice_aqc_acl_profile_ranges query_rng_buf =\n>> {};\n>> +\n>> +\t\t\tstatus = ice_prog_acl_prof_ranges(hw, prof_id,\n>> +\t\t\t\t\t\t\t  &query_rng_buf,\n>> NULL);\n>> +\t\t\tif (status)\n>> +\t\t\t\treturn status;\n>> +\t\t}\n>>  \t}\n>>\n>>  \t/* Remove all hardware profiles associated with this flow\n>> profile */ @@ -2214,6 +2248,44 @@ int ice_flow_rem_prof(struct ice_hw\n>> *hw, enum ice_block blk, u64 prof_id)\n>>  \treturn status;\n>>  }\n>>\n>> +/**\n>> + * ice_flow_find_entry - look for a flow entry using its unique ID\n>> + * @hw: pointer to the HW struct\n>> + * @blk: classification stage\n>> + * @entry_id: unique ID to identify this flow entry\n>> + *\n>> + * Look for the flow entry with the specified unique ID in all flow\n>> +profiles of\n>> + * the specified classification stage.\n>> + *\n>> + * Return: flow entry handle if entry found, ICE_FLOW_ENTRY_ID_INVAL\n>> +otherwise  */\n>> +u64 ice_flow_find_entry(struct ice_hw *hw, enum ice_block blk, u64\n>> +entry_id) {\n>> +\tstruct ice_flow_entry *found = NULL;\n>> +\tstruct ice_flow_prof *p;\n>> +\n>> +\tmutex_lock(&hw->fl_profs_locks[blk]);\n>> +\n>> +\tlist_for_each_entry(p, &hw->fl_profs[blk], l_entry) {\n>> +\t\tstruct ice_flow_entry *e;\n>> +\n>> +\t\tmutex_lock(&p->entries_lock);\n>> +\t\tlist_for_each_entry(e, &p->entries, l_entry)\n>> +\t\t\tif (e->id == entry_id) {\n>> +\t\t\t\tfound = e;\n>> +\t\t\t\tbreak;\n>> +\t\t\t}\n>> +\t\tmutex_unlock(&p->entries_lock);\n>> +\n>> +\t\tif (found)\n>> +\t\t\tbreak;\n>> +\t}\n>> +\n>> +\tmutex_unlock(&hw->fl_profs_locks[blk]);\n>> +\n>> +\treturn found ? ICE_FLOW_ENTRY_HNDL(found) :\n>> +ICE_FLOW_ENTRY_HANDLE_INVAL; }\n>> +\n>>  /**\n>>   * ice_flow_acl_check_actions - Checks the ACL rule's actions\n>>   * @hw: pointer to the hardware structure @@ -2541,6 +2613,325 @@\n>> static int ice_flow_acl_frmt_entry(struct ice_hw *hw,\n>>\n>>  \treturn err;\n>>  }\n>> +\n>> +/**\n>> + * ice_flow_acl_find_scen_entry_cond - Find an ACL scenario entry\n>> that matches\n>> + *\t\t\t\t       the compared data\n>> + * @prof: pointer to flow profile\n>> + * @e: pointer to the comparing flow entry\n>> + * @do_chg_action: decide if we want to change the ACL action\n>> + * @do_add_entry: decide if we want to add the new ACL entry\n>> + * @do_rem_entry: decide if we want to remove the current ACL entry\n>> + *\n>> + * Find an ACL scenario entry that matches the compared data. Also\n>> figure out:\n>> + * a) If we want to change the ACL action\n>> + * b) If we want to add the new ACL entry\n>> + * c) If we want to remove the current ACL entry\n>> + *\n>> + * Return: ACL scenario entry, or NULL if not found  */ static struct\n>> +ice_flow_entry * ice_flow_acl_find_scen_entry_cond(struct\n>> ice_flow_prof\n>> +*prof,\n>> +\t\t\t\t  struct ice_flow_entry *e, bool\n>> *do_chg_action,\n>> +\t\t\t\t  bool *do_add_entry, bool *do_rem_entry) {\n>> +\tstruct ice_flow_entry *p, *return_entry = NULL;\n>> +\n>> +\t/* Check if:\n>> +\t * a) There exists an entry with same matching data, but\n>> different\n>> +\t *    priority, then we remove this existing ACL entry. Then,\n>> we\n>> +\t *    will add the new entry to the ACL scenario.\n>> +\t * b) There exists an entry with same matching data, priority,\n>> and\n>> +\t *    result action, then we do nothing\n>> +\t * c) There exists an entry with same matching data, priority,\n>> but\n>> +\t *    different, action, then do only change the action's\n>> entry.\n> Too much of commas, please reduce the number.\n> \n> \n>> +\t * d) Else, we add this new entry to the ACL scenario.\n>> +\t */\n>> +\t*do_chg_action = false;\n>> +\t*do_add_entry = true;\n>> +\t*do_rem_entry = false;\n>> +\tlist_for_each_entry(p, &prof->entries, l_entry) {\n>> +\t\tif (memcmp(p->entry, e->entry, p->entry_sz))\n>> +\t\t\tcontinue;\n>> +\n>> +\t\t/* From this point, we have the same matching_data. */\n>> +\t\t*do_add_entry = false;\n>> +\t\treturn_entry = p;\n>> +\n>> +\t\tif (p->priority != e->priority) {\n>> +\t\t\t/* matching data && !priority */\n>> +\t\t\t*do_add_entry = true;\n>> +\t\t\t*do_rem_entry = true;\n>> +\t\t\tbreak;\n>> +\t\t}\n>> +\n>> +\t\t/* From this point, we will have matching_data &&\n>> priority */\n>> +\t\tif (p->acts_cnt != e->acts_cnt)\n>> +\t\t\t*do_chg_action = true;\n>> +\t\tfor (int i = 0; i < p->acts_cnt; i++) {\n>> +\t\t\tbool found_not_match = false;\n>> +\n>> +\t\t\tfor (int j = 0; j < e->acts_cnt; j++)\n>> +\t\t\t\tif (memcmp(&p->acts[i], &e->acts[j],\n>> +\t\t\t\t\t   sizeof(struct ice_flow_action)))\n> Due to comment above it should be if (!memcmp(&p->acts[i], &e->acts[j],\n> Please fix the comment or code.\n\nI believe the logic is fine, but naming/comments might be a bit confusing.\nI'll try to make it more readable.\n\nThanks,\nMarcin\n\n> Otherwise, it looks good.\n> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>\n> \n>> {\n>> +\t\t\t\t\tfound_not_match = true;\n>> +\t\t\t\t\tbreak;\n> \n> ...\n> \n>>  }\n>>\n>>  /**\n>> --\n>> 2.49.0\n>","headers":{"Return-Path":"<intel-wired-lan-bounces@osuosl.org>","X-Original-To":["incoming@patchwork.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256\n header.s=default header.b=LFzq7eJI;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvPWZ6HZxz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 20:57:46 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 2334A60E39;\n\tMon, 13 Apr 2026 10:57:45 +0000 (UTC)","from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id OtI17oBcLFai; Mon, 13 Apr 2026 10:57:43 +0000 (UTC)","from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 667F360DEB;\n\tMon, 13 Apr 2026 10:57:43 +0000 (UTC)","from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n by lists1.osuosl.org (Postfix) with ESMTP id 840EC237\n for <intel-wired-lan@lists.osuosl.org>; Mon, 13 Apr 2026 10:57:42 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n by smtp1.osuosl.org (Postfix) with ESMTP id 69F1B8441D\n for <intel-wired-lan@lists.osuosl.org>; Mon, 13 Apr 2026 10:57:42 +0000 (UTC)","from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id PoZ8mfijnv9z for <intel-wired-lan@lists.osuosl.org>;\n Mon, 13 Apr 2026 10:57:41 +0000 (UTC)","from mgamail.intel.com (mgamail.intel.com [198.175.65.14])\n by smtp1.osuosl.org (Postfix) with ESMTPS id 7C6EC84414\n for <intel-wired-lan@lists.osuosl.org>; Mon, 13 Apr 2026 10:57:40 +0000 (UTC)","from orviesa001.jf.intel.com ([10.64.159.141])\n by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 Apr 2026 03:57:40 -0700","from unknown (HELO [10.217.180.180]) ([10.217.180.180])\n by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 Apr 2026 03:57:37 -0700"],"X-Virus-Scanned":["amavis at osuosl.org","amavis at osuosl.org"],"X-Comment":"SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=<UNKNOWN> ","DKIM-Filter":["OpenDKIM Filter v2.11.0 smtp3.osuosl.org 667F360DEB","OpenDKIM Filter v2.11.0 smtp1.osuosl.org 7C6EC84414"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1776077863;\n\tbh=K8foIDC2WF+yykivFOEMMyEWmtyysOsqsBd/uEEi4ws=;\n\th=Date:To:Cc:References:From:In-Reply-To:Subject:List-Id:\n\t List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:\n\t From;\n\tb=LFzq7eJI5DqfMe/j55vDHC/MMi4hO4tA4qbiRzwJff3DA1BZkemGnkW0Qr8hmIEPp\n\t bD0IDX9A1PdxxCz2nW6BrJ3gUfeHe9f0rSk/feKutZtZJFxR3AtAmtz7p99s4UoKY6\n\t v+7GY4/6QCZXaOS9DcT9DQpVY1nBAfzChpvJY1lmso0imwnLSLu0XAa/TIwq0lE5oV\n\t eCqn3JfasG8iAuIp+JpVDEvy5jTC0UqKSvBiyUAdGvJpYmZPgsaWQk6OkGgb8kHeBu\n\t YqiVQnL6W68T22FmRnmYlEBKCSBKc7EPmA6D6kQCymJvoZXAUPpiat6mCo2VlW2CT/\n\t uW+YvH1Mwk/Kg==","Received-SPF":"Pass (mailfrom) identity=mailfrom; client-ip=198.175.65.14;\n helo=mgamail.intel.com; envelope-from=marcin.szycik@linux.intel.com;\n receiver=<UNKNOWN>","DMARC-Filter":"OpenDMARC Filter v1.4.2 smtp1.osuosl.org 7C6EC84414","X-CSE-ConnectionGUID":["VzT3TElZSF6LdQLl6Bfvhg==","FGce+dNNQPqG90xFSbApZw=="],"X-CSE-MsgGUID":["ug5m+q5ZSju727lwTCW5BQ==","2S2LXk1KTJGhDx65yUw42Q=="],"X-IronPort-AV":["E=McAfee;i=\"6800,10657,11757\"; a=\"80871415\"","E=Sophos;i=\"6.23,177,1770624000\"; d=\"scan'208\";a=\"80871415\"","E=Sophos;i=\"6.23,177,1770624000\"; d=\"scan'208\";a=\"267742753\""],"X-ExtLoop1":"1","Message-ID":"<44f2e76c-d573-4eb0-87f5-0c91e6340715@linux.intel.com>","Date":"Mon, 13 Apr 2026 12:57:30 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","To":"\"Loktionov, Aleksandr\" <aleksandr.loktionov@intel.com>,\n \"intel-wired-lan@lists.osuosl.org\" <intel-wired-lan@lists.osuosl.org>","Cc":"\"netdev@vger.kernel.org\" <netdev@vger.kernel.org>,\n \"Penigalapati, Sandeep\" <sandeep.penigalapati@intel.com>,\n \"S, Ananth\" <ananth.s@intel.com>,\n \"alexander.duyck@gmail.com\" <alexander.duyck@gmail.com>,\n \"Cao, Chinh T\" <chinh.t.cao@intel.com>,\n \"Nguyen, Anthony L\" <anthony.l.nguyen@intel.com>","References":"<20260409120003.2719-1-marcin.szycik@linux.intel.com>\n <20260409120003.2719-9-marcin.szycik@linux.intel.com>\n <IA3PR11MB898666B7AB0330B3C29DC630E5582@IA3PR11MB8986.namprd11.prod.outlook.com>","Content-Language":"en-US","From":"Marcin Szycik <marcin.szycik@linux.intel.com>","In-Reply-To":"\n <IA3PR11MB898666B7AB0330B3C29DC630E5582@IA3PR11MB8986.namprd11.prod.outlook.com>","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"7bit","X-Mailman-Original-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1776077861; x=1807613861;\n h=message-id:date:mime-version:subject:to:cc:references:\n from:in-reply-to:content-transfer-encoding;\n bh=v+Yl5oo6K3n5TZC9lJDiqsFSe9szOV/2yEYYDRyBvVU=;\n b=gCPXAr6piCtnMKTJB/5ookWCUZK1lraDf8imgiW+9wP/fOIQjLUQtgBv\n a3HADgq3GqINpPJzYMt/ZThLojEYZQfSiAEW1u3z8GtQmTXxrbzN3QPvq\n 3ZWaQfyjk8xbQke6fUjm3kfbkl1xrv8mG6Ljl9oqwERfhp6tuFVWllB+q\n 8FyMdUkGlZLy7ok8mygKff0FPe4rIAK3ntU2sBbFzM6g6D1IDS5HgxPRG\n +UKWhnkIGXy7g9Gk+oX7lWhPu+Tu5X3OgFGj9ijcgoNqaQnkiWOh9E1oH\n h0HVzwLrP8V8EhYSbh8c7KTs5zzBGyXFtORe54RT7HbJCww3LwLMkKiIP\n A==;","X-Mailman-Original-Authentication-Results":["smtp1.osuosl.org;\n dmarc=none (p=none dis=none)\n header.from=linux.intel.com","smtp1.osuosl.org;\n dkim=pass (2048-bit key,\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=gCPXAr6p"],"Subject":"Re: [Intel-wired-lan] [PATCH iwl-next v2 08/10] ice: program ACL\n entry","X-BeenThere":"intel-wired-lan@osuosl.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>","List-Unsubscribe":"<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>","List-Archive":"<http://lists.osuosl.org/pipermail/intel-wired-lan/>","List-Post":"<mailto:intel-wired-lan@osuosl.org>","List-Help":"<mailto:intel-wired-lan-request@osuosl.org?subject=help>","List-Subscribe":"<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>","Errors-To":"intel-wired-lan-bounces@osuosl.org","Sender":"\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"}}]