X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Ftf_ulp%2Fulp_fc_mgr.h;h=448d05c118813b0cb8158226a5f09f6621b6118a;hb=b37ed6def36798342172f298516c5fc6d0d8e070;hp=20726704941dbc27f3f4943b7531d5c098a0b44e;hpb=306c2d28e247a2dcc8af696f8a2f008d10f774c0;p=dpdk.git diff --git a/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h b/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h index 2072670494..448d05c118 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h +++ b/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2014-2019 Broadcom + * Copyright(c) 2014-2021 Broadcom * All rights reserved. */ @@ -16,14 +16,17 @@ #define FLOW_CNTR_BYTE_WIDTH 36 #define FLOW_CNTR_BYTE_MASK (((uint64_t)1 << FLOW_CNTR_BYTE_WIDTH) - 1) -#define FLOW_CNTR_PKTS(v) ((v) >> FLOW_CNTR_BYTE_WIDTH) -#define FLOW_CNTR_BYTES(v) ((v) & FLOW_CNTR_BYTE_MASK) +#define FLOW_CNTR_PKTS(v, d) (((v) & (d)->packet_count_mask) >> \ + (d)->packet_count_shift) +#define FLOW_CNTR_BYTES(v, d) (((v) & (d)->byte_count_mask) >> \ + (d)->byte_count_shift) struct sw_acc_counter { uint64_t pkt_count; uint64_t byte_count; bool valid; uint32_t hw_cntr_id; + uint32_t parent_flow_id; }; struct hw_fc_mem_info { @@ -36,6 +39,7 @@ struct hw_fc_mem_info { */ void *mem_pa; uint32_t start_idx; + bool start_idx_is_set; }; struct bnxt_ulp_fc_info { @@ -44,6 +48,7 @@ struct bnxt_ulp_fc_info { uint32_t flags; uint32_t num_entries; pthread_mutex_t fc_lock; + uint32_t num_counters; }; int32_t @@ -160,4 +165,22 @@ bool ulp_fc_mgr_thread_isstarted(struct bnxt_ulp_context *ctxt); int ulp_fc_mgr_query_count_get(struct bnxt_ulp_context *ulp_ctx, uint32_t flow_id, struct rte_flow_query_count *count); + +/* + * Set the parent flow if in the SW accumulator table entry + * + * ctxt [in] The ulp context for the flow counter manager + * + * dir [in] The direction of the flow + * + * hw_cntr_id [in] The HW flow counter ID + * + * fid [in] parent flow id + * + */ +int32_t ulp_fc_mgr_cntr_parent_flow_set(struct bnxt_ulp_context *ctxt, + enum tf_dir dir, + uint32_t hw_cntr_id, + uint32_t fid); + #endif /* _ULP_FC_MGR_H_ */