Commit 90bb4cdb authored by Andreas Schmidt's avatar Andreas Schmidt

Fixes.

* Expose round_start.
* Single call to getPacingRate().
parent 4e1beda4
Pipeline #2115 failed with stages
in 21 seconds
......@@ -158,6 +158,7 @@ cdef extern from "proto/socket.h":
uint32_t PrrtSocket_get_send_quantum(PrrtSocket *s)
uint32_t PrrtSocket_get_pipe(PrrtSocket *s)
uint32_t PrrtSocket_get_delivered(PrrtSocket *s)
bint PrrtSocket_get_bbr_round_start(PrrtSocket *s)
bint PrrtSocket_get_app_limited(PrrtSocket *socket)
......
......@@ -141,8 +141,9 @@ void BBR_HandleProbeRTT(BBR *bbr, PrrtPacketTracking *tracking) {
bbr->probe_rtt_round_done = false;
bbr->next_round_delivered = tracking->delivered;
} else if (bbr->probe_rtt_done_stamp != 0) {
if (bbr->round_start)
if (bbr->round_start) {
bbr->probe_rtt_round_done = true;
}
if (bbr->probe_rtt_round_done && (now > bbr->probe_rtt_done_stamp)) {
bbr->rtprop_stamp = now;
BBR_RestoreCwnd(bbr);
......@@ -321,6 +322,10 @@ bool BBR_getFilledPipe(BBR* bbr) {
return bbr->filled_pipe;
}
bool BBR_getRoundStart(BBR* bbr) {
return bbr->round_start;
}
uint64_t BBR_getFullBw(BBR* bbr) {
return bbr->full_bw;
}
......
......@@ -27,9 +27,9 @@ enum bbr_state {
};
typedef struct bbr {
uint32_t rtprop;
prrtTimedelta_t rtprop;
prrtTimestamp_t rtprop_stamp;
uint32_t probe_rtt_done_stamp;
prrtTimestamp_t probe_rtt_done_stamp;
bool probe_rtt_round_done;
bool packet_conservation;
prrtByteCount_t prior_cwnd;
......@@ -84,5 +84,6 @@ bool BBR_getFilledPipe(BBR* bbr);
uint32_t BBR_getRTProp(BBR* bbr);
prrtByteCount_t BBR_getInflight(BBR* bbr);
prrtByteCount_t BBR_getSendQuantum(BBR* bbr);
bool BBR_getRoundStart(BBR* bbr);
#endif //PRRT_BBR_H
......@@ -105,9 +105,11 @@ static bool send_packet(PrrtSocket *sock_ptr, PrrtPacket *packet) {
}
prrtTimestamp_t now = PrrtClock_get_current_time_us();
if (sock_ptr->pacingEnabled && BBR_getPacingRate(sock_ptr->receiver->bbr) != 0) {
debug(DEBUG_DATATRANSMITTER, "Payload: %u, PacingRate: %u, Pacing Time: %u", packet->payloadLength, BBR_getPacingRate(sock_ptr->receiver->bbr), packet->payloadLength / BBR_getPacingRate(sock_ptr->receiver->bbr));
sock_ptr->nextSendTime = now + ((prrtTimedelta_t) round((((double) 1000 * 1000 * packet->payloadLength) / (BBR_getPacingRate(sock_ptr->receiver->bbr)))));
uint32_t pacing_rate = BBR_getPacingRate(sock_ptr->receiver->bbr);
if (sock_ptr->pacingEnabled && pacing_rate != 0) {
debug(DEBUG_DATATRANSMITTER, "Payload: %u, PacingRate: %u, Pacing Time: %u", packet->payloadLength, pacing_rate, packet->payloadLength /
pacing_rate);
sock_ptr->nextSendTime = now + ((prrtTimedelta_t) round((((double) 1000 * 1000 * packet->payloadLength) / pacing_rate)));
}
struct timespec timestamp;
......
......@@ -644,7 +644,6 @@ prrtByteCount_t PrrtSocket_get_delivered(PrrtSocket *s) {
return s->receiver->packetTracking->delivered;
};
float PrrtSocket_get_pacing_gain(PrrtSocket *s) {
return BBR_getPacingGain(s->receiver->bbr);
}
......@@ -660,3 +659,6 @@ uint32_t PrrtSocket_get_cycle_index(PrrtSocket *s) {
bool PrrtSocket_get_app_limited(PrrtSocket *s) {
return s->receiver->rateSample->is_app_limited;
}
bool PrrtSocket_get_bbr_round_start(PrrtSocket *s) {
return BBR_getRoundStart(s->receiver->bbr);
}
......@@ -149,6 +149,7 @@ uint32_t PrrtSocket_get_pacing_rate(PrrtSocket *s);
prrtByteCount_t PrrtSocket_get_send_quantum(PrrtSocket *s);
prrtByteCount_t PrrtSocket_get_pipe(PrrtSocket *s);
prrtByteCount_t PrrtSocket_get_delivered(PrrtSocket *s);
bool PrrtSocket_get_bbr_round_start(PrrtSocket *s);
#endif // PRRT_SOCKET_H
......@@ -265,6 +265,12 @@ cdef class PrrtSocket:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_app_limited(self._c_socket)
property bbr_round_start:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_bbr_round_start(self._c_socket)
def recv(self):
cdef char buffer[65536]
cdef int32_t len
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment