: New RX History Step 3 - Track highest seqno
PATCH 4/9 : New RX History Step 3 - Track highest seqno
[CCID 3]: New RX History Step 3 - Track highest seqno
The receiver needs to track the highest sequence number (and corresponding CCVal / timestamp) received so far.
This is done here, the patch updates the `non_loss' entry of the CCID 3 RX history with the details of the currently received packet.
It uses the new ktime_t interface.
Signed-off-by Gerrit Renker <[email protected]>
--- net/dccp/ccids/ccid3.c | 3 ++ net/dccp/ccids/lib/packet_history.h | 38 ++++++++++++++++-------------------- 2 files changed, 20 insertions(+), 21 deletions(-)
net/dccp/ccids/ccid3.c +3 -0
@@ -1022,6 +1022,9 @@ static void ccid3_hc_rx_packet_recv(strureturn ; } +/* Update highest received sequence number so far */ +tfrc_rx_hist_update (&hcrx->ccid3hcrx_hist, skb, opt_recv->dccpor_ndp); +/* Dealing with packet loss */ ccid3_pr_debug ("%s(%p, state=%s), data loss! Reacting...\n" ,dccp_role (sk), sk,dccp_state_name (sk->sk_state));
net/dccp/ccids/lib/packet_history.h +17 -21
@@ -204,32 +204,28 @@ static inline void tfrc_rx_hist_swap(str *b = tmp; } -extern int tfrc_rx_hist_init (struct tfrc_rx_hist *); -extern void tfrc_rx_hist_cleanup (struct tfrc_rx_hist *); - -static inline struct dccp_rx_hist_entry * -dccp_rx_hist_entry_new (struct dccp_rx_hist *hist, -const struct sock *sk, -const u32 ndp, -const struct sk_buff *skb, -const gfp_t prio) +static inline void tfrc_rx_hist_entry_from_skb (struct tfrc_rx_hist_entry *new, +struct sk_buff *skb,u32 ndp) { -struct dccp_rx_hist_entry *entry =kmem_cache_alloc (hist->dccprxh_slab, - prio); - -if (entry !=NULL ) { -const struct dccp_hdr *dh =dccp_hdr (skb); +const struct dccp_hdr *dh =dccp_hdr (skb); - entry->dccphrx_seqno =DCCP_SKB_CB (skb)->dccpd_seq; - entry->dccphrx_ccval = dh->dccph_ccval; - entry->dccphrx_type = dh->dccph_type; - entry->dccphrx_ndp = ndp; -dccp_timestamp (sk, &entry->dccphrx_tstamp); - } + new->seqno =DCCP_SKB_CB (skb)->dccpd_seq; + new->ccval = dh->dccph_ccval; + new->ptype = dh->dccph_type; + new->ndp = ndp; + new->stamp =ktime_get_real (); +} -return entry; +/* commit packet details of skb to history (record highest received seqno) */ +static inline void tfrc_rx_hist_update (struct tfrc_rx_hist *h, +struct sk_buff *skb,u32 ndp) +{ +tfrc_rx_hist_entry_from_skb (last_rcv (h), skb, ndp); } +extern int tfrc_rx_hist_init (struct tfrc_rx_hist *); +extern void tfrc_rx_hist_cleanup (struct tfrc_rx_hist *); +static inline struct dccp_rx_hist_entry *dccp_rx_hist_head (struct list_head *list) {
Quoted 2 lines · Gerrit Renker
[CCID 3]: New RX History Step 3 - Track highest seqno
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