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 312C7432D9; Wed, 8 Nov 2023 19:36:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC38342D80; Wed, 8 Nov 2023 19:36:11 +0100 (CET) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id 52044402A7 for ; Wed, 8 Nov 2023 19:36:10 +0100 (CET) Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-2802b744e52so881652a91.0 for ; Wed, 08 Nov 2023 10:36:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1699468569; x=1700073369; 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=rYJvVipozp0Uok+XahB6RG6LMWbULBCJYi4hvG4xsnU=; b=xnSsfwXvGKezDL7Qt3VUBdJQAk1LNbkw+i+qswUA1h8UHAs4o8bgiKvUSMieBQaawQ AAjF+BMlmOpF1JEjwxjLuyDJ/VfxefEhGuRwh/7cD6wP8X8pU+5OOm46ofzgGiwvrsYe 8ZQcMnfWZK8zkpVfyzxGRn3TVJ4WWZvhFaFxeWDILSpTPhodJz6IUa++wNUiNBzxCKC6 TCMfptYUfMnJAKw7UiPGj/6qLPhcR3dIKyqjG5ZxPx77HxBx6jJPMjXyAs1+XG+bY1po m+2VxxiJVscOPzoZalVSuGkpfGwKRQcPVvfEPKJxMUpf2/nRIH4TlKAqzLKcdGlibRQr 7qkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699468569; x=1700073369; 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=rYJvVipozp0Uok+XahB6RG6LMWbULBCJYi4hvG4xsnU=; b=i7DZ3Asg/uqhLQTlkhoKmlnd+19CpXKaTxeHUoJFDu8bK8Y6uTRJAPuJdQeyA5TcfC gyrLY3e7KAVQwyBrUFH/ld4ZEeLY9a15K3olx/+jytp7NTSDfhUEFoOyz6hmezGNWumS vSs0FztERF6+N+Un7YW7mGNWhXieuZWyBY0Gj6AhWIGp3L5/Nn6kesXTNvW30hdQmWkE eVH8sjRmtWF+jN01F5kjaTO76ZADGqT/TnBMSIVH8EbCIMKlGN8G1tgGq7G+piVy+1Hg iyDE9s08r4oLsQYZAWuwksQe3Yqf50HdxvJ6PaGYcsK8E/Jy4temIEeiC4ztB9dRpWfS +gXQ== X-Gm-Message-State: AOJu0Yy9KtsxR0shgeVxvwG5YfERH7Ny9OcT2FoHg6xBUeNnCwu5gyEe rccVlMvI7UxlfFyXPD8f5aXwcVcEMIQdfz3JxRw= X-Google-Smtp-Source: AGHT+IE2/TFev2ubgp6d8YVJbWVmFGOlkyVpk0WuIWfSide3t4LcYayPtTd/Y49JHaWdAs78cpxiAQ== X-Received: by 2002:a17:90a:7003:b0:280:a4a1:5d03 with SMTP id f3-20020a17090a700300b00280a4a15d03mr9626928pjk.4.1699468568963; Wed, 08 Nov 2023 10:36:08 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id p25-20020a635b19000000b005b944b20f34sm3402522pgb.85.2023.11.08.10.36.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 10:36:08 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v3 1/5] pdump: fix setting rte_errno on mp error Date: Wed, 8 Nov 2023 10:35:53 -0800 Message-Id: <20231108183557.381955-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231108183557.381955-1-stephen@networkplumber.org> References: <20230921042349.104150-1-stephen@networkplumber.org> <20231108183557.381955-1-stephen@networkplumber.org> 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-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 --- 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