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 271494331C; Mon, 13 Nov 2023 17:15:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 019EA406B8; Mon, 13 Nov 2023 17:15:34 +0100 (CET) Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by mails.dpdk.org (Postfix) with ESMTP id 6FC8E402D6 for ; Mon, 13 Nov 2023 17:15:32 +0100 (CET) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6b5cac99cfdso3844701b3a.2 for ; Mon, 13 Nov 2023 08:15:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1699892131; x=1700496931; 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=vW5fzK+VqQrHtqjkYwyPj2ZYxpx8ugJtJAQDtF2a9kmsA6tgNyTcWbMoX3M84x2AZT UdptE53o8SGINoAxgCLxSDPfFp7k7sWc7JeY1ndWziFxSsdNVobIXLBogv0Xzc0i4JJN XW6lsGlBTZLBLz/UDhra5dvWQ50k/4Mi27/Ddfwf1RABROA09KnydapZxKOjSO1rNoJe XTk/8fH2/whTn1Cg962tIWQd96XmUQ9cGzydjprfKWcOspSla8UWMMYAjykKTMHP6H+j neITSACdm4qdWGswEb0ccd6b/Nad78DPMQMOHHOUY5CAl0OTw/m+mSF5xh1QXF1XWo1n eTKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699892131; x=1700496931; 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=hMGAM/fuhhIY9Ux6YBf6WzmexvjHzCAW9GVm70r4qCnWufUCWZXjDRujKKsbRtPZZN h9KIuZWwysQmO9kQpydCkPKApnxaOuEkp2KFXtEa7Q3pEw8kyA3eKs5PTAgRxWR7omSy RGGIT0YMTSuVE2D+1pyBSAmYQoH0jv6KIfrPg19a3G9EkyvAAdhryIVPGTeMnfgb6EUk eE67pRYDMFJj5vzvT0U2jMeG8FIAJpyUw3IGZRm+Qh5gCOf5RcaShrGKaCKLFKnLgLIm P63nS84Igt3m86AGswCaP4rPHbhjrOYpNoKd4WPi84JVNPCTyU42ywvsC9IZ9MoW0sfZ KIKg== X-Gm-Message-State: AOJu0Ywg0rdmIuy2Li+KsOvw2kDIEIGmQUGmYgEGT3aZWDsfberhrzMK 9MlkeNh+0ZMDWDzDTEmc6ufBxLATOUhYmzN4o0U= X-Google-Smtp-Source: AGHT+IGGNBTL1iXqhrB4BnTYF8JF4GE7J0rAnO7yWMcu+3+S7iGHyhVW6Gn/e4syrYLKIm7sF3VsOQ== X-Received: by 2002:a05:6a00:b1d:b0:6c3:6cdc:a297 with SMTP id f29-20020a056a000b1d00b006c36cdca297mr4514094pfu.14.1699892131070; Mon, 13 Nov 2023 08:15:31 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id hq11-20020a056a00680b00b006c69bbf03e2sm3350043pfb.192.2023.11.13.08.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 08:15:30 -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 v6 1/5] pdump: fix setting rte_errno on mp error Date: Mon, 13 Nov 2023 08:15:15 -0800 Message-Id: <20231113161519.242272-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231113161519.242272-1-stephen@networkplumber.org> References: <20230921042349.104150-1-stephen@networkplumber.org> <20231113161519.242272-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