18 Feb
2025
18 Feb
'25
4:30 p.m.
On Tue, 18 Feb 2025 13:50:13 +1100
David Gibson
head_cnt is a global variable which tracks how many entries in head[] are currently used. The fact that it's global obscures the fact that the lifetime over which it has a meaningful value is quite short: a single call to of tcp_vu_data_from_sock().
Make it a local to tcp_vu_data_from_sock() to make that lifetime clearer. We keep the head[] array global for now - although technically it has the same valid lifetime - because it's large enough we might not want to put it on the stack.
Cc: Laurent Vivier
Signed-off-by: David Gibson
Applied. -- Stefano