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 38FC543B6F; Thu, 7 Mar 2024 23:39:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 07251402A3; Thu, 7 Mar 2024 23:39:04 +0100 (CET) Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) by mails.dpdk.org (Postfix) with ESMTP id 3AAF940284 for ; Thu, 7 Mar 2024 23:39:02 +0100 (CET) Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-5d8ddbac4fbso1160189a12.0 for ; Thu, 07 Mar 2024 14:39:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709851141; x=1710455941; 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=ZcUhWOMpDH+tJl5rXHlR6rUeNZm5ZeO4aM5GOrYzprY=; b=lLaU5OG/TR7BrEBHIaK3AiBdP1SnGGCQSztXZt2snAAzNYv1cn3AUMn3/3QBshFXIC zbMsrlDaglMd1t2zQfBqoKaCnuMExs3nhkfbc9epvVh69mMorWNb71IFslJwLKLp+1gX ld62gv0fzM4pG1ex4N4j3js88nm5vNU90mfumD1PeoKoycHVNy6qNp+9HJ2dgGq/uALF TAh000qlhfG9qrfDe+FT1bBwC51OJVHIuZgmbWJR1/H5uZswnJL6wQo4qcD1JuNr3uWP R8kXThGxapJvUf3XB9JUNEfOuI/SJ1kicz39OTEeBXsuAh4WS/82IeD7KK9AV7EFxsUb Npcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709851141; x=1710455941; 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=ZcUhWOMpDH+tJl5rXHlR6rUeNZm5ZeO4aM5GOrYzprY=; b=vb1cup/PuTVcq4ks04ZNh9gEyHqZAINt319L0i2HwDNrSO2i9S9Lk6IGP3aKEEnz45 11ORkFUqVxydDmA+a5eAeSLhz5OBLf2mns8dGYpli7lqjQ1j8jdui1+FrkGvZ4n88vgz xjIK1lARGCeBjSbx3oz6FvZvLPOxcXOv0+acLpSeNQl4OiHId2oX0ji0Ixi6nMTfCTV/ OyV/YBv4Uzl0vInRCo9dB6DxuV1Pezx1d2XQQ0HhxFbnv6qg8M5AYbYNjLje7YCcxGhR ynkWPbTc1VcSe9fx4QuONyk/bxM8RrBvGeZLiZQRD+z3LEwYtmkP0YURhfNRcox37fUP mW1Q== X-Gm-Message-State: AOJu0YyylgF/qNH56lVlKLRpIC29Se5kVe0zGig3KGo3cKLscv0lHtLc DMLnKgbYyBahDtayxS4J0fyegJAvpeSjScvHVXX9Hb4YacreT36Ur8794IAZ0TsBUEyPPZxGoxT d3Ks= X-Google-Smtp-Source: AGHT+IHi3XhN08NqIKTFZMLTuzpBAVDmu4ARiIOEdjiXCh432C/uKPBETq+uX03lK5DuVHgOmN2JbA== X-Received: by 2002:a17:903:2a85:b0:1dd:6420:847d with SMTP id lv5-20020a1709032a8500b001dd6420847dmr1486493plb.2.1709851141141; Thu, 07 Mar 2024 14:39:01 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id km12-20020a17090327cc00b001db83d42322sm15166796plb.185.2024.03.07.14.39.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 14:39:00 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Isaac Boukris , Stephen Hemminger Subject: [PATCH v2] dumpcap: correctly disable promiscuous mode at exit Date: Thu, 7 Mar 2024 14:37:59 -0800 Message-ID: <20240307223851.5786-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240227092326.340229-1-iboukris@gmail.com> References: <20240227092326.340229-1-iboukris@gmail.com> 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 From: Isaac Boukris If request to set promiscious mode failed at startup, then it is not necessary to disable it when shutting down. This should only be issue if with a buggy driver because if driver does not support setting promiscious it would just ignore request to disable it as well. Fixes: 6026bfae07d4 ("app/dumpcap: support multiple interfaces") Signed-off-by: Isaac Boukris Signed-off-by: Stephen Hemminger --- v2 - add more to commit log, and simplify the logic app/dumpcap/main.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index 76c747511444..11e470391edb 100644 --- a/app/dumpcap/main.c +++ b/app/dumpcap/main.c @@ -828,12 +828,9 @@ static void enable_pdump(struct rte_ring *r, struct rte_mempool *mp) if (rte_eth_promiscuous_get(intf->port) == 1) { /* promiscuous already enabled */ intf->opts.promisc_mode = false; - } else { - ret = rte_eth_promiscuous_enable(intf->port); - if (ret != 0) - fprintf(stderr, - "port %u set promiscuous enable failed: %d\n", - intf->port, ret); + } else if (rte_eth_promiscuous_enable(intf->port) < 0) { + fprintf(stderr, "port %u:%s set promiscuous failed\n", + intf->port, intf->name); intf->opts.promisc_mode = false; } } -- 2.43.0