From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3CBEA432E9; Thu, 9 Nov 2023 18:34:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F0B640DF5; Thu, 9 Nov 2023 18:34:27 +0100 (CET) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mails.dpdk.org (Postfix) with ESMTP id 94C454021E for ; Thu, 9 Nov 2023 18:34:25 +0100 (CET) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1cc394f4cdfso9448375ad.0 for ; Thu, 09 Nov 2023 09:34:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1699551264; x=1700156064; 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; bh=dzO7hXbQ2jqdDptnVyq6Ah0zFTtMVblIxZyUbi0KLfM=; b=DQBzfOriKDKIWO0AqfrQr+9nDyplwn1T2CazILniOsyDdXzeDEvmMgoo2Gbzl6BRc2 cBegj4vtVLHv2PkW2Zt7txajImx4gVWIJYqi0ZdNi0jXCQCgrYRvP8w8UkNAsuCnlXW7 7xMDmieQfbzDV3urJGj4vLeXcmOlOUsfgNFydyUqyf/deBzw1l2oQ43IvBR9HKdwXQOa QeM8Qn5Qs1FwD1O3KzrR4q4x1u7YBR55PTGPuzPOyuWHnGXKdCyTqrmuccTbTOThJ30t LQmUL64w5Lnx92CPVuJMD4ucinz49n8bCSW8dgAYoRqdAZDtBCQEgioFoYF4v3RKou1G roew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699551264; x=1700156064; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dzO7hXbQ2jqdDptnVyq6Ah0zFTtMVblIxZyUbi0KLfM=; b=ZI43dyEkdDQLmTScbHJaGbdId5STrvjJ66p7fCfho7NRyU4Xf7dPidLq1jG8+pDurW l5hqltjAYXdAs8sm8T4JhAOwErqi6iQtRqfrJW5bK7rOOu4PMLnsXKScMDbnFVsCOdld Tl65ZCetEaSQtbTitaA1oylASlR5XyYddWXu5d/E/Xf5UtHB97prX1A8C9vh1/RMHSV5 WKP9v7rwxutfMPlkiRRgw8n54SARd2YlEmqJ6wGIQy7bI6xQUaU50PDzD2cKZtBTctyF rKT3j7KxktoGi7Vzjz06daSR/VQno9kgkqR7fIQTDSAsfbB+q/8kfLtRetp60fYT+2As eDoA== X-Gm-Message-State: AOJu0Yw6awKE/DKr5yQMEFgMTLChY/VtNAmE24mb+uEYIGRsv5yhvC8i wWPLNBJycEKeYnAke+8f201GPb3CwEKWcMUwDZU= X-Google-Smtp-Source: AGHT+IE2Y/SYUKW0AaoXzyoEoFqKr9wIfyi4by0cPw0smmAnZ82U1DJAy7kvLlIa3RhByJ33Cqh+PQ== X-Received: by 2002:a17:902:ccca:b0:1ca:7086:f009 with SMTP id z10-20020a170902ccca00b001ca7086f009mr6796291ple.61.1699551264467; Thu, 09 Nov 2023 09:34:24 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id f7-20020a170902ab8700b001c76fcccee8sm3787356plr.156.2023.11.09.09.34.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 09:34:23 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Reshma Pattan , Jianfeng Tan Subject: [PATCH v4 1/5] pdump: fix setting rte_errno on mp error Date: Thu, 9 Nov 2023 09:34:08 -0800 Message-Id: <20231109173412.108093-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231109173412.108093-1-stephen@networkplumber.org> References: <20230921042349.104150-1-stephen@networkplumber.org> <20231109173412.108093-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The response from MP server sets err_value to negative on error. The convention for rte_errno is to use a positive value on error. This makes errors like duplicate registration show up with the correct error value. Fixes: 660098d61f57 ("pdump: use generic multi-process channel") Signed-off-by: Stephen Hemminger Acked-by: Morten Brørup --- lib/pdump/rte_pdump.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c index 80b90c6f7d03..e94f49e21250 100644 --- a/lib/pdump/rte_pdump.c +++ b/lib/pdump/rte_pdump.c @@ -564,9 +564,10 @@ pdump_prepare_client_request(const char *device, uint16_t queue, if (rte_mp_request_sync(&mp_req, &mp_reply, &ts) == 0) { mp_rep = &mp_reply.msgs[0]; resp = (struct pdump_response *)mp_rep->param; - rte_errno = resp->err_value; - if (!resp->err_value) + if (resp->err_value == 0) ret = 0; + else + rte_errno = -resp->err_value; free(mp_reply.msgs); } -- 2.39.2