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 D4693A00BE; Fri, 11 Feb 2022 00:09:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B7CD3411B6; Fri, 11 Feb 2022 00:09:16 +0100 (CET) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id 461D84118A for ; Fri, 11 Feb 2022 00:09:14 +0100 (CET) Received: by mail-pj1-f44.google.com with SMTP id d9-20020a17090a498900b001b8bb1d00e7so7086106pjh.3 for ; Thu, 10 Feb 2022 15:09:14 -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=Fi69yJP2LkZgVtyLqlVcHS9KZ69M6S03JlecoZzEoK8=; b=NBfWlDUt0VL4rhFHaMpwFd7PLLFFVYGUL7k3wD05Vah7g8ICbZIJUatbHptjcyFTjf Q9ifBOA/MjM1NSQOn64cLsvfOKNH0WXhT6vqAZmjj9GuIVAfY05HSVBMOD3biNr1qK4m hHr6p0yIYKARMrI8FODriftO2WRHTGJo3ZM/iM6DUIYqaYMCZwivQxHy+cpHzKKxa6s+ 9eos1f2ASzOvnKhzIGXk4D3N/TKHuwu0zSY7Hd3hjNA5LbhRn2bRy7rwDMS5vGuIWvhx 0G0Wn3mwb/lIvvJet9PwnWhRfbnNdd7SeV0faYQrQG8QwfiEoBZA3O23yPKSinqb6ibt SM8Q== 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=Fi69yJP2LkZgVtyLqlVcHS9KZ69M6S03JlecoZzEoK8=; b=Jlgc6ndOqk+Q9uBH584z8Nh2H5UCUSNc8W5IeTO0DfWuUX606+IFWMAmaOS5nSEqDi xgCRbexOpvPTXXaeh0kqhjqJ+SM3IhBtikXnzsrsGc6uT9Op8tEPKajBPh+LE0baEq86 zwf5MGb5Xc6r6SK31tf2It/txpwLYpzZVwmB1FHjrGSrI0JRJEUIDK5sRZaCKfe3Iarq djP7QcmlmbY6+6Fg0eLxAyNtXWTYTR5nY3nNcS7OTC7HalzllJFmU+IRVWnnTl0SYWFI ohryxWuklmUUaeQLB7gi4PoVFBeiU9u3hIL1+79ZGK7V3s89F3WTriO6wrhs+HXTlgKl aNxQ== X-Gm-Message-State: AOAM531Bl4Y4gMfQJPUMERFbGzPUNhx9PpM3QccSNxpfsjtY4Atws4o4 vXTmCzhVDvg40MP0GWXyYER7OPbRCjR1t5mW X-Google-Smtp-Source: ABdhPJx09TK+ALAMus+ZX3j87UgJ4fRWkDd+o8ek0mcGdz40I8JuysElXq+cZFle79OhQp7RFM+edg== X-Received: by 2002:a17:903:24f:: with SMTP id j15mr9668901plh.16.1644534553139; Thu, 10 Feb 2022 15:09:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 15:09:12 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH 3/3] app/dumpcap: check for failure to set promiscious Date: Thu, 10 Feb 2022 15:09:06 -0800 Message-Id: <20220210230906.833163-4-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 the rte_eth_promiscious_enable() fails, then log the error and continue. Coverity issue: 373662 Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application") Signed-off-by: Stephen Hemminger --- app/dumpcap/main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index c5fe4403028a..21cb2810a48f 100644 --- a/app/dumpcap/main.c +++ b/app/dumpcap/main.c @@ -679,8 +679,13 @@ static void enable_pdump(struct rte_ring *r, struct rte_mempool *mp) flags |= RTE_PDUMP_FLAG_PCAPNG; TAILQ_FOREACH(intf, &interfaces, next) { - if (promiscuous_mode) - rte_eth_promiscuous_enable(intf->port); + if (promiscuous_mode) { + ret = rte_eth_promiscuous_enable(intf->port); + if (ret != 0) + fprintf(stderr, + "port %u set promicious enable faile: %d\n", + intf->port, ret); + } ret = rte_pdump_enable_bpf(intf->port, RTE_PDUMP_ALL_QUEUES, flags, snaplen, -- 2.34.1