diff options
Diffstat (limited to 'net/dccp/ccids')
| -rw-r--r-- | net/dccp/ccids/Kconfig | 79 | ||||
| -rw-r--r-- | net/dccp/ccids/Makefile | 9 | ||||
| -rw-r--r-- | net/dccp/ccids/ccid2.c | 22 | ||||
| -rw-r--r-- | net/dccp/ccids/ccid3.c | 23 | ||||
| -rw-r--r-- | net/dccp/ccids/lib/Makefile | 3 | ||||
| -rw-r--r-- | net/dccp/ccids/lib/loss_interval.c | 3 | ||||
| -rw-r--r-- | net/dccp/ccids/lib/packet_history.c | 9 | ||||
| -rw-r--r-- | net/dccp/ccids/lib/tfrc.c | 19 | ||||
| -rw-r--r-- | net/dccp/ccids/lib/tfrc.h | 11 | ||||
| -rw-r--r-- | net/dccp/ccids/lib/tfrc_equation.c | 4 |
10 files changed, 41 insertions, 141 deletions
diff --git a/net/dccp/ccids/Kconfig b/net/dccp/ccids/Kconfig index 12275943eab8..b28bf962edc3 100644 --- a/net/dccp/ccids/Kconfig +++ b/net/dccp/ccids/Kconfig | |||
| @@ -1,80 +1,51 @@ | |||
| 1 | menu "DCCP CCIDs Configuration (EXPERIMENTAL)" | 1 | menu "DCCP CCIDs Configuration (EXPERIMENTAL)" |
| 2 | depends on EXPERIMENTAL | 2 | depends on EXPERIMENTAL |
| 3 | 3 | ||
| 4 | config IP_DCCP_CCID2 | ||
| 5 | tristate "CCID2 (TCP-Like) (EXPERIMENTAL)" | ||
| 6 | def_tristate IP_DCCP | ||
| 7 | select IP_DCCP_ACKVEC | ||
| 8 | ---help--- | ||
| 9 | CCID 2, TCP-like Congestion Control, denotes Additive Increase, | ||
| 10 | Multiplicative Decrease (AIMD) congestion control with behavior | ||
| 11 | modelled directly on TCP, including congestion window, slow start, | ||
| 12 | timeouts, and so forth [RFC 2581]. CCID 2 achieves maximum | ||
| 13 | bandwidth over the long term, consistent with the use of end-to-end | ||
| 14 | congestion control, but halves its congestion window in response to | ||
| 15 | each congestion event. This leads to the abrupt rate changes | ||
| 16 | typical of TCP. Applications should use CCID 2 if they prefer | ||
| 17 | maximum bandwidth utilization to steadiness of rate. This is often | ||
| 18 | the case for applications that are not playing their data directly | ||
| 19 | to the user. For example, a hypothetical application that | ||
| 20 | transferred files over DCCP, using application-level retransmissions | ||
| 21 | for lost packets, would prefer CCID 2 to CCID 3. On-line games may | ||
| 22 | also prefer CCID 2. See RFC 4341 for further details. | ||
| 23 | |||
| 24 | CCID2 is the default CCID used by DCCP. | ||
| 25 | |||
| 26 | config IP_DCCP_CCID2_DEBUG | 4 | config IP_DCCP_CCID2_DEBUG |
| 27 | bool "CCID2 debugging messages" | 5 | bool "CCID-2 debugging messages" |
| 28 | depends on IP_DCCP_CCID2 | 6 | ---help--- |
| 29 | ---help--- | 7 | Enable CCID-2 specific debugging messages. |
| 30 | Enable CCID2-specific debugging messages. | ||
| 31 | 8 | ||
| 32 | When compiling CCID2 as a module, this debugging output can | 9 | The debugging output can additionally be toggled by setting the |
| 33 | additionally be toggled by setting the ccid2_debug module | 10 | ccid2_debug parameter to 0 or 1. |
| 34 | parameter to 0 or 1. | ||
| 35 | 11 | ||
| 36 | If in doubt, say N. | 12 | If in doubt, say N. |
| 37 | 13 | ||
| 38 | config IP_DCCP_CCID3 | 14 | config IP_DCCP_CCID3 |
| 39 | tristate "CCID3 (TCP-Friendly) (EXPERIMENTAL)" | 15 | bool "CCID-3 (TCP-Friendly) (EXPERIMENTAL)" |
| 40 | def_tristate IP_DCCP | 16 | def_bool y if (IP_DCCP = y || IP_DCCP = m) |
| 41 | select IP_DCCP_TFRC_LIB | ||
| 42 | ---help--- | 17 | ---help--- |
| 43 | CCID 3 denotes TCP-Friendly Rate Control (TFRC), an equation-based | 18 | CCID-3 denotes TCP-Friendly Rate Control (TFRC), an equation-based |
| 44 | rate-controlled congestion control mechanism. TFRC is designed to | 19 | rate-controlled congestion control mechanism. TFRC is designed to |
| 45 | be reasonably fair when competing for bandwidth with TCP-like flows, | 20 | be reasonably fair when competing for bandwidth with TCP-like flows, |
| 46 | where a flow is "reasonably fair" if its sending rate is generally | 21 | where a flow is "reasonably fair" if its sending rate is generally |
| 47 | within a factor of two of the sending rate of a TCP flow under the | 22 | within a factor of two of the sending rate of a TCP flow under the |
| 48 | same conditions. However, TFRC has a much lower variation of | 23 | same conditions. However, TFRC has a much lower variation of |
| 49 | throughput over time compared with TCP, which makes CCID 3 more | 24 | throughput over time compared with TCP, which makes CCID-3 more |
| 50 | suitable than CCID 2 for applications such streaming media where a | 25 | suitable than CCID-2 for applications such streaming media where a |
| 51 | relatively smooth sending rate is of importance. | 26 | relatively smooth sending rate is of importance. |
| 52 | 27 | ||
| 53 | CCID 3 is further described in RFC 4342, | 28 | CCID-3 is further described in RFC 4342, |
| 54 | http://www.ietf.org/rfc/rfc4342.txt | 29 | http://www.ietf.org/rfc/rfc4342.txt |
| 55 | 30 | ||
| 56 | The TFRC congestion control algorithms were initially described in | 31 | The TFRC congestion control algorithms were initially described in |
| 57 | RFC 3448. | 32 | RFC 5448. |
| 58 | 33 | ||
| 59 | This text was extracted from RFC 4340 (sec. 10.2), | 34 | This text was extracted from RFC 4340 (sec. 10.2), |
| 60 | http://www.ietf.org/rfc/rfc4340.txt | 35 | http://www.ietf.org/rfc/rfc4340.txt |
| 61 | |||
| 62 | To compile this CCID as a module, choose M here: the module will be | ||
| 63 | called dccp_ccid3. | ||
| 64 | 36 | ||
| 65 | If in doubt, say M. | 37 | If in doubt, say N. |
| 66 | 38 | ||
| 67 | config IP_DCCP_CCID3_DEBUG | 39 | config IP_DCCP_CCID3_DEBUG |
| 68 | bool "CCID3 debugging messages" | 40 | bool "CCID-3 debugging messages" |
| 69 | depends on IP_DCCP_CCID3 | 41 | depends on IP_DCCP_CCID3 |
| 70 | ---help--- | 42 | ---help--- |
| 71 | Enable CCID3-specific debugging messages. | 43 | Enable CCID-3 specific debugging messages. |
| 72 | 44 | ||
| 73 | When compiling CCID3 as a module, this debugging output can | 45 | The debugging output can additionally be toggled by setting the |
| 74 | additionally be toggled by setting the ccid3_debug module | 46 | ccid3_debug parameter to 0 or 1. |
| 75 | parameter to 0 or 1. | ||
| 76 | 47 | ||
| 77 | If in doubt, say N. | 48 | If in doubt, say N. |
| 78 | 49 | ||
| 79 | config IP_DCCP_CCID3_RTO | 50 | config IP_DCCP_CCID3_RTO |
| 80 | int "Use higher bound for nofeedback timer" | 51 | int "Use higher bound for nofeedback timer" |
| @@ -108,12 +79,8 @@ config IP_DCCP_CCID3_RTO | |||
| 108 | therefore not be performed on WANs. | 79 | therefore not be performed on WANs. |
| 109 | 80 | ||
| 110 | config IP_DCCP_TFRC_LIB | 81 | config IP_DCCP_TFRC_LIB |
| 111 | tristate | 82 | def_bool y if IP_DCCP_CCID3 |
| 112 | default n | ||
| 113 | 83 | ||
| 114 | config IP_DCCP_TFRC_DEBUG | 84 | config IP_DCCP_TFRC_DEBUG |
| 115 | bool | 85 | def_bool y if IP_DCCP_CCID3_DEBUG |
| 116 | depends on IP_DCCP_TFRC_LIB | ||
| 117 | default y if IP_DCCP_CCID3_DEBUG | ||
| 118 | |||
| 119 | endmenu | 86 | endmenu |
diff --git a/net/dccp/ccids/Makefile b/net/dccp/ccids/Makefile deleted file mode 100644 index 438f20bccff7..000000000000 --- a/net/dccp/ccids/Makefile +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | obj-$(CONFIG_IP_DCCP_CCID3) += dccp_ccid3.o | ||
| 2 | |||
| 3 | dccp_ccid3-y := ccid3.o | ||
| 4 | |||
| 5 | obj-$(CONFIG_IP_DCCP_CCID2) += dccp_ccid2.o | ||
| 6 | |||
| 7 | dccp_ccid2-y := ccid2.o | ||
| 8 | |||
| 9 | obj-y += lib/ | ||
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c index c9ea19a4d85e..d235294ace23 100644 --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c | |||
| @@ -768,10 +768,9 @@ static void ccid2_hc_rx_packet_recv(struct sock *sk, struct sk_buff *skb) | |||
| 768 | } | 768 | } |
| 769 | } | 769 | } |
| 770 | 770 | ||
| 771 | static struct ccid_operations ccid2 = { | 771 | struct ccid_operations ccid2_ops = { |
| 772 | .ccid_id = DCCPC_CCID2, | 772 | .ccid_id = DCCPC_CCID2, |
| 773 | .ccid_name = "TCP-like", | 773 | .ccid_name = "TCP-like", |
| 774 | .ccid_owner = THIS_MODULE, | ||
| 775 | .ccid_hc_tx_obj_size = sizeof(struct ccid2_hc_tx_sock), | 774 | .ccid_hc_tx_obj_size = sizeof(struct ccid2_hc_tx_sock), |
| 776 | .ccid_hc_tx_init = ccid2_hc_tx_init, | 775 | .ccid_hc_tx_init = ccid2_hc_tx_init, |
| 777 | .ccid_hc_tx_exit = ccid2_hc_tx_exit, | 776 | .ccid_hc_tx_exit = ccid2_hc_tx_exit, |
| @@ -784,22 +783,5 @@ static struct ccid_operations ccid2 = { | |||
| 784 | 783 | ||
| 785 | #ifdef CONFIG_IP_DCCP_CCID2_DEBUG | 784 | #ifdef CONFIG_IP_DCCP_CCID2_DEBUG |
| 786 | module_param(ccid2_debug, bool, 0644); | 785 | module_param(ccid2_debug, bool, 0644); |
| 787 | MODULE_PARM_DESC(ccid2_debug, "Enable debug messages"); | 786 | MODULE_PARM_DESC(ccid2_debug, "Enable CCID-2 debug messages"); |
| 788 | #endif | 787 | #endif |
| 789 | |||
| 790 | static __init int ccid2_module_init(void) | ||
| 791 | { | ||
| 792 | return ccid_register(&ccid2); | ||
| 793 | } | ||
| 794 | module_init(ccid2_module_init); | ||
| 795 | |||
| 796 | static __exit void ccid2_module_exit(void) | ||
| 797 | { | ||
| 798 | ccid_unregister(&ccid2); | ||
| 799 | } | ||
| 800 | module_exit(ccid2_module_exit); | ||
| 801 | |||
| 802 | MODULE_AUTHOR("Andrea Bittau <a.bittau@cs.ucl.ac.uk>"); | ||
| 803 | MODULE_DESCRIPTION("DCCP TCP-Like (CCID2) CCID"); | ||
| 804 | MODULE_LICENSE("GPL"); | ||
| 805 | MODULE_ALIAS("net-dccp-ccid-2"); | ||
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index 3b8bd7ca6761..a27b7f4c19c5 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
| @@ -940,10 +940,9 @@ static int ccid3_hc_rx_getsockopt(struct sock *sk, const int optname, int len, | |||
| 940 | return 0; | 940 | return 0; |
| 941 | } | 941 | } |
| 942 | 942 | ||
| 943 | static struct ccid_operations ccid3 = { | 943 | struct ccid_operations ccid3_ops = { |
| 944 | .ccid_id = DCCPC_CCID3, | 944 | .ccid_id = DCCPC_CCID3, |
| 945 | .ccid_name = "TCP-Friendly Rate Control", | 945 | .ccid_name = "TCP-Friendly Rate Control", |
| 946 | .ccid_owner = THIS_MODULE, | ||
| 947 | .ccid_hc_tx_obj_size = sizeof(struct ccid3_hc_tx_sock), | 946 | .ccid_hc_tx_obj_size = sizeof(struct ccid3_hc_tx_sock), |
| 948 | .ccid_hc_tx_init = ccid3_hc_tx_init, | 947 | .ccid_hc_tx_init = ccid3_hc_tx_init, |
| 949 | .ccid_hc_tx_exit = ccid3_hc_tx_exit, | 948 | .ccid_hc_tx_exit = ccid3_hc_tx_exit, |
| @@ -964,23 +963,5 @@ static struct ccid_operations ccid3 = { | |||
| 964 | 963 | ||
| 965 | #ifdef CONFIG_IP_DCCP_CCID3_DEBUG | 964 | #ifdef CONFIG_IP_DCCP_CCID3_DEBUG |
| 966 | module_param(ccid3_debug, bool, 0644); | 965 | module_param(ccid3_debug, bool, 0644); |
| 967 | MODULE_PARM_DESC(ccid3_debug, "Enable debug messages"); | 966 | MODULE_PARM_DESC(ccid3_debug, "Enable CCID-3 debug messages"); |
| 968 | #endif | 967 | #endif |
| 969 | |||
| 970 | static __init int ccid3_module_init(void) | ||
| 971 | { | ||
| 972 | return ccid_register(&ccid3); | ||
| 973 | } | ||
| 974 | module_init(ccid3_module_init); | ||
| 975 | |||
| 976 | static __exit void ccid3_module_exit(void) | ||
| 977 | { | ||
| 978 | ccid_unregister(&ccid3); | ||
| 979 | } | ||
| 980 | module_exit(ccid3_module_exit); | ||
| 981 | |||
| 982 | MODULE_AUTHOR("Ian McDonald <ian.mcdonald@jandi.co.nz>, " | ||
| 983 | "Arnaldo Carvalho de Melo <acme@ghostprotocols.net>"); | ||
| 984 | MODULE_DESCRIPTION("DCCP TFRC CCID3 CCID"); | ||
| 985 | MODULE_LICENSE("GPL"); | ||
| 986 | MODULE_ALIAS("net-dccp-ccid-3"); | ||
diff --git a/net/dccp/ccids/lib/Makefile b/net/dccp/ccids/lib/Makefile deleted file mode 100644 index 68c93e3d89dc..000000000000 --- a/net/dccp/ccids/lib/Makefile +++ /dev/null | |||
| @@ -1,3 +0,0 @@ | |||
| 1 | obj-$(CONFIG_IP_DCCP_TFRC_LIB) += dccp_tfrc_lib.o | ||
| 2 | |||
| 3 | dccp_tfrc_lib-y := tfrc.o tfrc_equation.o packet_history.o loss_interval.o | ||
diff --git a/net/dccp/ccids/lib/loss_interval.c b/net/dccp/ccids/lib/loss_interval.c index 5b3ce0688c5c..4d1e40127264 100644 --- a/net/dccp/ccids/lib/loss_interval.c +++ b/net/dccp/ccids/lib/loss_interval.c | |||
| @@ -60,7 +60,6 @@ void tfrc_lh_cleanup(struct tfrc_loss_hist *lh) | |||
| 60 | lh->ring[LIH_INDEX(lh->counter)] = NULL; | 60 | lh->ring[LIH_INDEX(lh->counter)] = NULL; |
| 61 | } | 61 | } |
| 62 | } | 62 | } |
| 63 | EXPORT_SYMBOL_GPL(tfrc_lh_cleanup); | ||
| 64 | 63 | ||
| 65 | static void tfrc_lh_calc_i_mean(struct tfrc_loss_hist *lh) | 64 | static void tfrc_lh_calc_i_mean(struct tfrc_loss_hist *lh) |
| 66 | { | 65 | { |
| @@ -121,7 +120,6 @@ u8 tfrc_lh_update_i_mean(struct tfrc_loss_hist *lh, struct sk_buff *skb) | |||
| 121 | 120 | ||
| 122 | return (lh->i_mean < old_i_mean); | 121 | return (lh->i_mean < old_i_mean); |
| 123 | } | 122 | } |
| 124 | EXPORT_SYMBOL_GPL(tfrc_lh_update_i_mean); | ||
| 125 | 123 | ||
| 126 | /* Determine if `new_loss' does begin a new loss interval [RFC 4342, 10.2] */ | 124 | /* Determine if `new_loss' does begin a new loss interval [RFC 4342, 10.2] */ |
| 127 | static inline u8 tfrc_lh_is_new_loss(struct tfrc_loss_interval *cur, | 125 | static inline u8 tfrc_lh_is_new_loss(struct tfrc_loss_interval *cur, |
| @@ -169,7 +167,6 @@ int tfrc_lh_interval_add(struct tfrc_loss_hist *lh, struct tfrc_rx_hist *rh, | |||
| 169 | } | 167 | } |
| 170 | return 1; | 168 | return 1; |
| 171 | } | 169 | } |
| 172 | EXPORT_SYMBOL_GPL(tfrc_lh_interval_add); | ||
| 173 | 170 | ||
| 174 | int __init tfrc_li_init(void) | 171 | int __init tfrc_li_init(void) |
| 175 | { | 172 | { |
diff --git a/net/dccp/ccids/lib/packet_history.c b/net/dccp/ccids/lib/packet_history.c index 6cc108afdc3b..b7785b3581ec 100644 --- a/net/dccp/ccids/lib/packet_history.c +++ b/net/dccp/ccids/lib/packet_history.c | |||
| @@ -94,7 +94,6 @@ int tfrc_tx_hist_add(struct tfrc_tx_hist_entry **headp, u64 seqno) | |||
| 94 | *headp = entry; | 94 | *headp = entry; |
| 95 | return 0; | 95 | return 0; |
| 96 | } | 96 | } |
| 97 | EXPORT_SYMBOL_GPL(tfrc_tx_hist_add); | ||
| 98 | 97 | ||
| 99 | void tfrc_tx_hist_purge(struct tfrc_tx_hist_entry **headp) | 98 | void tfrc_tx_hist_purge(struct tfrc_tx_hist_entry **headp) |
| 100 | { | 99 | { |
| @@ -109,7 +108,6 @@ void tfrc_tx_hist_purge(struct tfrc_tx_hist_entry **headp) | |||
| 109 | 108 | ||
| 110 | *headp = NULL; | 109 | *headp = NULL; |
| 111 | } | 110 | } |
| 112 | EXPORT_SYMBOL_GPL(tfrc_tx_hist_purge); | ||
| 113 | 111 | ||
| 114 | u32 tfrc_tx_hist_rtt(struct tfrc_tx_hist_entry *head, const u64 seqno, | 112 | u32 tfrc_tx_hist_rtt(struct tfrc_tx_hist_entry *head, const u64 seqno, |
| 115 | const ktime_t now) | 113 | const ktime_t now) |
| @@ -127,7 +125,6 @@ u32 tfrc_tx_hist_rtt(struct tfrc_tx_hist_entry *head, const u64 seqno, | |||
| 127 | 125 | ||
| 128 | return rtt; | 126 | return rtt; |
| 129 | } | 127 | } |
| 130 | EXPORT_SYMBOL_GPL(tfrc_tx_hist_rtt); | ||
| 131 | 128 | ||
| 132 | 129 | ||
| 133 | /* | 130 | /* |
| @@ -172,7 +169,6 @@ void tfrc_rx_hist_add_packet(struct tfrc_rx_hist *h, | |||
| 172 | 169 | ||
| 173 | tfrc_rx_hist_entry_from_skb(entry, skb, ndp); | 170 | tfrc_rx_hist_entry_from_skb(entry, skb, ndp); |
| 174 | } | 171 | } |
| 175 | EXPORT_SYMBOL_GPL(tfrc_rx_hist_add_packet); | ||
| 176 | 172 | ||
| 177 | /* has the packet contained in skb been seen before? */ | 173 | /* has the packet contained in skb been seen before? */ |
| 178 | int tfrc_rx_hist_duplicate(struct tfrc_rx_hist *h, struct sk_buff *skb) | 174 | int tfrc_rx_hist_duplicate(struct tfrc_rx_hist *h, struct sk_buff *skb) |
| @@ -189,7 +185,6 @@ int tfrc_rx_hist_duplicate(struct tfrc_rx_hist *h, struct sk_buff *skb) | |||
| 189 | 185 | ||
| 190 | return 0; | 186 | return 0; |
| 191 | } | 187 | } |
| 192 | EXPORT_SYMBOL_GPL(tfrc_rx_hist_duplicate); | ||
| 193 | 188 | ||
| 194 | static void tfrc_rx_hist_swap(struct tfrc_rx_hist *h, const u8 a, const u8 b) | 189 | static void tfrc_rx_hist_swap(struct tfrc_rx_hist *h, const u8 a, const u8 b) |
| 195 | { | 190 | { |
| @@ -390,7 +385,6 @@ int tfrc_rx_handle_loss(struct tfrc_rx_hist *h, | |||
| 390 | } | 385 | } |
| 391 | return is_new_loss; | 386 | return is_new_loss; |
| 392 | } | 387 | } |
| 393 | EXPORT_SYMBOL_GPL(tfrc_rx_handle_loss); | ||
| 394 | 388 | ||
| 395 | int tfrc_rx_hist_alloc(struct tfrc_rx_hist *h) | 389 | int tfrc_rx_hist_alloc(struct tfrc_rx_hist *h) |
| 396 | { | 390 | { |
| @@ -412,7 +406,6 @@ out_free: | |||
| 412 | } | 406 | } |
| 413 | return -ENOBUFS; | 407 | return -ENOBUFS; |
| 414 | } | 408 | } |
| 415 | EXPORT_SYMBOL_GPL(tfrc_rx_hist_alloc); | ||
| 416 | 409 | ||
| 417 | void tfrc_rx_hist_purge(struct tfrc_rx_hist *h) | 410 | void tfrc_rx_hist_purge(struct tfrc_rx_hist *h) |
| 418 | { | 411 | { |
| @@ -424,7 +417,6 @@ void tfrc_rx_hist_purge(struct tfrc_rx_hist *h) | |||
| 424 | h->ring[i] = NULL; | 417 | h->ring[i] = NULL; |
| 425 | } | 418 | } |
| 426 | } | 419 | } |
| 427 | EXPORT_SYMBOL_GPL(tfrc_rx_hist_purge); | ||
| 428 | 420 | ||
| 429 | /** | 421 | /** |
| 430 | * tfrc_rx_hist_rtt_last_s - reference entry to compute RTT samples against | 422 | * tfrc_rx_hist_rtt_last_s - reference entry to compute RTT samples against |
| @@ -495,4 +487,3 @@ keep_ref_for_next_time: | |||
| 495 | 487 | ||
| 496 | return sample; | 488 | return sample; |
| 497 | } | 489 | } |
| 498 | EXPORT_SYMBOL_GPL(tfrc_rx_hist_sample_rtt); | ||
diff --git a/net/dccp/ccids/lib/tfrc.c b/net/dccp/ccids/lib/tfrc.c index 185916218e07..60c412ccfeef 100644 --- a/net/dccp/ccids/lib/tfrc.c +++ b/net/dccp/ccids/lib/tfrc.c | |||
| @@ -1,20 +1,18 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * TFRC: main module holding the pieces of the TFRC library together | 2 | * TFRC library initialisation |
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2007 The University of Aberdeen, Scotland, UK | 4 | * Copyright (c) 2007 The University of Aberdeen, Scotland, UK |
| 5 | * Copyright (c) 2007 Arnaldo Carvalho de Melo <acme@redhat.com> | 5 | * Copyright (c) 2007 Arnaldo Carvalho de Melo <acme@redhat.com> |
| 6 | */ | 6 | */ |
| 7 | #include <linux/module.h> | ||
| 8 | #include <linux/moduleparam.h> | ||
| 9 | #include "tfrc.h" | 7 | #include "tfrc.h" |
| 10 | 8 | ||
| 11 | #ifdef CONFIG_IP_DCCP_TFRC_DEBUG | 9 | #ifdef CONFIG_IP_DCCP_TFRC_DEBUG |
| 12 | int tfrc_debug; | 10 | int tfrc_debug; |
| 13 | module_param(tfrc_debug, bool, 0644); | 11 | module_param(tfrc_debug, bool, 0644); |
| 14 | MODULE_PARM_DESC(tfrc_debug, "Enable debug messages"); | 12 | MODULE_PARM_DESC(tfrc_debug, "Enable TFRC debug messages"); |
| 15 | #endif | 13 | #endif |
| 16 | 14 | ||
| 17 | static int __init tfrc_module_init(void) | 15 | int __init tfrc_lib_init(void) |
| 18 | { | 16 | { |
| 19 | int rc = tfrc_li_init(); | 17 | int rc = tfrc_li_init(); |
| 20 | 18 | ||
| @@ -38,18 +36,9 @@ out: | |||
| 38 | return rc; | 36 | return rc; |
| 39 | } | 37 | } |
| 40 | 38 | ||
| 41 | static void __exit tfrc_module_exit(void) | 39 | void __exit tfrc_lib_exit(void) |
| 42 | { | 40 | { |
| 43 | tfrc_rx_packet_history_exit(); | 41 | tfrc_rx_packet_history_exit(); |
| 44 | tfrc_tx_packet_history_exit(); | 42 | tfrc_tx_packet_history_exit(); |
| 45 | tfrc_li_exit(); | 43 | tfrc_li_exit(); |
| 46 | } | 44 | } |
| 47 | |||
| 48 | module_init(tfrc_module_init); | ||
| 49 | module_exit(tfrc_module_exit); | ||
| 50 | |||
| 51 | MODULE_AUTHOR("Gerrit Renker <gerrit@erg.abdn.ac.uk>, " | ||
| 52 | "Ian McDonald <ian.mcdonald@jandi.co.nz>, " | ||
| 53 | "Arnaldo Carvalho de Melo <acme@redhat.com>"); | ||
| 54 | MODULE_DESCRIPTION("DCCP TFRC library"); | ||
| 55 | MODULE_LICENSE("GPL"); | ||
diff --git a/net/dccp/ccids/lib/tfrc.h b/net/dccp/ccids/lib/tfrc.h index ed9857527acf..e9720b143275 100644 --- a/net/dccp/ccids/lib/tfrc.h +++ b/net/dccp/ccids/lib/tfrc.h | |||
| @@ -17,7 +17,8 @@ | |||
| 17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
| 18 | #include <linux/math64.h> | 18 | #include <linux/math64.h> |
| 19 | #include "../../dccp.h" | 19 | #include "../../dccp.h" |
| 20 | /* internal includes that this module exports: */ | 20 | |
| 21 | /* internal includes that this library exports: */ | ||
| 21 | #include "loss_interval.h" | 22 | #include "loss_interval.h" |
| 22 | #include "packet_history.h" | 23 | #include "packet_history.h" |
| 23 | 24 | ||
| @@ -66,4 +67,12 @@ extern void tfrc_rx_packet_history_exit(void); | |||
| 66 | 67 | ||
| 67 | extern int tfrc_li_init(void); | 68 | extern int tfrc_li_init(void); |
| 68 | extern void tfrc_li_exit(void); | 69 | extern void tfrc_li_exit(void); |
| 70 | |||
| 71 | #ifdef CONFIG_IP_DCCP_TFRC_LIB | ||
| 72 | extern int tfrc_lib_init(void); | ||
| 73 | extern void tfrc_lib_exit(void); | ||
| 74 | #else | ||
| 75 | #define tfrc_lib_init() (0) | ||
| 76 | #define tfrc_lib_exit() | ||
| 77 | #endif | ||
| 69 | #endif /* _TFRC_H_ */ | 78 | #endif /* _TFRC_H_ */ |
diff --git a/net/dccp/ccids/lib/tfrc_equation.c b/net/dccp/ccids/lib/tfrc_equation.c index 2f20a29cffe4..c5d3a9e5a5a4 100644 --- a/net/dccp/ccids/lib/tfrc_equation.c +++ b/net/dccp/ccids/lib/tfrc_equation.c | |||
| @@ -659,8 +659,6 @@ u32 tfrc_calc_x(u16 s, u32 R, u32 p) | |||
| 659 | return scaled_div32(result, f); | 659 | return scaled_div32(result, f); |
| 660 | } | 660 | } |
| 661 | 661 | ||
| 662 | EXPORT_SYMBOL_GPL(tfrc_calc_x); | ||
| 663 | |||
| 664 | /** | 662 | /** |
| 665 | * tfrc_calc_x_reverse_lookup - try to find p given f(p) | 663 | * tfrc_calc_x_reverse_lookup - try to find p given f(p) |
| 666 | * | 664 | * |
| @@ -693,5 +691,3 @@ u32 tfrc_calc_x_reverse_lookup(u32 fvalue) | |||
| 693 | index = tfrc_binsearch(fvalue, 0); | 691 | index = tfrc_binsearch(fvalue, 0); |
| 694 | return (index + 1) * 1000000 / TFRC_CALC_X_ARRSIZE; | 692 | return (index + 1) * 1000000 / TFRC_CALC_X_ARRSIZE; |
| 695 | } | 693 | } |
| 696 | |||
| 697 | EXPORT_SYMBOL_GPL(tfrc_calc_x_reverse_lookup); | ||
