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 D6005426C7; Fri, 6 Oct 2023 01:07:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1832F402DB; Fri, 6 Oct 2023 01:07:02 +0200 (CEST) Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by mails.dpdk.org (Postfix) with ESMTP id C19B4402A8 for ; Fri, 6 Oct 2023 01:07:00 +0200 (CEST) Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-690bc3f82a7so1361384b3a.0 for ; Thu, 05 Oct 2023 16:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1696547220; x=1697152020; 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=LsawYgUPNSz8KCXOkCvRdkh/dufEOeHsF/JSonH5eXU=; b=OSkEOhv6hvoRKPj8hJOTiqSo0VECbGFVae5xYwBZCXIR6CcmoRBNFX6H+P7NLnwQSw iL/3QGHaSPNShIXHo1RFhj+q89FjPHyV7/b+t64wG8XWiQ59THUfVz24CHlgF8eVd5mc 0B2NE+gSXy2mADYcmjnZCGnCHAb2ZTV1beYTZgYe94AXkqiTVd9m3iGakB07a6mZQe2y yF7wOP9lYMO4gwg3menZLU6ygJeo9GGjoYFd/89EWRbASvlx0319HDE1RdKWBANwtlXN neVZdEI4BqdZaVhVGzy6PlMAvdVJcEiR1Wn4YtzlvblJoj/Sptud7lOHG9+vPsvM4MRl 2tOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696547220; x=1697152020; 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=LsawYgUPNSz8KCXOkCvRdkh/dufEOeHsF/JSonH5eXU=; b=hi6QirIjdoHPm3n9FFreoi4OrhV0dKQUBZ98lM/O7qEFUTSV7LlRIwjPLypLLOUB1X SfWI/HeVMevik3+RXfozUJZAGn3DunbBAHymanmy+FOWNA00+8xSNFM9iXuC3+MlR6N/ 8Hyg8J0w8fmGENSbL6j5ldadzGihxFVv+oOr2h3Yw8uVmmOuUYVm5rp2ERwziZ1j+AHv 4obGX3ahD8HakZWGARMFYA/0RkCInu8liN983ugRHsUvxwrx8cS7pwvMe/GZw6OhvP8c vKnPewP2uUjeXPgd+9kTfsraI3y6dJgLQDh1L0O6dhnFWksXhBMO7vEOV0nfrByB5c3P /eKw== X-Gm-Message-State: AOJu0YwCNcSlDBGYiMvJZUrHKEtRWnVXqENARSzub0hnML938aR35CJW /R3N8ZCLkAb6DXM+YMQAmCiW+UlCVHKpG28FR2I= X-Google-Smtp-Source: AGHT+IEgqUUMQnwjk1+BBa5+ifeF/8sgsiZoHRNcXIpbT+fibW05/P3DOQ4Iyvy6vICSMn95uhJvWQ== X-Received: by 2002:a05:6a00:b84:b0:68f:ccea:8e14 with SMTP id g4-20020a056a000b8400b0068fccea8e14mr7647678pfj.32.1696547219609; Thu, 05 Oct 2023 16:06:59 -0700 (PDT) Received: from hermes.local (204-195-126-68.wavecable.com. [204.195.126.68]) by smtp.gmail.com with ESMTPSA id d13-20020aa7814d000000b00690cd981652sm112665pfn.61.2023.10.05.16.06.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 16:06:58 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Reshma Pattan , Jianfeng Tan Subject: [PATCH v2 1/4] pdump: fix setting rte_errno on mp error Date: Thu, 5 Oct 2023 16:06:45 -0700 Message-Id: <20231005230648.68244-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231005230648.68244-1-stephen@networkplumber.org> References: <20230921042349.104150-1-stephen@networkplumber.org> <20231005230648.68244-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 53cca1034d41..a70085bd0211 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