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 865DEA00BE; Fri, 11 Feb 2022 00:09:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E1D2D41169; Fri, 11 Feb 2022 00:09:13 +0100 (CET) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mails.dpdk.org (Postfix) with ESMTP id CBBD64013F for ; Fri, 11 Feb 2022 00:09:11 +0100 (CET) Received: by mail-pl1-f182.google.com with SMTP id 10so3190426plj.1 for ; Thu, 10 Feb 2022 15:09:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4g03cnWsKmnvSuAS2CELAlmMann/H8Z3gEd+k1j+F/E=; b=CMmHd2p7ymxoQnr3wXoDwHAegXYcCN9UlCg249SA/hSuEF7hJNfoTCWD7p0t4e9CWa qUZBZY6UBUCcYSHiJbR/qKUr+Yibfk3+shlHGSiSlyyiyaMA0FrjrWIZqd6nr8LHWM/N G8UGDs92PHy1PKr/DQTxecoV75tRQXDwIbE3Ncp5yk4Oz0fEFl6wKgkBV1tEcZSjSGdI /1LNHyLSLVxFzVZqewZ5/TRAtQjIUDGySs/TiN3Ket3TRuW+qprvb7YsX8ROEioU6LsN J2/IqeOs81f8Q00HXQSE0TBNjFPyql4KSS83w/7vCjXKZ0+xj0iJMSyIGM5FZfz1iZXz 2voA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4g03cnWsKmnvSuAS2CELAlmMann/H8Z3gEd+k1j+F/E=; b=BNPeaQBDzequNuz56o1+XFhMtcnEUGfXA0y5Amd0kscuy5f5TV5wDRr5mHD9l6GFUH ta7hQsrr1GKCbPNJS3aNQxC0ZUK9lhmsbFGhZhI1bfq8iaZ61NFQ5UBHVdnJ2conbx3B DotZld2p4o+IWVgskjHjYHzvnONSqxe1EDu20XlFpJ8x4I5QwnbO/hZIr49FkFoUdKa0 h7kOpd9aoSSkmzz8yaGHwGZj/hsKK0lKqGd8L+C/qLe9kA98C8XvskfRIgf72CxAJm+G 5QJ4MBJJLS2g6oaXQniCtwOBk3rkYk0TAHvPbYyW2BVVKWmQZ/hb3PxMMiWxN1KRpKlj 9Fig== X-Gm-Message-State: AOAM531MpAmrGHC0qQKoWOBVdPwHW6K7GLPYvIa1z232l73QDYatZG40 5UL/cLF5E4bE39Uo5M9wbfDdoKozv14yO9kW X-Google-Smtp-Source: ABdhPJyIypXvSMq/sdbKuDrJLmmWly0m5EIDBwm3+IWHuBHxnnyFKFy5NjT7MHgXEPA/kMO0G8eaRw== X-Received: by 2002:a17:902:ce88:: with SMTP id f8mr9483198plg.22.1644534550732; Thu, 10 Feb 2022 15:09:10 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id y191sm24924970pfb.114.2022.02.10.15.09.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 15:09:10 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH 1/3] pcapng: handle rte_ethlink_get failing Date: Thu, 10 Feb 2022 15:09:04 -0800 Message-Id: <20220210230906.833163-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220210230906.833163-1-stephen@networkplumber.org> References: <20220210230906.833163-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 If rte_ethlink_get fails, the code can just not add speed to the pcap file. Coverity issue: 373664 Fixes: 8d23ce8f5ee9 ("pcapng: add new library for writing pcapng files") Signed-off-by: Stephen Hemminger --- lib/pcapng/rte_pcapng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c index 03edabe73e96..9db058fe422b 100644 --- a/lib/pcapng/rte_pcapng.c +++ b/lib/pcapng/rte_pcapng.c @@ -177,8 +177,8 @@ pcapng_add_interface(rte_pcapng_t *self, uint16_t port) "%s-%s", dev->bus->name, dev->name); /* DPDK reports in units of Mbps */ - rte_eth_link_get(port, &link); - if (link.link_status == RTE_ETH_LINK_UP) + if (rte_eth_link_get(port, &link) == 0 && + link.link_status == RTE_ETH_LINK_UP) speed = link.link_speed * PCAPNG_MBPS_SPEED; if (rte_eth_macaddr_get(port, &macaddr) < 0) -- 2.34.1