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 DCDFF43355; Fri, 17 Nov 2023 17:37:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E8C7402EA; Fri, 17 Nov 2023 17:37:42 +0100 (CET) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mails.dpdk.org (Postfix) with ESMTP id 8ECC040285 for ; Fri, 17 Nov 2023 17:37:41 +0100 (CET) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-6c3363a2b93so2105867b3a.3 for ; Fri, 17 Nov 2023 08:37:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1700239060; x=1700843860; 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=q3urgK3Pm25QrTpl2T7N34pdnrFPqlg7nm7VfucyFPo=; b=L573xhqcIxkgnmYy29F/VpseJNB+MG3WFp+4WKfM9Tga+NNaVJpqBtgITEVikoLd77 00bHoGiJ5U/uuuz8mU7DajrglrkKmATqMtZbTguZi8BnqIgS/aYx2ZWSKmvE+xXW3iDS IwV3naB4XSMTeDvBiJ5X8RryghmNGeHj7qFQxKjJAVbL95dZQBjkMeVFSLh+ANtoqSSS zwDOhKi9dC2nY32tmGiOKJPtADjolj/7e/Uq/ZTO9edDNEpN71EBccwSnzhAE4S6qYZW K2eKNqBd/+5Jc9uDgxrxmimij26qIvKzlORgO/mAEnVQ1E5/6nMDobwBTDcPE+qCfGyz 2edQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700239060; x=1700843860; 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=q3urgK3Pm25QrTpl2T7N34pdnrFPqlg7nm7VfucyFPo=; b=O0KiFzgB0/BkpXcitZUzuXkFaJMKksmGxqXLERIXBfpQlTMtUOatOs63718+K0nPnw K9TnF9snzAMIgB1VxrpFH97wsg40pmrv/YbkLFhIDJcBQ2Ea1//xYMZxbD6aD/jeHVPK nPNqkvnIhNTk/3KbeSvMBaM4Us3+eh4G90drUMIcgmUEsAyhhlb/cDgszsywtZWibdh6 aUbmRoFJ3hUNzUoXB+MDRf/oZXlouWsFSUF8mXYVGcXOoWUMsJXmQCcijxD8/CayWdFM yqvegvvq8jKJJ7rhas8xpUxKWjtBHjKtDvXSAOiXVkZRL86th0S+F1X1eVd9POgboJWm a8ag== X-Gm-Message-State: AOJu0YyyVGmZy6QmsdZ7dLLaXzVMlk/erkjtXQfElaapPNL8scM4/8tc UwMSDn+Z/zCWKKvt0Ury8laPu9iWWEHPCn5x3IRdgw== X-Google-Smtp-Source: AGHT+IFLu0R7VCkq9ghQTK3vvJQmA8197ZC05JeudC6jyNA+Pn+RCWdf2twRf8wkb6qD83uV/fVwCA== X-Received: by 2002:a05:6a20:7293:b0:186:a0d9:4189 with SMTP id o19-20020a056a20729300b00186a0d94189mr17073342pzk.35.1700239060403; Fri, 17 Nov 2023 08:37:40 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id f22-20020a631016000000b005bd3f34b10dsm1595541pgl.24.2023.11.17.08.37.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 08:37:40 -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 v7 1/5] pdump: fix setting rte_errno on mp error Date: Fri, 17 Nov 2023 08:35:55 -0800 Message-ID: <20231117163729.243188-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231117163729.243188-1-stephen@networkplumber.org> References: <20230921042349.104150-1-stephen@networkplumber.org> <20231117163729.243188-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.42.0