1 /* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef FILLP_PDT_FC_UT_H 17 #define FILLP_PDT_FC_UT_H 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif /* __cplusplus */ 22 23 #ifdef PDT_UT 24 25 #ifdef FILLP_CPU 26 #define FILLP_X86 "X86" 27 #define FILLP_X64 "X64" 28 29 #else 30 #define FILLP_CPU "" 31 #endif 32 33 #ifdef FILLP_OSVER 34 #define FILLP_WIN32_VC10 "WIN32_VC10" 35 #define FILLP_SUSE11SP1_32 "SUSE11SP1_32" 36 #define FILLP_SUSE11SP1_64 "SUSE11SP1_64" 37 38 #else 39 #define FILLP_OSVER "" 40 #endif 41 42 #define FILLP_STACK_SPACE " " 43 44 #define FILLP_PDT_INFO "PDT:UT" 45 #define FILLP_PDT_ALG "VTP" 46 47 #define MAX_SPUNGEINSTANCE_NUM 1 48 #define FILLP_DEFAULT_INST_NUM 1 49 50 #define SOCK_SEND_SEM 1 51 #define SOCK_RECV_SEM 1 52 53 #define FILLP_DEFAULT_APP_SEND_CACHE 2048 /* size of send cache */ 54 55 #define FILLP_DEFAULT_APP_RECV_CACHE 2048 /* size of recv cache */ 56 57 #define FILLP_DEFAULT_MAX_RATE (1 * 1000) /* max rate */ 58 59 #define FILLP_DEFAULT_APP_SLOW_START FILLP_TRUE /* slow start */ 60 61 #define FILLP_DEFAULT_BFULL_CPU FILLP_FALSE 62 63 #define FILLP_DEFAULT_INITIAL_RATE 350 64 #define FILLP_DEFAULT_MIN_RATE 350 65 66 #define FILLP_DEFAULT_PKT_LOSS_ALLOW 8 67 #define FILLP_DEFAULT_NACK_REPEAT_TIMES 5 68 69 #define FILLP_MIN_PACK_INTERVAL (50 * 1000) 70 71 #define FILLP_MINIMUM_SELECT_TIME 1000 // us 72 73 #define FILLP_DELAY_NACK_ENABLE FILLP_TRUE 74 75 #define FILLP_DEFAULT_ENLARGE_PACK_INTERVAL FILLP_TRUE 76 77 #define FILLP_DEFAULT_SEND_HISTORY_NACK FILLP_TRUE 78 79 #define FILLP_TIMING_WHEEL_ACCURACY 64 /* us */ 80 81 #define FILLP_DEFAULT_HISTORY_NACK_PKT_NACK_NUM 5 82 83 #define FILLP_DEFAULT_NACK_RETRY_LEN 120 84 #define FILLP_FC_MULTI_ADJUST_CONST 1.25 85 #define FILLP_FLOW_CONTROL_MULTI_NUM_STEP 0.0392 86 #define FILLP_FC_NINETY_PERCENT_VAL(value) ((value) * 0.95) 87 88 /* GlobalAppResource structure default values start */ 89 #ifdef FILLP_LINUX 90 #define FILLP_DEFAULT_APP_TX_BURST 4096 /* tx burst */ 91 #else 92 #define FILLP_DEFAULT_APP_TX_BURST 1400 /* tx burst */ 93 #endif 94 95 /* GlobalResource structure default values start */ 96 #ifdef FILLP_LINUX 97 #define FILLP_DEFAULT_RX_BURST 4096 /* max pkt number to recv each cycle */ 98 #else 99 #define FILLP_DEFAULT_RX_BURST 1400 /* max pkt number to recv each cycle */ 100 #endif 101 102 #define FILLP_CPU_PAUSE_TIME 100 /* sleep time */ 103 104 #define FILLP_UNSEND_BOX_LOOP_CHECK_BURST 1024 105 106 #endif 107 108 #ifdef __cplusplus 109 } 110 #endif /* __cplusplus */ 111 112 #endif