summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2018-01-19 09:24:48 +0100
committerDavid S. Miller <davem@davemloft.net>2018-01-21 18:21:30 -0500
commitc18c1e186ba872da73e944d9c54f027ea3899d39 (patch)
treebcf3bc571ae4c491f434b7bfe52c7e6c21fd4a4b /drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c
parent140ce421217e99f68a0108382e0789c1b1a15547 (diff)
downloadtalos-op-linux-c18c1e186ba872da73e944d9c54f027ea3899d39.tar.gz
talos-op-linux-c18c1e186ba872da73e944d9c54f027ea3899d39.zip
mlxsw: core: Make counter index allocated inside the action append
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>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c
index 34a0b632e5dd..4c7f32d4288d 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c
@@ -243,7 +243,8 @@ mlxsw_sp_mr_tcam_afa_block_create(struct mlxsw_sp *mlxsw_sp,
if (!afa_block)
return ERR_PTR(-ENOMEM);
- err = mlxsw_afa_block_append_counter(afa_block, counter_index);
+ err = mlxsw_afa_block_append_allocated_counter(afa_block,
+ counter_index);
if (err)
goto err;
OpenPOWER on IntegriCloud