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 E974E42602; Thu, 21 Sep 2023 06:24:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 532E1402DD; Thu, 21 Sep 2023 06:24:05 +0200 (CEST) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by mails.dpdk.org (Postfix) with ESMTP id 9116B4014F for ; Thu, 21 Sep 2023 06:24:02 +0200 (CEST) Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-691c05bc5aaso149298b3a.2 for ; Wed, 20 Sep 2023 21:24:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1695270241; x=1695875041; 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=oHXNGT1Xz5BwInAX08J6fOlHw5b0ti34RS11BsWPymrguO9WZ7zRUnhI3wWYCUU0qt FPX8b65rNcmvHOpHbGLCQyOJTwLU3nHE1H/d5MajnRLL7TaQJg0H2EZQPceOVleRmHEV cYJnmfxf+FMDhIoP5VrQp5xhXFVNWwccR12sQq4v4zh4Kvs7l0/n20QqnMBIam6soXkZ cM/LTFTsi8cr0tvEetKE8vaw+e8cpqYRJlrJWs8sz4QSipB7CzEzolhiYxPrDJNg8VGB L1nZlSN1AXYvkVXGlWoAV9ibOy8qiJbZtWABsUR1VCEVPifqMAVevkW57IDv+IXTQNpk edOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695270241; x=1695875041; 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=ApkyInYlUHgoZ8wl8JU2lJPi1moHiKAFITkfcFg6z+eWHiiebHM75Qb3BmZDTQvRXt IR3139vKaRx8o6jncXmPBd05vhnSojIEncqs4FzMfc2Cx1cUdE1nqkL79NObDYsxnWm4 DQlKWG3AeCBITigCV1tR72r+9qzx5DyQhQBV+IvABoGjdA9QpbKK61yhNMlvczzrxywN uy7LiNIoiKBDUj2r/sARC53qLkWYfNew/aYFoOKthtXLTQ348q3i91CxzaLKaVQgavWF 7ko5YsuC1d2AbSByxZoCER5DMO0FI8C5YuEVWrh7qd+V/2WBUczC0gPb1HA8goZHaU8j zvmQ== X-Gm-Message-State: AOJu0YzAh4PQclc4XjGmuIg10QHtuy5USw/gVjOuSnaeKLNdMZBVxtET HNuR62ZURdGyVVAy6fUzepMoI9lrcTWzveugVhM= X-Google-Smtp-Source: AGHT+IEIizz1mhZ0/128MZBtPPGAx6fi389FJ7slcJq4TaMDpywsk3KZhmXPSRx3GeMs1CHhbgxW5w== X-Received: by 2002:a05:6a21:3399:b0:145:47af:57d8 with SMTP id yy25-20020a056a21339900b0014547af57d8mr5068803pzb.2.1695270241257; Wed, 20 Sep 2023 21:24:01 -0700 (PDT) Received: from hermes.local (204-195-112-131.wavecable.com. [204.195.112.131]) by smtp.gmail.com with ESMTPSA id u5-20020aa78485000000b00690d1269691sm311946pfn.22.2023.09.20.21.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 21:24:00 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Reshma Pattan , Jianfeng Tan Subject: [PATCH 1/4] pdump: fix setting rte_errno on mp error Date: Wed, 20 Sep 2023 21:23:46 -0700 Message-Id: <20230921042349.104150-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230921042349.104150-1-stephen@networkplumber.org> References: <20230921042349.104150-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