summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c
Commit message (Collapse)AuthorAgeFilesLines
* mlxsw: Replace license text with SPDX identifiers and adjust copyrightsJiri Pirko2018-08-091-34/+2Star
| | | | | | Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mlxsw: spectrum_mr_tcam: Push Spectrum-specific operations into a separate fileJiri Pirko2018-07-101-272/+41Star
| | | | | | | | | | Since Spectrum-2 has different handling of TCAM, push Spectrum MR TCAM bits to a separate file accessible by ops which allows to implement Spectrum-2 specific ops. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mlxsw: spectrum_kvdl: Pass entry_count to free functionJiri Pirko2018-07-101-1/+1
| | | | | | | | | For the Spectrum-2 KVD linear manager implementation, entry_count will be needed even for the free function. So pass it down. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mlxsw: spectrum_kvdl: Pass entry type to alloc/freeJiri Pirko2018-07-101-5/+4Star
| | | | | | | | | | | | Future Spectrum-2 KVD linear manager implementation needs to know type of the entry to alloc and free. So define the types in an enum and pass it down to alloc and free functions. Once the entry type is passed down, KVDL common part knows sizes of each entry types, so replace size function arg with entry count. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mlxsw: spectrum_router: Support IPv6 multicast to host CPUYuval Mintz2018-03-261-33/+72
| | | | | | | | | | | | | A step toward offloading IPv6 routing, this adds an additional multicast routing table meant for IPv6 [with its underlying TCAM region] and populates the default rule for IPv6 multicast packets. Following this, ingress IPv6 multicast packets would be trapped and delivered to the host CPU. Signed-off-by: Yuval Mintz <yuvalm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mlxsw: core: Make counter index allocated inside the action appendJiri Pirko2018-01-221-1/+2
| | | | | | | | | | | So far, the caller of mlxsw_afa_block_append_counter needed to allocate counter index by hand. Benefit from the previously introduced resource infra and counter_index_get/put callbacks, and allocate the counter index in place where it is needed, inside the action append function. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mlxsw: spectrum: mr_tcam: Include the mr_tcam header fileYotam Gigi2017-10-241-0/+1
| | | | | | | | | | | | Make the spectrum_mr_tcam.c include the spectrum_mr_tcam.h header file. Cleans up sparse warning: symbol 'mlxsw_sp_mr_tcam_ops' was not declared. Should it be static? Fixes: 0e14c7777acb6 ("mlxsw: spectrum: Add the multicast routing hardware logic") Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mlxsw: spectrum: Add missing error code on allocation failureDan Carpenter2017-10-031-1/+3
| | | | | | | | | We accidentally return success if the kmalloc_array() call fails. Fixes: 0e14c7777acb ("mlxsw: spectrum: Add the multicast routing hardware logic") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Yotam Gigi <yotamg@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mlxsw: spectrum: Fix check for IS_ERR() instead of NULLDan Carpenter2017-10-031-2/+2
| | | | | | | | | | mlxsw_afa_block_create() doesn't return error pointers, it returns NULL on error. Fixes: 0e14c7777acb ("mlxsw: spectrum: Add the multicast routing hardware logic") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Yotam Gigi <yotamg@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mlxsw: spectrum: mr_tcam: Add trap-and-forward multicast routeYotam Gigi2017-10-031-0/+8
| | | | | | | | | | | | | | | | | | | In addition to the current multicast route actions, which include trap route action and a forward route action, add the trap-and-forward multicast route action, and implement it in the multicast routing hardware logic. To implement that, add a trap-and-forward ACL action as the last action in the route flexible action set. The used trap is the ACL2 trap, which marks the packets with offload_mr_forward_mark, to prevent the packet from being forwarded again by the kernel. Note: At that stage the offloading logic does not support trap-and-forward multicast routes. This patch adds the support only in the hardware logic. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mlxsw: spectrum: Add the multicast routing hardware logicYotam Gigi2017-09-271-0/+828
Implement the multicast routing hardware API introduced in previous patch for the specific spectrum hardware. The spectrum hardware multicast routes are written using the RMFT2 register and point to an ACL flexible action set. The actions used for multicast routes are: - Counter action, which allows counting bytes and packets on multicast routes. - Multicast route action, which provide RPF check and do the actual packet duplication to a list of RIFs. - Trap action, in the case the route action specified by the called is trap. Signed-off-by: Yotam Gigi <yotamg@mellanox.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>