2022-11-14 13:15:55 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
/****************************************************************************
|
|
|
|
* Driver for Solarflare network controllers and boards
|
|
|
|
* Copyright 2022 Advanced Micro Devices, Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 as published
|
|
|
|
* by the Free Software Foundation, incorporated herein by reference.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef EFX_TC_COUNTERS_H
|
|
|
|
#define EFX_TC_COUNTERS_H
|
2022-11-14 13:15:56 +00:00
|
|
|
#include <linux/refcount.h>
|
2022-11-14 13:15:55 +00:00
|
|
|
#include "net_driver.h"
|
|
|
|
|
|
|
|
#include "mcdi_pcol.h" /* for MAE_COUNTER_TYPE_* */
|
|
|
|
|
|
|
|
enum efx_tc_counter_type {
|
|
|
|
EFX_TC_COUNTER_TYPE_AR = MAE_COUNTER_TYPE_AR,
|
|
|
|
EFX_TC_COUNTER_TYPE_CT = MAE_COUNTER_TYPE_CT,
|
|
|
|
EFX_TC_COUNTER_TYPE_OR = MAE_COUNTER_TYPE_OR,
|
|
|
|
EFX_TC_COUNTER_TYPE_MAX
|
|
|
|
};
|
|
|
|
|
2022-11-14 13:15:56 +00:00
|
|
|
struct efx_tc_counter {
|
|
|
|
u32 fw_id; /* index in firmware counter table */
|
|
|
|
enum efx_tc_counter_type type;
|
|
|
|
struct rhash_head linkage; /* efx->tc->counter_ht */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct efx_tc_counter_index {
|
|
|
|
unsigned long cookie;
|
|
|
|
struct rhash_head linkage; /* efx->tc->counter_id_ht */
|
|
|
|
refcount_t ref;
|
|
|
|
struct efx_tc_counter *cnt;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* create/uncreate/teardown hashtables */
|
|
|
|
int efx_tc_init_counters(struct efx_nic *efx);
|
|
|
|
void efx_tc_destroy_counters(struct efx_nic *efx);
|
|
|
|
void efx_tc_fini_counters(struct efx_nic *efx);
|
|
|
|
|
2022-11-14 13:15:55 +00:00
|
|
|
extern const struct efx_channel_type efx_tc_channel_type;
|
|
|
|
|
|
|
|
#endif /* EFX_TC_COUNTERS_H */
|