pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcap/+/39949?usp=email )
Change subject: client: Process up to 10 recorded pkts per poll iteration ......................................................................
client: Process up to 10 recorded pkts per poll iteration
This should decrease CPU use of lipcap capturing under high capturing load, which is welcome now that we support osmo_io with io-uring backend on the Tx side towards osmo-pcap-server.
The processing number is kept low in order to avoid starving the event loop, as well as avoid filling up the msgb queue of the Tx side towards osmo-pcap-server.
Related: SYS#7290 Change-Id: I569fc8489bae2b829ef4040d3c5111a61129de68 --- M src/osmo_client_core.c 1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/49/39949/1
diff --git a/src/osmo_client_core.c b/src/osmo_client_core.c index 5ded001..11236bf 100644 --- a/src/osmo_client_core.c +++ b/src/osmo_client_core.c @@ -175,7 +175,9 @@ struct osmo_pcap_handle *ph = fd->data; int rc;
- rc = pcap_dispatch(ph->handle, 1, pcap_read_one_cb, (u_char *)ph); + /* Read up to 10 packets at once, to avoid starving the event loop and + * filling up transmit queue towards peer. */ + rc = pcap_dispatch(ph->handle, 10, pcap_read_one_cb, (u_char *)ph); if (rc < 0) { rate_ctr_inc2(ph->ctrg, PH_CTR_PERR); rate_ctr_inc2(ph->client->ctrg, CLIENT_CTR_PERR);