Skip to content

Commit

Permalink
[DCCP] packet_history: Convert dccphtx_tstamp to ktime_t
Browse files Browse the repository at this point in the history
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Arnaldo Carvalho de Melo authored and David S. Miller committed Oct 10, 2007
1 parent e7c2335 commit 0740d49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions net/dccp/ccids/ccid3.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, int more,
}
dccp_tx_hist_add_entry(&hctx->ccid3hctx_hist, packet);

packet->dccphtx_tstamp = ktime_to_timeval(ktime_get_real());
packet->dccphtx_tstamp = ktime_get_real();
packet->dccphtx_seqno = dccp_sk(sk)->dccps_gss;
packet->dccphtx_rtt = hctx->ccid3hctx_rtt;
packet->dccphtx_sent = 1;
Expand All @@ -412,7 +412,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk);
struct ccid3_options_received *opt_recv;
struct dccp_tx_hist_entry *packet;
ktime_t now, t_hist;
ktime_t now;
unsigned long t_nfb;
u32 pinv, r_sample;

Expand Down Expand Up @@ -451,12 +451,11 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
hctx->ccid3hctx_p = 1000000 / pinv;

now = ktime_get_real();
t_hist = timeval_to_ktime(packet->dccphtx_tstamp);
/*
* Calculate new round trip sample as per [RFC 3448, 4.3] by
* R_sample = (now - t_recvdata) - t_elapsed
*/
r_sample = dccp_sample_rtt(sk, now, &t_hist);
r_sample = dccp_sample_rtt(sk, now, &packet->dccphtx_tstamp);

/*
* Update RTT estimate by
Expand Down
3 changes: 1 addition & 2 deletions net/dccp/ccids/lib/packet_history.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include <linux/ktime.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/time.h>

#include "../../dccp.h"

Expand All @@ -58,7 +57,7 @@ struct dccp_tx_hist_entry {
u64 dccphtx_seqno:48,
dccphtx_sent:1;
u32 dccphtx_rtt;
struct timeval dccphtx_tstamp;
ktime_t dccphtx_tstamp;
};

struct dccp_tx_hist {
Expand Down

0 comments on commit 0740d49

Please sign in to comment.