aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2020-04-24 18:43:44 +0300
committerDavid S. Miller <davem@davemloft.net>2020-04-24 15:41:51 -0700
commit4c00dafc59c7cc25a381abf7671b203a2fcfca71 (patch)
treed8b01173b9a06ca3c6c4f336a03ac0d5e36b9d94 /drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h
parentmlxsw: spectrum_span: Remove unnecessary debug prints (diff)
downloadlinux-4c00dafc59c7cc25a381abf7671b203a2fcfca71.tar.xz
linux-4c00dafc59c7cc25a381abf7671b203a2fcfca71.zip
mlxsw: spectrum_span: Use 'refcount_t' for reference counting
'refcount_t' is very useful for catching over/under flows. Convert the SPAN agent objects to use it instead of 'int' for their reference count. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h
index 01273e54ba20..d23abdf957fa 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h
@@ -6,6 +6,7 @@
#include <linux/types.h>
#include <linux/if_ether.h>
+#include <linux/refcount.h>
#include "spectrum_router.h"
@@ -43,7 +44,7 @@ struct mlxsw_sp_span_entry {
const struct mlxsw_sp_span_entry_ops *ops;
struct mlxsw_sp_span_parms parms;
struct list_head bound_ports_list;
- int ref_count;
+ refcount_t ref_count;
int id;
};