1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 /* 3 * Copyright (c) 2022 Huawei Device Co., Ltd. 4 * 5 * NewIP INET 6 * An implementation of the TCP/IP protocol suite for the LINUX 7 * operating system. NewIP INET is implemented using the BSD Socket 8 * interface as the means of communication with the user level. 9 * 10 * Description: Definitions for the NewIP parameter module. 11 * 12 * Author: Yang Yanjun <yangyanjun@huawei.com> 13 * 14 * Data: 2022-07-25 15 */ 16 #ifndef _TCP_NIP_PARAMETER_H 17 #define _TCP_NIP_PARAMETER_H 18 19 int get_nip_srtt_factor(void); 20 int get_nip_dynamic_rto_max(void); 21 int get_nip_dynamic_rto_min(void); 22 int get_nip_br_max_bw(void); 23 int get_nip_rto(void); 24 int get_nip_sndbuf(void); 25 int get_nip_rcvbuf(void); 26 bool get_wscale_enable(void); 27 int get_wscale(void); 28 int get_ack_num(void); 29 int get_nip_ssthresh_reset(void); 30 int get_dup_ack_retrans_num(void); 31 int get_ack_retrans_num(void); 32 int get_dup_ack_snd_max(void); 33 int get_rtt_tstamp_rto_up(void); 34 int get_rtt_tstamp_high(void); 35 int get_rtt_tstamp_mid_high(void); 36 int get_rtt_tstamp_mid_low(void); 37 int get_ack_to_nxt_snd_tstamp(void); 38 bool get_ssthresh_enable(void); 39 int get_nip_ssthresh_default(void); 40 int get_ssthresh_high(void); 41 int get_ssthresh_mid_high(void); 42 int get_ssthresh_mid_low(void); 43 int get_ssthresh_low(void); 44 int get_ssthresh_low_min(void); 45 int get_ssthresh_high_step(void); 46 int get_ssthresh_br_max(void); 47 int get_nip_idle_ka_probes_out(void); 48 int get_nip_keepalive_time(void); 49 int get_nip_keepalive_intvl(void); 50 int get_nip_probe_max(void); 51 bool get_nip_tcp_snd_win_enable(void); 52 bool get_nip_tcp_rcv_win_enable(void); 53 bool get_nip_debug(void); 54 bool get_rtt_ssthresh_debug(void); 55 bool get_ack_retrans_debug(void); 56 57 /*********************************************************************************************/ 58 /* nip debug parameters */ 59 /*********************************************************************************************/ 60 #define nip_dbg(fmt, ...) \ 61 do { \ 62 if (get_nip_debug()) \ 63 pr_crit(fmt, ##__VA_ARGS__); \ 64 } while (0) 65 66 /* Debugging of threshold change */ 67 #define ssthresh_dbg(fmt, ...) \ 68 do { \ 69 if (get_rtt_ssthresh_debug()) \ 70 pr_crit(fmt, ##__VA_ARGS__); \ 71 } while (0) 72 73 /* Debugging of packet retransmission after ACK */ 74 #define retrans_dbg(fmt, ...) \ 75 do { \ 76 if (get_ack_retrans_debug()) \ 77 pr_crit(fmt, ##__VA_ARGS__); \ 78 } while (0) 79 80 #endif /* _TCP_NIP_PARAMETER_H */ 81