> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf Of 
> Marcin Szycik
> Sent: 02 July 2026 16:00
> To: [email protected]
> Cc: [email protected]; Penigalapati, Sandeep 
> <[email protected]>; S, Ananth <[email protected]>; 
> [email protected]; Nguyen, Anthony L <[email protected]>; 
> Marcin Szycik <[email protected]>; Cao, Chinh T 
> <[email protected]>; Loktionov, Aleksandr <[email protected]>
> Subject: [Intel-wired-lan] [PATCH iwl-next v5 05/12] ice: create flow profile
>
> From: Real Valiquette <[email protected]>
>
> Implement the initial steps for creating an ACL filter to support ntuple 
> masks. Create a flow profile based on a given mask rule and program it to the 
> hardware. Though the profile is written to hardware, no actions are 
> associated with the profile yet.
>
> Co-developed-by: Chinh Cao <[email protected]>
> Signed-off-by: Chinh Cao <[email protected]>
> Signed-off-by: Real Valiquette <[email protected]>
> Co-developed-by: Tony Nguyen <[email protected]>
> Signed-off-by: Tony Nguyen <[email protected]>
> Co-developed-by: Marcin Szycik <[email protected]>
> Signed-off-by: Marcin Szycik <[email protected]>
> Reviewed-by: Aleksandr Loktionov <[email protected]>
> ---
> v5:
> * ice_{add,del}_ntuple_ethtool(): remove dependency on ICE_FLAG_FD_ENA.
>   ACL should not be blocked by fdir being disabled
> * ice_acl_prof_add_ethtool(): don't free and NULL hw_prof on existing
>   seg mismatch. This prevents deallocating an existing hw_prof, also
>   leaking its seg
> v4:
> * ice_acl_prof_add_ethtool(): add missing line
>   (hw_prof->prof_id = prof->id;). Without it, all flow entries are added
>   to profile 0, which wrongly uses old extraction sequence in case flow
>   type is different. To reproduce, add two filters with different input
>   sets and check if they forward to expected queues, e.g.:
>     ethtool -N $PF1 flow-type tcp4 src-port 1234 m 0x000f action 23
>     ethtool -N $PF1 flow-type udp4 src-port 1234 m 0x000f action 24
> * Adjust to using struct ice_acl_hw_prof instead of struct
>   ice_fd_hw_prof
> * ice_acl_prof_add_ethtool(): remove old_seg helper variable - after
>   above change, accessing old segment is straightforward, so it's not
>   needed
> v3:
> * ice_acl_prof_add_ethtool(): add a writeback to hw profile in error
>   path to prevent leaving a pointer to deallocated object
> * ice_deinit_acl(): exit early if hw->acl_prof is already NULL
> * ice_flow_acl_def_entry_frmt(): copy seg->match to variable instead of
>   reading it as unsigned long pointer in order to avoid potential type
>   mismatch
> v2:
> * Add ice_acl_main.h in order to not awkwardly add prototypes to ice.h.
>   This will also help avoid potential dependency issues for future
>   additions to ice_acl_main.c
> * Rename ice_acl_check_input_set() to a more fiting
>   ice_acl_prof_add_ethtool() as it adds a profile
> * Set hw->acl_prof = 0 in ice_acl_prof_add_ethtool() to avoid use after
>   free
> * Add ipv4 and port full mask defines in ice_ethtool_ntuple.c
> * Move hw->acl_prof allocation to ice_init_acl(). Previously, it was
>   being deallocated when hw->acl_prof[fltr_type] allocation failed,
>   possibly with already existing other elements. Extend array lifetime
>   to driver's lifetime
> * Change hw->acl_prof[fltr_type] alloc from devm_ to plain
> * Add hw->acl_prof[fltr_type] and hw->acl_prof deallocation in
>   ice_deinit_acl() - previously were only deallocated on failure
> * Tweak alloc/unroll logic in ice_acl_prof_add_ethtool()
> ---
> drivers/net/ethernet/intel/ice/Makefile       |   1 +
> drivers/net/ethernet/intel/ice/ice.h          |   6 +
> drivers/net/ethernet/intel/ice/ice_acl_main.h |   9 +
> .../net/ethernet/intel/ice/ice_adminq_cmd.h   |  39 +++
> drivers/net/ethernet/intel/ice/ice_flow.h     |  17 +
> drivers/net/ethernet/intel/ice/ice_acl_main.c | 227 +++++++++++++
> .../ethernet/intel/ice/ice_ethtool_ntuple.c   | 307 +++++++++++++-----
> .../net/ethernet/intel/ice/ice_flex_pipe.c    |   6 +
> drivers/net/ethernet/intel/ice/ice_flow.c     | 173 ++++++++++
> drivers/net/ethernet/intel/ice/ice_main.c     |  42 ++-
> 10 files changed, 745 insertions(+), 82 deletions(-)  create mode 100644 
> drivers/net/ethernet/intel/ice/ice_acl_main.h
> create mode 100644 drivers/net/ethernet/intel/ice/ice_acl_main.c
>

Tested-by: Rinitha S <[email protected]> (A Contingent worker at Intel)

Reply via email to