Skip to content

cxgb4: add TC-MATCHALL classifier offload

Rahul Lakkireddy netdev 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 2 repliesIn review
  2. v43 patches 3 repliesSuperseded
  3. v32 patches 8 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches2 repliesSuperseded
v12 patches4 repliesSuperseded

Changes in v5 from the cover letter

- Fixed commit message and comment to include comparison for equal priority in patch 2.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3cxgb4: add TC-MATCHALL classifier egress offloaddrivers/net/ethernet/chelsio/cxgb4/Makefile drivers/net/ethernet/chelsio/cxgb4/cxgb4.h drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +6 more+381 -330 replies
2/3cxgb4: check rule prio conflicts before offloaddrivers/net/ethernet/chelsio/cxgb4/cxgb4.h drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.h +2 more+143 -440 replies
3/3cxgb4: add TC-MATCHALL classifier ingress offloaddrivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c +3 more+192 -190 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH net-next v5 0/3] cxgb4: add TC-MATCHALL classifier offload

This series of patches add support to offload TC-MATCHALL classifier to hardware to classify all outgoing and incoming traffic on the underlying port. Only 1 egress and 1 ingress rule each can be offloaded on the underlying port.

Patch 1 adds support for TC-MATCHALL classifier offload on the egress side. TC-POLICE is the only action that can be offloaded on the egress side and is used to rate limit all outgoing traffic to specified max rate.

Patch 2 adds logic to reject the current rule offload if its priority conflicts with existing rules in the TCAM.

Patch 3 adds support for TC-MATCHALL classifier offload on the ingress side. The same set of actions supported by existing TC-FLOWER classifier offload can be applied on all the incoming traffic.

Thanks,
Rahul

v5:
- Fixed commit message and comment to include comparison for equal priority in patch 2.

v4:
- Removed check in patch 1 to reject police offload if prio is not 1.
- Moved TC_SETUP_BLOCK code to separate function in patch 1.
- Added logic to ensure the prio passed by TC doesn't conflict with other rules in TCAM in patch 2.
- Higher index has lower priority than lower index in TCAM. So, rework cxgb4_get_free_ftid() to search free index from end of TCAM in descending order in patch 2.
- Added check to ensure the matchall rule's prio doesn't conflict with other rules in TCAM in patch 3.
- Added logic to fill default mask for VIID, if none has been provided, to prevent conflict with duplicate VIID rules in patch 3.
- Used existing variables in private structure to fill VIID info, instead of extracting the info manually in patch 3.

v3:
- Added check in patch 1 to reject police offload if prio is not 1.
- Assign block_shared variable only for TC_SETUP_BLOCK in patch 1.

v2:
- Added check to reject flow block sharing for policers in patch 1.
- Removed logic to fetch free index from end of TCAM in patch 2. Must maintain the same ordering as in kernel.

Rahul Lakkireddy (3):
cxgb4: add TC-MATCHALL classifier egress offload
cxgb4: check rule prio conflicts before offload
cxgb4: add TC-MATCHALL classifier ingress offload

 drivers/net/ethernet/chelsio/cxgb4/Makefile   |   3 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h    |  11 +-
 .../net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 120 ++++--
 .../net/ethernet/chelsio/cxgb4/cxgb4_filter.h |   1 +
 .../net/ethernet/chelsio/cxgb4/cxgb4_main.c   |  91 ++++-
 .../ethernet/chelsio/cxgb4/cxgb4_tc_flower.c  |  52 ++-
 .../ethernet/chelsio/cxgb4/cxgb4_tc_flower.h  |   6 +
 .../chelsio/cxgb4/cxgb4_tc_matchall.c         | 354 ++++++++++++++++++
 .../chelsio/cxgb4/cxgb4_tc_matchall.h         |  49 +++
 .../ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c  |   5 +-
 .../net/ethernet/chelsio/cxgb4/cxgb4_tc_u32.c |  36 +-
 drivers/net/ethernet/chelsio/cxgb4/sched.c    |  56 ++-
 drivers/net/ethernet/chelsio/cxgb4/sched.h    |   1 +
 drivers/net/ethernet/chelsio/cxgb4/t4_hw.c    |  11 +-
 14 files changed, 708 insertions(+), 88 deletions(-)
 create mode 100644 drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c
 create mode 100644 drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.h
Signature · 1 line
2.24.0