TT#78307 don't update RTP stats for non-forwarding ports

Change-Id: I2dc40d7f9a511588c676fe487a23074e0d8129e2
changes/89/39089/3
Richard Fuchs 5 years ago
parent 2e4617ff86
commit 34baba9d22

@ -465,14 +465,14 @@ destroy:
#define DS(x) do { \ #define DS(x) do { \
u_int64_t ks_val, d; \ u_int64_t ks_val; \
ks_val = atomic64_get(&ps->kernel_stats.x); \ ks_val = atomic64_get(&ps->kernel_stats.x); \
if (ke->stats.x < ks_val) \ if (ke->stats.x < ks_val) \
d = 0; \ diff_ ## x = 0; \
else \ else \
d = ke->stats.x - ks_val; \ diff_ ## x = ke->stats.x - ks_val; \
atomic64_add(&ps->stats.x, d); \ atomic64_add(&ps->stats.x, diff_ ## x); \
atomic64_add(&rtpe_statsps.x, d); \ atomic64_add(&rtpe_statsps.x, diff_ ## x); \
} while (0) } while (0)
static void update_requests_per_second_stats(struct requests_ps *request, u_int64_t new_val) { static void update_requests_per_second_stats(struct requests_ps *request, u_int64_t new_val) {
@ -582,6 +582,8 @@ static void call_timer(void *ptr) {
goto next; goto next;
} }
uint64_t diff_packets, diff_bytes, diff_errors;
DS(packets); DS(packets);
DS(bytes); DS(bytes);
DS(errors); DS(errors);
@ -622,7 +624,7 @@ static void call_timer(void *ptr) {
sink = packet_stream_sink(ps); sink = packet_stream_sink(ps);
/* XXX this only works if the kernel module actually gets to see the packets. */ if (!ke->target.non_forwarding && diff_packets) {
if (sink) { if (sink) {
mutex_lock(&sink->out_lock); mutex_lock(&sink->out_lock);
if (sink->crypto.params.crypto_suite && sink->ssrc_out if (sink->crypto.params.crypto_suite && sink->ssrc_out
@ -644,6 +646,7 @@ static void call_timer(void *ptr) {
update = 1; update = 1;
} }
mutex_unlock(&ps->in_lock); mutex_unlock(&ps->in_lock);
}
rwlock_unlock_r(&sfd->call->master_lock); rwlock_unlock_r(&sfd->call->master_lock);

Loading…
Cancel
Save