21 #ifndef __PLATFORM_COMMON_OVERRIDE_H__ 22 #define __PLATFORM_COMMON_OVERRIDE_H__ 26 #undef PLATFORM_DBL_SUPPORT 27 #define PLATFORM_DBL_SUPPORT 1 // Destination Based logging support 30 #undef PLATFORM_ADDR_MASK_PER_CORE 33 #define PLATFORM_ADDR_MASK_PER_CORE 0x01 35 #undef MAX_COMBINED_DB_ENTRIES_PER_SCAN 36 #define MAX_COMBINED_DB_ENTRIES_PER_SCAN 128 38 #undef PLATFORM_MAX_CORES 39 #define PLATFORM_MAX_CORES (PLATFORM_ADDR_MASK_PER_CORE + 1) 42 #undef PLATFORM_ADDR_MASK_PER_CORE_PER_PARTITION 43 #define PLATFORM_ADDR_MASK_PER_CORE_PER_PARTITION \ 44 PLATFORM_ADDR_MASK_PER_CORE 46 #undef PLATFORM_MAX_CORES_PER_PARTITION 47 #define PLATFORM_MAX_CORES_PER_PARTITION PLATFORM_MAX_CORES 49 #undef PLATFORM_CNAT_INSTS 51 #define PLATFORM_CNAT_INSTS 1 53 #undef PLATFORM_MAX_NAT_ENTRIES 55 #define PLATFORM_MAX_NAT_ENTRIES 1666660 // ~80M/48 (79999680/48) 57 #undef PLATFORM_MAX_USER_ENTRIES 58 #define PLATFORM_MAX_USER_ENTRIES 20800 // ~1M/48 (998400/48) 65 #undef PLATFORM_CNAT_MAIN_PRELIM_HASH_SIZE 67 #define PLATFORM_CNAT_MAIN_PRELIM_HASH_SIZE (5<<20) 72 #undef PLATFORM_CNAT_USER_PRELIM_HASH_SIZE 73 #define PLATFORM_CNAT_USER_PRELIM_HASH_SIZE 4096 75 #undef PLATFORM_CNAT_MAX_ADDR_POOL_SIZE 76 #define PLATFORM_CNAT_MAX_ADDR_POOL_SIZE 0x10000 // max /16 78 #undef PLATFORM_MAX_DB_ENTRY_PER_SCAN 79 #define PLATFORM_MAX_DB_ENTRY_PER_SCAN 400 81 #undef PLATFORM_MAX_DB_ENTRY_SELECTED_PER_SCAN 82 #define PLATFORM_MAX_DB_ENTRY_SELECTED_PER_SCAN 100 // 1/4th of above 84 #undef PLATFORM_CNAT_TIMEOUT_IPPROT_MASK 85 #define PLATFORM_CNAT_TIMEOUT_IPPROT_MASK 0xFFFFFFFF0000FFFF 87 #undef PLATFORM_CNAT_TIMEOUT_PORTPROT_MASK 88 #define PLATFORM_CNAT_TIMEOUT_PORTPROT_MASK 0x00000000FFFFFFFF 91 #undef PLATFORM_FILL_DST_ADDR_PORT_TABLE 92 #define PLATFORM_FILL_DST_ADDR_PORT_TABLE fill_dst_addr_port_table(); 96 #ifndef RODDICK_ON_LINUX_OR_EVB 97 #undef PLATFORM_SET_CTX_RU_TX_FROM_NODE 98 #undef PLATFORM_SET_CTX_RU_TX_DST_IPPORT_IDX 99 #undef PLATFORM_SET_CTX_RU_TX_PKT_TYPE 101 #define PLATFORM_SET_CTX_RU_TX_FROM_NODE(ctx, value) \ 102 (vnet_buffer(ctx))->vcgn_uii.ru.tx.from_node = value; 103 #define PLATFORM_SET_CTX_RU_TX_DST_IPPORT_IDX(ctx, value) \ 104 (vnet_buffer(ctx))->vcgn_uii.ru.tx.dst_ip_port_idx = value; 105 #define PLATFORM_SET_CTX_RU_TX_PKT_TYPE(ctx, type) \ 106 (vnet_buffer(ctx))->vcgn_uii.ru.tx.packet_type = type; 109 #undef PLATFORM_SET_RX_VRF 110 #undef PLATFORM_SET_TX_VRF 111 #ifdef TARGET_RODDICK 112 #define PLATFORM_SET_RX_VRF(ctx, rx_vrf, hardcode, mask) \ 113 rx_vrf = (ctx->ru.rx.uidb_index & CNAT_VRF_MASK); 114 #define PLATFORM_SET_TX_VRF(ctx, tx_vrf) \ 115 ctx->ru.tx.uidb_index = tx_vrf; 117 #define PLATFORM_SET_RX_VRF(ctx, rx_vrf, hardcode, mask) \ 119 #define PLATFORM_SET_TX_VRF(ctx, tx_vrf) 122 #undef PLATFORM_CNAT_SET_RX_VRF 123 #undef PLATFORM_CNAT_SET_TX_VRF 125 #define PLATFORM_CNAT_SET_RX_VRF(if_index, rx_vrf, proto) \ 126 rx_vrf = proto | ((if_index) & CNAT_VRF_MASK); 128 #define PLATFORM_CNAT_SET_TX_VRF(if_index, tx_vrf) \ 129 (if_index) = ((tx_vrf) & CNAT_VRF_MASK); 133 #undef PLATFORM_NAT64_SET_RX_VRF 135 #ifdef TARGET_RODDICK 137 #define PLATFORM_NAT64_SET_RX_VRF(rx_vrf, proto, inst_id) \ 138 rx_vrf = proto | (inst_id & CNAT_VRF_MASK); 142 #define PLATFORM_NAT64_SET_RX_VRF(rx_vrf, proto, inst_id) \ 143 rx_vrf = proto | inst_id; 148 #define VRF_MAP_CONFIG 151 #undef PLATFORM_PRINT_TESTING_PG 152 #if defined(TARGET_LINUX_UDVR) || defined(CNAT_PG) 153 #define PLATFORM_PRINT_TESTING_PG() printf("testing pg\n"); 155 #define PLATFORM_PRINT_TESTING_PG() 158 #ifdef TARGET_RODDICK 159 #undef PLATFORM_INIT_TEMP_SENSORS 160 #undef PLATFORM_READ_CPU_SENSORS 161 #undef PLATFORM_SET_TEMP_READ_BLOCK 163 #define PLATFORM_INIT_TEMP_SENSORS() Init_temperature_sensors(); 164 #define PLATFORM_READ_CPU_SENSORS(value) read_octeon_sensors(value); 165 #define PLATFORM_SET_TEMP_READ_BLOCK(var, val) var = &val->param[0]; 168 #undef PLATFORM_HANDLE_ICMP_TTL_EXPIRED 169 #define PLATFORM_HANDLE_ICMP_TTL_EXPIRED 1 // handle TTL in NAT44 Application (for AVSM) 171 #undef PLATFORM_NFV9_DISP_NODE_IDX 172 #ifdef TARGET_RODDICK 173 #define PLATFORM_NFV9_DISP_NODE_IDX "roddick_infra_l3_tx" 175 #define PLATFORM_NFV9_DISP_NODE_IDX "cnat_rewrite_output" 178 #undef PLATFORM_CNAT_DB_DUMP_POLICY_PRINT 179 #define PLATFORM_CNAT_DB_DUMP_POLICY_PRINT() \ 180 printf("my instance:%d\n" \ 181 "icmp timeout %d udp init timeout %d act timeout %d\n" \ 182 "tcp init timeout %d act timeout %d mapping refresh %d\n" \ 183 "port limit per user %d ftp alg %d lb debug %d\n" \ 184 "icmp rate limit 0x%x config delete timer 0x%x\n" \ 185 "global debug flag 0x%x\n" \ 186 "icmp rate limit (pkts/per sec) %d\n" \ 187 "dynamic port range start %d\n" \ 188 "debug ivrf 0x%x flag 0x%x start_addr 0x%x end_addr 0x%x\n" \ 189 "debug ovrf 0x%x flag 0x%x start_addr 0x%x end_addr 0x%x\n", \ 190 my_instance_number, \ 191 icmp_session_timeout, udp_init_session_timeout, udp_act_session_timeout, \ 192 tcp_initial_setup_timeout, tcp_active_timeout, \ 193 mapping_refresh_both_direction, cnat_main_db_max_ports_per_user, \ 194 ftp_alg_enabled, lb_debug_enable, per_user_icmp_msg_limit, \ 195 config_delete_timeout, \ 197 cnat_main_db_icmp_rate_limit, \ 198 cnat_static_port_range, \ 199 debug_i_vrf, debug_i_flag, debug_i_addr_start, debug_i_addr_end, \ 200 debug_o_vrf, debug_o_flag, debug_o_addr_start, debug_o_addr_end); 203 #undef PLATFORM_PRINT_CTX_VALUES 204 #ifdef TARGET_RODDICK 205 #define PLATFORM_PRINT_CTX_VALUES(ctx) \ 206 printf("\nAFTER: %s cur_hdr %p, uidb %d, pkt_type %d, cur_len %d\n", \ 208 ctx->current_header, \ 209 ctx->ru.tx.uidb_index, \ 210 ctx->ru.tx.packet_type, \ 211 ctx->current_length); 213 #define PLATFORM_PRINT_CTX_VALUES(ctx) \ 214 printf("\nAFTER: %s cur_hdr %p, cur_len %d\n", \ 216 ctx->current_header, \ 217 ctx->current_length); 220 #undef PLATFORM_ADD_VRF_MAP_HANDLE_PARTITION 221 #define PLATFORM_ADD_VRF_MAP_HANDLE_PARTITION(uidb_index, partition_id) 223 #undef PLATFORM_DEL_VRF_MAP_HANDLE_PARTITION 224 #define PLATFORM_DEL_VRF_MAP_HANDLE_PARTITION(uidb_index, partition_id) 226 #undef PLATFORM_ALLOC_NFV9_PKT_BUFFER 227 #define PLATFORM_ALLOC_NFV9_PKT_BUFFER(ctx, to_lc_cpu) 229 #undef PLATFORM_CNAT_NFV9_SHIM_HDR_OFFSET 230 #ifdef TARGET_RODDICK 232 #define PLATFORM_CNAT_NFV9_SHIM_HDR_OFFSET 8 234 #define PLATFORM_CNAT_NFV9_SHIM_HDR_OFFSET 0 237 #undef PLATFORM_CNAT_NFV9_L2_ENCAPS_OFFSET 238 #ifdef TARGET_RODDICK 239 #define PLATFORM_CNAT_NFV9_L2_ENCAPS_OFFSET 0 241 #define PLATFORM_CNAT_NFV9_L2_ENCAPS_OFFSET 16 244 #undef PLATFORM_MAX_SHOW_BUFFER_SIZE 245 #undef PLATFORM_MAX_TRANSLATION_ENTRIES 246 #undef PLATFORM_MAX_UTIL_ENTRIES 248 #define PLATFORM_MAX_SHOW_BUFFER_SIZE 1700 249 #define PLATFORM_MAX_TRANSLATION_ENTRIES (50) 250 #define PLATFORM_NAT64_MAX_TRANSLATION_ENTRIES (30) 251 #define PLATFORM_MAX_UTIL_ENTRIES (100) 254 #undef PLATFORM_NAT64_MAX_SESSIONS 255 #undef PLATFORM_NAT64_TIMEOUT_HASH_SIZE 256 #define PLATFORM_NAT64_MAX_SESSIONS 20000000 257 #define PLATFORM_NAT64_TIMEOUT_HASH_SIZE 24001 259 #undef PLATFORM_CHECK_DSLITE_ENABLE_FLAG 260 #define PLATFORM_CHECK_DSLITE_ENABLE_FLAG 1 264 #undef PLATFORM_IPV4_FRAG_FRAG_HOLD_LIMIT 265 #define PLATFORM_IPV4_FRAG_FRAG_HOLD_LIMIT 63 267 #undef PLATFORM_MAX_IPV4_CTX_ENTRIES 268 #define PLATFORM_MAX_IPV4_CTX_ENTRIES 80 270 #undef PLATFORM_DIRN_IN_TO_OUT 271 #undef PLATFORM_DIRN_OUT_TO_IN 272 #undef PLATFORM_SET_SVI_PARAMS_FIELD 274 #define PLATFORM_DIRN_IN_TO_OUT 275 #define PLATFORM_DIRN_OUT_TO_IN 276 #define PLATFORM_SET_SVI_PARAMS_FIELD(var, value) 278 #undef PLATFORM_GET_NFV9_L3_HDR_OFFSET 279 #define PLATFORM_GET_NFV9_L3_HDR_OFFSET \ 280 ((u8 *)ctx + ctx->data + CNAT_NFV9_IP_HDR_OFFSET); 282 #undef PLATFORM_GET_NFV9_L4_HDR_OFFSET 283 #define PLATFORM_GET_NFV9_L4_HDR_OFFSET \ 284 ((u8 *) ctx + ctx->data + CNAT_NFV9_UDP_HDR_OFFSET); 286 #undef PLATFORM_MEMSET_CNAT_LOG_PKT_DATA 287 #define PLATFORM_MEMSET_CNAT_LOG_PKT_DATA