: Integrate RX history loss detection with loss interval update
PATCH 6/9 : Integrate RX history loss detection with loss interval update
[TFRC]: Integrate RX history loss detection with loss interval update
This adds the missing link between
* TFRC loss detection as provided by the RX history code and
* Loss Intervals update whenever a new loss is detected.
Handling is conform to the TFRC semantics and conveniently transparent to the caller: only the function tfrc_rx_handle_loss() need be called.
A test module is available on request which shows that the transfer from RX history loss event into a newly created loss interval entry works.
Signed-off-by Gerrit Renker <[email protected]>
--- net/dccp/ccids/lib/packet_history.c | 23 +++++++++++++++-------- net/dccp/ccids/lib/packet_history.h | 4 +++- 2 files changed, 18 insertions(+), 9 deletions(-)
net/dccp/ccids/lib/packet_history.c +15 -8
@@ -328,13 +328,20 @@ static void __three_after_loss(struct tf/** * tfrc_rx_handle_loss - Loss detection and further processing -* @h: The non-empty history object -* @skb: Currently received packet -* @ndp: The NDP count belonging to skb -* Returns 1 when caller should send feedback, 0 otherwise. +* @h: The non-empty RX history object +* @lh: Loss Intervals database to update +* @skb: Currently received packet +* @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. */ int tfrc_rx_handle_loss (struct tfrc_rx_hist *h, -struct sk_buff *skb,u32 ndp) +struct tfrc_loss_hist *lh, +struct sk_buff *skb,u32 ndp, +u32 (*calc_first_li)(struct sock *),struct sock *sk) {int is_new_loss =0 ;
@@ -344,9 +351,9 @@ int tfrc_rx_handle_loss(struct tfrc_rx_hDCCP_BUG ("invalid loss_count %d" , h->loss_count); else if (__two_after_loss(h, skb, ndp)) {/* -* XXX part of subsequent patch -is_new_loss = update_li(li_hist, loss_prev(h)); -*/ +* Update Loss Interval database and recycle RX records +*/ + is_new_loss =tfrc_lh_interval_add (lh, h, calc_first_li, sk);__three_after_loss (h); }return is_new_loss;
net/dccp/ccids/lib/packet_history.h +3 -1
@@ -223,7 +223,9 @@ static inline void tfrc_rx_hist_update(stfrc_rx_hist_entry_from_skb (last_rcv (h), skb, ndp); } -extern int tfrc_rx_handle_loss (struct tfrc_rx_hist *,struct sk_buff *,u32 ); +extern int tfrc_rx_handle_loss (struct tfrc_rx_hist *,struct tfrc_loss_hist *, +struct sk_buff *skb,u32 ndp, +u32 (*first_li)(struct sock *),struct sock *);extern u32 tfrc_rx_sample_rtt (struct tfrc_rx_hist *,struct sk_buff *);extern int tfrc_rx_hist_init (struct tfrc_rx_hist *);extern void tfrc_rx_hist_cleanup (struct tfrc_rx_hist *);
Quoted 2 lines · Gerrit Renker
[TFRC]: Integrate RX history loss detection with loss interval update
Signed-off-by Gerrit Renker <[email protected]>
Signed-off-by Ian McDonald <[email protected]>
Signature · 3 lines
Web: http://wand.net.nz/~iam4/ Blog: http://iansblog.jandi.co.nz WAND Network Research Group