netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 00/17] mlxsw: Introduce algorithmic TCAM support
@ 2018-07-25  6:23 Ido Schimmel
  2018-07-25  6:23 ` [PATCH net-next 01/17] mlxsw: reg: Prepare PERERP register for A-TCAM usage Ido Schimmel
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: Ido Schimmel @ 2018-07-25  6:23 UTC (permalink / raw)
  To: netdev; +Cc: davem, jiri, mlxsw, Ido Schimmel

The Spectrum-2 ASIC uses an algorithmic TCAM (A-TCAM) where multiple
exact matches lookups are performed instead of a single lookup as with
standard circuit TCAM (C-TCAM) memory. This allows for higher scale and
reduced power consumption.

The lookups are performed by masking a packet using different masks
(e.g., {dst_ip/24, ethtype}) defined for the region and looking for an
exact match. Eventually, the rule with the highest priority will be
picked.

Since the number of masks per-region is limited, the ASIC includes a
C-TCAM that can be used as a spill area for rules that do not fit into
the A-TCAM.

The driver currently uses a C-TCAM only mode which is similar to
Spectrum-1. However, this mode severely limits both the number of
supported ACL rules and the performance of the ACL lookup.

This patch set introduces initial support for the A-TCAM mode where the
C-TCAM is only used for rule spillage.

The first five patches add the registers and ASIC resources needed in
order to make use of the A-TCAM.

Next three patches are the "meat" and add the eRP core which is used to
manage the masks used by each ACL region. The individual commit messages
are lengthy and aim to thoroughly explain the subject.

The next seven patches perform small adjustments in the code and the
related data structures and are meant to prepare the code base to the
introduction of the A-TCAM in the last two patches.

Various A-TCAM optimization will be the focus of follow-up patch sets:

* Pruning - Used to reduce the number of lookups. Each rule will include
  a prune vector that indicates which masks should not be considered for
  further lookups as they cannot result in a higher priority match

* Bloom filter - Used to reduce the number of lookups. Before performing
  a lookup with a given mask the ASIC will consult a bloom filter
  (managed by the driver) that indicates whether a match might exist using
  the considered mask

* Masks aggregation - Used to increase scale and reduce lookups. Masks
  that only differ by up to eight consecutive bits (delta bits) can be
  aggregated into a single mask. The delta bits then become a part of the
  rule's key. For example, dst_ip/16 and dst_ip/17 can be represented as
  dst_ip/16 with a delta bit of one. Rules using the aggregated mask then
  specify whether the 17-th bit should be masked or not and its value

Ido Schimmel (17):
  mlxsw: reg: Prepare PERERP register for A-TCAM usage
  mlxsw: reg: Add Policy-Engine TCAM Entry Register Version 3
  mlxsw: reg: Add Policy-Engine eRP Table Register
  mlxsw: resources: Add Spectrum-2 maximum large key ID resource
  mlxsw: resources: Add Spectrum-2 eRP resources
  mlxsw: spectrum_acl: Implement common eRP core
  mlxsw: spectrum_acl: Enable C-TCAM only mode in eRP core
  mlxsw: spectrum_acl: Add support for C-TCAM eRPs
  mlxsw: spectrum_acl: Extend Spectrum-2 region struct
  mlxsw: spectrum_acl: Allow encoding a partial key
  mlxsw: spectrum_acl: Add A-TCAM initialization
  mlxsw: spectrum_acl: Encapsulate C-TCAM region in A-TCAM region
  mlxsw: spectrum_acl: Make global TCAM resources available to regions
  mlxsw: spectrum_acl: Add A-TCAM region initialization
  mlxsw: spectrum_acl: Pass C-TCAM region and entry to insert function
  mlxsw: spectrum_acl: Add A-TCAM rule insertion and deletion
  mlxsw: spectrum_acl: Start using A-TCAM

 drivers/net/ethernet/mellanox/mlxsw/Kconfig   |    1 +
 drivers/net/ethernet/mellanox/mlxsw/Makefile  |    2 +-
 .../mellanox/mlxsw/core_acl_flex_keys.c       |   10 +-
 .../mellanox/mlxsw/core_acl_flex_keys.h       |    2 +-
 drivers/net/ethernet/mellanox/mlxsw/reg.h     |  301 ++++-
 .../net/ethernet/mellanox/mlxsw/resources.h   |   14 +
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |    1 +
 .../mellanox/mlxsw/spectrum1_acl_tcam.c       |   24 +-
 .../mellanox/mlxsw/spectrum2_acl_tcam.c       |   82 +-
 .../mellanox/mlxsw/spectrum_acl_atcam.c       |  509 ++++++-
 .../mellanox/mlxsw/spectrum_acl_ctcam.c       |   40 +-
 .../mellanox/mlxsw/spectrum_acl_erp.c         | 1199 +++++++++++++++++
 .../mellanox/mlxsw/spectrum_acl_tcam.c        |    2 +-
 .../mellanox/mlxsw/spectrum_acl_tcam.h        |  117 +-
 14 files changed, 2235 insertions(+), 69 deletions(-)
 create mode 100644 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c

-- 
2.17.1

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

end of thread, other threads:[~2018-07-26  1:00 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-25  6:23 [PATCH net-next 00/17] mlxsw: Introduce algorithmic TCAM support Ido Schimmel
2018-07-25  6:23 ` [PATCH net-next 01/17] mlxsw: reg: Prepare PERERP register for A-TCAM usage Ido Schimmel
2018-07-25  6:23 ` [PATCH net-next 02/17] mlxsw: reg: Add Policy-Engine TCAM Entry Register Version 3 Ido Schimmel
2018-07-25  6:23 ` [PATCH net-next 03/17] mlxsw: reg: Add Policy-Engine eRP Table Register Ido Schimmel
2018-07-25  6:23 ` [PATCH net-next 04/17] mlxsw: resources: Add Spectrum-2 maximum large key ID resource Ido Schimmel
2018-07-25  6:23 ` [PATCH net-next 05/17] mlxsw: resources: Add Spectrum-2 eRP resources Ido Schimmel
2018-07-25  6:23 ` [PATCH net-next 06/17] mlxsw: spectrum_acl: Implement common eRP core Ido Schimmel
2018-07-25  6:23 ` [PATCH net-next 07/17] mlxsw: spectrum_acl: Enable C-TCAM only mode in " Ido Schimmel
2018-07-25  6:23 ` [PATCH net-next 08/17] mlxsw: spectrum_acl: Add support for C-TCAM eRPs Ido Schimmel
2018-07-25  6:23 ` [PATCH net-next 09/17] mlxsw: spectrum_acl: Extend Spectrum-2 region struct Ido Schimmel
2018-07-25  6:23 ` [PATCH net-next 10/17] mlxsw: spectrum_acl: Allow encoding a partial key Ido Schimmel
2018-07-25  6:24 ` [PATCH net-next 11/17] mlxsw: spectrum_acl: Add A-TCAM initialization Ido Schimmel
2018-07-25  6:24 ` [PATCH net-next 12/17] mlxsw: spectrum_acl: Encapsulate C-TCAM region in A-TCAM region Ido Schimmel
2018-07-25  6:24 ` [PATCH net-next 13/17] mlxsw: spectrum_acl: Make global TCAM resources available to regions Ido Schimmel
2018-07-25  6:24 ` [PATCH net-next 14/17] mlxsw: spectrum_acl: Add A-TCAM region initialization Ido Schimmel
2018-07-25  6:24 ` [PATCH net-next 15/17] mlxsw: spectrum_acl: Pass C-TCAM region and entry to insert function Ido Schimmel
2018-07-25  6:24 ` [PATCH net-next 16/17] mlxsw: spectrum_acl: Add A-TCAM rule insertion and deletion Ido Schimmel
2018-07-25  6:24 ` [PATCH net-next 17/17] mlxsw: spectrum_acl: Start using A-TCAM Ido Schimmel
2018-07-25 23:46 ` [PATCH net-next 00/17] mlxsw: Introduce algorithmic TCAM support David Miller

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