diff options
Diffstat (limited to 'net/dccp/ccids/lib')
| -rw-r--r-- | net/dccp/ccids/lib/loss_interval.c | 1 | ||||
| -rw-r--r-- | net/dccp/ccids/lib/loss_interval.h | 8 | ||||
| -rw-r--r-- | net/dccp/ccids/lib/packet_history.c | 3 | ||||
| -rw-r--r-- | net/dccp/ccids/lib/packet_history.h | 25 | ||||
| -rw-r--r-- | net/dccp/ccids/lib/tfrc.c | 3 | ||||
| -rw-r--r-- | net/dccp/ccids/lib/tfrc.h | 24 | ||||
| -rw-r--r-- | net/dccp/ccids/lib/tfrc_equation.c | 2 | 
7 files changed, 34 insertions, 32 deletions
diff --git a/net/dccp/ccids/lib/loss_interval.c b/net/dccp/ccids/lib/loss_interval.c index 497723c4d4b..57f9fd78c4d 100644 --- a/net/dccp/ccids/lib/loss_interval.c +++ b/net/dccp/ccids/lib/loss_interval.c @@ -133,6 +133,7 @@ static inline u8 tfrc_lh_is_new_loss(struct tfrc_loss_interval *cur,   * @rh:		   Receive history containing a fresh loss event   * @calc_first_li: Caller-dependent routine to compute length of first interval   * @sk:		   Used by @calc_first_li in caller-specific way (subtyping) + *   * Updates I_mean and returns 1 if a new interval has in fact been added to @lh.   */  int tfrc_lh_interval_add(struct tfrc_loss_hist *lh, struct tfrc_rx_hist *rh, diff --git a/net/dccp/ccids/lib/loss_interval.h b/net/dccp/ccids/lib/loss_interval.h index d1d2f5383b7..57f631a86cc 100644 --- a/net/dccp/ccids/lib/loss_interval.h +++ b/net/dccp/ccids/lib/loss_interval.h @@ -65,9 +65,9 @@ static inline u8 tfrc_lh_length(struct tfrc_loss_hist *lh)  struct tfrc_rx_hist; -extern int  tfrc_lh_interval_add(struct tfrc_loss_hist *, struct tfrc_rx_hist *, -				 u32 (*first_li)(struct sock *), struct sock *); -extern u8   tfrc_lh_update_i_mean(struct tfrc_loss_hist *lh, struct sk_buff *); -extern void tfrc_lh_cleanup(struct tfrc_loss_hist *lh); +int tfrc_lh_interval_add(struct tfrc_loss_hist *, struct tfrc_rx_hist *, +			 u32 (*first_li)(struct sock *), struct sock *); +u8 tfrc_lh_update_i_mean(struct tfrc_loss_hist *lh, struct sk_buff *); +void tfrc_lh_cleanup(struct tfrc_loss_hist *lh);  #endif /* _DCCP_LI_HIST_ */ diff --git a/net/dccp/ccids/lib/packet_history.c b/net/dccp/ccids/lib/packet_history.c index de8fe294bf0..08df7a3acb3 100644 --- a/net/dccp/ccids/lib/packet_history.c +++ b/net/dccp/ccids/lib/packet_history.c @@ -315,6 +315,7 @@ static void __three_after_loss(struct tfrc_rx_hist *h)   *  @ndp:	    The NDP count belonging to @skb   *  @calc_first_li: Caller-dependent computation of first loss interval in @lh   *  @sk:	    Used by @calc_first_li (see tfrc_lh_interval_add) + *   *  Chooses action according to pending loss, updates LI database when a new   *  loss was detected, and does required post-processing. Returns 1 when caller   *  should send feedback, 0 otherwise. @@ -387,7 +388,7 @@ static inline struct tfrc_rx_hist_entry *  }  /** - * tfrc_rx_hist_rtt_prev_s: previously suitable (wrt rtt_last_s) RTT-sampling entry + * tfrc_rx_hist_rtt_prev_s - previously suitable (wrt rtt_last_s) RTT-sampling entry   */  static inline struct tfrc_rx_hist_entry *  			tfrc_rx_hist_rtt_prev_s(const struct tfrc_rx_hist *h) diff --git a/net/dccp/ccids/lib/packet_history.h b/net/dccp/ccids/lib/packet_history.h index 7ee4a9d9d33..ee362b0b630 100644 --- a/net/dccp/ccids/lib/packet_history.h +++ b/net/dccp/ccids/lib/packet_history.h @@ -60,8 +60,8 @@ static inline struct tfrc_tx_hist_entry *  	return head;  } -extern int  tfrc_tx_hist_add(struct tfrc_tx_hist_entry **headp, u64 seqno); -extern void tfrc_tx_hist_purge(struct tfrc_tx_hist_entry **headp); +int tfrc_tx_hist_add(struct tfrc_tx_hist_entry **headp, u64 seqno); +void tfrc_tx_hist_purge(struct tfrc_tx_hist_entry **headp);  /* Subtraction a-b modulo-16, respects circular wrap-around */  #define SUB16(a, b) (((a) + 16 - (b)) & 0xF) @@ -139,20 +139,17 @@ static inline bool tfrc_rx_hist_loss_pending(const struct tfrc_rx_hist *h)  	return h->loss_count > 0;  } -extern void tfrc_rx_hist_add_packet(struct tfrc_rx_hist *h, -				    const struct sk_buff *skb, const u64 ndp); +void tfrc_rx_hist_add_packet(struct tfrc_rx_hist *h, const struct sk_buff *skb, +			     const u64 ndp); -extern int tfrc_rx_hist_duplicate(struct tfrc_rx_hist *h, struct sk_buff *skb); +int tfrc_rx_hist_duplicate(struct tfrc_rx_hist *h, struct sk_buff *skb);  struct tfrc_loss_hist; -extern int  tfrc_rx_handle_loss(struct tfrc_rx_hist *h, -				struct tfrc_loss_hist *lh, -				struct sk_buff *skb, const u64 ndp, -				u32 (*first_li)(struct sock *sk), -				struct sock *sk); -extern u32 tfrc_rx_hist_sample_rtt(struct tfrc_rx_hist *h, -				   const struct sk_buff *skb); -extern int tfrc_rx_hist_alloc(struct tfrc_rx_hist *h); -extern void tfrc_rx_hist_purge(struct tfrc_rx_hist *h); +int tfrc_rx_handle_loss(struct tfrc_rx_hist *h, struct tfrc_loss_hist *lh, +			struct sk_buff *skb, const u64 ndp, +			u32 (*first_li)(struct sock *sk), struct sock *sk); +u32 tfrc_rx_hist_sample_rtt(struct tfrc_rx_hist *h, const struct sk_buff *skb); +int tfrc_rx_hist_alloc(struct tfrc_rx_hist *h); +void tfrc_rx_hist_purge(struct tfrc_rx_hist *h);  #endif /* _DCCP_PKT_HIST_ */ diff --git a/net/dccp/ccids/lib/tfrc.c b/net/dccp/ccids/lib/tfrc.c index 4902029854d..62b5828acde 100644 --- a/net/dccp/ccids/lib/tfrc.c +++ b/net/dccp/ccids/lib/tfrc.c @@ -4,10 +4,11 @@   * Copyright (c) 2007 The University of Aberdeen, Scotland, UK   * Copyright (c) 2007 Arnaldo Carvalho de Melo <acme@redhat.com>   */ +#include <linux/moduleparam.h>  #include "tfrc.h"  #ifdef CONFIG_IP_DCCP_TFRC_DEBUG -int tfrc_debug; +bool tfrc_debug;  module_param(tfrc_debug, bool, 0644);  MODULE_PARM_DESC(tfrc_debug, "Enable TFRC debug messages");  #endif diff --git a/net/dccp/ccids/lib/tfrc.h b/net/dccp/ccids/lib/tfrc.h index f8ee3f54977..40ee7d62b65 100644 --- a/net/dccp/ccids/lib/tfrc.h +++ b/net/dccp/ccids/lib/tfrc.h @@ -21,7 +21,7 @@  #include "packet_history.h"  #ifdef CONFIG_IP_DCCP_TFRC_DEBUG -extern int tfrc_debug; +extern bool tfrc_debug;  #define tfrc_pr_debug(format, a...)	DCCP_PR_DEBUG(tfrc_debug, format, ##a)  #else  #define tfrc_pr_debug(format, a...) @@ -55,21 +55,21 @@ static inline u32 tfrc_ewma(const u32 avg, const u32 newval, const u8 weight)  	return avg ? (weight * avg + (10 - weight) * newval) / 10 : newval;  } -extern u32  tfrc_calc_x(u16 s, u32 R, u32 p); -extern u32  tfrc_calc_x_reverse_lookup(u32 fvalue); -extern u32  tfrc_invert_loss_event_rate(u32 loss_event_rate); +u32 tfrc_calc_x(u16 s, u32 R, u32 p); +u32 tfrc_calc_x_reverse_lookup(u32 fvalue); +u32 tfrc_invert_loss_event_rate(u32 loss_event_rate); -extern int  tfrc_tx_packet_history_init(void); -extern void tfrc_tx_packet_history_exit(void); -extern int  tfrc_rx_packet_history_init(void); -extern void tfrc_rx_packet_history_exit(void); +int tfrc_tx_packet_history_init(void); +void tfrc_tx_packet_history_exit(void); +int tfrc_rx_packet_history_init(void); +void tfrc_rx_packet_history_exit(void); -extern int  tfrc_li_init(void); -extern void tfrc_li_exit(void); +int tfrc_li_init(void); +void tfrc_li_exit(void);  #ifdef CONFIG_IP_DCCP_TFRC_LIB -extern int  tfrc_lib_init(void); -extern void tfrc_lib_exit(void); +int tfrc_lib_init(void); +void tfrc_lib_exit(void);  #else  #define tfrc_lib_init() (0)  #define tfrc_lib_exit() diff --git a/net/dccp/ccids/lib/tfrc_equation.c b/net/dccp/ccids/lib/tfrc_equation.c index a052a4377e2..88ef98285be 100644 --- a/net/dccp/ccids/lib/tfrc_equation.c +++ b/net/dccp/ccids/lib/tfrc_equation.c @@ -611,6 +611,7 @@ static inline u32 tfrc_binsearch(u32 fval, u8 small)   * @s: packet size          in bytes   * @R: RTT                  scaled by 1000000   (i.e., microseconds)   * @p: loss ratio estimate  scaled by 1000000 + *   * Returns X_calc           in bytes per second (not scaled).   */  u32 tfrc_calc_x(u16 s, u32 R, u32 p) @@ -659,6 +660,7 @@ u32 tfrc_calc_x(u16 s, u32 R, u32 p)  /**   *  tfrc_calc_x_reverse_lookup  -  try to find p given f(p)   *  @fvalue: function value to match, scaled by 1000000 + *   *  Returns closest match for p, also scaled by 1000000   */  u32 tfrc_calc_x_reverse_lookup(u32 fvalue)  | 
