1 /* SPDX-License-Identifier: BSD-3-Clause
3 * Copyright(c) 2020-2021 Xilinx, Inc.
6 #ifndef _SFC_MAE_COUNTER_H
7 #define _SFC_MAE_COUNTER_H
15 /* Default values for a user of counter RxQ */
16 #define SFC_MAE_COUNTER_RX_BURST 32
17 #define SFC_COUNTER_RXQ_RX_DESC_COUNT 256
20 * The refill level is chosen based on requirement to keep number
21 * of give credits operations low.
23 #define SFC_COUNTER_RXQ_REFILL_LEVEL (SFC_COUNTER_RXQ_RX_DESC_COUNT / 4)
26 * SF-122415-TC states that the packetiser that generates packets for
27 * counter stream must support 9k frames. Set it to the maximum supported
28 * size since in case of huge flow of counters, having fewer packets in counter
31 #define SFC_MAE_COUNTER_STREAM_PACKET_SIZE 9216
33 bool sfc_mae_counter_rxq_required(struct sfc_adapter *sa);
35 int sfc_mae_counter_rxq_attach(struct sfc_adapter *sa);
36 void sfc_mae_counter_rxq_detach(struct sfc_adapter *sa);
38 int sfc_mae_counter_rxq_init(struct sfc_adapter *sa);
39 void sfc_mae_counter_rxq_fini(struct sfc_adapter *sa);
41 int sfc_mae_counters_init(struct sfc_mae_counters *counters,
42 uint32_t nb_counters_max);
43 void sfc_mae_counters_fini(struct sfc_mae_counters *counters);
44 int sfc_mae_counter_enable(struct sfc_adapter *sa,
45 struct sfc_mae_counter_id *counterp);
46 int sfc_mae_counter_disable(struct sfc_adapter *sa,
47 struct sfc_mae_counter_id *counter);
48 int sfc_mae_counter_get(struct sfc_mae_counters *counters,
49 const struct sfc_mae_counter_id *counter,
50 struct rte_flow_query_count *data);
52 int sfc_mae_counter_start(struct sfc_adapter *sa);
53 void sfc_mae_counter_stop(struct sfc_adapter *sa);
58 #endif /* _SFC_MAE_COUNTER_H */