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 CA22845AAF; Fri, 4 Oct 2024 18:25:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B48D942E5D; Fri, 4 Oct 2024 18:24:36 +0200 (CEST) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mails.dpdk.org (Postfix) with ESMTP id 00AD442DE3 for ; Fri, 4 Oct 2024 18:24:31 +0200 (CEST) Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-71ddb6199c4so1432530b3a.0 for ; Fri, 04 Oct 2024 09:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1728059071; x=1728663871; 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=O7sGRX5SJh9EfSceZLmib7rj2B471vwcHVz9A4Mktxs=; b=VPkGJkZoSmaZ0flGhQSmsItAMYVVLCMyxUIayJUIwyLKB5po+JIRiib+gLU7YyrVj8 z+BxnLoOsvKWyK38lbBEWUFgNaaifyZ9py26OSnK5kenJxx90Ezr2y+Rd6yjMwTz1Oin P9ih08D7TfxQ4xn/Mj5ZUQmFy87X3bck5/7cx964Fh7qk+0rmsLzIDikquwPXzmr936E BAXDyx4zBh1DLorZ+rJ7aTXKqY2qef9ul1drRLY1lswY7Lc/4H8UQPlQioOQCbOQKvkz wwtr1LbvSQCBZA7EAdyFZCgtxfiLsatXHD9xYsSJAx/7BDNWiTGwju2F9lf0RqbmwL9k uwtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728059071; x=1728663871; 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=O7sGRX5SJh9EfSceZLmib7rj2B471vwcHVz9A4Mktxs=; b=fMlsRFEtHGKoTNFkg++3ka0eNgxsbCReaqZ5m5+Qh1OnE7jqdNbLZAos1Ka2n6si4D LTLdBkocIoUb0Ujgk4d5ps+N8gOzwsfLA6pjp11JHQgXTNBfBXAVyMjb20xib6TB9A/u 2X7uQSBG0MnApWpCuxt5anH9RJDC8I2DLw3H2jKi3kiD2GH4ulHvV6SDfZ/GkHh3ewqR UR7X18XL1i3UNGbGDzMqepRWImnhnumZeaMJ1OkjAKkHWvfvfGKsxJJS16wTKII5ik5O 3UC15lpts3Y5DViw30f3RVUZKuzFhydvNWSBK8eQjrwlLzHWsJzhWG42x6G8+/S5w9+C OtHg== X-Gm-Message-State: AOJu0YxBBUE4ffzxDoGwzL122B8wB+ybzHQScLUZ85hA2Vhqup8Mtnpw 15vXpZw0tMWsBnAgcUy9mtV/VH7kc5p/CPdisQQE/SJHEXwVWViOhDzWRPVd0tp9DT7Gol0Y2Pu NbdKk3g== X-Google-Smtp-Source: AGHT+IEDLM/IqeKXxkCJJ6lqnkParjj0W0hrBKWT2FCGj4qCTt12cbvxphfwEEOPbs13RiE/0VGG6Q== X-Received: by 2002:a05:6a00:21c8:b0:717:839c:6838 with SMTP id d2e1a72fcca58-71de23e8c92mr4615240b3a.14.1728059071146; Fri, 04 Oct 2024 09:24:31 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e9f680d7a1sm139231a12.19.2024.10.04.09.24.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 09:24:30 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Sunil Kumar Kori , Rakesh Kudurumalla Subject: [PATCH 03/10] graph: check return value from rte_eth_dev_info_get Date: Fri, 4 Oct 2024 09:21:50 -0700 Message-ID: <20241004162418.52940-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241004162418.52940-1-stephen@networkplumber.org> References: <20241004162418.52940-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 data in rte_eth_dev_info is undefined if rte_eth_dev_info_get returns an error. Handle the errors the same as previous error. Signed-off-by: Stephen Hemminger --- app/graph/ethdev.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/app/graph/ethdev.c b/app/graph/ethdev.c index cfc1b18569..b8ddf21938 100644 --- a/app/graph/ethdev.c +++ b/app/graph/ethdev.c @@ -219,10 +219,22 @@ ethdev_show(const char *name) if (rc < 0) return rc; - rte_eth_dev_info_get(port_id, &info); - rte_eth_stats_get(port_id, &stats); - rte_eth_macaddr_get(port_id, &addr); - rte_eth_link_get(port_id, &link); + rc = rte_eth_dev_info_get(port_id, &info); + if (rc < 0) + return rc; + + rc = rte_eth_link_get(port_id, &link); + if (rc < 0) + return rc; + + rc = rte_eth_stats_get(port_id, &stats); + if (rc < 0) + return rc; + + rc = rte_eth_macaddr_get(port_id, &addr); + if (rc < 0) + return rc; + rte_eth_dev_get_mtu(port_id, &mtu); length = strlen(conn->msg_out); -- 2.45.2