From mboxrd@z Thu Jan 1 00:00:00 1970 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 5DC36606A682 for ; Wed, 2 Dec 2026 18:09:06 +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=BKtYFORU Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E21340691; Wed, 2 Dec 2026 19:08:31 +0100 (CET) Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mails.dpdk.org (Postfix) with ESMTPS id 3E7DD402E7 for ; Wed, 2 Dec 2026 19:08:28 +0100 (CET) Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-cde7e8abf9cso5471037a12.0 for ; Wed, 02 Dec 2026 10:08:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1796234907; x=1796839707; 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=BKtYFORU0SbtBCeKd5hCgkhbzIp6WftEMERcCqaIiekoL9agwAulWSqufjc2/dg0Hh h2MezHn9K3ujdoQQxvVZbORn8ANU+q/pw3Nsx6dMrv/73xwSrcWZpvfUQRwymulOh68h 9IlDZQO5KomY0U6SWQwi4KlrWLegQxiPfOPWUv2lsLNN+Cf03RV/xdEHbwesvekBbiKD tza6GrZ3Eot1MIbkjiTCVGTKf6cNE8jc/nCMqj0dZFh4NXhLm8EO0h5brylTyNYdHZL8 7o0P0y8LCLvkrJjkpaD+IOskJvQ50BgmbpFJa4xmOVRBJv+39p2YlX1buCAlxF3f+gbP 5Jcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796234907; x=1796839707; 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=tNCbSxiK2uLIXaWEqDWxEZLTydMNwjsAjnu9YTn/qQt4D6bkVdCjPZ0gJ2E96xNCYn sU3Y4PyDwVJhv6A+HAsPuMxBVQ5UcJr3EnimCQotv1uDyMy4PaZIYC3cd6CVWXnw5bMe j3JLIwiQI5zNkYb5BQMTdrw7gQpurfEo6o7qzRhb5TxV6lBIbqeEI+a+uecj3OVJUggq EkgvyQKoR46tJYFyUVdxqpYl2CVOM3U6x16wfVZfOvElTkHs4svRocGqlF/dZ/WLVEjq DWY9mkgUBQymkC/PAQtG9f+PdxibCPQr6h8KyB+YPgo16XPW9x3kksI/c+UcMaqoPgXd GQOg== X-Gm-Message-State: APuU4Z/qlmTknfcVcJOE83QrcxqqBgBmL4Q+LVkl8QGK8PRupNCWNOLF x2JPgWWHxJLHNwaYvL14lsXSRSz1t6/UEzUZt8RyT2mTVY7AVSTxmA2r5eWHYF8KrtBVNjAF/y6 wYZb/C4c= X-Gm-Gg: AZFdTZcRf4vQqDPqrhrm3rIRgLCazV2gZR0nr6qxjPDGRkrgkQTpJbZegTrhHuQsOBr EVoLJvl1R+cMbiRGvjd/fBrvOHLKSpQ7Z6BR6a0zx6f84RyggOcK3sThQHkOzF+E+WLfU7Hkk4o xqJinmHe4LqcdzikUEy6SD0Nr5eT1XTibZl7aflgF9Rg/OxBag/O5wOMmAmpnMDF7MUET224LZD h4xG/QusqTB/2r3+iU1KJXiaM6ZQDFehZN6xLhp37cXlIg5Nv5nuuApBjIPpZ36UDLt1gglAcF7 /SmkEhFwBIK4jNLDmwTuGcsS61kGqFqqD57K8azlrAojnyvoobVAFkn5WIFJhQY3yOjKK5uErXF wacA1z+fqq634fY+57K1Nlxc9R3Wm3nWF6tITR6KfzMkSGZpCOsiqw8OuZUcE4FM00XvzsFzNP1 n3haEQUVyB++jEZ5PcHBWEDB6KlqDgIKsUXSn2lY9KkXssM9DeJ7gpcxEE8Pb6LJBu+IT2vnJ63 DxhhDBDU85OMwE2VvmPLl0m74HdNOcrYll+rgvdwedc6IZ65RvCLq0rYDtS4X8TSxQvF7ftOptR d0z/Ft8Qqzjvbm6/Dss9cCLXsckXRCnYtpitJigg2LKC1gL+UE6xHfIMGN15HV8BVZ4c X-Received: by 2002:a17:90b:2f8f:b0:3b3:b915:2c03 with SMTP id 98e67ed59e1d1-3b41c92ce36mr42131549a91.31.1796234906659; Wed, 02 Dec 2026 10:08:26 -0800 (PST) Received: from phoenix.lan (204-195-112-43.wavecable.com. [204.195.112.43]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5c7d65000sm214204a91.11.2026.12.02.10.08.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 10:08:26 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org, Anatoly Burakov , Jianfeng Tan Subject: [PATCH v4 5/8] eal: fix IPC request when no handler is registered Date: Wed, 2 Dec 2026 10:07:38 -0800 Message-ID: <20261202180820.4107462-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261202180820.4107462-1-stephen@networkplumber.org> References: <20261028141750.310963-1-stephen@networkplumber.org> <20261202180820.4107462-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