Attention is currently required from: laforge, neels.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email )
Change subject: per-HNB GTP-U traffic counters via nft ......................................................................
Patch Set 6:
(1 comment)
File src/osmo-hnbgw/nft_kpi.c:
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539/comment/94748393_6ce3a7e9 PS6, Line 86: static __thread struct nft_thread *g_nft_thread = NULL;
Simply have one var per thread, even better when you split stuff into different files. […]
Not exactly imho. __thread is useful when you have N (tons of, unknown) threads spawned which do generic work and use generic code.
This is not really the case here. You have a well known number of threads (2), each having its own specific purpose and hence context. So it's totally fine having 2 global variables instead of having to use TLS every time each of the threads need to access its context.