On 5/28/2026 4:24 PM, Thomas Monjalon wrote:
Hello Anatoly,
19/03/2026 17:07, Anatoly Burakov:
Use a numeric request ID for alarm callback lookup so stale callbacks
from rolled-back requests become harmless no-ops.
It seems you forgot to convert 2 calls to rte_eal_alarm_set().
[...]
struct pending_request {
TAILQ_ENTRY(pending_request) next;
+ unsigned long id;
[...]
+static struct pending_request *
+find_pending_request_by_id(unsigned long id)
+{
+ struct pending_request *r;
+
+ TAILQ_FOREACH(r, &pending_requests.requests, next) {
+ if (r->id == id)
+ return r;
+ }
+
+ return NULL;
+}
[...]
async_reply_handle(void *arg)
{
struct pending_request *req;
+ /* alarm arg carries the request ID packed into a void * via uintptr_t
*/
No, that's wrong.
The pointer passed in some rte_eal_alarm_set() from patch 2
is a struct pending_request.
+ unsigned long id = (uintptr_t)arg;
Either you get the id field from arg,
or you pass dummy->id to rte_eal_alarm_set().
The intent was to do the latter, good catch. Thanks!
pthread_mutex_lock(&pending_requests.lock);
- req = async_reply_handle_thread_unsafe(arg);
+ req = find_pending_request_by_id(id);
+ if (req != NULL)
+ req = async_reply_handle_thread_unsafe(req);
pthread_mutex_unlock(&pending_requests.lock);
--
Thanks,
Anatoly