Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B112606A31A for ; Tue, 1 Dec 2026 19:33:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=s72R7Qdl Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F17B40696; Tue, 1 Dec 2026 20:32:54 +0100 (CET) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by mails.dpdk.org (Postfix) with ESMTPS id 27C8B40656 for ; Tue, 1 Dec 2026 20:32:52 +0100 (CET) Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-cdb1199bfd8so5751382a12.1 for ; Tue, 01 Dec 2026 11:32:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1796153570; x=1796758370; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=LzaR5Up1f3ceCGihO6nNa77ymtVIJAjhBXlzRFkrnt0=; b=s72R7QdlFSW/QF8UFZA+HHBPoM2sNXmOAAJMEkSKCzJEGtp3LQiK5gq3dAzukX0wBU +3y52P759FSLe8vkNTmQxLM4LtdPz8I1EDuX6Cyz7/n2dzcCQIDmMncCazi9fHnBUxp0 XSbi7dGc1Wz81cjEalwrZaVi86ogZ2qNPQpZ0vw185eo86y+A2TkE/G0g+PRkS7ZZq2S xnnYD2cCnKNmAD0VsDO0Zr4Xd5Dq5ovRMEo3rLnCV02Q6tidqLNWFbNSKqoTXiNh/KVb t104RWY9O2eJxpEjvr6L2jOWMhfvpAgxFYCm/M5pGCqIvQaGidNlnfHv3Dql9zrTPbIA FyZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796153570; x=1796758370; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=LzaR5Up1f3ceCGihO6nNa77ymtVIJAjhBXlzRFkrnt0=; b=i3k9PgmMB8i6eoV6+/mVxNx/L7vrhTrzTSNpdJUGp5WgT/2rWTHMEube8UCsBZm3Pw FEi+sdQuQHv/6EtxuJXG2wvvalS7KhC28lxCkbNOhy69De4zsGB1FnD9zr3ifqkOs9XD /lkmk9Zh9Vj8ZreU0c3U7IqXg+E40X4ohmHrRCjufKH/joxWZYS9+SaipbvqmYEvjbQ0 1rdhUXgWw0oP+RubUL3dK44/vUn/DnuCjWh11/4lMPHSVgC+t0MzSokLWMQuNfZsuReo kfH3uUvA4FILJIe5Lqef46Pkp77dpkPiSMbzPI26cKFmGcOjZ7/Dz4vAAqUCTWQnQhuY eQGw== X-Gm-Message-State: APuU4Z/7x3nFPiCBjVQQYhJdFiNnOK9GwdkMs+ZzEBXpr4hdYAPVMGyU Qn4gAc0o+wnP2lqqtw46BTxcky5OcOYNxWjotMxxgi1xm1Pefkllqb9xq0y7KbwRAEcVnsgeHN3 8V+49p5Q= X-Gm-Gg: AZFdTZc3lCwPhuOpDC8nSoNOvI8rVY4UZYSLXPyz/YjX4it/J5H3JhKKgP+O3X83mDz mTmWCptRlnU8/Mz4FpiU/dWrf0c574WBqJ+sbFiychm7znz09mgS7IGmHz3IZnWJUWn/Ek5qe4T dOqhrc/WgpiHhdRZisWJ3GUIjAs/+bs5kVbCnnDokWom0KN+4EOviPH/wr9bZD2Ht5pYX8PWw3y qhEUyonE2W4t8AN/cHmWzGXjWnzaGZ//Uo6ZsdK/x3L+b+ZRzyjNUp1GVSs82mtGl6iyXDodeoS LkkwZWoKLRubmTYHThsYEKGPNnyv5UR57Z2S/lkUCS3EZU9QcMtFCQLUbAce8xXQhDThteCN+9x euYdYfcAIQa/25ONq0A0tRJ5pYma21i+De3nY5BSATsBFaOaX0wtQ3R6Icz4L7UxzrcrzJuc4dv 2hhjkCd3ro/uYNrYMO92uji3KHiAxWCnzGT8zycojsBJqjo1lhojGNr9T+elMd9Ir6Ksf02j6gC HELu15iuibCoDfgGPLKFdHp9aRnjN8D+NFCgkO39nik2N/2MToHd/Yo0RFKHq8sD9qTogNs4l6R tNFiNBdRpsAZ46qYKJj19GlPXJXiz2Vte+79rJ033Qbd51gq8tp+Q1EiyaOK2zu44jWfFQ== X-Received: by 2002:a17:90b:53c6:b0:3b5:834a:e1d6 with SMTP id 98e67ed59e1d1-3b5834ae2eemr8130846a91.63.1796153570391; Tue, 01 Dec 2026 11:32:50 -0800 (PST) Received: from phoenix.lan (204-195-112-43.wavecable.com. [204.195.112.43]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b44b21e19fsm23264700a91.0.2026.12.01.11.32.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 11:32:50 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org, Anatoly Burakov , Jianfeng Tan Subject: [PATCH v3 5/8] eal: fix IPC request when no handler is registered Date: Tue, 1 Dec 2026 11:31:14 -0800 Message-ID: <20261201193243.1008280-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261201193243.1008280-1-stephen@networkplumber.org> References: <20261028141750.310963-1-stephen@networkplumber.org> <20261201193243.1008280-1-stephen@networkplumber.org> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 A process only answers an IPC request if it registered an action for that name. When no action is found the request is dropped silently unless EAL init is still in progress, so the requester waits for the full timeout and then sees ETIMEDOUT. This is what happens when a primary broadcasts a pdump request and any secondary did not call rte_pdump_init() then the primary would wait for timeout on response. The secondary should just respond with MP_IGN. When secondary sends a request to primary that has not registered an action, then the primary needs to respond to secondary with new reply MP_ERR indicating that this action is not supported. A secondary request to a primary that is still initializing now fails with ENOTSUP. Before it got MP_IGN and the request returned success with no replies. Waiting is not an option since there is no way to know whether the primary will ever register that action. The async path counts an MP_ERR as processed so the callback still runs. No in tree user can reach that case today, since the only async requests go from secondary to primary, but rte_mp_request_async is public and dropping the reply would leave its callback pending. Fixes: 579a4ccc345c ("eal: ignore IPC messages until init is complete") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_proc.c | 55 ++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c index b70e9189a4..65dceed1b6 100644 --- a/lib/eal/common/eal_common_proc.c +++ b/lib/eal/common/eal_common_proc.c @@ -32,7 +32,6 @@ #include "eal_memcfg.h" #include "eal_private.h" #include "eal_filesystem.h" -#include "eal_internal_cfg.h" static RTE_ATOMIC(int) mp_fd = -1; static rte_thread_t mp_handle_tid; @@ -58,6 +57,7 @@ enum mp_type { MP_REQ, /* Request for information, Will block for a reply */ MP_REP, /* Response to previously-received request */ MP_IGN, /* Response telling requester to ignore this response */ + MP_ERR, /* Response telling requester that request not handled */ }; /* Message sent from primary EAL to secondary EAL */ @@ -357,25 +357,27 @@ cleanup_msg_fds(const struct rte_mp_msg *msg) static void process_msg(struct mp_msg_internal *m, struct sockaddr_un *s) { - struct pending_request *pending_req; struct action_entry *entry; struct rte_mp_msg *msg = &m->msg; rte_mp_t action = NULL; - const struct internal_config *internal_conf = - eal_get_internal_configuration(); EAL_LOG(DEBUG, "msg: %s", msg->name); - if (m->type == MP_REP || m->type == MP_IGN) { + if (m->type == MP_REP || m->type == MP_IGN || m->type == MP_ERR) { + struct pending_request *pending_req; struct pending_request *req = NULL; pthread_mutex_lock(&pending_requests.lock); pending_req = find_request_by_name(s->sun_path, msg->name); if (pending_req) { memcpy(pending_req->reply, msg, sizeof(*msg)); - /* -1 indicates that we've been asked to ignore */ - pending_req->reply_received = - m->type == MP_REP ? 1 : -1; + + if (m->type == MP_REP) + pending_req->reply_received = 1; + else if (m->type == MP_IGN) + pending_req->reply_received = -1; + else /* MP_ERR */ + pending_req->reply_received = -2; if (pending_req->type == REQUEST_TYPE_SYNC) pthread_cond_signal(&pending_req->sync.cond); @@ -398,18 +400,20 @@ process_msg(struct mp_msg_internal *m, struct sockaddr_un *s) action = entry->action; pthread_mutex_unlock(&mp_mutex_action); - if (!action) { - if (m->type == MP_REQ && !internal_conf->init_complete) { - /* if this is a request, and init is not yet complete, - * and callback wasn't registered, we should tell the - * requester to ignore our existence because we're not - * yet ready to process this request. + if (action == NULL) { + if (m->type == MP_REQ) { + /* + * No handler is registered, either because init is not + * complete or because this process does not use the + * feature. A secondary only gets broadcasts from the + * primary and can ignore them. A primary must tell the + * requester it is unsupported. */ - struct rte_mp_msg dummy; + struct rte_mp_msg dummy = { 0 }; - memset(&dummy, 0, sizeof(dummy)); strlcpy(dummy.name, msg->name, sizeof(dummy.name)); - mp_send(&dummy, s->sun_path, MP_IGN); + mp_send(&dummy, s->sun_path, + rte_eal_process_type() == RTE_PROC_PRIMARY ? MP_ERR : MP_IGN); } else { EAL_LOG(ERR, "Cannot find action: %s", msg->name); @@ -501,6 +505,13 @@ process_async_request(struct pending_request *sr, const struct timespec *now) } else if (sr->reply_received == -1) { /* we were asked to ignore this process */ reply->nb_sent--; + } else if (sr->reply_received == -2) { + /* + * peer has no handler for this request. Count it as + * processed so the callback still runs, but not as + * received since there is no reply to pass up. + */ + param->n_responses_processed++; } else if (timeout) { /* count it as processed response, but don't increment * nb_received. @@ -1019,19 +1030,23 @@ mp_request_sync(const char *dst, struct rte_mp_msg *req, TAILQ_REMOVE(&pending_requests.requests, &pending_req, next); - if (pending_req.reply_received == 0) { + switch (pending_req.reply_received) { + case 0: EAL_LOG(ERR, "Fail to recv reply for request %s:%s", dst, req->name); rte_errno = ETIMEDOUT; return -1; - } - if (pending_req.reply_received == -1) { + case -1: EAL_LOG(DEBUG, "Asked to ignore response"); /* not receiving this message is not an error, so decrement * number of sent messages */ reply->nb_sent--; return 0; + case -2: + EAL_LOG(DEBUG, "Request not supported"); + rte_errno = ENOTSUP; + return -1; } tmp = realloc(reply->msgs, sizeof(msg) * (reply->nb_received + 1)); -- 2.53.0