Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215144
b: refs/heads/master
c: d196c9a
h: refs/heads/master
v: v3
  • Loading branch information
Ivo Calado authored and Gerrit Renker committed Oct 12, 2010
1 parent a8afb41 commit e82c193
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: baf9e782e1dc4991edecfa3b8700cf8739c40259
refs/heads/master: d196c9a5d4e150cdff675662214c80c69b906958
21 changes: 15 additions & 6 deletions trunk/net/dccp/dccp.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,27 @@ static inline u64 max48(const u64 seq1, const u64 seq2)
}

/**
* dccp_loss_free - Evaluates condition for data loss from RFC 4340, 7.7.1
* @s1: start sequence number
* @s2: end sequence number
* dccp_loss_count - Approximate the number of lost data packets in a burst loss
* @s1: last known sequence number before the loss ('hole')
* @s2: first sequence number seen after the 'hole'
* @ndp: NDP count on packet with sequence number @s2
* Returns true if the sequence range s1...s2 has no data loss.
*/
static inline bool dccp_loss_free(const u64 s1, const u64 s2, const u64 ndp)
static inline u64 dccp_loss_count(const u64 s1, const u64 s2, const u64 ndp)
{
s64 delta = dccp_delta_seqno(s1, s2);

WARN_ON(delta < 0);
return (u64)delta <= ndp + 1;
delta -= ndp + 1;

return delta > 0 ? delta : 0;
}

/**
* dccp_loss_free - Evaluate condition for data loss from RFC 4340, 7.7.1
*/
static inline bool dccp_loss_free(const u64 s1, const u64 s2, const u64 ndp)
{
return dccp_loss_count(s1, s2, ndp) == 0;
}

enum {
Expand Down

0 comments on commit e82c193

Please sign in to comment.