Attention is currently required from: arehbein, laforge, pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/31533 )
Change subject: common: Have PCU socket connection use osmo_wqueue ......................................................................
Patch Set 6: Code-Review-1
(3 comments)
File src/common/pcu_sock.c:
https://gerrit.osmocom.org/c/osmo-bts/+/31533/comment/e28d7635_9bd0d65c PS6, Line 990: pcu_sock_close(state);
I think you need to free msgb in this code path. […]
Indeed, the API doc clearly states:
\returns 0 on success; negative on error (MESSAGE NOT FREED IN CASE OF ERROR)
so pespin is right here, please add `msgb_free(msg)`.
https://gerrit.osmocom.org/c/osmo-bts/+/31533/comment/f1a8cf00_cb863ff4 PS6, Line 1093: struct msgb *m I would keep the usual naming, i.e. `msg`. Not critical, but this way the patch/diff is easier to read.
https://gerrit.osmocom.org/c/osmo-bts/+/31533/comment/13779f69_adf0eef9 PS6, Line 1106: rc = osmo_wqueue_enqueue(&state->upqueue, m);
You mean at the beginning of the queue?
Yes, this is likely what pespin meant. When this callback is called, it gets a msgb from the head (beginning) of the queue. But here you're putting it back at the tail, changing the ordering.
Take a look at the `osmo_wqueue_bfd_cb()` in libosmocore.git. You don't really need to enqueue the msgb back yourself, just return `-EAGAIN` and the calling function will enqueue it back for you.