Thread (10 messages) flat view 10 messages, 3 authors, 2021-10-13

Re: [PATCH net-next 3/4] gen_stats: Add instead Set the value in __gnet_stats_copy_queue().

From: Jakub Kicinski <kuba@kernel.org>
Date: 2021-10-08 23:38:54

On Thu,  7 Oct 2021 19:49:59 +0200 Sebastian Andrzej Siewior wrote:
quoted hunk ↗ jump to hunk
--- a/net/core/gen_stats.c
+++ b/net/core/gen_stats.c
@@ -312,14 +312,14 @@ void __gnet_stats_copy_queue(struct gnet_stats_queue *qstats,
 	if (cpu) {
 		__gnet_stats_copy_queue_cpu(qstats, cpu);
 	} else {
-		qstats->qlen = q->qlen;
-		qstats->backlog = q->backlog;
-		qstats->drops = q->drops;
-		qstats->requeues = q->requeues;
-		qstats->overlimits = q->overlimits;
+		qstats->qlen += q->qlen;
+		qstats->backlog += q->backlog;
+		qstats->drops += q->drops;
+		qstats->requeues += q->requeues;
+		qstats->overlimits += q->overlimits;
 	}
 
-	qstats->qlen = qlen;
+	qstats->qlen += qlen;
Looks like qlen is going to be added twice for the non-per-cpu case?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help