Add ACL support
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest12 patches 12 repliesIn review
- v410 patches 10 repliesSuperseded
- v310 patches 0 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 10 patches | 15 replies | Superseded |
Changes in v5 from the cover letter
* Purely sashiko [5][6] issues fixing. See specific patches for details
* Add patches 2 and 10
* The biggest change is the addition of proper reset handling, which was apparently mostly missing in the original code - see patch 10
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/12 | ice: rename shared Flow Director functions and structsdrivers/ drivers/ drivers/ +7 more | +98 | 1 reply | |
| 2/12 | ice: remove unused ICE_FD_FLUSH_REQ from PF statedrivers/ drivers/ | +0 | 1 reply | |
| 3/12 | ice: initialize ACL tabledrivers/ drivers/ drivers/ +5 more | +843 | 1 reply | |
| 4/12 | ice: initialize ACL scenariodrivers/ drivers/ drivers/ +8 more | +841 | 1 reply | |
| 5/12 | ice: create flow profiledrivers/ drivers/ drivers/ +7 more | +745 | 1 reply | |
| 6/12 | Revert "ice: remove unused ice_flow_entry fields"drivers/ drivers/ | +7 | 1 reply | |
| 7/12 | ice: use plain alloc/dealloc for ice_ntuple_fltrdrivers/ | +4 | 1 reply | |
| 8/12 | ice: create ACL entrydrivers/ drivers/ drivers/ +10 more | +1075 | 1 reply | |
| 9/12 | ice: program ACL entrydrivers/ drivers/ drivers/ +7 more | +862 | 1 reply | |
| 10/12 | ice: add ACL reset recovery and NTUPLE feature toggledrivers/ drivers/ drivers/ +4 more | +201 | 1 reply | |
| 11/12 | ice: re-introduce ice_dealloc_flow_entry() helperdrivers/ | +20 | 1 reply | |
| 12/12 | ice: use ACL for ntuple rules that conflict with FDirdrivers/ | +140 | 1 reply |
Reviews trailers per patch
9 of 12 patches have a Reviewed-by or Acked-by.
| Patch | Aleksandr Loktionov | Przemek Kitszel | Rinitha S |
|---|---|---|---|
| 1/12 | R-b | T-b | |
| 2/12 | T-b | ||
| 3/12 | R-b | T-b | |
| 4/12 | R-b | T-b | |
| 5/12 | R-b | T-b | |
| 6/12 | R-b | R-b | T-b |
| 7/12 | R-b | T-b | |
| 8/12 | R-b | T-b | |
| 9/12 | T-b | ||
| 10/12 | T-b | ||
| 11/12 | R-b | R-b | T-b |
| 12/12 | R-b | T-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH iwl-next v5 00/12] Add ACL support
E8xx hardware provides a Ternary Classifier block for implementing functions such as ACL (Access Control List). In this series it's simply referred to as "ACL".
Implement ACL filtering. This expands support of network flow classification rules for the ethtool ntuple command. ACL filtering allows for an ip or port field's optional mask to be specified.
Example filters:
ethtool -N eth0 flow-type tcp4 dst-port 8880 m 0x00ff action 10 ethtool -N eth0 flow-type tcp4 src-ip 192.168.0.55 m 0.0.0.255 action -1
This is a resurrection of an old series from 2020 [1] with several improvements, but the fundamental logic unchanged. v1 was almost pulled in, but ultimately it was decided to drop it [2] because of unresolved issues. One issue was too many defensive NULL checks. Second issue is about inconsistency when using multiple input sets. Both are addressed in this patchset.
More about the second issue:
From [3]:
Quoted 8 lines
I would argue that you need to have some sort of logic that basically checks to see if you are going to hit the input set issue and falls back and applies the ACL rules. Otherwise you are significantly hampering the usefulness of this filter type. It doesn't make sense that dropping a field will cause a rule to fail to be added, but masking a single bit in some field will make it valid. It would make it a nightmare to use from the user point of view as the rules come across as arbitrary.
Flow Director (FD) has a hardware limitation where all filters for the same packet type must use identical input sets. Previously, attempting to add the second filter would fail.
Patch 12 adds automatic fallback to ACL block when FD cannot accommodate a filter due to input set conflicts, which resolves this inconsistency.
v5 note:
I haven't addressed *every* issue reported by sashikos; the amount of issues to analyze and potentially fix was frankly overwhelming: 35 from left brain (netdev-ai), 31 from right brain (sashiko.dev), and these are not simple typos, but issues that often require deep analysis, something particularly tricky in a large, messy codebase that was originally not authored by me. I focused on netdev-ai, since I believe this is the "main" one (please correct me if I'm wrong), addressing highs and some meds/lows. I skimmed through sashiko.dev, but it looked like a lot of duplicates.
The code has already went through 2 rounds of sashiko. I've significantly improved code quality (see changelog), likely beyond what one could expect from such a large code addition before the introduction of automated review. Before, this would've gotten very little attention due to the amount of effort required to just read through it, let alone understand it.
I'm sure both sashikos will have a new bag full of (potential) defects waiting for me after submitting this version. We could iterate this patchset till December until it's spotless, however I humbly suggest to move on now, of course assuming no *human* review arrives and validation is successful.
v5:
* Purely sashiko [5][6] issues fixing. See specific patches for details
* Add patches 2 and 10
* The biggest change is the addition of proper reset handling, which was apparently mostly missing in the original code - see patch 10
v4:
* Fix a bug where filters with different flow types would use the same profile, leading to strange behaviour. See patch 5 for details
* Clean up confusing code using struct ice_fd_hw_prof for ACL. This struct has many members that are not relevant to ACL. Also remove some code that dealt with those extra members (it was redundant). See patches 4, 5, 8, 9
* Resend for sashiko. v3 failed to be applied and therefore was not analyzed
v3:
* Various minor fixes, mostly reported by sashiko [4] - check individual changelogs. Not all comments were addressed (some were irrelevant)
v2:
* Rebase. Notable conflicts were the removal of ice_status and the addition of libie (which affected AdminQ communication)
* Reduce the number of defensive NULL checks
* Use = {} instead of memset for definitions
* Use kzalloc_obj() instead of plain kzalloc()
* Move from devm_ to plain allocation for objects that don't require it
* Move iterator declaration to loop start
* Move some defines out of structs
* Fix kdoc (except untouched ice_ethtool_fdir.c functions)
* Adjust style (err for return variable, spacing, rewrite some comments,
* commit messages)
* Remove overly verbose comments
* Add patches 6, 7, 11 and 12
* More changes listed in patches (if applicable)
[1] https://lore.kernel.org/intel-wired-lan/[email protected]
[2] https://lore.kernel.org/netdev/[email protected]/#t
[3] https://lore.kernel.org/netdev/CAKgT0Ucxd5-gvEwWAdbL04ER2o++RX_oekUV3E0rYquEgFKj1w@mail.gmail.com
[4] https://sashiko.dev/#/patchset/20260409120003.2719-1-marcin.szycik%40linux.intel.com
[5] https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260603220828.829969-1-anthony.l.nguyen%40intel.com
[6] https://sashiko.dev/#/patchset/[email protected]
Lukasz Czapnik (1):
ice: use ACL for ntuple rules that conflict with FDir
Marcin Szycik (5):
ice: remove unused ICE_FD_FLUSH_REQ from PF state Revert "ice: remove unused ice_flow_entry fields"
ice: use plain alloc/dealloc for ice_ntuple_fltr
ice: add ACL reset recovery and NTUPLE feature toggle
ice: re-introduce ice_dealloc_flow_entry() helper
Real Valiquette (5):
ice: initialize ACL table
ice: initialize ACL scenario
ice: create flow profile
ice: create ACL entry
ice: program ACL entry
Tony Nguyen (1):
ice: rename shared Flow Director functions and structs
drivers/net/ethernet/intel/ice/Makefile | 5 +-
drivers/net/ethernet/intel/ice/ice.h | 27 +-
drivers/net/ethernet/intel/ice/ice_acl.h | 177 +++
drivers/net/ethernet/intel/ice/ice_acl_main.h | 10 +
.../net/ethernet/intel/ice/ice_adminq_cmd.h | 393 ++++-
drivers/net/ethernet/intel/ice/ice_arfs.h | 2 +-
drivers/net/ethernet/intel/ice/ice_fdir.h | 16 +-
.../net/ethernet/intel/ice/ice_flex_pipe.h | 2 +
drivers/net/ethernet/intel/ice/ice_flow.h | 39 +-
.../net/ethernet/intel/ice/ice_lan_tx_rx.h | 3 +
drivers/net/ethernet/intel/ice/ice_type.h | 14 +-
drivers/net/ethernet/intel/ice/ice_acl.c | 486 +++++++
drivers/net/ethernet/intel/ice/ice_acl_ctrl.c | 1140 +++++++++++++++
drivers/net/ethernet/intel/ice/ice_acl_main.c | 377 +++++
drivers/net/ethernet/intel/ice/ice_arfs.c | 8 +-
drivers/net/ethernet/intel/ice/ice_ethtool.c | 13 +-
...ce_ethtool_fdir.c => ice_ethtool_ntuple.c} | 817 ++++++++---
drivers/net/ethernet/intel/ice/ice_fdir.c | 38 +-
.../net/ethernet/intel/ice/ice_flex_pipe.c | 11 +-
drivers/net/ethernet/intel/ice/ice_flow.c | 1267 ++++++++++++++++-
drivers/net/ethernet/intel/ice/ice_lib.c | 10 +-
drivers/net/ethernet/intel/ice/ice_main.c | 162 ++-
drivers/net/ethernet/intel/ice/virt/fdir.c | 32 +-
23 files changed, 4769 insertions(+), 280 deletions(-)
create mode 100644 drivers/net/ethernet/intel/ice/ice_acl.h
create mode 100644 drivers/net/ethernet/intel/ice/ice_acl_main.h
create mode 100644 drivers/net/ethernet/intel/ice/ice_acl.c
create mode 100644 drivers/net/ethernet/intel/ice/ice_acl_ctrl.c
create mode 100644 drivers/net/ethernet/intel/ice/ice_acl_main.c
rename drivers/net/ethernet/intel/ice/{ice_ethtool_fdir.c => ice_ethtool_ntuple.c} (74%)Signature · 1 line
2.49.0