|
|
|
@ -118,8 +118,8 @@ void etcp_loadbalancer_send(struct ETCP_DGRAM* dgram) { |
|
|
|
DEBUG_TRACE(DEBUG_CATEGORY_ETCP, "[%s] unlimited bandwidth, skipping shaper update", etcp->log_name); |
|
|
|
DEBUG_TRACE(DEBUG_CATEGORY_ETCP, "[%s] unlimited bandwidth, skipping shaper update", etcp->log_name); |
|
|
|
// Don't return here, let the function continue to free dgram at the end
|
|
|
|
// Don't return here, let the function continue to free dgram at the end
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// Time to transmit (ns per byte = 8e9 / bw for bits/sec)
|
|
|
|
// Time to transmit (ns per byte = 8e6 / bw for Kbits/sec)
|
|
|
|
double byte_time_ns = 8000000000.0 / (double)link->bandwidth; |
|
|
|
double byte_time_ns = 8000000.0 / (double)link->bandwidth; |
|
|
|
uint64_t tx_time_ns = (uint64_t)(pkt_size * byte_time_ns + 0.5); // Round nearest
|
|
|
|
uint64_t tx_time_ns = (uint64_t)(pkt_size * byte_time_ns + 0.5); // Round nearest
|
|
|
|
|
|
|
|
|
|
|
|
// To sub_nanotime (*10 for 0.1ns)
|
|
|
|
// To sub_nanotime (*10 for 0.1ns)
|
|
|
|
|