mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	Add support to allow optional-counters binding to a QP, whereas when a bind operation is requested depending on the counter optional-counter binding state the driver will determine if to also add optional-counters to this QP binding. The optional-counter binding is done by simply adding a steering rule for the specific optional-counter condition with the additional match over that QP number. Note that optional-counters per QP rules are handled on an earlier prio than per device counters, and per device counter correctness is maintained by core whereas it is responsible to sum active counters when checking device counter and to add them to history count when they are deallocated. Signed-off-by: Patrisious Haddad <phaddad@nvidia.com> Reviewed-by: Mark Bloch <mbloch@nvidia.com> Link: https://patch.msgid.link/2cad1b891a6641ae61fe8d92f867e1059121813a.1741875070.git.leon@kernel.org Signed-off-by: Leon Romanovsky <leon@kernel.org>
		
			
				
	
	
		
			32 lines
		
	
	
	
		
			1,020 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			1,020 B
		
	
	
	
		
			C
		
	
	
	
	
	
/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
 | 
						|
/*
 | 
						|
 * Copyright (c) 2013-2020, Mellanox Technologies inc. All rights reserved.
 | 
						|
 */
 | 
						|
 | 
						|
#ifndef _MLX5_IB_COUNTERS_H
 | 
						|
#define _MLX5_IB_COUNTERS_H
 | 
						|
 | 
						|
#include "mlx5_ib.h"
 | 
						|
 | 
						|
struct mlx5_rdma_counter {
 | 
						|
	struct rdma_counter rdma_counter;
 | 
						|
 | 
						|
	struct mlx5_fc *fc[MLX5_IB_OPCOUNTER_MAX];
 | 
						|
	struct xarray qpn_opfc_xa;
 | 
						|
};
 | 
						|
 | 
						|
static inline struct mlx5_rdma_counter *
 | 
						|
to_mcounter(struct rdma_counter *counter)
 | 
						|
{
 | 
						|
	return container_of(counter, struct mlx5_rdma_counter, rdma_counter);
 | 
						|
}
 | 
						|
 | 
						|
int mlx5_ib_counters_init(struct mlx5_ib_dev *dev);
 | 
						|
void mlx5_ib_counters_cleanup(struct mlx5_ib_dev *dev);
 | 
						|
void mlx5_ib_counters_clear_description(struct ib_counters *counters);
 | 
						|
int mlx5_ib_flow_counters_set_data(struct ib_counters *ibcounters,
 | 
						|
				   struct mlx5_ib_create_flow *ucmd);
 | 
						|
u16 mlx5_ib_get_counters_id(struct mlx5_ib_dev *dev, u32 port_num);
 | 
						|
bool mlx5r_is_opfc_shared_and_in_use(struct mlx5_ib_op_fc *opfcs, u32 type,
 | 
						|
				     struct mlx5_ib_op_fc **opfc);
 | 
						|
#endif /* _MLX5_IB_COUNTERS_H */
 |