add features for host-based flow management
Subsystems (2)
PATCH v3 22/51 net/bnxt: support EM and TCAM lookup with table scope
In reply to Ajit KhapardeFrom: Peter Spreadborough <[email protected]>
- Support for table scope within the EM module
- Support for host and system memory
- Update TCAM set/free.
- Replace TF device type by HCAPI RM type.
- Update TCAM set and free for HCAPI RM type
--- drivers/net/bnxt/meson.build | 5 +- drivers/net/bnxt/tf_core/Makefile | 5 +- drivers/net/bnxt/tf_core/cfa_resource_types.h | 8 +- drivers/net/bnxt/tf_core/hwrm_tf.h | 864 +----------- drivers/net/bnxt/tf_core/tf_core.c | 100 +- drivers/net/bnxt/tf_core/tf_device.c | 50 +- drivers/net/bnxt/tf_core/tf_device.h | 86 +- drivers/net/bnxt/tf_core/tf_device_p4.c | 14 +- drivers/net/bnxt/tf_core/tf_device_p4.h | 20 +- drivers/net/bnxt/tf_core/tf_em.c | 360 ----- drivers/net/bnxt/tf_core/tf_em.h | 310 +++- drivers/net/bnxt/tf_core/tf_em_common.c | 281 ++++ drivers/net/bnxt/tf_core/tf_em_common.h | 107 ++ drivers/net/bnxt/tf_core/tf_em_host.c | 1146 +++++++++++++++ drivers/net/bnxt/tf_core/tf_em_internal.c | 312 +++++ drivers/net/bnxt/tf_core/tf_em_system.c | 118 ++ drivers/net/bnxt/tf_core/tf_msg.c | 1248 ++++------------- drivers/net/bnxt/tf_core/tf_msg.h | 233 +-- drivers/net/bnxt/tf_core/tf_rm.c | 89 +- drivers/net/bnxt/tf_core/tf_rm_new.c | 40 +- drivers/net/bnxt/tf_core/tf_tbl.c | 1134 --------------- drivers/net/bnxt/tf_core/tf_tbl_type.c | 39 +- drivers/net/bnxt/tf_core/tf_tcam.c | 25 +- drivers/net/bnxt/tf_core/tf_tcam.h | 4 + drivers/net/bnxt/tf_core/tf_util.c | 4 +- 25 files changed, 3030 insertions(+), 3572 deletions(-) delete mode 100644 drivers/net/bnxt/tf_core/tf_em.c create mode 100644 drivers/net/bnxt/tf_core/tf_em_common.c create mode 100644 drivers/net/bnxt/tf_core/tf_em_common.h create mode 100644 drivers/net/bnxt/tf_core/tf_em_host.c create mode 100644 drivers/net/bnxt/tf_core/tf_em_internal.c create mode 100644 drivers/net/bnxt/tf_core/tf_em_system.c
drivers/net/bnxt/meson.build +4 -1
@@ -28,7 +28,10 @@ sources = files('bnxt_cpr.c', 'tf_core/tf_msg.c', 'tf_core/rand.c', 'tf_core/stack.c', - 'tf_core/tf_em.c', + 'tf_core/tf_em_common.c', + 'tf_core/tf_em_host.c', + 'tf_core/tf_em_internal.c', + 'tf_core/tf_em_system.c', 'tf_core/tf_rm.c', 'tf_core/tf_tbl.c', 'tf_core/tfp.c',
drivers/net/bnxt/tf_core/Makefile +4 -1
@@ -12,8 +12,11 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_core.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_rm.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tfp.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_msg.c -SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_em.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_tbl.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_em_common.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_em_internal.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_em_host.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_em_system.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_session.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_device.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_device_p4.c
drivers/net/bnxt/tf_core/cfa_resource_types.h +6 -2
@@ -202,7 +202,9 @@#define CFA_RESOURCE_TYPE_P45_SP_TCAM 0x1fUL/* VEB TCAM */ #define CFA_RESOURCE_TYPE_P45_VEB_TCAM 0x20UL -#define CFA_RESOURCE_TYPE_P45_LAST CFA_RESOURCE_TYPE_P45_VEB_TCAM +/* Table Scope */ +#define CFA_RESOURCE_TYPE_P45_TBL_SCOPE 0x21UL +#define CFA_RESOURCE_TYPE_P45_LAST CFA_RESOURCE_TYPE_P45_TBL_SCOPE/* Multicast Group */
@@ -269,7 +271,9 @@#define CFA_RESOURCE_TYPE_P4_MIRROR 0x1eUL/* Source Property TCAM */ #define CFA_RESOURCE_TYPE_P4_SP_TCAM 0x1fUL -#define CFA_RESOURCE_TYPE_P4_LAST CFA_RESOURCE_TYPE_P4_SP_TCAM +/* Table Scope */ +#define CFA_RESOURCE_TYPE_P4_TBL_SCOPE 0x20UL +#define CFA_RESOURCE_TYPE_P4_LAST CFA_RESOURCE_TYPE_P4_TBL_SCOPE#endif /* _CFA_RESOURCE_TYPES_H_ */
drivers/net/bnxt/tf_core/hwrm_tf.h +1 -863
884 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_core.c +97 -3
121 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_device.c +46 -4
74 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_device.h +81 -5
109 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_device_p4.c +12 -2
@@ -93,6 +93,12 @@ const struct tf_dev_ops tf_dev_ops_p4_init = { .tf_dev_alloc_search_tcam = NULL, .tf_dev_set_tcam = NULL, .tf_dev_get_tcam = NULL, + .tf_dev_insert_int_em_entry = NULL, + .tf_dev_delete_int_em_entry = NULL, + .tf_dev_insert_ext_em_entry = NULL, + .tf_dev_delete_ext_em_entry = NULL, + .tf_dev_alloc_tbl_scope = NULL, + .tf_dev_free_tbl_scope = NULL, };/**
@@ -113,6 +119,10 @@ const struct tf_dev_ops tf_dev_ops_p4 = { .tf_dev_alloc_search_tcam = NULL, .tf_dev_set_tcam = tf_tcam_set, .tf_dev_get_tcam = NULL, - .tf_dev_insert_em_entry = tf_em_insert_entry, - .tf_dev_delete_em_entry = tf_em_delete_entry, + .tf_dev_insert_int_em_entry = tf_em_insert_int_entry, + .tf_dev_delete_int_em_entry = tf_em_delete_int_entry, + .tf_dev_insert_ext_em_entry = tf_em_insert_ext_entry, + .tf_dev_delete_ext_em_entry = tf_em_delete_ext_entry, + .tf_dev_alloc_tbl_scope = tf_em_ext_common_alloc, + .tf_dev_free_tbl_scope = tf_em_ext_common_free, };
drivers/net/bnxt/tf_core/tf_device_p4.h +16 -4
@@ -36,13 +36,12 @@ struct tf_rm_element_cfg tf_tbl_p4[TF_TBL_TYPE_MAX] = { { TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P4_MCG }, { TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P4_ENCAP_8B }, { TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P4_ENCAP_16B }, -/* CFA_RESOURCE_TYPE_P4_SRAM_ENCAP_32B */ +/* CFA_RESOURCE_TYPE_P4_ENCAP_32B */ { TF_RM_ELEM_CFG_NULL, CFA_RESOURCE_TYPE_INVALID }, { TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P4_ENCAP_64B }, { TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P4_SP_MAC }, -/* CFA_RESOURCE_TYPE_P4_SRAM_SP_SMAC_IPV4 */ - { TF_RM_ELEM_CFG_NULL, CFA_RESOURCE_TYPE_INVALID }, -/* CFA_RESOURCE_TYPE_P4_SRAM_SP_SMAC_IPV6 */ + { TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P4_SP_MAC_IPV4 }, +/* CFA_RESOURCE_TYPE_P4_SP_MAC_IPV6 */ { TF_RM_ELEM_CFG_NULL, CFA_RESOURCE_TYPE_INVALID }, { TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P4_COUNTER_64B }, { TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P4_NAT_SPORT },
@@ -77,4 +76,17 @@ struct tf_rm_element_cfg tf_tbl_p4[TF_TBL_TYPE_MAX] = {/* CFA_RESOURCE_TYPE_P4_EXT */ { TF_RM_ELEM_CFG_NULL, CFA_RESOURCE_TYPE_INVALID } }; + +struct tf_rm_element_cfg tf_em_ext_p4[TF_EM_TBL_TYPE_MAX ] = { +/* CFA_RESOURCE_TYPE_P4_EM_REC */ + {TF_RM_ELEM_CFG_NULL ,CFA_RESOURCE_TYPE_INVALID }, + {TF_RM_ELEM_CFG_HCAPI ,CFA_RESOURCE_TYPE_P4_TBL_SCOPE }, +}; + +struct tf_rm_element_cfg tf_em_int_p4[TF_EM_TBL_TYPE_MAX ] = { + {TF_RM_ELEM_CFG_HCAPI ,CFA_RESOURCE_TYPE_P4_EM_REC }, +/* CFA_RESOURCE_TYPE_P4_TBL_SCOPE */ + {TF_RM_ELEM_CFG_NULL ,CFA_RESOURCE_TYPE_INVALID }, +}; +#endif /* _TF_DEVICE_P4_H_ */
drivers/net/bnxt/tf_core/tf_em.c deleted +0 -360
360 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_em.h +292 -18
339 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_em_common.c new file +281 -0
281 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_em_common.h new file +107 -0
107 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_em_host.c new file +1146 -0
625 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_em_internal.c new file +312 -0
312 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_em_system.c new file +118 -0
118 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_msg.c +251 -997
1,248 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_msg.h +154 -79
233 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_rm.c +2 -87
89 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tbl.c +0 -1134
1,134 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tbl_type.c +35 -4
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.21.1 (Apple Git-122.3)
Part of the diff is not shown here. View the raw message.
PATCH v3 23/51 net/bnxt: update table get to use new design
In reply to Ajit KhapardeFrom: Michael Wildt <[email protected]>
- Move bulk table get implementation to new Tbl Module design.
- Update messages for bulk table get
- Retrieve specified table element using bulk mechanism
- Remove deprecated resource definitions
- Update device type configuration for P4.
- Update RM DB HCAPI count check and fix EM internal and host code such that EM DBs can be created correctly.
- Update error logging to be info on unbind in the different modules.
- Move RTE RSVD out of tf_resources.h
--- drivers/net/bnxt/hcapi/cfa_p40_tbl.h | 250 ++ drivers/net/bnxt/hcapi/hcapi_cfa.h | 2 + drivers/net/bnxt/meson.build | 3 +- drivers/net/bnxt/tf_core/Makefile | 2 - drivers/net/bnxt/tf_core/tf_common.h | 55 +- drivers/net/bnxt/tf_core/tf_core.c | 86 +- drivers/net/bnxt/tf_core/tf_device.h | 24 +- drivers/net/bnxt/tf_core/tf_device_p4.c | 4 +- drivers/net/bnxt/tf_core/tf_device_p4.h | 5 +- drivers/net/bnxt/tf_core/tf_em.h | 88 +- drivers/net/bnxt/tf_core/tf_em_common.c | 29 +- drivers/net/bnxt/tf_core/tf_em_internal.c | 59 +- drivers/net/bnxt/tf_core/tf_identifier.c | 14 +- drivers/net/bnxt/tf_core/tf_msg.c | 31 +- drivers/net/bnxt/tf_core/tf_msg.h | 8 +- drivers/net/bnxt/tf_core/tf_resources.h | 529 --- drivers/net/bnxt/tf_core/tf_rm.c | 3695 ++++----------------- drivers/net/bnxt/tf_core/tf_rm.h | 539 +-- drivers/net/bnxt/tf_core/tf_rm_new.c | 907 ----- drivers/net/bnxt/tf_core/tf_rm_new.h | 446 --- drivers/net/bnxt/tf_core/tf_session.h | 214 +- drivers/net/bnxt/tf_core/tf_tbl.c | 478 ++- drivers/net/bnxt/tf_core/tf_tbl.h | 436 ++- drivers/net/bnxt/tf_core/tf_tbl_type.c | 342 -- drivers/net/bnxt/tf_core/tf_tbl_type.h | 318 -- drivers/net/bnxt/tf_core/tf_tcam.c | 15 +- 26 files changed, 2337 insertions(+), 6242 deletions(-) create mode 100644 drivers/net/bnxt/hcapi/cfa_p40_tbl.h delete mode 100644 drivers/net/bnxt/tf_core/tf_rm_new.c delete mode 100644 drivers/net/bnxt/tf_core/tf_rm_new.h delete mode 100644 drivers/net/bnxt/tf_core/tf_tbl_type.c delete mode 100644 drivers/net/bnxt/tf_core/tf_tbl_type.h
drivers/net/bnxt/hcapi/cfa_p40_tbl.h new file +250 -0
@@ -0,0 +1,250 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2019-2020 Broadcom +* All rights reserved. +*/ +/* +* Name: cfa_p40_tbl.h +* +* Description: header for SWE based on Truflow +* +* Date: 12/16/19 17:18:12 +* +* Note: This file was originally generated by tflib_decode.py. +* Remainder is hand coded due to lack of availability of xml for +* addtional tables at this time (EEM Record and union fields) +* +**/ +#ifndef _CFA_P40_TBL_H_ +#define _CFA_P40_TBL_H_ + +#include "cfa_p40_hw.h" + +#include "hcapi_cfa_defs.h" + +const struct hcapi_cfa_field cfa_p40_prof_l2_ctxt_tcam_layout[] = { + {CFA_P40_PROF_L2_CTXT_TCAM_VALID_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_VALID_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_KEY_TYPE_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_KEY_TYPE_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_TUN_HDR_TYPE_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_TUN_HDR_TYPE_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_T_L2_NUMTAGS_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_T_L2_NUMTAGS_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_L2_NUMTAGS_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_L2_NUMTAGS_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_MAC1_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_MAC1_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_T_OVID_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_T_OVID_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_T_IVID_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_T_IVID_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_SPARIF_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_SPARIF_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_SVIF_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_SVIF_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_MAC0_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_MAC0_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_OVID_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_OVID_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_IVID_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_IVID_NUM_BITS }, +}; + +const struct hcapi_cfa_field cfa_p40_act_veb_tcam_layout[] = { + {CFA_P40_ACT_VEB_TCAM_VALID_BITPOS , +CFA_P40_ACT_VEB_TCAM_VALID_NUM_BITS }, + {CFA_P40_ACT_VEB_TCAM_RESERVED_BITPOS , +CFA_P40_ACT_VEB_TCAM_RESERVED_NUM_BITS }, + {CFA_P40_ACT_VEB_TCAM_PARIF_IN_BITPOS , +CFA_P40_ACT_VEB_TCAM_PARIF_IN_NUM_BITS }, + {CFA_P40_ACT_VEB_TCAM_NUM_VTAGS_BITPOS , +CFA_P40_ACT_VEB_TCAM_NUM_VTAGS_NUM_BITS }, + {CFA_P40_ACT_VEB_TCAM_MAC_BITPOS , +CFA_P40_ACT_VEB_TCAM_MAC_NUM_BITS }, + {CFA_P40_ACT_VEB_TCAM_OVID_BITPOS , +CFA_P40_ACT_VEB_TCAM_OVID_NUM_BITS }, + {CFA_P40_ACT_VEB_TCAM_IVID_BITPOS , +CFA_P40_ACT_VEB_TCAM_IVID_NUM_BITS }, +}; + +const struct hcapi_cfa_field cfa_p40_lkup_tcam_record_mem_layout[] = { + {CFA_P40_LKUP_TCAM_RECORD_MEM_VALID_BITPOS , +CFA_P40_LKUP_TCAM_RECORD_MEM_VALID_NUM_BITS }, + {CFA_P40_LKUP_TCAM_RECORD_MEM_ACT_REC_PTR_BITPOS , +CFA_P40_LKUP_TCAM_RECORD_MEM_ACT_REC_PTR_NUM_BITS }, + {CFA_P40_LKUP_TCAM_RECORD_MEM_STRENGTH_BITPOS , +CFA_P40_LKUP_TCAM_RECORD_MEM_STRENGTH_NUM_BITS }, +}; + +const struct hcapi_cfa_field cfa_p40_prof_ctxt_remap_mem_layout[] = { + {CFA_P40_PROF_CTXT_REMAP_MEM_TPID_ANTI_SPOOF_CTL_BITPOS , +CFA_P40_PROF_CTXT_REMAP_MEM_TPID_ANTI_SPOOF_CTL_NUM_BITS }, + {CFA_P40_PROF_CTXT_REMAP_MEM_PRI_ANTI_SPOOF_CTL_BITPOS , +CFA_P40_PROF_CTXT_REMAP_MEM_PRI_ANTI_SPOOF_CTL_NUM_BITS }, + {CFA_P40_PROF_CTXT_REMAP_MEM_BYP_SP_LKUP_BITPOS , +CFA_P40_PROF_CTXT_REMAP_MEM_BYP_SP_LKUP_NUM_BITS }, + {CFA_P40_PROF_CTXT_REMAP_MEM_SP_REC_PTR_BITPOS , +CFA_P40_PROF_CTXT_REMAP_MEM_SP_REC_PTR_NUM_BITS }, + {CFA_P40_PROF_CTXT_REMAP_MEM_BD_ACT_EN_BITPOS , +CFA_P40_PROF_CTXT_REMAP_MEM_BD_ACT_EN_NUM_BITS }, + {CFA_P40_PROF_CTXT_REMAP_MEM_DEFAULT_TPID_BITPOS , +CFA_P40_PROF_CTXT_REMAP_MEM_DEFAULT_TPID_NUM_BITS }, + {CFA_P40_PROF_CTXT_REMAP_MEM_ALLOWED_TPID_BITPOS , +CFA_P40_PROF_CTXT_REMAP_MEM_ALLOWED_TPID_NUM_BITS }, + {CFA_P40_PROF_CTXT_REMAP_MEM_DEFAULT_PRI_BITPOS , +CFA_P40_PROF_CTXT_REMAP_MEM_DEFAULT_PRI_NUM_BITS }, + {CFA_P40_PROF_CTXT_REMAP_MEM_ALLOWED_PRI_BITPOS , +CFA_P40_PROF_CTXT_REMAP_MEM_ALLOWED_PRI_NUM_BITS }, + {CFA_P40_PROF_CTXT_REMAP_MEM_PARIF_BITPOS , +CFA_P40_PROF_CTXT_REMAP_MEM_PARIF_NUM_BITS }, + {CFA_P40_PROF_CTXT_REMAP_MEM_BYP_LKUP_EN_BITPOS , +CFA_P40_PROF_CTXT_REMAP_MEM_BYP_LKUP_EN_NUM_BITS }, +/* Fields below not generated through automation */ + {CFA_P40_PROF_CTXT_REMAP_MEM_PROF_VNIC_BITPOS , +CFA_P40_PROF_CTXT_REMAP_MEM_PROF_VNIC_NUM_BITS }, + {CFA_P40_PROF_CTXT_REMAP_MEM_PROF_FUNC_BITPOS , +CFA_P40_PROF_CTXT_REMAP_MEM_PROF_FUNC_NUM_BITS }, + {CFA_P40_PROF_CTXT_REMAP_MEM_L2_CTXT_BITPOS , +CFA_P40_PROF_CTXT_REMAP_MEM_L2_CTXT_NUM_BITS }, + {CFA_P40_PROF_CTXT_REMAP_MEM_ARP_BITPOS , +CFA_P40_PROF_CTXT_REMAP_MEM_ARP_NUM_BITS }, +}; + +const struct hcapi_cfa_field cfa_p40_prof_profile_tcam_remap_mem_layout[] = { + {CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_PL_BYP_LKUP_EN_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_PL_BYP_LKUP_EN_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_EM_SEARCH_ENB_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_EM_SEARCH_ENB_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_EM_PROFILE_ID_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_EM_PROFILE_ID_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_EM_KEY_ID_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_EM_KEY_ID_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_EM_KEY_MASK_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_EM_KEY_MASK_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_TCAM_SEARCH_ENB_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_TCAM_SEARCH_ENB_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_TCAM_PROFILE_ID_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_TCAM_PROFILE_ID_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_TCAM_KEY_ID_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_TCAM_KEY_ID_NUM_BITS }, +}; + +const struct hcapi_cfa_field cfa_p40_prof_profile_tcam_layout[] = { + {CFA_P40_PROF_PROFILE_TCAM_VALID_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_VALID_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_PKT_TYPE_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_PKT_TYPE_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_RECYCLE_CNT_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_RECYCLE_CNT_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_AGG_ERROR_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_AGG_ERROR_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_PROF_FUNC_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_PROF_FUNC_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_RESERVED_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_RESERVED_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_HREC_NEXT_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_HREC_NEXT_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TL2_HDR_VALID_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TL2_HDR_VALID_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TL2_HDR_TYPE_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TL2_HDR_TYPE_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TL2_UC_MC_BC_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TL2_UC_MC_BC_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TL2_VTAG_PRESENT_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TL2_VTAG_PRESENT_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TL2_TWO_VTAGS_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TL2_TWO_VTAGS_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TL3_VALID_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TL3_VALID_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TL3_ERROR_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TL3_ERROR_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TL3_HDR_TYPE_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TL3_HDR_TYPE_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TL3_HDR_ISIP_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TL3_HDR_ISIP_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TL3_IPV6_CMP_SRC_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TL3_IPV6_CMP_SRC_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TL3_IPV6_CMP_DEST_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TL3_IPV6_CMP_DEST_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TL4_HDR_VALID_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TL4_HDR_VALID_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TL4_HDR_ERROR_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TL4_HDR_ERROR_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TL4_HDR_TYPE_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TL4_HDR_TYPE_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TL4_HDR_IS_UDP_TCP_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TL4_HDR_IS_UDP_TCP_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TUN_HDR_VALID_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TUN_HDR_VALID_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TUN_HDR_ERR_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TUN_HDR_ERR_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TUN_HDR_TYPE_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TUN_HDR_TYPE_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_TUN_HDR_FLAGS_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_TUN_HDR_FLAGS_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_L2_HDR_VALID_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_L2_HDR_VALID_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_L2_HDR_ERROR_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_L2_HDR_ERROR_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_L2_HDR_TYPE_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_L2_HDR_TYPE_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_L2_UC_MC_BC_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_L2_UC_MC_BC_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_L2_VTAG_PRESENT_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_L2_VTAG_PRESENT_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_L2_TWO_VTAGS_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_L2_TWO_VTAGS_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_L3_VALID_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_L3_VALID_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_L3_ERROR_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_L3_ERROR_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_L3_HDR_TYPE_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_L3_HDR_TYPE_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_L3_HDR_ISIP_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_L3_HDR_ISIP_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_L3_IPV6_CMP_SRC_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_L3_IPV6_CMP_SRC_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_L3_IPV6_CMP_DEST_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_L3_IPV6_CMP_DEST_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_L4_HDR_VALID_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_L4_HDR_VALID_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_L4_HDR_ERROR_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_L4_HDR_ERROR_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_L4_HDR_TYPE_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_L4_HDR_TYPE_NUM_BITS }, + {CFA_P40_PROF_PROFILE_TCAM_L4_HDR_IS_UDP_TCP_BITPOS , +CFA_P40_PROF_PROFILE_TCAM_L4_HDR_IS_UDP_TCP_NUM_BITS }, +}; + +/**************************************************************************/ +/** +* Non-autogenerated fields +*/ + +const struct hcapi_cfa_field cfa_p40_eem_key_tbl_layout[] = { + {CFA_P40_EEM_KEY_TBL_VALID_BITPOS , +CFA_P40_EEM_KEY_TBL_VALID_NUM_BITS }, + + {CFA_P40_EEM_KEY_TBL_L1_CACHEABLE_BITPOS , +CFA_P40_EEM_KEY_TBL_L1_CACHEABLE_NUM_BITS }, + + {CFA_P40_EEM_KEY_TBL_STRENGTH_BITPOS , +CFA_P40_EEM_KEY_TBL_STRENGTH_NUM_BITS }, + + {CFA_P40_EEM_KEY_TBL_KEY_SZ_BITPOS , +CFA_P40_EEM_KEY_TBL_KEY_SZ_NUM_BITS }, + + {CFA_P40_EEM_KEY_TBL_REC_SZ_BITPOS , +CFA_P40_EEM_KEY_TBL_REC_SZ_NUM_BITS }, + + {CFA_P40_EEM_KEY_TBL_ACT_REC_INT_BITPOS , +CFA_P40_EEM_KEY_TBL_ACT_REC_INT_NUM_BITS }, + + {CFA_P40_EEM_KEY_TBL_EXT_FLOW_CTR_BITPOS , +CFA_P40_EEM_KEY_TBL_EXT_FLOW_CTR_NUM_BITS }, + + {CFA_P40_EEM_KEY_TBL_AR_PTR_BITPOS , +CFA_P40_EEM_KEY_TBL_AR_PTR_NUM_BITS }, + +}; +#endif /* _CFA_P40_TBL_H_ */
drivers/net/bnxt/hcapi/hcapi_cfa.h +2 -0
@@ -243,6 +243,8 @@ int hcapi_cfa_p4_wc_tcam_hwop(struct hcapi_cfa_hwop *op, struct hcapi_cfa_data *obj_data);int hcapi_cfa_p4_wc_tcam_rec_hwop (struct hcapi_cfa_hwop *op,struct hcapi_cfa_data *obj_data); +int hcapi_cfa_p4_mirror_hwop (struct hcapi_cfa_hwop *op, +struct hcapi_cfa_data *mirror);#endif /* SUPPORT_CFA_HW_P4 */ /** * HCAPI CFA device HW operation function callback definition
drivers/net/bnxt/meson.build +1 -2
@@ -41,10 +41,9 @@ sources = files('bnxt_cpr.c', 'tf_core/tf_identifier.c', 'tf_core/tf_shadow_tbl.c', 'tf_core/tf_shadow_tcam.c', - 'tf_core/tf_tbl_type.c', 'tf_core/tf_tcam.c', 'tf_core/tf_util.c', - 'tf_core/tf_rm_new.c', + 'tf_core/tf_rm.c', 'hcapi/hcapi_cfa_p4.c',
drivers/net/bnxt/tf_core/Makefile +0 -2
@@ -23,10 +23,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_device_p4.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_identifier.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_shadow_tbl.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_shadow_tcam.c -SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_tbl_type.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_tcam.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_util.c -SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_rm_new.c SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_core.h SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_project.h
drivers/net/bnxt/tf_core/tf_common.h +10 -45
74 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_core.c +79 -7
128 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_device.h +22 -2
@@ -8,7 +8,7 @@#include "tf_core.h" #include "tf_identifier.h" -#include "tf_tbl_type.h" +#include "tf_tbl.h" #include "tf_tcam.h" struct tf ;
@@ -293,7 +293,27 @@ struct tf_dev_ops {* - (-EINVAL) on failure. */ int (*tf_dev_get_tbl)(struct tf *tfp, -struct tf_tbl_get_parms *parms); +struct tf_tbl_get_parms *parms); + +/** +* Retrieves the specified table type element using 'bulk' +* mechanism. +* +* This API retrieves the specified element data by invoking the +* firmware. +* +* [in] tfp +* Pointer to TF handle +* +* [in] parms +* Pointer to table get bulk parameters +* +* Returns +* - (0) if successful. +* - (-EINVAL) on failure. +*/ +int (*tf_dev_get_bulk_tbl)(struct tf *tfp, +struct tf_tbl_get_bulk_parms *parms);/** * Allocation of a tcam element.
drivers/net/bnxt/tf_core/tf_device_p4.c +3 -1
@@ -8,7 +8,7 @@#include "tf_device.h" #include "tf_identifier.h" -#include "tf_tbl_type.h" +#include "tf_tbl.h" #include "tf_tcam.h" #include "tf_em.h"
@@ -88,6 +88,7 @@ const struct tf_dev_ops tf_dev_ops_p4_init = { .tf_dev_alloc_search_tbl = NULL, .tf_dev_set_tbl = NULL, .tf_dev_get_tbl = NULL, + .tf_dev_get_bulk_tbl = NULL, .tf_dev_alloc_tcam = NULL, .tf_dev_free_tcam = NULL, .tf_dev_alloc_search_tcam = NULL,
@@ -114,6 +115,7 @@ const struct tf_dev_ops tf_dev_ops_p4 = { .tf_dev_alloc_search_tbl = NULL, .tf_dev_set_tbl = tf_tbl_set, .tf_dev_get_tbl = tf_tbl_get, + .tf_dev_get_bulk_tbl = tf_tbl_bulk_get, .tf_dev_alloc_tcam = tf_tcam_alloc, .tf_dev_free_tcam = tf_tcam_free, .tf_dev_alloc_search_tcam = NULL,
drivers/net/bnxt/tf_core/tf_device_p4.h +2 -3
@@ -9,7 +9,7 @@#include <cfa_resource_types.h> #include "tf_core.h" -#include "tf_rm_new.h" +#include "tf_rm.h" struct tf_rm_element_cfg tf_ident_p4[TF_IDENT_TYPE_MAX ] = { {TF_RM_ELEM_CFG_HCAPI ,CFA_RESOURCE_TYPE_P4_L2_CTXT_REMAP },
@@ -41,8 +41,7 @@ struct tf_rm_element_cfg tf_tbl_p4[TF_TBL_TYPE_MAX] = { { TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P4_ENCAP_64B }, { TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P4_SP_MAC }, { TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P4_SP_MAC_IPV4 }, -/* CFA_RESOURCE_TYPE_P4_SP_MAC_IPV6 */ - { TF_RM_ELEM_CFG_NULL, CFA_RESOURCE_TYPE_INVALID }, + { TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P4_SP_MAC_IPV6 }, { TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P4_COUNTER_64B }, { TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P4_NAT_SPORT }, { TF_RM_ELEM_CFG_HCAPI, CFA_RESOURCE_TYPE_P4_NAT_DPORT },
drivers/net/bnxt/tf_core/tf_em.h +84 -4
117 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_em_common.c +19 -10
@@ -194,12 +194,13 @@ tf_em_ext_common_bind(struct tf *tfp,int rc;int i;struct tf_rm_create_db_parms db_cfg = {0 }; +uint8_t db_exists =0 ;TF_CHECK_PARMS2 (tfp, parms);if (init) {TFP_DRV_LOG (ERR , -"Identifier already initialized\n" ); +"EM Ext DB already initialized\n" );return -EINVAL ; }
@@ -210,19 +211,29 @@ tf_em_ext_common_bind(struct tf *tfp,for (i =0 ; i <TF_DIR_MAX ; i++) { db_cfg.dir = i; db_cfg.alloc_cnt = parms->resources->em_cnt[i].cnt; + +/* Check if we got any request to support EEM, if so +* we build an EM Ext DB holding Table Scopes. +*/ +if (db_cfg.alloc_cnt[TF_EM_TBL_TYPE_TBL_SCOPE ] ==0 ) +continue ; + db_cfg.rm_db = &eem_db[i]; rc =tf_rm_create_db (tfp, &db_cfg);if (rc) {TFP_DRV_LOG (ERR , -"%s: EM DB creation failed\n" , +"%s: EM Ext DB creation failed\n" ,tf_dir_2_str (i));return rc; } + db_exists =1 ; } - mem_type = parms->mem_type; - init =1 ; +if (db_exists) { + mem_type = parms->mem_type; + init =1 ; + }return 0 ; }
@@ -236,13 +247,11 @@ tf_em_ext_common_unbind(struct tf *tfp)TF_CHECK_PARMS1 (tfp); -/* Bail if nothing has been initialized done silent as to -* allow for creation cleanup. -*/ +/* Bail if nothing has been initialized */ if (!init) { -TFP_DRV_LOG (ERR , -"No EM DBs created\n" ); -return -EINVAL ; +TFP_DRV_LOG (INFO , +"No EM Ext DBs created\n" ); +return 0 ; }for (i =0 ; i <TF_DIR_MAX ; i++) {
drivers/net/bnxt/tf_core/tf_em_internal.c +31 -28
87 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_identifier.c +6 -8
@@ -7,7 +7,7 @@#include "tf_identifier.h" #include "tf_common.h" -#include "tf_rm_new.h" +#include "tf_rm.h" #include "tf_util.h" #include "tfp.h"
@@ -35,7 +35,7 @@ tf_ident_bind(struct tf *tfp,if (init) {TFP_DRV_LOG (ERR , -"Identifier already initialized\n" ); +"Identifier DB already initialized\n" );return -EINVAL ; }
@@ -65,7 +65,7 @@ tf_ident_bind(struct tf *tfp, }int -tf_ident_unbind(struct tf *tfp __rte_unused) +tf_ident_unbind (struct tf *tfp) {int rc;int i;
@@ -73,13 +73,11 @@ tf_ident_unbind(struct tf *tfp __rte_unused)TF_CHECK_PARMS1 (tfp); -/* Bail if nothing has been initialized done silent as to -* allow for creation cleanup. -*/ +/* Bail if nothing has been initialized */ if (!init) { -TFP_DRV_LOG (ERR , +TFP_DRV_LOG (INFO ,"No Identifier DBs created\n" ); -return -EINVAL ; +return 0 ; }for (i =0 ; i <TF_DIR_MAX ; i++) {
drivers/net/bnxt/tf_core/tf_msg.c +23 -8
@@ -871,26 +871,41 @@ tf_msg_get_tbl_entry(struct tf *tfp,int tf_msg_bulk_get_tbl_entry (struct tf *tfp, -struct tf_bulk_get_tbl_entry_parms *params) +enum tf_dir dir, +uint16_t hcapi_type, +uint32_t starting_idx, +uint16_t num_entries, +uint16_t entry_sz_in_bytes, +uint64_t physical_mem_addr) {int rc;struct tfp_send_msg_parms parms = {0 };struct tf_tbl_type_bulk_get_input req = {0 };struct tf_tbl_type_bulk_get_output resp = {0 }; -struct tf_session *tfs = (struct tf_session *)(tfp->session->core_data); +struct tf_session *tfs;int data_size =0 ; +/* Retrieve the session information */ + rc =tf_session_get_session (tfp, &tfs); +if (rc) { +TFP_DRV_LOG (ERR , +"%s: Failed to lookup session, rc:%s\n" , +tf_dir_2_str (dir), +strerror (-rc)); +return rc; + } +/* Populate the request */ req.fw_session_id =tfp_cpu_to_le_32 (tfs->session_id.internal.fw_session_id); - req.flags =tfp_cpu_to_le_16 (params->dir); - req.type =tfp_cpu_to_le_32 (params->type); - req.start_index =tfp_cpu_to_le_32 (params->starting_idx); - req.num_entries =tfp_cpu_to_le_32 (params->num_entries); + req.flags =tfp_cpu_to_le_16 (dir); + req.type =tfp_cpu_to_le_32 (hcapi_type); + req.start_index =tfp_cpu_to_le_32 (starting_idx); + req.num_entries =tfp_cpu_to_le_32 (num_entries); - data_size = params->num_entries * params->entry_sz_in_bytes; + data_size = num_entries * entry_sz_in_bytes; - req.host_addr =tfp_cpu_to_le_64 (params->physical_mem_addr); + req.host_addr =tfp_cpu_to_le_64 (physical_mem_addr); MSG_PREP(parms, TF_KONG_MB,
drivers/net/bnxt/tf_core/tf_msg.h +6 -2
@@ -11,7 +11,6 @@#include "tf_tbl.h" #include "tf_rm.h" -#include "tf_rm_new.h" #include "tf_tcam.h" struct tf ;
@@ -422,6 +421,11 @@ int tf_msg_get_tbl_entry(struct tf *tfp,* 0 on Success else internal Truflow error */ int tf_msg_bulk_get_tbl_entry (struct tf *tfp, -struct tf_bulk_get_tbl_entry_parms *parms); +enum tf_dir dir, +uint16_t hcapi_type, +uint32_t starting_idx, +uint16_t num_entries, +uint16_t entry_sz_in_bytes, +uint64_t physical_mem_addr);#endif /* _TF_MSG_H_ */
drivers/net/bnxt/tf_core/tf_resources.h +0 -529
535 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_rm.c +720 -2975
1,534 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_rm.h +341 -198
539 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_rm_new.c deleted +0 -907
907 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_rm_new.h deleted +0 -446
446 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_session.h +3 -211
214 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tbl.c +358 -120
478 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tbl.h +369 -67
436 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tbl_type.c deleted +0 -342
342 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tbl_type.h deleted +0 -318
318 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.21.1 (Apple Git-122.3)
Part of the diff is not shown here. View the raw message.
PATCH v3 24/51 net/bnxt: update RM to support HCAPI only
In reply to Ajit KhapardeFrom: Peter Spreadborough <[email protected]>
- For the EM Module there is a need to only allocate the EM Records in HCAPI RM but the storage control is requested to be outside of the RM DB.
- Add TF_RM_ELEM_CFG_HCAPI_BA.
- Return error when the number of reserved entries for wc tcam is odd number in tf_tcam_bind.
- Remove em_pool from session
- Use RM provided start offset and size
- HCAPI returns entry index instead of row index for WC TCAM.
- Move resource type conversion to hrwm set/free tcam functions.
--- drivers/net/bnxt/tf_core/tf_device_p4.c | 2 + drivers/net/bnxt/tf_core/tf_device_p4.h | 54 ++++----- drivers/net/bnxt/tf_core/tf_em_internal.c | 131 ++++++++++++++-------- drivers/net/bnxt/tf_core/tf_msg.c | 6 +- drivers/net/bnxt/tf_core/tf_rm.c | 81 ++++++------- drivers/net/bnxt/tf_core/tf_rm.h | 14 ++- drivers/net/bnxt/tf_core/tf_session.h | 5 - drivers/net/bnxt/tf_core/tf_tcam.c | 21 ++++ 8 files changed, 190 insertions(+), 124 deletions(-)
drivers/net/bnxt/tf_core/tf_device_p4.c +2 -0
@@ -68,6 +68,8 @@ tf_dev_p4_get_tcam_slice_info(struct tf *tfp __rte_unused, *num_slices_per_row =CFA_P4_WC_TCAM_SLICES_PER_ROW ;if (key_sz > *num_slices_per_row *CFA_P4_WC_TCAM_SLICE_SIZE )return -ENOTSUP ; + + *num_slices_per_row =1 ; }else {/* for other type of tcam */ *num_slices_per_row =1 ; }
drivers/net/bnxt/tf_core/tf_device_p4.h +27 -27
79 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_em_internal.c +84 -47
272 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_msg.c +3 -3
@@ -857,12 +857,12 @@ tf_msg_get_tbl_entry(struct tf *tfp,return rc;/* Verify that we got enough buffer to return the requested data */ -if (resp.size < size) +if (tfp_le_to_cpu_32 (resp.size) != size)return -EINVAL ;tfp_memcpy (data, &resp.data, - resp.size); + size);return tfp_le_to_cpu_32 (parms.tf_resp_code); }
@@ -919,7 +919,7 @@ tf_msg_bulk_get_tbl_entry(struct tf *tfp,return rc;/* Verify that we got enough buffer to return the requested data */ -if (resp.size < data_size) +if (tfp_le_to_cpu_32 (resp.size) != data_size)return -EINVAL ;return tfp_le_to_cpu_32 (parms.tf_resp_code);
drivers/net/bnxt/tf_core/tf_rm.c +43 -38
149 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_rm.h +10 -4
@@ -56,12 +56,18 @@ struct tf_rm_new_entry {* ULP layer that is not controlled by HCAPI within the Firmware. */ enum tf_rm_elem_cfg_type { -/** No configuration */ +/** +* No configuration +*/ TF_RM_ELEM_CFG_NULL , -/** HCAPI 'controlled', uses a Pool for internal storage */ +/** HCAPI 'controlled', no RM storage thus the Device Module +* using the RM can chose to handle storage locally. +*/ TF_RM_ELEM_CFG_HCAPI , -/** Private thus not HCAPI 'controlled', creates a Pool for storage */ -TF_RM_ELEM_CFG_PRIVATE , +/** HCAPI 'controlled', uses a Bit Allocator Pool for internal +* storage in the RM. +*/ +TF_RM_ELEM_CFG_HCAPI_BA ,/** * Shared element thus it belongs to a shared FW Session and * is not controlled by the Host.
drivers/net/bnxt/tf_core/tf_session.h +0 -5
@@ -103,11 +103,6 @@ struct tf_session {/** Table scope array */ struct tf_tbl_scope_cb tbl_scopes[TF_NUM_TBL_SCOPE ]; - -/** -* EM Pools -*/ -struct stack em_pool[TF_DIR_MAX ]; };/**
drivers/net/bnxt/tf_core/tf_tcam.c +21 -0
@@ -43,6 +43,7 @@ tf_tcam_bind(struct tf *tfp, {int rc;int i; +struct tf_tcam_resources *tcam_cnt;struct tf_rm_create_db_parms db_cfg = {0 };TF_CHECK_PARMS2 (tfp, parms);
@@ -53,6 +54,14 @@ tf_tcam_bind(struct tf *tfp,return -EINVAL ; } + tcam_cnt = parms->resources->tcam_cnt; +if ((tcam_cnt[TF_DIR_RX ].cnt[TF_TCAM_TBL_TYPE_WC_TCAM ] %2 ) || + (tcam_cnt[TF_DIR_TX ].cnt[TF_TCAM_TBL_TYPE_WC_TCAM ] %2 )) { +TFP_DRV_LOG (ERR , +"Number of WC TCAM entries cannot be odd num\n" ); +return -EINVAL ; + } + db_cfg.type =TF_DEVICE_MODULE_TYPE_TCAM ; db_cfg.num_elements = parms->num_elements; db_cfg.cfg = parms->cfg;
@@ -168,6 +177,18 @@ tf_tcam_alloc(struct tf *tfp,return rc; } +if (parms->type ==TF_TCAM_TBL_TYPE_WC_TCAM && + (parms->idx %2 ) !=0 ) { + rc =tf_rm_allocate (&aparms); +if (rc) { +TFP_DRV_LOG (ERR , +"%s: Failed tcam, type:%d\n" , +tf_dir_2_str (parms->dir), + parms->type); +return rc; + } + } + parms->idx *= num_slice_per_row;return 0 ;
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 25/51 net/bnxt: remove table scope from session
In reply to Ajit KhapardeFrom: Peter Spreadborough <[email protected]>
- Remove table scope data from session. Added to EEM.
- Complete move to RM of table scope base and range.
- Fix some err messaging strings.
- Fix the tcam logging message.
--- drivers/net/bnxt/tf_core/tf_core.c | 2 +- drivers/net/bnxt/tf_core/tf_em.h | 1 - drivers/net/bnxt/tf_core/tf_em_common.c | 16 +++++++---- drivers/net/bnxt/tf_core/tf_em_common.h | 5 +--- drivers/net/bnxt/tf_core/tf_em_host.c | 38 ++++++++++--------------- drivers/net/bnxt/tf_core/tf_em_system.c | 12 +++----- drivers/net/bnxt/tf_core/tf_session.h | 3 -- drivers/net/bnxt/tf_core/tf_tcam.c | 6 ++-- 8 files changed, 35 insertions(+), 48 deletions(-)
drivers/net/bnxt/tf_core/tf_core.c +1 -1
@@ -573,7 +573,7 @@ tf_free_tcam_entry(struct tf *tfp, rc = dev->ops->tf_dev_free_tcam (tfp, &fparms);if (rc) {TFP_DRV_LOG (ERR , -"%s: TCAM allocation failed, rc:%s\n" , +"%s: TCAM free failed, rc:%s\n" ,tf_dir_2_str (parms->dir),strerror (-rc));return rc;
drivers/net/bnxt/tf_core/tf_em.h +0 -1
@@ -9,7 +9,6 @@#include "tf_core.h" #include "tf_session.h" -#define TF_HACK_TBL_SCOPE_BASE 68#define SUPPORT_CFA_HW_P4 1#define SUPPORT_CFA_HW_P58 0#define SUPPORT_CFA_HW_P59 0
drivers/net/bnxt/tf_core/tf_em_common.c +10 -6
@@ -29,6 +29,8 @@*/ void *eem_db[TF_DIR_MAX ]; +#define TF_EEM_DB_TBL_SCOPE 1 +/** * Init flag, set on bind and cleared on unbind */
@@ -39,10 +41,12 @@ static uint8_t init;*/ static enum tf_mem_type mem_type; +/** Table scope array */ +struct tf_tbl_scope_cb tbl_scopes[TF_NUM_TBL_SCOPE ]; +/* API defined in tf_em.h */ struct tf_tbl_scope_cb * -tbl_scope_cb_find (struct tf_session *session, -uint32_t tbl_scope_id) +tbl_scope_cb_find (uint32_t tbl_scope_id) {int i;struct tf_rm_is_allocated_parms parms;
@@ -50,8 +54,8 @@ tbl_scope_cb_find(struct tf_session *session,/* Check that id is valid */ parms.rm_db = eem_db[TF_DIR_RX ]; - parms.db_index =1 /**** TYPE TABLE-SCOPE??? ****/ ; - parms.index = tbl_scope_id +TF_HACK_TBL_SCOPE_BASE ; + parms.db_index =TF_EEM_DB_TBL_SCOPE ; + parms.index = tbl_scope_id; parms.allocated = &allocated; i =tf_rm_is_allocated (&parms);
@@ -60,8 +64,8 @@ tbl_scope_cb_find(struct tf_session *session,return NULL ;for (i =0 ; i <TF_NUM_TBL_SCOPE ; i++) { -if (session->tbl_scopes[i].tbl_scope_id == tbl_scope_id) -return &session->tbl_scopes[i]; +if (tbl_scopes[i].tbl_scope_id == tbl_scope_id) +return &tbl_scopes[i]; }return NULL ;
drivers/net/bnxt/tf_core/tf_em_common.h +1 -4
@@ -14,8 +14,6 @@* Function to search for table scope control block structure * with specified table scope ID. * -* [in] session -* Session to use for the search of the table scope control block * [in] tbl_scope_id * Table scope ID to search for *
@@ -23,8 +21,7 @@* Pointer to the found table scope control block struct or NULL if * table scope control block struct not found */ -struct tf_tbl_scope_cb *tbl_scope_cb_find (struct tf_session *session, -uint32_t tbl_scope_id); +struct tf_tbl_scope_cb *tbl_scope_cb_find (uint32_t tbl_scope_id);/** * Create and initialize a stack to use for action entries
drivers/net/bnxt/tf_core/tf_em_host.c +15 -23
@@ -48,6 +48,9 @@* EM DBs. */ extern void *eem_db[TF_DIR_MAX ]; +#define TF_EEM_DB_TBL_SCOPE 1 + +extern struct tf_tbl_scope_cb tbl_scopes[TF_NUM_TBL_SCOPE ];/** * Function to free a page table
@@ -934,14 +937,12 @@ tf_delete_eem_entry(struct tf_tbl_scope_cb *tbl_scope_cb,* -EINVAL - Error */ int -tf_em_insert_ext_entry (struct tf *tfp, +tf_em_insert_ext_entry(struct tf *tfp __rte_unused,struct tf_insert_em_entry_parms *parms) {struct tf_tbl_scope_cb *tbl_scope_cb; - tbl_scope_cb = -tbl_scope_cb_find ((struct tf_session *)(tfp->session->core_data), - parms->tbl_scope_id); + tbl_scope_cb =tbl_scope_cb_find (parms->tbl_scope_id);if (tbl_scope_cb ==NULL ) {TFP_DRV_LOG (ERR ,"Invalid tbl_scope_cb\n" );return -EINVAL ;
@@ -957,14 +958,12 @@ tf_em_insert_ext_entry(struct tf *tfp,* -EINVAL - Error */ int -tf_em_delete_ext_entry (struct tf *tfp, +tf_em_delete_ext_entry(struct tf *tfp __rte_unused,struct tf_delete_em_entry_parms *parms) {struct tf_tbl_scope_cb *tbl_scope_cb; - tbl_scope_cb = -tbl_scope_cb_find ((struct tf_session *)(tfp->session->core_data), - parms->tbl_scope_id); + tbl_scope_cb =tbl_scope_cb_find (parms->tbl_scope_id);if (tbl_scope_cb ==NULL ) {TFP_DRV_LOG (ERR ,"Invalid tbl_scope_cb\n" );return -EINVAL ;
@@ -981,16 +980,13 @@ tf_em_ext_host_alloc(struct tf *tfp,enum tf_dir dir;struct tf_tbl_scope_cb *tbl_scope_cb;struct hcapi_cfa_em_table *em_tables; -struct tf_session *session;struct tf_free_tbl_scope_parms free_parms;struct tf_rm_allocate_parms aparms = {0 };struct tf_rm_free_parms fparms = {0 }; - session = (struct tf_session *)tfp->session->core_data; -/* Get Table Scope control block from the session pool */ aparms.rm_db = eem_db[TF_DIR_RX ]; - aparms.db_index =1 /**** TYPE TABLE-SCOPE??? ****/ ; + aparms.db_index =TF_EEM_DB_TBL_SCOPE ; aparms.index = (uint32_t *)&parms->tbl_scope_id; rc =tf_rm_allocate (&aparms);if (rc) {
@@ -999,8 +995,7 @@ tf_em_ext_host_alloc(struct tf *tfp,return rc; } - parms->tbl_scope_id -=TF_HACK_TBL_SCOPE_BASE ; - tbl_scope_cb = &session->tbl_scopes[parms->tbl_scope_id]; + tbl_scope_cb = &tbl_scopes[parms->tbl_scope_id]; tbl_scope_cb->index = parms->tbl_scope_id; tbl_scope_cb->tbl_scope_id = parms->tbl_scope_id;
@@ -1092,8 +1087,8 @@ tf_em_ext_host_alloc(struct tf *tfp, cleanup:/* Free Table control block */ fparms.rm_db = eem_db[TF_DIR_RX ]; - fparms.db_index =1 /**** TYPE TABLE-SCOPE??? ****/ ; - fparms.index = parms->tbl_scope_id +TF_HACK_TBL_SCOPE_BASE ; + fparms.db_index =TF_EEM_DB_TBL_SCOPE ; + fparms.index = parms->tbl_scope_id;tf_rm_free (&fparms);return -EINVAL ; }
@@ -1105,13 +1100,9 @@ tf_em_ext_host_free(struct tf *tfp,int rc =0 ;enum tf_dir dir;struct tf_tbl_scope_cb *tbl_scope_cb; -struct tf_session *session;struct tf_rm_free_parms aparms = {0 }; - session = (struct tf_session *)(tfp->session->core_data); - - tbl_scope_cb =tbl_scope_cb_find (session, - parms->tbl_scope_id); + tbl_scope_cb =tbl_scope_cb_find (parms->tbl_scope_id);if (tbl_scope_cb ==NULL ) {TFP_DRV_LOG (ERR ,"Table scope error\n" );
@@ -1120,8 +1111,8 @@ tf_em_ext_host_free(struct tf *tfp,/* Free Table control block */ aparms.rm_db = eem_db[TF_DIR_RX ]; - aparms.db_index =1 /**** TYPE TABLE-SCOPE??? ****/ ; - aparms.index = parms->tbl_scope_id +TF_HACK_TBL_SCOPE_BASE ; + aparms.db_index =TF_EEM_DB_TBL_SCOPE ; + aparms.index = parms->tbl_scope_id; rc =tf_rm_free (&aparms);if (rc) { TFP_DRV_LOG(ERR,
@@ -1142,5 +1133,6 @@ tf_em_ext_host_free(struct tf *tfp,tf_em_ctx_unreg (tfp, tbl_scope_cb, dir); } + tbl_scopes[parms->tbl_scope_id].tbl_scope_id =-1 ;return rc; }
drivers/net/bnxt/tf_core/tf_em_system.c +4 -8
@@ -63,14 +63,12 @@ tf_delete_eem_entry(struct tf_tbl_scope_cb *tbl_scope_cb __rte_unused,* -EINVAL - Error */ int -tf_em_insert_ext_sys_entry (struct tf *tfp, +tf_em_insert_ext_sys_entry(struct tf *tfp __rte_unused,struct tf_insert_em_entry_parms *parms) {struct tf_tbl_scope_cb *tbl_scope_cb; - tbl_scope_cb =tbl_scope_cb_find - ((struct tf_session *)(tfp->session->core_data), - parms->tbl_scope_id); + tbl_scope_cb =tbl_scope_cb_find (parms->tbl_scope_id);if (tbl_scope_cb ==NULL ) {TFP_DRV_LOG (ERR ,"Invalid tbl_scope_cb\n" );return -EINVAL ;
@@ -87,14 +85,12 @@ tf_em_insert_ext_sys_entry(struct tf *tfp,* -EINVAL - Error */ int -tf_em_delete_ext_sys_entry (struct tf *tfp, +tf_em_delete_ext_sys_entry(struct tf *tfp __rte_unused,struct tf_delete_em_entry_parms *parms) {struct tf_tbl_scope_cb *tbl_scope_cb; - tbl_scope_cb =tbl_scope_cb_find - ((struct tf_session *)(tfp->session->core_data), - parms->tbl_scope_id); + tbl_scope_cb =tbl_scope_cb_find (parms->tbl_scope_id);if (tbl_scope_cb ==NULL ) {TFP_DRV_LOG (ERR ,"Invalid tbl_scope_cb\n" );return -EINVAL ;
drivers/net/bnxt/tf_core/tf_session.h +0 -3
@@ -100,9 +100,6 @@ struct tf_session {/** Device handle */ struct tf_dev_info dev; - -/** Table scope array */ -struct tf_tbl_scope_cb tbl_scopes[TF_NUM_TBL_SCOPE ]; };/**
drivers/net/bnxt/tf_core/tf_tcam.c +4 -2
@@ -287,7 +287,8 @@ tf_tcam_free(struct tf *tfp, rc =tf_msg_tcam_entry_free (tfp, parms);if (rc) {/* Log error */ - TFP_DRV_LOG(ERR, "%s: %s: Entry %d free failed with err %s", + TFP_DRV_LOG(ERR, + "%s: %s: Entry %d free failed, rc:%s\n", tf_dir_2_str(parms->dir), tf_tcam_tbl_2_str(parms->type), parms->idx,
@@ -382,7 +383,8 @@ tf_tcam_set(struct tf *tfp __rte_unused, rc =tf_msg_tcam_entry_set (tfp, parms);if (rc) {/* Log error */ - TFP_DRV_LOG(ERR, "%s: %s: Entry %d free failed with err %s", + TFP_DRV_LOG(ERR, + "%s: %s: Entry %d set failed, rc:%s", tf_dir_2_str(parms->dir), tf_tcam_tbl_2_str(parms->type), parms->idx,
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 26/51 net/bnxt: add external action alloc and free
In reply to Ajit KhapardeFrom: Jay Ding <[email protected]>
- Link external action alloc and free to new hcapi interface
- Add parameter range checking
- Fix issues with index allocation check
--- drivers/net/bnxt/tf_core/tf_core.c | 163 ++++++++++++++++------- drivers/net/bnxt/tf_core/tf_core.h | 4 - drivers/net/bnxt/tf_core/tf_device.h | 58 ++++++++ drivers/net/bnxt/tf_core/tf_device_p4.c | 6 + drivers/net/bnxt/tf_core/tf_device_p4.h | 2 - drivers/net/bnxt/tf_core/tf_em.h | 95 +++++++++++++ drivers/net/bnxt/tf_core/tf_em_common.c | 120 ++++++++++++++++- drivers/net/bnxt/tf_core/tf_em_host.c | 80 ++++++++++- drivers/net/bnxt/tf_core/tf_em_system.c | 6 + drivers/net/bnxt/tf_core/tf_identifier.c | 4 +- drivers/net/bnxt/tf_core/tf_rm.h | 5 + drivers/net/bnxt/tf_core/tf_tbl.c | 10 +- drivers/net/bnxt/tf_core/tf_tbl.h | 12 ++ drivers/net/bnxt/tf_core/tf_tcam.c | 8 +- drivers/net/bnxt/tf_core/tf_util.c | 4 - 15 files changed, 499 insertions(+), 78 deletions(-)
drivers/net/bnxt/tf_core/tf_core.c +115 -48
@@ -617,25 +617,48 @@ tf_alloc_tbl_entry(struct tf *tfp,return rc; } -if (dev->ops->tf_dev_alloc_tbl ==NULL ) { - rc = -EOPNOTSUPP ; -TFP_DRV_LOG (ERR , -"%s: Operation not supported, rc:%s\n" , -tf_dir_2_str (parms->dir), -strerror (-rc)); -return -EOPNOTSUPP ; - } - aparms.dir = parms->dir; aparms.type = parms->type; aparms.idx = &idx; - rc = dev->ops->tf_dev_alloc_tbl (tfp, &aparms); -if (rc) { -TFP_DRV_LOG (ERR , -"%s: Table allocation failed, rc:%s\n" , -tf_dir_2_str (parms->dir), -strerror (-rc)); -return rc; + aparms.tbl_scope_id = parms->tbl_scope_id; + +if (parms->type ==TF_TBL_TYPE_EXT ) { +if (dev->ops->tf_dev_alloc_ext_tbl ==NULL ) { + rc = -EOPNOTSUPP ; +TFP_DRV_LOG (ERR , +"%s: Operation not supported, rc:%s\n" , +tf_dir_2_str (parms->dir), +strerror (-rc)); +return -EOPNOTSUPP ; + } + + rc = dev->ops->tf_dev_alloc_ext_tbl (tfp, &aparms); +if (rc) { +TFP_DRV_LOG (ERR , +"%s: External table allocation failed, rc:%s\n" , +tf_dir_2_str (parms->dir), +strerror (-rc)); +return rc; + } + + }else { +if (dev->ops->tf_dev_alloc_tbl ==NULL ) { + rc = -EOPNOTSUPP ; +TFP_DRV_LOG (ERR , +"%s: Operation not supported, rc:%s\n" , +tf_dir_2_str (parms->dir), +strerror (-rc)); +return -EOPNOTSUPP ; + } + + rc = dev->ops->tf_dev_alloc_tbl (tfp, &aparms); +if (rc) { +TFP_DRV_LOG (ERR , +"%s: Table allocation failed, rc:%s\n" , +tf_dir_2_str (parms->dir), +strerror (-rc)); +return rc; + } } parms->idx = idx;
@@ -677,25 +700,47 @@ tf_free_tbl_entry(struct tf *tfp,return rc; } -if (dev->ops->tf_dev_free_tbl ==NULL ) { - rc = -EOPNOTSUPP ; -TFP_DRV_LOG (ERR , -"%s: Operation not supported, rc:%s\n" , -tf_dir_2_str (parms->dir), -strerror (-rc)); -return -EOPNOTSUPP ; - } - fparms.dir = parms->dir; fparms.type = parms->type; fparms.idx = parms->idx; - rc = dev->ops->tf_dev_free_tbl (tfp, &fparms); -if (rc) { -TFP_DRV_LOG (ERR , -"%s: Table free failed, rc:%s\n" , -tf_dir_2_str (parms->dir), -strerror (-rc)); -return rc; + fparms.tbl_scope_id = parms->tbl_scope_id; + +if (parms->type ==TF_TBL_TYPE_EXT ) { +if (dev->ops->tf_dev_free_ext_tbl ==NULL ) { + rc = -EOPNOTSUPP ; +TFP_DRV_LOG (ERR , +"%s: Operation not supported, rc:%s\n" , +tf_dir_2_str (parms->dir), +strerror (-rc)); +return -EOPNOTSUPP ; + } + + rc = dev->ops->tf_dev_free_ext_tbl (tfp, &fparms); +if (rc) { +TFP_DRV_LOG (ERR , +"%s: Table free failed, rc:%s\n" , +tf_dir_2_str (parms->dir), +strerror (-rc)); +return rc; + } + }else { +if (dev->ops->tf_dev_free_tbl ==NULL ) { + rc = -EOPNOTSUPP ; +TFP_DRV_LOG (ERR , +"%s: Operation not supported, rc:%s\n" , +tf_dir_2_str (parms->dir), +strerror (-rc)); +return -EOPNOTSUPP ; + } + + rc = dev->ops->tf_dev_free_tbl (tfp, &fparms); +if (rc) { +TFP_DRV_LOG (ERR , +"%s: Table free failed, rc:%s\n" , +tf_dir_2_str (parms->dir), +strerror (-rc)); +return rc; + } }return 0 ;
@@ -735,27 +780,49 @@ tf_set_tbl_entry(struct tf *tfp,return rc; } -if (dev->ops->tf_dev_set_tbl ==NULL ) { - rc = -EOPNOTSUPP ; -TFP_DRV_LOG (ERR , -"%s: Operation not supported, rc:%s\n" , -tf_dir_2_str (parms->dir), -strerror (-rc)); -return -EOPNOTSUPP ; - } - sparms.dir = parms->dir; sparms.type = parms->type; sparms.data = parms->data; sparms.data_sz_in_bytes = parms->data_sz_in_bytes; sparms.idx = parms->idx; - rc = dev->ops->tf_dev_set_tbl (tfp, &sparms); -if (rc) { -TFP_DRV_LOG (ERR , -"%s: Table set failed, rc:%s\n" , -tf_dir_2_str (parms->dir), -strerror (-rc)); -return rc; + sparms.tbl_scope_id = parms->tbl_scope_id; + +if (parms->type ==TF_TBL_TYPE_EXT ) { +if (dev->ops->tf_dev_set_ext_tbl ==NULL ) { + rc = -EOPNOTSUPP ; +TFP_DRV_LOG (ERR , +"%s: Operation not supported, rc:%s\n" , +tf_dir_2_str (parms->dir), +strerror (-rc)); +return -EOPNOTSUPP ; + } + + rc = dev->ops->tf_dev_set_ext_tbl (tfp, &sparms); +if (rc) { +TFP_DRV_LOG (ERR , +"%s: Table set failed, rc:%s\n" , +tf_dir_2_str (parms->dir), +strerror (-rc)); +return rc; + } + }else { +if (dev->ops->tf_dev_set_tbl ==NULL ) { + rc = -EOPNOTSUPP ; +TFP_DRV_LOG (ERR , +"%s: Operation not supported, rc:%s\n" , +tf_dir_2_str (parms->dir), +strerror (-rc)); +return -EOPNOTSUPP ; + } + + rc = dev->ops->tf_dev_set_tbl (tfp, &sparms); +if (rc) { +TFP_DRV_LOG (ERR , +"%s: Table set failed, rc:%s\n" , +tf_dir_2_str (parms->dir), +strerror (-rc)); +return rc; + } }return rc;
drivers/net/bnxt/tf_core/tf_core.h +0 -4
@@ -211,10 +211,6 @@ enum tf_tbl_type {TF_TBL_TYPE_ACT_MODIFY_IPV4_SRC ,/** Wh+/SR Action _Modify L4 Dest Port */ TF_TBL_TYPE_ACT_MODIFY_IPV4_DEST , -/** Action Modify IPv6 Source */ -TF_TBL_TYPE_ACT_MODIFY_IPV6_SRC , -/** Action Modify IPv6 Destination */ -TF_TBL_TYPE_ACT_MODIFY_IPV6_DEST ,/** Meter Profiles */ TF_TBL_TYPE_METER_PROF,/** Meter Instance */
drivers/net/bnxt/tf_core/tf_device.h +58 -0
76 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_device_p4.c +6 -0
@@ -85,10 +85,13 @@ const struct tf_dev_ops tf_dev_ops_p4_init = { .tf_dev_get_tcam_slice_info = tf_dev_p4_get_tcam_slice_info, .tf_dev_alloc_ident = NULL, .tf_dev_free_ident = NULL, + .tf_dev_alloc_ext_tbl = NULL, .tf_dev_alloc_tbl = NULL, + .tf_dev_free_ext_tbl = NULL, .tf_dev_free_tbl = NULL, .tf_dev_alloc_search_tbl = NULL, .tf_dev_set_tbl = NULL, + .tf_dev_set_ext_tbl = NULL, .tf_dev_get_tbl = NULL, .tf_dev_get_bulk_tbl = NULL, .tf_dev_alloc_tcam = NULL,
@@ -113,9 +116,12 @@ const struct tf_dev_ops tf_dev_ops_p4 = { .tf_dev_alloc_ident = tf_ident_alloc, .tf_dev_free_ident = tf_ident_free, .tf_dev_alloc_tbl = tf_tbl_alloc, + .tf_dev_alloc_ext_tbl = tf_tbl_ext_alloc, .tf_dev_free_tbl = tf_tbl_free, + .tf_dev_free_ext_tbl = tf_tbl_ext_free, .tf_dev_alloc_search_tbl = NULL, .tf_dev_set_tbl = tf_tbl_set, + .tf_dev_set_ext_tbl = tf_tbl_ext_set, .tf_dev_get_tbl = tf_tbl_get, .tf_dev_get_bulk_tbl = tf_tbl_bulk_get, .tf_dev_alloc_tcam = tf_tcam_alloc,
drivers/net/bnxt/tf_core/tf_device_p4.h +0 -2
@@ -47,8 +47,6 @@ struct tf_rm_element_cfg tf_tbl_p4[TF_TBL_TYPE_MAX] = { { TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P4_NAT_DPORT }, { TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P4_NAT_S_IPV4 }, { TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P4_NAT_D_IPV4 }, - { TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P4_NAT_S_IPV6 }, - { TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P4_NAT_D_IPV6 }, { TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P4_METER_PROF }, { TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P4_METER }, { TF_RM_ELEM_CFG_HCAPI_BA, CFA_RESOURCE_TYPE_P4_MIRROR },
drivers/net/bnxt/tf_core/tf_em.h +95 -0
99 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_em_common.c +116 -4
149 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_em_host.c +75 -5
109 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_em_system.c +6 -0
@@ -112,3 +112,9 @@ tf_em_ext_system_free(struct tf *tfp __rte_unused, {return 0 ; } + +int tf_tbl_ext_system_set(struct tf *tfp __rte_unused, + struct tf_tbl_set_parms *parms __rte_unused) +{ +return 0 ; +}
drivers/net/bnxt/tf_core/tf_identifier.c +2 -2
@@ -159,13 +159,13 @@ tf_ident_free(struct tf *tfp __rte_unused,if (rc)return rc; -if (!allocated) { +if (allocated !=TF_RM_ALLOCATED_ENTRY_IN_USE ) {TFP_DRV_LOG (ERR ,"%s: Entry already free, type:%d, index:%d\n" ,tf_dir_2_str (parms->dir), parms->type, parms->id); -return rc; +return -EINVAL ; }/* Free requested element */
drivers/net/bnxt/tf_core/tf_rm.h +5 -0
@@ -12,6 +12,11 @@struct tf ; +/** RM return codes */ +#define TF_RM_ALLOCATED_ENTRY_FREE 0 +#define TF_RM_ALLOCATED_ENTRY_IN_USE 1 +#define TF_RM_ALLOCATED_NO_ENTRY_FOUND -1 +/** * The Resource Manager (RM) module provides basic DB handling for * internal resources. These resources exists within the actual device
drivers/net/bnxt/tf_core/tf_tbl.c +5 -5
@@ -172,13 +172,13 @@ tf_tbl_free(struct tf *tfp __rte_unused,if (rc)return rc; -if (!allocated) { +if (allocated !=TF_RM_ALLOCATED_ENTRY_IN_USE ) {TFP_DRV_LOG (ERR ,"%s: Entry already free, type:%d, index:%d\n" ,tf_dir_2_str (parms->dir), parms->type, parms->idx); -return rc; +return -EINVAL ; }/* Free requested element */
@@ -233,7 +233,7 @@ tf_tbl_set(struct tf *tfp,if (rc)return rc; -if (!allocated) { +if (allocated !=TF_RM_ALLOCATED_ENTRY_IN_USE ) { TFP_DRV_LOG(ERR, "%s, Invalid or not allocated index, type:%d, idx:%d\n", tf_dir_2_str(parms->dir),
@@ -301,7 +301,7 @@ tf_tbl_get(struct tf *tfp,if (rc)return rc; -if (!allocated) { +if (allocated !=TF_RM_ALLOCATED_ENTRY_IN_USE ) { TFP_DRV_LOG(ERR, "%s, Invalid or not allocated index, type:%d, idx:%d\n", tf_dir_2_str(parms->dir),
@@ -374,7 +374,7 @@ tf_tbl_bulk_get(struct tf *tfp,if (rc)return rc; -if (!allocated) { +if (allocated !=TF_RM_ALLOCATED_ENTRY_IN_USE ) { TFP_DRV_LOG(ERR, "%s, Invalid or not allocated index, type:%d, idx:%d\n", tf_dir_2_str(parms->dir),
drivers/net/bnxt/tf_core/tf_tbl.h +12 -0
@@ -83,6 +83,10 @@ struct tf_tbl_alloc_parms {* [in] Type of the allocation */ enum tf_tbl_type type; +/** +* [in] Table scope identifier (ignored unless TF_TBL_TYPE_EXT) +*/ +uint32_t tbl_scope_id;/** * [out] Idx of allocated entry or found entry (if search_enable) */
@@ -101,6 +105,10 @@ struct tf_tbl_free_parms {* [in] Type of the allocation type */ enum tf_tbl_type type; +/** +* [in] Table scope identifier (ignored unless TF_TBL_TYPE_EXT) +*/ +uint32_t tbl_scope_id;/** * [in] Index to free */
@@ -168,6 +176,10 @@ struct tf_tbl_set_parms {* [in] Type of object to set */ enum tf_tbl_type type; +/** +* [in] Table scope identifier (ignored unless TF_TBL_TYPE_EXT) +*/ +uint32_t tbl_scope_id;/** * [in] Entry data */
drivers/net/bnxt/tf_core/tf_tcam.c +4 -4
@@ -252,13 +252,13 @@ tf_tcam_free(struct tf *tfp,if (rc)return rc; -if (!allocated) { +if (allocated !=TF_RM_ALLOCATED_ENTRY_IN_USE ) {TFP_DRV_LOG (ERR ,"%s: Entry already free, type:%d, index:%d\n" ,tf_dir_2_str (parms->dir), parms->type, parms->idx); -return rc; +return -EINVAL ; }/* Free requested element */
@@ -362,13 +362,13 @@ tf_tcam_set(struct tf *tfp __rte_unused,if (rc)return rc; -if (!allocated) { +if (allocated !=TF_RM_ALLOCATED_ENTRY_IN_USE ) {TFP_DRV_LOG (ERR ,"%s: Entry is not allocated, type:%d, index:%d\n" ,tf_dir_2_str (parms->dir), parms->type, parms->idx); -return rc; +return -EINVAL ; }/* Convert TF type to HCAPI RM type */
drivers/net/bnxt/tf_core/tf_util.c +0 -4
@@ -92,10 +92,6 @@ tf_tbl_type_2_str(enum tf_tbl_type tbl_type)return "NAT IPv4 Source" ;case TF_TBL_TYPE_ACT_MODIFY_IPV4_DEST :return "NAT IPv4 Destination" ; -case TF_TBL_TYPE_ACT_MODIFY_IPV6_SRC : -return "NAT IPv6 Source" ; -case TF_TBL_TYPE_ACT_MODIFY_IPV6_DEST : -return "NAT IPv6 Destination" ;case TF_TBL_TYPE_METER_PROF :return "Meter Profile" ;case TF_TBL_TYPE_METER_INST :
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 27/51 net/bnxt: align CFA resources with RM
In reply to Ajit KhapardeFrom: Randy Schacher <[email protected]>
- HCAPI resources need to align for Resource Manager
- Clean up unnecessary debug messages
--- drivers/net/bnxt/tf_core/cfa_resource_types.h | 250 +++++++++--------- drivers/net/bnxt/tf_core/tf_identifier.c | 3 +- drivers/net/bnxt/tf_core/tf_msg.c | 37 ++- drivers/net/bnxt/tf_core/tf_rm.c | 21 +- drivers/net/bnxt/tf_core/tf_tbl.c | 3 +- drivers/net/bnxt/tf_core/tf_tcam.c | 28 +- 6 files changed, 197 insertions(+), 145 deletions(-)
drivers/net/bnxt/tf_core/cfa_resource_types.h +132 -118
@@ -48,232 +48,246 @@#define CFA_RESOURCE_TYPE_P59_TBL_SCOPE 0xdUL/* L2 Func */ #define CFA_RESOURCE_TYPE_P59_L2_FUNC 0xeUL -/* EPOCH */ -#define CFA_RESOURCE_TYPE_P59_EPOCH 0xfUL +/* EPOCH 0 */ +#define CFA_RESOURCE_TYPE_P59_EPOCH0 0xfUL +/* EPOCH 1 */ +#define CFA_RESOURCE_TYPE_P59_EPOCH1 0x10UL/* Metadata */ -#define CFA_RESOURCE_TYPE_P59_METADATA 0x10UL +#define CFA_RESOURCE_TYPE_P59_METADATA 0x11UL/* Connection Tracking Rule TCAM */ -#define CFA_RESOURCE_TYPE_P59_CT_RULE_TCAM 0x11UL +#define CFA_RESOURCE_TYPE_P59_CT_RULE_TCAM 0x12UL/* Range Profile */ -#define CFA_RESOURCE_TYPE_P59_RANGE_PROF 0x12UL +#define CFA_RESOURCE_TYPE_P59_RANGE_PROF 0x13UL/* Range */ -#define CFA_RESOURCE_TYPE_P59_RANGE 0x13UL +#define CFA_RESOURCE_TYPE_P59_RANGE 0x14UL/* Link Aggrigation */ -#define CFA_RESOURCE_TYPE_P59_LAG 0x14UL +#define CFA_RESOURCE_TYPE_P59_LAG 0x15UL/* VEB TCAM */ -#define CFA_RESOURCE_TYPE_P59_VEB_TCAM 0x15UL +#define CFA_RESOURCE_TYPE_P59_VEB_TCAM 0x16UL#define CFA_RESOURCE_TYPE_P59_LAST CFA_RESOURCE_TYPE_P59_VEB_TCAM/* Multicast Group */ -#define CFA_RESOURCE_TYPE_P58_MCG 0x0UL +#define CFA_RESOURCE_TYPE_P58_MCG 0x0UL/* Encap 8 byte record */ -#define CFA_RESOURCE_TYPE_P58_ENCAP_8B 0x1UL +#define CFA_RESOURCE_TYPE_P58_ENCAP_8B 0x1UL/* Encap 16 byte record */ -#define CFA_RESOURCE_TYPE_P58_ENCAP_16B 0x2UL +#define CFA_RESOURCE_TYPE_P58_ENCAP_16B 0x2UL/* Encap 64 byte record */ -#define CFA_RESOURCE_TYPE_P58_ENCAP_64B 0x3UL +#define CFA_RESOURCE_TYPE_P58_ENCAP_64B 0x3UL/* Source Property MAC */ -#define CFA_RESOURCE_TYPE_P58_SP_MAC 0x4UL +#define CFA_RESOURCE_TYPE_P58_SP_MAC 0x4UL/* Source Property MAC and IPv4 */ -#define CFA_RESOURCE_TYPE_P58_SP_MAC_IPV4 0x5UL +#define CFA_RESOURCE_TYPE_P58_SP_MAC_IPV4 0x5UL/* Source Property MAC and IPv6 */ -#define CFA_RESOURCE_TYPE_P58_SP_MAC_IPV6 0x6UL +#define CFA_RESOURCE_TYPE_P58_SP_MAC_IPV6 0x6UL/* Network Address Translation Source Port */ -#define CFA_RESOURCE_TYPE_P58_NAT_SPORT 0x7UL +#define CFA_RESOURCE_TYPE_P58_NAT_SPORT 0x7UL/* Network Address Translation Destination Port */ -#define CFA_RESOURCE_TYPE_P58_NAT_DPORT 0x8UL +#define CFA_RESOURCE_TYPE_P58_NAT_DPORT 0x8UL/* Network Address Translation Source IPv4 address */ -#define CFA_RESOURCE_TYPE_P58_NAT_S_IPV4 0x9UL +#define CFA_RESOURCE_TYPE_P58_NAT_S_IPV4 0x9UL/* Network Address Translation Destination IPv4 address */ -#define CFA_RESOURCE_TYPE_P58_NAT_D_IPV4 0xaUL -/* Network Address Translation Source IPv4 address */ -#define CFA_RESOURCE_TYPE_P58_NAT_S_IPV6 0xbUL -/* Network Address Translation Destination IPv4 address */ -#define CFA_RESOURCE_TYPE_P58_NAT_D_IPV6 0xcUL +#define CFA_RESOURCE_TYPE_P58_NAT_D_IPV4 0xaUL/* Meter */ -#define CFA_RESOURCE_TYPE_P58_METER 0xdUL +#define CFA_RESOURCE_TYPE_P58_METER 0xbUL/* Flow State */ -#define CFA_RESOURCE_TYPE_P58_FLOW_STATE 0xeUL +#define CFA_RESOURCE_TYPE_P58_FLOW_STATE 0xcUL/* Full Action Records */ -#define CFA_RESOURCE_TYPE_P58_FULL_ACTION 0xfUL +#define CFA_RESOURCE_TYPE_P58_FULL_ACTION 0xdUL/* Action Record Format 0 */ -#define CFA_RESOURCE_TYPE_P58_FORMAT_0_ACTION 0x10UL +#define CFA_RESOURCE_TYPE_P58_FORMAT_0_ACTION 0xeUL +/* Action Record Ext Format 0 */ +#define CFA_RESOURCE_TYPE_P58_EXT_FORMAT_0_ACTION 0xfUL +/* Action Record Format 1 */ +#define CFA_RESOURCE_TYPE_P58_FORMAT_1_ACTION 0x10UL/* Action Record Format 2 */ -#define CFA_RESOURCE_TYPE_P58_FORMAT_2_ACTION 0x11UL +#define CFA_RESOURCE_TYPE_P58_FORMAT_2_ACTION 0x11UL/* Action Record Format 3 */ -#define CFA_RESOURCE_TYPE_P58_FORMAT_3_ACTION 0x12UL +#define CFA_RESOURCE_TYPE_P58_FORMAT_3_ACTION 0x12UL/* Action Record Format 4 */ -#define CFA_RESOURCE_TYPE_P58_FORMAT_4_ACTION 0x13UL +#define CFA_RESOURCE_TYPE_P58_FORMAT_4_ACTION 0x13UL +/* Action Record Format 5 */ +#define CFA_RESOURCE_TYPE_P58_FORMAT_5_ACTION 0x14UL +/* Action Record Format 6 */ +#define CFA_RESOURCE_TYPE_P58_FORMAT_6_ACTION 0x15UL/* L2 Context TCAM */ -#define CFA_RESOURCE_TYPE_P58_L2_CTXT_TCAM 0x14UL +#define CFA_RESOURCE_TYPE_P58_L2_CTXT_TCAM 0x16UL/* L2 Context REMAP */ -#define CFA_RESOURCE_TYPE_P58_L2_CTXT_REMAP 0x15UL +#define CFA_RESOURCE_TYPE_P58_L2_CTXT_REMAP 0x17UL/* Profile Func */ -#define CFA_RESOURCE_TYPE_P58_PROF_FUNC 0x16UL +#define CFA_RESOURCE_TYPE_P58_PROF_FUNC 0x18UL/* Profile TCAM */ -#define CFA_RESOURCE_TYPE_P58_PROF_TCAM 0x17UL +#define CFA_RESOURCE_TYPE_P58_PROF_TCAM 0x19UL/* Exact Match Profile Id */ -#define CFA_RESOURCE_TYPE_P58_EM_PROF_ID 0x18UL +#define CFA_RESOURCE_TYPE_P58_EM_PROF_ID 0x1aUL/* Wildcard Profile Id */ -#define CFA_RESOURCE_TYPE_P58_WC_TCAM_PROF_ID 0x19UL +#define CFA_RESOURCE_TYPE_P58_WC_TCAM_PROF_ID 0x1bUL/* Exact Match Record */ -#define CFA_RESOURCE_TYPE_P58_EM_REC 0x1aUL +#define CFA_RESOURCE_TYPE_P58_EM_REC 0x1cUL/* Wildcard TCAM */ -#define CFA_RESOURCE_TYPE_P58_WC_TCAM 0x1bUL +#define CFA_RESOURCE_TYPE_P58_WC_TCAM 0x1dUL/* Meter profile */ -#define CFA_RESOURCE_TYPE_P58_METER_PROF 0x1cUL +#define CFA_RESOURCE_TYPE_P58_METER_PROF 0x1eUL/* Meter */ -#define CFA_RESOURCE_TYPE_P58_MIRROR 0x1dUL +#define CFA_RESOURCE_TYPE_P58_MIRROR 0x1fUL/* Source Property TCAM */ -#define CFA_RESOURCE_TYPE_P58_SP_TCAM 0x1eUL +#define CFA_RESOURCE_TYPE_P58_SP_TCAM 0x20UL/* Exact Match Flexible Key Builder */ -#define CFA_RESOURCE_TYPE_P58_EM_FKB 0x1fUL +#define CFA_RESOURCE_TYPE_P58_EM_FKB 0x21UL/* Wildcard Flexible Key Builder */ -#define CFA_RESOURCE_TYPE_P58_WC_FKB 0x20UL +#define CFA_RESOURCE_TYPE_P58_WC_FKB 0x22UL/* VEB TCAM */ -#define CFA_RESOURCE_TYPE_P58_VEB_TCAM 0x21UL -#define CFA_RESOURCE_TYPE_P58_LAST CFA_RESOURCE_TYPE_P58_VEB_TCAM +#define CFA_RESOURCE_TYPE_P58_VEB_TCAM 0x23UL +#define CFA_RESOURCE_TYPE_P58_LAST CFA_RESOURCE_TYPE_P58_VEB_TCAM/* Multicast Group */ -#define CFA_RESOURCE_TYPE_P45_MCG 0x0UL +#define CFA_RESOURCE_TYPE_P45_MCG 0x0UL/* Encap 8 byte record */ -#define CFA_RESOURCE_TYPE_P45_ENCAP_8B 0x1UL +#define CFA_RESOURCE_TYPE_P45_ENCAP_8B 0x1UL/* Encap 16 byte record */ -#define CFA_RESOURCE_TYPE_P45_ENCAP_16B 0x2UL +#define CFA_RESOURCE_TYPE_P45_ENCAP_16B 0x2UL/* Encap 64 byte record */ -#define CFA_RESOURCE_TYPE_P45_ENCAP_64B 0x3UL +#define CFA_RESOURCE_TYPE_P45_ENCAP_64B 0x3UL/* Source Property MAC */ -#define CFA_RESOURCE_TYPE_P45_SP_MAC 0x4UL +#define CFA_RESOURCE_TYPE_P45_SP_MAC 0x4UL/* Source Property MAC and IPv4 */ -#define CFA_RESOURCE_TYPE_P45_SP_MAC_IPV4 0x5UL +#define CFA_RESOURCE_TYPE_P45_SP_MAC_IPV4 0x5UL/* Source Property MAC and IPv6 */ -#define CFA_RESOURCE_TYPE_P45_SP_MAC_IPV6 0x6UL +#define CFA_RESOURCE_TYPE_P45_SP_MAC_IPV6 0x6UL/* 64B Counters */ -#define CFA_RESOURCE_TYPE_P45_COUNTER_64B 0x7UL +#define CFA_RESOURCE_TYPE_P45_COUNTER_64B 0x7UL/* Network Address Translation Source Port */ -#define CFA_RESOURCE_TYPE_P45_NAT_SPORT 0x8UL +#define CFA_RESOURCE_TYPE_P45_NAT_SPORT 0x8UL/* Network Address Translation Destination Port */ -#define CFA_RESOURCE_TYPE_P45_NAT_DPORT 0x9UL +#define CFA_RESOURCE_TYPE_P45_NAT_DPORT 0x9UL/* Network Address Translation Source IPv4 address */ -#define CFA_RESOURCE_TYPE_P45_NAT_S_IPV4 0xaUL +#define CFA_RESOURCE_TYPE_P45_NAT_S_IPV4 0xaUL/* Network Address Translation Destination IPv4 address */ -#define CFA_RESOURCE_TYPE_P45_NAT_D_IPV4 0xbUL -/* Network Address Translation Source IPv6 address */ -#define CFA_RESOURCE_TYPE_P45_NAT_S_IPV6 0xcUL -/* Network Address Translation Destination IPv6 address */ -#define CFA_RESOURCE_TYPE_P45_NAT_D_IPV6 0xdUL +#define CFA_RESOURCE_TYPE_P45_NAT_D_IPV4 0xbUL/* Meter */ -#define CFA_RESOURCE_TYPE_P45_METER 0xeUL +#define CFA_RESOURCE_TYPE_P45_METER 0xcUL/* Flow State */ -#define CFA_RESOURCE_TYPE_P45_FLOW_STATE 0xfUL +#define CFA_RESOURCE_TYPE_P45_FLOW_STATE 0xdUL/* Full Action Records */ -#define CFA_RESOURCE_TYPE_P45_FULL_ACTION 0x10UL +#define CFA_RESOURCE_TYPE_P45_FULL_ACTION 0xeUL/* Action Record Format 0 */ -#define CFA_RESOURCE_TYPE_P45_FORMAT_0_ACTION 0x11UL +#define CFA_RESOURCE_TYPE_P45_FORMAT_0_ACTION 0xfUL +/* Action Record Ext Format 0 */ +#define CFA_RESOURCE_TYPE_P45_EXT_FORMAT_0_ACTION 0x10UL +/* Action Record Format 1 */ +#define CFA_RESOURCE_TYPE_P45_FORMAT_1_ACTION 0x11UL/* Action Record Format 2 */ -#define CFA_RESOURCE_TYPE_P45_FORMAT_2_ACTION 0x12UL +#define CFA_RESOURCE_TYPE_P45_FORMAT_2_ACTION 0x12UL/* Action Record Format 3 */ -#define CFA_RESOURCE_TYPE_P45_FORMAT_3_ACTION 0x13UL +#define CFA_RESOURCE_TYPE_P45_FORMAT_3_ACTION 0x13UL/* Action Record Format 4 */ -#define CFA_RESOURCE_TYPE_P45_FORMAT_4_ACTION 0x14UL +#define CFA_RESOURCE_TYPE_P45_FORMAT_4_ACTION 0x14UL +/* Action Record Format 5 */ +#define CFA_RESOURCE_TYPE_P45_FORMAT_5_ACTION 0x15UL +/* Action Record Format 6 */ +#define CFA_RESOURCE_TYPE_P45_FORMAT_6_ACTION 0x16UL/* L2 Context TCAM */ -#define CFA_RESOURCE_TYPE_P45_L2_CTXT_TCAM 0x15UL +#define CFA_RESOURCE_TYPE_P45_L2_CTXT_TCAM 0x17UL/* L2 Context REMAP */ -#define CFA_RESOURCE_TYPE_P45_L2_CTXT_REMAP 0x16UL +#define CFA_RESOURCE_TYPE_P45_L2_CTXT_REMAP 0x18UL/* Profile Func */ -#define CFA_RESOURCE_TYPE_P45_PROF_FUNC 0x17UL +#define CFA_RESOURCE_TYPE_P45_PROF_FUNC 0x19UL/* Profile TCAM */ -#define CFA_RESOURCE_TYPE_P45_PROF_TCAM 0x18UL +#define CFA_RESOURCE_TYPE_P45_PROF_TCAM 0x1aUL/* Exact Match Profile Id */ -#define CFA_RESOURCE_TYPE_P45_EM_PROF_ID 0x19UL +#define CFA_RESOURCE_TYPE_P45_EM_PROF_ID 0x1bUL/* Exact Match Record */ -#define CFA_RESOURCE_TYPE_P45_EM_REC 0x1aUL +#define CFA_RESOURCE_TYPE_P45_EM_REC 0x1cUL/* Wildcard Profile Id */ -#define CFA_RESOURCE_TYPE_P45_WC_TCAM_PROF_ID 0x1bUL +#define CFA_RESOURCE_TYPE_P45_WC_TCAM_PROF_ID 0x1dUL/* Wildcard TCAM */ -#define CFA_RESOURCE_TYPE_P45_WC_TCAM 0x1cUL +#define CFA_RESOURCE_TYPE_P45_WC_TCAM 0x1eUL/* Meter profile */ -#define CFA_RESOURCE_TYPE_P45_METER_PROF 0x1dUL +#define CFA_RESOURCE_TYPE_P45_METER_PROF 0x1fUL/* Meter */ -#define CFA_RESOURCE_TYPE_P45_MIRROR 0x1eUL +#define CFA_RESOURCE_TYPE_P45_MIRROR 0x20UL/* Source Property TCAM */ -#define CFA_RESOURCE_TYPE_P45_SP_TCAM 0x1fUL +#define CFA_RESOURCE_TYPE_P45_SP_TCAM 0x21UL/* VEB TCAM */ -#define CFA_RESOURCE_TYPE_P45_VEB_TCAM 0x20UL +#define CFA_RESOURCE_TYPE_P45_VEB_TCAM 0x22UL/* Table Scope */ -#define CFA_RESOURCE_TYPE_P45_TBL_SCOPE 0x21UL -#define CFA_RESOURCE_TYPE_P45_LAST CFA_RESOURCE_TYPE_P45_TBL_SCOPE +#define CFA_RESOURCE_TYPE_P45_TBL_SCOPE 0x23UL +#define CFA_RESOURCE_TYPE_P45_LAST CFA_RESOURCE_TYPE_P45_TBL_SCOPE/* Multicast Group */ -#define CFA_RESOURCE_TYPE_P4_MCG 0x0UL +#define CFA_RESOURCE_TYPE_P4_MCG 0x0UL/* Encap 8 byte record */ -#define CFA_RESOURCE_TYPE_P4_ENCAP_8B 0x1UL +#define CFA_RESOURCE_TYPE_P4_ENCAP_8B 0x1UL/* Encap 16 byte record */ -#define CFA_RESOURCE_TYPE_P4_ENCAP_16B 0x2UL +#define CFA_RESOURCE_TYPE_P4_ENCAP_16B 0x2UL/* Encap 64 byte record */ -#define CFA_RESOURCE_TYPE_P4_ENCAP_64B 0x3UL +#define CFA_RESOURCE_TYPE_P4_ENCAP_64B 0x3UL/* Source Property MAC */ -#define CFA_RESOURCE_TYPE_P4_SP_MAC 0x4UL +#define CFA_RESOURCE_TYPE_P4_SP_MAC 0x4UL/* Source Property MAC and IPv4 */ -#define CFA_RESOURCE_TYPE_P4_SP_MAC_IPV4 0x5UL +#define CFA_RESOURCE_TYPE_P4_SP_MAC_IPV4 0x5UL/* Source Property MAC and IPv6 */ -#define CFA_RESOURCE_TYPE_P4_SP_MAC_IPV6 0x6UL +#define CFA_RESOURCE_TYPE_P4_SP_MAC_IPV6 0x6UL/* 64B Counters */ -#define CFA_RESOURCE_TYPE_P4_COUNTER_64B 0x7UL +#define CFA_RESOURCE_TYPE_P4_COUNTER_64B 0x7UL/* Network Address Translation Source Port */ -#define CFA_RESOURCE_TYPE_P4_NAT_SPORT 0x8UL +#define CFA_RESOURCE_TYPE_P4_NAT_SPORT 0x8UL/* Network Address Translation Destination Port */ -#define CFA_RESOURCE_TYPE_P4_NAT_DPORT 0x9UL +#define CFA_RESOURCE_TYPE_P4_NAT_DPORT 0x9UL/* Network Address Translation Source IPv4 address */ -#define CFA_RESOURCE_TYPE_P4_NAT_S_IPV4 0xaUL +#define CFA_RESOURCE_TYPE_P4_NAT_S_IPV4 0xaUL/* Network Address Translation Destination IPv4 address */ -#define CFA_RESOURCE_TYPE_P4_NAT_D_IPV4 0xbUL -/* Network Address Translation Source IPv6 address */ -#define CFA_RESOURCE_TYPE_P4_NAT_S_IPV6 0xcUL -/* Network Address Translation Destination IPv6 address */ -#define CFA_RESOURCE_TYPE_P4_NAT_D_IPV6 0xdUL +#define CFA_RESOURCE_TYPE_P4_NAT_D_IPV4 0xbUL/* Meter */ -#define CFA_RESOURCE_TYPE_P4_METER 0xeUL +#define CFA_RESOURCE_TYPE_P4_METER 0xcUL/* Flow State */ -#define CFA_RESOURCE_TYPE_P4_FLOW_STATE 0xfUL +#define CFA_RESOURCE_TYPE_P4_FLOW_STATE 0xdUL/* Full Action Records */ -#define CFA_RESOURCE_TYPE_P4_FULL_ACTION 0x10UL +#define CFA_RESOURCE_TYPE_P4_FULL_ACTION 0xeUL/* Action Record Format 0 */ -#define CFA_RESOURCE_TYPE_P4_FORMAT_0_ACTION 0x11UL +#define CFA_RESOURCE_TYPE_P4_FORMAT_0_ACTION 0xfUL +/* Action Record Ext Format 0 */ +#define CFA_RESOURCE_TYPE_P4_EXT_FORMAT_0_ACTION 0x10UL +/* Action Record Format 1 */ +#define CFA_RESOURCE_TYPE_P4_FORMAT_1_ACTION 0x11UL/* Action Record Format 2 */ -#define CFA_RESOURCE_TYPE_P4_FORMAT_2_ACTION 0x12UL +#define CFA_RESOURCE_TYPE_P4_FORMAT_2_ACTION 0x12UL/* Action Record Format 3 */ -#define CFA_RESOURCE_TYPE_P4_FORMAT_3_ACTION 0x13UL +#define CFA_RESOURCE_TYPE_P4_FORMAT_3_ACTION 0x13UL/* Action Record Format 4 */ -#define CFA_RESOURCE_TYPE_P4_FORMAT_4_ACTION 0x14UL +#define CFA_RESOURCE_TYPE_P4_FORMAT_4_ACTION 0x14UL +/* Action Record Format 5 */ +#define CFA_RESOURCE_TYPE_P4_FORMAT_5_ACTION 0x15UL +/* Action Record Format 6 */ +#define CFA_RESOURCE_TYPE_P4_FORMAT_6_ACTION 0x16UL/* L2 Context TCAM */ -#define CFA_RESOURCE_TYPE_P4_L2_CTXT_TCAM 0x15UL +#define CFA_RESOURCE_TYPE_P4_L2_CTXT_TCAM 0x17UL/* L2 Context REMAP */ -#define CFA_RESOURCE_TYPE_P4_L2_CTXT_REMAP 0x16UL +#define CFA_RESOURCE_TYPE_P4_L2_CTXT_REMAP 0x18UL/* Profile Func */ -#define CFA_RESOURCE_TYPE_P4_PROF_FUNC 0x17UL +#define CFA_RESOURCE_TYPE_P4_PROF_FUNC 0x19UL/* Profile TCAM */ -#define CFA_RESOURCE_TYPE_P4_PROF_TCAM 0x18UL +#define CFA_RESOURCE_TYPE_P4_PROF_TCAM 0x1aUL/* Exact Match Profile Id */ -#define CFA_RESOURCE_TYPE_P4_EM_PROF_ID 0x19UL +#define CFA_RESOURCE_TYPE_P4_EM_PROF_ID 0x1bUL/* Exact Match Record */ -#define CFA_RESOURCE_TYPE_P4_EM_REC 0x1aUL +#define CFA_RESOURCE_TYPE_P4_EM_REC 0x1cUL/* Wildcard Profile Id */ -#define CFA_RESOURCE_TYPE_P4_WC_TCAM_PROF_ID 0x1bUL +#define CFA_RESOURCE_TYPE_P4_WC_TCAM_PROF_ID 0x1dUL/* Wildcard TCAM */ -#define CFA_RESOURCE_TYPE_P4_WC_TCAM 0x1cUL +#define CFA_RESOURCE_TYPE_P4_WC_TCAM 0x1eUL/* Meter profile */ -#define CFA_RESOURCE_TYPE_P4_METER_PROF 0x1dUL +#define CFA_RESOURCE_TYPE_P4_METER_PROF 0x1fUL/* Meter */ -#define CFA_RESOURCE_TYPE_P4_MIRROR 0x1eUL +#define CFA_RESOURCE_TYPE_P4_MIRROR 0x20UL/* Source Property TCAM */ -#define CFA_RESOURCE_TYPE_P4_SP_TCAM 0x1fUL +#define CFA_RESOURCE_TYPE_P4_SP_TCAM 0x21UL/* Table Scope */ -#define CFA_RESOURCE_TYPE_P4_TBL_SCOPE 0x20UL -#define CFA_RESOURCE_TYPE_P4_LAST CFA_RESOURCE_TYPE_P4_TBL_SCOPE +#define CFA_RESOURCE_TYPE_P4_TBL_SCOPE 0x22UL +#define CFA_RESOURCE_TYPE_P4_LAST CFA_RESOURCE_TYPE_P4_TBL_SCOPE#endif /* _CFA_RESOURCE_TYPES_H_ */
drivers/net/bnxt/tf_core/tf_identifier.c +2 -1
@@ -59,7 +59,8 @@ tf_ident_bind(struct tf *tfp, init =1 ; -printf ("Identifier - initialized\n" ); +TFP_DRV_LOG (INFO , +"Identifier - initialized\n" );return 0 ; }
drivers/net/bnxt/tf_core/tf_msg.c +26 -11
@@ -18,6 +18,9 @@#include "hwrm_tf.h" #include "tf_em.h" +/* Logging defines */ +#define TF_RM_MSG_DEBUG 0 +/** * This is the MAX data we can transport across regular HWRM */
@@ -215,7 +218,7 @@ tf_msg_session_resc_qcaps(struct tf *tfp, rc =tfp_send_msg_direct (tfp, &parms);if (rc) -return rc; + goto cleanup;/* Process the response * Should always get expected number of entries
@@ -225,31 +228,39 @@ tf_msg_session_resc_qcaps(struct tf *tfp,"%s: QCAPS message size error, rc:%s\n" ,tf_dir_2_str (dir), strerror(-EINVAL)); -return -EINVAL ; + rc = -EINVAL ; + goto cleanup; } +#if (TF_RM_MSG_DEBUG ==1 )printf ("size: %d\n" ,tfp_le_to_cpu_32 (resp.size)); +#endif /* (TF_RM_MSG_DEBUG == 1) */ /* Post process the response */ data = (struct tf_rm_resc_req_entry *)qcaps_buf.va_addr; +#if (TF_RM_MSG_DEBUG ==1 )printf ("\nQCAPS\n" ); +#endif /* (TF_RM_MSG_DEBUG == 1) */ for (i =0 ; i < size; i++) { query[i].type =tfp_le_to_cpu_32 (data[i].type); query[i].min =tfp_le_to_cpu_16 (data[i].min); query[i].max =tfp_le_to_cpu_16 (data[i].max); +#if (TF_RM_MSG_DEBUG ==1 )printf ("type: %d(0x%x) %d %d\n" , query[i].type, query[i].type, query[i].min, query[i].max); +#endif /* (TF_RM_MSG_DEBUG == 1) */ } *resv_strategy = resp.flags &HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_MASK ; +cleanup:tf_msg_free_dma_buf (&qcaps_buf);return rc;
@@ -293,8 +304,10 @@ tf_msg_session_resc_alloc(struct tf *tfp, dma_size = size *sizeof (struct tf_rm_resc_entry ); rc =tf_msg_alloc_dma_buf (&resv_buf, dma_size); -if (rc) +if (rc) { +tf_msg_free_dma_buf (&req_buf);return rc; + }/* Populate the request */ req.fw_session_id =tfp_cpu_to_le_32 (fw_session_id);
@@ -320,7 +333,7 @@ tf_msg_session_resc_alloc(struct tf *tfp, rc =tfp_send_msg_direct (tfp, &parms);if (rc) -return rc; + goto cleanup;/* Process the response * Should always get expected number of entries
@@ -330,11 +343,14 @@ tf_msg_session_resc_alloc(struct tf *tfp,"%s: Alloc message size error, rc:%s\n" ,tf_dir_2_str (dir), strerror(-EINVAL)); -return -EINVAL ; + rc = -EINVAL ; + goto cleanup; } +#if (TF_RM_MSG_DEBUG ==1 )printf ("\nRESV\n" );printf ("size: %d\n" ,tfp_le_to_cpu_32 (resp.size)); +#endif /* (TF_RM_MSG_DEBUG == 1) */ /* Post process the response */ resv_data = (struct tf_rm_resc_entry *)resv_buf.va_addr;
@@ -343,14 +359,17 @@ tf_msg_session_resc_alloc(struct tf *tfp, resv[i].start =tfp_le_to_cpu_16 (resv_data[i].start); resv[i].stride =tfp_le_to_cpu_16 (resv_data[i].stride); +#if (TF_RM_MSG_DEBUG ==1 )printf ("%d type: %d(0x%x) %d %d\n" , i, resv[i].type, resv[i].type, resv[i].start, resv[i].stride); +#endif /* (TF_RM_MSG_DEBUG == 1) */ } +cleanup:tf_msg_free_dma_buf (&req_buf);tf_msg_free_dma_buf (&resv_buf);
@@ -412,8 +431,6 @@ tf_msg_session_resc_flush(struct tf *tfp, parms.mailbox =TF_KONG_MB ; rc =tfp_send_msg_direct (tfp, &parms); -if (rc) -return rc;tf_msg_free_dma_buf (&resv_buf);
@@ -434,7 +451,7 @@ tf_msg_insert_em_internal_entry(struct tf *tfp,struct tf_session *tfs = (struct tf_session *)(tfp->session->core_data);struct tf_em_64b_entry *em_result = (struct tf_em_64b_entry *)em_parms->em_record; -uint32_t flags; +uint16_t flags; req.fw_session_id =tfp_cpu_to_le_32 (tfs->session_id.internal.fw_session_id);
@@ -480,7 +497,7 @@ tf_msg_delete_em_entry(struct tf *tfp,struct tfp_send_msg_parms parms = {0 };struct hwrm_tf_em_delete_input req = {0 };struct hwrm_tf_em_delete_output resp = {0 }; -uint32_t flags; +uint16_t flags;struct tf_session *tfs = (struct tf_session *)(tfp->session->core_data);
@@ -726,8 +743,6 @@ tf_msg_tcam_entry_set(struct tf *tfp, rc =tfp_send_msg_direct (tfp, &mparms); -if (rc) - goto cleanup; cleanup:tf_msg_free_dma_buf (&buf);
drivers/net/bnxt/tf_core/tf_rm.c +8 -13
@@ -17,6 +17,9 @@#include "tfp.h" #include "tf_msg.h" +/* Logging defines */ +#define TF_RM_DEBUG 0 +/** * Generic RM Element data type that an RM DB is build upon. */
@@ -120,16 +123,11 @@ tf_rm_count_hcapi_reservations(enum tf_dir dir, cfg[i].cfg_type == TF_RM_ELEM_CFG_NULL && reservations[i] > 0) {TFP_DRV_LOG (ERR , -"%s, %s, %s allocation not supported\n" , -tf_device_module_type_2_str (type), -tf_dir_2_str (dir), -tf_device_module_type_subtype_2_str (type, i)); -printf ("%s, %s, %s allocation of %d not supported\n" , +"%s, %s, %s allocation of %d not supported\n" ,tf_device_module_type_2_str (type),tf_dir_2_str (dir), -tf_device_module_type_subtype_2_str (type, i), - reservations[i]); - +tf_device_module_type_subtype_2_str (type, i), + reservations[i]); } }
@@ -549,11 +547,6 @@ tf_rm_create_db(struct tf *tfp, db[i].alloc.entry.start = resv[j].start; db[i].alloc.entry.stride = resv[j].stride; -printf ("Entry:%d Start:%d Stride:%d\n" , - i, - resv[j].start, - resv[j].stride); -/* Only allocate BA pool if so requested */ if (parms->cfg[i].cfg_type ==TF_RM_ELEM_CFG_HCAPI_BA ) {/* Create pool */
@@ -603,10 +596,12 @@ tf_rm_create_db(struct tf *tfp, rm_db->type = parms->type; *parms->rm_db = (void *)rm_db; +#if (TF_RM_DEBUG ==1 )printf ("%s: type:%d num_entries:%d\n" ,tf_dir_2_str (parms->dir), parms->type, i); +#endif /* (TF_RM_DEBUG == 1) */ tfp_free ((void *)req);tfp_free ((void *)resv);
drivers/net/bnxt/tf_core/tf_tbl.c +2 -1
@@ -74,7 +74,8 @@ tf_tbl_bind(struct tf *tfp, init =1 ; -printf ("Table Type - initialized\n" ); +TFP_DRV_LOG (INFO , +"Table Type - initialized\n" );return 0 ; }
drivers/net/bnxt/tf_core/tf_tcam.c +27 -1
@@ -81,7 +81,8 @@ tf_tcam_bind(struct tf *tfp, init =1 ; -printf ("TCAM - initialized\n" ); +TFP_DRV_LOG (INFO , +"TCAM - initialized\n" );return 0 ; }
@@ -275,6 +276,31 @@ tf_tcam_free(struct tf *tfp,return rc; } +if (parms->type ==TF_TCAM_TBL_TYPE_WC_TCAM ) { +int i; + +for (i =-1 ; i <3 ; i +=3 ) { + aparms.index += i; + rc =tf_rm_is_allocated (&aparms); +if (rc) +return rc; + +if (allocated ==TF_RM_ALLOCATED_ENTRY_IN_USE ) { +/* Free requested element */ + fparms.index = aparms.index; + rc =tf_rm_free (&fparms); +if (rc) { +TFP_DRV_LOG (ERR , +"%s: Free failed, type:%d, index:%d\n" , +tf_dir_2_str (parms->dir), + parms->type, + fparms.index); +return rc; + } + } + } + } +/* Convert TF type to HCAPI RM type */ hparms.rm_db = tcam_db[parms->dir]; hparms.db_index = parms->type;
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 28/51 net/bnxt: implement IF tables set and get
In reply to Ajit KhapardeFrom: Jay Ding <[email protected]>
- Implement set/get for PROF_SPIF_CTXT, LKUP_PF_DFLT_ARP, PROF_PF_ERR_ARP with tunneled HWRM messages
- Add IF table for PROF_PARIF_DFLT_ARP
- Fix page size offset in the HCAPI code
- Fix Entry offset calculation
--- drivers/net/bnxt/hcapi/cfa_p40_tbl.h | 53 +++++ drivers/net/bnxt/hcapi/hcapi_cfa_defs.h | 12 +- drivers/net/bnxt/hcapi/hcapi_cfa_p4.c | 8 +- drivers/net/bnxt/hcapi/hcapi_cfa_p4.h | 18 +- drivers/net/bnxt/meson.build | 2 +- drivers/net/bnxt/tf_core/Makefile | 2 + drivers/net/bnxt/tf_core/hwrm_tf.h | 63 +++++- drivers/net/bnxt/tf_core/tf_core.c | 116 +++++++++++ drivers/net/bnxt/tf_core/tf_core.h | 104 ++++++++++ drivers/net/bnxt/tf_core/tf_device.c | 21 ++ drivers/net/bnxt/tf_core/tf_device.h | 39 ++++ drivers/net/bnxt/tf_core/tf_device_p4.c | 5 + drivers/net/bnxt/tf_core/tf_device_p4.h | 10 + drivers/net/bnxt/tf_core/tf_em_common.c | 5 +- drivers/net/bnxt/tf_core/tf_em_host.c | 12 +- drivers/net/bnxt/tf_core/tf_identifier.c | 3 +- drivers/net/bnxt/tf_core/tf_if_tbl.c | 178 +++++++++++++++++ drivers/net/bnxt/tf_core/tf_if_tbl.h | 236 +++++++++++++++++++++++ drivers/net/bnxt/tf_core/tf_msg.c | 186 +++++++++++++++--- drivers/net/bnxt/tf_core/tf_msg.h | 30 +++ drivers/net/bnxt/tf_core/tf_session.c | 14 +- 21 files changed, 1060 insertions(+), 57 deletions(-) create mode 100644 drivers/net/bnxt/tf_core/tf_if_tbl.c create mode 100644 drivers/net/bnxt/tf_core/tf_if_tbl.h
drivers/net/bnxt/hcapi/cfa_p40_tbl.h +53 -0
@@ -127,6 +127,11 @@ const struct hcapi_cfa_field cfa_p40_prof_profile_tcam_remap_mem_layout[] = { CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_TCAM_PROFILE_ID_NUM_BITS}, {CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_TCAM_KEY_ID_BITPOS, CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_TCAM_KEY_ID_NUM_BITS}, +/* Fields below not generated through automation */ + {CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_BYPASS_OPT_BITPOS, + CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_BYPASS_OPT_NUM_BITS}, + {CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_ACT_REC_PTR_BITPOS, + CFA_P40_PROF_PROFILE_TCAM_REMAP_MEM_ACT_REC_PTR_NUM_BITS}, };const struct hcapi_cfa_field cfa_p40_prof_profile_tcam_layout[] = {
@@ -247,4 +252,52 @@ const struct hcapi_cfa_field cfa_p40_eem_key_tbl_layout[] = { CFA_P40_EEM_KEY_TBL_AR_PTR_NUM_BITS}, }; + +const struct hcapi_cfa_field cfa_p40_mirror_tbl_layout[] = { + {CFA_P40_MIRROR_TBL_SP_PTR_BITPOS , +CFA_P40_MIRROR_TBL_SP_PTR_NUM_BITS }, + + {CFA_P40_MIRROR_TBL_IGN_DROP_BITPOS , +CFA_P40_MIRROR_TBL_IGN_DROP_NUM_BITS }, + + {CFA_P40_MIRROR_TBL_COPY_BITPOS , +CFA_P40_MIRROR_TBL_COPY_NUM_BITS }, + + {CFA_P40_MIRROR_TBL_EN_BITPOS , +CFA_P40_MIRROR_TBL_EN_NUM_BITS }, + + {CFA_P40_MIRROR_TBL_AR_PTR_BITPOS , +CFA_P40_MIRROR_TBL_AR_PTR_NUM_BITS }, +}; + +/* P45 Defines */ + +const struct hcapi_cfa_field cfa_p45_prof_l2_ctxt_tcam_layout[] = { + {CFA_P45_PROF_L2_CTXT_TCAM_VALID_BITPOS , +CFA_P45_PROF_L2_CTXT_TCAM_VALID_NUM_BITS }, + {CFA_P45_PROF_L2_CTXT_TCAM_SPARIF_BITPOS , +CFA_P45_PROF_L2_CTXT_TCAM_SPARIF_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_KEY_TYPE_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_KEY_TYPE_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_TUN_HDR_TYPE_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_TUN_HDR_TYPE_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_T_L2_NUMTAGS_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_T_L2_NUMTAGS_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_L2_NUMTAGS_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_L2_NUMTAGS_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_MAC1_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_MAC1_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_T_OVID_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_T_OVID_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_T_IVID_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_T_IVID_NUM_BITS }, + {CFA_P45_PROF_L2_CTXT_TCAM_SVIF_BITPOS , +CFA_P45_PROF_L2_CTXT_TCAM_SVIF_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_MAC0_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_MAC0_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_OVID_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_OVID_NUM_BITS }, + {CFA_P40_PROF_L2_CTXT_TCAM_IVID_BITPOS , +CFA_P40_PROF_L2_CTXT_TCAM_IVID_NUM_BITS }, +};#endif /* _CFA_P40_TBL_H_ */
drivers/net/bnxt/hcapi/hcapi_cfa_defs.h +6 -6
@@ -35,10 +35,6 @@#define CFA_GLOBAL_CFG_DATA_SZ (100) -#if SUPPORT_CFA_HW_P4 &&SUPPORT_CFA_HW_P58 &&SUPPORT_CFA_HW_P59 -#define SUPPORT_CFA_HW_ALL (1) -#endif -#include "hcapi_cfa_p4.h" #define CFA_PROF_L2CTXT_TCAM_MAX_FIELD_CNT CFA_P40_PROF_L2_CTXT_TCAM_MAX_FLD#define CFA_PROF_L2CTXT_REMAP_MAX_FIELD_CNT CFA_P40_PROF_L2_CTXT_RMP_DR_MAX_FLD
@@ -121,6 +117,8 @@ struct hcapi_cfa_layout {const struct hcapi_cfa_field *field_array;/** [out] number of HW field entries in the HW layout field array */ uint32_t array_sz; +/** [out] layout_id - layout id associated with the layout */ +uint16_t layout_id; };/**
@@ -247,6 +245,8 @@ struct hcapi_cfa_key_tbl {* applicable for newer chip */ uint8_t *base1; +/** [in] Page size for EEM tables */ +uint32_t page_size; };/**
@@ -267,7 +267,7 @@ struct hcapi_cfa_key_obj {struct hcapi_cfa_key_data {/** [in] For on-chip key table, it is the offset in unit of smallest * key. For off-chip key table, it is the byte offset relative -* to the key record memory base. +* to the key record memory base and adjusted for page and entry size. */ uint32_t offset;/** [in] HW key data buffer pointer */
@@ -668,5 +668,5 @@ int hcapi_cfa_key_hw_op(struct hcapi_cfa_hwop *op, struct hcapi_cfa_key_loc *key_loc);uint64_t hcapi_get_table_page (struct hcapi_cfa_em_table *mem, -uint32_t offset); +uint32_t page);#endif /* HCAPI_CFA_DEFS_H_ */
drivers/net/bnxt/hcapi/hcapi_cfa_p4.c +4 -4
@@ -13,7 +13,6 @@#include "hcapi_cfa_defs.h" #define HCAPI_CFA_LKUP_SEED_MEM_SIZE 512 -#define TF_EM_PAGE_SIZE (1 << 21)uint32_t hcapi_cfa_lkup_lkup3_init_cfg;uint32_t hcapi_cfa_lkup_em_seed_mem[HCAPI_CFA_LKUP_SEED_MEM_SIZE ];bool hcapi_cfa_lkup_init;
@@ -199,10 +198,9 @@ static uint32_t hcapi_cfa_lookup3_hash(uint8_t *in_key)uint64_t hcapi_get_table_page (struct hcapi_cfa_em_table *mem, -uint32_t offset) +uint32_t page) {int level =0 ; -int page = offset /TF_EM_PAGE_SIZE ;uint64_t addr;if (mem ==NULL )
@@ -362,7 +360,9 @@ int hcapi_cfa_key_hw_op(struct hcapi_cfa_hwop *op, op->hw.base_addr =hcapi_get_table_page ((struct hcapi_cfa_em_table *) key_tbl->base0, - key_obj->offset); + key_obj->offset / key_tbl->page_size); +/* Offset is adjusted to be the offset into the page */ + key_obj->offset = key_obj->offset % key_tbl->page_size;if (op->hw.base_addr ==0 )return -1 ;
drivers/net/bnxt/hcapi/hcapi_cfa_p4.h +17 -1
@@ -21,6 +21,10 @@ enum cfa_p4_tbl_id {CFA_P4_TBL_WC_TCAM_REMAP ,CFA_P4_TBL_VEB_TCAM ,CFA_P4_TBL_SP_TCAM , +CFA_P4_TBL_PROF_SPIF_DFLT_L2CTXT , +CFA_P4_TBL_PROF_PARIF_DFLT_ACT_REC_PTR , +CFA_P4_TBL_PROF_PARIF_ERR_ACT_REC_PTR , +CFA_P4_TBL_LKUP_PARIF_DFLT_ACT_REC_PTR , CFA_P4_TBL_MAX };
@@ -333,17 +337,29 @@ enum cfa_p4_action_sram_entry_type {*/ /** SRAM Action Record */ -CFA_P4_ACTION_SRAM_ENTRY_TYPE_ACT , +CFA_P4_ACTION_SRAM_ENTRY_TYPE_FULL_ACTION , + +CFA_P4_ACTION_SRAM_ENTRY_TYPE_FORMAT_0_ACTION , +CFA_P4_ACTION_SRAM_ENTRY_TYPE_FORMAT_1_ACTION , +CFA_P4_ACTION_SRAM_ENTRY_TYPE_FORMAT_2_ACTION , +CFA_P4_ACTION_SRAM_ENTRY_TYPE_FORMAT_3_ACTION , +CFA_P4_ACTION_SRAM_ENTRY_TYPE_FORMAT_4_ACTION , +/** SRAM Action Encap 8 Bytes */ CFA_P4_ACTION_SRAM_ENTRY_TYPE_ENCAP_8B ,/** SRAM Action Encap 16 Bytes */ CFA_P4_ACTION_SRAM_ENTRY_TYPE_ENCAP_16B ,/** SRAM Action Encap 64 Bytes */ CFA_P4_ACTION_SRAM_ENTRY_TYPE_ENCAP_64B , + +CFA_P4_ACTION_SRAM_ENTRY_TYPE_MODIFY_PORT_SRC , +CFA_P4_ACTION_SRAM_ENTRY_TYPE_MODIFY_PORT_DEST , +/** SRAM Action Modify IPv4 Source */ CFA_P4_ACTION_SRAM_ENTRY_TYPE_MODIFY_IPV4_SRC ,/** SRAM Action Modify IPv4 Destination */ CFA_P4_ACTION_SRAM_ENTRY_TYPE_MODIFY_IPV4_DEST , +/** SRAM Action Source Properties SMAC */ CFA_P4_ACTION_SRAM_ENTRY_TYPE_SP_SMAC , /** SRAM Action Source Properties SMAC IPv4 */
drivers/net/bnxt/meson.build +1 -1
@@ -43,7 +43,7 @@ sources = files('bnxt_cpr.c', 'tf_core/tf_shadow_tcam.c', 'tf_core/tf_tcam.c', 'tf_core/tf_util.c', - 'tf_core/tf_rm.c', + 'tf_core/tf_if_tbl.c', 'hcapi/hcapi_cfa_p4.c',
drivers/net/bnxt/tf_core/Makefile +2 -0
@@ -25,6 +25,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_shadow_tbl.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_shadow_tcam.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_tcam.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_util.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_if_tbl.c SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_core.h SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_project.h
@@ -33,3 +34,4 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_identifier.h SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_tbl.h SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/stack.h SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_tcam.h +SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_if_tbl.h
drivers/net/bnxt/tf_core/hwrm_tf.h +61 -2
85 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_core.c +116 -0
119 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_core.h +104 -0
108 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_device.c +21 -0
@@ -44,6 +44,7 @@ tf_dev_bind_p4(struct tf *tfp,struct tf_tbl_cfg_parms tbl_cfg;struct tf_tcam_cfg_parms tcam_cfg;struct tf_em_cfg_parms em_cfg; +struct tf_if_tbl_cfg_parms if_tbl_cfg; dev_handle->type =TF_DEVICE_TYPE_WH ;/* Initial function initialization */
@@ -114,6 +115,19 @@ tf_dev_bind_p4(struct tf *tfp, goto fail; } +/* +* IF_TBL +*/ + if_tbl_cfg.num_elements =TF_IF_TBL_TYPE_MAX ; + if_tbl_cfg.cfg = tf_if_tbl_p4; + if_tbl_cfg.shadow_copy = shadow_copy; + rc =tf_if_tbl_bind (tfp, &if_tbl_cfg); +if (rc) { +TFP_DRV_LOG (ERR , +"IF Table initialization failure\n" ); + goto fail; + } +/* Final function initialization */ dev_handle->ops = &tf_dev_ops_p4;
@@ -186,6 +200,13 @@ tf_dev_unbind_p4(struct tf *tfp) fail = true; } + rc =tf_if_tbl_unbind (tfp); +if (rc) { +TFP_DRV_LOG (ERR , +"Device unbind failed, IF Table Type\n" ); + fail = true; + } +if (fail)return -1 ;
drivers/net/bnxt/tf_core/tf_device.h +39 -0
@@ -10,6 +10,7 @@#include "tf_identifier.h" #include "tf_tbl.h" #include "tf_tcam.h" +#include "tf_if_tbl.h" struct tf ;struct tf_session ;
@@ -567,6 +568,44 @@ struct tf_dev_ops {*/ int (*tf_dev_free_tbl_scope)(struct tf *tfp,struct tf_free_tbl_scope_parms *parms); + +/** +* Sets the specified interface table type element. +* +* This API sets the specified element data by invoking the +* firmware. +* +* [in] tfp +* Pointer to TF handle +* +* [in] parms +* Pointer to interface table set parameters +* +* Returns +* - (0) if successful. +* - (-EINVAL) on failure. +*/ +int (*tf_dev_set_if_tbl)(struct tf *tfp, +struct tf_if_tbl_set_parms *parms); + +/** +* Retrieves the specified interface table type element. +* +* This API retrieves the specified element data by invoking the +* firmware. +* +* [in] tfp +* Pointer to TF handle +* +* [in] parms +* Pointer to table get parameters +* +* Returns +* - (0) if successful. +* - (-EINVAL) on failure. +*/ +int (*tf_dev_get_if_tbl)(struct tf *tfp, +struct tf_if_tbl_get_parms *parms); };/**
drivers/net/bnxt/tf_core/tf_device_p4.c +5 -0
@@ -11,6 +11,7 @@#include "tf_tbl.h" #include "tf_tcam.h" #include "tf_em.h" +#include "tf_if_tbl.h" /** * Device specific function that retrieves the MAX number of HCAPI
@@ -105,6 +106,8 @@ const struct tf_dev_ops tf_dev_ops_p4_init = { .tf_dev_delete_ext_em_entry = NULL, .tf_dev_alloc_tbl_scope = NULL, .tf_dev_free_tbl_scope = NULL, + .tf_dev_set_if_tbl = NULL, + .tf_dev_get_if_tbl = NULL, };/**
@@ -135,4 +138,6 @@ const struct tf_dev_ops tf_dev_ops_p4 = { .tf_dev_delete_ext_em_entry = tf_em_delete_ext_entry, .tf_dev_alloc_tbl_scope = tf_em_ext_common_alloc, .tf_dev_free_tbl_scope = tf_em_ext_common_free, + .tf_dev_set_if_tbl = tf_if_tbl_set, + .tf_dev_get_if_tbl = tf_if_tbl_get, };
drivers/net/bnxt/tf_core/tf_device_p4.h +10 -0
@@ -10,6 +10,7 @@#include "tf_core.h" #include "tf_rm.h" +#include "tf_if_tbl.h" struct tf_rm_element_cfg tf_ident_p4[TF_IDENT_TYPE_MAX ] = { {TF_RM_ELEM_CFG_HCAPI_BA ,CFA_RESOURCE_TYPE_P4_L2_CTXT_REMAP },
@@ -86,4 +87,13 @@ struct tf_rm_element_cfg tf_em_int_p4[TF_EM_TBL_TYPE_MAX] = { { TF_RM_ELEM_CFG_NULL, CFA_RESOURCE_TYPE_INVALID }, }; +struct tf_if_tbl_cfg tf_if_tbl_p4[TF_IF_TBL_TYPE_MAX] = { + { TF_IF_TBL_CFG, CFA_P4_TBL_PROF_SPIF_DFLT_L2CTXT }, + { TF_IF_TBL_CFG, CFA_P4_TBL_PROF_PARIF_DFLT_ACT_REC_PTR }, + { TF_IF_TBL_CFG, CFA_P4_TBL_PROF_PARIF_ERR_ACT_REC_PTR }, + { TF_IF_TBL_CFG, CFA_P4_TBL_LKUP_PARIF_DFLT_ACT_REC_PTR }, + { TF_IF_TBL_CFG_NULL, CFA_IF_TBL_TYPE_INVALID }, + { TF_IF_TBL_CFG_NULL, CFA_IF_TBL_TYPE_INVALID } +}; + #endif /* _TF_DEVICE_P4_H_ */
drivers/net/bnxt/tf_core/tf_em_common.c +2 -3
@@ -337,11 +337,10 @@ tf_em_ext_common_bind(struct tf *tfp, db_exists =1 ; } -if (db_exists) { - mem_type = parms->mem_type; +if (db_exists) init =1 ; - } + mem_type = parms->mem_type;return 0 ; }
drivers/net/bnxt/tf_core/tf_em_host.c +7 -5
@@ -831,7 +831,8 @@ tf_insert_eem_entry(struct tf_tbl_scope_cb *tbl_scope_cb, op.opcode =HCAPI_CFA_HWOPS_ADD ; key_tbl.base0 = (uint8_t *) &tbl_scope_cb->em_ctx_info[parms->dir].em_tables[TF_KEY0_TABLE ]; - key_obj.offset = (index *TF_EM_KEY_RECORD_SIZE ) %TF_EM_PAGE_SIZE ; + key_tbl.page_size =TF_EM_PAGE_SIZE ; + key_obj.offset = index *TF_EM_KEY_RECORD_SIZE ; key_obj.data = (uint8_t *)&key_entry; key_obj.size =TF_EM_KEY_RECORD_SIZE ;
@@ -847,8 +848,7 @@ tf_insert_eem_entry(struct tf_tbl_scope_cb *tbl_scope_cb, key_tbl.base0 = (uint8_t *) &tbl_scope_cb->em_ctx_info[parms->dir].em_tables[TF_KEY1_TABLE ]; - key_obj.offset = - (index *TF_EM_KEY_RECORD_SIZE ) %TF_EM_PAGE_SIZE ; + key_obj.offset = index *TF_EM_KEY_RECORD_SIZE ; rc = hcapi_cfa_key_hw_op(&op, &key_tbl,
@@ -914,7 +914,8 @@ tf_delete_eem_entry(struct tf_tbl_scope_cb *tbl_scope_cb, &tbl_scope_cb->em_ctx_info[parms->dir].em_tables[(hash_type ==0 ?TF_KEY0_TABLE :TF_KEY1_TABLE )]; - key_obj.offset = (index *TF_EM_KEY_RECORD_SIZE ) %TF_EM_PAGE_SIZE ; + key_tbl.page_size =TF_EM_PAGE_SIZE ; + key_obj.offset = index *TF_EM_KEY_RECORD_SIZE ; key_obj.data =NULL ; key_obj.size =TF_EM_KEY_RECORD_SIZE ;
@@ -1195,7 +1196,8 @@ int tf_tbl_ext_host_set(struct tf *tfp, op.opcode =HCAPI_CFA_HWOPS_PUT ; key_tbl.base0 = (uint8_t *)&tbl_scope_cb->em_ctx_info[parms->dir].em_tables[TF_RECORD_TABLE ]; - key_obj.offset = parms->idx %TF_EM_PAGE_SIZE ; + key_tbl.page_size =TF_EM_PAGE_SIZE ; + key_obj.offset = parms->idx; key_obj.data = parms->data; key_obj.size = parms->data_sz_in_bytes;
drivers/net/bnxt/tf_core/tf_identifier.c +1 -2
@@ -68,7 +68,7 @@ tf_ident_bind(struct tf *tfp,int tf_ident_unbind (struct tf *tfp) { -int rc; +int rc =0 ;int i;struct tf_rm_free_db_parms fparms = {0 };
@@ -89,7 +89,6 @@ tf_ident_unbind(struct tf *tfp)TFP_DRV_LOG (ERR ,"rm free failed on unbind\n" ); } - ident_db[i] =NULL ; }
drivers/net/bnxt/tf_core/tf_if_tbl.c new file +178 -0
178 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_if_tbl.h new file +236 -0
236 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_msg.c +155 -31
270 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_msg.h +30 -0
@@ -428,4 +428,34 @@ int tf_msg_bulk_get_tbl_entry(struct tf *tfp,uint16_t entry_sz_in_bytes, uint64_t physical_mem_addr); +/** +* Sends Set message of a IF Table Type element to the firmware. +* +* [in] tfp +* Pointer to session handle +* +* [in] parms +* Pointer to IF table set parameters +* +* Returns: +* 0 on Success else internal Truflow error +*/ +int tf_msg_set_if_tbl_entry (struct tf *tfp, +struct tf_if_tbl_set_parms *params); + +/** +* Sends get message of a IF Table Type element to the firmware. +* +* [in] tfp +* Pointer to session handle +* +* [in] parms +* Pointer to IF table get parameters +* +* Returns: +* 0 on Success else internal Truflow error +*/ +int tf_msg_get_if_tbl_entry (struct tf *tfp, +struct tf_if_tbl_get_parms *params); +#endif /* _TF_MSG_H_ */
drivers/net/bnxt/tf_core/tf_session.c +12 -2
@@ -70,14 +70,24 @@ tf_session_open_session(struct tf *tfp, goto cleanup; } tfp->session->core_data = cparms.mem_va; + session_id = &parms->open_cfg->session_id; + +/* Update Session Info, which is what is visible to the caller */ + tfp->session->ver.major =0 ; + tfp->session->ver.minor =0 ; + tfp->session->ver.update =0 ; -/* Initialize Session and Device */ + tfp->session->session_id.internal.domain = session_id->internal.domain; + tfp->session->session_id.internal.bus = session_id->internal.bus; + tfp->session->session_id.internal.device = session_id->internal.device; + tfp->session->session_id.internal.fw_session_id = fw_session_id; + +/* Initialize Session and Device, which is private */ session = (struct tf_session *)tfp->session->core_data; session->ver.major =0 ; session->ver.minor =0 ; session->ver.update =0 ; - session_id = &parms->open_cfg->session_id; session->session_id.internal.domain = session_id->internal.domain; session->session_id.internal.bus = session_id->internal.bus; session->session_id.internal.device = session_id->internal.device;
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 29/51 net/bnxt: add TF register and unregister
In reply to Ajit KhapardeFrom: Michael Wildt <[email protected]>
- Add TF register/unregister support. Session got session clients to keep track of the ctrl-channels/function.
- Add support code to tfp layer
--- drivers/net/bnxt/meson.build | 1 + drivers/net/bnxt/tf_core/Makefile | 1 + drivers/net/bnxt/tf_core/ll.c | 52 +++ drivers/net/bnxt/tf_core/ll.h | 46 +++ drivers/net/bnxt/tf_core/tf_core.c | 26 +- drivers/net/bnxt/tf_core/tf_core.h | 105 +++-- drivers/net/bnxt/tf_core/tf_msg.c | 84 +++- drivers/net/bnxt/tf_core/tf_msg.h | 42 +- drivers/net/bnxt/tf_core/tf_rm.c | 2 +- drivers/net/bnxt/tf_core/tf_session.c | 569 ++++++++++++++++++++++++-- drivers/net/bnxt/tf_core/tf_session.h | 201 ++++++++- drivers/net/bnxt/tf_core/tf_tbl.c | 2 + drivers/net/bnxt/tf_core/tf_tcam.c | 8 +- drivers/net/bnxt/tf_core/tfp.c | 17 + drivers/net/bnxt/tf_core/tfp.h | 15 + 15 files changed, 1075 insertions(+), 96 deletions(-) create mode 100644 drivers/net/bnxt/tf_core/ll.c create mode 100644 drivers/net/bnxt/tf_core/ll.h
drivers/net/bnxt/meson.build +1 -0
@@ -44,6 +44,7 @@ sources = files('bnxt_cpr.c', 'tf_core/tf_tcam.c', 'tf_core/tf_util.c', 'tf_core/tf_if_tbl.c', + 'tf_core/ll.c', 'hcapi/hcapi_cfa_p4.c',
drivers/net/bnxt/tf_core/Makefile +1 -0
@@ -8,6 +8,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/bitalloc.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/rand.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/stack.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/ll.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_core.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_rm.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tfp.c
drivers/net/bnxt/tf_core/ll.c new file +52 -0
52 lines not on this page · raw message
drivers/net/bnxt/tf_core/ll.h new file +46 -0
46 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_core.c +11 -15
@@ -58,21 +58,20 @@ tf_open_session(struct tf *tfp, parms->session_id.internal.device = device; oparms.open_cfg = parms; +/* Session vs session client is decided in +* tf_session_open_session() +*/ +printf ("TF_OPEN, %s\n" , parms->ctrl_chan_name); rc =tf_session_open_session (tfp, &oparms);/* Logging handled by tf_session_open_session */ if (rc)return rc;TFP_DRV_LOG (INFO , -"Session created, session_id:%d\n" , - parms->session_id.id); - -TFP_DRV_LOG (INFO , -"domain:%d, bus:%d, device:%d, fw_session_id:%d\n" , +"domain:%d, bus:%d, device:%d\n" , parms->session_id.internal.domain, parms->session_id.internal.bus, - parms->session_id.internal.device, - parms->session_id.internal.fw_session_id); + parms->session_id.internal.device);return 0 ; }
@@ -152,6 +151,9 @@ tf_close_session(struct tf *tfp) cparms.ref_count = &ref_count; cparms.session_id = &session_id; +/* Session vs session client is decided in +* tf_session_close_session() +*/ rc =tf_session_close_session (tfp, &cparms);/* Logging handled by tf_session_close_session */
@@ -159,16 +161,10 @@ tf_close_session(struct tf *tfp)return rc;TFP_DRV_LOG (INFO , -"Closed session, session_id:%d, ref_count:%d\n" , - cparms.session_id->id, - *cparms.ref_count); - -TFP_DRV_LOG (INFO , -"domain:%d, bus:%d, device:%d, fw_session_id:%d\n" , +"domain:%d, bus:%d, device:%d\n" , cparms.session_id->internal.domain, cparms.session_id->internal.bus, - cparms.session_id->internal.device, - cparms.session_id->internal.fw_session_id); + cparms.session_id->internal.device);return rc; }
drivers/net/bnxt/tf_core/tf_core.h +80 -25
176 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_msg.c +82 -2
102 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_msg.h +41 -1
60 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_rm.c +1 -1
@@ -389,7 +389,7 @@ tf_rm_create_db(struct tf *tfp,TF_CHECK_PARMS2 (tfp, parms);/* Retrieve the session information */ - rc =tf_session_get_session (tfp, &tfs); + rc =tf_session_get_session_internal (tfp, &tfs);if (rc)return rc;
drivers/net/bnxt/tf_core/tf_session.c +537 -32
671 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_session.h +184 -17
291 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tbl.c +2 -0
@@ -269,6 +269,7 @@ tf_tbl_set(struct tf *tfp,tf_dir_2_str (parms->dir), parms->type, strerror(-rc)); +return rc; }return 0 ;
@@ -338,6 +339,7 @@ tf_tbl_get(struct tf *tfp,tf_dir_2_str (parms->dir), parms->type, strerror(-rc)); +return rc; }return 0 ;
drivers/net/bnxt/tf_core/tf_tcam.c +5 -3
@@ -138,7 +138,7 @@ tf_tcam_alloc(struct tf *tfp, }/* Retrieve the session information */ - rc =tf_session_get_session (tfp, &tfs); + rc =tf_session_get_session_internal (tfp, &tfs);if (rc)return rc;
@@ -218,7 +218,7 @@ tf_tcam_free(struct tf *tfp, }/* Retrieve the session information */ - rc =tf_session_get_session (tfp, &tfs); + rc =tf_session_get_session_internal (tfp, &tfs);if (rc)return rc;
@@ -319,6 +319,7 @@ tf_tcam_free(struct tf *tfp,tf_tcam_tbl_2_str (parms->type), parms->idx, strerror(-rc)); +return rc; }return 0 ;
@@ -353,7 +354,7 @@ tf_tcam_set(struct tf *tfp __rte_unused, }/* Retrieve the session information */ - rc =tf_session_get_session (tfp, &tfs); + rc =tf_session_get_session_internal (tfp, &tfs);if (rc)return rc;
@@ -415,6 +416,7 @@ tf_tcam_set(struct tf *tfp __rte_unused,tf_tcam_tbl_2_str (parms->type), parms->idx, strerror(-rc)); +return rc; }return 0 ;
drivers/net/bnxt/tf_core/tfp.c +17 -0
@@ -161,3 +161,20 @@ tfp_spinlock_unlock(struct tfp_spinlock_parms *parms) {rte_spinlock_unlock (&parms->slock); } + +int +tfp_get_fid (struct tf *tfp,uint16_t *fw_fid) +{ +struct bnxt *bp =NULL ; + +if (tfp ==NULL || fw_fid ==NULL ) +return -EINVAL ; + + bp = container_of(tfp, struct bnxt, tfp); +if (bp ==NULL ) +return -EINVAL ; + + *fw_fid = bp->fw_fid; + +return 0 ; +}
drivers/net/bnxt/tf_core/tfp.h +15 -0
@@ -238,4 +238,19 @@ int tfp_get_fid(struct tf *tfp, uint16_t *fw_fid);#define tfp_bswap_32 (val) rte_bswap32(val)#define tfp_bswap_64 (val) rte_bswap64(val) +/** +* Lookup of the FID in the platform specific structure. +* +* [in] session +* Pointer to session handle +* +* [out] fw_fid +* Pointer to the fw_fid +* +* Returns: +* 0 - Success +* -EINVAL - Parameter error +*/ +int tfp_get_fid (struct tf *tfp,uint16_t *fw_fid); +#endif /* _TFP_H_ */
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 30/51 net/bnxt: add global config set and get APIs
In reply to Ajit KhapardeFrom: Jay Ding <[email protected]>
- Add support to update global configuration for ACT_TECT and ACT_ABCR.
- Add support to allow Tunnel and Action global configuration.
- Remove register read and write operations.
- Remove the register read and write support.
--- drivers/net/bnxt/hcapi/hcapi_cfa.h | 3 + drivers/net/bnxt/meson.build | 1 + drivers/net/bnxt/tf_core/Makefile | 2 + drivers/net/bnxt/tf_core/hwrm_tf.h | 54 +++++- drivers/net/bnxt/tf_core/tf_core.c | 137 ++++++++++++++++ drivers/net/bnxt/tf_core/tf_core.h | 77 +++++++++ drivers/net/bnxt/tf_core/tf_device.c | 20 +++ drivers/net/bnxt/tf_core/tf_device.h | 33 ++++ drivers/net/bnxt/tf_core/tf_device_p4.c | 4 + drivers/net/bnxt/tf_core/tf_device_p4.h | 5 + drivers/net/bnxt/tf_core/tf_global_cfg.c | 199 +++++++++++++++++++++++ drivers/net/bnxt/tf_core/tf_global_cfg.h | 170 +++++++++++++++++++ drivers/net/bnxt/tf_core/tf_msg.c | 109 ++++++++++++- drivers/net/bnxt/tf_core/tf_msg.h | 31 ++++ 14 files changed, 840 insertions(+), 5 deletions(-) create mode 100644 drivers/net/bnxt/tf_core/tf_global_cfg.c create mode 100644 drivers/net/bnxt/tf_core/tf_global_cfg.h
drivers/net/bnxt/hcapi/hcapi_cfa.h +3 -0
@@ -245,6 +245,9 @@ int hcapi_cfa_p4_wc_tcam_rec_hwop(struct hcapi_cfa_hwop *op, struct hcapi_cfa_data *obj_data);int hcapi_cfa_p4_mirror_hwop (struct hcapi_cfa_hwop *op,struct hcapi_cfa_data *mirror); +int hcapi_cfa_p4_global_cfg_hwop (struct hcapi_cfa_hwop *op, +uint32_t type, +struct hcapi_cfa_data *config);#endif /* SUPPORT_CFA_HW_P4 */ /** * HCAPI CFA device HW operation function callback definition
drivers/net/bnxt/meson.build +1 -0
@@ -45,6 +45,7 @@ sources = files('bnxt_cpr.c', 'tf_core/tf_util.c', 'tf_core/tf_if_tbl.c', 'tf_core/ll.c', + 'tf_core/tf_global_cfg.c', 'hcapi/hcapi_cfa_p4.c',
drivers/net/bnxt/tf_core/Makefile +2 -0
@@ -27,6 +27,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_shadow_tcam.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_tcam.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_util.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_if_tbl.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_global_cfg.c SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_core.h SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_project.h
@@ -36,3 +37,4 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_tbl.h SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/stack.h SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_tcam.h SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_if_tbl.h +SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_global_cfg.h
drivers/net/bnxt/tf_core/hwrm_tf.h +51 -3
77 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_core.c +137 -0
149 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_core.h +77 -0
83 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_device.c +20 -0
@@ -45,6 +45,7 @@ tf_dev_bind_p4(struct tf *tfp,struct tf_tcam_cfg_parms tcam_cfg;struct tf_em_cfg_parms em_cfg;struct tf_if_tbl_cfg_parms if_tbl_cfg; +struct tf_global_cfg_cfg_parms global_cfg; dev_handle->type =TF_DEVICE_TYPE_WH ;/* Initial function initialization */
@@ -128,6 +129,18 @@ tf_dev_bind_p4(struct tf *tfp, goto fail; } +/* +* GLOBAL_CFG +*/ + global_cfg.num_elements =TF_GLOBAL_CFG_TYPE_MAX ; + global_cfg.cfg = tf_global_cfg_p4; + rc =tf_global_cfg_bind (tfp, &global_cfg); +if (rc) { +TFP_DRV_LOG (ERR , +"Global Cfg initialization failure\n" ); + goto fail; + } +/* Final function initialization */ dev_handle->ops = &tf_dev_ops_p4;
@@ -207,6 +220,13 @@ tf_dev_unbind_p4(struct tf *tfp) fail = true; } + rc =tf_global_cfg_unbind (tfp); +if (rc) { +TFP_DRV_LOG (ERR , +"Device unbind failed, Global Cfg Type\n" ); + fail = true; + } +if (fail)return -1 ;
drivers/net/bnxt/tf_core/tf_device.h +33 -0
@@ -11,6 +11,7 @@#include "tf_tbl.h" #include "tf_tcam.h" #include "tf_if_tbl.h" +#include "tf_global_cfg.h" struct tf ;struct tf_session ;
@@ -606,6 +607,38 @@ struct tf_dev_ops {*/ int (*tf_dev_get_if_tbl)(struct tf *tfp,struct tf_if_tbl_get_parms *parms); + +/** +* Update global cfg +* +* [in] tfp +* Pointer to TF handle +* +* [in] parms +* Pointer to global cfg parameters +* +* returns: +* 0 - Success +* -EINVAL - Error +*/ +int (*tf_dev_set_global_cfg)(struct tf *tfp, +struct tf_dev_global_cfg_parms *parms); + +/** +* Get global cfg +* +* [in] tfp +* Pointer to TF handle +* +* [in] parms +* Pointer to global cfg parameters +* +* returns: +* 0 - Success +* -EINVAL - Error +*/ +int (*tf_dev_get_global_cfg)(struct tf *tfp, +struct tf_dev_global_cfg_parms *parms); };/**
drivers/net/bnxt/tf_core/tf_device_p4.c +4 -0
@@ -108,6 +108,8 @@ const struct tf_dev_ops tf_dev_ops_p4_init = { .tf_dev_free_tbl_scope = NULL, .tf_dev_set_if_tbl = NULL, .tf_dev_get_if_tbl = NULL, + .tf_dev_set_global_cfg = NULL, + .tf_dev_get_global_cfg = NULL, };/**
@@ -140,4 +142,6 @@ const struct tf_dev_ops tf_dev_ops_p4 = { .tf_dev_free_tbl_scope = tf_em_ext_common_free, .tf_dev_set_if_tbl = tf_if_tbl_set, .tf_dev_get_if_tbl = tf_if_tbl_get, + .tf_dev_set_global_cfg = tf_global_cfg_set, + .tf_dev_get_global_cfg = tf_global_cfg_get, };
drivers/net/bnxt/tf_core/tf_device_p4.h +5 -0
@@ -11,6 +11,7 @@#include "tf_core.h" #include "tf_rm.h" #include "tf_if_tbl.h" +#include "tf_global_cfg.h" struct tf_rm_element_cfg tf_ident_p4[TF_IDENT_TYPE_MAX ] = { {TF_RM_ELEM_CFG_HCAPI_BA ,CFA_RESOURCE_TYPE_P4_L2_CTXT_REMAP },
@@ -96,4 +97,8 @@ struct tf_if_tbl_cfg tf_if_tbl_p4[TF_IF_TBL_TYPE_MAX] = { { TF_IF_TBL_CFG_NULL, CFA_IF_TBL_TYPE_INVALID } }; +struct tf_global_cfg_cfg tf_global_cfg_p4[TF_GLOBAL_CFG_TYPE_MAX ] = { + {TF_GLOBAL_CFG_CFG_HCAPI ,TF_TUNNEL_ENCAP }, + {TF_GLOBAL_CFG_CFG_HCAPI ,TF_ACTION_BLOCK }, +};#endif /* _TF_DEVICE_P4_H_ */
drivers/net/bnxt/tf_core/tf_global_cfg.c new file +199 -0
199 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_global_cfg.h new file +170 -0
170 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_msg.c +107 -2
121 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_msg.h +31 -0
@@ -12,6 +12,7 @@#include "tf_tbl.h" #include "tf_rm.h" #include "tf_tcam.h" +#include "tf_global_cfg.h" struct tf ;
@@ -448,6 +449,36 @@ int tf_msg_get_tbl_entry(struct tf *tfp,/* HWRM Tunneled messages */ +/** +* Sends global cfg read request to Firmware +* +* [in] tfp +* Pointer to TF handle +* +* [in] params +* Pointer to read parameters +* +* Returns: +* 0 on Success else internal Truflow error +*/ +int tf_msg_get_global_cfg (struct tf *tfp, +struct tf_dev_global_cfg_parms *params); + +/** +* Sends global cfg update request to Firmware +* +* [in] tfp +* Pointer to TF handle +* +* [in] params +* Pointer to write parameters +* +* Returns: +* 0 on Success else internal Truflow error +*/ +int tf_msg_set_global_cfg (struct tf *tfp, +struct tf_dev_global_cfg_parms *params); +/** * Sends bulk get message of a Table Type element to the firmware. *
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 31/51 net/bnxt: add support for EEM System memory
In reply to Ajit KhapardeFrom: Peter Spreadborough <[email protected]>
- Select EEM Host or System memory via config parameter
- Add EEM system memory support for kernel memory
- Dependent on DPDK changes that add support for the HWRM_OEM_CMD.
--- config/common_base | 1 + drivers/net/bnxt/Makefile | 3 + drivers/net/bnxt/bnxt.h | 8 + drivers/net/bnxt/bnxt_hwrm.c | 27 + drivers/net/bnxt/bnxt_hwrm.h | 1 + drivers/net/bnxt/meson.build | 2 +- drivers/net/bnxt/tf_core/Makefile | 5 +- drivers/net/bnxt/tf_core/tf_core.c | 13 +- drivers/net/bnxt/tf_core/tf_core.h | 4 +- drivers/net/bnxt/tf_core/tf_device.c | 5 +- drivers/net/bnxt/tf_core/tf_device_p4.c | 2 +- drivers/net/bnxt/tf_core/tf_em.h | 113 +--- drivers/net/bnxt/tf_core/tf_em_common.c | 683 ++++++++++++++++++++++- drivers/net/bnxt/tf_core/tf_em_common.h | 30 ++ drivers/net/bnxt/tf_core/tf_em_host.c | 689 +----------------------- drivers/net/bnxt/tf_core/tf_em_system.c | 541 ++++++++++++++++--- drivers/net/bnxt/tf_core/tf_if_tbl.h | 4 +- drivers/net/bnxt/tf_core/tf_msg.c | 24 + drivers/net/bnxt/tf_core/tf_tbl.h | 7 + drivers/net/bnxt/tf_core/tfp.c | 12 + drivers/net/bnxt/tf_core/tfp.h | 15 + 21 files changed, 1319 insertions(+), 870 deletions(-)
config/common_base +1 -0
@@ -220,6 +220,7 @@ CONFIG_RTE_LIBRTE_BNX2X_DEBUG_PERIODIC=n # Compile burst-oriented Broadcom BNXT PMD driver # CONFIG_RTE_LIBRTE_BNXT_PMD=y +CONFIG_RTE_LIBRTE_BNXT_PMD_SYSTEM=n # # Compile burst-oriented Chelsio Terminator (CXGBE) PMD
drivers/net/bnxt/Makefile +3 -0
@@ -50,6 +50,9 @@ CFLAGS += -I$(SRCDIR) -I$(SRCDIR)/tf_ulp -I$(SRCDIR)/tf_core -I$(SRCDIR)/hcapi include $(SRCDIR)/tf_ulp/Makefile include $(SRCDIR)/tf_core/Makefile include $(SRCDIR)/hcapi/Makefile +ifeq ($(CONFIG_RTE_LIBRTE_BNXT_PMD_SYSTEM), y) +CFLAGS += -DTF_USE_SYSTEM_MEM +endif endif #
drivers/net/bnxt/bnxt.h +8 -0
@@ -563,6 +563,13 @@ struct bnxt_rep_info { DEV_RX_OFFLOAD_SCATTER | \ DEV_RX_OFFLOAD_RSS_HASH) +#define MAX_TABLE_SUPPORT 4 +#define MAX_DIR_SUPPORT 2 +struct bnxt_dmabuf_info { +uint32_t entry_num; +int fd[MAX_DIR_SUPPORT ][MAX_TABLE_SUPPORT ]; +}; +#define BNXT_HWRM_SHORT_REQ_LEN sizeof(struct hwrm_short_input)struct bnxt_flow_stat_info {
@@ -780,6 +787,7 @@ struct bnxt {uint16_t port_svif;struct tf tfp; +struct bnxt_dmabuf_info dmabuf;struct bnxt_ulp_context *ulp_ctx;struct bnxt_flow_stat_info *flow_stat;uint8_t flow_xstat;
drivers/net/bnxt/bnxt_hwrm.c +27 -0
@@ -5506,3 +5506,30 @@ int bnxt_hwrm_cfa_counter_qstats(struct bnxt *bp,return 0 ; } + +#ifdef RTE_LIBRTE_BNXT_PMD_SYSTEM +int +bnxt_hwrm_oem_cmd (struct bnxt *bp,uint32_t entry_num) +{ +struct hwrm_oem_cmd_input req = {0 }; +struct hwrm_oem_cmd_output *resp = bp->hwrm_cmd_resp_addr; +struct bnxt_dmabuf_info oem_data; +int rc =0 ; + +HWRM_PREP (&req,HWRM_OEM_CMD ,BNXT_USE_CHIMP_MB ); + req.IANA =0x14e4 ; + +memset (&oem_data,0 ,sizeof (struct bnxt_dmabuf_info )); + oem_data.entry_num = (entry_num); +memcpy (&req.oem_data[0 ], &oem_data,sizeof (struct bnxt_dmabuf_info )); + + rc =bnxt_hwrm_send_message (bp, &req,sizeof (req),BNXT_USE_CHIMP_MB ); +HWRM_CHECK_RESULT (); + + bp->dmabuf.entry_num = entry_num; + +HWRM_UNLOCK (); + +return rc; +} +#endif /* RTE_LIBRTE_BNXT_PMD_SYSTEM */
drivers/net/bnxt/bnxt_hwrm.h +1 -0
@@ -276,4 +276,5 @@ int bnxt_hwrm_get_dflt_vnic_svif(struct bnxt *bp, uint16_t fid, uint16_t *vnic_id, uint16_t *svif);int bnxt_hwrm_parent_pf_qcfg (struct bnxt *bp);int bnxt_hwrm_port_phy_qcaps (struct bnxt *bp); +int bnxt_hwrm_oem_cmd (struct bnxt *bp,uint32_t entry_num);#endif
drivers/net/bnxt/meson.build +1 -1
@@ -31,7 +31,6 @@ sources = files('bnxt_cpr.c', 'tf_core/tf_em_common.c', 'tf_core/tf_em_host.c', 'tf_core/tf_em_internal.c', - 'tf_core/tf_em_system.c', 'tf_core/tf_rm.c', 'tf_core/tf_tbl.c', 'tf_core/tfp.c',
@@ -46,6 +45,7 @@ sources = files('bnxt_cpr.c', 'tf_core/tf_if_tbl.c', 'tf_core/ll.c', 'tf_core/tf_global_cfg.c', + 'tf_core/tf_em_host.c', 'hcapi/hcapi_cfa_p4.c',
drivers/net/bnxt/tf_core/Makefile +4 -1
@@ -16,8 +16,11 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_msg.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_tbl.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_em_common.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_em_internal.c +ifeq ($(CONFIG_RTE_LIBRTE_BNXT_PMD_SYSTEM), n) SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_em_host.c -SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_em_system.c +else +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD_SYSTEM) += tf_core/tf_em_system.c +endif SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_session.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_device.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_device_p4.c
drivers/net/bnxt/tf_core/tf_core.c +10 -3
@@ -540,10 +540,12 @@ tf_alloc_tcam_entry(struct tf *tfp,int rc;struct tf_session *tfs;struct tf_dev_info *dev; -struct tf_tcam_alloc_parms aparms = {0 }; +struct tf_tcam_alloc_parms aparms;TF_CHECK_PARMS2 (tfp, parms); +memset (&aparms,0 ,sizeof (struct tf_tcam_alloc_parms )); +/* Retrieve the session information */ rc =tf_session_get_session (tfp, &tfs);if (rc) {
@@ -598,10 +600,13 @@ tf_set_tcam_entry(struct tf *tfp,int rc;struct tf_session *tfs;struct tf_dev_info *dev; -struct tf_tcam_set_parms sparms = {0 }; +struct tf_tcam_set_parms sparms;TF_CHECK_PARMS2 (tfp, parms); +memset (&sparms,0 ,sizeof (struct tf_tcam_set_parms )); + +/* Retrieve the session information */ rc =tf_session_get_session (tfp, &tfs);if (rc) {
@@ -667,10 +672,12 @@ tf_free_tcam_entry(struct tf *tfp,int rc;struct tf_session *tfs;struct tf_dev_info *dev; -struct tf_tcam_free_parms fparms = {0 }; +struct tf_tcam_free_parms fparms;TF_CHECK_PARMS2 (tfp, parms); +memset (&fparms,0 ,sizeof (struct tf_tcam_free_parms )); +/* Retrieve the session information */ rc =tf_session_get_session (tfp, &tfs);if (rc) {
drivers/net/bnxt/tf_core/tf_core.h +2 -2
@@ -1731,7 +1731,7 @@ struct tf_set_if_tbl_entry_parms {/** * [in] Entry data */ -uint32_t *data; +uint8_t *data;/** * [in] Entry size */
@@ -1768,7 +1768,7 @@ struct tf_get_if_tbl_entry_parms {/** * [out] Entry data */ -uint32_t *data; +uint8_t *data;/** * [in] Entry size */
drivers/net/bnxt/tf_core/tf_device.c +4 -1
@@ -92,8 +92,11 @@ tf_dev_bind_p4(struct tf *tfp, em_cfg.num_elements =TF_EM_TBL_TYPE_MAX ; em_cfg.cfg = tf_em_ext_p4; em_cfg.resources = resources; +#ifdef TF_USE_SYSTEM_MEM + em_cfg.mem_type =TF_EEM_MEM_TYPE_SYSTEM ; +#else em_cfg.mem_type =TF_EEM_MEM_TYPE_HOST ; - +#endif rc =tf_em_ext_common_bind (tfp, &em_cfg);if (rc) { TFP_DRV_LOG(ERR,
drivers/net/bnxt/tf_core/tf_device_p4.c +1 -1
@@ -126,7 +126,7 @@ const struct tf_dev_ops tf_dev_ops_p4 = { .tf_dev_free_ext_tbl = tf_tbl_ext_free, .tf_dev_alloc_search_tbl = NULL, .tf_dev_set_tbl = tf_tbl_set, - .tf_dev_set_ext_tbl = tf_tbl_ext_set, + .tf_dev_set_ext_tbl = tf_tbl_ext_common_set, .tf_dev_get_tbl = tf_tbl_get, .tf_dev_get_bulk_tbl = tf_tbl_bulk_get, .tf_dev_alloc_tcam = tf_tcam_alloc,
drivers/net/bnxt/tf_core/tf_em.h +22 -91
157 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_em_common.c +663 -20
725 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_em_common.h +30 -0
@@ -101,4 +101,34 @@ void *tf_em_get_table_page(struct tf_tbl_scope_cb *tbl_scope_cb,uint32_t offset, enum hcapi_cfa_em_table_type table_type); +/** +* Validates EM number of entries requested +* +* [in] tbl_scope_cb +* Pointer to table scope control block to be populated +* +* [in] parms +* Pointer to input parameters +* +* Returns: +* 0 - Success +* -EINVAL - Parameter error +*/ +int tf_em_validate_num_entries (struct tf_tbl_scope_cb *tbl_scope_cb, +struct tf_alloc_tbl_scope_parms *parms); + +/** +* Size the EM table based on capabilities +* +* [in] tbl +* EM table to size +* +* Returns: +* 0 - Success +* - EINVAL - Parameter error +* - ENOMEM - Out of memory +*/ +int tf_em_size_table (struct hcapi_cfa_em_table *tbl, +uint32_t page_size); +#endif /* _TF_EM_COMMON_H_ */
drivers/net/bnxt/tf_core/tf_em_host.c +5 -684
735 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_em_system.c +477 -64
591 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_if_tbl.h +2 -2
@@ -113,7 +113,7 @@ struct tf_if_tbl_set_parms {/** * [in] Entry data */ -uint32_t *data; +uint8_t *data;/** * [in] Entry size */
@@ -143,7 +143,7 @@ struct tf_if_tbl_get_parms {/** * [out] Entry data */ -uint32_t *data; +uint8_t *data;/** * [out] Entry size */
drivers/net/bnxt/tf_core/tf_msg.c +24 -0
@@ -813,7 +813,19 @@ tf_msg_tcam_entry_set(struct tf *tfp,struct tf_msg_dma_buf buf = {0 };uint8_t *data =NULL ;int data_size =0 ; +uint8_t fw_session_id; + rc =tf_session_get_fw_session_id (tfp, &fw_session_id); +if (rc) { +TFP_DRV_LOG (ERR , +"%s: Unable to lookup FW id, rc:%s\n" , +tf_dir_2_str (parms->dir), +strerror (-rc)); +return rc; + } + +/* Populate the request */ + req.fw_session_id =tfp_cpu_to_le_32 (fw_session_id); req.type = parms->hcapi_type; req.idx =tfp_cpu_to_le_16 (parms->idx);if (parms->dir ==TF_DIR_TX )
@@ -869,7 +881,19 @@ tf_msg_tcam_entry_free(struct tf *tfp,struct hwrm_tf_tcam_free_input req = {0 };struct hwrm_tf_tcam_free_output resp = {0 };struct tfp_send_msg_parms parms = {0 }; +uint8_t fw_session_id; + rc =tf_session_get_fw_session_id (tfp, &fw_session_id); +if (rc) { +TFP_DRV_LOG (ERR , +"%s: Unable to lookup FW id, rc:%s\n" , +tf_dir_2_str (in_parms->dir), +strerror (-rc)); +return rc; + } + +/* Populate the request */ + req.fw_session_id =tfp_cpu_to_le_32 (fw_session_id); req.type = in_parms->hcapi_type; req.count =1 ; req.idx_list[0 ] =tfp_cpu_to_le_16 (in_parms->idx);
drivers/net/bnxt/tf_core/tf_tbl.h +7 -0
@@ -38,6 +38,13 @@ struct tf_em_caps {*/ struct tf_tbl_scope_cb {uint32_t tbl_scope_id; +#ifdef TF_USE_SYSTEM_MEM +int lfc_fd; +uint32_t bus; +uint32_t devfn; +int fd[TF_DIR_MAX ][TF_MAX_TABLE ]; +bool valid; +#endif int index;struct hcapi_cfa_em_ctx_mem_info em_ctx_info[TF_DIR_MAX ];struct tf_em_caps em_caps[TF_DIR_MAX ];
drivers/net/bnxt/tf_core/tfp.c +12 -0
@@ -87,6 +87,18 @@ tfp_send_msg_tunneled(struct tf *tfp,return rc; } +#ifdef TF_USE_SYSTEM_MEM +int +tfp_msg_hwrm_oem_cmd (struct tf *tfp, +uint32_t max_flows) +{ +return bnxt_hwrm_oem_cmd (container_of (tfp, + struct bnxt, + tfp), + max_flows); +} +#endif /* TF_USE_SYSTEM_MEM */ +/** * Allocates zero'ed memory from the heap. *
drivers/net/bnxt/tf_core/tfp.h +15 -0
@@ -170,6 +170,21 @@ int tfp_msg_hwrm_oem_cmd(struct tf *tfp, uint32_t max_flows); +/** +* Sends OEM command message to Chimp +* +* [in] session, pointer to session handle +* [in] max_flows, max number of flows requested +* +* Returns: +* 0 - Success +* -1 - Global error like not supported +* -EINVAL - Parameter Error +*/ +int +tfp_msg_hwrm_oem_cmd (struct tf *tfp, +uint32_t max_flows); +/** * Allocates zero'ed memory from the heap. *
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 32/51 net/bnxt: integrate with the latest tf core changes
In reply to Ajit KhapardeFrom: Kishore Padmanabha <[email protected]>
ULP changes to integrate with the latest session open interface in tf_core
--- drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +46 -0
@@ -68,6 +68,7 @@ ulp_ctx_session_open(struct bnxt *bp,struct rte_eth_dev *ethdev = bp->eth_dev;int32_t rc =0 ;struct tf_open_session_parms params; +struct tf_session_resources *resources;memset (¶ms,0 ,sizeof (params));
@@ -79,6 +80,51 @@ ulp_ctx_session_open(struct bnxt *bp,return rc; } + params.shadow_copy = false; + params.device_type =TF_DEVICE_TYPE_WH ; + resources = ¶ms.resources; +/** RX **/ +/* Identifiers */ + resources->ident_cnt[TF_DIR_RX ].cnt[TF_IDENT_TYPE_L2_CTXT ] =16 ; + resources->ident_cnt[TF_DIR_RX ].cnt[TF_IDENT_TYPE_WC_PROF ] =8 ; + resources->ident_cnt[TF_DIR_RX ].cnt[TF_IDENT_TYPE_PROF_FUNC ] =8 ; + resources->ident_cnt[TF_DIR_RX ].cnt[TF_IDENT_TYPE_EM_PROF ] =8 ; + +/* Table Types */ + resources->tbl_cnt[TF_DIR_RX ].cnt[TF_TBL_TYPE_FULL_ACT_RECORD ] =720 ; + resources->tbl_cnt[TF_DIR_RX ].cnt[TF_TBL_TYPE_ACT_STATS_64 ] =720 ; + +/* TCAMs */ + resources->tcam_cnt[TF_DIR_RX ].cnt[TF_TCAM_TBL_TYPE_L2_CTXT_TCAM ] =16 ; + resources->tcam_cnt[TF_DIR_RX ].cnt[TF_TCAM_TBL_TYPE_PROF_TCAM ] =8 ; + resources->tcam_cnt[TF_DIR_RX ].cnt[TF_TCAM_TBL_TYPE_WC_TCAM ] =416 ; + +/* EM */ + resources->em_cnt[TF_DIR_RX ].cnt[TF_EM_TBL_TYPE_EM_RECORD ] =2048 ; + +/** TX **/ +/* Identifiers */ + resources->ident_cnt[TF_DIR_TX ].cnt[TF_IDENT_TYPE_L2_CTXT ] =8 ; + resources->ident_cnt[TF_DIR_TX ].cnt[TF_IDENT_TYPE_WC_PROF ] =8 ; + resources->ident_cnt[TF_DIR_TX ].cnt[TF_IDENT_TYPE_PROF_FUNC ] =8 ; + resources->ident_cnt[TF_DIR_TX ].cnt[TF_IDENT_TYPE_EM_PROF ] =8 ; + +/* Table Types */ + resources->tbl_cnt[TF_DIR_TX ].cnt[TF_TBL_TYPE_FULL_ACT_RECORD ] =16 ; + resources->tbl_cnt[TF_DIR_TX ].cnt[TF_TBL_TYPE_ACT_STATS_64 ] =16 ; + +/* TCAMs */ + resources->tcam_cnt[TF_DIR_TX ].cnt[TF_TCAM_TBL_TYPE_L2_CTXT_TCAM ] =8 ; + resources->tcam_cnt[TF_DIR_TX ].cnt[TF_TCAM_TBL_TYPE_PROF_TCAM ] =8 ; + resources->tcam_cnt[TF_DIR_TX ].cnt[TF_TCAM_TBL_TYPE_WC_TCAM ] =8 ; + +/* EM */ + resources->em_cnt[TF_DIR_TX ].cnt[TF_EM_TBL_TYPE_EM_RECORD ] =8 ; + +/* EEM */ + resources->em_cnt[TF_DIR_RX ].cnt[TF_EM_TBL_TYPE_TBL_SCOPE ] =1 ; + resources->em_cnt[TF_DIR_TX ].cnt[TF_EM_TBL_TYPE_TBL_SCOPE ] =1 ; + rc =tf_open_session (&bp->tfp, ¶ms);if (rc) { BNXT_TF_DBG(ERR, "Failed to open TF session - %s, rc = %d\n",
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 33/51 net/bnxt: add support for internal encap records
In reply to Ajit KhapardeFrom: Mike Baucom <[email protected]>
Modifications to allow internal encap records to be supported:
- Modified the mapper index table processing to handle encap without an action record
- Modified the session open code to reserve some 64 Byte internal encap records on tx
- Modified the blob encap swap to support encap without action record
--- drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 3 +++ drivers/net/bnxt/tf_ulp/ulp_mapper.c | 29 +++++++++++++--------------- drivers/net/bnxt/tf_ulp/ulp_utils.c | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +3 -0
@@ -113,6 +113,9 @@ ulp_ctx_session_open(struct bnxt *bp, resources->tbl_cnt[TF_DIR_TX ].cnt[TF_TBL_TYPE_FULL_ACT_RECORD ] =16 ; resources->tbl_cnt[TF_DIR_TX ].cnt[TF_TBL_TYPE_ACT_STATS_64 ] =16 ; +/* ENCAP */ + resources->tbl_cnt[TF_DIR_TX ].cnt[TF_TBL_TYPE_ACT_ENCAP_64B ] =16 ; +/* TCAMs */ resources->tcam_cnt[TF_DIR_TX ].cnt[TF_TCAM_TBL_TYPE_L2_CTXT_TCAM ] =8 ; resources->tcam_cnt[TF_DIR_TX ].cnt[TF_TCAM_TBL_TYPE_PROF_TCAM ] =8 ;
drivers/net/bnxt/tf_ulp/ulp_mapper.c +13 -16
@@ -1473,7 +1473,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms, flds =ulp_mapper_act_result_fields_get (tbl, &num_flds, &encap_flds); -if (!flds || !num_flds) { +if (!flds || (!num_flds && !encap_flds)) {BNXT_TF_DBG (ERR ,"template undefined for the index table\n" );return -EINVAL ; }
@@ -1482,7 +1482,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,for (i =0 ; i < (num_flds + encap_flds); i++) {/* set the swap index if encap swap bit is enabled */ if (parms->device_params->encap_byte_swap && encap_flds && - ((i +1 ) == num_flds)) + (i == num_flds))ulp_blob_encap_swap_idx_set (&data);/* Process the result fields */
@@ -1495,18 +1495,15 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,BNXT_TF_DBG (ERR ,"data field failed\n" );return rc; } + } -/* if encap bit swap is enabled perform the bit swap */ -if (parms->device_params->encap_byte_swap && encap_flds) { -if ((i +1 ) == (num_flds + encap_flds)) -ulp_blob_perform_encap_swap (&data); +/* if encap bit swap is enabled perform the bit swap */ +if (parms->device_params->encap_byte_swap && encap_flds) { +ulp_blob_perform_encap_swap (&data);#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -if ((i +1 ) == (num_flds + encap_flds)) { -BNXT_TF_DBG (INFO ,"Dump fter encap swap\n" ); -ulp_mapper_blob_dump (&data); - } +BNXT_TF_DBG (INFO ,"Dump after encap swap\n" ); +ulp_mapper_blob_dump (&data);#endif - } }/* Perform the tf table allocation by filling the alloc params */
@@ -1817,6 +1814,11 @@ ulp_mapper_action_tbls_process(struct bnxt_ulp_mapper_parms *parms)switch (tbl->resource_func) {case BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE : rc =ulp_mapper_index_tbl_process (parms, tbl, false); +if (rc) { +BNXT_TF_DBG (ERR ,"Resource type %d failed\n" , + tbl->resource_func); +return rc; + }break ;default : BNXT_TF_DBG(ERR, "Unexpected action resource %d\n",
@@ -1824,11 +1826,6 @@ ulp_mapper_action_tbls_process(struct bnxt_ulp_mapper_parms *parms)return -EINVAL ; } } -if (rc) { -BNXT_TF_DBG (ERR ,"Resource type %d failed\n" , - tbl->resource_func); -return rc; - }return rc; }
drivers/net/bnxt/tf_ulp/ulp_utils.c +1 -1
@@ -478,7 +478,7 @@ ulp_blob_perform_encap_swap(struct ulp_blob *blob)BNXT_TF_DBG (ERR ,"invalid argument\n" );return ;/* failure */ } - idx =ULP_BITS_2_BYTE_NR (blob->encap_swap_idx +1 ); + idx =ULP_BITS_2_BYTE_NR (blob->encap_swap_idx); end_idx =ULP_BITS_2_BYTE (blob->write_idx);while (idx <= end_idx) {
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 34/51 net/bnxt: add support for if table processing
In reply to Ajit KhapardeFrom: Kishore Padmanabha <[email protected]>
Added support for if table processing in the ulp mapper layer. This enables support for the default partition action record pointer interface table.
--- drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 1 + drivers/net/bnxt/tf_ulp/ulp_flow_db.c | 2 +- drivers/net/bnxt/tf_ulp/ulp_mapper.c | 141 +++++++++++++++--- drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c | 1 + .../net/bnxt/tf_ulp/ulp_template_db_enum.h | 117 ++++++++------- drivers/net/bnxt/tf_ulp/ulp_template_struct.h | 8 +- 6 files changed, 187 insertions(+), 83 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +1 -0
@@ -115,6 +115,7 @@ ulp_ctx_session_open(struct bnxt *bp,/* ENCAP */ resources->tbl_cnt[TF_DIR_TX ].cnt[TF_TBL_TYPE_ACT_ENCAP_64B ] =16 ; + resources->tbl_cnt[TF_DIR_TX ].cnt[TF_TBL_TYPE_ACT_ENCAP_16B ] =16 ;/* TCAMs */ resources->tcam_cnt[TF_DIR_TX ].cnt[TF_TCAM_TBL_TYPE_L2_CTXT_TCAM ] =8 ;
drivers/net/bnxt/tf_ulp/ulp_flow_db.c +1 -1
@@ -933,7 +933,7 @@ ulp_default_flow_db_cfa_action_get(struct bnxt_ulp_context *ulp_ctx,uint32_t flow_id, uint32_t *cfa_action) { - uint8_t sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_VFR_ACT_IDX; + uint8_t sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_VFR_CFA_ACTION;uint64_t hndl;int32_t rc;
drivers/net/bnxt/tf_ulp/ulp_mapper.c +118 -23
243 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c +1 -0
@@ -256,6 +256,7 @@ ulp_mark_db_mark_add(struct bnxt_ulp_context *ctxt,BNXT_TF_DBG (ERR ,"Mark index greater than allocated\n" );return -EINVAL ; } +BNXT_TF_DBG (DEBUG ,"Set LFID[0x%0x] = 0x%0x\n" , fid, mark); mtbl->lfid_tbl[fid].mark_id = mark;ULP_MARK_DB_ENTRY_SET_VALID (&mtbl->lfid_tbl[fid]); }
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +61 -56
170 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/ulp_template_struct.h +5 -3
@@ -150,9 +150,10 @@ struct bnxt_ulp_device_params {/* Flow Mapper */ struct bnxt_ulp_mapper_tbl_list_info { -uint32_t device_name; -uint32_t start_tbl_idx; -uint32_t num_tbls; +uint32_t device_name; +uint32_t start_tbl_idx; +uint32_t num_tbls; +enum bnxt_ulp_fdb_type flow_db_table_type; };struct bnxt_ulp_mapper_tbl_info {
@@ -183,6 +184,7 @@ struct bnxt_ulp_mapper_tbl_info {enum bnxt_ulp_regfile_index regfile_idx;enum bnxt_ulp_mark_db_opcode mark_db_opcode; +uint32_t comp_field_idx; };struct bnxt_ulp_mapper_class_key_field_info {
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 35/51 net/bnxt: disable Tx vector mode if truflow is enabled
In reply to Ajit KhapardeFrom: Kishore Padmanabha <[email protected]>
The vector mode in the tx handler is disabled when truflow is enabled since truflow now requires bd action record support.
--- drivers/net/bnxt/bnxt_ethdev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/bnxt/bnxt_ethdev.c +4 -1
@@ -1116,12 +1116,15 @@ bnxt_transmit_function(__rte_unused struct rte_eth_dev *eth_dev) { #ifdef RTE_ARCH_X86 #ifndef RTE_LIBRTE_IEEE1588 + struct bnxt *bp = eth_dev->data->dev_private; + /* * Vector mode transmit can be enabled only if not using scatter rx * or tx offloads. */ if (!eth_dev->data->scattered_rx && - !eth_dev->data->dev_conf.txmode.offloads) { + !eth_dev->data->dev_conf.txmode.offloads && + !BNXT_TRUFLOW_EN(bp)) { PMD_DRV_LOG(INFO, "Using vector mode transmit for port %d\n", eth_dev->data->port_id); return bnxt_xmit_pkts_vec;
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 36/51 net/bnxt: add index opcode and operand to mapper table
In reply to Ajit KhapardeFrom: Kishore Padmanabha <[email protected]>
Extended the regfile and computed field operations to a common index opcode operation and added globlal resource operations are also part of the index opcode operation.
--- drivers/net/bnxt/tf_ulp/ulp_mapper.c | 56 ++++++++++++++++--- drivers/net/bnxt/tf_ulp/ulp_template_db_act.c | 9 ++- .../net/bnxt/tf_ulp/ulp_template_db_class.c | 45 +++++---------- .../net/bnxt/tf_ulp/ulp_template_db_enum.h | 8 +++ drivers/net/bnxt/tf_ulp/ulp_template_struct.h | 4 +- 5 files changed, 80 insertions(+), 42 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +49 -7
@@ -1443,7 +1443,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,struct bnxt_ulp_mapper_result_field_info *flds;struct ulp_flow_db_res_params fid_parms;struct ulp_blob data; -uint64_t idx; +uint64_t idx =0 ;uint16_t tmplen;uint32_t i, num_flds;int32_t rc =0 , trc =0 ;
@@ -1516,6 +1516,42 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,#endif } +/* +* Check for index opcode, if it is Global then +* no need to allocate the table, just set the table +* and exit since it is not maintained in the flow db. +*/ +if (tbl->index_opcode ==BNXT_ULP_INDEX_OPCODE_GLOBAL ) { +/* get the index from index operand */ +if (tbl->index_operand <BNXT_ULP_GLB_REGFILE_INDEX_LAST && +ulp_mapper_glb_resource_read (parms->mapper_data, + tbl->direction, + tbl->index_operand, + &idx)) { +BNXT_TF_DBG (ERR ,"Glbl regfile[%d] read failed.\n" , + tbl->index_operand); +return -EINVAL ; + } +/* set the Tf index table */ + sparms.dir = tbl->direction; + sparms.type = tbl->resource_type; + sparms.data =ulp_blob_data_get (&data, &tmplen); + sparms.data_sz_in_bytes =ULP_BITS_2_BYTE (tmplen); + sparms.idx =tfp_be_to_cpu_64 (idx); + sparms.tbl_scope_id = tbl_scope_id; + + rc =tf_set_tbl_entry (tfp, &sparms); +if (rc) { +BNXT_TF_DBG (ERR , +"Glbl Set table[%d][%s][%d] failed rc=%d\n" , + sparms.type, + (sparms.dir ==TF_DIR_RX ) ?"RX" :"TX" , + sparms.idx, + rc); +return rc; + } +return 0 ;/* success */ + }/* Perform the tf table allocation by filling the alloc params */ aparms.dir = tbl->direction; aparms.type = tbl->resource_type;
@@ -1546,11 +1582,13 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,/* Always storing values in Regfile in BE */ idx =tfp_cpu_to_be_64 (idx); - rc =ulp_regfile_write (parms->regfile, tbl->regfile_idx, idx); -if (!rc) { -BNXT_TF_DBG (ERR ,"Write regfile[%d] failed\n" , - tbl->regfile_idx); - goto error; +if (tbl->index_opcode ==BNXT_ULP_INDEX_OPCODE_ALLOCATE ) { + rc =ulp_regfile_write (parms->regfile, tbl->index_operand, idx); +if (!rc) { +BNXT_TF_DBG (ERR ,"Write regfile[%d] failed\n" , + tbl->index_operand); + goto error; + } }/* Perform the tf table set by filling the set params */
@@ -1815,7 +1853,11 @@ ulp_mapper_if_tbl_process(struct bnxt_ulp_mapper_parms *parms, }/* Get the index details from computed field */ - idx =ULP_COMP_FLD_IDX_RD (parms, tbl->comp_field_idx); +if (tbl->index_opcode !=BNXT_ULP_INDEX_OPCODE_COMP_FIELD ) { +BNXT_TF_DBG (ERR ,"Invalid tbl index opcode\n" ); +return -EINVAL ; + } + idx =ULP_COMP_FLD_IDX_RD (parms, tbl->index_operand);/* Perform the tf table set by filling the set params */ iftbl_params.dir = tbl->direction;
drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +6 -3
@@ -76,7 +76,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[] = { .result_bit_size = 128, .result_num_fields = 26, .encap_num_fields = 0, - .regfile_idx = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR, + .index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE, + .index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR, .mark_db_opcode =BNXT_ULP_MARK_DB_OPCODE_NOP }, {
@@ -90,7 +91,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[] = { .result_bit_size = 128, .result_num_fields = 26, .encap_num_fields = 0, - .regfile_idx = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR, + .index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE, + .index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR, .mark_db_opcode =BNXT_ULP_MARK_DB_OPCODE_NOP }, {
@@ -104,7 +106,8 @@ struct bnxt_ulp_mapper_tbl_info ulp_act_tbl_list[] = { .result_bit_size = 128, .result_num_fields = 26, .encap_num_fields = 12, - .regfile_idx = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR, + .index_opcode = BNXT_ULP_INDEX_OPCODE_ALLOCATE, + .index_operand = BNXT_ULP_REGFILE_INDEX_MAIN_ACTION_PTR, .mark_db_opcode = BNXT_ULP_MARK_DB_OPCODE_NOP } };
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +15 -30
135 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +8 -0
@@ -161,6 +161,14 @@ enum bnxt_ulp_hdr_type {BNXT_ULP_HDR_TYPE_LAST =3 }; +enum bnxt_ulp_index_opcode { +BNXT_ULP_INDEX_OPCODE_NOT_USED =0 , +BNXT_ULP_INDEX_OPCODE_ALLOCATE =1 , +BNXT_ULP_INDEX_OPCODE_GLOBAL =2 , +BNXT_ULP_INDEX_OPCODE_COMP_FIELD =3 , +BNXT_ULP_INDEX_OPCODE_LAST =4 +}; +enum bnxt_ulp_mapper_opc {BNXT_ULP_MAPPER_OPC_SET_TO_CONSTANT =0 ,BNXT_ULP_MAPPER_OPC_SET_TO_HDR_FIELD =1 ,
drivers/net/bnxt/tf_ulp/ulp_template_struct.h +2 -2
@@ -182,9 +182,9 @@ struct bnxt_ulp_mapper_tbl_info {uint32_t ident_start_idx;uint16_t ident_nums; -enum bnxt_ulp_regfile_index regfile_idx;enum bnxt_ulp_mark_db_opcode mark_db_opcode; -uint32_t comp_field_idx; +enum bnxt_ulp_index_opcode index_opcode; +uint32_t index_operand; };struct bnxt_ulp_mapper_class_key_field_info {
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 37/51 net/bnxt: add support for global resource templates
In reply to Ajit KhapardeFrom: Kishore Padmanabha <[email protected]>
Added support for the global resource templates, so that they can be reused by the other regular templates.
--- drivers/net/bnxt/tf_ulp/ulp_mapper.c | 178 +++++++++++++++++- .../net/bnxt/tf_ulp/ulp_template_db_enum.h | 1 + drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c | 3 + drivers/net/bnxt/tf_ulp/ulp_template_struct.h | 6 + 4 files changed, 181 insertions(+), 7 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +171 -7
@@ -80,15 +80,20 @@ ulp_mapper_glb_resource_write(struct bnxt_ulp_mapper_data *data,* returns 0 on success */ static int32_t -ulp_mapper_resource_ident_allocate (struct tf *tfp, +ulp_mapper_resource_ident_allocate (struct bnxt_ulp_context *ulp_ctx,struct bnxt_ulp_mapper_data *mapper_data,struct bnxt_ulp_glb_resource_info *glb_res) {struct tf_alloc_identifier_parms iparms = {0 };struct tf_free_identifier_parms fparms;uint64_t regval; +struct tf *tfp;int32_t rc =0 ; + tfp =bnxt_ulp_cntxt_tfp_get (ulp_ctx); +if (!tfp) +return -EINVAL ; + iparms.ident_type = glb_res->resource_type; iparms.dir = glb_res->direction;
@@ -115,13 +120,76 @@ ulp_mapper_resource_ident_allocate(struct tf *tfp,return rc; }#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -BNXT_TF_DBG (DEBUG ,"Allocated Glb Res[%s][%d][%d] = 0x%04x\n" , +BNXT_TF_DBG (DEBUG ,"Allocated Glb Res Ident [%s][%d][%d] = 0x%04x\n" , (iparms.dir ==TF_DIR_RX ) ?"RX" :"TX" , glb_res->glb_regfile_index, iparms.ident_type, iparms.id);#endif return rc; } +/* +* Internal function to allocate index tbl resource and store it in mapper data. +* +* returns 0 on success +*/ +static int32_t +ulp_mapper_resource_index_tbl_alloc (struct bnxt_ulp_context *ulp_ctx, +struct bnxt_ulp_mapper_data *mapper_data, +struct bnxt_ulp_glb_resource_info *glb_res) +{ +struct tf_alloc_tbl_entry_parms aparms = {0 }; +struct tf_free_tbl_entry_parms free_parms = {0 }; +uint64_t regval; +struct tf *tfp; +uint32_t tbl_scope_id; +int32_t rc =0 ; + + tfp =bnxt_ulp_cntxt_tfp_get (ulp_ctx); +if (!tfp) +return -EINVAL ; + +/* Get the scope id */ + rc =bnxt_ulp_cntxt_tbl_scope_id_get (ulp_ctx, &tbl_scope_id); +if (rc) { +BNXT_TF_DBG (ERR ,"Failed to get table scope rc=%d\n" , rc); +return rc; + } + + aparms.type = glb_res->resource_type; + aparms.dir = glb_res->direction; + aparms.search_enable =BNXT_ULP_SEARCH_BEFORE_ALLOC_NO ; + aparms.tbl_scope_id = tbl_scope_id; + +/* Allocate the index tbl using tf api */ + rc =tf_alloc_tbl_entry (tfp, &aparms); +if (rc) { +BNXT_TF_DBG (ERR ,"Failed to alloc identifier [%s][%d]\n" , + (aparms.dir ==TF_DIR_RX ) ?"RX" :"TX" , + aparms.type); +return rc; + } + +/* entries are stored as big-endian format */ + regval =tfp_cpu_to_be_64 ((uint64_t )aparms.idx); +/* write to the mapper global resource */ + rc =ulp_mapper_glb_resource_write (mapper_data, glb_res, regval); +if (rc) { +BNXT_TF_DBG (ERR ,"Failed to write to global resource id\n" ); +/* Free the identifer when update failed */ + free_parms.dir = aparms.dir; + free_parms.type = aparms.type; + free_parms.idx = aparms.idx; +tf_free_tbl_entry (tfp, &free_parms); +return rc; + } +#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG +BNXT_TF_DBG (DEBUG ,"Allocated Glb Res Index [%s][%d][%d] = 0x%04x\n" , + (aparms.dir ==TF_DIR_RX ) ?"RX" :"TX" , + glb_res->glb_regfile_index, aparms.type, aparms.idx); +#endif +return rc; +} +/* Retrieve the cache initialization parameters for the tbl_idx */ static struct bnxt_ulp_cache_tbl_params *ulp_mapper_cache_tbl_params_get (uint32_t tbl_idx)
@@ -132,6 +200,16 @@ ulp_mapper_cache_tbl_params_get(uint32_t tbl_idx)return &ulp_cache_tbl_params[tbl_idx]; } +/* Retrieve the global template table */ +static uint32_t * +ulp_mapper_glb_template_table_get (uint32_t *num_entries) +{ +if (!num_entries) +return NULL ; + *num_entries =BNXT_ULP_GLB_TEMPLATE_TBL_MAX_SZ ; +return ulp_glb_template_tbl; +} +/* * Get the size of the action property for a given index. *
@@ -659,7 +737,10 @@ ulp_mapper_result_field_process(struct bnxt_ulp_mapper_parms *parms,return -EINVAL ; } act_bit =tfp_be_to_cpu_64 (act_bit); - act_val =ULP_BITMAP_ISSET (parms->act_bitmap->bits, act_bit); +if (ULP_BITMAP_ISSET (parms->act_bitmap->bits, act_bit)) + act_val =1 ; +else + act_val =0 ;if (fld->field_bit_size >ULP_BYTE_2_BITS (sizeof (act_val))) {BNXT_TF_DBG (ERR ,"%s field size is incorrect\n" , name);return -EINVAL ;
@@ -1552,6 +1633,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms, }return 0 ;/* success */ } +/* Perform the tf table allocation by filling the alloc params */ aparms.dir = tbl->direction; aparms.type = tbl->resource_type;
@@ -1616,6 +1698,7 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms, fid_parms.direction = tbl->direction; fid_parms.resource_func = tbl->resource_func; fid_parms.resource_type = tbl->resource_type; + fid_parms.resource_sub_type = tbl->resource_sub_type; fid_parms.resource_hndl = aparms.idx; fid_parms.critical_resource =BNXT_ULP_CRITICAL_RESOURCE_NO ;
@@ -1884,7 +1967,7 @@ ulp_mapper_if_tbl_process(struct bnxt_ulp_mapper_parms *parms, }static int32_t -ulp_mapper_glb_resource_info_init (struct tf *tfp, +ulp_mapper_glb_resource_info_init (struct bnxt_ulp_context *ulp_ctx,struct bnxt_ulp_mapper_data *mapper_data) {struct bnxt_ulp_glb_resource_info *glb_res;
@@ -1901,15 +1984,23 @@ ulp_mapper_glb_resource_info_init(struct tf *tfp,for (idx =0 ; idx < num_glb_res_ids; idx++) {switch (glb_res[idx].resource_func) {case BNXT_ULP_RESOURCE_FUNC_IDENTIFIER : - rc =ulp_mapper_resource_ident_allocate (tfp, + rc =ulp_mapper_resource_ident_allocate (ulp_ctx, mapper_data, &glb_res[idx]);break ; +case BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE : + rc =ulp_mapper_resource_index_tbl_alloc (ulp_ctx, + mapper_data, + &glb_res[idx]); +break ;default :BNXT_TF_DBG (ERR ,"Global resource %x not supported\n" , glb_res[idx].resource_func); + rc = -EINVAL ;break ; } +if (rc) +return rc; }return rc; }
@@ -2125,7 +2216,9 @@ ulp_mapper_glb_resource_info_deinit(struct bnxt_ulp_context *ulp_ctx, res.resource_func = ent->resource_func; res.direction = dir; res.resource_type = ent->resource_type; - res.resource_hndl = ent->resource_hndl; +/*convert it from BE to cpu */ + res.resource_hndl = +tfp_be_to_cpu_64 (ent->resource_hndl);ulp_mapper_resource_free (ulp_ctx, &res); } }
@@ -2144,6 +2237,71 @@ ulp_mapper_flow_destroy(struct bnxt_ulp_context *ulp_ctx, uint32_t fid) BNXT_ULP_REGULAR_FLOW_TABLE); } +/* Function to handle the default global templates that are allocated during +* the startup and reused later. +*/ +static int32_t +ulp_mapper_glb_template_table_init (struct bnxt_ulp_context *ulp_ctx) +{ +uint32_t *glbl_tmpl_list; +uint32_t num_glb_tmpls, idx, dev_id; +struct bnxt_ulp_mapper_parms parms; +struct bnxt_ulp_mapper_data *mapper_data; +int32_t rc =0 ; + + glbl_tmpl_list =ulp_mapper_glb_template_table_get (&num_glb_tmpls); +if (!glbl_tmpl_list || !num_glb_tmpls) +return rc;/* No global templates to process */ + +/* Get the device id from the ulp context */ +if (bnxt_ulp_cntxt_dev_id_get (ulp_ctx, &dev_id)) { +BNXT_TF_DBG (ERR ,"Invalid ulp context\n" ); +return -EINVAL ; + } + + mapper_data =bnxt_ulp_cntxt_ptr2_mapper_data_get (ulp_ctx); +if (!mapper_data) { +BNXT_TF_DBG (ERR ,"Failed to get the ulp mapper data\n" ); +return -EINVAL ; + } + +/* Iterate the global resources and process each one */ +for (idx =0 ; idx < num_glb_tmpls; idx++) { +/* Initialize the parms structure */ +memset (&parms,0 ,sizeof (parms)); + parms.tfp =bnxt_ulp_cntxt_tfp_get (ulp_ctx); + parms.ulp_ctx = ulp_ctx; + parms.dev_id = dev_id; + parms.mapper_data = mapper_data; + +/* Get the class table entry from dev id and class id */ + parms.class_tid = glbl_tmpl_list[idx]; + parms.ctbls =ulp_mapper_class_tbl_list_get (parms.dev_id, + parms.class_tid, + &parms.num_ctbls, + &parms.tbl_idx); +if (!parms.ctbls || !parms.num_ctbls) { +BNXT_TF_DBG (ERR ,"No class tables for %d:%d\n" , + parms.dev_id, parms.class_tid); +return -EINVAL ; + } + parms.device_params =bnxt_ulp_device_params_get (parms.dev_id); +if (!parms.device_params) { +BNXT_TF_DBG (ERR ,"No class tables for %d:%d\n" , + parms.dev_id, parms.class_tid); +return -EINVAL ; + } + rc =ulp_mapper_class_tbls_process (&parms); +if (rc) { +BNXT_TF_DBG (ERR , +"class tables failed creation for %d:%d\n" , + parms.dev_id, parms.class_tid); +return rc; + } + } +return rc; +} +/* Function to handle the mapping of the Flow to be compatible * with the underlying hardware. */
@@ -2316,7 +2474,7 @@ ulp_mapper_init(struct bnxt_ulp_context *ulp_ctx) }/* Allocate the global resource ids */ - rc =ulp_mapper_glb_resource_info_init (tfp, data); + rc =ulp_mapper_glb_resource_info_init (ulp_ctx, data);if (rc) {BNXT_TF_DBG (ERR ,"Failed to initialize global resource ids\n" ); goto error;
@@ -2344,6 +2502,12 @@ ulp_mapper_init(struct bnxt_ulp_context *ulp_ctx) } } + rc =ulp_mapper_glb_template_table_init (ulp_ctx); +if (rc) { +BNXT_TF_DBG (ERR ,"Failed to initialize global templates\n" ); + goto error; + } +return 0 ; error:/* Ignore the return code in favor of returning the original error. */
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +1 -0
@@ -26,6 +26,7 @@#define BNXT_ULP_ACT_HID_MASK 255#define BNXT_ULP_CACHE_TBL_IDENT_MAX_NUM 2#define BNXT_ULP_GLB_RESOURCE_INFO_TBL_MAX_SZ 3 +#define BNXT_ULP_GLB_TEMPLATE_TBL_MAX_SZ 0enum bnxt_ulp_action_bit {BNXT_ULP_ACTION_BIT_MARK =0x0000000000000001 ,
drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +3 -0
@@ -546,3 +546,6 @@ uint32_t bnxt_ulp_encap_vtag_map[] = { [1] = BNXT_ULP_SYM_ECV_VTAG_TYPE_ADD_1_ENCAP_PRI, [2] = BNXT_ULP_SYM_ECV_VTAG_TYPE_ADD_2_ENCAP_PRI }; + +uint32_t ulp_glb_template_tbl[] = { +};
drivers/net/bnxt/tf_ulp/ulp_template_struct.h +6 -0
@@ -299,4 +299,10 @@ extern struct bnxt_ulp_glb_resource_info ulp_glb_resource_tbl[];*/ extern struct bnxt_ulp_cache_tbl_params ulp_cache_tbl_params[]; +/* +* The ulp_global template table is used to initialize default entries +* that could be reused by other templates. +*/ +extern uint32_t ulp_glb_template_tbl[]; +#endif /* _ULP_TEMPLATE_STRUCT_H_ */
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 38/51 net/bnxt: add support for internal exact match entries
In reply to Ajit KhapardeFrom: Kishore Padmanabha <[email protected]>
Added support for the internal exact match entries.
--- drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 38 +++++++++++++++++++ drivers/net/bnxt/tf_ulp/ulp_flow_db.c | 13 +++++-- drivers/net/bnxt/tf_ulp/ulp_mapper.c | 21 ++++++---- drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c | 4 ++ .../net/bnxt/tf_ulp/ulp_template_db_class.c | 6 +-- .../net/bnxt/tf_ulp/ulp_template_db_enum.h | 13 ++++--- drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c | 7 +++- drivers/net/bnxt/tf_ulp/ulp_template_struct.h | 5 +++ 8 files changed, 85 insertions(+), 22 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +38 -0
@@ -213,8 +213,27 @@ static int32_t ulp_eem_tbl_scope_init(struct bnxt *bp) {struct tf_alloc_tbl_scope_parms params = {0 }; +uint32_t dev_id; +struct bnxt_ulp_device_params *dparms;int rc; +/* Get the dev specific number of flows that needed to be supported. */ +if (bnxt_ulp_cntxt_dev_id_get (bp->ulp_ctx, &dev_id)) { +BNXT_TF_DBG (ERR ,"Invalid device id\n" ); +return -EINVAL ; + } + + dparms =bnxt_ulp_device_params_get (dev_id); +if (!dparms) { +BNXT_TF_DBG (ERR ,"could not fetch the device params\n" ); +return -ENODEV ; + } + +if (dparms->flow_mem_type !=BNXT_ULP_FLOW_MEM_TYPE_EXT ) { +BNXT_TF_DBG (INFO ,"Table Scope alloc is not required\n" ); +return 0 ; + } +bnxt_init_tbl_scope_parms (bp, ¶ms); rc =tf_alloc_tbl_scope (&bp->tfp, ¶ms);
@@ -240,6 +259,8 @@ ulp_eem_tbl_scope_deinit(struct bnxt *bp, struct bnxt_ulp_context *ulp_ctx)struct tf_free_tbl_scope_parms params = {0 };struct tf *tfp;int32_t rc =0 ; +struct bnxt_ulp_device_params *dparms; +uint32_t dev_id;if (!ulp_ctx || !ulp_ctx->cfg_data)return -EINVAL ;
@@ -254,6 +275,23 @@ ulp_eem_tbl_scope_deinit(struct bnxt *bp, struct bnxt_ulp_context *ulp_ctx)return -EINVAL ; } +/* Get the dev specific number of flows that needed to be supported. */ +if (bnxt_ulp_cntxt_dev_id_get (bp->ulp_ctx, &dev_id)) { +BNXT_TF_DBG (ERR ,"Invalid device id\n" ); +return -EINVAL ; + } + + dparms =bnxt_ulp_device_params_get (dev_id); +if (!dparms) { +BNXT_TF_DBG (ERR ,"could not fetch the device params\n" ); +return -ENODEV ; + } + +if (dparms->flow_mem_type !=BNXT_ULP_FLOW_MEM_TYPE_EXT ) { +BNXT_TF_DBG (INFO ,"Table Scope free is not required\n" ); +return 0 ; + } + rc =bnxt_ulp_cntxt_tbl_scope_id_get (ulp_ctx, ¶ms.tbl_scope_id);if (rc) {BNXT_TF_DBG (ERR ,"Failed to get the table scope id\n" );
drivers/net/bnxt/tf_ulp/ulp_flow_db.c +9 -4
@@ -114,7 +114,8 @@ ulp_flow_db_res_params_to_info(struct ulp_fdb_resource_info *resource_info, }/* Store the handle as 64bit only for EM table entries */ -if (params->resource_func !=BNXT_ULP_RESOURCE_FUNC_EM_TABLE ) { +if (params->resource_func !=BNXT_ULP_RESOURCE_FUNC_EXT_EM_TABLE && + params->resource_func !=BNXT_ULP_RESOURCE_FUNC_INT_EM_TABLE ) { resource_info->resource_hndl = (uint32_t )params->resource_hndl; resource_info->resource_type = params->resource_type; resource_info->resource_sub_type = params->resource_sub_type;
@@ -145,7 +146,8 @@ ulp_flow_db_res_info_to_params(struct ulp_fdb_resource_info *resource_info,/* use the helper function to get the resource func */ params->resource_func =ulp_flow_db_resource_func_get (resource_info); -if (params->resource_func ==BNXT_ULP_RESOURCE_FUNC_EM_TABLE ) { +if (params->resource_func ==BNXT_ULP_RESOURCE_FUNC_EXT_EM_TABLE || + params->resource_func ==BNXT_ULP_RESOURCE_FUNC_INT_EM_TABLE ) { params->resource_hndl = resource_info->resource_em_handle; }else if (params->resource_func &ULP_FLOW_DB_RES_FUNC_NEED_LOWER ) { params->resource_hndl = resource_info->resource_hndl;
@@ -908,7 +910,9 @@ ulp_flow_db_resource_hndl_get(struct bnxt_ulp_context *ulp_ctx, } }else if (resource_func == -BNXT_ULP_RESOURCE_FUNC_EM_TABLE ){ +BNXT_ULP_RESOURCE_FUNC_EXT_EM_TABLE || + resource_func == +BNXT_ULP_RESOURCE_FUNC_INT_EM_TABLE ) { *res_hndl = fid_res->resource_em_handle;return 0 ; }
@@ -966,7 +970,8 @@ static void ulp_flow_db_res_dump(struct ulp_fdb_resource_info *r,BNXT_TF_DBG (DEBUG ,"Resource func = %x, nxt_resource_idx = %x\n" , res_func, (ULP_FLOW_DB_RES_NXT_MASK & r->nxt_resource_idx)); -if (res_func ==BNXT_ULP_RESOURCE_FUNC_EM_TABLE ) +if (res_func ==BNXT_ULP_RESOURCE_FUNC_EXT_EM_TABLE || + res_func ==BNXT_ULP_RESOURCE_FUNC_INT_EM_TABLE )BNXT_TF_DBG (DEBUG ,"EM Handle = 0x%016" PRIX64 "\n" , r->resource_em_handle);else
drivers/net/bnxt/tf_ulp/ulp_mapper.c +13 -8
@@ -556,15 +556,18 @@ ulp_mapper_index_entry_free(struct bnxt_ulp_context *ulp, }static inline int32_t -ulp_mapper_eem_entry_free (struct bnxt_ulp_context *ulp, -struct tf *tfp, -struct ulp_flow_db_res_params *res) +ulp_mapper_em_entry_free (struct bnxt_ulp_context *ulp, +struct tf *tfp, +struct ulp_flow_db_res_params *res) {struct tf_delete_em_entry_parms fparms = {0 };int32_t rc; fparms.dir = res->direction; - fparms.mem =TF_MEM_EXTERNAL ; +if (res->resource_func ==BNXT_ULP_RESOURCE_FUNC_EXT_EM_TABLE ) + fparms.mem =TF_MEM_EXTERNAL ; +else + fparms.mem =TF_MEM_INTERNAL ; fparms.flow_handle = res->resource_hndl; rc =bnxt_ulp_cntxt_tbl_scope_id_get (ulp, &fparms.tbl_scope_id);
@@ -1443,7 +1446,7 @@ ulp_mapper_em_tbl_process(struct bnxt_ulp_mapper_parms *parms,#endif /* do the transpose for the internal EM keys */ -if (tbl->resource_type ==TF_MEM_INTERNAL ) +if (tbl->resource_func ==BNXT_ULP_RESOURCE_FUNC_INT_EM_TABLE )ulp_blob_perform_byte_reverse (&key); rc = bnxt_ulp_cntxt_tbl_scope_id_get(parms->ulp_ctx,
@@ -2066,7 +2069,8 @@ ulp_mapper_class_tbls_process(struct bnxt_ulp_mapper_parms *parms)case BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE : rc =ulp_mapper_tcam_tbl_process (parms, tbl);break ; -case BNXT_ULP_RESOURCE_FUNC_EM_TABLE : +case BNXT_ULP_RESOURCE_FUNC_EXT_EM_TABLE : +case BNXT_ULP_RESOURCE_FUNC_INT_EM_TABLE : rc =ulp_mapper_em_tbl_process (parms, tbl);break ;case BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE :
@@ -2119,8 +2123,9 @@ ulp_mapper_resource_free(struct bnxt_ulp_context *ulp,case BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE : rc =ulp_mapper_tcam_entry_free (ulp, tfp, res);break ; -case BNXT_ULP_RESOURCE_FUNC_EM_TABLE : - rc =ulp_mapper_eem_entry_free (ulp, tfp, res); +case BNXT_ULP_RESOURCE_FUNC_EXT_EM_TABLE : +case BNXT_ULP_RESOURCE_FUNC_INT_EM_TABLE : + rc =ulp_mapper_em_entry_free (ulp, tfp, res);break ;case BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE : rc =ulp_mapper_index_entry_free (ulp, tfp, res);
drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c +4 -0
@@ -87,6 +87,9 @@ ulp_mark_db_init(struct bnxt_ulp_context *ctxt)/* Need to allocate 2 * Num flows to account for hash type bit */ mark_tbl->gfid_num_entries = dparms->mark_db_gfid_entries; +if (!mark_tbl->gfid_num_entries) + goto gfid_not_required; + mark_tbl->gfid_tbl = rte_zmalloc("ulp_rx_eem_flow_mark_table", mark_tbl->gfid_num_entries * sizeof(struct bnxt_gfid_mark_info),
@@ -109,6 +112,7 @@ ulp_mark_db_init(struct bnxt_ulp_context *ctxt) mark_tbl->gfid_num_entries -1 , mark_tbl->gfid_mask); +gfid_not_required:/* Add the mark tbl to the ulp context. */ bnxt_ulp_cntxt_ptr2_mark_db_set (ctxt, mark_tbl);return 0 ;
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +3 -3
@@ -179,7 +179,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = { .critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO }, { - .resource_func = BNXT_ULP_RESOURCE_FUNC_EM_TABLE, + .resource_func = BNXT_ULP_RESOURCE_FUNC_EXT_EM_TABLE, .resource_type = TF_MEM_EXTERNAL, .resource_sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_NOT_USED,
@@ -284,7 +284,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = { .critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO }, { - .resource_func = BNXT_ULP_RESOURCE_FUNC_EM_TABLE, + .resource_func = BNXT_ULP_RESOURCE_FUNC_EXT_EM_TABLE, .resource_type = TF_MEM_EXTERNAL, .resource_sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_NOT_USED,
@@ -389,7 +389,7 @@ struct bnxt_ulp_mapper_tbl_info ulp_class_tbl_list[] = { .critical_resource = BNXT_ULP_CRITICAL_RESOURCE_NO }, { - .resource_func = BNXT_ULP_RESOURCE_FUNC_EM_TABLE, + .resource_func = BNXT_ULP_RESOURCE_FUNC_EXT_EM_TABLE, .resource_type = TF_MEM_EXTERNAL, .resource_sub_type = BNXT_ULP_RESOURCE_SUB_TYPE_NOT_USED,
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +7 -6
@@ -149,10 +149,11 @@ enum bnxt_ulp_flow_mem_type { };enum bnxt_ulp_glb_regfile_index { -BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID =0 , -BNXT_ULP_GLB_REGFILE_INDEX_GLB_L2_CNTXT_ID =1 , -BNXT_ULP_GLB_REGFILE_INDEX_GLB_LOOPBACK_AREC_INDEX =2 , -BNXT_ULP_GLB_REGFILE_INDEX_LAST =3 +BNXT_ULP_GLB_REGFILE_INDEX_NOT_USED =0 , +BNXT_ULP_GLB_REGFILE_INDEX_GLB_PROF_FUNC_ID =1 , +BNXT_ULP_GLB_REGFILE_INDEX_GLB_L2_CNTXT_ID =2 , +BNXT_ULP_GLB_REGFILE_INDEX_GLB_LB_AREC_PTR =3 , +BNXT_ULP_GLB_REGFILE_INDEX_LAST =4 };enum bnxt_ulp_hdr_type {
@@ -257,8 +258,8 @@ enum bnxt_ulp_match_type_bitmask {enum bnxt_ulp_resource_func {BNXT_ULP_RESOURCE_FUNC_INVALID =0x00 , -BNXT_ULP_RESOURCE_FUNC_EM_TABLE =0x20 , -BNXT_ULP_RESOURCE_FUNC_RSVD1 =0x40 , +BNXT_ULP_RESOURCE_FUNC_EXT_EM_TABLE =0x20 , +BNXT_ULP_RESOURCE_FUNC_INT_EM_TABLE =0x40 ,BNXT_ULP_RESOURCE_FUNC_RSVD2 =0x60 ,BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE =0x80 ,BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE =0x81 ,
drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +6 -1
@@ -321,7 +321,12 @@ struct bnxt_ulp_device_params ulp_device_params[BNXT_ULP_DEVICE_ID_LAST] = { .mark_db_gfid_entries = 65536, .flow_count_db_entries = 16384, .num_resources_per_flow = 8, - .num_phy_ports = 2 + .num_phy_ports = 2, + .ext_cntr_table_type = 0, + .byte_count_mask = 0x00000003ffffffff, + .packet_count_mask = 0xfffffffc00000000, + .byte_count_shift = 0, + .packet_count_shift = 36 } };
drivers/net/bnxt/tf_ulp/ulp_template_struct.h +5 -0
@@ -146,6 +146,11 @@ struct bnxt_ulp_device_params {uint64_t flow_db_num_entries;uint32_t flow_count_db_entries;uint32_t num_resources_per_flow; +uint32_t ext_cntr_table_type; +uint64_t byte_count_mask; +uint64_t packet_count_mask; +uint32_t byte_count_shift; +uint32_t packet_count_shift; };/* Flow Mapper */
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 39/51 net/bnxt: add conditional execution of mapper tables
In reply to Ajit KhapardeFrom: Kishore Padmanabha <[email protected]>
Added support for conditional execution of the mapper tables so that actions like count will have table processed only if action count is configured.
--- drivers/net/bnxt/tf_ulp/ulp_mapper.c | 45 +++++++++++++++++++ drivers/net/bnxt/tf_ulp/ulp_mapper.h | 1 + drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 8 ++++ .../net/bnxt/tf_ulp/ulp_template_db_enum.h | 12 ++++- drivers/net/bnxt/tf_ulp/ulp_template_struct.h | 2 + 5 files changed, 67 insertions(+), 1 deletion(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +45 -0
@@ -2008,6 +2008,44 @@ ulp_mapper_glb_resource_info_init(struct bnxt_ulp_context *ulp_ctx,return rc; } +/* +* Function to process the conditional opcode of the mapper table. +* returns 1 to skip the table. +* return 0 to continue processing the table. +*/ +static int32_t +ulp_mapper_tbl_cond_opcode_process (struct bnxt_ulp_mapper_parms *parms, +struct bnxt_ulp_mapper_tbl_info *tbl) +{ +int32_t rc =1 ; + +switch (tbl->cond_opcode) { +case BNXT_ULP_COND_OPCODE_NOP : + rc =0 ; +break ; +case BNXT_ULP_COND_OPCODE_COMP_FIELD : +if (tbl->cond_operand <BNXT_ULP_CF_IDX_LAST && +ULP_COMP_FLD_IDX_RD (parms, tbl->cond_operand)) + rc =0 ; +break ; +case BNXT_ULP_COND_OPCODE_ACTION_BIT : +if (ULP_BITMAP_ISSET (parms->act_bitmap->bits, + tbl->cond_operand)) + rc =0 ; +break ; +case BNXT_ULP_COND_OPCODE_HDR_BIT : +if (ULP_BITMAP_ISSET (parms->hdr_bitmap->bits, + tbl->cond_operand)) + rc =0 ; +break ; +default : +BNXT_TF_DBG (ERR , +"Invalid arg in mapper tbl for cond opcode\n" ); +break ; + } +return rc; +} +/* * Function to process the action template. Iterate through the list * action info templates and process it.
@@ -2027,6 +2065,9 @@ ulp_mapper_action_tbls_process(struct bnxt_ulp_mapper_parms *parms)for (i =0 ; i < parms->num_atbls; i++) { tbl = &parms->atbls[i]; +if (ulp_mapper_tbl_cond_opcode_process (parms, tbl)) +continue ; +switch (tbl->resource_func) {case BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE : rc =ulp_mapper_index_tbl_process (parms, tbl, false);
@@ -2065,6 +2106,9 @@ ulp_mapper_class_tbls_process(struct bnxt_ulp_mapper_parms *parms)for (i =0 ; i < parms->num_ctbls; i++) {struct bnxt_ulp_mapper_tbl_info *tbl = &parms->ctbls[i]; +if (ulp_mapper_tbl_cond_opcode_process (parms, tbl)) +continue ; +switch (tbl->resource_func) {case BNXT_ULP_RESOURCE_FUNC_TCAM_TABLE : rc =ulp_mapper_tcam_tbl_process (parms, tbl);
@@ -2326,6 +2370,7 @@ ulp_mapper_flow_create(struct bnxt_ulp_context *ulp_ctx,memset (&parms,0 ,sizeof (parms)); parms.act_prop = cparms->act_prop; parms.act_bitmap = cparms->act; + parms.hdr_bitmap = cparms->hdr_bitmap; parms.regfile = ®file; parms.hdr_field = cparms->hdr_field; parms.comp_fld = cparms->comp_fld;
drivers/net/bnxt/tf_ulp/ulp_mapper.h +1 -0
@@ -62,6 +62,7 @@ struct bnxt_ulp_mapper_parms {uint32_t num_ctbls;struct ulp_rte_act_prop *act_prop;struct ulp_rte_act_bitmap *act_bitmap; +struct ulp_rte_hdr_bitmap *hdr_bitmap;struct ulp_rte_hdr_field *hdr_field;uint32_t *comp_fld;struct ulp_regfile *regfile;
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +8 -0
@@ -1128,6 +1128,10 @@ ulp_rte_vxlan_encap_act_handler(const struct rte_flow_action *action_item,memcpy (&ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_L3_TYPE ], &ip_type,sizeof (uint32_t )); +/* update the computed field to notify it is ipv4 header */ +ULP_COMP_FLD_IDX_WR (params,BNXT_ULP_CF_IDX_ACT_ENCAP_IPV4_FLAG , +1 ); +if (!ulp_rte_item_skip_void (&item,1 ))return BNXT_TF_RC_ERROR ; }else if (item->type ==RTE_FLOW_ITEM_TYPE_IPV6 ) {
@@ -1148,6 +1152,10 @@ ulp_rte_vxlan_encap_act_handler(const struct rte_flow_action *action_item,memcpy (&ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_L3_TYPE ], &ip_type,sizeof (uint32_t )); +/* update the computed field to notify it is ipv6 header */ +ULP_COMP_FLD_IDX_WR (params,BNXT_ULP_CF_IDX_ACT_ENCAP_IPV6_FLAG , +1 ); +if (!ulp_rte_item_skip_void (&item,1 ))return BNXT_TF_RC_ERROR ; }else {
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +11 -1
@@ -118,7 +118,17 @@ enum bnxt_ulp_cf_idx {BNXT_ULP_CF_IDX_PHY_PORT_SPIF =26 ,BNXT_ULP_CF_IDX_PHY_PORT_PARIF =27 ,BNXT_ULP_CF_IDX_PHY_PORT_VPORT =28 , -BNXT_ULP_CF_IDX_LAST =29 +BNXT_ULP_CF_IDX_ACT_ENCAP_IPV4_FLAG =29 , +BNXT_ULP_CF_IDX_ACT_ENCAP_IPV6_FLAG =30 , +BNXT_ULP_CF_IDX_LAST =31 +}; + +enum bnxt_ulp_cond_opcode { +BNXT_ULP_COND_OPCODE_NOP =0 , +BNXT_ULP_COND_OPCODE_COMP_FIELD =1 , +BNXT_ULP_COND_OPCODE_ACTION_BIT =2 , +BNXT_ULP_COND_OPCODE_HDR_BIT =3 , +BNXT_ULP_COND_OPCODE_LAST =4 }; enum bnxt_ulp_critical_resource {
drivers/net/bnxt/tf_ulp/ulp_template_struct.h +2 -0
@@ -165,6 +165,8 @@ struct bnxt_ulp_mapper_tbl_info {enum bnxt_ulp_resource_func resource_func;uint32_t resource_type;/* TF_ enum type */ enum bnxt_ulp_resource_sub_type resource_sub_type; +enum bnxt_ulp_cond_opcode cond_opcode; +uint32_t cond_operand;uint8_t direction;uint32_t priority;uint8_t srch_b4_alloc;
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 40/51 net/bnxt: enable port MAC qcfg for trusted VF
In reply to Ajit KhapardeFrom: Venkat Duvvuru <[email protected]>
Issue HWRM_PORT_MAC_QCFG command on trusted vf to fetch the port count.
--- drivers/net/bnxt/bnxt_hwrm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/bnxt/bnxt_hwrm.c +2 -2
@@ -3194,14 +3194,14 @@ int bnxt_hwrm_port_mac_qcfg(struct bnxt *bp) bp->port_svif =BNXT_SVIF_INVALID ; -if (!BNXT_PF (bp)) +if (BNXT_VF (bp) && !BNXT_VF_IS_TRUSTED (bp))return 0 ;HWRM_PREP (&req,HWRM_PORT_MAC_QCFG ,BNXT_USE_CHIMP_MB ); rc =bnxt_hwrm_send_message (bp, &req,sizeof (req),BNXT_USE_CHIMP_MB ); -HWRM_CHECK_RESULT (); +HWRM_CHECK_RESULT_SILENT (); port_svif_info =rte_le_to_cpu_16 (resp->port_svif_info); if (port_svif_info &
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 41/51 net/bnxt: enhancements for port db
In reply to Ajit KhapardeFrom: Venkat Duvvuru <[email protected]>
1. Add "enum bnxt_ulp_intf_type” as the second parameter for the port & func helper functions
2. Return vfrep related port & func information in the helper functions
3. Allocate phy_port_list dynamically based on port count
4. Introduce ulp_func_id_tbl array for book keeping func related information indexed by func_id
--- drivers/net/bnxt/bnxt.h | 10 +- drivers/net/bnxt/bnxt_ethdev.c | 64 ++++++++-- drivers/net/bnxt/tf_ulp/bnxt_tf_common.h | 6 + drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 2 +- drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c | 9 +- drivers/net/bnxt/tf_ulp/ulp_port_db.c | 143 +++++++++++++++++------ drivers/net/bnxt/tf_ulp/ulp_port_db.h | 56 +++++++-- drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 22 +++- 8 files changed, 250 insertions(+), 62 deletions(-)
drivers/net/bnxt/bnxt.h +6 -4
@@ -23,6 +23,7 @@#include "tf_core.h" #include "bnxt_ulp.h" +#include "bnxt_tf_common.h" /* Vendor ID */ #define PCI_VENDOR_ID_BROADCOM 0x14E4
@@ -879,10 +880,11 @@ extern const struct rte_flow_ops bnxt_ulp_rte_flow_ops;int32_t bnxt_ulp_init (struct bnxt *bp);void bnxt_ulp_deinit (struct bnxt *bp); -uint16_t bnxt_get_vnic_id (uint16_t port); -uint16_t bnxt_get_svif (uint16_t port_id,bool func_svif); -uint16_t bnxt_get_fw_func_id (uint16_t port); -uint16_t bnxt_get_parif (uint16_t port); +uint16_t bnxt_get_vnic_id (uint16_t port,enum bnxt_ulp_intf_type type); +uint16_t bnxt_get_svif (uint16_t port_id,bool func_svif, +enum bnxt_ulp_intf_type type); +uint16_t bnxt_get_fw_func_id (uint16_t port,enum bnxt_ulp_intf_type type); +uint16_t bnxt_get_parif (uint16_t port,enum bnxt_ulp_intf_type type);uint16_t bnxt_get_phy_port_id (uint16_t port);uint16_t bnxt_get_vport (uint16_t port);enum bnxt_ulp_intf_type
drivers/net/bnxt/bnxt_ethdev.c +56 -8
122 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/bnxt_tf_common.h +6 -0
@@ -6,6 +6,11 @@#ifndef _BNXT_TF_COMMON_H_#define _BNXT_TF_COMMON_H_ +#include <inttypes.h> + +#include "bnxt_ulp.h" +#include "ulp_template_db_enum.h" + #define BNXT_TF_DBG(lvl, fmt, args...) PMD_DRV_LOG(lvl, fmt, ## args)#define BNXT_ULP_EM_FLOWS 8192
@@ -48,6 +53,7 @@ enum ulp_direction_type {enum bnxt_ulp_intf_type {BNXT_ULP_INTF_TYPE_INVALID =0 ,BNXT_ULP_INTF_TYPE_PF , +BNXT_ULP_INTF_TYPE_TRUSTED_VF ,BNXT_ULP_INTF_TYPE_VF ,BNXT_ULP_INTF_TYPE_PF_REP ,BNXT_ULP_INTF_TYPE_VF_REP ,
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +1 -1
@@ -658,7 +658,7 @@ bnxt_ulp_init(struct bnxt *bp) rc =ulp_dparms_init (bp, bp->ulp_ctx);/* create the port database */ - rc =ulp_port_db_init (bp->ulp_ctx); + rc =ulp_port_db_init (bp->ulp_ctx, bp->port_cnt);if (rc) {BNXT_TF_DBG (ERR ,"Failed to create the port database\n" ); goto jump_to_error;
drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c +6 -3
@@ -128,7 +128,8 @@ bnxt_ulp_flow_create(struct rte_eth_dev *dev, mapper_cparms.act_prop = ¶ms.act_prop; mapper_cparms.class_tid = class_id; mapper_cparms.act_tid = act_tmpl; - mapper_cparms.func_id =bnxt_get_fw_func_id (dev->data->port_id); + mapper_cparms.func_id =bnxt_get_fw_func_id (dev->data->port_id, +BNXT_ULP_INTF_TYPE_INVALID ); mapper_cparms.dir = params.dir;/* Call the ulp mapper to create the flow in the hardware. */
@@ -226,7 +227,8 @@ bnxt_ulp_flow_destroy(struct rte_eth_dev *dev, } flow_id = (uint32_t )(uintptr_t )flow; - func_id =bnxt_get_fw_func_id (dev->data->port_id); + func_id =bnxt_get_fw_func_id (dev->data->port_id, +BNXT_ULP_INTF_TYPE_INVALID );if (ulp_flow_db_validate_flow_func (ulp_ctx, flow_id, func_id) == false) {
@@ -270,7 +272,8 @@ bnxt_ulp_flow_flush(struct rte_eth_dev *eth_dev,if (ulp_ctx_deinit_allowed (bp)) { ret =ulp_flow_db_session_flow_flush (ulp_ctx); }else if (bnxt_ulp_cntxt_ptr2_flow_db_get (ulp_ctx)) { - func_id =bnxt_get_fw_func_id (eth_dev->data->port_id); + func_id =bnxt_get_fw_func_id (eth_dev->data->port_id, +BNXT_ULP_INTF_TYPE_INVALID ); ret =ulp_flow_db_function_flow_flush (ulp_ctx, func_id); }if (ret)
drivers/net/bnxt/tf_ulp/ulp_port_db.c +110 -33
282 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/ulp_port_db.h +47 -9
94 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/ulp_rte_parser.c +18 -4
@@ -166,6 +166,8 @@ ulp_rte_parser_svif_set(struct ulp_rte_parser_params *params,uint16_t port_id = svif;uint32_t dir =0 ;struct ulp_rte_hdr_field *hdr_field; +enum bnxt_ulp_svif_type svif_type; +enum bnxt_ulp_intf_type if_type;uint32_t ifindex;int32_t rc;
@@ -187,7 +189,18 @@ ulp_rte_parser_svif_set(struct ulp_rte_parser_params *params, "Invalid port id\n");return BNXT_TF_RC_ERROR ; } -ulp_port_db_svif_get (params->ulp_ctx, ifindex, dir, &svif); + +if (dir ==ULP_DIR_INGRESS ) { + svif_type =BNXT_ULP_PHY_PORT_SVIF ; + }else { + if_type =bnxt_get_interface_type (port_id); +if (if_type ==BNXT_ULP_INTF_TYPE_VF_REP ) + svif_type =BNXT_ULP_VF_FUNC_SVIF ; +else + svif_type =BNXT_ULP_DRV_FUNC_SVIF ; + } +ulp_port_db_svif_get (params->ulp_ctx, ifindex, svif_type, + &svif); svif =rte_cpu_to_be_16 (svif); } hdr_field = ¶ms->hdr_field[BNXT_ULP_PROTO_HDR_FIELD_SVIF_IDX ];
@@ -1256,7 +1269,7 @@ ulp_rte_pf_act_handler(const struct rte_flow_action *action_item __rte_unused,/* copy the PF of the current device into VNIC Property */ svif =ULP_COMP_FLD_IDX_RD (params,BNXT_ULP_CF_IDX_INCOMING_IF ); - svif =bnxt_get_vnic_id (svif); + svif =bnxt_get_vnic_id (svif,BNXT_ULP_INTF_TYPE_INVALID ); svif =rte_cpu_to_be_32 (svif);memcpy (¶ms->act_prop.act_details[BNXT_ULP_ACT_PROP_IDX_VNIC ], &svif,BNXT_ULP_ACT_PROP_SZ_VNIC );
@@ -1280,7 +1293,8 @@ ulp_rte_vf_act_handler(const struct rte_flow_action *action_item,return BNXT_TF_RC_PARSE_ERR ; }/* TBD: Update the computed VNIC using VF conversion */ - pid =bnxt_get_vnic_id (vf_action->id); + pid =bnxt_get_vnic_id (vf_action->id, +BNXT_ULP_INTF_TYPE_INVALID ); pid =rte_cpu_to_be_32 (pid);memcpy (¶m->act_prop.act_details[BNXT_ULP_ACT_PROP_IDX_VNIC ], &pid,BNXT_ULP_ACT_PROP_SZ_VNIC );
@@ -1307,7 +1321,7 @@ ulp_rte_port_id_act_handler(const struct rte_flow_action *act_item,return BNXT_TF_RC_PARSE_ERR ; }/* TBD: Update the computed VNIC using port conversion */ - pid =bnxt_get_vnic_id (port_id->id); + pid =bnxt_get_vnic_id (port_id->id,BNXT_ULP_INTF_TYPE_INVALID ); pid =rte_cpu_to_be_32 (pid);memcpy (¶m->act_prop.act_details[BNXT_ULP_ACT_PROP_IDX_VNIC ], &pid,BNXT_ULP_ACT_PROP_SZ_VNIC );
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 42/51 net/bnxt: manage VF to VFR conduit
In reply to Ajit KhapardeFrom: Venkat Duvvuru <[email protected]>
When VF-VFR conduits are created, a mark is added to the mark database. mark_flag indicates whether the mark is valid and has VFR information (VFR_ID bit in mark_flag). Rx path was checking for this VFR_ID bit. However, while adding the mark to the mark database, VFR_ID bit is not set in mark_flag.
--- drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c +5 -0
@@ -18,6 +18,8 @@ BNXT_ULP_MARK_VALID)#define ULP_MARK_DB_ENTRY_IS_INVALID (mark_info) (!((mark_info)->flags &\ BNXT_ULP_MARK_VALID)) +#define ULP_MARK_DB_ENTRY_SET_VFR_ID (mark_info) ((mark_info)->flags |=\ + BNXT_ULP_MARK_VFR_ID)#define ULP_MARK_DB_ENTRY_IS_VFR_ID (mark_info) ((mark_info)->flags &\ BNXT_ULP_MARK_VFR_ID)#define ULP_MARK_DB_ENTRY_IS_GLOBAL_HW_FID (mark_info) ((mark_info)->flags &\
@@ -263,6 +265,9 @@ ulp_mark_db_mark_add(struct bnxt_ulp_context *ctxt,BNXT_TF_DBG (DEBUG ,"Set LFID[0x%0x] = 0x%0x\n" , fid, mark); mtbl->lfid_tbl[fid].mark_id = mark;ULP_MARK_DB_ENTRY_SET_VALID (&mtbl->lfid_tbl[fid]); + +if (mark_flag &BNXT_ULP_MARK_VFR_ID ) +ULP_MARK_DB_ENTRY_SET_VFR_ID (&mtbl->lfid_tbl[fid]); }return 0 ;
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 43/51 net/bnxt: parse reps along with other dev-args
In reply to Ajit KhapardeFrom: Somnath Kotur <[email protected]>
Representor dev-args need to be parsed during pci probe as they determine subsequent probe of VF representor ports as well.
--- drivers/net/bnxt/bnxt_ethdev.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/bnxt/bnxt_ethdev.c +2 -0
@@ -98,8 +98,10 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {#define BNXT_DEVARG_TRUFLOW "host-based-truflow"#define BNXT_DEVARG_FLOW_XSTAT "flow-xstat"#define BNXT_DEVARG_MAX_NUM_KFLOWS "max-num-kflows" +#define BNXT_DEVARG_REPRESENTOR "representor"static const char *const bnxt_dev_args[] = { +BNXT_DEVARG_REPRESENTOR ,BNXT_DEVARG_TRUFLOW ,BNXT_DEVARG_FLOW_XSTAT ,BNXT_DEVARG_MAX_NUM_KFLOWS ,
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 44/51 net/bnxt: fill mapper parameters with default rules
In reply to Ajit KhapardeFrom: Venkat Duvvuru <[email protected]>
Default rules are needed for the packets to be punted between the following entities in the non-offloaded path
1. Device PORT to DPDK App
2. DPDK App to Device PORT
3. VF Representor to VF
4. VF to VF Representor
This patch fills all the relevant information in the computed fields & the act_prop fields for the flow mapper to create the necessary tables in the hardware to enable the default rules.
--- drivers/net/bnxt/bnxt_ethdev.c | 6 +- drivers/net/bnxt/meson.build | 1 + drivers/net/bnxt/tf_ulp/Makefile | 1 + drivers/net/bnxt/tf_ulp/bnxt_ulp.h | 24 ++ drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c | 30 +- drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 385 ++++++++++++++++++ drivers/net/bnxt/tf_ulp/ulp_mapper.c | 10 +- drivers/net/bnxt/tf_ulp/ulp_mapper.h | 3 +- .../net/bnxt/tf_ulp/ulp_template_db_enum.h | 5 + 9 files changed, 444 insertions(+), 21 deletions(-) create mode 100644 drivers/net/bnxt/tf_ulp/ulp_def_rules.c
drivers/net/bnxt/bnxt_ethdev.c +3 -3
@@ -1275,9 +1275,6 @@ static void bnxt_dev_stop_op(struct rte_eth_dev *eth_dev)struct rte_pci_device *pci_dev =RTE_ETH_DEV_TO_PCI (eth_dev);struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; -if (BNXT_TRUFLOW_EN (bp)) -bnxt_ulp_deinit (bp); - eth_dev->data->dev_started =0 ;/* Prevent crashes when queues are still in use */ eth_dev->rx_pkt_burst = &bnxt_dummy_recv_pkts;
@@ -1333,6 +1330,9 @@ static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev)rte_eal_alarm_cancel (bnxt_dev_recover, (void *)bp);bnxt_cancel_fc_thread (bp); +if (BNXT_TRUFLOW_EN (bp)) +bnxt_ulp_deinit (bp); +if (eth_dev->data->dev_started)bnxt_dev_stop_op (eth_dev);
drivers/net/bnxt/meson.build +1 -0
@@ -61,6 +61,7 @@ sources = files('bnxt_cpr.c', 'tf_ulp/ulp_rte_parser.c', 'tf_ulp/bnxt_ulp_flow.c', 'tf_ulp/ulp_port_db.c', + 'tf_ulp/ulp_def_rules.c', 'rte_pmd_bnxt.c')
drivers/net/bnxt/tf_ulp/Makefile +1 -0
@@ -16,3 +16,4 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_ulp/bnxt_ulp.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_ulp/ulp_mark_mgr.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_ulp/ulp_flow_db.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_ulp/ulp_port_db.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_ulp/ulp_def_rules.c
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +24 -0
@@ -12,6 +12,8 @@#include "rte_ethdev.h" +#include "ulp_template_db_enum.h" +struct bnxt_ulp_data {uint32_t tbl_scope_id;struct bnxt_ulp_mark_tbl *mark_tbl;
@@ -49,6 +51,12 @@ struct rte_tf_flow {uint32_t flow_id; }; +struct ulp_tlv_param { +enum bnxt_ulp_df_param_type type; +uint32_t length; +uint8_t value[16 ]; +}; +/* * Allow the deletion of context only for the bnxt device that * created the session
@@ -127,4 +135,20 @@ bnxt_ulp_cntxt_ptr2_port_db_set(struct bnxt_ulp_context *ulp_ctx,struct bnxt_ulp_port_db *bnxt_ulp_cntxt_ptr2_port_db_get (struct bnxt_ulp_context *ulp_ctx); +/* Function to create default flows. */ +int32_t +ulp_default_flow_create (struct rte_eth_dev *eth_dev, +struct ulp_tlv_param *param_list, +uint32_t ulp_class_tid, +uint32_t *flow_id); + +/* Function to destroy default flows. */ +int32_t +ulp_default_flow_destroy (struct rte_eth_dev *eth_dev, +uint32_t flow_id); + +int +bnxt_ulp_flow_destroy (struct rte_eth_dev *dev,struct rte_flow *flow, +struct rte_flow_error *error); +#endif /* _BNXT_ULP_H_ */
drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c +18 -12
@@ -207,7 +207,7 @@ bnxt_ulp_flow_validate(struct rte_eth_dev *dev, }/* Function to destroy the rte flow. */ -static int +int bnxt_ulp_flow_destroy (struct rte_eth_dev *dev,struct rte_flow *flow,struct rte_flow_error *error)
@@ -220,9 +220,10 @@ bnxt_ulp_flow_destroy(struct rte_eth_dev *dev, ulp_ctx =bnxt_ulp_eth_dev_ptr2_cntxt_get (dev);if (!ulp_ctx) {BNXT_TF_DBG (ERR ,"ULP context is not initialized\n" ); -rte_flow_error_set (error,EINVAL , -RTE_FLOW_ERROR_TYPE_HANDLE ,NULL , -"Failed to destroy flow." ); +if (error) +rte_flow_error_set (error,EINVAL , +RTE_FLOW_ERROR_TYPE_HANDLE ,NULL , +"Failed to destroy flow." );return -EINVAL ; }
@@ -233,17 +234,22 @@ bnxt_ulp_flow_destroy(struct rte_eth_dev *dev,if (ulp_flow_db_validate_flow_func (ulp_ctx, flow_id, func_id) == false) {BNXT_TF_DBG (ERR ,"Incorrect device params\n" ); -rte_flow_error_set (error,EINVAL , -RTE_FLOW_ERROR_TYPE_HANDLE ,NULL , -"Failed to destroy flow." ); +if (error) +rte_flow_error_set (error,EINVAL , +RTE_FLOW_ERROR_TYPE_HANDLE ,NULL , +"Failed to destroy flow." );return -EINVAL ; } - ret =ulp_mapper_flow_destroy (ulp_ctx, flow_id); -if (ret) -rte_flow_error_set (error, -ret, -RTE_FLOW_ERROR_TYPE_HANDLE ,NULL , -"Failed to destroy flow." ); + ret =ulp_mapper_flow_destroy (ulp_ctx, flow_id, +BNXT_ULP_REGULAR_FLOW_TABLE ); +if (ret) { +BNXT_TF_DBG (ERR ,"Failed to destroy flow.\n" ); +if (error) +rte_flow_error_set (error, -ret, +RTE_FLOW_ERROR_TYPE_HANDLE ,NULL , +"Failed to destroy flow." ); + }return ret; }
drivers/net/bnxt/tf_ulp/ulp_def_rules.c new file +385 -0
385 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/ulp_mapper.c +5 -5
@@ -2274,16 +2274,15 @@ ulp_mapper_glb_resource_info_deinit(struct bnxt_ulp_context *ulp_ctx, }int32_t -ulp_mapper_flow_destroy (struct bnxt_ulp_context *ulp_ctx,uint32_t fid) +ulp_mapper_flow_destroy (struct bnxt_ulp_context *ulp_ctx,uint32_t fid, +enum bnxt_ulp_flow_db_tables flow_tbl_type) {if (!ulp_ctx) {BNXT_TF_DBG (ERR ,"Invalid parms, unable to free flow\n" );return -EINVAL ; } -return ulp_mapper_resources_free (ulp_ctx, - fid, -BNXT_ULP_REGULAR_FLOW_TABLE ); +return ulp_mapper_resources_free (ulp_ctx, fid, flow_tbl_type); }/* Function to handle the default global templates that are allocated during
@@ -2486,7 +2485,8 @@ ulp_mapper_flow_create(struct bnxt_ulp_context *ulp_ctx, flow_error:/* Free all resources that were allocated during flow creation */ - trc =ulp_mapper_flow_destroy (ulp_ctx, parms.fid); + trc =ulp_mapper_flow_destroy (ulp_ctx, parms.fid, +BNXT_ULP_REGULAR_FLOW_TABLE );if (trc)BNXT_TF_DBG (ERR ,"Failed to free all resources rc=%d\n" , trc);
drivers/net/bnxt/tf_ulp/ulp_mapper.h +2 -1
@@ -109,7 +109,8 @@ ulp_mapper_flow_create(struct bnxt_ulp_context *ulp_ctx,/* Function that frees all resources associated with the flow. */ int32_t -ulp_mapper_flow_destroy (struct bnxt_ulp_context *ulp_ctx,uint32_t fid); +ulp_mapper_flow_destroy (struct bnxt_ulp_context *ulp_ctx,uint32_t fid, +enum bnxt_ulp_flow_db_tables flow_tbl_type);/* * Function that frees all resources and can be called on default or regular
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +5 -0
@@ -145,6 +145,11 @@ enum bnxt_ulp_device_id {BNXT_ULP_DEVICE_ID_LAST =4 }; +enum bnxt_ulp_df_param_type { +BNXT_ULP_DF_PARAM_TYPE_DEV_PORT_ID =0 , +BNXT_ULP_DF_PARAM_TYPE_LAST =1 +}; +enum bnxt_ulp_direction {BNXT_ULP_DIRECTION_INGRESS =0 ,BNXT_ULP_DIRECTION_EGRESS =1 ,
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 45/51 net/bnxt: add VF-rep and stat templates
In reply to Ajit KhapardeFrom: Kishore Padmanabha <[email protected]>
The support for VF representor and counters is added to the ulp templates.
--- drivers/net/bnxt/tf_ulp/ulp_mapper.c | 21 +- drivers/net/bnxt/tf_ulp/ulp_mapper.h | 2 +- drivers/net/bnxt/tf_ulp/ulp_template_db_act.c | 424 +- .../net/bnxt/tf_ulp/ulp_template_db_class.c | 5198 +++++++++++++---- .../net/bnxt/tf_ulp/ulp_template_db_enum.h | 409 +- .../net/bnxt/tf_ulp/ulp_template_db_field.h | 463 +- drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c | 87 +- 7 files changed, 4948 insertions(+), 1656 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_mapper.c +2 -19
@@ -22,7 +22,7 @@ ulp_mapper_glb_resource_info_list_get(uint32_t *num_entries) {if (!num_entries)return NULL ; - *num_entries =BNXT_ULP_GLB_RESOURCE_INFO_TBL_MAX_SZ ; + *num_entries =BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ ;return ulp_glb_resource_tbl; }
@@ -119,11 +119,6 @@ ulp_mapper_resource_ident_allocate(struct bnxt_ulp_context *ulp_ctx,tf_free_identifier (tfp, &fparms);return rc; } -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -BNXT_TF_DBG (DEBUG ,"Allocated Glb Res Ident [%s][%d][%d] = 0x%04x\n" , - (iparms.dir ==TF_DIR_RX ) ?"RX" :"TX" , - glb_res->glb_regfile_index, iparms.ident_type, iparms.id); -#endif return rc; }
@@ -182,11 +177,6 @@ ulp_mapper_resource_index_tbl_alloc(struct bnxt_ulp_context *ulp_ctx,tf_free_tbl_entry (tfp, &free_parms);return rc; } -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -BNXT_TF_DBG (DEBUG ,"Allocated Glb Res Index [%s][%d][%d] = 0x%04x\n" , - (aparms.dir ==TF_DIR_RX ) ?"RX" :"TX" , - glb_res->glb_regfile_index, aparms.type, aparms.idx); -#endif return rc; }
@@ -1441,9 +1431,6 @@ ulp_mapper_em_tbl_process(struct bnxt_ulp_mapper_parms *parms,return rc; } } -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -ulp_mapper_result_dump ("EEM Result" , tbl, &data); -#endif /* do the transpose for the internal EM keys */ if (tbl->resource_func ==BNXT_ULP_RESOURCE_FUNC_INT_EM_TABLE )
@@ -1594,10 +1581,6 @@ ulp_mapper_index_tbl_process(struct bnxt_ulp_mapper_parms *parms,/* if encap bit swap is enabled perform the bit swap */ if (parms->device_params->encap_byte_swap && encap_flds) {ulp_blob_perform_encap_swap (&data); -#ifdef RTE_LIBRTE_BNXT_TRUFLOW_DEBUG -BNXT_TF_DBG (INFO ,"Dump after encap swap\n" ); -ulp_mapper_blob_dump (&data); -#endif }/*
@@ -2255,7 +2238,7 @@ ulp_mapper_glb_resource_info_deinit(struct bnxt_ulp_context *ulp_ctx,/* Iterate the global resources and process each one */ for (dir =TF_DIR_RX ; dir <TF_DIR_MAX ; dir++) { -for (idx =0 ; idx <BNXT_ULP_GLB_RESOURCE_INFO_TBL_MAX_SZ ; +for (idx =0 ; idx <BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ ; idx++) { ent = &mapper_data->glb_res_tbl[dir][idx]; if (ent->resource_func ==
drivers/net/bnxt/tf_ulp/ulp_mapper.h +1 -1
@@ -46,7 +46,7 @@ struct bnxt_ulp_mapper_glb_resource_entry {struct bnxt_ulp_mapper_data {struct bnxt_ulp_mapper_glb_resource_entry - glb_res_tbl[TF_DIR_MAX ][BNXT_ULP_GLB_RESOURCE_INFO_TBL_MAX_SZ ]; + glb_res_tbl[TF_DIR_MAX ][BNXT_ULP_GLB_RESOURCE_TBL_MAX_SZ ];struct bnxt_ulp_mapper_cache_entry *cache_tbl[BNXT_ULP_CACHE_TBL_MAX_SZ ]; };
drivers/net/bnxt/tf_ulp/ulp_template_db_act.c +391 -33
541 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/ulp_template_db_class.c +4027 -1171
2,394 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/ulp_template_db_enum.h +218 -191
409 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/ulp_template_db_field.h +259 -204
463 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c +50 -37
87 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.21.1 (Apple Git-122.3)
Part of the diff is not shown here. View the raw message.
PATCH v3 46/51 net/bnxt: create default flow rules for the VF-rep
In reply to Ajit KhapardeFrom: Somnath Kotur <[email protected]>
Invoked 3 new APIs for the default flow create/destroy and to get the action ptr for a default flow.
Changed ulp_intf_update() to accept rte_eth_dev as input and invoke the same from the VF rep start function.
ULP Mark Manager will indicate if the cfa_code returned in the Rx completion descriptor was for one of the default flow rules created for the VF representor conduit. The mark_id returned in such a case would be the VF rep's DPDK Port id, which can be used to get the corresponding rte_eth_dev struct in bnxt_vf_recv
--- drivers/net/bnxt/bnxt.h | 4 +- drivers/net/bnxt/bnxt_reps.c | 134 ++++++++++++++++++++++++----------- drivers/net/bnxt/bnxt_reps.h | 3 +- drivers/net/bnxt/bnxt_rxr.c | 25 +++---- drivers/net/bnxt/bnxt_txq.h | 1 + 5 files changed, 111 insertions(+), 56 deletions(-)
drivers/net/bnxt/bnxt.h +3 -1
@@ -806,8 +806,10 @@ struct bnxt_vf_representor {uint16_t fw_fid;uint16_t dflt_vnic_id;uint16_t svif; -uint16_t tx_cfa_action; +uint32_t vfr_tx_cfa_action;uint16_t rx_cfa_code; +uint32_t rep2vf_flow_id; +uint32_t vf2rep_flow_id;/* Private data store of associated PF/Trusted VF */ struct rte_eth_dev *parent_dev;uint8_t mac_addr[RTE_ETHER_ADDR_LEN ];
drivers/net/bnxt/bnxt_reps.c +93 -41
222 lines not on this page · raw message
drivers/net/bnxt/bnxt_reps.h +1 -2
@@ -13,8 +13,7 @@#define BNXT_VF_IDX_INVALID 0xffffuint16_t -bnxt_vfr_recv (struct bnxt *bp,uint16_t cfa_code,uint16_t queue_id, -struct rte_mbuf *mbuf); +bnxt_vfr_recv (uint16_t port_id,uint16_t queue_id,struct rte_mbuf *mbuf);int bnxt_vf_representor_init (struct rte_eth_dev *eth_dev,void *params);int bnxt_vf_representor_uninit (struct rte_eth_dev *eth_dev); int bnxt_vf_rep_dev_info_get_op(struct rte_eth_dev *eth_dev,
drivers/net/bnxt/bnxt_rxr.c +13 -12
@@ -403,9 +403,9 @@ bnxt_get_rx_ts_thor(struct bnxt *bp, uint32_t rx_ts_cmpl) }#endif -static void +static uint32_t bnxt_ulp_set_mark_in_mbuf (struct bnxt *bp,struct rx_pkt_cmpl_hi *rxcmp1, -struct rte_mbuf *mbuf) +struct rte_mbuf *mbuf,uint32_t *vfr_flag) {uint32_t cfa_code;uint32_t meta_fmt;
@@ -415,8 +415,6 @@ bnxt_ulp_set_mark_in_mbuf(struct bnxt *bp, struct rx_pkt_cmpl_hi *rxcmp1,uint32_t flags2;uint32_t gfid_support =0 ;int rc; -uint32_t vfr_flag; -if (BNXT_GFID_ENABLED (bp)) gfid_support =1 ;
@@ -485,19 +483,21 @@ bnxt_ulp_set_mark_in_mbuf(struct bnxt *bp, struct rx_pkt_cmpl_hi *rxcmp1, } rc =ulp_mark_db_mark_get (bp->ulp_ctx, gfid, - cfa_code, &vfr_flag, &mark_id); + cfa_code, vfr_flag, &mark_id);if (!rc) {/* Got the mark, write it to the mbuf and return */ mbuf->hash.fdir.hi = mark_id; mbuf->udata64 = (cfa_code &0xffffffffull ) <<32 ; mbuf->hash.fdir.id = rxcmp1->cfa_code; mbuf->ol_flags |=PKT_RX_FDIR |PKT_RX_FDIR_ID ; -return ; +return mark_id; } skip_mark: mbuf->hash.fdir.hi =0 ; mbuf->hash.fdir.id =0 ; + +return 0 ; } void bnxt_set_mark_in_mbuf(struct bnxt *bp,
@@ -553,7 +553,7 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,int rc =0 ;uint8_t agg_buf =0 ;uint16_t cmp_type; -uint32_t flags2_f =0 ; +uint32_t flags2_f =0 , vfr_flag =0 , mark_id =0 ;uint16_t flags_type;struct bnxt *bp = rxq->bp;
@@ -632,7 +632,8 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt, }if (BNXT_TRUFLOW_EN (bp)) -bnxt_ulp_set_mark_in_mbuf (rxq->bp, rxcmp1, mbuf); + mark_id =bnxt_ulp_set_mark_in_mbuf (rxq->bp, rxcmp1, mbuf, + &vfr_flag);else bnxt_set_mark_in_mbuf (rxq->bp, rxcmp1, mbuf);
@@ -736,10 +737,10 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt, rx: *rx_pkt = mbuf; -if ((BNXT_VF_IS_TRUSTED (rxq->bp) ||BNXT_PF (rxq->bp)) && - rxq->bp->cfa_code_map && rxcmp1->cfa_code) { -if (!bnxt_vfr_recv (rxq->bp, rxcmp1->cfa_code, rxq->queue_id, - mbuf)) { +if (BNXT_TRUFLOW_EN (bp) && + (BNXT_VF_IS_TRUSTED (bp) ||BNXT_PF (bp)) && + vfr_flag) { +if (!bnxt_vfr_recv (mark_id, rxq->queue_id, mbuf)) {/* Now return an error so that nb_rx_pkts is not * incremented. * This packet was meant to be given to the representor.
drivers/net/bnxt/bnxt_txq.h +1 -0
@@ -30,6 +30,7 @@ struct bnxt_tx_queue {int index;int tx_wake_thresh;uint32_t tx_cfa_action; +uint32_t vfr_tx_cfa_action;struct bnxt_tx_ring_info *tx_ring;unsigned int cp_nr_rings;
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 47/51 net/bnxt: add port default rules for ingress and egress
In reply to Ajit KhapardeFrom: Venkat Duvvuru <[email protected]>
ingress & egress port default rules are needed to send the packet from port_to_dpdk & dpdk_to_port respectively.
--- drivers/net/bnxt/bnxt_ethdev.c | 76 +++++++++++++++++++++++++++++- drivers/net/bnxt/tf_ulp/bnxt_ulp.h | 3 ++ 2 files changed, 78 insertions(+), 1 deletion(-)
drivers/net/bnxt/bnxt_ethdev.c +75 -1
@@ -29,6 +29,7 @@#include "hsi_struct_def_dpdk.h" #include "bnxt_nvm_defs.h" #include "bnxt_tf_common.h" +#include "ulp_flow_db.h" #define DRV_MODULE_NAME "bnxt" static const char bnxt_version[] =
@@ -1162,6 +1163,73 @@ static int bnxt_handle_if_change_status(struct bnxt *bp)return rc; } +static int32_t +bnxt_create_port_app_df_rule (struct bnxt *bp,uint8_t flow_type, +uint32_t *flow_id) +{ +uint16_t port_id = bp->eth_dev->data->port_id; +struct ulp_tlv_param param_list[] = { + { + .type =BNXT_ULP_DF_PARAM_TYPE_DEV_PORT_ID , + .length =2 , + .value = {(port_id >>8 ) &0xff , port_id &0xff } + }, + { + .type =BNXT_ULP_DF_PARAM_TYPE_LAST , + .length =0 , + .value = {0 } + } + }; + +return ulp_default_flow_create (bp->eth_dev, param_list, flow_type, + flow_id); +} + +static int32_t +bnxt_create_df_rules (struct bnxt *bp) +{ +struct bnxt_ulp_data *cfg_data; +int rc; + + cfg_data = bp->ulp_ctx->cfg_data; + rc =bnxt_create_port_app_df_rule (bp,BNXT_ULP_DF_TPL_PORT_TO_VS , + &cfg_data->port_to_app_flow_id); +if (rc) { +PMD_DRV_LOG (ERR , +"Failed to create port to app default rule\n" ); +return rc; + } + +BNXT_TF_DBG (DEBUG ,"***** created port to app default rule ******\n" ); + rc =bnxt_create_port_app_df_rule (bp,BNXT_ULP_DF_TPL_VS_TO_PORT , + &cfg_data->app_to_port_flow_id); +if (!rc) { + rc =ulp_default_flow_db_cfa_action_get (bp->ulp_ctx, + cfg_data->app_to_port_flow_id, + &cfg_data->tx_cfa_action); +if (rc) + goto err; + +BNXT_TF_DBG (DEBUG , +"***** created app to port default rule *****\n" ); +return 0 ; + } + +err: +BNXT_TF_DBG (DEBUG ,"Failed to create app to port default rule\n" ); +return rc; +} + +static void +bnxt_destroy_df_rules (struct bnxt *bp) +{ +struct bnxt_ulp_data *cfg_data; + + cfg_data = bp->ulp_ctx->cfg_data; +ulp_default_flow_destroy (bp->eth_dev, cfg_data->port_to_app_flow_id); +ulp_default_flow_destroy (bp->eth_dev, cfg_data->app_to_port_flow_id); +} +static int bnxt_dev_start_op (struct rte_eth_dev *eth_dev) {struct bnxt *bp = eth_dev->data->dev_private;
@@ -1330,8 +1398,11 @@ static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev)rte_eal_alarm_cancel (bnxt_dev_recover, (void *)bp);bnxt_cancel_fc_thread (bp); -if (BNXT_TRUFLOW_EN (bp)) +if (BNXT_TRUFLOW_EN (bp)) { +if (bp->rep_info !=NULL ) +bnxt_destroy_df_rules (bp);bnxt_ulp_deinit (bp); + }if (eth_dev->data->dev_started)bnxt_dev_stop_op (eth_dev);
@@ -1581,6 +1652,9 @@ static int bnxt_promiscuous_disable_op(struct rte_eth_dev *eth_dev)if (rc !=0 ) vnic->flags = old_flags; +if (BNXT_TRUFLOW_EN (bp) && bp->rep_info !=NULL ) +bnxt_create_df_rules (bp); +return rc; }
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +3 -0
@@ -22,6 +22,9 @@ struct bnxt_ulp_data {struct bnxt_ulp_flow_db *flow_db;void *mapper_data;struct bnxt_ulp_port_db *port_db; +uint32_t port_to_app_flow_id; +uint32_t app_to_port_flow_id; +uint32_t tx_cfa_action; };struct bnxt_ulp_context {
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 48/51 net/bnxt: fill cfa action in the Tx descriptor
In reply to Ajit KhapardeFrom: Venkat Duvvuru <[email protected]>
Currently, only vfrep transmit requires cfa_action to be filled in the tx buffer descriptor. However with truflow, dpdk(non vfrep) to port also requires cfa_action to be filled in the tx buffer descriptor.
This patch uses the correct cfa_action pointer while transmitting the packet. Based on whether the packet is transmitted on non-vfrep or vfrep, tx_cfa_action or vfr_tx_cfa_action inside txq will be filled in the tx buffer descriptor.
--- drivers/net/bnxt/bnxt_txr.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
drivers/net/bnxt/bnxt_txr.c +15 -3
@@ -131,7 +131,9 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,PKT_TX_VLAN_PKT |PKT_TX_OUTER_IP_CKSUM |PKT_TX_TUNNEL_GRE |PKT_TX_TUNNEL_VXLAN |PKT_TX_TUNNEL_GENEVE |PKT_TX_IEEE1588_TMST | - PKT_TX_QINQ_PKT) || txq->tx_cfa_action) + PKT_TX_QINQ_PKT) || + txq->bp->ulp_ctx->cfg_data->tx_cfa_action || + txq->vfr_tx_cfa_action) long_bd = true; nr_bds = long_bd + tx_pkt->nb_segs;
@@ -184,7 +186,15 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,if (long_bd) { txbd->flags_type |=TX_BD_LONG_TYPE_TX_BD_LONG ; vlan_tag_flags =0 ; - cfa_action = txq->tx_cfa_action; + +if (BNXT_TRUFLOW_EN (txq->bp)) { +if (txq->vfr_tx_cfa_action) + cfa_action = txq->vfr_tx_cfa_action; +else + cfa_action = + txq->bp->ulp_ctx->cfg_data->tx_cfa_action; + } +/* HW can accelerate only outer vlan in QinQ mode */ if (tx_buf->mbuf->ol_flags &PKT_TX_QINQ_PKT ) { vlan_tag_flags = TX_BD_LONG_CFA_META_KEY_VLAN_TAG |
@@ -212,7 +222,9 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt, &txr->tx_desc_ring[txr->tx_prod]; txbd1->lflags =0 ; txbd1->cfa_meta = vlan_tag_flags; - txbd1->cfa_action = cfa_action; + +if (BNXT_TRUFLOW_EN (txq->bp)) + txbd1->cfa_action = cfa_action;if (tx_pkt->ol_flags &PKT_TX_TCP_SEG ) {uint16_t hdr_size;
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 49/51 net/bnxt: add ULP Flow counter Manager
In reply to Ajit KhapardeFrom: Somnath Kotur <[email protected]>
The Flow counter manager allocates memory to hold the software view of the counters where the on-chip counter data will be accumulated along with another memory block that will be shadowing the on-chip counter data i.e where the raw counter data will be DMAed into from the chip.
It also keeps track of the first HW counter ID as that will be needed to retrieve the counter data in bulk using a TF API. It issues this cmd in an rte_alarm thread that keeps running every second.
--- drivers/net/bnxt/meson.build | 1 + drivers/net/bnxt/tf_ulp/Makefile | 1 + drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 35 ++ drivers/net/bnxt/tf_ulp/bnxt_ulp.h | 8 + drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c | 465 ++++++++++++++++++++++++++ drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h | 148 ++++++++ drivers/net/bnxt/tf_ulp/ulp_flow_db.c | 27 ++ 7 files changed, 685 insertions(+) create mode 100644 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c create mode 100644 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h
drivers/net/bnxt/meson.build +1 -0
@@ -46,6 +46,7 @@ sources = files('bnxt_cpr.c', 'tf_core/ll.c', 'tf_core/tf_global_cfg.c', 'tf_core/tf_em_host.c', + 'tf_ulp/ulp_fc_mgr.c', 'hcapi/hcapi_cfa_p4.c',
drivers/net/bnxt/tf_ulp/Makefile +1 -0
@@ -17,3 +17,4 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_ulp/ulp_mark_mgr.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_ulp/ulp_flow_db.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_ulp/ulp_port_db.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_ulp/ulp_def_rules.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_ulp/ulp_fc_mgr.c
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +35 -0
@@ -18,6 +18,7 @@#include "ulp_template_db_enum.h" #include "ulp_template_struct.h" #include "ulp_mark_mgr.h" +#include "ulp_fc_mgr.h" #include "ulp_flow_db.h" #include "ulp_mapper.h" #include "ulp_port_db.h"
@@ -705,6 +706,12 @@ bnxt_ulp_init(struct bnxt *bp) goto jump_to_error; } + rc =ulp_fc_mgr_init (bp->ulp_ctx); +if (rc) { +BNXT_TF_DBG (ERR ,"Failed to initialize ulp flow counter mgr\n" ); + goto jump_to_error; + } +return rc; jump_to_error:
@@ -752,6 +759,9 @@ bnxt_ulp_deinit(struct bnxt *bp)/* cleanup the ulp mapper */ ulp_mapper_deinit (bp->ulp_ctx); +/* Delete the Flow Counter Manager */ +ulp_fc_mgr_deinit (bp->ulp_ctx); +/* Delete the Port database */ ulp_port_db_deinit (bp->ulp_ctx);
@@ -963,3 +973,28 @@ bnxt_ulp_cntxt_ptr2_port_db_get(struct bnxt_ulp_context *ulp_ctx)return ulp_ctx->cfg_data->port_db; } + +/* Function to set the flow counter info into the context */ +int32_t +bnxt_ulp_cntxt_ptr2_fc_info_set (struct bnxt_ulp_context *ulp_ctx, +struct bnxt_ulp_fc_info *ulp_fc_info) +{ +if (!ulp_ctx || !ulp_ctx->cfg_data) { +BNXT_TF_DBG (ERR ,"Invalid ulp context data\n" ); +return -EINVAL ; + } + + ulp_ctx->cfg_data->fc_info = ulp_fc_info; + +return 0 ; +} + +/* Function to retrieve the flow counter info from the context. */ +struct bnxt_ulp_fc_info * +bnxt_ulp_cntxt_ptr2_fc_info_get (struct bnxt_ulp_context *ulp_ctx) +{ +if (!ulp_ctx || !ulp_ctx->cfg_data) +return NULL ; + +return ulp_ctx->cfg_data->fc_info; +}
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +8 -0
@@ -22,6 +22,7 @@ struct bnxt_ulp_data {struct bnxt_ulp_flow_db *flow_db;void *mapper_data;struct bnxt_ulp_port_db *port_db; +struct bnxt_ulp_fc_info *fc_info;uint32_t port_to_app_flow_id;uint32_t app_to_port_flow_id;uint32_t tx_cfa_action;
@@ -154,4 +155,11 @@ int bnxt_ulp_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow, struct rte_flow_error *error); +int32_t +bnxt_ulp_cntxt_ptr2_fc_info_set (struct bnxt_ulp_context *ulp_ctx, +struct bnxt_ulp_fc_info *ulp_fc_info); + +struct bnxt_ulp_fc_info * +bnxt_ulp_cntxt_ptr2_fc_info_get (struct bnxt_ulp_context *ulp_ctx); +#endif /* _BNXT_ULP_H_ */
drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c new file +465 -0
465 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h new file +148 -0
148 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/ulp_flow_db.c +27 -0
@@ -10,6 +10,7 @@#include "ulp_utils.h" #include "ulp_template_struct.h" #include "ulp_mapper.h" +#include "ulp_fc_mgr.h" #define ULP_FLOW_DB_RES_DIR_BIT 31#define ULP_FLOW_DB_RES_DIR_MASK 0x80000000
@@ -484,6 +485,21 @@ int32_t ulp_flow_db_resource_add(struct bnxt_ulp_context *ulp_ctxt,ulp_flow_db_res_params_to_info (fid_resource, params); } +if (params->resource_type ==TF_TBL_TYPE_ACT_STATS_64 && + params->resource_sub_type == +BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT ) { +/* Store the first HW counter ID for this table */ +if (!ulp_fc_mgr_start_idx_isset (ulp_ctxt, params->direction)) +ulp_fc_mgr_start_idx_set (ulp_ctxt, params->direction, + params->resource_hndl); + +ulp_fc_mgr_cntr_set (ulp_ctxt, params->direction, + params->resource_hndl); + +if (!ulp_fc_mgr_thread_isstarted (ulp_ctxt)) +ulp_fc_mgr_thread_start (ulp_ctxt); + } +/* all good, return success */ return 0 ; }
@@ -574,6 +590,17 @@ int32_t ulp_flow_db_resource_del(struct bnxt_ulp_context *ulp_ctxt, nxt_idx); } +/* Now that the HW Flow counter resource is deleted, reset it's +* corresponding slot in the SW accumulation table in the Flow Counter +* manager +*/ +if (params->resource_type ==TF_TBL_TYPE_ACT_STATS_64 && + params->resource_sub_type == +BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TYPE_INT_COUNT ) { +ulp_fc_mgr_cntr_reset (ulp_ctxt, params->direction, + params->resource_hndl); + } +/* all good, return success */ return 0 ; }
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 50/51 net/bnxt: add support for count action in flow query
In reply to Ajit KhapardeFrom: Somnath Kotur <[email protected]>
Use the flow counter manager to fetch the accumulated stats for a flow.
--- drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c | 45 +++++++- drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c | 141 +++++++++++++++++++++++- drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h | 17 ++- 3 files changed, 196 insertions(+), 7 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c +44 -1
@@ -9,6 +9,7 @@#include "ulp_matcher.h" #include "ulp_flow_db.h" #include "ulp_mapper.h" +#include "ulp_fc_mgr.h" #include <rte_malloc.h> static int32_t
@@ -289,11 +290,53 @@ bnxt_ulp_flow_flush(struct rte_eth_dev *eth_dev,return ret; } +/* Function to query the rte flows. */ +static int32_t +bnxt_ulp_flow_query (struct rte_eth_dev *eth_dev, +struct rte_flow *flow, +const struct rte_flow_action *action, +void *data, +struct rte_flow_error *error) +{ +int rc =0 ; +struct bnxt_ulp_context *ulp_ctx; +struct rte_flow_query_count *count; +uint32_t flow_id; + + ulp_ctx =bnxt_ulp_eth_dev_ptr2_cntxt_get (eth_dev); +if (!ulp_ctx) { +BNXT_TF_DBG (ERR ,"ULP context is not initialized\n" ); +rte_flow_error_set (error,EINVAL , +RTE_FLOW_ERROR_TYPE_HANDLE ,NULL , +"Failed to query flow." ); +return -EINVAL ; + } + + flow_id = (uint32_t )(uintptr_t )flow; + +switch (action->type) { +case RTE_FLOW_ACTION_TYPE_COUNT : + count = data; + rc =ulp_fc_mgr_query_count_get (ulp_ctx, flow_id, count); +if (rc) { +rte_flow_error_set (error,EINVAL , +RTE_FLOW_ERROR_TYPE_HANDLE ,NULL , +"Failed to query flow." ); + } +break ; +default : +rte_flow_error_set (error, -rc,RTE_FLOW_ERROR_TYPE_ACTION_NUM , +NULL ,"Unsupported action item" ); + } + +return rc; +} +const struct rte_flow_ops bnxt_ulp_rte_flow_ops = { .validate = bnxt_ulp_flow_validate, .create = bnxt_ulp_flow_create, .destroy = bnxt_ulp_flow_destroy, .flush = bnxt_ulp_flow_flush, - .query =NULL , + .query = bnxt_ulp_flow_query, .isolate =NULL };
drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c +136 -5
200 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h +16 -1
@@ -23,6 +23,7 @@ struct sw_acc_counter {uint64_t pkt_count;uint64_t byte_count;bool valid; +uint32_t hw_cntr_id; };struct hw_fc_mem_info {
@@ -142,7 +143,21 @@ bool ulp_fc_mgr_start_idx_isset(struct bnxt_ulp_context *ctxt, enum tf_dir dir);* ctxt [in] The ulp context for the flow counter manager * */ -bool ulp_fc_mgr_thread_isstarted (struct bnxt_ulp_context *ctxt); +/* +* Fill the rte_flow_query_count 'data' argument passed +* in the rte_flow_query() with the values obtained and +* accumulated locally. +* +* ctxt [in] The ulp context for the flow counter manager +* +* flow_id [in] The HW flow ID +* +* count [out] The rte_flow_query_count 'data' that is set +* +*/ +int ulp_fc_mgr_query_count_get (struct bnxt_ulp_context *ulp_ctx, +uint32_t flow_id, +struct rte_flow_query_count *count);#endif /* _ULP_FC_MGR_H_ */
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v3 51/51 doc: update release notes
In reply to Ajit KhapardeUpdate release notes with enhancements in Broadcom PMD.
--- doc/guides/rel_notes/release_20_08.rst | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
doc/guides/rel_notes/release_20_08.rst +10 -1
@@ -91,6 +91,16 @@ New Features * Added support for DCF datapath configuration. +* **Updated Broadcom bnxt driver.** + + Updated the Broadcom bnxt driver with new features and improvements, including: + + * Added support for VF representors. + * Added support for multiple devices. + * Added support for new resource manager API. + * Added support for VXLAN encap/decap. + * Added support for rte_flow_query for COUNT action. + * **Added support for BPF_ABS/BPF_IND load instructions.** Added support for two BPF non-generic instructions:
@@ -107,7 +117,6 @@ New Features * Dump ``rte_flow`` memory consumption. * Measure packet per second forwarding. - Removed Items -------------
Signature · 1 line
2.21.1 (Apple Git-122.3)
v4 cover add features for host-based flow management
In reply to Ferruh Yigitv1->v2:
- update commit message
- rebase patches against latest changes in the tree
- fix signed-off-by tags
- update release notes
v2->v3:
- fix compilation issues
v3->v4:
- rebase against latest dpdk-next-net
Ajit Khaparde (1):
doc: update release notes
Jay Ding (5):
net/bnxt: implement support for TCAM access
net/bnxt: support two level priority for TCAMs
net/bnxt: add external action alloc and free
net/bnxt: implement IF tables set and get
net/bnxt: add global config set and get APIs
Kishore Padmanabha (8):
net/bnxt: integrate with the latest tf core changes net/bnxt: add support for if table processing net/bnxt: disable Tx vector mode if truflow is enabled net/bnxt: add index opcode and operand to mapper table net/bnxt: add support for global resource templates net/bnxt: add support for internal exact match entries net/bnxt: add support for conditional execution of mapper tables net/bnxt: add VF-rep and stat templates
Lance Richardson (1):
net/bnxt: initialize parent PF information
Michael Wildt (7):
net/bnxt: add multi device support
net/bnxt: update multi device design support
net/bnxt: multiple device implementation
net/bnxt: update identifier with remap support
net/bnxt: update RM with residual checker
net/bnxt: update table get to use new design
net/bnxt: add TF register and unregister
Mike Baucom (1):
net/bnxt: add support for internal encap records
Peter Spreadborough (7):
net/bnxt: add support for exact match
net/bnxt: modify EM insert and delete to use HWRM direct net/bnxt: add HCAPI interface support
net/bnxt: support EM and TCAM lookup with table scope net/bnxt: update RM to support HCAPI only net/bnxt: remove table scope from session net/bnxt: add support for EEM System memory
Randy Schacher (2):
net/bnxt: add core changes for EM and EEM lookups net/bnxt: align CFA resources with RM
Shahaji Bhosle (2):
net/bnxt: support bulk table get and mirror
net/bnxt: support two-level priority for TCAMs
Somnath Kotur (7):
net/bnxt: add basic infrastructure for VF representors net/bnxt: add support for VF-reps data path net/bnxt: get IDs for VF-Rep endpoint
net/bnxt: parse representor along with other dev-args net/bnxt: create default flow rules for the VF-rep conduit net/bnxt: add ULP Flow counter Manager
net/bnxt: add support for count action in flow query
Venkat Duvvuru (10):
net/bnxt: modify port db dev interface net/bnxt: get port and function info
net/bnxt: add support for hwrm port phy qcaps net/bnxt: modify port db to handle more info net/bnxt: enable port MAC qcfg command for trusted VF net/bnxt: enhancements for port db
net/bnxt: manage VF to VFR conduit
net/bnxt: fill mapper parameters with default rules info net/bnxt: add port default rules for ingress and egress net/bnxt: fill cfa action in the Tx descriptor
config/common_base | 1 + doc/guides/rel_notes/release_20_08.rst | 11 +- drivers/net/bnxt/Makefile | 8 +- drivers/net/bnxt/bnxt.h | 121 +- drivers/net/bnxt/bnxt_ethdev.c | 519 +- drivers/net/bnxt/bnxt_hwrm.c | 122 +- drivers/net/bnxt/bnxt_hwrm.h | 7 + drivers/net/bnxt/bnxt_reps.c | 773 +++ drivers/net/bnxt/bnxt_reps.h | 45 + drivers/net/bnxt/bnxt_rxr.c | 39 +- drivers/net/bnxt/bnxt_rxr.h | 1 + drivers/net/bnxt/bnxt_txq.h | 2 + drivers/net/bnxt/bnxt_txr.c | 18 +- drivers/net/bnxt/hcapi/Makefile | 10 + drivers/net/bnxt/hcapi/cfa_p40_hw.h | 781 +++ drivers/net/bnxt/hcapi/cfa_p40_tbl.h | 303 + drivers/net/bnxt/hcapi/hcapi_cfa.h | 276 + drivers/net/bnxt/hcapi/hcapi_cfa_defs.h | 672 +++ drivers/net/bnxt/hcapi/hcapi_cfa_p4.c | 399 ++ drivers/net/bnxt/hcapi/hcapi_cfa_p4.h | 467 ++ drivers/net/bnxt/hsi_struct_def_dpdk.h | 3091 ++++++++-- drivers/net/bnxt/meson.build | 21 +- drivers/net/bnxt/tf_core/Makefile | 29 +- drivers/net/bnxt/tf_core/bitalloc.c | 107 + drivers/net/bnxt/tf_core/bitalloc.h | 5 + drivers/net/bnxt/tf_core/cfa_resource_types.h | 293 + drivers/net/bnxt/tf_core/hwrm_tf.h | 995 +--- drivers/net/bnxt/tf_core/ll.c | 52 + drivers/net/bnxt/tf_core/ll.h | 46 + drivers/net/bnxt/tf_core/lookup3.h | 1 - drivers/net/bnxt/tf_core/stack.c | 8 + drivers/net/bnxt/tf_core/stack.h | 10 + drivers/net/bnxt/tf_core/tf_common.h | 43 + drivers/net/bnxt/tf_core/tf_core.c | 1495 +++-- drivers/net/bnxt/tf_core/tf_core.h | 874 ++- drivers/net/bnxt/tf_core/tf_device.c | 271 + drivers/net/bnxt/tf_core/tf_device.h | 650 ++ drivers/net/bnxt/tf_core/tf_device_p4.c | 147 + drivers/net/bnxt/tf_core/tf_device_p4.h | 104 + drivers/net/bnxt/tf_core/tf_em.c | 515 -- drivers/net/bnxt/tf_core/tf_em.h | 492 +- drivers/net/bnxt/tf_core/tf_em_common.c | 1048 ++++ drivers/net/bnxt/tf_core/tf_em_common.h | 134 + drivers/net/bnxt/tf_core/tf_em_host.c | 531 ++ drivers/net/bnxt/tf_core/tf_em_internal.c | 352 ++ drivers/net/bnxt/tf_core/tf_em_system.c | 533 ++ drivers/net/bnxt/tf_core/tf_ext_flow_handle.h | 12 + drivers/net/bnxt/tf_core/tf_global_cfg.c | 199 + drivers/net/bnxt/tf_core/tf_global_cfg.h | 170 + drivers/net/bnxt/tf_core/tf_identifier.c | 186 + drivers/net/bnxt/tf_core/tf_identifier.h | 147 + drivers/net/bnxt/tf_core/tf_if_tbl.c | 178 + drivers/net/bnxt/tf_core/tf_if_tbl.h | 236 + drivers/net/bnxt/tf_core/tf_msg.c | 1681 +++--- drivers/net/bnxt/tf_core/tf_msg.h | 409 +- drivers/net/bnxt/tf_core/tf_resources.h | 531 -- drivers/net/bnxt/tf_core/tf_rm.c | 3840 +++--------- drivers/net/bnxt/tf_core/tf_rm.h | 554 +- drivers/net/bnxt/tf_core/tf_session.c | 776 +++ drivers/net/bnxt/tf_core/tf_session.h | 565 +- drivers/net/bnxt/tf_core/tf_shadow_tbl.c | 63 + drivers/net/bnxt/tf_core/tf_shadow_tbl.h | 240 + drivers/net/bnxt/tf_core/tf_shadow_tcam.c | 63 + drivers/net/bnxt/tf_core/tf_shadow_tcam.h | 239 + drivers/net/bnxt/tf_core/tf_tbl.c | 1930 +----- drivers/net/bnxt/tf_core/tf_tbl.h | 469 +- drivers/net/bnxt/tf_core/tf_tcam.c | 430 ++ drivers/net/bnxt/tf_core/tf_tcam.h | 360 ++ drivers/net/bnxt/tf_core/tf_util.c | 176 + drivers/net/bnxt/tf_core/tf_util.h | 98 + drivers/net/bnxt/tf_core/tfp.c | 33 +- drivers/net/bnxt/tf_core/tfp.h | 153 +- drivers/net/bnxt/tf_ulp/Makefile | 2 + drivers/net/bnxt/tf_ulp/bnxt_tf_common.h | 16 + drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 129 +- drivers/net/bnxt/tf_ulp/bnxt_ulp.h | 35 + drivers/net/bnxt/tf_ulp/bnxt_ulp_flow.c | 84 +- drivers/net/bnxt/tf_ulp/ulp_def_rules.c | 385 ++ drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c | 596 ++ drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h | 163 + drivers/net/bnxt/tf_ulp/ulp_flow_db.c | 42 +- drivers/net/bnxt/tf_ulp/ulp_mapper.c | 481 +- drivers/net/bnxt/tf_ulp/ulp_mapper.h | 6 +- drivers/net/bnxt/tf_ulp/ulp_mark_mgr.c | 10 + drivers/net/bnxt/tf_ulp/ulp_port_db.c | 235 +- drivers/net/bnxt/tf_ulp/ulp_port_db.h | 122 +- drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 30 +- drivers/net/bnxt/tf_ulp/ulp_template_db_act.c | 433 +- .../net/bnxt/tf_ulp/ulp_template_db_class.c | 5217 +++++++++++++---- .../net/bnxt/tf_ulp/ulp_template_db_enum.h | 537 +- .../net/bnxt/tf_ulp/ulp_template_db_field.h | 463 +- drivers/net/bnxt/tf_ulp/ulp_template_db_tbl.c | 85 +- drivers/net/bnxt/tf_ulp/ulp_template_struct.h | 23 +- drivers/net/bnxt/tf_ulp/ulp_utils.c | 2 +- 94 files changed, 28009 insertions(+), 11247 deletions(-) create mode 100644 drivers/net/bnxt/bnxt_reps.c create mode 100644 drivers/net/bnxt/bnxt_reps.h create mode 100644 drivers/net/bnxt/hcapi/Makefile create mode 100644 drivers/net/bnxt/hcapi/cfa_p40_hw.h create mode 100644 drivers/net/bnxt/hcapi/cfa_p40_tbl.h create mode 100644 drivers/net/bnxt/hcapi/hcapi_cfa.h create mode 100644 drivers/net/bnxt/hcapi/hcapi_cfa_defs.h create mode 100644 drivers/net/bnxt/hcapi/hcapi_cfa_p4.c create mode 100644 drivers/net/bnxt/hcapi/hcapi_cfa_p4.h create mode 100644 drivers/net/bnxt/tf_core/cfa_resource_types.h create mode 100644 drivers/net/bnxt/tf_core/ll.c create mode 100644 drivers/net/bnxt/tf_core/ll.h create mode 100644 drivers/net/bnxt/tf_core/tf_common.h create mode 100644 drivers/net/bnxt/tf_core/tf_device.c create mode 100644 drivers/net/bnxt/tf_core/tf_device.h create mode 100644 drivers/net/bnxt/tf_core/tf_device_p4.c create mode 100644 drivers/net/bnxt/tf_core/tf_device_p4.h delete mode 100644 drivers/net/bnxt/tf_core/tf_em.c create mode 100644 drivers/net/bnxt/tf_core/tf_em_common.c create mode 100644 drivers/net/bnxt/tf_core/tf_em_common.h create mode 100644 drivers/net/bnxt/tf_core/tf_em_host.c create mode 100644 drivers/net/bnxt/tf_core/tf_em_internal.c create mode 100644 drivers/net/bnxt/tf_core/tf_em_system.c create mode 100644 drivers/net/bnxt/tf_core/tf_global_cfg.c create mode 100644 drivers/net/bnxt/tf_core/tf_global_cfg.h create mode 100644 drivers/net/bnxt/tf_core/tf_identifier.c create mode 100644 drivers/net/bnxt/tf_core/tf_identifier.h create mode 100644 drivers/net/bnxt/tf_core/tf_if_tbl.c create mode 100644 drivers/net/bnxt/tf_core/tf_if_tbl.h create mode 100644 drivers/net/bnxt/tf_core/tf_session.c create mode 100644 drivers/net/bnxt/tf_core/tf_shadow_tbl.c create mode 100644 drivers/net/bnxt/tf_core/tf_shadow_tbl.h create mode 100644 drivers/net/bnxt/tf_core/tf_shadow_tcam.c create mode 100644 drivers/net/bnxt/tf_core/tf_shadow_tcam.h create mode 100644 drivers/net/bnxt/tf_core/tf_tcam.c create mode 100644 drivers/net/bnxt/tf_core/tf_tcam.h create mode 100644 drivers/net/bnxt/tf_core/tf_util.c create mode 100644 drivers/net/bnxt/tf_core/tf_util.h create mode 100644 drivers/net/bnxt/tf_ulp/ulp_def_rules.c create mode 100644 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c create mode 100644 drivers/net/bnxt/tf_ulp/ulp_fc_mgr.h
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 1/51 net/bnxt: add basic infrastructure for VF reps
From: Somnath Kotur <[email protected]>
Defines data structures and code to init/uninit
VF representors during pci_probe and pci_remove respectively.
Most of the dev_ops for the VF representor are just stubs for now and will be will be filled out in next patch.
To create a representor using testpmd:
testpmd -c 0xff -wB:D.F,representor=1 -- -i
testpmd -c 0xff -w05:02.0,representor=[1] -- -i
To create a representor using ovs-dpdk:
1. Firt add the trusted VF port to a bridge
ovs-vsctl add-port ovsbr0 vf_rep1 -- set Interface vf_rep1 type=dpdk options:dpdk-devargs=0000:06:02.0
2. Add the representor port to the bridge
ovs-vsctl add-port ovsbr0 vf_rep1 -- set Interface vf_rep1 type=dpdk options:dpdk-devargs=0000:06:02.0,representor=1
--- drivers/net/bnxt/Makefile | 2 + drivers/net/bnxt/bnxt.h | 64 +++++++- drivers/net/bnxt/bnxt_ethdev.c | 225 ++++++++++++++++++++------ drivers/net/bnxt/bnxt_reps.c | 287 +++++++++++++++++++++++++++++++++ drivers/net/bnxt/bnxt_reps.h | 35 ++++ drivers/net/bnxt/meson.build | 1 + 6 files changed, 566 insertions(+), 48 deletions(-) create mode 100644 drivers/net/bnxt/bnxt_reps.c create mode 100644 drivers/net/bnxt/bnxt_reps.h
drivers/net/bnxt/Makefile +2 -0
@@ -14,6 +14,7 @@ LIB = librte_pmd_bnxt.a EXPORT_MAP := rte_pmd_bnxt_version.map CFLAGS += -O3 +CFLAGS += -DALLOW_EXPERIMENTAL_API CFLAGS += $(WERROR_FLAGS) LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs
@@ -38,6 +39,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_txr.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_vnic.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_irq.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_util.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_reps.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += rte_pmd_bnxt.c ifeq ($(CONFIG_RTE_ARCH_X86), y) SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_sse.c
drivers/net/bnxt/bnxt.h +63 -1
107 lines not on this page · raw message
drivers/net/bnxt/bnxt_ethdev.c +178 -47
304 lines not on this page · raw message
drivers/net/bnxt/bnxt_reps.c new file +287 -0
287 lines not on this page · raw message
drivers/net/bnxt/bnxt_reps.h new file +35 -0
@@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2014-2020 Broadcom +* All rights reserved. +*/ + +#ifndef _BNXT_REPS_H_ +#define _BNXT_REPS_H_ + +#include <rte_malloc.h> +#include <rte_ethdev.h> + +int bnxt_vf_representor_init (struct rte_eth_dev *eth_dev,void *params); +int bnxt_vf_representor_uninit (struct rte_eth_dev *eth_dev); +int bnxt_vf_rep_dev_info_get_op (struct rte_eth_dev *eth_dev, +struct rte_eth_dev_info *dev_info); +int bnxt_vf_rep_dev_configure_op (struct rte_eth_dev *eth_dev); + +int bnxt_vf_rep_link_update_op (struct rte_eth_dev *eth_dev,int wait_to_compl); +int bnxt_vf_rep_dev_start_op (struct rte_eth_dev *eth_dev); +int bnxt_vf_rep_rx_queue_setup_op (struct rte_eth_dev *eth_dev, + __rte_unused uint16_t queue_idx, + __rte_unused uint16_t nb_desc, + __rte_unused unsigned int socket_id, + __rte_unused const struct rte_eth_rxconf * + rx_conf, + __rte_unused struct rte_mempool *mp); +int bnxt_vf_rep_tx_queue_setup_op (struct rte_eth_dev *eth_dev, + __rte_unused uint16_t queue_idx, + __rte_unused uint16_t nb_desc, + __rte_unused unsigned int socket_id, + __rte_unused const struct rte_eth_txconf * + tx_conf); +void bnxt_vf_rep_dev_stop_op (struct rte_eth_dev *eth_dev); +void bnxt_vf_rep_dev_close_op (struct rte_eth_dev *eth_dev); +#endif /* _BNXT_REPS_H_ */
drivers/net/bnxt/meson.build +1 -0
@@ -21,6 +21,7 @@ sources = files('bnxt_cpr.c', 'bnxt_txr.c', 'bnxt_util.c', 'bnxt_vnic.c', + 'bnxt_reps.c', 'tf_core/tf_core.c', 'tf_core/bitalloc.c',
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 2/51 net/bnxt: add support for VF-reps data path
In reply to Ajit KhapardeFrom: Somnath Kotur <[email protected]>
Added code to support Tx/Rx from a VF representor port.
The VF-reps use the RX/TX rings of the Trusted VF/PF.
For each VF-rep, the Trusted VF/PF driver issues a VFR_ALLOC FW cmd that returns "cfa_code" and "cfa_action" values.
The FW sets up the filter tables in such a way that VF traffic by default (in absence of other rules) gets punted to the parent function i.e. either the Trusted VF or the PF.
The cfa_code value in the RX-compl informs the driver of the source VF. For traffic being transmitted from the VF-rep, the TX BD is tagged with a cfa_action value that informs the HW to punt it to the corresponding VF.
--- drivers/net/bnxt/bnxt.h | 30 ++- drivers/net/bnxt/bnxt_ethdev.c | 150 ++++++++--- drivers/net/bnxt/bnxt_reps.c | 476 +++++++++++++++++++++++++++++++-- drivers/net/bnxt/bnxt_reps.h | 11 + drivers/net/bnxt/bnxt_rxr.c | 22 +- drivers/net/bnxt/bnxt_rxr.h | 1 + drivers/net/bnxt/bnxt_txq.h | 1 + drivers/net/bnxt/bnxt_txr.c | 4 +- 8 files changed, 616 insertions(+), 79 deletions(-)
drivers/net/bnxt/bnxt.h +24 -6
@@ -495,6 +495,7 @@ struct bnxt_mark_info {struct bnxt_rep_info {struct rte_eth_dev *vfr_eth_dev; +pthread_mutex_t vfr_lock; };/* address space location of register */
@@ -755,7 +756,8 @@ struct bnxt {uint16_t fw_reset_max_msecs;uint16_t switch_domain_id;uint16_t num_reps; -struct bnxt_rep_info rep_info[BNXT_MAX_VF_REPS ]; +struct bnxt_rep_info *rep_info; +uint16_t *cfa_code_map;/* Struct to hold adapter error recovery related info */ struct bnxt_error_recovery_info *recovery_info;#define BNXT_MARK_TABLE_SZ (sizeof(struct bnxt_mark_info) * 64 * 1024)
@@ -780,12 +782,28 @@ struct bnxt {* Structure to store private data for each VF representor instance */ struct bnxt_vf_representor { -uint16_t switch_domain_id; -uint16_t vf_id; +uint16_t switch_domain_id; +uint16_t vf_id; +uint16_t tx_cfa_action; +uint16_t rx_cfa_code;/* Private data store of associated PF/Trusted VF */ -struct bnxt *parent_priv; -uint8_t mac_addr[RTE_ETHER_ADDR_LEN ]; -uint8_t dflt_mac_addr[RTE_ETHER_ADDR_LEN ]; +struct rte_eth_dev *parent_dev; +uint8_t mac_addr[RTE_ETHER_ADDR_LEN ]; +uint8_t dflt_mac_addr[RTE_ETHER_ADDR_LEN ]; +struct bnxt_rx_queue **rx_queues; +unsigned int rx_nr_rings; +unsigned int tx_nr_rings; +uint64_t tx_pkts[BNXT_MAX_VF_REP_RINGS ]; +uint64_t tx_bytes[BNXT_MAX_VF_REP_RINGS ]; +uint64_t rx_pkts[BNXT_MAX_VF_REP_RINGS ]; +uint64_t rx_bytes[BNXT_MAX_VF_REP_RINGS ]; +uint64_t rx_drop_pkts[BNXT_MAX_VF_REP_RINGS ]; +uint64_t rx_drop_bytes[BNXT_MAX_VF_REP_RINGS ]; +}; + +struct bnxt_vf_rep_tx_queue { +struct bnxt_tx_queue *txq; +struct bnxt_vf_representor *bp; };int bnxt_mtu_set_op (struct rte_eth_dev *eth_dev,uint16_t new_mtu);
drivers/net/bnxt/bnxt_ethdev.c +108 -42
209 lines not on this page · raw message
drivers/net/bnxt/bnxt_reps.c +449 -27
565 lines not on this page · raw message
drivers/net/bnxt/bnxt_reps.h +11 -0
@@ -9,6 +9,12 @@#include <rte_malloc.h> #include <rte_ethdev.h> +#define BNXT_MAX_CFA_CODE 65536 +#define BNXT_VF_IDX_INVALID 0xffff + +uint16_t +bnxt_vfr_recv (struct bnxt *bp,uint16_t cfa_code,uint16_t queue_id, +struct rte_mbuf *mbuf);int bnxt_vf_representor_init (struct rte_eth_dev *eth_dev,void *params);int bnxt_vf_representor_uninit (struct rte_eth_dev *eth_dev); int bnxt_vf_rep_dev_info_get_op(struct rte_eth_dev *eth_dev,
@@ -30,6 +36,11 @@ int bnxt_vf_rep_tx_queue_setup_op(struct rte_eth_dev *eth_dev, __rte_unused unsigned int socket_id, __rte_unused const struct rte_eth_txconf * tx_conf); +void bnxt_vf_rep_rx_queue_release_op (void *rx_queue); +void bnxt_vf_rep_tx_queue_release_op (void *tx_queue);void bnxt_vf_rep_dev_stop_op (struct rte_eth_dev *eth_dev);void bnxt_vf_rep_dev_close_op (struct rte_eth_dev *eth_dev); +int bnxt_vf_rep_stats_get_op (struct rte_eth_dev *eth_dev, +struct rte_eth_stats *stats); +int bnxt_vf_rep_stats_reset_op (struct rte_eth_dev *eth_dev);#endif /* _BNXT_REPS_H_ */
drivers/net/bnxt/bnxt_rxr.c +20 -2
@@ -12,6 +12,7 @@#include <rte_memory.h> #include "bnxt.h" +#include "bnxt_reps.h" #include "bnxt_ring.h" #include "bnxt_rxr.h" #include "bnxt_rxq.h"
@@ -539,7 +540,7 @@ void bnxt_set_mark_in_mbuf(struct bnxt *bp, }static int bnxt_rx_pkt (struct rte_mbuf **rx_pkt, -struct bnxt_rx_queue *rxq,uint32_t *raw_cons) +struct bnxt_rx_queue *rxq,uint32_t *raw_cons) {struct bnxt_cp_ring_info *cpr = rxq->cp_ring;struct bnxt_rx_ring_info *rxr = rxq->rx_ring;
@@ -735,6 +736,20 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt, rx: *rx_pkt = mbuf; +if ((BNXT_VF_IS_TRUSTED (rxq->bp) ||BNXT_PF (rxq->bp)) && + rxq->bp->cfa_code_map && rxcmp1->cfa_code) { +if (!bnxt_vfr_recv (rxq->bp, rxcmp1->cfa_code, rxq->queue_id, + mbuf)) { +/* Now return an error so that nb_rx_pkts is not +* incremented. +* This packet was meant to be given to the representor. +* So no need to account the packet and give it to +* parent Rx burst function. +*/ + rc = -ENODEV ; + } + } + next_rx: *raw_cons = tmp_raw_cons;
@@ -751,6 +766,7 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,uint32_t raw_cons = cpr->cp_raw_cons;uint32_t cons;int nb_rx_pkts =0 ; +int nb_rep_rx_pkts =0 ;struct rx_pkt_cmpl *rxcmp;uint16_t prod = rxr->rx_prod;uint16_t ag_prod = rxr->ag_prod;
@@ -784,6 +800,8 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, nb_rx_pkts++;if (rc == -EBUSY )/* partial completion */ break ; +if (rc == -ENODEV )/* completion for representor */ + nb_rep_rx_pkts++; }else if (!BNXT_NUM_ASYNC_CPR (rxq->bp)) { evt = bnxt_event_hwrm_resp_handler(rxq->bp,
@@ -802,7 +820,7 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, } cpr->cp_raw_cons = raw_cons; -if (!nb_rx_pkts && !evt) { +if (!nb_rx_pkts && !nb_rep_rx_pkts && !evt) {/* * For PMD, there is no need to keep on pushing to REARM * the doorbell if there are no new completions
drivers/net/bnxt/bnxt_rxr.h +1 -0
@@ -188,6 +188,7 @@ struct bnxt_sw_rx_bd {struct bnxt_rx_ring_info {uint16_t rx_prod;uint16_t ag_prod; +uint16_t rx_cons;/* Needed for representor */ struct bnxt_db_info rx_db;struct bnxt_db_info ag_db;
drivers/net/bnxt/bnxt_txq.h +1 -0
@@ -29,6 +29,7 @@ struct bnxt_tx_queue {struct bnxt *bp;int index;int tx_wake_thresh; +uint32_t tx_cfa_action;struct bnxt_tx_ring_info *tx_ring;unsigned int cp_nr_rings;
drivers/net/bnxt/bnxt_txr.c +2 -2
@@ -131,7 +131,7 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,PKT_TX_VLAN_PKT |PKT_TX_OUTER_IP_CKSUM |PKT_TX_TUNNEL_GRE |PKT_TX_TUNNEL_VXLAN |PKT_TX_TUNNEL_GENEVE |PKT_TX_IEEE1588_TMST | - PKT_TX_QINQ_PKT)) + PKT_TX_QINQ_PKT) || txq->tx_cfa_action) long_bd = true; nr_bds = long_bd + tx_pkt->nb_segs;
@@ -184,7 +184,7 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,if (long_bd) { txbd->flags_type |=TX_BD_LONG_TYPE_TX_BD_LONG ; vlan_tag_flags =0 ; - cfa_action =0 ; + cfa_action = txq->tx_cfa_action;/* HW can accelerate only outer vlan in QinQ mode */ if (tx_buf->mbuf->ol_flags &PKT_TX_QINQ_PKT ) { vlan_tag_flags = TX_BD_LONG_CFA_META_KEY_VLAN_TAG |
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 3/51 net/bnxt: get IDs for VF-Rep endpoint
In reply to Ajit KhapardeFrom: Somnath Kotur <[email protected]>
Use 'first_vf_id' and the 'vf_id' that is input as part of adding a representor to obtain the PCI function ID(FID) of the VF(VFR endpoint). Use the FID as an input to FUNC_QCFG HWRM cmd to obtain the default vnic ID of the VF.
Along with getting the default vNIC ID by supplying the FW FID of the VF-rep endpoint to HWRM_FUNC_QCFG, obtain and store it's function svif.
--- drivers/net/bnxt/bnxt.h | 3 +++ drivers/net/bnxt/bnxt_hwrm.c | 27 +++++++++++++++++++++++++++ drivers/net/bnxt/bnxt_hwrm.h | 4 ++++ drivers/net/bnxt/bnxt_reps.c | 12 ++++++++++++ 4 files changed, 46 insertions(+)
drivers/net/bnxt/bnxt.h +3 -0
@@ -784,6 +784,9 @@ struct bnxt {struct bnxt_vf_representor {uint16_t switch_domain_id;uint16_t vf_id; +uint16_t fw_fid; +uint16_t dflt_vnic_id; +uint16_t svif;uint16_t tx_cfa_action;uint16_t rx_cfa_code;/* Private data store of associated PF/Trusted VF */
drivers/net/bnxt/bnxt_hwrm.c +27 -0
@@ -3094,6 +3094,33 @@ int bnxt_hwrm_func_qcfg(struct bnxt *bp, uint16_t *mtu)return rc; } +int bnxt_hwrm_get_dflt_vnic_svif (struct bnxt *bp,uint16_t fid, +uint16_t *vnic_id,uint16_t *svif) +{ +struct hwrm_func_qcfg_input req = {0 }; +struct hwrm_func_qcfg_output *resp = bp->hwrm_cmd_resp_addr; +uint16_t svif_info; +int rc =0 ; + +HWRM_PREP (&req,HWRM_FUNC_QCFG ,BNXT_USE_CHIMP_MB ); + req.fid =rte_cpu_to_le_16 (fid); + + rc =bnxt_hwrm_send_message (bp, &req,sizeof (req),BNXT_USE_CHIMP_MB ); + +HWRM_CHECK_RESULT (); + +if (vnic_id) + *vnic_id =rte_le_to_cpu_16 (resp->dflt_vnic_id); + + svif_info =rte_le_to_cpu_16 (resp->svif_info); +if (svif && (svif_info &HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_VALID )) + *svif = svif_info &HWRM_FUNC_QCFG_OUTPUT_SVIF_INFO_SVIF_MASK ; + +HWRM_UNLOCK (); + +return rc; +} +int bnxt_hwrm_port_mac_qcfg (struct bnxt *bp) {struct hwrm_port_mac_qcfg_input req = {0 };
drivers/net/bnxt/bnxt_hwrm.h +4 -0
@@ -270,4 +270,8 @@ int bnxt_hwrm_cfa_counter_qstats(struct bnxt *bp,enum bnxt_flow_dir dir, uint16_t cntr, uint16_t num_entries); +int bnxt_hwrm_get_dflt_vnic_id (struct bnxt *bp,uint16_t fid, +uint16_t *vnic_id); +int bnxt_hwrm_get_dflt_vnic_svif (struct bnxt *bp,uint16_t fid, +uint16_t *vnic_id,uint16_t *svif);#endif
drivers/net/bnxt/bnxt_reps.c +12 -0
@@ -150,6 +150,7 @@ int bnxt_vf_representor_init(struct rte_eth_dev *eth_dev, void *params) (struct bnxt_vf_representor *)params;struct rte_eth_link *link;struct bnxt *parent_bp; +int rc =0 ; vf_rep_bp->vf_id = rep_params->vf_id; vf_rep_bp->switch_domain_id = rep_params->switch_domain_id;
@@ -179,6 +180,17 @@ int bnxt_vf_representor_init(struct rte_eth_dev *eth_dev, void *params) eth_dev->data->dev_link.link_status = link->link_status; eth_dev->data->dev_link.link_autoneg = link->link_autoneg; + vf_rep_bp->fw_fid = rep_params->vf_id + parent_bp->first_vf_id; +PMD_DRV_LOG (INFO ,"vf_rep->fw_fid = %d\n" , vf_rep_bp->fw_fid); + rc =bnxt_hwrm_get_dflt_vnic_svif (parent_bp, vf_rep_bp->fw_fid, + &vf_rep_bp->dflt_vnic_id, + &vf_rep_bp->svif); +if (rc) +PMD_DRV_LOG (ERR ,"Failed to get default vnic id of VF\n" ); +else +PMD_DRV_LOG (INFO ,"vf_rep->dflt_vnic_id = %d\n" , + vf_rep_bp->dflt_vnic_id); +PMD_DRV_LOG (INFO ,"calling bnxt_print_link_info\n" );bnxt_print_link_info (eth_dev);
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 4/51 net/bnxt: initialize parent PF information
In reply to Ajit KhapardeFrom: Lance Richardson <[email protected]>
Add support to query parent PF information (MAC address, function ID, port ID and default VNIC) from firmware.
Current firmware returns zero for parent default vnic, a temporary Wh+-specific workaround is included until that can be fixed.
--- drivers/net/bnxt/bnxt.h | 9 ++++++++ drivers/net/bnxt/bnxt_ethdev.c | 23 +++++++++++++++++++ drivers/net/bnxt/bnxt_hwrm.c | 42 ++++++++++++++++++++++++++++++++++ drivers/net/bnxt/bnxt_hwrm.h | 1 + 4 files changed, 75 insertions(+)
drivers/net/bnxt/bnxt.h +9 -0
@@ -217,6 +217,14 @@ struct bnxt_child_vf_info {bool persist_stats; }; +struct bnxt_parent_info { +#define BNXT_PF_FID_INVALID 0xFFFF +uint16_t fid; +uint16_t vnic; +uint16_t port_id; +uint8_t mac_addr[RTE_ETHER_ADDR_LEN ]; +}; +struct bnxt_pf_info {#define BNXT_FIRST_PF_FID 1#define BNXT_MAX_VFS (bp) ((bp)->pf->max_vfs)
@@ -738,6 +746,7 @@ struct bnxt {#define BNXT_OUTER_TPID_BD_SHFT 16uint32_t outer_tpid_bd;struct bnxt_pf_info *pf; +struct bnxt_parent_info *parent;uint8_t vxlan_port_cnt;uint8_t geneve_port_cnt;uint16_t vxlan_port;
drivers/net/bnxt/bnxt_ethdev.c +23 -0
@@ -97,6 +97,7 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {#define BNXT_DEVARG_TRUFLOW "host-based-truflow"#define BNXT_DEVARG_FLOW_XSTAT "flow-xstat"#define BNXT_DEVARG_MAX_NUM_KFLOWS "max-num-kflows" +static const char *const bnxt_dev_args[] = {BNXT_DEVARG_TRUFLOW ,BNXT_DEVARG_FLOW_XSTAT ,
@@ -173,6 +174,11 @@ uint16_t bnxt_rss_hash_tbl_size(const struct bnxt *bp)return bnxt_rss_ctxts (bp) *BNXT_RSS_ENTRIES_PER_CTX_THOR ; } +static void bnxt_free_parent_info (struct bnxt *bp) +{ +rte_free (bp->parent); +} +static void bnxt_free_pf_info (struct bnxt *bp) {rte_free (bp->pf);
@@ -223,6 +229,16 @@ static void bnxt_free_mem(struct bnxt *bp, bool reconfig) bp->grp_info =NULL ; } +static int bnxt_alloc_parent_info (struct bnxt *bp) +{ + bp->parent =rte_zmalloc ("bnxt_parent_info" , +sizeof (struct bnxt_parent_info ),0 ); +if (bp->parent ==NULL ) +return -ENOMEM ; + +return 0 ; +} +static int bnxt_alloc_pf_info (struct bnxt *bp) { bp->pf =rte_zmalloc ("bnxt_pf_info" ,sizeof (struct bnxt_pf_info ),0 );
@@ -1322,6 +1338,7 @@ static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev)bnxt_free_cos_queues (bp);bnxt_free_link_info (bp);bnxt_free_pf_info (bp); +bnxt_free_parent_info (bp); eth_dev->dev_ops =NULL ; eth_dev->rx_pkt_burst =NULL ;
@@ -5210,6 +5227,8 @@ static int bnxt_init_fw(struct bnxt *bp)bnxt_hwrm_port_mac_qcfg (bp); +bnxt_hwrm_parent_pf_qcfg (bp); + rc =bnxt_hwrm_cfa_adv_flow_mgmt_qcaps (bp);if (rc)return rc;
@@ -5528,6 +5547,10 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev, void *params __rte_unused)if (rc) goto error_free; + rc =bnxt_alloc_parent_info (bp); +if (rc) + goto error_free; + rc =bnxt_alloc_hwrm_resources (bp);if (rc) { PMD_DRV_LOG(ERR,
drivers/net/bnxt/bnxt_hwrm.c +42 -0
48 lines not on this page · raw message
drivers/net/bnxt/bnxt_hwrm.h +1 -0
@@ -274,4 +274,5 @@ int bnxt_hwrm_get_dflt_vnic_id(struct bnxt *bp, uint16_t fid, uint16_t *vnic_id);int bnxt_hwrm_get_dflt_vnic_svif (struct bnxt *bp,uint16_t fid,uint16_t *vnic_id,uint16_t *svif); +int bnxt_hwrm_parent_pf_qcfg (struct bnxt *bp);#endif
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 5/51 net/bnxt: modify port db dev interface
In reply to Ajit KhapardeFrom: Venkat Duvvuru <[email protected]>
Modify ulp_port_db_dev_port_intf_update prototype to take "struct rte_eth_dev *" as the second parameter.
--- drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 4 ++-- drivers/net/bnxt/tf_ulp/ulp_port_db.c | 5 +++-- drivers/net/bnxt/tf_ulp/ulp_port_db.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-)
drivers/net/bnxt/tf_ulp/bnxt_ulp.c +2 -2
@@ -548,7 +548,7 @@ bnxt_ulp_init(struct bnxt *bp) }/* update the port database */ - rc =ulp_port_db_dev_port_intf_update (bp->ulp_ctx, bp); + rc =ulp_port_db_dev_port_intf_update (bp->ulp_ctx, bp->eth_dev);if (rc) {BNXT_TF_DBG (ERR ,"Failed to update port database\n" );
@@ -584,7 +584,7 @@ bnxt_ulp_init(struct bnxt *bp) }/* update the port database */ - rc =ulp_port_db_dev_port_intf_update (bp->ulp_ctx, bp); + rc =ulp_port_db_dev_port_intf_update (bp->ulp_ctx, bp->eth_dev);if (rc) {BNXT_TF_DBG (ERR ,"Failed to update port database\n" ); goto jump_to_error;
drivers/net/bnxt/tf_ulp/ulp_port_db.c +3 -2
@@ -104,10 +104,11 @@ int32_t ulp_port_db_deinit(struct bnxt_ulp_context *ulp_ctxt)* Returns 0 on success or negative number on failure. */ int32_t ulp_port_db_dev_port_intf_update (struct bnxt_ulp_context *ulp_ctxt, -struct bnxt *bp) +struct rte_eth_dev *eth_dev) {struct bnxt_ulp_port_db *port_db; -uint32_t port_id = bp->eth_dev->data->port_id; +struct bnxt *bp = eth_dev->data->dev_private; +uint32_t port_id = eth_dev->data->port_id;uint32_t ifindex;struct ulp_interface_info *intf;int32_t rc;
drivers/net/bnxt/tf_ulp/ulp_port_db.h +1 -1
@@ -71,7 +71,7 @@ int32_t ulp_port_db_deinit(struct bnxt_ulp_context *ulp_ctxt);* Returns 0 on success or negative number on failure. */ int32_t ulp_port_db_dev_port_intf_update (struct bnxt_ulp_context *ulp_ctxt, -struct bnxt *bp); +struct rte_eth_dev *eth_dev);/* * Api to get the ulp ifindex for a given device port.
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 6/51 net/bnxt: get port and function info
In reply to Ajit KhapardeFrom: Venkat Duvvuru <[email protected]>
add helper functions to get port & function related information like parif, physical port id & vport id.
--- drivers/net/bnxt/bnxt.h | 8 ++++ drivers/net/bnxt/bnxt_ethdev.c | 58 ++++++++++++++++++++++++ drivers/net/bnxt/tf_ulp/bnxt_tf_common.h | 10 ++++ drivers/net/bnxt/tf_ulp/ulp_port_db.h | 10 ---- 4 files changed, 76 insertions(+), 10 deletions(-)
drivers/net/bnxt/bnxt.h +8 -0
@@ -855,6 +855,9 @@ extern const struct rte_flow_ops bnxt_flow_ops; } \ } while (0) +#define BNXT_ETH_DEV_IS_REPRESENTOR (eth_dev) \ + ((eth_dev)->data->dev_flags & RTE_ETH_DEV_REPRESENTOR) +extern int bnxt_logtype_driver; #define PMD_DRV_LOG_RAW(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, bnxt_logtype_driver, "%s(): " fmt, \
@@ -870,6 +873,11 @@ void bnxt_ulp_deinit(struct bnxt *bp);uint16_t bnxt_get_vnic_id (uint16_t port);uint16_t bnxt_get_svif (uint16_t port_id,bool func_svif);uint16_t bnxt_get_fw_func_id (uint16_t port); +uint16_t bnxt_get_parif (uint16_t port); +uint16_t bnxt_get_phy_port_id (uint16_t port); +uint16_t bnxt_get_vport (uint16_t port); +enum bnxt_ulp_intf_type +bnxt_get_interface_type (uint16_t port);void bnxt_cancel_fc_thread (struct bnxt *bp);void bnxt_flow_cnt_alarm_cb (void *arg);
drivers/net/bnxt/bnxt_ethdev.c +58 -0
70 lines not on this page · raw message
drivers/net/bnxt/tf_ulp/bnxt_tf_common.h +10 -0
@@ -44,6 +44,16 @@ enum ulp_direction_type { ULP_DIR_EGRESS, }; +/* enumeration of the interface types */ +enum bnxt_ulp_intf_type { +BNXT_ULP_INTF_TYPE_INVALID =0 , +BNXT_ULP_INTF_TYPE_PF , +BNXT_ULP_INTF_TYPE_VF , +BNXT_ULP_INTF_TYPE_PF_REP , +BNXT_ULP_INTF_TYPE_VF_REP , +BNXT_ULP_INTF_TYPE_LAST +}; +struct bnxt_ulp_mark_tbl *bnxt_ulp_cntxt_ptr2_mark_db_get (struct bnxt_ulp_context *ulp_ctx);
drivers/net/bnxt/tf_ulp/ulp_port_db.h +0 -10
@@ -10,16 +10,6 @@#define BNXT_PORT_DB_MAX_INTF_LIST 256 -/* enumeration of the interface types */ -enum bnxt_ulp_intf_type { -BNXT_ULP_INTF_TYPE_INVALID =0 , -BNXT_ULP_INTF_TYPE_PF =1 , -BNXT_ULP_INTF_TYPE_VF , -BNXT_ULP_INTF_TYPE_PF_REP , -BNXT_ULP_INTF_TYPE_VF_REP , -BNXT_ULP_INTF_TYPE_LAST -}; -/* Structure for the Port database resource information. */ struct ulp_interface_info {enum bnxt_ulp_intf_type type;
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 7/51 net/bnxt: add support for hwrm port phy qcaps
In reply to Ajit KhapardeFrom: Venkat Duvvuru <[email protected]>
Issue HWRM_PORT_PHY_QCAPS to the firmware to get the physical port count of the device.
--- drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_ethdev.c | 2 ++ drivers/net/bnxt/bnxt_hwrm.c | 22 ++++++++++++++++++++++ drivers/net/bnxt/bnxt_hwrm.h | 1 + 4 files changed, 26 insertions(+)
drivers/net/bnxt/bnxt.h +1 -0
@@ -747,6 +747,7 @@ struct bnxt {uint32_t outer_tpid_bd;struct bnxt_pf_info *pf;struct bnxt_parent_info *parent; +uint8_t port_cnt;uint8_t vxlan_port_cnt;uint8_t geneve_port_cnt;uint16_t vxlan_port;
drivers/net/bnxt/bnxt_ethdev.c +2 -0
@@ -5287,6 +5287,8 @@ static int bnxt_init_fw(struct bnxt *bp)bnxt_hwrm_parent_pf_qcfg (bp); +bnxt_hwrm_port_phy_qcaps (bp); + rc =bnxt_hwrm_cfa_adv_flow_mgmt_qcaps (bp);if (rc)return rc;
drivers/net/bnxt/bnxt_hwrm.c +22 -0
@@ -1330,6 +1330,28 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp,return rc; } +int bnxt_hwrm_port_phy_qcaps (struct bnxt *bp) +{ +int rc =0 ; +struct hwrm_port_phy_qcaps_input req = {0 }; +struct hwrm_port_phy_qcaps_output *resp = bp->hwrm_cmd_resp_addr; + +if (BNXT_VF (bp) && !BNXT_VF_IS_TRUSTED (bp)) +return 0 ; + +HWRM_PREP (&req,HWRM_PORT_PHY_QCAPS ,BNXT_USE_CHIMP_MB ); + + rc =bnxt_hwrm_send_message (bp, &req,sizeof (req),BNXT_USE_CHIMP_MB ); + +HWRM_CHECK_RESULT (); + + bp->port_cnt = resp->port_cnt; + +HWRM_UNLOCK (); + +return 0 ; +} +static bool bnxt_find_lossy_profile (struct bnxt *bp) {int i =0 ;
drivers/net/bnxt/bnxt_hwrm.h +1 -0
@@ -275,4 +275,5 @@ int bnxt_hwrm_get_dflt_vnic_id(struct bnxt *bp, uint16_t fid,int bnxt_hwrm_get_dflt_vnic_svif (struct bnxt *bp,uint16_t fid,uint16_t *vnic_id,uint16_t *svif);int bnxt_hwrm_parent_pf_qcfg (struct bnxt *bp); +int bnxt_hwrm_port_phy_qcaps (struct bnxt *bp);#endif
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 8/51 net/bnxt: modify port db to handle more info
In reply to Ajit KhapardeFrom: Venkat Duvvuru <[email protected]>
Apart from func_svif, func_id & vnic, port_db now stores and retrieves func_spif, func_parif, phy_port_id, port_svif, port_spif, port_parif, port_vport. New helper functions have been added to support the same.
--- drivers/net/bnxt/tf_ulp/ulp_port_db.c | 145 +++++++++++++++++++++----- drivers/net/bnxt/tf_ulp/ulp_port_db.h | 72 ++++++++++--- 2 files changed, 179 insertions(+), 38 deletions(-)
drivers/net/bnxt/tf_ulp/ulp_port_db.c +121 -24
@@ -106,13 +106,12 @@ int32_t ulp_port_db_deinit(struct bnxt_ulp_context *ulp_ctxt)int32_t ulp_port_db_dev_port_intf_update (struct bnxt_ulp_context *ulp_ctxt,struct rte_eth_dev *eth_dev) { -struct bnxt_ulp_port_db *port_db; -struct bnxt *bp = eth_dev->data->dev_private;uint32_t port_id = eth_dev->data->port_id; -uint32_t ifindex; +struct ulp_phy_port_info *port_data; +struct bnxt_ulp_port_db *port_db;struct ulp_interface_info *intf; +uint32_t ifindex;int32_t rc; -struct bnxt_vnic_info *vnic; port_db =bnxt_ulp_cntxt_ptr2_port_db_get (ulp_ctxt);if (!port_db) {
@@ -133,22 +132,22 @@ int32_t ulp_port_db_dev_port_intf_update(struct bnxt_ulp_context *ulp_ctxt,/* update the interface details */ intf = &port_db->ulp_intf_list[ifindex]; -if (BNXT_PF (bp) ||BNXT_VF (bp)) { -if (BNXT_PF (bp)) { - intf->type =BNXT_ULP_INTF_TYPE_PF ; - intf->port_svif = bp->port_svif; - }else { - intf->type =BNXT_ULP_INTF_TYPE_VF ; - } - intf->func_id = bp->fw_fid; - intf->func_svif = bp->func_svif; - vnic =BNXT_GET_DEFAULT_VNIC (bp); -if (vnic) - intf->default_vnic = vnic->fw_vnic_id; - intf->bp = bp; -memcpy (intf->mac_addr, bp->mac_addr,sizeof (intf->mac_addr)); - }else { -BNXT_TF_DBG (ERR ,"Invalid interface type\n" ); + + intf->type =bnxt_get_interface_type (port_id); + + intf->func_id =bnxt_get_fw_func_id (port_id); + intf->func_svif =bnxt_get_svif (port_id,1 ); + intf->func_spif =bnxt_get_phy_port_id (port_id); + intf->func_parif =bnxt_get_parif (port_id); + intf->default_vnic =bnxt_get_vnic_id (port_id); + intf->phy_port_id =bnxt_get_phy_port_id (port_id); + +if (intf->type ==BNXT_ULP_INTF_TYPE_PF ) { + port_data = &port_db->phy_port_list[intf->phy_port_id]; + port_data->port_svif =bnxt_get_svif (port_id,0 ); + port_data->port_spif =bnxt_get_phy_port_id (port_id); + port_data->port_parif =bnxt_get_parif (port_id); + port_data->port_vport =bnxt_get_vport (port_id); }return 0 ;
@@ -209,7 +208,7 @@ ulp_port_db_function_id_get(struct bnxt_ulp_context *ulp_ctxt, }/* -* Api to get the svid for a given ulp ifindex. +* Api to get the svif for a given ulp ifindex. * * ulp_ctxt [in] Ptr to ulp context * ifindex [in] ulp ifindex
@@ -225,16 +224,88 @@ ulp_port_db_svif_get(struct bnxt_ulp_context *ulp_ctxt, uint16_t *svif) {struct bnxt_ulp_port_db *port_db; +uint16_t phy_port_id; port_db =bnxt_ulp_cntxt_ptr2_port_db_get (ulp_ctxt);if (!port_db || ifindex >= port_db->ulp_intf_list_size || !ifindex) {BNXT_TF_DBG (ERR ,"Invalid Arguments\n" );return -EINVAL ; } -if (dir ==ULP_DIR_EGRESS ) +if (dir ==ULP_DIR_EGRESS ) { *svif = port_db->ulp_intf_list[ifindex].func_svif; -else - *svif = port_db->ulp_intf_list[ifindex].port_svif; + }else { + phy_port_id = port_db->ulp_intf_list[ifindex].phy_port_id; + *svif = port_db->phy_port_list[phy_port_id].port_svif; + } + +return 0 ; +} + +/* +* Api to get the spif for a given ulp ifindex. +* +* ulp_ctxt [in] Ptr to ulp context +* ifindex [in] ulp ifindex +* dir [in] the direction for the flow. +* spif [out] the spif of the given ifindex. +* +* Returns 0 on success or negative number on failure. +*/ +int32_t +ulp_port_db_spif_get (struct bnxt_ulp_context *ulp_ctxt, +uint32_t ifindex, +uint32_t dir, +uint16_t *spif) +{ +struct bnxt_ulp_port_db *port_db; +uint16_t phy_port_id; + + port_db =bnxt_ulp_cntxt_ptr2_port_db_get (ulp_ctxt); +if (!port_db || ifindex >= port_db->ulp_intf_list_size || !ifindex) { +BNXT_TF_DBG (ERR ,"Invalid Arguments\n" ); +return -EINVAL ; + } +if (dir ==ULP_DIR_EGRESS ) { + *spif = port_db->ulp_intf_list[ifindex].func_spif; + }else { + phy_port_id = port_db->ulp_intf_list[ifindex].phy_port_id; + *spif = port_db->phy_port_list[phy_port_id].port_spif; + } + +return 0 ; +} + +/* +* Api to get the parif for a given ulp ifindex. +* +* ulp_ctxt [in] Ptr to ulp context +* ifindex [in] ulp ifindex +* dir [in] the direction for the flow. +* parif [out] the parif of the given ifindex. +* +* Returns 0 on success or negative number on failure. +*/ +int32_t +ulp_port_db_parif_get (struct bnxt_ulp_context *ulp_ctxt, +uint32_t ifindex, +uint32_t dir, +uint16_t *parif) +{ +struct bnxt_ulp_port_db *port_db; +uint16_t phy_port_id; + + port_db =bnxt_ulp_cntxt_ptr2_port_db_get (ulp_ctxt); +if (!port_db || ifindex >= port_db->ulp_intf_list_size || !ifindex) { +BNXT_TF_DBG (ERR ,"Invalid Arguments\n" ); +return -EINVAL ; + } +if (dir ==ULP_DIR_EGRESS ) { + *parif = port_db->ulp_intf_list[ifindex].func_parif; + }else { + phy_port_id = port_db->ulp_intf_list[ifindex].phy_port_id; + *parif = port_db->phy_port_list[phy_port_id].port_parif; + } +return 0 ; }
@@ -262,3 +333,29 @@ ulp_port_db_default_vnic_get(struct bnxt_ulp_context *ulp_ctxt, *vnic = port_db->ulp_intf_list[ifindex].default_vnic;return 0 ; } + +/* +* Api to get the vport id for a given ulp ifindex. +* +* ulp_ctxt [in] Ptr to ulp context +* ifindex [in] ulp ifindex +* vport [out] the port of the given ifindex. +* +* Returns 0 on success or negative number on failure. +*/ +int32_t +ulp_port_db_vport_get (struct bnxt_ulp_context *ulp_ctxt, +uint32_t ifindex,uint16_t *vport) +{ +struct bnxt_ulp_port_db *port_db; +uint16_t phy_port_id; + + port_db =bnxt_ulp_cntxt_ptr2_port_db_get (ulp_ctxt); +if (!port_db || ifindex >= port_db->ulp_intf_list_size || !ifindex) { +BNXT_TF_DBG (ERR ,"Invalid Arguments\n" ); +return -EINVAL ; + } + phy_port_id = port_db->ulp_intf_list[ifindex].phy_port_id; + *vport = port_db->phy_port_list[phy_port_id].port_vport; +return 0 ; +}
drivers/net/bnxt/tf_ulp/ulp_port_db.h +58 -14
110 lines not on this page · raw message
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 9/51 net/bnxt: add support for exact match
In reply to Ajit KhapardeFrom: Peter Spreadborough <[email protected]>
- Add Exact Match support
- Create EM table pool of memory indices
- Insert exact match internal entry API
- Sends EM internal insert and delete request to firmware
--- drivers/net/bnxt/hsi_struct_def_dpdk.h | 3091 ++++++++++++++--- drivers/net/bnxt/tf_core/hwrm_tf.h | 9 + drivers/net/bnxt/tf_core/lookup3.h | 1 - drivers/net/bnxt/tf_core/stack.c | 8 + drivers/net/bnxt/tf_core/stack.h | 10 + drivers/net/bnxt/tf_core/tf_core.c | 144 +- drivers/net/bnxt/tf_core/tf_core.h | 383 +- drivers/net/bnxt/tf_core/tf_em.c | 98 +- drivers/net/bnxt/tf_core/tf_em.h | 31 + drivers/net/bnxt/tf_core/tf_ext_flow_handle.h | 12 + drivers/net/bnxt/tf_core/tf_msg.c | 86 +- drivers/net/bnxt/tf_core/tf_msg.h | 13 + drivers/net/bnxt/tf_core/tf_session.h | 18 + drivers/net/bnxt/tf_core/tf_tbl.c | 99 +- drivers/net/bnxt/tf_core/tf_tbl.h | 57 +- drivers/net/bnxt/tf_core/tfp.h | 123 +- 16 files changed, 3493 insertions(+), 690 deletions(-)
drivers/net/bnxt/hsi_struct_def_dpdk.h +2656 -435
@@ -611,6 +611,10 @@ struct cmd_nums {#define HWRM_FUNC_VF_BW_QCFG UINT32_C(0x196)/* Queries pf ids belong to specified host(s) */ #define HWRM_FUNC_HOST_PF_IDS_QUERY UINT32_C(0x197) +/* Queries extended stats per function */ +#define HWRM_FUNC_QSTATS_EXT UINT32_C(0x198) +/* Queries exteded statitics context */ +#define HWRM_STAT_EXT_CTX_QUERY UINT32_C(0x199)/* Experimental */ #define HWRM_SELFTEST_QLIST UINT32_C(0x200)/* Experimental */
@@ -647,41 +651,49 @@ struct cmd_nums {/* Experimental */ #define HWRM_TF_SESSION_ATTACH UINT32_C(0x2c7)/* Experimental */ -#define HWRM_TF_SESSION_CLOSE UINT32_C(0x2c8) +#define HWRM_TF_SESSION_REGISTER UINT32_C(0x2c8)/* Experimental */ -#define HWRM_TF_SESSION_QCFG UINT32_C(0x2c9) +#define HWRM_TF_SESSION_UNREGISTER UINT32_C(0x2c9)/* Experimental */ -#define HWRM_TF_SESSION_RESC_QCAPS UINT32_C(0x2ca) +#define HWRM_TF_SESSION_CLOSE UINT32_C(0x2ca)/* Experimental */ -#define HWRM_TF_SESSION_RESC_ALLOC UINT32_C(0x2cb) +#define HWRM_TF_SESSION_QCFG UINT32_C(0x2cb)/* Experimental */ -#define HWRM_TF_SESSION_RESC_FREE UINT32_C(0x2cc) +#define HWRM_TF_SESSION_RESC_QCAPS UINT32_C(0x2cc)/* Experimental */ -#define HWRM_TF_SESSION_RESC_FLUSH UINT32_C(0x2cd) +#define HWRM_TF_SESSION_RESC_ALLOC UINT32_C(0x2cd)/* Experimental */ -#define HWRM_TF_TBL_TYPE_GET UINT32_C(0x2d0) +#define HWRM_TF_SESSION_RESC_FREE UINT32_C(0x2ce)/* Experimental */ -#define HWRM_TF_TBL_TYPE_SET UINT32_C(0x2d1) +#define HWRM_TF_SESSION_RESC_FLUSH UINT32_C(0x2cf)/* Experimental */ -#define HWRM_TF_CTXT_MEM_RGTR UINT32_C(0x2da) +#define HWRM_TF_TBL_TYPE_GET UINT32_C(0x2da)/* Experimental */ -#define HWRM_TF_CTXT_MEM_UNRGTR UINT32_C(0x2db) +#define HWRM_TF_TBL_TYPE_SET UINT32_C(0x2db)/* Experimental */ -#define HWRM_TF_EXT_EM_QCAPS UINT32_C(0x2dc) +#define HWRM_TF_CTXT_MEM_RGTR UINT32_C(0x2e4)/* Experimental */ -#define HWRM_TF_EXT_EM_OP UINT32_C(0x2dd) +#define HWRM_TF_CTXT_MEM_UNRGTR UINT32_C(0x2e5)/* Experimental */ -#define HWRM_TF_EXT_EM_CFG UINT32_C(0x2de) +#define HWRM_TF_EXT_EM_QCAPS UINT32_C(0x2e6)/* Experimental */ -#define HWRM_TF_EXT_EM_QCFG UINT32_C(0x2df) +#define HWRM_TF_EXT_EM_OP UINT32_C(0x2e7)/* Experimental */ -#define HWRM_TF_TCAM_SET UINT32_C(0x2ee) +#define HWRM_TF_EXT_EM_CFG UINT32_C(0x2e8)/* Experimental */ -#define HWRM_TF_TCAM_GET UINT32_C(0x2ef) +#define HWRM_TF_EXT_EM_QCFG UINT32_C(0x2e9)/* Experimental */ -#define HWRM_TF_TCAM_MOVE UINT32_C(0x2f0) +#define HWRM_TF_EM_INSERT UINT32_C(0x2ea)/* Experimental */ -#define HWRM_TF_TCAM_FREE UINT32_C(0x2f1) +#define HWRM_TF_EM_DELETE UINT32_C(0x2eb) +/* Experimental */ +#define HWRM_TF_TCAM_SET UINT32_C(0x2f8) +/* Experimental */ +#define HWRM_TF_TCAM_GET UINT32_C(0x2f9) +/* Experimental */ +#define HWRM_TF_TCAM_MOVE UINT32_C(0x2fa) +/* Experimental */ +#define HWRM_TF_TCAM_FREE UINT32_C(0x2fb)/* Experimental */ #define HWRM_SV UINT32_C(0x400)/* Experimental */
@@ -715,6 +727,13 @@ struct cmd_nums {#define HWRM_DBG_CRASHDUMP_ERASE UINT32_C(0xff1e)/* Send driver debug information to firmware */ #define HWRM_DBG_DRV_TRACE UINT32_C(0xff1f) +/* Query debug capabilities of firmware */ +#define HWRM_DBG_QCAPS UINT32_C(0xff20) +/* Retrieve debug settings of firmware */ +#define HWRM_DBG_QCFG UINT32_C(0xff21) +/* Set destination parameters for crashdump medium */ +#define HWRM_DBG_CRASHDUMP_MEDIUM_CFG UINT32_C(0xff22) +#define HWRM_NVM_REQ_ARBITRATION UINT32_C(0xffed)/* Experimental */ #define HWRM_NVM_FACTORY_DEFAULTS UINT32_C(0xffee)#define HWRM_NVM_VALIDATE_OPTION UINT32_C(0xffef)
@@ -914,8 +933,8 @@ struct hwrm_err_output {#define HWRM_VERSION_MINOR 10#define HWRM_VERSION_UPDATE 1/* non-zero means beta version */ -#define HWRM_VERSION_RSVD 30 -#define HWRM_VERSION_STR "1.10.1.30" +#define HWRM_VERSION_RSVD 45 +#define HWRM_VERSION_STR "1.10.1.45"/**************** * hwrm_ver_get *
@@ -2292,6 +2311,35 @@ struct cmpl_base {* Completion of TX packet. Length = 16B */ #define CMPL_BASE_TYPE_TX_L2 UINT32_C(0x0) +/* +* NO-OP completion: +* Completion of NO-OP. Length = 16B +*/ +#define CMPL_BASE_TYPE_NO_OP UINT32_C(0x1) +/* +* TX L2 coalesced completion: +* Completion of coalesced TX packet. Length = 16B +*/ +#define CMPL_BASE_TYPE_TX_L2_COAL UINT32_C(0x2) +/* +* TX L2 PTP completion: +* Completion of PTP TX packet. Length = 32B +*/ +#define CMPL_BASE_TYPE_TX_L2_PTP UINT32_C(0x3) +/* +* RX L2 TPA Start V2 Completion: +* Completion of and L2 RX packet. Length = 32B +* This is the new version of the RX_TPA_START completion used +* in SR2 and later chips. +*/ +#define CMPL_BASE_TYPE_RX_TPA_START_V2 UINT32_C(0xd) +/* +* RX L2 V2 completion: +* Completion of and L2 RX packet. Length = 32B +* This is the new version of the RX_L2 completion used in SR2 +* and later chips. +*/ +#define CMPL_BASE_TYPE_RX_L2_V2 UINT32_C(0xf)/* * RX L2 completion: * Completion of and L2 RX packet. Length = 32B
@@ -2321,6 +2369,24 @@ struct cmpl_base {* Length = 16B */ #define CMPL_BASE_TYPE_STAT_EJECT UINT32_C(0x1a) +/* +* VEE Flush Completion: +* This completion is inserted manually by +* the Primate and processed by the VEE hardware to ensure that +* all completions on a VEE function have been processed by the +* VEE hardware before FLR process is completed. +*/ +#define CMPL_BASE_TYPE_VEE_FLUSH UINT32_C(0x1c) +/* +* Mid Path Short Completion : +* Completion of a Mid Path Command. Length = 16B +*/ +#define CMPL_BASE_TYPE_MID_PATH_SHORT UINT32_C(0x1e) +/* +* Mid Path Long Completion : +* Completion of a Mid Path Command. Length = 32B +*/ +#define CMPL_BASE_TYPE_MID_PATH_LONG UINT32_C(0x1f)/* * HWRM Command Completion: * Completion of an HWRM command.
@@ -2398,7 +2464,9 @@ struct tx_cmpl {uint16_t unused_0;/* * This is a copy of the opaque field from the first TX BD of this -* transmitted packet. +* transmitted packet. Note that, if the packet was described by a short +* CSO or short CSO inline BD, then the 16-bit opaque field from the +* short CSO BD will appear in the bottom 16 bits of this field. */ uint32_t opaque;uint16_t errors_v;
@@ -2407,58 +2475,352 @@ struct tx_cmpl {* for each pass through the completion queue. The even passes * will write 1. The odd passes will write 0. */ -#define TX_CMPL_V UINT32_C(0x1) -#define TX_CMPL_ERRORS_MASK UINT32_C(0xfffe) -#define TX_CMPL_ERRORS_SFT 1 +#define TX_CMPL_V UINT32_C(0x1) +#define TX_CMPL_ERRORS_MASK UINT32_C(0xfffe) +#define TX_CMPL_ERRORS_SFT 1/* * This error indicates that there was some sort of problem * with the BDs for the packet. */ -#define TX_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe) -#define TX_CMPL_ERRORS_BUFFER_ERROR_SFT 1 +#define TX_CMPL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe) +#define TX_CMPL_ERRORS_BUFFER_ERROR_SFT 1/* No error */ -#define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR (UINT32_C(0x0) << 1) +#define TX_CMPL_ERRORS_BUFFER_ERROR_NO_ERROR \ + (UINT32_C(0x0) << 1)/* * Bad Format: * BDs were not formatted correctly. */ -#define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT (UINT32_C(0x2) << 1) +#define TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT \ + (UINT32_C(0x2) << 1)#define TX_CMPL_ERRORS_BUFFER_ERROR_LAST \ TX_CMPL_ERRORS_BUFFER_ERROR_BAD_FMT/* * When this bit is '1', it indicates that the length of * the packet was zero. No packet was transmitted. */ -#define TX_CMPL_ERRORS_ZERO_LENGTH_PKT UINT32_C(0x10) +#define TX_CMPL_ERRORS_ZERO_LENGTH_PKT UINT32_C(0x10)/* * When this bit is '1', it indicates that the packet * was longer than the programmed limit in TDI. No * packet was transmitted. */ -#define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH UINT32_C(0x20) +#define TX_CMPL_ERRORS_EXCESSIVE_BD_LENGTH UINT32_C(0x20)/* * When this bit is '1', it indicates that one or more of the * BDs associated with this packet generated a PCI error. * This probably means the address was not valid. */ -#define TX_CMPL_ERRORS_DMA_ERROR UINT32_C(0x40) +#define TX_CMPL_ERRORS_DMA_ERROR UINT32_C(0x40)/* * When this bit is '1', it indicates that the packet was longer * than indicated by the hint. No packet was transmitted. */ -#define TX_CMPL_ERRORS_HINT_TOO_SHORT UINT32_C(0x80) +#define TX_CMPL_ERRORS_HINT_TOO_SHORT UINT32_C(0x80)/* * When this bit is '1', it indicates that the packet was * dropped due to Poison TLP error on one or more of the * TLPs in the PXP completion. */ -#define TX_CMPL_ERRORS_POISON_TLP_ERROR UINT32_C(0x100) +#define TX_CMPL_ERRORS_POISON_TLP_ERROR UINT32_C(0x100) +/* +* When this bit is '1', it indicates that the packet was dropped +* due to a transient internal error in TDC. The packet or LSO can +* be retried and may transmit successfully on a subsequent attempt. +*/ +#define TX_CMPL_ERRORS_INTERNAL_ERROR UINT32_C(0x200) +/* +* When this bit is '1', it was not possible to collect a a timestamp +* for a PTP completion, in which case the timestamp_hi and +* timestamp_lo fields are invalid. When this bit is '0' for a PTP +* completion, the timestamp_hi and timestamp_lo fields are valid. +* RJRN will copy the value of this bit into the field of the same +* name in all TX completions, regardless of whether such completions +* are PTP completions or other TX completions. +*/ +#define TX_CMPL_ERRORS_TIMESTAMP_INVALID_ERROR UINT32_C(0x400)/* unused2 is 16 b */ uint16_t unused_1;/* unused3 is 32 b */ uint32_t unused_2; } __rte_packed; +/* tx_cmpl_coal (size:128b/16B) */ +struct tx_cmpl_coal { +uint16_t flags_type; +/* +* This field indicates the exact type of the completion. +* By convention, the LSB identifies the length of the +* record in 16B units. Even values indicate 16B +* records. Odd values indicate 32B +* records. +*/ +#define TX_CMPL_COAL_TYPE_MASK UINT32_C(0x3f) +#define TX_CMPL_COAL_TYPE_SFT 0 +/* +* TX L2 coalesced completion: +* Completion of TX packet. Length = 16B +*/ +#define TX_CMPL_COAL_TYPE_TX_L2_COAL UINT32_C(0x2) +#define TX_CMPL_COAL_TYPE_LAST TX_CMPL_COAL_TYPE_TX_L2_COAL +#define TX_CMPL_COAL_FLAGS_MASK UINT32_C(0xffc0) +#define TX_CMPL_COAL_FLAGS_SFT 6 +/* +* When this bit is '1', it indicates a packet that has an +* error of some type. Type of error is indicated in +* error_flags. +*/ +#define TX_CMPL_COAL_FLAGS_ERROR UINT32_C(0x40) +/* +* When this bit is '1', it indicates that the packet completed +* was transmitted using the push acceleration data provided +* by the driver. When this bit is '0', it indicates that the +* packet had not push acceleration data written or was executed +* as a normal packet even though push data was provided. +*/ +#define TX_CMPL_COAL_FLAGS_PUSH UINT32_C(0x80) +/* unused1 is 16 b */ +uint16_t unused_0; +/* +* This is a copy of the opaque field from the first TX BD of the packet +* which corresponds with the reported sq_cons_idx. Note that, with +* coalesced completions, completions are generated for only some of the +* packets. The driver will see the opaque field for only those packets. +* Note that, if the packet was described by a short CSO or short CSO +* inline BD, then the 16-bit opaque field from the short CSO BD will +* appear in the bottom 16 bits of this field. For TX rings with +* completion coalescing enabled (which would use the coalesced +* completion record), it is suggested that the driver populate the +* opaque field to indicate the specific TX ring with which the +* completion is associated, then utilize the opaque and sq_cons_idx +* fields in the coalesced completion record to determine the specific +* packets that are to be completed on that ring. +*/ +uint32_t opaque; +uint16_t errors_v; +/* +* This value is written by the NIC such that it will be different +* for each pass through the completion queue. The even passes +* will write 1. The odd passes will write 0. +*/ +#define TX_CMPL_COAL_V UINT32_C(0x1) +#define TX_CMPL_COAL_ERRORS_MASK \ + UINT32_C(0xfffe) +#define TX_CMPL_COAL_ERRORS_SFT 1 +/* +* This error indicates that there was some sort of problem +* with the BDs for the packet. +*/ +#define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe) +#define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_SFT 1 +/* No error */ +#define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_NO_ERROR \ + (UINT32_C(0x0) << 1) +/* +* Bad Format: +* BDs were not formatted correctly. +*/ +#define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_BAD_FMT \ + (UINT32_C(0x2) << 1) +#define TX_CMPL_COAL_ERRORS_BUFFER_ERROR_LAST \ + TX_CMPL_COAL_ERRORS_BUFFER_ERROR_BAD_FMT +/* +* When this bit is '1', it indicates that the length of +* the packet was zero. No packet was transmitted. +*/ +#define TX_CMPL_COAL_ERRORS_ZERO_LENGTH_PKT UINT32_C(0x10) +/* +* When this bit is '1', it indicates that the packet +* was longer than the programmed limit in TDI. No +* packet was transmitted. +*/ +#define TX_CMPL_COAL_ERRORS_EXCESSIVE_BD_LENGTH UINT32_C(0x20) +/* +* When this bit is '1', it indicates that one or more of the +* BDs associated with this packet generated a PCI error. +* This probably means the address was not valid. +*/ +#define TX_CMPL_COAL_ERRORS_DMA_ERROR UINT32_C(0x40) +/* +* When this bit is '1', it indicates that the packet was longer +* than indicated by the hint. No packet was transmitted. +*/ +#define TX_CMPL_COAL_ERRORS_HINT_TOO_SHORT UINT32_C(0x80) +/* +* When this bit is '1', it indicates that the packet was +* dropped due to Poison TLP error on one or more of the +* TLPs in the PXP completion. +*/ +#define TX_CMPL_COAL_ERRORS_POISON_TLP_ERROR \ + UINT32_C(0x100) +/* +* When this bit is '1', it indicates that the packet was dropped +* due to a transient internal error in TDC. The packet or LSO can +* be retried and may transmit successfully on a subsequent attempt. +*/ +#define TX_CMPL_COAL_ERRORS_INTERNAL_ERROR \ + UINT32_C(0x200) +/* +* When this bit is '1', it was not possible to collect a a timestamp +* for a PTP completion, in which case the timestamp_hi and +* timestamp_lo fields are invalid. When this bit is '0' for a PTP +* completion, the timestamp_hi and timestamp_lo fields are valid. +* RJRN will copy the value of this bit into the field of the same +* name in all TX completions, regardless of whether such +* completions are PTP completions or other TX completions. +*/ +#define TX_CMPL_COAL_ERRORS_TIMESTAMP_INVALID_ERROR \ + UINT32_C(0x400) +/* unused2 is 16 b */ +uint16_t unused_1; +uint32_t sq_cons_idx; +/* +* This value is SQ index for the start of the packet following the +* last completed packet. +*/ +#define TX_CMPL_COAL_SQ_CONS_IDX_MASK UINT32_C(0xffffff) +#define TX_CMPL_COAL_SQ_CONS_IDX_SFT 0 +} __rte_packed; + +/* tx_cmpl_ptp (size:128b/16B) */ +struct tx_cmpl_ptp { +uint16_t flags_type; +/* +* This field indicates the exact type of the completion. +* By convention, the LSB identifies the length of the +* record in 16B units. Even values indicate 16B +* records. Odd values indicate 32B +* records. +*/ +#define TX_CMPL_PTP_TYPE_MASK UINT32_C(0x3f) +#define TX_CMPL_PTP_TYPE_SFT 0 +/* +* TX L2 PTP completion: +* Completion of TX packet. Length = 32B +*/ +#define TX_CMPL_PTP_TYPE_TX_L2_PTP UINT32_C(0x2) +#define TX_CMPL_PTP_TYPE_LAST TX_CMPL_PTP_TYPE_TX_L2_PTP +#define TX_CMPL_PTP_FLAGS_MASK UINT32_C(0xffc0) +#define TX_CMPL_PTP_FLAGS_SFT 6 +/* +* When this bit is '1', it indicates a packet that has an +* error of some type. Type of error is indicated in +* error_flags. +*/ +#define TX_CMPL_PTP_FLAGS_ERROR UINT32_C(0x40) +/* +* When this bit is '1', it indicates that the packet completed +* was transmitted using the push acceleration data provided +* by the driver. When this bit is '0', it indicates that the +* packet had not push acceleration data written or was executed +* as a normal packet even though push data was provided. +*/ +#define TX_CMPL_PTP_FLAGS_PUSH UINT32_C(0x80) +/* unused1 is 16 b */ +uint16_t unused_0; +/* +* This is a copy of the opaque field from the first TX BD of this +* transmitted packet. Note that, if the packet was described by a short +* CSO or short CSO inline BD, then the 16-bit opaque field from the +* short CSO BD will appear in the bottom 16 bits of this field. +*/ +uint32_t opaque; +uint16_t errors_v; +/* +* This value is written by the NIC such that it will be different +* for each pass through the completion queue. The even passes +* will write 1. The odd passes will write 0. +*/ +#define TX_CMPL_PTP_V UINT32_C(0x1) +#define TX_CMPL_PTP_ERRORS_MASK UINT32_C(0xfffe) +#define TX_CMPL_PTP_ERRORS_SFT 1 +/* +* This error indicates that there was some sort of problem +* with the BDs for the packet. +*/ +#define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_MASK UINT32_C(0xe) +#define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_SFT 1 +/* No error */ +#define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_NO_ERROR \ + (UINT32_C(0x0) << 1) +/* +* Bad Format: +* BDs were not formatted correctly. +*/ +#define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_BAD_FMT \ + (UINT32_C(0x2) << 1) +#define TX_CMPL_PTP_ERRORS_BUFFER_ERROR_LAST \ + TX_CMPL_PTP_ERRORS_BUFFER_ERROR_BAD_FMT +/* +* When this bit is '1', it indicates that the length of +* the packet was zero. No packet was transmitted. +*/ +#define TX_CMPL_PTP_ERRORS_ZERO_LENGTH_PKT UINT32_C(0x10) +/* +* When this bit is '1', it indicates that the packet +* was longer than the programmed limit in TDI. No +* packet was transmitted. +*/ +#define TX_CMPL_PTP_ERRORS_EXCESSIVE_BD_LENGTH UINT32_C(0x20) +/* +* When this bit is '1', it indicates that one or more of the +* BDs associated with this packet generated a PCI error. +* This probably means the address was not valid. +*/ +#define TX_CMPL_PTP_ERRORS_DMA_ERROR UINT32_C(0x40) +/* +* When this bit is '1', it indicates that the packet was longer +* than indicated by the hint. No packet was transmitted. +*/ +#define TX_CMPL_PTP_ERRORS_HINT_TOO_SHORT UINT32_C(0x80) +/* +* When this bit is '1', it indicates that the packet was +* dropped due to Poison TLP error on one or more of the +* TLPs in the PXP completion. +*/ +#define TX_CMPL_PTP_ERRORS_POISON_TLP_ERROR UINT32_C(0x100) +/* +* When this bit is '1', it indicates that the packet was dropped due +* to a transient internal error in TDC. The packet or LSO can be +* retried and may transmit successfully on a subsequent attempt. +*/ +#define TX_CMPL_PTP_ERRORS_INTERNAL_ERROR UINT32_C(0x200) +/* +* When this bit is '1', it was not possible to collect a a timestamp +* for a PTP completion, in which case the timestamp_hi and +* timestamp_lo fields are invalid. When this bit is '0' for a PTP +* completion, the timestamp_hi and timestamp_lo fields are valid. +* RJRN will copy the value of this bit into the field of the same +* name in all TX completions, regardless of whether such +* completions are PTP completions or other TX completions. +*/ +#define TX_CMPL_PTP_ERRORS_TIMESTAMP_INVALID_ERROR UINT32_C(0x400) +/* unused2 is 16 b */ +uint16_t unused_1; +/* +* This is timestamp value (lower 32bits) read from PM for the PTP +* timestamp enabled packet. +*/ +uint32_t timestamp_lo; +} __rte_packed; + +/* tx_cmpl_ptp_hi (size:128b/16B) */ +struct tx_cmpl_ptp_hi { +/* +* This is timestamp value (lower 32bits) read from PM for the PTP +* timestamp enabled packet. +*/ +uint16_t timestamp_hi[3 ]; +uint16_t reserved16; +uint64_t v2; +/* +* This value is written by the NIC such that it will be different for +* each pass through the completion queue.The even passes will write 1. +* The odd passes will write 0 +*/ +#define TX_CMPL_PTP_HI_V2 UINT32_C(0x1) +} __rte_packed; +/* rx_pkt_cmpl (size:128b/16B) */ struct rx_pkt_cmpl {uint16_t flags_type;
@@ -3003,12 +3365,8 @@ struct rx_pkt_cmpl_hi {#define RX_PKT_CMPL_REORDER_SFT 0 } __rte_packed; -/* -* This TPA completion structure is used on devices where the -* `hwrm_vnic_qcaps.max_aggs_supported` value is 0. -*/ -/* rx_tpa_start_cmpl (size:128b/16B) */ -struct rx_tpa_start_cmpl { +/* rx_pkt_v2_cmpl (size:128b/16B) */ +struct rx_pkt_v2_cmpl {uint16_t flags_type;/* * This field indicates the exact type of the completion.
@@ -3017,84 +3375,143 @@ struct rx_tpa_start_cmpl {* records. Odd values indicate 32B * records. */ -#define RX_TPA_START_CMPL_TYPE_MASK UINT32_C(0x3f) -#define RX_TPA_START_CMPL_TYPE_SFT 0 +#define RX_PKT_V2_CMPL_TYPE_MASK UINT32_C(0x3f) +#define RX_PKT_V2_CMPL_TYPE_SFT 0/* -* RX L2 TPA Start Completion: -* Completion at the beginning of a TPA operation. -* Length = 32B +* RX L2 V2 completion: +* Completion of and L2 RX packet. Length = 32B +* This is the new version of the RX_L2 completion used in SR2 +* and later chips. */ -#define RX_TPA_START_CMPL_TYPE_RX_TPA_START UINT32_C(0x13) -#define RX_TPA_START_CMPL_TYPE_LAST \ - RX_TPA_START_CMPL_TYPE_RX_TPA_START -#define RX_TPA_START_CMPL_FLAGS_MASK UINT32_C(0xffc0) -#define RX_TPA_START_CMPL_FLAGS_SFT 6 -/* This bit will always be '0' for TPA start completions. */ -#define RX_TPA_START_CMPL_FLAGS_ERROR UINT32_C(0x40) +#define RX_PKT_V2_CMPL_TYPE_RX_L2_V2 UINT32_C(0xf) +#define RX_PKT_V2_CMPL_TYPE_LAST \ + RX_PKT_V2_CMPL_TYPE_RX_L2_V2 +#define RX_PKT_V2_CMPL_FLAGS_MASK UINT32_C(0xffc0) +#define RX_PKT_V2_CMPL_FLAGS_SFT 6 +/* +* When this bit is '1', it indicates a packet that has an +* error of some type. Type of error is indicated in +* error_flags. +*/ +#define RX_PKT_V2_CMPL_FLAGS_ERROR UINT32_C(0x40)/* This field indicates how the packet was placed in the buffer. */ -#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380) -#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_SFT 7 +#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380) +#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_SFT 7 +/* +* Normal: +* Packet was placed using normal algorithm. +*/ +#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_NORMAL \ + (UINT32_C(0x0) << 7)/* * Jumbo: -* TPA Packet was placed using jumbo algorithm. This means -* that the first buffer will be filled with data before -* moving to aggregation buffers. Each aggregation buffer -* will be filled before moving to the next aggregation -* buffer. +* Packet was placed using jumbo algorithm. */ -#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_JUMBO \ +#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_JUMBO \ (UINT32_C(0x1) << 7)/* * Header/Data Separation: * Packet was placed using Header/Data separation algorithm. * The separation location is indicated by the itype field. */ -#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_HDS \ +#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_HDS \ (UINT32_C(0x2) << 7)/* -* GRO/Jumbo: -* Packet will be placed using GRO/Jumbo where the first -* packet is filled with data. Subsequent packets will be -* placed such that any one packet does not span two -* aggregation buffers unless it starts at the beginning of -* an aggregation buffer. +* Truncation: +* Packet was placed using truncation algorithm. The +* placed (truncated) length is indicated in the payload_offset +* field. The original length is indicated in the len field. */ -#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \ - (UINT32_C(0x5) << 7) +#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_TRUNCATION \ + (UINT32_C(0x3) << 7) +#define RX_PKT_V2_CMPL_FLAGS_PLACEMENT_LAST \ + RX_PKT_V2_CMPL_FLAGS_PLACEMENT_TRUNCATION +/* This bit is '1' if the RSS field in this completion is valid. */ +#define RX_PKT_V2_CMPL_FLAGS_RSS_VALID UINT32_C(0x400)/* -* GRO/Header-Data Separation: -* Packet will be placed using GRO/HDS where the header -* is in the first packet. -* Payload of each packet will be -* placed such that any one packet does not span two -* aggregation buffers unless it starts at the beginning of -* an aggregation buffer. +* This bit is '1' if metadata has been added to the end of the +* packet in host memory. Metadata starts at the first 32B boundary +* after the end of the packet for regular and jumbo placement. +* It starts at the first 32B boundary after the end of the header +* for HDS placement. The length of the metadata is indicated in the +* metadata itself. */ -#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS \ - (UINT32_C(0x6) << 7) -#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_LAST \ - RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS -/* This bit is '1' if the RSS field in this completion is valid. */ -#define RX_TPA_START_CMPL_FLAGS_RSS_VALID UINT32_C(0x400) -/* unused is 1 b */ -#define RX_TPA_START_CMPL_FLAGS_UNUSED UINT32_C(0x800) +#define RX_PKT_V2_CMPL_FLAGS_PKT_METADATA_PRESENT UINT32_C(0x800)/* * This value indicates what the inner packet determined for the * packet was. */ -#define RX_TPA_START_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000) -#define RX_TPA_START_CMPL_FLAGS_ITYPE_SFT 12 +#define RX_PKT_V2_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000) +#define RX_PKT_V2_CMPL_FLAGS_ITYPE_SFT 12 +/* +* Not Known: +* Indicates that the packet type was not known. +*/ +#define RX_PKT_V2_CMPL_FLAGS_ITYPE_NOT_KNOWN \ + (UINT32_C(0x0) << 12) +/* +* IP Packet: +* Indicates that the packet was an IP packet, but further +* classification was not possible. +*/ +#define RX_PKT_V2_CMPL_FLAGS_ITYPE_IP \ + (UINT32_C(0x1) << 12)/* * TCP Packet: * Indicates that the packet was IP and TCP. +* This indicates that the payload_offset field is valid. */ -#define RX_TPA_START_CMPL_FLAGS_ITYPE_TCP \ +#define RX_PKT_V2_CMPL_FLAGS_ITYPE_TCP \ (UINT32_C(0x2) << 12) -#define RX_TPA_START_CMPL_FLAGS_ITYPE_LAST \ - RX_TPA_START_CMPL_FLAGS_ITYPE_TCP/* -* This value indicates the amount of packet data written to the -* buffer the opaque field in this completion corresponds to. +* UDP Packet: +* Indicates that the packet was IP and UDP. +* This indicates that the payload_offset field is valid. +*/ +#define RX_PKT_V2_CMPL_FLAGS_ITYPE_UDP \ + (UINT32_C(0x3) << 12) +/* +* FCoE Packet: +* Indicates that the packet was recognized as a FCoE. +* This also indicates that the payload_offset field is valid. +*/ +#define RX_PKT_V2_CMPL_FLAGS_ITYPE_FCOE \ + (UINT32_C(0x4) << 12) +/* +* RoCE Packet: +* Indicates that the packet was recognized as a RoCE. +* This also indicates that the payload_offset field is valid. +*/ +#define RX_PKT_V2_CMPL_FLAGS_ITYPE_ROCE \ + (UINT32_C(0x5) << 12) +/* +* ICMP Packet: +* Indicates that the packet was recognized as ICMP. +* This indicates that the payload_offset field is valid. +*/ +#define RX_PKT_V2_CMPL_FLAGS_ITYPE_ICMP \ + (UINT32_C(0x7) << 12) +/* +* PtP packet wo/timestamp: +* Indicates that the packet was recognized as a PtP +* packet. +*/ +#define RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_WO_TIMESTAMP \ + (UINT32_C(0x8) << 12) +/* +* PtP packet w/timestamp: +* Indicates that the packet was recognized as a PtP +* packet and that a timestamp was taken for the packet. +*/ +#define RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP \ + (UINT32_C(0x9) << 12) +#define RX_PKT_V2_CMPL_FLAGS_ITYPE_LAST \ + RX_PKT_V2_CMPL_FLAGS_ITYPE_PTP_W_TIMESTAMP +/* +* This is the length of the data for the packet stored in the +* buffer(s) identified by the opaque value. This includes +* the packet BD and any associated buffer BDs. This does not include +* the length of any data places in aggregation BDs. */ uint16_t len;/*
@@ -3102,19 +3519,597 @@ struct rx_tpa_start_cmpl {* corresponds to. */ uint32_t opaque; +uint8_t agg_bufs_v1;/* * This value is written by the NIC such that it will be different * for each pass through the completion queue. The even passes * will write 1. The odd passes will write 0. */ -uint8_t v1; +#define RX_PKT_V2_CMPL_V1 UINT32_C(0x1)/* -* This value is written by the NIC such that it will be different -* for each pass through the completion queue. The even passes -* will write 1. The odd passes will write 0. +* This value is the number of aggregation buffers that follow this +* entry in the completion ring that are a part of this packet. +* If the value is zero, then the packet is completely contained +* in the buffer space provided for the packet in the RX ring. */ -#define RX_TPA_START_CMPL_V1 UINT32_C(0x1) -#define RX_TPA_START_CMPL_LAST RX_TPA_START_CMPL_V1 +#define RX_PKT_V2_CMPL_AGG_BUFS_MASK UINT32_C(0x3e) +#define RX_PKT_V2_CMPL_AGG_BUFS_SFT 1 +/* unused1 is 2 b */ +#define RX_PKT_V2_CMPL_UNUSED1_MASK UINT32_C(0xc0) +#define RX_PKT_V2_CMPL_UNUSED1_SFT 6 +/* +* This is the RSS hash type for the packet. The value is packed +* {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}. +* +* The value of tuple_extrac_op provides the information about +* what fields the hash was computed on. +* * 0: The RSS hash was computed over source IP address, +* destination IP address, source port, and destination port of inner +* IP and TCP or UDP headers. Note: For non-tunneled packets, +* the packet headers are considered inner packet headers for the RSS +* hash computation purpose. +* * 1: The RSS hash was computed over source IP address and destination +* IP address of inner IP header. Note: For non-tunneled packets, +* the packet headers are considered inner packet headers for the RSS +* hash computation purpose. +* * 2: The RSS hash was computed over source IP address, +* destination IP address, source port, and destination port of +* IP and TCP or UDP headers of outer tunnel headers. +* Note: For non-tunneled packets, this value is not applicable. +* * 3: The RSS hash was computed over source IP address and +* destination IP address of IP header of outer tunnel headers. +* Note: For non-tunneled packets, this value is not applicable. +* +* Note that 4-tuples values listed above are applicable +* for layer 4 protocols supported and enabled for RSS in the hardware, +* HWRM firmware, and drivers. For example, if RSS hash is supported and +* enabled for TCP traffic only, then the values of tuple_extract_op +* corresponding to 4-tuples are only valid for TCP traffic. +*/ +uint8_t rss_hash_type; +uint16_t metadata1_payload_offset; +/* +* This is data from the CFA as indicated by the meta_format field. +* If truncation placement is not used, this value indicates the offset +* in bytes from the beginning of the packet where the inner payload +* starts. This value is valid for TCP, UDP, FCoE, and RoCE packets. If +* truncation placement is used, this value represents the placed +* (truncated) length of the packet. +*/ +#define RX_PKT_V2_CMPL_PAYLOAD_OFFSET_MASK UINT32_C(0x1ff) +#define RX_PKT_V2_CMPL_PAYLOAD_OFFSET_SFT 0 +/* This is data from the CFA as indicated by the meta_format field. */ +#define RX_PKT_V2_CMPL_METADATA1_MASK UINT32_C(0xf000) +#define RX_PKT_V2_CMPL_METADATA1_SFT 12 +/* When meta_format != 0, this value is the VLAN TPID_SEL. */ +#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_MASK UINT32_C(0x7000) +#define RX_PKT_V2_CMPL_METADATA1_TPID_SEL_SFT 12 +/* When meta_format != 0, this value is the VLAN TPID_SEL. */ +#define RX_PKT_V2_CMPL_METADATA1_VALID UINT32_C(0x8000) +/* +* This value is the RSS hash value calculated for the packet +* based on the mode bits and key value in the VNIC. When vee_cmpl_mode +* is set in VNIC context, this is the lower 32b of the host address +* from the first BD used to place the packet. +*/ +uint32_t rss_hash; +} __rte_packed; + +/* Last 16 bytes of RX Packet V2 Completion Record */ +/* rx_pkt_v2_cmpl_hi (size:128b/16B) */ +struct rx_pkt_v2_cmpl_hi { +uint32_t flags2; +/* +* When this bit is '0', the cs_ok field has the following definition:- +* ip_cs_ok[2:0] = The number of header groups with a valid IP checksum +* in the delivered packet, counted from the outer-most header group to +* the inner-most header group, stopping at the first error. - +* l4_cs_ok[5:3] = The number of header groups with a valid L4 checksum +* in the delivered packet, counted from the outer-most header group to +* the inner-most header group, stopping at the first error. When this +* bit is '1', the cs_ok field has the following definition: - +* hdr_cnt[2:0] = The number of header groups that were parsed by the +* chip and passed in the delivered packet. - ip_cs_all_ok[3] =This bit +* will be '1' if all the parsed header groups with an IP checksum are +* valid. - l4_cs_all_ok[4] = This bit will be '1' if all the parsed +* header groups with an L4 checksum are valid. +*/ +#define RX_PKT_V2_CMPL_HI_FLAGS2_CS_ALL_OK_MODE \ + UINT32_C(0x8) +/* This value indicates what format the metadata field is. */ +#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_MASK \ + UINT32_C(0xf0) +#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_SFT 4 +/* There is no metadata information. Values are zero. */ +#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_NONE \ + (UINT32_C(0x0) << 4) +/* +* The {metadata1, metadata0} fields contain the vtag +* information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], +* de, vid[11:0]} The metadata2 field contains the table scope +* and action record pointer. - metadata2[25:0] contains the +* action record pointer. - metadata2[31:26] contains the table +* scope. +*/ +#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_ACT_REC_PTR \ + (UINT32_C(0x1) << 4) +/* +* The {metadata1, metadata0} fields contain the vtag +* information: +* - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]} +* The metadata2 field contains the Tunnel ID +* value, justified to LSB. i +* - VXLAN = VNI[23:0] -> VXLAN Network ID +* - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier +* - NVGRE = TNI[23:0] -> Tenant Network ID +* - GRE = KEY[31:0] -> key field with bit mask. zero if K=0 +* - IPv4 = 0 (not populated) +* - IPv6 = Flow Label[19:0] +* - PPPoE = sessionID[15:0] +* - MPLs = Outer label[19:0] +* - UPAR = Selected[31:0] with bit mask +*/ +#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_TUNNEL_ID \ + (UINT32_C(0x2) << 4) +/* +* The {metadata1, metadata0} fields contain the vtag +* information: +* - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]} +* The metadata2 field contains the 32b metadata from the prepended +* header (chdr_data). +*/ +#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_CHDR_DATA \ + (UINT32_C(0x3) << 4) +/* +* The {metadata1, metadata0} fields contain the vtag +* information: +* - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]} +* The metadata2 field contains the outer_l3_offset, +* inner_l2_offset, inner_l3_offset, and inner_l4_size. +* - metadata2[8:0] contains the outer_l3_offset. +* - metadata2[17:9] contains the inner_l2_offset. +* - metadata2[26:18] contains the inner_l3_offset. +* - metadata2[31:27] contains the inner_l4_size. +*/ +#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET \ + (UINT32_C(0x4) << 4) +#define RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_LAST \ + RX_PKT_V2_CMPL_HI_FLAGS2_META_FORMAT_HDR_OFFSET +/* +* This field indicates the IP type for the inner-most IP header. +* A value of '0' indicates IPv4. A value of '1' indicates IPv6. +* This value is only valid if itype indicates a packet +* with an IP header. +*/ +#define RX_PKT_V2_CMPL_HI_FLAGS2_IP_TYPE \ + UINT32_C(0x100) +/* +* This indicates that the complete 1's complement checksum was +* calculated for the packet. +*/ +#define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_CALC \ + UINT32_C(0x200) +/* +* This field indicates the status of IP and L4 CS calculations done +* by the chip. The format of this field is indicated by the +* cs_all_ok_mode bit. +*/ +#define RX_PKT_V2_CMPL_HI_FLAGS2_CS_OK_MASK \ + UINT32_C(0xfc00) +#define RX_PKT_V2_CMPL_HI_FLAGS2_CS_OK_SFT 10 +/* +* This value is the complete 1's complement checksum calculated from +* the start of the outer L3 header to the end of the packet (not +* including the ethernet crc). It is valid when the +* 'complete_checksum_calc' flag is set. +*/ +#define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_MASK \ + UINT32_C(0xffff0000) +#define RX_PKT_V2_CMPL_HI_FLAGS2_COMPLETE_CHECKSUM_SFT 16 +/* +* This is data from the CFA block as indicated by the meta_format +* field. +* - meta_format 0 - none - metadata2 = 0 - not valid/not stripped +* - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0], +* act_rec_ptr[25:0]} +* - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0] +* - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0] +* - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0] +* When vee_cmpl_mode is set in VNIC context, this is the upper 32b +* of the host address from the first BD used to place the packet. +*/ +uint32_t metadata2; +uint16_t errors_v2; +/* +* This value is written by the NIC such that it will be different +* for each pass through the completion queue. The even passes +* will write 1. The odd passes will write 0. +*/ +#define RX_PKT_V2_CMPL_HI_V2 \ + UINT32_C(0x1) +#define RX_PKT_V2_CMPL_HI_ERRORS_MASK \ + UINT32_C(0xfffe) +#define RX_PKT_V2_CMPL_HI_ERRORS_SFT 1 +/* +* This error indicates that there was some sort of problem with +* the BDs for the packet that was found after part of the +* packet was already placed. The packet should be treated as +* invalid. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_MASK \ + UINT32_C(0xe) +#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_SFT 1 +/* No buffer error */ +#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_NO_BUFFER \ + (UINT32_C(0x0) << 1) +/* +* Did Not Fit: Packet did not fit into packet buffer provided. +* For regular placement, this means the packet did not fit in +* the buffer provided. For HDS and jumbo placement, this means +* that the packet could not be placed into 8 physical buffers +* (if fixed-size buffers are used), or that the packet could +* not be placed in the number of physical buffers configured +* for the VNIC (if variable-size buffers are used) +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_DID_NOT_FIT \ + (UINT32_C(0x1) << 1) +/* +* Not On Chip: All BDs needed for the packet were not on-chip +* when the packet arrived. For regular placement, this error is +* not valid. For HDS and jumbo placement, this means that not +* enough agg BDs were posted to place the packet. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_NOT_ON_CHIP \ + (UINT32_C(0x2) << 1) +/* +* Bad Format: +* BDs were not formatted correctly. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_BAD_FORMAT \ + (UINT32_C(0x3) << 1) +/* +* Flush: +* There was a bad_format error on the previous operation +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH \ + (UINT32_C(0x5) << 1) +#define RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_LAST \ + RX_PKT_V2_CMPL_HI_ERRORS_BUFFER_ERROR_FLUSH +/* +* This indicates that there was an error in the outer tunnel +* portion of the packet when this field is non-zero. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_MASK \ + UINT32_C(0x70) +#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_SFT 4 +/* +* No additional error occurred on the outer tunnel portion +* of the packet or the packet does not have a outer tunnel. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_NO_ERROR \ + (UINT32_C(0x0) << 4) +/* +* Indicates that IP header version does not match expectation +* from L2 Ethertype for IPv4 and IPv6 in the outer tunnel header. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_VERSION \ + (UINT32_C(0x1) << 4) +/* +* Indicates that header length is out of range in the outer +* tunnel header. Valid for IPv4. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_HDR_LEN \ + (UINT32_C(0x2) << 4) +/* +* Indicates that physical packet is shorter than that claimed +* by the outer tunnel l3 header length. Valid for IPv4, or +* IPv6 outer tunnel packets. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_IP_TOTAL_ERROR \ + (UINT32_C(0x3) << 4) +/* +* Indicates that the physical packet is shorter than that +* claimed by the outer tunnel UDP header length for a outer +* tunnel UDP packet that is not fragmented. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_UDP_TOTAL_ERROR \ + (UINT32_C(0x4) << 4) +/* +* Indicates that the IPv4 TTL or IPv6 hop limit check have +* failed (e.g. TTL = 0) in the outer tunnel header. Valid for +* IPv4, and IPv6. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L3_BAD_TTL \ + (UINT32_C(0x5) << 4) +/* +* Indicates that the IP checksum failed its check in the outer +* tunnel header. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_IP_CS_ERROR \ + (UINT32_C(0x6) << 4) +/* +* Indicates that the L4 checksum failed its check in the outer +* tunnel header. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L4_CS_ERROR \ + (UINT32_C(0x7) << 4) +#define RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_LAST \ + RX_PKT_V2_CMPL_HI_ERRORS_OT_PKT_ERROR_OT_L4_CS_ERROR +/* +* This indicates that there was a CRC error on either an FCoE +* or RoCE packet. The itype indicates the packet type. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_CRC_ERROR \ + UINT32_C(0x100) +/* +* This indicates that there was an error in the tunnel portion +* of the packet when this field is non-zero. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_MASK \ + UINT32_C(0xe00) +#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_SFT 9 +/* +* No additional error occurred on the tunnel portion +* of the packet or the packet does not have a tunnel. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_NO_ERROR \ + (UINT32_C(0x0) << 9) +/* +* Indicates that IP header version does not match expectation +* from L2 Ethertype for IPv4 and IPv6 in the tunnel header. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_VERSION \ + (UINT32_C(0x1) << 9) +/* +* Indicates that header length is out of range in the tunnel +* header. Valid for IPv4. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_HDR_LEN \ + (UINT32_C(0x2) << 9) +/* +* Indicates that physical packet is shorter than that claimed +* by the tunnel l3 header length. Valid for IPv4, or IPv6 tunnel +* packet packets. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_TOTAL_ERROR \ + (UINT32_C(0x3) << 9) +/* +* Indicates that the physical packet is shorter than that claimed +* by the tunnel UDP header length for a tunnel UDP packet that is +* not fragmented. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_UDP_TOTAL_ERROR \ + (UINT32_C(0x4) << 9) +/* +* Indicates that the IPv4 TTL or IPv6 hop limit check have failed +* (e.g. TTL = 0) in the tunnel header. Valid for IPv4, and IPv6. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L3_BAD_TTL \ + (UINT32_C(0x5) << 9) +/* +* Indicates that the IP checksum failed its check in the tunnel +* header. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_IP_CS_ERROR \ + (UINT32_C(0x6) << 9) +/* +* Indicates that the L4 checksum failed its check in the tunnel +* header. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR \ + (UINT32_C(0x7) << 9) +#define RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_LAST \ + RX_PKT_V2_CMPL_HI_ERRORS_T_PKT_ERROR_T_L4_CS_ERROR +/* +* This indicates that there was an error in the inner +* portion of the packet when this +* field is non-zero. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_MASK \ + UINT32_C(0xf000) +#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_SFT 12 +/* +* No additional error occurred on the tunnel portion +* or the packet of the packet does not have a tunnel. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_NO_ERROR \ + (UINT32_C(0x0) << 12) +/* +* Indicates that IP header version does not match +* expectation from L2 Ethertype for IPv4 and IPv6 or that +* option other than VFT was parsed on +* FCoE packet. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_VERSION \ + (UINT32_C(0x1) << 12) +/* +* indicates that header length is out of range. Valid for +* IPv4 and RoCE +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_HDR_LEN \ + (UINT32_C(0x2) << 12) +/* +* indicates that the IPv4 TTL or IPv6 hop limit check +* have failed (e.g. TTL = 0). Valid for IPv4, and IPv6 +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L3_BAD_TTL \ + (UINT32_C(0x3) << 12) +/* +* Indicates that physical packet is shorter than that +* claimed by the l3 header length. Valid for IPv4, +* IPv6 packet or RoCE packets. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_IP_TOTAL_ERROR \ + (UINT32_C(0x4) << 12) +/* +* Indicates that the physical packet is shorter than that +* claimed by the UDP header length for a UDP packet that is +* not fragmented. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_UDP_TOTAL_ERROR \ + (UINT32_C(0x5) << 12) +/* +* Indicates that TCP header length > IP payload. Valid for +* TCP packets only. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN \ + (UINT32_C(0x6) << 12) +/* Indicates that TCP header length < 5. Valid for TCP. */ +#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_HDR_LEN_TOO_SMALL \ + (UINT32_C(0x7) << 12) +/* +* Indicates that TCP option headers result in a TCP header +* size that does not match data offset in TCP header. Valid +* for TCP. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_BAD_OPT_LEN \ + (UINT32_C(0x8) << 12) +/* +* Indicates that the IP checksum failed its check in the +* inner header. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_IP_CS_ERROR \ + (UINT32_C(0x9) << 12) +/* +* Indicates that the L4 checksum failed its check in the +* inner header. +*/ +#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR \ + (UINT32_C(0xa) << 12) +#define RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_LAST \ + RX_PKT_V2_CMPL_HI_ERRORS_PKT_ERROR_L4_CS_ERROR +/* +* This is data from the CFA block as indicated by the meta_format +* field. +*/ +uint16_t metadata0; +/* When meta_format=1, this value is the VLAN VID. */ +#define RX_PKT_V2_CMPL_HI_METADATA0_VID_MASK UINT32_C(0xfff) +#define RX_PKT_V2_CMPL_HI_METADATA0_VID_SFT 0 +/* When meta_format=1, this value is the VLAN DE. */ +#define RX_PKT_V2_CMPL_HI_METADATA0_DE UINT32_C(0x1000) +/* When meta_format=1, this value is the VLAN PRI. */ +#define RX_PKT_V2_CMPL_HI_METADATA0_PRI_MASK UINT32_C(0xe000) +#define RX_PKT_V2_CMPL_HI_METADATA0_PRI_SFT 13 +/* +* The timestamp field contains the 32b timestamp for the packet from +* the MAC. +*/ +uint32_t timestamp; +} __rte_packed; + +/* +* This TPA completion structure is used on devices where the +* `hwrm_vnic_qcaps.max_aggs_supported` value is 0. +*/ +/* rx_tpa_start_cmpl (size:128b/16B) */ +struct rx_tpa_start_cmpl { +uint16_t flags_type; +/* +* This field indicates the exact type of the completion. +* By convention, the LSB identifies the length of the +* record in 16B units. Even values indicate 16B +* records. Odd values indicate 32B +* records. +*/ +#define RX_TPA_START_CMPL_TYPE_MASK UINT32_C(0x3f) +#define RX_TPA_START_CMPL_TYPE_SFT 0 +/* +* RX L2 TPA Start Completion: +* Completion at the beginning of a TPA operation. +* Length = 32B +*/ +#define RX_TPA_START_CMPL_TYPE_RX_TPA_START UINT32_C(0x13) +#define RX_TPA_START_CMPL_TYPE_LAST \ + RX_TPA_START_CMPL_TYPE_RX_TPA_START +#define RX_TPA_START_CMPL_FLAGS_MASK UINT32_C(0xffc0) +#define RX_TPA_START_CMPL_FLAGS_SFT 6 +/* This bit will always be '0' for TPA start completions. */ +#define RX_TPA_START_CMPL_FLAGS_ERROR UINT32_C(0x40) +/* This field indicates how the packet was placed in the buffer. */ +#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380) +#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_SFT 7 +/* +* Jumbo: +* TPA Packet was placed using jumbo algorithm. This means +* that the first buffer will be filled with data before +* moving to aggregation buffers. Each aggregation buffer +* will be filled before moving to the next aggregation +* buffer. +*/ +#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_JUMBO \ + (UINT32_C(0x1) << 7) +/* +* Header/Data Separation: +* Packet was placed using Header/Data separation algorithm. +* The separation location is indicated by the itype field. +*/ +#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_HDS \ + (UINT32_C(0x2) << 7) +/* +* GRO/Jumbo: +* Packet will be placed using GRO/Jumbo where the first +* packet is filled with data. Subsequent packets will be +* placed such that any one packet does not span two +* aggregation buffers unless it starts at the beginning of +* an aggregation buffer. +*/ +#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \ + (UINT32_C(0x5) << 7) +/* +* GRO/Header-Data Separation: +* Packet will be placed using GRO/HDS where the header +* is in the first packet. +* Payload of each packet will be +* placed such that any one packet does not span two +* aggregation buffers unless it starts at the beginning of +* an aggregation buffer. +*/ +#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS \ + (UINT32_C(0x6) << 7) +#define RX_TPA_START_CMPL_FLAGS_PLACEMENT_LAST \ + RX_TPA_START_CMPL_FLAGS_PLACEMENT_GRO_HDS +/* This bit is '1' if the RSS field in this completion is valid. */ +#define RX_TPA_START_CMPL_FLAGS_RSS_VALID UINT32_C(0x400) +/* unused is 1 b */ +#define RX_TPA_START_CMPL_FLAGS_UNUSED UINT32_C(0x800) +/* +* This value indicates what the inner packet determined for the +* packet was. +*/ +#define RX_TPA_START_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000) +#define RX_TPA_START_CMPL_FLAGS_ITYPE_SFT 12 +/* +* TCP Packet: +* Indicates that the packet was IP and TCP. +*/ +#define RX_TPA_START_CMPL_FLAGS_ITYPE_TCP \ + (UINT32_C(0x2) << 12) +#define RX_TPA_START_CMPL_FLAGS_ITYPE_LAST \ + RX_TPA_START_CMPL_FLAGS_ITYPE_TCP +/* +* This value indicates the amount of packet data written to the +* buffer the opaque field in this completion corresponds to. +*/ +uint16_t len; +/* +* This is a copy of the opaque field from the RX BD this completion +* corresponds to. +*/ +uint32_t opaque; +/* +* This value is written by the NIC such that it will be different +* for each pass through the completion queue. The even passes +* will write 1. The odd passes will write 0. +*/ +uint8_t v1; +/* +* This value is written by the NIC such that it will be different +* for each pass through the completion queue. The even passes +* will write 1. The odd passes will write 0. +*/ +#define RX_TPA_START_CMPL_V1 UINT32_C(0x1) +#define RX_TPA_START_CMPL_LAST RX_TPA_START_CMPL_V1/* * This is the RSS hash type for the packet. The value is packed * {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}.
@@ -3285,6 +4280,430 @@ struct rx_tpa_start_cmpl_hi {#define RX_TPA_START_CMPL_INNER_L4_SIZE_SFT 27 } __rte_packed; +/* +* This TPA completion structure is used on devices where the +* `hwrm_vnic_qcaps.max_aggs_supported` value is 0. +* RX L2 TPA Start V2 Completion Record (32 bytes split to 2 16-byte +* struct) +*/ +/* rx_tpa_start_v2_cmpl (size:128b/16B) */ +struct rx_tpa_start_v2_cmpl { +uint16_t flags_type; +/* +* This field indicates the exact type of the completion. +* By convention, the LSB identifies the length of the +* record in 16B units. Even values indicate 16B +* records. Odd values indicate 32B +* records. +*/ +#define RX_TPA_START_V2_CMPL_TYPE_MASK \ + UINT32_C(0x3f) +#define RX_TPA_START_V2_CMPL_TYPE_SFT 0 +/* +* RX L2 TPA Start V2 Completion: +* Completion at the beginning of a TPA operation. +* Length = 32B +* This is the new version of the RX_TPA_START completion used +* in SR2 and later chips. +*/ +#define RX_TPA_START_V2_CMPL_TYPE_RX_TPA_START_V2 \ + UINT32_C(0xd) +#define RX_TPA_START_V2_CMPL_TYPE_LAST \ + RX_TPA_START_V2_CMPL_TYPE_RX_TPA_START_V2 +#define RX_TPA_START_V2_CMPL_FLAGS_MASK \ + UINT32_C(0xffc0) +#define RX_TPA_START_V2_CMPL_FLAGS_SFT 6 +/* +* When this bit is '1', it indicates a packet that has an error +* of some type. Type of error is indicated in error_flags. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS_ERROR \ + UINT32_C(0x40) +/* This field indicates how the packet was placed in the buffer. */ +#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_MASK \ + UINT32_C(0x380) +#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_SFT 7 +/* +* Jumbo: +* TPA Packet was placed using jumbo algorithm. This means +* that the first buffer will be filled with data before +* moving to aggregation buffers. Each aggregation buffer +* will be filled before moving to the next aggregation +* buffer. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_JUMBO \ + (UINT32_C(0x1) << 7) +/* +* Header/Data Separation: +* Packet was placed using Header/Data separation algorithm. +* The separation location is indicated by the itype field. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_HDS \ + (UINT32_C(0x2) << 7) +/* +* IOC/Jumbo: +* Packet will be placed using In-Order Completion/Jumbo where +* the first packet of the aggregation is placed using Jumbo +* Placement. Subsequent packets will be placed such that each +* packet starts at the beginning of an aggregation buffer. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_JUMBO \ + (UINT32_C(0x4) << 7) +/* +* GRO/Jumbo: +* Packet will be placed using GRO/Jumbo where the first +* packet is filled with data. Subsequent packets will be +* placed such that any one packet does not span two +* aggregation buffers unless it starts at the beginning of +* an aggregation buffer. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_GRO_JUMBO \ + (UINT32_C(0x5) << 7) +/* +* GRO/Header-Data Separation: +* Packet will be placed using GRO/HDS where the header +* is in the first packet. +* Payload of each packet will be +* placed such that any one packet does not span two +* aggregation buffers unless it starts at the beginning of +* an aggregation buffer. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_GRO_HDS \ + (UINT32_C(0x6) << 7) +/* +* IOC/Header-Data Separation: +* Packet will be placed using In-Order Completion/HDS where +* the header is in the first packet buffer. Payload of each +* packet will be placed such that each packet starts at the +* beginning of an aggregation buffer. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_HDS \ + (UINT32_C(0x7) << 7) +#define RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_LAST \ + RX_TPA_START_V2_CMPL_FLAGS_PLACEMENT_IOC_HDS +/* This bit is '1' if the RSS field in this completion is valid. */ +#define RX_TPA_START_V2_CMPL_FLAGS_RSS_VALID \ + UINT32_C(0x400) +/* +* This bit is '1' if metadata has been added to the end of the +* packet in host memory. Metadata starts at the first 32B boundary +* after the end of the packet for regular and jumbo placement. It +* starts at the first 32B boundary after the end of the header for +* HDS placement. The length of the metadata is indicated in the +* metadata itself. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS_PKT_METADATA_PRESENT \ + UINT32_C(0x800) +/* +* This value indicates what the inner packet determined for the +* packet was. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_MASK \ + UINT32_C(0xf000) +#define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_SFT 12 +/* +* TCP Packet: +* Indicates that the packet was IP and TCP. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_TCP \ + (UINT32_C(0x2) << 12) +#define RX_TPA_START_V2_CMPL_FLAGS_ITYPE_LAST \ + RX_TPA_START_V2_CMPL_FLAGS_ITYPE_TCP +/* +* This value indicates the amount of packet data written to the +* buffer the opaque field in this completion corresponds to. +*/ +uint16_t len; +/* +* This is a copy of the opaque field from the RX BD this completion +* corresponds to. If the VNIC is configured to not use an Rx BD for +* the TPA Start completion, then this is a copy of the opaque field +* from the first BD used to place the TPA Start packet. +*/ +uint32_t opaque; +/* +* This value is written by the NIC such that it will be different +* for each pass through the completion queue. The even passes +* will write 1. The odd passes will write 0. +*/ +uint8_t v1; +/* +* This value is written by the NIC such that it will be different +* for each pass through the completion queue. The even passes +* will write 1. The odd passes will write 0. +*/ +#define RX_TPA_START_V2_CMPL_V1 UINT32_C(0x1) +#define RX_TPA_START_V2_CMPL_LAST RX_TPA_START_V2_CMPL_V1 +/* +* This is the RSS hash type for the packet. The value is packed +* {tuple_extrac_op[1:0],rss_profile_id[4:0],tuple_extrac_op[2]}. +* +* The value of tuple_extrac_op provides the information about +* what fields the hash was computed on. +* * 0: The RSS hash was computed over source IP address, +* destination IP address, source port, and destination port of inner +* IP and TCP or UDP headers. Note: For non-tunneled packets, +* the packet headers are considered inner packet headers for the RSS +* hash computation purpose. +* * 1: The RSS hash was computed over source IP address and destination +* IP address of inner IP header. Note: For non-tunneled packets, +* the packet headers are considered inner packet headers for the RSS +* hash computation purpose. +* * 2: The RSS hash was computed over source IP address, +* destination IP address, source port, and destination port of +* IP and TCP or UDP headers of outer tunnel headers. +* Note: For non-tunneled packets, this value is not applicable. +* * 3: The RSS hash was computed over source IP address and +* destination IP address of IP header of outer tunnel headers. +* Note: For non-tunneled packets, this value is not applicable. +* +* Note that 4-tuples values listed above are applicable +* for layer 4 protocols supported and enabled for RSS in the hardware, +* HWRM firmware, and drivers. For example, if RSS hash is supported and +* enabled for TCP traffic only, then the values of tuple_extract_op +* corresponding to 4-tuples are only valid for TCP traffic. +*/ +uint8_t rss_hash_type; +/* +* This is the aggregation ID that the completion is associated +* with. Use this number to correlate the TPA start completion +* with the TPA end completion. +*/ +uint16_t agg_id; +/* +* This is the aggregation ID that the completion is associated +* with. Use this number to correlate the TPA start completion +* with the TPA end completion. +*/ +#define RX_TPA_START_V2_CMPL_AGG_ID_MASK UINT32_C(0xfff) +#define RX_TPA_START_V2_CMPL_AGG_ID_SFT 0 +#define RX_TPA_START_V2_CMPL_METADATA1_MASK UINT32_C(0xf000) +#define RX_TPA_START_V2_CMPL_METADATA1_SFT 12 +/* When meta_format != 0, this value is the VLAN TPID_SEL. */ +#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_MASK UINT32_C(0x7000) +#define RX_TPA_START_V2_CMPL_METADATA1_TPID_SEL_SFT 12 +/* When meta_format != 0, this value is the VLAN valid. */ +#define RX_TPA_START_V2_CMPL_METADATA1_VALID UINT32_C(0x8000) +/* +* This value is the RSS hash value calculated for the packet +* based on the mode bits and key value in the VNIC. +* When vee_cmpl_mode is set in VNIC context, this is the lower +* 32b of the host address from the first BD used to place the packet. +*/ +uint32_t rss_hash; +} __rte_packed; + +/* +* Last 16 bytes of RX L2 TPA Start V2 Completion Record +* +* This TPA completion structure is used on devices where the +* `hwrm_vnic_qcaps.max_aggs_supported` value is 0. +*/ +/* rx_tpa_start_v2_cmpl_hi (size:128b/16B) */ +struct rx_tpa_start_v2_cmpl_hi { +uint32_t flags2; +/* This indicates that the aggregation was done using GRO rules. */ +#define RX_TPA_START_V2_CMPL_FLAGS2_AGG_GRO \ + UINT32_C(0x4) +/* +* When this bit is '0', the cs_ok field has the following definition:- +* ip_cs_ok[2:0] = The number of header groups with a valid IP checksum +* in the delivered packet, counted from the outer-most header group to +* the inner-most header group, stopping at the first error. - +* l4_cs_ok[5:3] = The number of header groups with a valid L4 checksum +* in the delivered packet, counted from the outer-most header group to +* the inner-most header group, stopping at the first error. When this +* bit is '1', the cs_ok field has the following definition: - +* hdr_cnt[2:0] = The number of header groups that were parsed by the +* chip and passed in the delivered packet. - ip_cs_all_ok[3] =This bit +* will be '1' if all the parsed header groups with an IP checksum are +* valid. - l4_cs_all_ok[4] = This bit will be '1' if all the parsed +* header groups with an L4 checksum are valid. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS2_CS_ALL_OK_MODE \ + UINT32_C(0x8) +/* This value indicates what format the metadata field is. */ +#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_MASK \ + UINT32_C(0xf0) +#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_SFT 4 +/* There is no metadata information. Values are zero. */ +#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_NONE \ + (UINT32_C(0x0) << 4) +/* +* The {metadata1, metadata0} fields contain the vtag +* information: - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], +* de, vid[11:0]} The metadata2 field contains the table scope +* and action record pointer. - metadata2[25:0] contains the +* action record pointer. - metadata2[31:26] contains the table +* scope. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_ACT_REC_PTR \ + (UINT32_C(0x1) << 4) +/* +* The {metadata1, metadata0} fields contain the vtag +* information: +* - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]} +* The metadata2 field contains the Tunnel ID +* value, justified to LSB. i +* - VXLAN = VNI[23:0] -> VXLAN Network ID +* - Geneve (NGE) = VNI[23:0] a-> Virtual Network Identifier +* - NVGRE = TNI[23:0] -> Tenant Network ID +* - GRE = KEY[31:0] -> key field with bit mask. zero if K=0 +* - IPv4 = 0 (not populated) +* - IPv6 = Flow Label[19:0] +* - PPPoE = sessionID[15:0] +* - MPLs = Outer label[19:0] +* - UPAR = Selected[31:0] with bit mask +*/ +#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_TUNNEL_ID \ + (UINT32_C(0x2) << 4) +/* +* The {metadata1, metadata0} fields contain the vtag +* information: +* - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0],de, vid[11:0]} +* The metadata2 field contains the 32b metadata from the prepended +* header (chdr_data). +*/ +#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_CHDR_DATA \ + (UINT32_C(0x3) << 4) +/* +* The {metadata1, metadata0} fields contain the vtag +* information: +* - vtag[19:0] = {valid, tpid_sel[2:0], pri[2:0], de, vid[11:0]} +* The metadata2 field contains the outer_l3_offset, +* inner_l2_offset, inner_l3_offset, and inner_l4_size. +* - metadata2[8:0] contains the outer_l3_offset. +* - metadata2[17:9] contains the inner_l2_offset. +* - metadata2[26:18] contains the inner_l3_offset. +* - metadata2[31:27] contains the inner_l4_size. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET \ + (UINT32_C(0x4) << 4) +#define RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_LAST \ + RX_TPA_START_V2_CMPL_FLAGS2_META_FORMAT_HDR_OFFSET +/* +* This field indicates the IP type for the inner-most IP header. +* A value of '0' indicates IPv4. A value of '1' indicates IPv6. +* This value is only valid if itype indicates a packet +* with an IP header. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS2_IP_TYPE \ + UINT32_C(0x100) +/* +* This indicates that the complete 1's complement checksum was +* calculated for the packet in the affregation. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_CALC \ + UINT32_C(0x200) +/* +* This field indicates the status of IP and L4 CS calculations done +* by the chip. The format of this field is indicated by the +* cs_all_ok_mode bit. +* CS status for TPA packets is always valid. This means that "all_ok" +* status will always be set. The ok count status will be set +* appropriately for the packet header, such that all existing CS +* values are ok. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS2_CS_OK_MASK \ + UINT32_C(0xfc00) +#define RX_TPA_START_V2_CMPL_FLAGS2_CS_OK_SFT 10 +/* +* This value is the complete 1's complement checksum calculated from +* the start of the outer L3 header to the end of the packet (not +* including the ethernet crc). It is valid when the +* 'complete_checksum_calc' flag is set. For TPA Start completions, +* the complete checksum is calculated for the first packet in the +* aggregation only. +*/ +#define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_MASK \ + UINT32_C(0xffff0000) +#define RX_TPA_START_V2_CMPL_FLAGS2_COMPLETE_CHECKSUM_SFT 16 +/* +* This is data from the CFA block as indicated by the meta_format +* field. +* - meta_format 0 - none - metadata2 = 0 - not valid/not stripped +* - meta_format 1 - act_rec_ptr - metadata2 = {table_scope[5:0], +* act_rec_ptr[25:0]} +* - meta_format 2 - tunnel_id - metadata2 = tunnel_id[31:0] +* - meta_format 3 - chdr_data - metadata2 = updated_chdr_data[31:0] +* - meta_format 4 - hdr_offsets - metadata2 = hdr_offsets[31:0] +* When vee_cmpl_mode is set in VNIC context, this is the upper 32b +* of the host address from the first BD used to place the packet. +*/ +uint32_t metadata2; +uint16_t errors_v2; +/* +* This value is written by the NIC such that it will be different +* for each pass through the completion queue. The even passes +* will write 1. The odd passes will write 0. +*/ +#define RX_TPA_START_V2_CMPL_V2 \ + UINT32_C(0x1) +#define RX_TPA_START_V2_CMPL_ERRORS_MASK \ + UINT32_C(0xfffe) +#define RX_TPA_START_V2_CMPL_ERRORS_SFT 1 +/* +* This error indicates that there was some sort of problem with +* the BDs for the packetThe packet should be treated as +* invalid. +*/ +#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_MASK \ + UINT32_C(0xe) +#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_SFT 1 +/* No buffer error */ +#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_NO_BUFFER \ + (UINT32_C(0x0) << 1) +/* +* Did Not Fit: +* Packet did not fit into packet buffer provided. This means +* that the TPA Start packet was too big to be placed into the +* per-packet maximum number of physical buffers configured for +* the VNIC, or that it was too big to be placed into the +* per-aggregation maximum number of physical buffers configured +* for the VNIC. This error only occurs when the VNIC is +* configured for variable size receive buffers. +*/ +#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_DID_NOT_FIT \ + (UINT32_C(0x1) << 1) +/* +* Bad Format: +* BDs were not formatted correctly. +*/ +#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_BAD_FORMAT \ + (UINT32_C(0x3) << 1) +/* +* Flush: +* There was a bad_format error on the previous operation +*/ +#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_FLUSH \ + (UINT32_C(0x5) << 1) +#define RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_LAST \ + RX_TPA_START_V2_CMPL_ERRORS_BUFFER_ERROR_FLUSH +/* +* This is data from the CFA block as indicated by the meta_format +* field. +*/ +uint16_t metadata0; +/* When meta_format != 0, this value is the VLAN VID. */ +#define RX_TPA_START_V2_CMPL_METADATA0_VID_MASK UINT32_C(0xfff) +#define RX_TPA_START_V2_CMPL_METADATA0_VID_SFT 0 +/* When meta_format != 0, this value is the VLAN DE. */ +#define RX_TPA_START_V2_CMPL_METADATA0_DE UINT32_C(0x1000) +/* When meta_format != 0, this value is the VLAN PRI. */ +#define RX_TPA_START_V2_CMPL_METADATA0_PRI_MASK UINT32_C(0xe000) +#define RX_TPA_START_V2_CMPL_METADATA0_PRI_SFT 13 +/* +* This field contains the outer_l3_offset, inner_l2_offset, +* inner_l3_offset, and inner_l4_size. +* +* hdr_offsets[8:0] contains the outer_l3_offset. +* hdr_offsets[17:9] contains the inner_l2_offset. +* hdr_offsets[26:18] contains the inner_l3_offset. +* hdr_offsets[31:27] contains the inner_l4_size. +*/ +uint32_t hdr_offsets; +} __rte_packed; +/* * This TPA completion structure is used on devices where the * `hwrm_vnic_qcaps.max_aggs_supported` value is 0.
@@ -3299,27 +4718,27 @@ struct rx_tpa_end_cmpl {* records. Odd values indicate 32B * records. */ -#define RX_TPA_END_CMPL_TYPE_MASK UINT32_C(0x3f) -#define RX_TPA_END_CMPL_TYPE_SFT 0 +#define RX_TPA_END_CMPL_TYPE_MASK UINT32_C(0x3f) +#define RX_TPA_END_CMPL_TYPE_SFT 0/* * RX L2 TPA End Completion: * Completion at the end of a TPA operation. * Length = 32B */ -#define RX_TPA_END_CMPL_TYPE_RX_TPA_END UINT32_C(0x15) +#define RX_TPA_END_CMPL_TYPE_RX_TPA_END UINT32_C(0x15)#define RX_TPA_END_CMPL_TYPE_LAST \ RX_TPA_END_CMPL_TYPE_RX_TPA_END -#define RX_TPA_END_CMPL_FLAGS_MASK UINT32_C(0xffc0) -#define RX_TPA_END_CMPL_FLAGS_SFT 6 +#define RX_TPA_END_CMPL_FLAGS_MASK UINT32_C(0xffc0) +#define RX_TPA_END_CMPL_FLAGS_SFT 6/* * When this bit is '1', it indicates a packet that has an * error of some type. Type of error is indicated in * error_flags. */ -#define RX_TPA_END_CMPL_FLAGS_ERROR UINT32_C(0x40) +#define RX_TPA_END_CMPL_FLAGS_ERROR UINT32_C(0x40)/* This field indicates how the packet was placed in the buffer. */ -#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380) -#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_SFT 7 +#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_MASK UINT32_C(0x380) +#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_SFT 7/* * Jumbo: * TPA Packet was placed using jumbo algorithm. This means
@@ -3337,6 +4756,15 @@ struct rx_tpa_end_cmpl {*/ #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_HDS \ (UINT32_C(0x2) << 7) +/* +* IOC/Jumbo: +* Packet will be placed using In-Order Completion/Jumbo where +* the first packet of the aggregation is placed using Jumbo +* Placement. Subsequent packets will be placed such that each +* packet starts at the beginning of an aggregation buffer. +*/ +#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_JUMBO \ + (UINT32_C(0x4) << 7)/* * GRO/Jumbo: * Packet will be placed using GRO/Jumbo where the first
@@ -3358,11 +4786,28 @@ struct rx_tpa_end_cmpl {*/ #define RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS \ (UINT32_C(0x6) << 7) +/* +* IOC/Header-Data Separation: +* Packet will be placed using In-Order Completion/HDS where +* the header is in the first packet buffer. Payload of each +* packet will be placed such that each packet starts at the +* beginning of an aggregation buffer. +*/ +#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_HDS \ + (UINT32_C(0x7) << 7)#define RX_TPA_END_CMPL_FLAGS_PLACEMENT_LAST \ - RX_TPA_END_CMPL_FLAGS_PLACEMENT_GRO_HDS -/* unused is 2 b */ -#define RX_TPA_END_CMPL_FLAGS_UNUSED_MASK UINT32_C(0xc00) -#define RX_TPA_END_CMPL_FLAGS_UNUSED_SFT 10 + RX_TPA_END_CMPL_FLAGS_PLACEMENT_IOC_HDS +/* unused is 1 b */ +#define RX_TPA_END_CMPL_FLAGS_UNUSED UINT32_C(0x400) +/* +* This bit is '1' if metadata has been added to the end of the +* packet in host memory. Metadata starts at the first 32B boundary +* after the end of the packet for regular and jumbo placement. +* It starts at the first 32B boundary after the end of the header +* for HDS placement. The length of the metadata is indicated in the +* metadata itself. +*/ +#define RX_TPA_END_CMPL_FLAGS_PKT_METADATA_PRESENT UINT32_C(0x800)/* * This value indicates what the inner packet determined for the * packet was.
@@ -3372,8 +4817,9 @@ struct rx_tpa_end_cmpl {* field is valid and contains the TCP checksum. * This also indicates that the payload_offset field is valid. */ -#define RX_TPA_END_CMPL_FLAGS_ITYPE_MASK UINT32_C(0xf000) -#define RX_TPA_END_CMPL_FLAGS_ITYPE_SFT 12 +#define RX_TPA_END_CMPL_FLAGS_ITYPE_MASK \ + UINT32_C(0xf000) +#define RX_TPA_END_CMPL_FLAGS_ITYPE_SFT 12/* * This value is zero for TPA End completions. * There is no data in the buffer that corresponds to the opaque
@@ -4243,6 +5689,52 @@ struct rx_abuf_cmpl {uint32_t unused_2; } __rte_packed; +/* VEE FLUSH Completion Record (16 bytes) */ +/* vee_flush (size:128b/16B) */ +struct vee_flush { +uint32_t downstream_path_type; +/* +* This field indicates the exact type of the completion. +* By convention, the LSB identifies the length of the +* record in 16B units. Even values indicate 16B +* records. Odd values indicate 32B +* records. +*/ +#define VEE_FLUSH_TYPE_MASK UINT32_C(0x3f) +#define VEE_FLUSH_TYPE_SFT 0 +/* +* VEE Flush Completion: +* This completion is inserted manually by the Primate and processed +* by the VEE hardware to ensure that all completions on a VEE +* function have been processed by the VEE hardware before FLR +* process is completed. +*/ +#define VEE_FLUSH_TYPE_VEE_FLUSH UINT32_C(0x1c) +#define VEE_FLUSH_TYPE_LAST VEE_FLUSH_TYPE_VEE_FLUSH +/* downstream_path is 1 b */ +#define VEE_FLUSH_DOWNSTREAM_PATH UINT32_C(0x40) +/* This completion is associated with VEE Transmit */ +#define VEE_FLUSH_DOWNSTREAM_PATH_TX (UINT32_C(0x0) << 6) +/* This completion is associated with VEE Receive */ +#define VEE_FLUSH_DOWNSTREAM_PATH_RX (UINT32_C(0x1) << 6) +#define VEE_FLUSH_DOWNSTREAM_PATH_LAST VEE_FLUSH_DOWNSTREAM_PATH_RX +/* +* This is an opaque value that is passed through the completion +* to the VEE handler SW and is used to indicate what VEE VQ or +* function has completed FLR processing. +*/ +uint32_t opaque; +uint32_t v; +/* +* This value is written by the NIC such that it will be different +* for each pass through the completion queue. The even passes will +* write 1. The odd passes will write 0. +*/ +#define VEE_FLUSH_V UINT32_C(0x1) +/* unused3 is 32 b */ +uint32_t unused_3; +} __rte_packed; +/* eject_cmpl (size:128b/16B) */ struct eject_cmpl {uint16_t type;
@@ -6562,7 +8054,7 @@ struct hwrm_async_event_cmpl_deferred_response {/* * The PF's mailbox is clear to issue another command. * A command with this seq_id is still in progress -* and will return a regular HWRM completion when done. +* and will return a regualr HWRM completion when done. * 'event_data1' field, if non-zero, contains the estimated * execution time for the command. */
@@ -7476,6 +8968,8 @@ struct hwrm_func_qcaps_input {* Function ID of the function that is being queried. * 0xFF... (All Fs) if the query is for the requesting * function. +* 0xFFFE (REQUESTING_PARENT_FID) This is a special FID +* to be used by a trusted VF to query its parent PF. */ uint16_t fid;uint8_t unused_0[6 ];
@@ -7729,6 +9223,12 @@ struct hwrm_func_qcaps_output {*/ #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_PFC_WD_STATS_SUPPORTED \ UINT32_C(0x40000000) +/* +* When this bit is '1', it indicates that core firmware supports +* DBG_QCAPS command +*/ +#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_DBG_QCAPS_CMD_SUPPORTED \ + UINT32_C(0x80000000)/* * This value is current MAC address configured for this * function. A value of 00-00-00-00-00-00 indicates no
@@ -7854,6 +9354,19 @@ struct hwrm_func_qcaps_output {*/ #define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_ECN_STATS_SUPPORTED \ UINT32_C(0x2) +/* +* If 1, the device can report extended hw statistics (including +* additional tpa statistics). +*/ +#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_EXT_HW_STATS_SUPPORTED \ + UINT32_C(0x4) +/* +* If set to 1, then the core firmware has support to enable/ +* disable hot reset support for interface dynamically through +* HWRM_FUNC_CFG. +*/ +#define HWRM_FUNC_QCAPS_OUTPUT_FLAGS_EXT_HOT_RESET_IF_SUPPORT \ + UINT32_C(0x8)uint8_t unused_1[3 ];/* * This field is used in Output records to indicate that the output
@@ -7904,6 +9417,8 @@ struct hwrm_func_qcfg_input {* Function ID of the function that is being queried. * 0xFF... (All Fs) if the query is for the requesting * function. +* 0xFFFE (REQUESTING_PARENT_FID) This is a special FID +* to be used by a trusted VF to query its parent PF. */ uint16_t fid;uint8_t unused_0[6 ];
@@ -8013,6 +9528,15 @@ struct hwrm_func_qcfg_output {*/ #define HWRM_FUNC_QCFG_OUTPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS \ UINT32_C(0x100) +/* +* If set to 1, then the firmware and all currently registered driver +* instances support hot reset. The hot reset support will be updated +* dynamically based on the driver interface advertisement. +* If set to 0, then the adapter is not currently able to initiate +* hot reset. +*/ +#define HWRM_FUNC_QCFG_OUTPUT_FLAGS_HOT_RESET_ALLOWED \ + UINT32_C(0x200)/* * This value is current MAC address configured for this * function. A value of 00-00-00-00-00-00 indicates no
@@ -8565,6 +10089,17 @@ struct hwrm_func_cfg_input {*/ #define HWRM_FUNC_CFG_INPUT_FLAGS_PREBOOT_LEGACY_L2_RINGS \ UINT32_C(0x2000000) +/* +* If this bit is set to 0, then the interface does not support hot +* reset capability which it advertised with the hot_reset_support +* flag in HWRM_FUNC_DRV_RGTR. If any of the function has set this +* flag to 0, adapter cannot do the hot reset. In this state, if the +* firmware receives a hot reset request, firmware must fail the +* request. If this bit is set to 1, then interface is renabling the +* hot reset capability. +*/ +#define HWRM_FUNC_CFG_INPUT_FLAGS_HOT_RESET_IF_EN_DIS \ + UINT32_C(0x4000000)uint32_t enables;/* * This bit must be '1' for the mtu field to be
@@ -8704,6 +10239,12 @@ struct hwrm_func_cfg_input {*/ #define HWRM_FUNC_CFG_INPUT_ENABLES_ADMIN_LINK_STATE \ UINT32_C(0x400000) +/* +* This bit must be '1' for the hot_reset_if_en_dis field to be +* configured. +*/ +#define HWRM_FUNC_CFG_INPUT_ENABLES_HOT_RESET_IF_SUPPORT \ + UINT32_C(0x800000)/* * The maximum transmission unit of the function. * The HWRM should make sure that the mtu of
@@ -9036,15 +10577,21 @@ struct hwrm_func_qstats_input {/* This flags indicates the type of statistics request. */ uint8_t flags;/* This value is not used to avoid backward compatibility issues. */ -#define HWRM_FUNC_QSTATS_INPUT_FLAGS_UNUSED UINT32_C(0x0) +#define HWRM_FUNC_QSTATS_INPUT_FLAGS_UNUSED UINT32_C(0x0)/* * flags should be set to 1 when request is for only RoCE statistics. * This will be honored only if the caller_fid is a privileged PF. * In all other cases FID and caller_fid should be the same. */ -#define HWRM_FUNC_QSTATS_INPUT_FLAGS_ROCE_ONLY UINT32_C(0x1) +#define HWRM_FUNC_QSTATS_INPUT_FLAGS_ROCE_ONLY UINT32_C(0x1) +/* +* flags should be set to 2 when request is for the counter mask, +* representing the width of each of the stats counters, rather +* than counters themselves. +*/ +#define HWRM_FUNC_QSTATS_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x2)#define HWRM_FUNC_QSTATS_INPUT_FLAGS_LAST \ - HWRM_FUNC_QSTATS_INPUT_FLAGS_ROCE_ONLY + HWRM_FUNC_QSTATS_INPUT_FLAGS_COUNTER_MASKuint8_t unused_0[5 ]; } __rte_packed;
@@ -9130,6 +10677,132 @@ struct hwrm_func_qstats_output {uint8_t valid; } __rte_packed; +/************************ +* hwrm_func_qstats_ext * +************************/ + + +/* hwrm_func_qstats_ext_input (size:192b/24B) */ +struct hwrm_func_qstats_ext_input { +/* The HWRM command request type. */ +uint16_t req_type; +/* +* The completion ring to send the completion event on. This should +* be the NQ ID returned from the `nq_alloc` HWRM command. +*/ +uint16_t cmpl_ring; +/* +* The sequence ID is used by the driver for tracking multiple +* commands. This ID is treated as opaque data by the firmware and +* the value is returned in the `hwrm_resp_hdr` upon completion. +*/ +uint16_t seq_id; +/* +* The target ID of the command: +* * 0x0-0xFFF8 - The function ID +* * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors +* * 0xFFFD - Reserved for user-space HWRM interface +* * 0xFFFF - HWRM +*/ +uint16_t target_id; +/* +* A physical address pointer pointing to a host buffer that the +* command's response data will be written. This can be either a host +* physical address (HPA) or a guest physical address (GPA) and must +* point to a physically contiguous block of memory. +*/ +uint64_t resp_addr; +/* +* Function ID of the function that is being queried. +* 0xFF... (All Fs) if the query is for the requesting +* function. +* A privileged PF can query for other function's statistics. +*/ +uint16_t fid; +/* This flags indicates the type of statistics request. */ +uint8_t flags; +/* This value is not used to avoid backward compatibility issues. */ +#define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_UNUSED UINT32_C(0x0) +/* +* flags should be set to 1 when request is for only RoCE statistics. +* This will be honored only if the caller_fid is a privileged PF. +* In all other cases FID and caller_fid should be the same. +*/ +#define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_ROCE_ONLY UINT32_C(0x1) +/* +* flags should be set to 2 when request is for the counter mask +* representing the width of each of the stats counters, rather +* than counters themselves. +*/ +#define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x2) +#define HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_LAST \ + HWRM_FUNC_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK +uint8_t unused_0[5 ]; +} __rte_packed; + +/* hwrm_func_qstats_ext_output (size:1472b/184B) */ +struct hwrm_func_qstats_ext_output { +/* The specific error status for the command. */ +uint16_t error_code; +/* The HWRM command request type. */ +uint16_t req_type; +/* The sequence ID from the original command. */ +uint16_t seq_id; +/* The length of the response data in number of bytes. */ +uint16_t resp_len; +/* Number of received unicast packets */ +uint64_t rx_ucast_pkts; +/* Number of received multicast packets */ +uint64_t rx_mcast_pkts; +/* Number of received broadcast packets */ +uint64_t rx_bcast_pkts; +/* Number of discarded packets on received path */ +uint64_t rx_discard_pkts; +/* Number of packets on receive path with error */ +uint64_t rx_error_pkts; +/* Number of received bytes for unicast traffic */ +uint64_t rx_ucast_bytes; +/* Number of received bytes for multicast traffic */ +uint64_t rx_mcast_bytes; +/* Number of received bytes for broadcast traffic */ +uint64_t rx_bcast_bytes; +/* Number of transmitted unicast packets */ +uint64_t tx_ucast_pkts; +/* Number of transmitted multicast packets */ +uint64_t tx_mcast_pkts; +/* Number of transmitted broadcast packets */ +uint64_t tx_bcast_pkts; +/* Number of packets on transmit path with error */ +uint64_t tx_error_pkts; +/* Number of discarded packets on transmit path */ +uint64_t tx_discard_pkts; +/* Number of transmitted bytes for unicast traffic */ +uint64_t tx_ucast_bytes; +/* Number of transmitted bytes for multicast traffic */ +uint64_t tx_mcast_bytes; +/* Number of transmitted bytes for broadcast traffic */ +uint64_t tx_bcast_bytes; +/* Number of TPA eligible packets */ +uint64_t rx_tpa_eligible_pkt; +/* Number of TPA eligible bytes */ +uint64_t rx_tpa_eligible_bytes; +/* Number of TPA packets */ +uint64_t rx_tpa_pkt; +/* Number of TPA bytes */ +uint64_t rx_tpa_bytes; +/* Number of TPA errors */ +uint64_t rx_tpa_errors; +uint8_t unused_0[7 ]; +/* +* This field is used in Output records to indicate that the output +* is completely written to RAM. This field should be read as '1' +* to indicate that the output has been completely written. +* When writing a command completion or response to an internal processor, +* the order of writes has to be such that this field is written last. +*/ +uint8_t valid; +} __rte_packed; +/*********************** * hwrm_func_clr_stats * ***********************/
@@ -10116,7 +11789,7 @@ struct hwrm_func_backing_store_qcaps_output {* * TQM slowpath rings should be sized as follows: * -* num_entries = num_vnics + num_l2_tx_rings + num_roce_qps + tqm_min_size +* num_entries = num_vnics + num_l2_tx_rings + 2 * num_roce_qps + tqm_min_size * * Where: * num_vnics is the number of VNICs allocated in the VNIC backing store
@@ -11039,7 +12712,7 @@ struct hwrm_func_backing_store_cfg_input {* * TQM slowpath rings should be sized as follows: * -* num_entries = num_vnics + num_l2_tx_rings + num_roce_qps + tqm_min_size +* num_entries = num_vnics + num_l2_tx_rings + 2 * num_roce_qps + tqm_min_size * * Where: * num_vnics is the number of VNICs allocated in the VNIC backing store
@@ -16149,7 +17822,18 @@ struct hwrm_port_qstats_input {uint64_t resp_addr;/* Port ID of port that is being queried. */ uint16_t port_id; -uint8_t unused_0[6 ]; +uint8_t flags; +/* This value is not used to avoid backward compatibility issues. */ +#define HWRM_PORT_QSTATS_INPUT_FLAGS_UNUSED UINT32_C(0x0) +/* +* This bit is set to 1 when request is for a counter mask, +* representing the width of each of the stats counters, rather +* than counters themselves. +*/ +#define HWRM_PORT_QSTATS_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x1) +#define HWRM_PORT_QSTATS_INPUT_FLAGS_LAST \ + HWRM_PORT_QSTATS_INPUT_FLAGS_COUNTER_MASK +uint8_t unused_0[5 ];/* * This is the host address where * Tx port statistics will be stored
@@ -16382,7 +18066,7 @@ struct rx_port_stats_ext {* Port Rx Statistics extended PFC WatchDog Format. * StormDetect and StormRevert event determination is based * on an integration period and a percentage threshold. -* StormDetect event - when percentage of XOFF frames received +* StormDetect event - when percentage of XOFF frames receieved * within an integration period exceeds the configured threshold. * StormRevert event - when percentage of XON frames received * within an integration period exceeds the configured threshold.
@@ -16843,7 +18527,18 @@ struct hwrm_port_qstats_ext_input {* statistics block in bytes */ uint16_t rx_stat_size; -uint8_t unused_0[2 ]; +uint8_t flags; +/* This value is not used to avoid backward compatibility issues. */ +#define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_UNUSED UINT32_C(0x0) +/* +* This bit is set to 1 when request is for the counter mask, +* representing width of each of the stats counters, rather than +* counters themselves. +*/ +#define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK UINT32_C(0x1) +#define HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_LAST \ + HWRM_PORT_QSTATS_EXT_INPUT_FLAGS_COUNTER_MASK +uint8_t unused_0;/* * This is the host address where * Tx port statistics will be stored
@@ -25312,95 +27007,104 @@ struct hwrm_ring_free_input {/* Ring Type. */ uint8_t ring_type;/* L2 Completion Ring (CR) */ -#define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0) +#define HWRM_RING_FREE_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0) +/* TX Ring (TR) */ +#define HWRM_RING_FREE_INPUT_RING_TYPE_TX UINT32_C(0x1) +/* RX Ring (RR) */ +#define HWRM_RING_FREE_INPUT_RING_TYPE_RX UINT32_C(0x2) +/* RoCE Notification Completion Ring (ROCE_CR) */ +#define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3) +/* RX Aggregation Ring */ +#define HWRM_RING_FREE_INPUT_RING_TYPE_RX_AGG UINT32_C(0x4) +/* Notification Queue */ +#define HWRM_RING_FREE_INPUT_RING_TYPE_NQ UINT32_C(0x5) +#define HWRM_RING_FREE_INPUT_RING_TYPE_LAST \ + HWRM_RING_FREE_INPUT_RING_TYPE_NQ +uint8_t unused_0; +/* Physical number of ring allocated. */ +uint16_t ring_id; +uint8_t unused_1[4 ]; +} __rte_packed; + +/* hwrm_ring_free_output (size:128b/16B) */ +struct hwrm_ring_free_output { +/* The specific error status for the command. */ +uint16_t error_code; +/* The HWRM command request type. */ +uint16_t req_type; +/* The sequence ID from the original command. */ +uint16_t seq_id; +/* The length of the response data in number of bytes. */ +uint16_t resp_len; +uint8_t unused_0[7 ]; +/* +* This field is used in Output records to indicate that the output +* is completely written to RAM. This field should be read as '1' +* to indicate that the output has been completely written. +* When writing a command completion or response to an internal processor, +* the order of writes has to be such that this field is written last. +*/ +uint8_t valid; +} __rte_packed; + +/******************* +* hwrm_ring_reset * +*******************/ + + +/* hwrm_ring_reset_input (size:192b/24B) */ +struct hwrm_ring_reset_input { +/* The HWRM command request type. */ +uint16_t req_type; +/* +* The completion ring to send the completion event on. This should +* be the NQ ID returned from the `nq_alloc` HWRM command. +*/ +uint16_t cmpl_ring; +/* +* The sequence ID is used by the driver for tracking multiple +* commands. This ID is treated as opaque data by the firmware and +* the value is returned in the `hwrm_resp_hdr` upon completion. +*/ +uint16_t seq_id; +/* +* The target ID of the command: +* * 0x0-0xFFF8 - The function ID +* * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors +* * 0xFFFD - Reserved for user-space HWRM interface +* * 0xFFFF - HWRM +*/ +uint16_t target_id; +/* +* A physical address pointer pointing to a host buffer that the +* command's response data will be written. This can be either a host +* physical address (HPA) or a guest physical address (GPA) and must +* point to a physically contiguous block of memory. +*/ +uint64_t resp_addr; +/* Ring Type. */ +uint8_t ring_type; +/* L2 Completion Ring (CR) */ +#define HWRM_RING_RESET_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0)/* TX Ring (TR) */ -#define HWRM_RING_FREE_INPUT_RING_TYPE_TX UINT32_C(0x1) +#define HWRM_RING_RESET_INPUT_RING_TYPE_TX UINT32_C(0x1)/* RX Ring (RR) */ -#define HWRM_RING_FREE_INPUT_RING_TYPE_RX UINT32_C(0x2) +#define HWRM_RING_RESET_INPUT_RING_TYPE_RX UINT32_C(0x2)/* RoCE Notification Completion Ring (ROCE_CR) */ -#define HWRM_RING_FREE_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3) -/* RX Aggregation Ring */ -#define HWRM_RING_FREE_INPUT_RING_TYPE_RX_AGG UINT32_C(0x4) -/* Notification Queue */ -#define HWRM_RING_FREE_INPUT_RING_TYPE_NQ UINT32_C(0x5) -#define HWRM_RING_FREE_INPUT_RING_TYPE_LAST \ - HWRM_RING_FREE_INPUT_RING_TYPE_NQ -uint8_t unused_0; -/* Physical number of ring allocated. */ -uint16_t ring_id; -uint8_t unused_1[4 ]; -} __rte_packed; - -/* hwrm_ring_free_output (size:128b/16B) */ -struct hwrm_ring_free_output { -/* The specific error status for the command. */ -uint16_t error_code; -/* The HWRM command request type. */ -uint16_t req_type; -/* The sequence ID from the original command. */ -uint16_t seq_id; -/* The length of the response data in number of bytes. */ -uint16_t resp_len; -uint8_t unused_0[7 ]; +#define HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3)/* -* This field is used in Output records to indicate that the output -* is completely written to RAM. This field should be read as '1' -* to indicate that the output has been completely written. -* When writing a command completion or response to an internal processor, -* the order of writes has to be such that this field is written last. +* Rx Ring Group. This is to reset rx and aggregation in an atomic +* operation. Completion ring associated with this ring group is +* not reset. */ -uint8_t valid; -} __rte_packed; - -/******************* -* hwrm_ring_reset * -*******************/ - - -/* hwrm_ring_reset_input (size:192b/24B) */ -struct hwrm_ring_reset_input { -/* The HWRM command request type. */ -uint16_t req_type; -/* -* The completion ring to send the completion event on. This should -* be the NQ ID returned from the `nq_alloc` HWRM command. -*/ -uint16_t cmpl_ring; -/* -* The sequence ID is used by the driver for tracking multiple -* commands. This ID is treated as opaque data by the firmware and -* the value is returned in the `hwrm_resp_hdr` upon completion. -*/ -uint16_t seq_id; -/* -* The target ID of the command: -* * 0x0-0xFFF8 - The function ID -* * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors -* * 0xFFFD - Reserved for user-space HWRM interface -* * 0xFFFF - HWRM -*/ -uint16_t target_id; -/* -* A physical address pointer pointing to a host buffer that the -* command's response data will be written. This can be either a host -* physical address (HPA) or a guest physical address (GPA) and must -* point to a physically contiguous block of memory. -*/ -uint64_t resp_addr; -/* Ring Type. */ -uint8_t ring_type; -/* L2 Completion Ring (CR) */ -#define HWRM_RING_RESET_INPUT_RING_TYPE_L2_CMPL UINT32_C(0x0) -/* TX Ring (TR) */ -#define HWRM_RING_RESET_INPUT_RING_TYPE_TX UINT32_C(0x1) -/* RX Ring (RR) */ -#define HWRM_RING_RESET_INPUT_RING_TYPE_RX UINT32_C(0x2) -/* RoCE Notification Completion Ring (ROCE_CR) */ -#define HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL UINT32_C(0x3) +#define HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRP UINT32_C(0x6)#define HWRM_RING_RESET_INPUT_RING_TYPE_LAST \ - HWRM_RING_RESET_INPUT_RING_TYPE_ROCE_CMPL + HWRM_RING_RESET_INPUT_RING_TYPE_RX_RING_GRPuint8_t unused_0; -/* Physical number of the ring. */ +/* +* Physical number of the ring. When ring type is rx_ring_grp, ring id +* actually refers to ring group id. +*/ uint16_t ring_id;uint8_t unused_1[4 ]; } __rte_packed;
@@ -25615,7 +27319,18 @@ struct hwrm_ring_cmpl_ring_qaggint_params_input {uint64_t resp_addr;/* Physical number of completion ring. */ uint16_t ring_id; -uint8_t unused_0[6 ]; +uint16_t flags; +#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_UNUSED_0_MASK \ + UINT32_C(0x3) +#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_UNUSED_0_SFT 0 +/* +* Set this flag to 1 when querying parameters on a notification +* queue. Set this flag to 0 when querying parameters on a +* completion queue or completion ring. +*/ +#define HWRM_RING_CMPL_RING_QAGGINT_PARAMS_INPUT_FLAGS_IS_NQ \ + UINT32_C(0x4) +uint8_t unused_0[4 ]; } __rte_packed;/* hwrm_ring_cmpl_ring_qaggint_params_output (size:256b/32B) */
@@ -25652,19 +27367,19 @@ struct hwrm_ring_cmpl_ring_qaggint_params_output {*/ uint16_t num_cmpl_dma_aggr_during_int;/* -* Timer in unit of 80-nsec used to aggregate completions before +* Timer used to aggregate completions before * DMA during the normal mode (not in interrupt mode). */ uint16_t cmpl_aggr_dma_tmr;/* -* Timer in unit of 80-nsec used to aggregate completions before -* DMA during the interrupt mode. +* Timer used to aggregate completions before +* DMA when in interrupt mode. */ uint16_t cmpl_aggr_dma_tmr_during_int; -/* Minimum time (in unit of 80-nsec) between two interrupts. */ +/* Minimum time between two interrupts. */ uint16_t int_lat_tmr_min;/* -* Maximum wait time (in unit of 80-nsec) spent aggregating +* Maximum wait time spent aggregating * completions before signaling the interrupt after the * interrupt is enabled. */
@@ -25738,7 +27453,7 @@ struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {/* * Set this flag to 1 when configuring parameters on a * notification queue. Set this flag to 0 when configuring -* parameters on a completion queue. +* parameters on a completion queue or completion ring. */ #define HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_IS_NQ \ UINT32_C(0x4)
@@ -25753,20 +27468,20 @@ struct hwrm_ring_cmpl_ring_cfg_aggint_params_input {*/ uint16_t num_cmpl_dma_aggr_during_int;/* -* Timer in unit of 80-nsec used to aggregate completions before +* Timer used to aggregate completions before * DMA during the normal mode (not in interrupt mode). */ uint16_t cmpl_aggr_dma_tmr;/* -* Timer in unit of 80-nsec used to aggregate completions before -* DMA during the interrupt mode. +* Timer used to aggregate completions before +* DMA while in interrupt mode. */ uint16_t cmpl_aggr_dma_tmr_during_int; -/* Minimum time (in unit of 80-nsec) between two interrupts. */ +/* Minimum time between two interrupts. */ uint16_t int_lat_tmr_min;/* -* Maximum wait time (in unit of 80-nsec) spent aggregating -* cmpls before signaling the interrupt after the +* Maximum wait time spent aggregating +* completions before signaling the interrupt after the * interrupt is enabled. */ uint16_t int_lat_tmr_max;
@@ -33339,78 +35054,246 @@ struct hwrm_tf_version_get_input {* point to a physically contiguous block of memory. */ uint64_t resp_addr; -} __rte_packed; - -/* hwrm_tf_version_get_output (size:128b/16B) */ -struct hwrm_tf_version_get_output { -/* The specific error status for the command. */ -uint16_t error_code; -/* The HWRM command request type. */ -uint16_t req_type; -/* The sequence ID from the original command. */ -uint16_t seq_id; -/* The length of the response data in number of bytes. */ -uint16_t resp_len; -/* Version Major number. */ -uint8_t major; -/* Version Minor number. */ -uint8_t minor; -/* Version Update number. */ -uint8_t update; -/* unused. */ -uint8_t unused0[4 ]; +} __rte_packed; + +/* hwrm_tf_version_get_output (size:128b/16B) */ +struct hwrm_tf_version_get_output { +/* The specific error status for the command. */ +uint16_t error_code; +/* The HWRM command request type. */ +uint16_t req_type; +/* The sequence ID from the original command. */ +uint16_t seq_id; +/* The length of the response data in number of bytes. */ +uint16_t resp_len; +/* Version Major number. */ +uint8_t major; +/* Version Minor number. */ +uint8_t minor; +/* Version Update number. */ +uint8_t update; +/* unused. */ +uint8_t unused0[4 ]; +/* +* This field is used in Output records to indicate that the output +* is completely written to RAM. This field should be read as '1' +* to indicate that the output has been completely written. +* When writing a command completion or response to an internal +* processor, the order of writes has to be such that this field is +* written last. +*/ +uint8_t valid; +} __rte_packed; + +/************************ +* hwrm_tf_session_open * +************************/ + + +/* hwrm_tf_session_open_input (size:640b/80B) */ +struct hwrm_tf_session_open_input { +/* The HWRM command request type. */ +uint16_t req_type; +/* +* The completion ring to send the completion event on. This should +* be the NQ ID returned from the `nq_alloc` HWRM command. +*/ +uint16_t cmpl_ring; +/* +* The sequence ID is used by the driver for tracking multiple +* commands. This ID is treated as opaque data by the firmware and +* the value is returned in the `hwrm_resp_hdr` upon completion. +*/ +uint16_t seq_id; +/* +* The target ID of the command: +* * 0x0-0xFFF8 - The function ID +* * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors +* * 0xFFFD - Reserved for user-space HWRM interface +* * 0xFFFF - HWRM +*/ +uint16_t target_id; +/* +* A physical address pointer pointing to a host buffer that the +* command's response data will be written. This can be either a host +* physical address (HPA) or a guest physical address (GPA) and must +* point to a physically contiguous block of memory. +*/ +uint64_t resp_addr; +/* Name of the session. */ +uint8_t session_name[64 ]; +} __rte_packed; + +/* hwrm_tf_session_open_output (size:192b/24B) */ +struct hwrm_tf_session_open_output { +/* The specific error status for the command. */ +uint16_t error_code; +/* The HWRM command request type. */ +uint16_t req_type; +/* The sequence ID from the original command. */ +uint16_t seq_id; +/* The length of the response data in number of bytes. */ +uint16_t resp_len; +/* +* Unique session identifier for the session created by the +* firmware. +*/ +uint32_t fw_session_id; +/* +* Unique session client identifier for the first client on +* the newly created session. +*/ +uint32_t fw_session_client_id; +/* unused. */ +uint32_t unused0; +/* unused. */ +uint8_t unused1[3 ]; +/* +* This field is used in Output records to indicate that the output +* is completely written to RAM. This field should be read as '1' +* to indicate that the output has been completely written. +* When writing a command completion or response to an internal +* processor, the order of writes has to be such that this field is +* written last. +*/ +uint8_t valid; +} __rte_packed; + +/************************** +* hwrm_tf_session_attach * +**************************/ + + +/* hwrm_tf_session_attach_input (size:704b/88B) */ +struct hwrm_tf_session_attach_input { +/* The HWRM command request type. */ +uint16_t req_type; +/* +* The completion ring to send the completion event on. This should +* be the NQ ID returned from the `nq_alloc` HWRM command. +*/ +uint16_t cmpl_ring; +/* +* The sequence ID is used by the driver for tracking multiple +* commands. This ID is treated as opaque data by the firmware and +* the value is returned in the `hwrm_resp_hdr` upon completion. +*/ +uint16_t seq_id; +/* +* The target ID of the command: +* * 0x0-0xFFF8 - The function ID +* * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors +* * 0xFFFD - Reserved for user-space HWRM interface +* * 0xFFFF - HWRM +*/ +uint16_t target_id; +/* +* A physical address pointer pointing to a host buffer that the +* command's response data will be written. This can be either a host +* physical address (HPA) or a guest physical address (GPA) and must +* point to a physically contiguous block of memory. +*/ +uint64_t resp_addr; +/* +* Unique session identifier for the session that the attach +* request want to attach to. This value originates from the +* shared session memory that the attach request opened by +* way of the 'attach name' that was passed in to the core +* attach API. +* The fw_session_id of the attach session includes PCIe bus +* info to distinguish the PF and session info to identify +* the associated TruFlow session. +*/ +uint32_t attach_fw_session_id; +/* unused. */ +uint32_t unused0; +/* Name of the session it self. */ +uint8_t session_name[64 ]; +} __rte_packed; + +/* hwrm_tf_session_attach_output (size:128b/16B) */ +struct hwrm_tf_session_attach_output { +/* The specific error status for the command. */ +uint16_t error_code; +/* The HWRM command request type. */ +uint16_t req_type; +/* The sequence ID from the original command. */ +uint16_t seq_id; +/* The length of the response data in number of bytes. */ +uint16_t resp_len; +/* +* Unique session identifier for the session created by the +* firmware. It includes PCIe bus info to distinguish the PF +* and session info to identify the associated TruFlow +* session. This fw_session_id is unique to the attach +* request. +*/ +uint32_t fw_session_id; +/* unused. */ +uint8_t unused0[3 ]; +/* +* This field is used in Output records to indicate that the output +* is completely written to RAM. This field should be read as '1' +* to indicate that the output has been completely written. +* When writing a command completion or response to an internal +* processor, the order of writes has to be such that this field is +* written last. +*/ +uint8_t valid; +} __rte_packed; + +/**************************** +* hwrm_tf_session_register * +****************************/ + + +/* hwrm_tf_session_register_input (size:704b/88B) */ +struct hwrm_tf_session_register_input { +/* The HWRM command request type. */ +uint16_t req_type; +/* +* The completion ring to send the completion event on. This should +* be the NQ ID returned from the `nq_alloc` HWRM command. +*/ +uint16_t cmpl_ring; +/* +* The sequence ID is used by the driver for tracking multiple +* commands. This ID is treated as opaque data by the firmware and +* the value is returned in the `hwrm_resp_hdr` upon completion. +*/ +uint16_t seq_id; +/* +* The target ID of the command: +* * 0x0-0xFFF8 - The function ID +* * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors +* * 0xFFFD - Reserved for user-space HWRM interface +* * 0xFFFF - HWRM +*/ +uint16_t target_id; +/* +* A physical address pointer pointing to a host buffer that the +* command's response data will be written. This can be either a host +* physical address (HPA) or a guest physical address (GPA) and must +* point to a physically contiguous block of memory. +*/ +uint64_t resp_addr;/* -* This field is used in Output records to indicate that the output -* is completely written to RAM. This field should be read as '1' -* to indicate that the output has been completely written. -* When writing a command completion or response to an internal -* processor, the order of writes has to be such that this field is -* written last. -*/ -uint8_t valid; -} __rte_packed; - -/************************ -* hwrm_tf_session_open * -************************/ - - -/* hwrm_tf_session_open_input (size:640b/80B) */ -struct hwrm_tf_session_open_input { -/* The HWRM command request type. */ -uint16_t req_type; -/* -* The completion ring to send the completion event on. This should -* be the NQ ID returned from the `nq_alloc` HWRM command. -*/ -uint16_t cmpl_ring; -/* -* The sequence ID is used by the driver for tracking multiple -* commands. This ID is treated as opaque data by the firmware and -* the value is returned in the `hwrm_resp_hdr` upon completion. -*/ -uint16_t seq_id; -/* -* The target ID of the command: -* * 0x0-0xFFF8 - The function ID -* * 0xFFF8-0xFFFC, 0xFFFE - Reserved for internal processors -* * 0xFFFD - Reserved for user-space HWRM interface -* * 0xFFFF - HWRM -*/ -uint16_t target_id; -/* -* A physical address pointer pointing to a host buffer that the -* command's response data will be written. This can be either a host -* physical address (HPA) or a guest physical address (GPA) and must -* point to a physically contiguous block of memory. +* Unique session identifier for the session that the +* register request want to create a new client on. This +* value originates from the first open request. +* The fw_session_id of the attach session includes PCIe bus +* info to distinguish the PF and session info to identify +* the associated TruFlow session. */ -uint64_t resp_addr; -/* Name of the session. */ -uint8_t session_name[64 ]; +uint32_t fw_session_id; +/* unused. */ +uint32_t unused0; +/* Name of the session client. */ +uint8_t session_client_name[64 ]; } __rte_packed; -/* hwrm_tf_session_open_output (size:128b/16B) */ -struct hwrm_tf_session_open_output { +/* hwrm_tf_session_register_output (size:128b/16B) */ +struct hwrm_tf_session_register_output {/* The specific error status for the command. */ uint16_t error_code;/* The HWRM command request type. */
@@ -33420,12 +35303,11 @@ struct hwrm_tf_session_open_output {/* The length of the response data in number of bytes. */ uint16_t resp_len;/* -* Unique session identifier for the session created by the -* firmware. It includes PCIe bus info to distinguish the PF -* and session info to identify the associated TruFlow -* session. +* Unique session client identifier for the session created +* by the firmware. It includes the session the client it +* attached to and session client info. */ -uint32_t fw_session_id; +uint32_t fw_session_client_id;/* unused. */ uint8_t unused0[3 ];/*
@@ -33439,13 +35321,13 @@ struct hwrm_tf_session_open_output {uint8_t valid; } __rte_packed; -/************************** -* hwrm_tf_session_attach * -**************************/ +/****************************** +* hwrm_tf_session_unregister * +******************************/ -/* hwrm_tf_session_attach_input (size:704b/88B) */ -struct hwrm_tf_session_attach_input { +/* hwrm_tf_session_unregister_input (size:192b/24B) */ +struct hwrm_tf_session_unregister_input {/* The HWRM command request type. */ uint16_t req_type;/*
@@ -33475,24 +35357,19 @@ struct hwrm_tf_session_attach_input {*/ uint64_t resp_addr;/* -* Unique session identifier for the session that the attach -* request want to attach to. This value originates from the -* shared session memory that the attach request opened by -* way of the 'attach name' that was passed in to the core -* attach API. -* The fw_session_id of the attach session includes PCIe bus -* info to distinguish the PF and session info to identify -* the associated TruFlow session. +* Unique session identifier for the session that the +* unregister request want to close a session client on. */ -uint32_t attach_fw_session_id; -/* unused. */ -uint32_t unused0; -/* Name of the session it self. */ -uint8_t session_name[64 ]; +uint32_t fw_session_id; +/* +* Unique session client identifier for the session that the +* unregister request want to close. +*/ +uint32_t fw_session_client_id; } __rte_packed; -/* hwrm_tf_session_attach_output (size:128b/16B) */ -struct hwrm_tf_session_attach_output { +/* hwrm_tf_session_unregister_output (size:128b/16B) */ +struct hwrm_tf_session_unregister_output {/* The specific error status for the command. */ uint16_t error_code;/* The HWRM command request type. */
@@ -33501,16 +35378,8 @@ struct hwrm_tf_session_attach_output {uint16_t seq_id;/* The length of the response data in number of bytes. */ uint16_t resp_len; -/* -* Unique session identifier for the session created by the -* firmware. It includes PCIe bus info to distinguish the PF -* and session info to identify the associated TruFlow -* session. This fw_session_id is unique to the attach -* request. -*/ -uint32_t fw_session_id;/* unused. */ -uint8_t unused0[3 ]; +uint8_t unused0[7 ];/* * This field is used in Output records to indicate that the output * is completely written to RAM. This field should be read as '1'
@@ -33746,15 +35615,17 @@ struct hwrm_tf_session_resc_qcaps_input {#define HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_LAST \ HWRM_TF_SESSION_RESC_QCAPS_INPUT_FLAGS_DIR_TX/* -* Defines the size, in bytes, of the provided qcaps_addr +* Defines the size of the provided qcaps_addr array * buffer. The size should be set to the Resource Manager -* provided max qcaps value that is device specific. This is -* the max size possible. +* provided max number of qcaps entries which is device +* specific. Resource Manager gets the max size from HCAPI +* RM. */ -uint16_t size; +uint16_t qcaps_size;/* -* This is the DMA address for the qcaps output data -* array. Array is of tf_rm_cap type and is device specific. +* This is the DMA address for the qcaps output data array +* buffer. Array is of tf_rm_resc_req_entry type and is +* device specific. */ uint64_t qcaps_addr; } __rte_packed;
@@ -33772,29 +35643,28 @@ struct hwrm_tf_session_resc_qcaps_output {/* Control flags. */ uint32_t flags;/* Session reservation strategy. */ -#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RES_STRATEGY_MASK \ +#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_MASK \ UINT32_C(0x3) -#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RES_STRATEGY_SFT \ +#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_SFT \ 0/* Static partitioning. */ -#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RES_STRATEGY_STATIC \ +#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_STATIC \ UINT32_C(0x0)/* Strategy 1. */ -#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RES_STRATEGY_1 \ +#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_1 \ UINT32_C(0x1)/* Strategy 2. */ -#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RES_STRATEGY_2 \ +#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_2 \ UINT32_C(0x2)/* Strategy 3. */ -#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RES_STRATEGY_3 \ +#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_3 \ UINT32_C(0x3) -#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RES_STRATEGY_LAST \ - HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RES_STRATEGY_3 +#define HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_LAST \ + HWRM_TF_SESSION_RESC_QCAPS_OUTPUT_FLAGS_SESS_RESV_STRATEGY_3/* -* Size of the returned tf_rm_cap data array. The value -* cannot exceed the size defined by the input msg. The data -* array is returned using the qcaps_addr specified DMA -* address also provided by the input msg. +* Size of the returned qcaps_addr data array buffer. The +* value cannot exceed the size defined by the input msg, +* qcaps_size. */ uint16_t size;/* unused. */
@@ -33817,7 +35687,7 @@ struct hwrm_tf_session_resc_qcaps_output {******************************/ -/* hwrm_tf_session_resc_alloc_input (size:256b/32B) */ +/* hwrm_tf_session_resc_alloc_input (size:320b/40B) */ struct hwrm_tf_session_resc_alloc_input {/* The HWRM command request type. */ uint16_t req_type;
@@ -33860,16 +35730,25 @@ struct hwrm_tf_session_resc_alloc_input {#define HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_LAST \ HWRM_TF_SESSION_RESC_ALLOC_INPUT_FLAGS_DIR_TX/* -* Defines the size, in bytes, of the provided num_addr -* buffer. +* Defines the array size of the provided req_addr and +* resv_addr array buffers. Should be set to the number of +* request entries. */ -uint16_t size; +uint16_t req_size; +/* +* This is the DMA address for the request input data array +* buffer. Array is of tf_rm_resc_req_entry type. Size of the +* array buffer is provided by the 'req_size' field in this +* message. +*/ +uint64_t req_addr;/* -* This is the DMA address for the num input data array -* buffer. Array is of tf_rm_num type. Size of the buffer is -* provided by the 'size' field in this message. +* This is the DMA address for the resc output data array +* buffer. Array is of tf_rm_resc_entry type. Size of the array +* buffer is provided by the 'req_size' field in this +* message. */ -uint64_t num_addr; +uint64_t resc_addr; } __rte_packed;
Lines of this file are not shown. View the raw message.
drivers/net/bnxt/tf_core/tf_core.c +133 -11
144 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_core.h +208 -175
383 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_em.c +94 -4
98 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_ext_flow_handle.h +12 -0
Lines of this file are not shown. View the raw message.
drivers/net/bnxt/tf_core/tf_msg.c +83 -3
86 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tbl.c +95 -4
99 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tbl.h +35 -22
57 lines not on this page · raw message
drivers/net/bnxt/tf_core/tfp.h +88 -35
123 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.21.1 (Apple Git-122.3)
Part of the diff is not shown here. View the raw message.
PATCH v4 10/51 net/bnxt: modify EM insert and delete to use HWRM direct
In reply to Ajit KhapardeFrom: Peter Spreadborough <[email protected]>
Modify Exact Match insert and delete to use the HWRM messages directly. Remove tunneled EM insert and delete message types.
--- drivers/net/bnxt/tf_core/hwrm_tf.h | 70 ++---------------------------- drivers/net/bnxt/tf_core/tf_msg.c | 66 ++++++++++++++++------------ 2 files changed, 43 insertions(+), 93 deletions(-)
drivers/net/bnxt/tf_core/hwrm_tf.h +4 -66
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2019-2020 Broadcom +* Copyright(c) 2019 Broadcom * All rights reserved. */ #ifndef _HWRM_TF_H_
@@ -23,8 +23,6 @@ typedef enum tf_subtype {HWRM_TFT_SESSION_SRAM_RESC_FREE =727 ,HWRM_TFT_SESSION_SRAM_RESC_FLUSH =728 ,HWRM_TFT_TBL_SCOPE_CFG =731 , -HWRM_TFT_EM_RULE_INSERT =739 , -HWRM_TFT_EM_RULE_DELETE =740 ,HWRM_TFT_REG_GET =821 ,HWRM_TFT_REG_SET =822 , HWRM_TFT_TBL_TYPE_SET = 823,
@@ -83,10 +81,6 @@ struct tf_session_sram_resc_flush_input;struct tf_tbl_type_set_input ;struct tf_tbl_type_get_input ;struct tf_tbl_type_get_output ; -struct tf_em_internal_insert_input ; -struct tf_em_internal_insert_output ; -struct tf_em_internal_delete_input ; -struct tf_em_internal_delete_output ;/* Input params for session attach */ typedef struct tf_session_attach_input { /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent */
@@ -351,7 +345,7 @@ typedef struct tf_session_hw_resc_alloc_output {uint16_t range_prof_start;/* Number range profiles allocated */ uint16_t range_prof_stride; -/* Starting index of range entries allocated to the session */ +/* Starting index of range enntries allocated to the session */ uint16_t range_entries_start;/* Number of range entries allocated */ uint16_t range_entries_stride;
@@ -453,7 +447,7 @@ typedef struct tf_session_hw_resc_free_input {uint16_t range_prof_start;/* Number range profiles allocated */ uint16_t range_prof_stride; -/* Starting index of range entries allocated to the session */ +/* Starting index of range enntries allocated to the session */ uint16_t range_entries_start;/* Number of range entries allocated */ uint16_t range_entries_stride;
@@ -555,7 +549,7 @@ typedef struct tf_session_hw_resc_flush_input {uint16_t range_prof_start;/* Number range profiles allocated */ uint16_t range_prof_stride; -/* Starting index of range entries allocated to the session */ +/* Starting index of range enntries allocated to the session */ uint16_t range_entries_start;/* Number of range entries allocated */ uint16_t range_entries_stride;
@@ -922,60 +916,4 @@ typedef struct tf_tbl_type_get_output { uint8_t data[TF_BULK_RECV]; } tf_tbl_type_get_output_t, *ptf_tbl_type_get_output_t; -/* Input params for EM internal rule insert */ -typedef struct tf_em_internal_insert_input { -/* Firmware Session Id */ -uint32_t fw_session_id; -/* flags */ -uint16_t flags; -/* When set to 0, indicates the get apply to RX */ -#define TF_EM_INTERNAL_INSERT_INPUT_FLAGS_DIR_RX (0x0) -/* When set to 1, indicates the get apply to TX */ -#define TF_EM_INTERNAL_INSERT_INPUT_FLAGS_DIR_TX (0x1) -/* strength */ -uint16_t strength; -/* index to action */ -uint32_t action_ptr; -/* index of em record */ -uint32_t em_record_idx; -/* EM Key value */ -uint64_t em_key[8 ]; -/* number of bits in em_key */ -uint16_t em_key_bitlen; -}tf_em_internal_insert_input_t , *ptf_em_internal_insert_input_t ; - -/* Output params for EM internal rule insert */ -typedef struct tf_em_internal_insert_output { -/* EM record pointer index */ -uint16_t rptr_index; -/* EM record offset 0~3 */ -uint8_t rptr_entry; -/* Number of word entries consumed by the key */ -uint8_t num_of_entries; -}tf_em_internal_insert_output_t , *ptf_em_internal_insert_output_t ; - -/* Input params for EM INTERNAL rule delete */ -typedef struct tf_em_internal_delete_input { -/* Session Id */ -uint32_t tf_session_id; -/* flags */ -uint16_t flags; -/* When set to 0, indicates the get apply to RX */ -#define TF_EM_INTERNAL_DELETE_INPUT_FLAGS_DIR_RX (0x0) -/* When set to 1, indicates the get apply to TX */ -#define TF_EM_INTERNAL_DELETE_INPUT_FLAGS_DIR_TX (0x1) -/* EM internal flow hanndle */ -uint64_t flow_handle; -/* EM Key value */ -uint64_t em_key[8 ]; -/* number of bits in em_key */ -uint16_t em_key_bitlen; -}tf_em_internal_delete_input_t , *ptf_em_internal_delete_input_t ; - -/* Input params for EM INTERNAL rule delete */ -typedef struct tf_em_internal_delete_output { -/* Original stack allocation index */ -uint16_t em_index; -}tf_em_internal_delete_output_t , *ptf_em_internal_delete_output_t ; -#endif /* _HWRM_TF_H_ */
drivers/net/bnxt/tf_core/tf_msg.c +39 -27
110 lines not on this page · raw message
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 11/51 net/bnxt: add multi device support
In reply to Ajit KhapardeFrom: Michael Wildt <[email protected]>
Introduce new modules for Device, Resource Manager, Identifier, Table Types, and TCAM for multi device support.
--- drivers/net/bnxt/meson.build | 8 + drivers/net/bnxt/tf_core/Makefile | 9 + drivers/net/bnxt/tf_core/cfa_resource_types.h | 266 +++++++++++++ drivers/net/bnxt/tf_core/tf_core.c | 2 + drivers/net/bnxt/tf_core/tf_core.h | 56 +-- drivers/net/bnxt/tf_core/tf_device.c | 50 +++ drivers/net/bnxt/tf_core/tf_device.h | 331 ++++++++++++++++ drivers/net/bnxt/tf_core/tf_device_p4.c | 24 ++ drivers/net/bnxt/tf_core/tf_device_p4.h | 64 +++ drivers/net/bnxt/tf_core/tf_identifier.c | 47 +++ drivers/net/bnxt/tf_core/tf_identifier.h | 140 +++++++ drivers/net/bnxt/tf_core/tf_rm.c | 54 +-- drivers/net/bnxt/tf_core/tf_rm.h | 18 - drivers/net/bnxt/tf_core/tf_rm_new.c | 102 +++++ drivers/net/bnxt/tf_core/tf_rm_new.h | 368 ++++++++++++++++++ drivers/net/bnxt/tf_core/tf_session.c | 31 ++ drivers/net/bnxt/tf_core/tf_session.h | 54 +++ drivers/net/bnxt/tf_core/tf_shadow_tbl.c | 63 +++ drivers/net/bnxt/tf_core/tf_shadow_tbl.h | 240 ++++++++++++ drivers/net/bnxt/tf_core/tf_shadow_tcam.c | 63 +++ drivers/net/bnxt/tf_core/tf_shadow_tcam.h | 239 ++++++++++++ drivers/net/bnxt/tf_core/tf_tbl.c | 1 + drivers/net/bnxt/tf_core/tf_tbl_type.c | 78 ++++ drivers/net/bnxt/tf_core/tf_tbl_type.h | 309 +++++++++++++++ drivers/net/bnxt/tf_core/tf_tcam.c | 78 ++++ drivers/net/bnxt/tf_core/tf_tcam.h | 314 +++++++++++++++ drivers/net/bnxt/tf_core/tf_util.c | 145 +++++++ drivers/net/bnxt/tf_core/tf_util.h | 41 ++ 28 files changed, 3101 insertions(+), 94 deletions(-) create mode 100644 drivers/net/bnxt/tf_core/cfa_resource_types.h create mode 100644 drivers/net/bnxt/tf_core/tf_device.c create mode 100644 drivers/net/bnxt/tf_core/tf_device.h create mode 100644 drivers/net/bnxt/tf_core/tf_device_p4.c create mode 100644 drivers/net/bnxt/tf_core/tf_device_p4.h create mode 100644 drivers/net/bnxt/tf_core/tf_identifier.c create mode 100644 drivers/net/bnxt/tf_core/tf_identifier.h create mode 100644 drivers/net/bnxt/tf_core/tf_rm_new.c create mode 100644 drivers/net/bnxt/tf_core/tf_rm_new.h create mode 100644 drivers/net/bnxt/tf_core/tf_session.c create mode 100644 drivers/net/bnxt/tf_core/tf_shadow_tbl.c create mode 100644 drivers/net/bnxt/tf_core/tf_shadow_tbl.h create mode 100644 drivers/net/bnxt/tf_core/tf_shadow_tcam.c create mode 100644 drivers/net/bnxt/tf_core/tf_shadow_tcam.h create mode 100644 drivers/net/bnxt/tf_core/tf_tbl_type.c create mode 100644 drivers/net/bnxt/tf_core/tf_tbl_type.h create mode 100644 drivers/net/bnxt/tf_core/tf_tcam.c create mode 100644 drivers/net/bnxt/tf_core/tf_tcam.h create mode 100644 drivers/net/bnxt/tf_core/tf_util.c create mode 100644 drivers/net/bnxt/tf_core/tf_util.h
drivers/net/bnxt/meson.build +8 -0
@@ -32,6 +32,14 @@ sources = files('bnxt_cpr.c', 'tf_core/tf_rm.c', 'tf_core/tf_tbl.c', 'tf_core/tfp.c', + 'tf_core/tf_device_p4.c', + 'tf_core/tf_identifier.c', + 'tf_core/tf_shadow_tbl.c', + 'tf_core/tf_shadow_tcam.c', + 'tf_core/tf_tbl_type.c', + 'tf_core/tf_tcam.c', + 'tf_core/tf_util.c', + 'tf_core/tf_rm_new.c', 'tf_ulp/bnxt_ulp.c', 'tf_ulp/ulp_mark_mgr.c',
drivers/net/bnxt/tf_core/Makefile +9 -0
@@ -14,3 +14,12 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tfp.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_msg.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_em.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_tbl.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_device.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_device_p4.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_identifier.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_shadow_tbl.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_shadow_tcam.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_tbl_type.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_tcam.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_util.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_rm_new.c
drivers/net/bnxt/tf_core/cfa_resource_types.h new file +266 -0
266 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_core.c +2 -0
@@ -6,6 +6,7 @@#include <stdio.h> #include "tf_core.h" +#include "tf_util.h" #include "tf_session.h" #include "tf_tbl.h" #include "tf_em.h"
@@ -229,6 +230,7 @@ tf_open_session(struct tf *tfp,/* Initialize Session */ session->device_type = parms->device_type; + session->dev =NULL ;tf_rm_init (tfp);/* Construct the Session ID */
drivers/net/bnxt/tf_core/tf_core.h +33 -23
72 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_device.c new file +50 -0
50 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_device.h new file +331 -0
331 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_device_p4.c new file +24 -0
@@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2019-2020 Broadcom +* All rights reserved. +*/ + +#include "tf_device.h" +#include "tf_identifier.h" +#include "tf_tbl_type.h" +#include "tf_tcam.h" + +const struct tf_dev_ops tf_dev_ops_p4 = { + .tf_dev_alloc_ident = tf_ident_alloc, + .tf_dev_free_ident = tf_ident_free, + .tf_dev_alloc_tbl_type = tf_tbl_type_alloc, + .tf_dev_free_tbl_type = tf_tbl_type_free, + .tf_dev_alloc_search_tbl_type = tf_tbl_type_alloc_search, + .tf_dev_set_tbl_type = tf_tbl_type_set, + .tf_dev_get_tbl_type = tf_tbl_type_get, + .tf_dev_alloc_tcam = tf_tcam_alloc, + .tf_dev_free_tcam = tf_tcam_free, + .tf_dev_alloc_search_tcam = tf_tcam_alloc_search, + .tf_dev_set_tcam = tf_tcam_set, + .tf_dev_get_tcam = tf_tcam_get, +};
drivers/net/bnxt/tf_core/tf_device_p4.h new file +64 -0
64 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_identifier.c new file +47 -0
47 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_identifier.h new file +140 -0
140 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_rm.c +1 -53
66 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_rm.h +0 -18
@@ -124,24 +124,6 @@ struct tf_rm_db {struct tf_rm_resc tx; }; -/** -* Helper function converting direction to text string -*/ -const char -*tf_dir_2_str (enum tf_dir dir); - -/** -* Helper function converting identifier to text string -*/ -const char -*tf_ident_2_str (enum tf_identifier_type id_type); - -/** -* Helper function converting tcam type to text string -*/ -const char -*tf_tcam_tbl_2_str (enum tf_tcam_tbl_type tcam_type); -/** * Helper function used to convert HW HCAPI resource type to a string. */
drivers/net/bnxt/tf_core/tf_rm_new.c new file +102 -0
102 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_rm_new.h new file +368 -0
368 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_session.c new file +31 -0
@@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2019-2020 Broadcom +* All rights reserved. +*/ + +int +tf_session_get_session (struct tf *tfp, +struct tf_session *tfs) +{ +if (tfp->session ==NULL || tfp->session->core_data ==NULL ) { +TFP_DRV_LOG (ERR ,"Session not created\n" ); +return -EINVAL ; + } + + tfs = (struct tf_session *)(tfp->session->core_data); + +return 0 ; +} + +int +tf_session_get_device (struct tf_session *tfs, +struct tf_device *tfd) +{ +if (tfs->dev ==NULL ) { +TFP_DRV_LOG (ERR ,"Device not created\n" ); +return -EINVAL ; + } + tfd = tfs->dev; + +return 0 ; +}
drivers/net/bnxt/tf_core/tf_session.h +54 -0
74 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_shadow_tbl.c new file +63 -0
63 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_shadow_tbl.h new file +240 -0
240 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_shadow_tcam.c new file +63 -0
63 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_shadow_tcam.h new file +239 -0
239 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tbl.c +1 -0
@@ -15,6 +15,7 @@#include "hsi_struct_def_dpdk.h" #include "tf_core.h" +#include "tf_util.h" #include "tf_em.h" #include "tf_msg.h" #include "tfp.h"
drivers/net/bnxt/tf_core/tf_tbl_type.c new file +78 -0
78 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tbl_type.h new file +309 -0
309 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tcam.c new file +78 -0
78 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tcam.h new file +314 -0
224 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_util.c new file +145 -0
145 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_util.h new file +41 -0
41 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.21.1 (Apple Git-122.3)
Part of the diff is not shown here. View the raw message.
PATCH v4 12/51 net/bnxt: support bulk table get and mirror
In reply to Ajit KhapardeFrom: Shahaji Bhosle <[email protected]>
- Add new bulk table type get using FW
to DMA the data back to host.
- Add flag to allow records to be cleared if possible
- Set mirror using tf_alloc_tbl_entry
--- drivers/net/bnxt/tf_core/hwrm_tf.h | 37 ++++++++- drivers/net/bnxt/tf_core/tf_common.h | 54 +++++++++++++ drivers/net/bnxt/tf_core/tf_core.c | 2 + drivers/net/bnxt/tf_core/tf_core.h | 55 ++++++++++++- drivers/net/bnxt/tf_core/tf_msg.c | 70 ++++++++++++---- drivers/net/bnxt/tf_core/tf_msg.h | 15 ++++ drivers/net/bnxt/tf_core/tf_resources.h | 5 +- drivers/net/bnxt/tf_core/tf_tbl.c | 103 ++++++++++++++++++++++++ 8 files changed, 319 insertions(+), 22 deletions(-) create mode 100644 drivers/net/bnxt/tf_core/tf_common.h
drivers/net/bnxt/tf_core/hwrm_tf.h +35 -2
@@ -1,5 +1,5 @@/* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2019 Broadcom +* Copyright(c) 2019-2020 Broadcom * All rights reserved. */ #ifndef _HWRM_TF_H_
@@ -27,7 +27,8 @@ typedef enum tf_subtype {HWRM_TFT_REG_SET =822 ,HWRM_TFT_TBL_TYPE_SET =823 ,HWRM_TFT_TBL_TYPE_GET =824 , -TF_SUBTYPE_LAST =HWRM_TFT_TBL_TYPE_GET , +HWRM_TFT_TBL_TYPE_GET_BULK =825 , +TF_SUBTYPE_LAST =HWRM_TFT_TBL_TYPE_GET_BULK , } tf_subtype_t;/* Request and Response compile time checking */
@@ -81,6 +82,8 @@ struct tf_session_sram_resc_flush_input;struct tf_tbl_type_set_input ;struct tf_tbl_type_get_input ;struct tf_tbl_type_get_output ; +struct tf_tbl_type_get_bulk_input ; +struct tf_tbl_type_get_bulk_output ;/* Input params for session attach */ typedef struct tf_session_attach_input { /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent */
@@ -902,6 +905,8 @@ typedef struct tf_tbl_type_get_input {#define TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_RX (0x0)/* When set to 1, indicates the get apply to TX */ #define TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_TX (0x1) +/* When set to 1, indicates the clear entry on read */ +#define TF_TBL_TYPE_GET_INPUT_FLAGS_CLEAR_ON_READ (0x2)/* Type of the object to set */ uint32_t type;/* Index to get */
@@ -916,4 +921,32 @@ typedef struct tf_tbl_type_get_output { uint8_t data[TF_BULK_RECV]; } tf_tbl_type_get_output_t, *ptf_tbl_type_get_output_t; +/* Input params for table type get */ +typedef struct tf_tbl_type_get_bulk_input { +/* Session Id */ +uint32_t fw_session_id; +/* flags */ +uint16_t flags; +/* When set to 0, indicates the get apply to RX */ +#define TF_TBL_TYPE_GET_BULK_INPUT_FLAGS_DIR_RX (0x0) +/* When set to 1, indicates the get apply to TX */ +#define TF_TBL_TYPE_GET_BULK_INPUT_FLAGS_DIR_TX (0x1) +/* When set to 1, indicates the clear entry on read */ +#define TF_TBL_TYPE_GET_BULK_INPUT_FLAGS_CLEAR_ON_READ (0x2) +/* Type of the object to set */ +uint32_t type; +/* Starting index to get from */ +uint32_t start_index; +/* Number of entries to get */ +uint32_t num_entries; +/* Host memory where data will be stored */ +uint64_t host_addr; +}tf_tbl_type_get_bulk_input_t , *ptf_tbl_type_get_bulk_input_t ; + +/* Output params for table type get */ +typedef struct tf_tbl_type_get_bulk_output { +/* Size of the total data read in bytes */ +uint16_t size; +}tf_tbl_type_get_bulk_output_t , *ptf_tbl_type_get_bulk_output_t ; +#endif /* _HWRM_TF_H_ */
drivers/net/bnxt/tf_core/tf_common.h new file +54 -0
54 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_core.c +2 -0
@@ -16,6 +16,8 @@#include "bitalloc.h" #include "bnxt.h" #include "rand.h" +#include "tf_common.h" +#include "hwrm_tf.h" static inline uint32_t SWAP_WORDS32 (uint32_t val32) {
drivers/net/bnxt/tf_core/tf_core.h +54 -1
67 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_msg.c +54 -16
104 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_msg.h +15 -0
@@ -267,4 +267,19 @@ int tf_msg_get_tbl_entry(struct tf *tfp,uint8_t *data, uint32_t index); +/** +* Sends bulk get message of a Table Type element to the firmware. +* +* [in] tfp +* Pointer to session handle +* +* [in] parms +* Pointer to table get bulk parameters +* +* Returns: +* 0 on Success else internal Truflow error +*/ +int tf_msg_get_bulk_tbl_entry (struct tf *tfp, +struct tf_get_bulk_tbl_entry_parms *parms); +#endif /* _TF_MSG_H_ */
drivers/net/bnxt/tf_core/tf_resources.h +2 -3
@@ -149,11 +149,10 @@#define TF_RSVD_METER_INST_END_IDX_TX 0/* Mirror */ -/* Not yet supported fully in the infra */ -#define TF_RSVD_MIRROR_RX 0 +#define TF_RSVD_MIRROR_RX 1#define TF_RSVD_MIRROR_BEGIN_IDX_RX 0#define TF_RSVD_MIRROR_END_IDX_RX 0 -#define TF_RSVD_MIRROR_TX 0 +#define TF_RSVD_MIRROR_TX 1#define TF_RSVD_MIRROR_BEGIN_IDX_TX 0#define TF_RSVD_MIRROR_END_IDX_TX 0
drivers/net/bnxt/tf_core/tf_tbl.c +103 -0
133 lines not on this page · raw message
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 13/51 net/bnxt: update multi device design support
In reply to Ajit KhapardeFrom: Michael Wildt <[email protected]>
- Implement the modules RM, Device (WH+), Identifier.
- Update Session module.
- Implement new HWRMs for RM direct messaging.
- Add new parameter check macro's and clean up the header includes for i.e. tfp such that bnxt.h is not directly included in the new modules.
- Add cfa_resource_types, required for RM design.
--- drivers/net/bnxt/meson.build | 2 + drivers/net/bnxt/tf_core/Makefile | 1 + drivers/net/bnxt/tf_core/cfa_resource_types.h | 291 ++++++------ drivers/net/bnxt/tf_core/tf_common.h | 24 + drivers/net/bnxt/tf_core/tf_core.c | 286 +++++++++++- drivers/net/bnxt/tf_core/tf_core.h | 12 +- drivers/net/bnxt/tf_core/tf_device.c | 150 +++++- drivers/net/bnxt/tf_core/tf_device.h | 79 +++- drivers/net/bnxt/tf_core/tf_device_p4.c | 78 +++- drivers/net/bnxt/tf_core/tf_device_p4.h | 79 ++-- drivers/net/bnxt/tf_core/tf_identifier.c | 142 +++++- drivers/net/bnxt/tf_core/tf_identifier.h | 25 +- drivers/net/bnxt/tf_core/tf_msg.c | 268 +++++++++-- drivers/net/bnxt/tf_core/tf_msg.h | 59 +++ drivers/net/bnxt/tf_core/tf_rm_new.c | 434 ++++++++++++++++-- drivers/net/bnxt/tf_core/tf_rm_new.h | 72 ++- drivers/net/bnxt/tf_core/tf_session.c | 256 ++++++++++- drivers/net/bnxt/tf_core/tf_session.h | 118 ++++- drivers/net/bnxt/tf_core/tf_tbl.h | 4 + drivers/net/bnxt/tf_core/tf_tbl_type.c | 30 +- drivers/net/bnxt/tf_core/tf_tbl_type.h | 95 ++-- drivers/net/bnxt/tf_core/tf_tcam.h | 14 +- 22 files changed, 2120 insertions(+), 399 deletions(-)
drivers/net/bnxt/meson.build +2 -0
@@ -32,6 +32,8 @@ sources = files('bnxt_cpr.c', 'tf_core/tf_rm.c', 'tf_core/tf_tbl.c', 'tf_core/tfp.c', + 'tf_core/tf_session.c', + 'tf_core/tf_device.c', 'tf_core/tf_device_p4.c', 'tf_core/tf_identifier.c', 'tf_core/tf_shadow_tbl.c',
drivers/net/bnxt/tf_core/Makefile +1 -0
@@ -14,6 +14,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tfp.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_msg.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_em.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_tbl.c +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_session.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_device.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_device_p4.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_identifier.c
drivers/net/bnxt/tf_core/cfa_resource_types.h +146 -145
361 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_common.h +24 -0
@@ -51,4 +51,28 @@ } \ } while (0) + +#define TF_CHECK_PARMS1 (parms) do { \ + if ((parms) == NULL) { \ + TFP_DRV_LOG(ERR, "Invalid Argument(s)\n"); \ + return -EINVAL; \ + } \ + } while (0) + +#define TF_CHECK_PARMS2 (parms1, parms2) do { \ + if ((parms1) == NULL || (parms2) == NULL) { \ + TFP_DRV_LOG(ERR, "Invalid Argument(s)\n"); \ + return -EINVAL; \ + } \ + } while (0) + +#define TF_CHECK_PARMS3 (parms1, parms2, parms3) do { \ + if ((parms1) == NULL || \ + (parms2) == NULL || \ + (parms3) == NULL) { \ + TFP_DRV_LOG(ERR, "Invalid Argument(s)\n"); \ + return -EINVAL; \ + } \ + } while (0) +#endif /* _TF_COMMON_H_ */
drivers/net/bnxt/tf_core/tf_core.c +278 -8
340 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_core.h +11 -1
@@ -380,7 +380,7 @@ struct tf_session_resources {* The number of identifier resources requested for the session. * The index used is tf_identifier_type. */ -uint16_t identifer_cnt[TF_DIR_MAX ][TF_IDENT_TYPE_MAX ]; +uint16_t identifier_cnt[TF_IDENT_TYPE_MAX ][TF_DIR_MAX ];/** [in] Requested Index Table resource counts * * The number of index table resources requested for the session.
@@ -480,6 +480,9 @@ struct tf_open_session_parms {int tf_open_session (struct tf *tfp,struct tf_open_session_parms *parms); +int tf_open_session_new (struct tf *tfp, +struct tf_open_session_parms *parms); +struct tf_attach_session_parms {/** [in] ctrl_chan_name *
@@ -542,6 +545,8 @@ struct tf_attach_session_parms {*/ int tf_attach_session (struct tf *tfp,struct tf_attach_session_parms *parms); +int tf_attach_session_new (struct tf *tfp, +struct tf_attach_session_parms *parms);/** * Closes an existing session. Cleans up all hardware and firmware
@@ -551,6 +556,7 @@ int tf_attach_session(struct tf *tfp,* Returns success or failure code. */ int tf_close_session (struct tf *tfp); +int tf_close_session_new (struct tf *tfp);/** * @page ident Identity Management
@@ -602,6 +608,8 @@ struct tf_free_identifier_parms {*/ int tf_alloc_identifier (struct tf *tfp,struct tf_alloc_identifier_parms *parms); +int tf_alloc_identifier_new (struct tf *tfp, +struct tf_alloc_identifier_parms *parms);/** free identifier resource *
@@ -613,6 +621,8 @@ int tf_alloc_identifier(struct tf *tfp,*/ int tf_free_identifier (struct tf *tfp,struct tf_free_identifier_parms *parms); +int tf_free_identifier_new (struct tf *tfp, +struct tf_free_identifier_parms *parms);/** * @page dram_table DRAM Table Scope Interface
drivers/net/bnxt/tf_core/tf_device.c +137 -13
182 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_device.h +62 -17
161 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_device_p4.c +73 -5
92 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_device_p4.h +48 -31
100 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_identifier.c +136 -6
178 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_identifier.h +16 -9
@@ -12,21 +12,28 @@* The Identifier module provides processing of Identifiers. */ -struct tf_ident_cfg { +struct tf_ident_cfg_parms {/** -* Number of identifier types in each of the configuration -* arrays +* [in] Number of identifier types in each of the +* configuration arrays */ uint16_t num_elements; -/** -* TCAM configuration array +* [in] Identifier configuration array +*/ +struct tf_rm_element_cfg *cfg; +/** +* [in] Boolean controlling the request shadow copy. */ -struct tf_rm_element_cfg *ident_cfg[TF_DIR_MAX ]; +bool shadow_copy; +/** +* [in] Session resource allocations +*/ +struct tf_session_resources *resources; };/** -* Identifier allcoation parameter definition +* Identifier allocation parameter definition */ struct tf_ident_alloc_parms {/**
@@ -40,7 +47,7 @@ struct tf_ident_alloc_parms {/** * [out] Identifier allocated */ -uint16_t id; +uint16_t *id; };/**
@@ -88,7 +95,7 @@ struct tf_ident_free_parms {* - (-EINVAL) on failure. */ int tf_ident_bind (struct tf *tfp, -struct tf_ident_cfg *parms); +struct tf_ident_cfg_parms *parms);/** * Cleans up the private DBs and releases all the data.
drivers/net/bnxt/tf_core/tf_msg.c +234 -34
321 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_msg.h +59 -0
73 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_rm_new.c +407 -27
487 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_rm_new.h +50 -22
187 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_session.c +248 -8
277 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_session.h +107 -11
99 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tbl_type.c +15 -15
Lines of this file are not shown. View the raw message.
drivers/net/bnxt/tf_core/tf_tbl_type.h +52 -43
95 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.21.1 (Apple Git-122.3)
Part of the diff is not shown here. View the raw message.
PATCH v4 14/51 net/bnxt: support two-level priority for TCAMs
In reply to Ajit KhapardeFrom: Shahaji Bhosle <[email protected]>
Allow TCAM indexes to be allocated from top or bottom. If the priority is set to 0, allocate from the lowest tcam indexes i.e. from top. Any other value, allocate it from the highest tcam indexes i.e. from bottom.
--- drivers/net/bnxt/tf_core/tf_core.c | 36 ++++++++++++++++++++++++------ drivers/net/bnxt/tf_core/tf_core.h | 4 +++- drivers/net/bnxt/tf_core/tf_em.c | 6 ++--- drivers/net/bnxt/tf_core/tf_tbl.c | 2 +- 4 files changed, 35 insertions(+), 13 deletions(-)
drivers/net/bnxt/tf_core/tf_core.c +29 -7
@@ -893,7 +893,7 @@ tf_alloc_tcam_entry(struct tf *tfp, struct tf_alloc_tcam_entry_parms *parms) {int rc; -int index; +int index =0 ;struct tf_session *tfs;struct bitalloc *session_pool;
@@ -916,12 +916,34 @@ tf_alloc_tcam_entry(struct tf *tfp,if (rc)return rc; - index =ba_alloc (session_pool); -if (index ==BA_FAIL ) { -PMD_DRV_LOG (ERR ,"%s: %s: No resource available\n" , -tf_dir_2_str (parms->dir), -tf_tcam_tbl_2_str (parms->tcam_tbl_type)); -return -ENOMEM ; +/* +* priority 0: allocate from top of the tcam i.e. high +* priority !0: allocate index from bottom i.e lowest +*/ +if (parms->priority) { +for (index = session_pool->size -1 ; index >=0 ; index--) { +if (ba_inuse (session_pool, + index) ==BA_ENTRY_FREE ) { +break ; + } + } +if (ba_alloc_index (session_pool, + index) ==BA_FAIL ) { +TFP_DRV_LOG (ERR , +"%s: %s: ba_alloc index %d failed\n" , +tf_dir_2_str (parms->dir), +tf_tcam_tbl_2_str (parms->tcam_tbl_type), + index); +return -ENOMEM ; + } + }else { + index =ba_alloc (session_pool); +if (index ==BA_FAIL ) { +TFP_DRV_LOG (ERR ,"%s: %s: Out of resource\n" , +tf_dir_2_str (parms->dir), +tf_tcam_tbl_2_str (parms->tcam_tbl_type)); +return -ENOMEM ; + } } parms->idx = index;
drivers/net/bnxt/tf_core/tf_core.h +3 -1
@@ -799,7 +799,9 @@ struct tf_alloc_tcam_entry_parms {*/ uint8_t *mask;/** -* [in] Priority of entry requested (definition TBD) +* [in] Priority of entry requested +* 0: index from top i.e. highest priority first +* !0: index from bottom i.e lowest priority first */ uint32_t priority;/**
drivers/net/bnxt/tf_core/tf_em.c +2 -4
@@ -479,8 +479,7 @@ int tf_insert_em_internal_entry(struct tf *tfp, rc =stack_pop (pool, &index);if (rc !=0 ) { -PMD_DRV_LOG - (ERR , +TFP_DRV_LOG (ERR ,"dir:%d, EM entry index allocation failed\n" , parms->dir);return rc;
@@ -495,8 +494,7 @@ int tf_insert_em_internal_entry(struct tf *tfp,if (rc !=0 )return -1 ; -PMD_DRV_LOG - (ERR, + TFP_DRV_LOG(INFO, "Internal entry @ Index:%d rptr_index:0x%x rptr_entry:0x%x num_of_entries:%d\n", index * TF_SESSION_EM_ENTRY_SIZE, rptr_index,
drivers/net/bnxt/tf_core/tf_tbl.c +1 -1
@@ -1967,7 +1967,7 @@ void tf_dump_dma(struct tf *tfp, uint32_t tbl_scope_id) tbl_scope_cb =tbl_scope_cb_find (session, tbl_scope_id);if (tbl_scope_cb ==NULL ) -PMD_DRV_LOG (ERR ,"No table scope\n" ); +TFP_DRV_LOG (ERR ,"No table scope\n" );for (dir =0 ; dir <TF_DIR_MAX ; dir++) {printf ("Direction %s:\n" , (dir ==TF_DIR_RX ?"Rx" :"Tx" ));
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 15/51 net/bnxt: add HCAPI interface support
In reply to Ajit KhapardeFrom: Peter Spreadborough <[email protected]>
Add new hardware shim APIs to support multiple
device generations
--- drivers/net/bnxt/hcapi/Makefile | 10 + drivers/net/bnxt/hcapi/hcapi_cfa.h | 271 +++++++++ drivers/net/bnxt/hcapi/hcapi_cfa_common.c | 92 +++ drivers/net/bnxt/hcapi/hcapi_cfa_defs.h | 672 ++++++++++++++++++++++ drivers/net/bnxt/hcapi/hcapi_cfa_p4.c | 399 +++++++++++++ drivers/net/bnxt/hcapi/hcapi_cfa_p4.h | 451 +++++++++++++++ drivers/net/bnxt/meson.build | 2 + drivers/net/bnxt/tf_core/tf_em.c | 28 +- drivers/net/bnxt/tf_core/tf_tbl.c | 94 +-- drivers/net/bnxt/tf_core/tf_tbl.h | 24 +- 10 files changed, 1970 insertions(+), 73 deletions(-) create mode 100644 drivers/net/bnxt/hcapi/Makefile create mode 100644 drivers/net/bnxt/hcapi/hcapi_cfa.h create mode 100644 drivers/net/bnxt/hcapi/hcapi_cfa_common.c create mode 100644 drivers/net/bnxt/hcapi/hcapi_cfa_defs.h create mode 100644 drivers/net/bnxt/hcapi/hcapi_cfa_p4.c create mode 100644 drivers/net/bnxt/hcapi/hcapi_cfa_p4.h
drivers/net/bnxt/hcapi/Makefile new file +10 -0
@@ -0,0 +1,10 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2019-2020 Broadcom Limited. +# All rights reserved. + +SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += hcapi/hcapi_cfa_p4.c + +SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += hcapi/hcapi_cfa.h +SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += hcapi/hcapi_cfa_defs.h +SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += hcapi/hcapi_cfa_p4.h +SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += hcapi/cfa_p40_hw.h
drivers/net/bnxt/hcapi/hcapi_cfa.h new file +271 -0
271 lines not on this page · raw message
drivers/net/bnxt/hcapi/hcapi_cfa_common.c new file +92 -0
92 lines not on this page · raw message
drivers/net/bnxt/hcapi/hcapi_cfa_defs.h new file +672 -0
672 lines not on this page · raw message
drivers/net/bnxt/hcapi/hcapi_cfa_p4.c new file +399 -0
399 lines not on this page · raw message
drivers/net/bnxt/hcapi/hcapi_cfa_p4.h new file +451 -0
451 lines not on this page · raw message
drivers/net/bnxt/meson.build +2 -0
@@ -43,6 +43,8 @@ sources = files('bnxt_cpr.c', 'tf_core/tf_util.c', 'tf_core/tf_rm_new.c', + 'hcapi/hcapi_cfa_p4.c', + 'tf_ulp/bnxt_ulp.c', 'tf_ulp/ulp_mark_mgr.c', 'tf_ulp/ulp_flow_db.c',
drivers/net/bnxt/tf_core/tf_em.c +14 -14
@@ -189,7 +189,7 @@ void *tf_em_get_table_page(struct tf_tbl_scope_cb *tbl_scope_cb,if (dir !=TF_DIR_RX && dir !=TF_DIR_TX )return NULL ; -if (table_type <KEY0_TABLE || table_type >EFC_TABLE ) +if (table_type <TF_KEY0_TABLE || table_type >TF_EFC_TABLE )return NULL ;/*
@@ -325,7 +325,7 @@ static int tf_em_select_inject_table(struct tf_tbl_scope_cb *tbl_scope_cb, key0_entry =tf_em_entry_exists (tbl_scope_cb, entry, key0_hash, -KEY0_TABLE , +TF_KEY0_TABLE , dir);/*
@@ -334,23 +334,23 @@ static int tf_em_select_inject_table(struct tf_tbl_scope_cb *tbl_scope_cb, key1_entry =tf_em_entry_exists (tbl_scope_cb, entry, key1_hash, -KEY1_TABLE , +TF_KEY1_TABLE , dir);if (key0_entry == -EEXIST ) { - *table =KEY0_TABLE ; + *table =TF_KEY0_TABLE ; *index = key0_hash;return -EEXIST ; }else if (key1_entry == -EEXIST ) { - *table =KEY1_TABLE ; + *table =TF_KEY1_TABLE ; *index = key1_hash;return -EEXIST ; }else if (key0_entry ==0 ) { - *table =KEY0_TABLE ; + *table =TF_KEY0_TABLE ; *index = key0_hash;return 0 ; }else if (key1_entry ==0 ) { - *table =KEY1_TABLE ; + *table =TF_KEY1_TABLE ; *index = key1_hash;return 0 ; }
@@ -384,7 +384,7 @@ int tf_insert_eem_entry(struct tf_session *session,int num_of_entry;/* Get mask to use on hash */ - mask =tf_em_get_key_mask (tbl_scope_cb->em_ctx_info[parms->dir].em_tables[KEY0_TABLE ].num_entries); + mask =tf_em_get_key_mask (tbl_scope_cb->em_ctx_info[parms->dir].em_tables[TF_KEY0_TABLE ].num_entries);if (!mask)return -EINVAL ;
@@ -392,13 +392,13 @@ int tf_insert_eem_entry(struct tf_session *session, num_of_entry =TF_HW_EM_KEY_MAX_SIZE +4 ; key0_hash =tf_em_lkup_get_crc32_hash (session, - &parms->key[num_of_entry] -1 , - parms->dir); + &parms->key[num_of_entry] -1 , + parms->dir); key0_index = key0_hash & mask; key1_hash =tf_em_lkup_get_lookup3_hash (session->lkup_lkup3_init_cfg[parms->dir], - parms->key); + parms->key); key1_index = key1_hash & mask;/*
@@ -420,14 +420,14 @@ int tf_insert_eem_entry(struct tf_session *session, key1_index, &index, &table_type) == 0) { -if (table_type ==KEY0_TABLE ) { +if (table_type ==TF_KEY0_TABLE ) {TF_SET_GFID (gfid, key0_index, -KEY0_TABLE ); +TF_KEY0_TABLE ); }else {TF_SET_GFID (gfid, key1_index, -KEY1_TABLE ); +TF_KEY1_TABLE ); }/*
drivers/net/bnxt/tf_core/tf_tbl.c +47 -47
195 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tbl.h +12 -12
@@ -14,18 +14,18 @@struct tf_session ;enum tf_pg_tbl_lvl { -PT_LVL_0 , -PT_LVL_1 , -PT_LVL_2 , -PT_LVL_MAX +TF_PT_LVL_0 , +TF_PT_LVL_1 , +TF_PT_LVL_2 , +TF_PT_LVL_MAX };enum tf_em_table_type { -KEY0_TABLE , -KEY1_TABLE , -RECORD_TABLE , -EFC_TABLE , -MAX_TABLE +TF_KEY0_TABLE , +TF_KEY1_TABLE , +TF_RECORD_TABLE , +TF_EFC_TABLE , +TF_MAX_TABLE };struct tf_em_page_tbl {
@@ -41,15 +41,15 @@ struct tf_em_table {uint16_t ctx_id;uint32_t entry_size;int num_lvl; -uint32_t page_cnt[PT_LVL_MAX ]; +uint32_t page_cnt[TF_PT_LVL_MAX ];uint64_t num_data_pages;void *l0_addr;uint64_t l0_dma_addr; -struct tf_em_page_tbl pg_tbl[PT_LVL_MAX ]; +struct tf_em_page_tbl pg_tbl[TF_PT_LVL_MAX ]; };struct tf_em_ctx_mem_info { -struct tf_em_table em_tables[MAX_TABLE ]; +struct tf_em_table em_tables[TF_MAX_TABLE ]; };/** table scope control block content */
Signature · 1 line
2.21.1 (Apple Git-122.3)
PATCH v4 16/51 net/bnxt: add core changes for EM and EEM lookups
In reply to Ajit KhapardeFrom: Randy Schacher <[email protected]>
- Move External Exact and Exact Match to device module using HCAPI to add and delete entries
- Make EM active through the device interface.
--- drivers/net/bnxt/Makefile | 3 +- drivers/net/bnxt/hcapi/cfa_p40_hw.h | 781 ++++++++++++++++++++++ drivers/net/bnxt/hcapi/hcapi_cfa_common.c | 92 --- drivers/net/bnxt/hcapi/hcapi_cfa_p4.c | 2 +- drivers/net/bnxt/tf_core/Makefile | 8 + drivers/net/bnxt/tf_core/hwrm_tf.h | 24 +- drivers/net/bnxt/tf_core/tf_core.c | 441 ++++++------ drivers/net/bnxt/tf_core/tf_core.h | 141 ++-- drivers/net/bnxt/tf_core/tf_device.h | 32 + drivers/net/bnxt/tf_core/tf_device_p4.c | 3 + drivers/net/bnxt/tf_core/tf_em.c | 567 +++++----------- drivers/net/bnxt/tf_core/tf_em.h | 72 +- drivers/net/bnxt/tf_core/tf_msg.c | 23 +- drivers/net/bnxt/tf_core/tf_msg.h | 4 +- drivers/net/bnxt/tf_core/tf_resources.h | 25 +- drivers/net/bnxt/tf_core/tf_rm.c | 156 +++-- drivers/net/bnxt/tf_core/tf_tbl.c | 437 +++++------- drivers/net/bnxt/tf_core/tf_tbl.h | 49 +- 18 files changed, 1627 insertions(+), 1233 deletions(-) create mode 100644 drivers/net/bnxt/hcapi/cfa_p40_hw.h delete mode 100644 drivers/net/bnxt/hcapi/hcapi_cfa_common.c
drivers/net/bnxt/Makefile +2 -1
@@ -46,9 +46,10 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += bnxt_rxtx_vec_sse.c endif ifeq ($(CONFIG_RTE_LIBRTE_BNXT_PMD), y) -CFLAGS += -I$(SRCDIR) -I$(SRCDIR)/tf_ulp -I$(SRCDIR)/tf_core +CFLAGS += -I$(SRCDIR) -I$(SRCDIR)/tf_ulp -I$(SRCDIR)/tf_core -I$(SRCDIR)/hcapi include $(SRCDIR)/tf_ulp/Makefile include $(SRCDIR)/tf_core/Makefile +include $(SRCDIR)/hcapi/Makefile endif #
drivers/net/bnxt/hcapi/cfa_p40_hw.h new file +781 -0
781 lines not on this page · raw message
drivers/net/bnxt/hcapi/hcapi_cfa_common.c deleted +0 -92
92 lines not on this page · raw message
drivers/net/bnxt/hcapi/hcapi_cfa_p4.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2019-2020 Broadcom * All rights reserved. */ - +#include <inttypes.h> #include <stdint.h> #include <stdlib.h> #include <stdbool.h>
drivers/net/bnxt/tf_core/Makefile +8 -0
@@ -24,3 +24,11 @@ SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_tbl_type.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_tcam.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_util.c SRCS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += tf_core/tf_rm_new.c + +SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_core.h +SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_project.h +SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_device.h +SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_identifier.h +SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_tbl.h +SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/stack.h +SYMLINK-$(CONFIG_RTE_LIBRTE_BNXT_PMD)-include += tf_core/tf_tcam.h
drivers/net/bnxt/tf_core/hwrm_tf.h +11 -13
@@ -27,8 +27,8 @@ typedef enum tf_subtype {HWRM_TFT_REG_SET =822 ,HWRM_TFT_TBL_TYPE_SET =823 ,HWRM_TFT_TBL_TYPE_GET =824 , -HWRM_TFT_TBL_TYPE_GET_BULK =825 , -TF_SUBTYPE_LAST =HWRM_TFT_TBL_TYPE_GET_BULK , +HWRM_TFT_TBL_TYPE_BULK_GET =825 , +TF_SUBTYPE_LAST =HWRM_TFT_TBL_TYPE_BULK_GET , } tf_subtype_t;/* Request and Response compile time checking */
@@ -82,8 +82,8 @@ struct tf_session_sram_resc_flush_input;struct tf_tbl_type_set_input ;struct tf_tbl_type_get_input ;struct tf_tbl_type_get_output ; -struct tf_tbl_type_get_bulk_input ; -struct tf_tbl_type_get_bulk_output ; +struct tf_tbl_type_bulk_get_input ; +struct tf_tbl_type_bulk_get_output ;/* Input params for session attach */ typedef struct tf_session_attach_input { /* Firmware session id returned when HWRM_TF_SESSION_OPEN is sent */
@@ -905,8 +905,6 @@ typedef struct tf_tbl_type_get_input {#define TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_RX (0x0)/* When set to 1, indicates the get apply to TX */ #define TF_TBL_TYPE_GET_INPUT_FLAGS_DIR_TX (0x1) -/* When set to 1, indicates the clear entry on read */ -#define TF_TBL_TYPE_GET_INPUT_FLAGS_CLEAR_ON_READ (0x2)/* Type of the object to set */ uint32_t type;/* Index to get */
@@ -922,17 +920,17 @@ typedef struct tf_tbl_type_get_output { } tf_tbl_type_get_output_t, *ptf_tbl_type_get_output_t;/* Input params for table type get */ -typedef struct tf_tbl_type_get_bulk_input { +typedef struct tf_tbl_type_bulk_get_input { /* Session Id */ uint32_t fw_session_id; /* flags */ uint16_t flags; /* When set to 0, indicates the get apply to RX */ -#define TF_TBL_TYPE_GET_BULK_INPUT_FLAGS_DIR_RX (0x0) +#define TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_RX (0x0) /* When set to 1, indicates the get apply to TX */ -#define TF_TBL_TYPE_GET_BULK_INPUT_FLAGS_DIR_TX (0x1) +#define TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_DIR_TX (0x1) /* When set to 1, indicates the clear entry on read */ -#define TF_TBL_TYPE_GET_BULK_INPUT_FLAGS_CLEAR_ON_READ (0x2) +#define TF_TBL_TYPE_BULK_GET_INPUT_FLAGS_CLEAR_ON_READ (0x2) /* Type of the object to set */ uint32_t type; /* Starting index to get from */
@@ -941,12 +939,12 @@ typedef struct tf_tbl_type_get_bulk_input {uint32_t num_entries;/* Host memory where data will be stored */ uint64_t host_addr; -} tf_tbl_type_get_bulk_input_t, *ptf_tbl_type_get_bulk_input_t; +} tf_tbl_type_bulk_get_input_t, *ptf_tbl_type_bulk_get_input_t;/* Output params for table type get */ -typedef struct tf_tbl_type_get_bulk_output { +typedef struct tf_tbl_type_bulk_get_output {/* Size of the total data read in bytes */ uint16_t size; -}tf_tbl_type_get_bulk_output_t , *ptf_tbl_type_get_bulk_output_t ; +}tf_tbl_type_bulk_get_output_t , *ptf_tbl_type_bulk_get_output_t ;#endif /* _HWRM_TF_H_ */
drivers/net/bnxt/tf_core/tf_core.c +229 -212
712 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_core.h +84 -57
427 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_device.h +32 -0
@@ -366,6 +366,38 @@ struct tf_dev_ops {*/ int (*tf_dev_get_tcam)(struct tf *tfp,struct tf_tcam_get_parms *parms); + +/** +* Insert EM hash entry API +* +* [in] tfp +* Pointer to TF handle +* +* [in] parms +* Pointer to E/EM insert parameters +* +* Returns: +* 0 - Success +* -EINVAL - Error +*/ +int (*tf_dev_insert_em_entry)(struct tf *tfp, +struct tf_insert_em_entry_parms *parms); + +/** +* Delete EM hash entry API +* +* [in] tfp +* Pointer to TF handle +* +* [in] parms +* Pointer to E/EM delete parameters +* +* returns: +* 0 - Success +* -EINVAL - Error +*/ +int (*tf_dev_delete_em_entry)(struct tf *tfp, +struct tf_delete_em_entry_parms *parms); };/**
drivers/net/bnxt/tf_core/tf_device_p4.c +3 -0
@@ -10,6 +10,7 @@#include "tf_identifier.h" #include "tf_tbl_type.h" #include "tf_tcam.h" +#include "tf_em.h" /** * Device specific function that retrieves the MAX number of HCAPI
@@ -89,4 +90,6 @@ const struct tf_dev_ops tf_dev_ops_p4 = { .tf_dev_alloc_search_tcam = tf_tcam_alloc_search, .tf_dev_set_tcam = tf_tcam_set, .tf_dev_get_tcam = tf_tcam_get, + .tf_dev_insert_em_entry = tf_em_insert_entry, + .tf_dev_delete_em_entry = tf_em_delete_entry, };
drivers/net/bnxt/tf_core/tf_em.c +162 -405
660 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_em.h +15 -57
99 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_msg.c +13 -10
@@ -183,6 +183,10 @@ tf_msg_free_dma_buf(struct tf_msg_dma_buf *buf)tfp_free (buf->va_addr); } +/** +* NEW HWRM direct messages +*/ +/** * Sends session open request to TF Firmware */
@@ -1259,8 +1263,9 @@ int tf_msg_insert_em_internal_entry(struct tf *tfp, HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_TX : HWRM_TF_EM_INSERT_INPUT_FLAGS_DIR_RX); req.flags =tfp_cpu_to_le_16 (flags); - req.strength = (em_result->hdr.word1 &TF_LKUP_RECORD_STRENGTH_MASK ) >> -TF_LKUP_RECORD_STRENGTH_SHIFT ; + req.strength = + (em_result->hdr.word1 &CFA_P4_EEM_ENTRY_STRENGTH_MASK ) >> +CFA_P4_EEM_ENTRY_STRENGTH_SHIFT ; req.em_key_bitlen = em_parms->key_sz_in_bits; req.action_ptr = em_result->hdr.pointer; req.em_record_idx = *rptr_index;
@@ -1436,22 +1441,20 @@ tf_msg_get_tbl_entry(struct tf *tfp, }int -tf_msg_get_bulk_tbl_entry (struct tf *tfp, -struct tf_get_bulk_tbl_entry_parms *params) +tf_msg_bulk_get_tbl_entry (struct tf *tfp, +struct tf_bulk_get_tbl_entry_parms *params) {int rc;struct tfp_send_msg_parms parms = {0 }; -struct tf_tbl_type_get_bulk_input req = {0 }; -struct tf_tbl_type_get_bulk_output resp = {0 }; +struct tf_tbl_type_bulk_get_input req = {0 }; +struct tf_tbl_type_bulk_get_output resp = {0 };struct tf_session *tfs = (struct tf_session *)(tfp->session->core_data);int data_size =0 ;/* Populate the request */ req.fw_session_id =tfp_cpu_to_le_32 (tfs->session_id.internal.fw_session_id); - req.flags =tfp_cpu_to_le_16 ((params->dir) | - ((params->clear_on_read) ? -TF_TBL_TYPE_GET_BULK_INPUT_FLAGS_CLEAR_ON_READ :0x0 )); + req.flags =tfp_cpu_to_le_16 (params->dir); req.type =tfp_cpu_to_le_32 (params->type); req.start_index =tfp_cpu_to_le_32 (params->starting_idx); req.num_entries =tfp_cpu_to_le_32 (params->num_entries);
@@ -1462,7 +1465,7 @@ tf_msg_get_bulk_tbl_entry(struct tf *tfp,MSG_PREP (parms,TF_KONG_MB ,HWRM_TF , -HWRM_TFT_TBL_TYPE_GET_BULK , +HWRM_TFT_TBL_TYPE_BULK_GET , req, resp);
drivers/net/bnxt/tf_core/tf_msg.h +2 -2
@@ -338,7 +338,7 @@ int tf_msg_get_tbl_entry(struct tf *tfp,* Returns: * 0 on Success else internal Truflow error */ -int tf_msg_get_bulk_tbl_entry (struct tf *tfp, -struct tf_get_bulk_tbl_entry_parms *parms); +int tf_msg_bulk_get_tbl_entry (struct tf *tfp, +struct tf_bulk_get_tbl_entry_parms *parms);#endif /* _TF_MSG_H_ */
drivers/net/bnxt/tf_core/tf_resources.h +12 -13
@@ -23,29 +23,27 @@* IDs */ #define TF_NUM_WC_PROF_ID 256/* < Number WC profile IDs */ -#define TF_NUM_WC_TCAM_ROW 256/* Number slices per row in WC -* TCAM. A slices is a WC TCAM entry. -*/ +#define TF_NUM_WC_TCAM_ROW 512/* < Number of rows in WC TCAM */ #define TF_NUM_METER_PROF 256/* < Number of meter profiles */ #define TF_NUM_METER 1024/* < Number of meter instances */ #define TF_NUM_MIRROR 2/* < Number of mirror instances */ #define TF_NUM_UPAR 2/* < Number of UPAR instances */ -/* Wh+/Brd2 specific HW resources */ +/* Wh+/SR specific HW resources */ #define TF_NUM_SP_TCAM 512/* < Number of Source Property TCAM * entries */ -/* Brd2/Brd4 specific HW resources */
Lines of this file are not shown. View the raw message.
drivers/net/bnxt/tf_core/tf_rm.c +88 -68
156 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tbl.c +181 -256
437 lines not on this page · raw message
drivers/net/bnxt/tf_core/tf_tbl.h +3 -46
49 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.21.1 (Apple Git-122.3)
Part of the diff is not shown here. View the raw message.