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 A278F43BDF; Fri, 8 Mar 2024 08:10:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3C79340298; Fri, 8 Mar 2024 08:10:03 +0100 (CET) Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by mails.dpdk.org (Postfix) with ESMTP id C374F40274 for ; Fri, 8 Mar 2024 08:10:01 +0100 (CET) Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-5ce9555d42eso1342123a12.2 for ; Thu, 07 Mar 2024 23:10:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709881801; x=1710486601; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=RTNTVaU79OhkvApDFMPff6wJoUOHlJ42AL61XDe7K58=; b=BLRfpGBNEDALeUXUeqpvyXL50nVwX5YOAzE4o4awvQwO+VU7D9twwpGRo+iwBqM6F6 VkhYvVEkDx8AXkGzQtDuljmo84cbuGtlEAOTtNNOi+tfC5j1N5sXM0WyMykPBMtmklka kL2n0kQ84ncucP9n8ugYgVBpwFwHdwQQqrKxn0xKJnEL8gHFoaot95JAAZ4R2IVnlz2S DhCLWTahE8ZyNOsIByD1tHnORt3liAZ1ppG7SNNlJRZNjZZf/ukNmwQZmlpeTVxggBcK x+5zptmam6ojF7WZr2JHhYCNjfs5LgFd+EzxPFfKf5tnOhzNJTWRgXrZ3YBANhmfH8sQ ch3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709881801; x=1710486601; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RTNTVaU79OhkvApDFMPff6wJoUOHlJ42AL61XDe7K58=; b=nWNJYCnL9zjADehFlTPJ37xUiaqKKl6JkuW8bhMFmOa+y0i/gxvTEXde0nX31tNr8m KeEflzYeqwLBJIVcnqtCkIzOWDaXgJmgNmp4/fHUSM9WVzUeiPRzhwHoNsKSnbxhsmF6 5bs0srnxwxnSFzuag/SR2HcgeaejMFKcDrN+GOBeNxX4Ylt/1oZhgWEEnO5kPuUpY5rW JXIKaDv+7gL4WevdJ7/W8vLzg/qTQoOqC36ppwCgu+9yJpUE6Qd2xUXEu2t4BwKBDesH MXgsiyylsnAZRd0hpl3xV+rmRMs3eR2CvQ7HoeM60WnjtdjtbatwkaucTiVb/2cZCr+b Rmww== X-Gm-Message-State: AOJu0Yyp039LTAgwB9GBDSxJGn7KByt0tZH/l2kYHU4p5DX9lXQwJ7Fn by0pJxZpb0xr9Ce/gy4azDUburthAwmH/ss97jU85x2RMKL2mAeh+us7niisbsXm8NaQ8Obibiv 6uJWF/7iSu0eB+jRAf380NkzjYIM= X-Google-Smtp-Source: AGHT+IHa7/97A85vWOZXTMEpLkai4OjUmssuiEBusre89R0HZBHSm3lKceSUPTHF1SuPdClLWEhRj9zJ6398xRi8FAw= X-Received: by 2002:a17:90a:ce14:b0:29b:ad3e:8eb6 with SMTP id f20-20020a17090ace1400b0029bad3e8eb6mr1534539pju.30.1709881800768; Thu, 07 Mar 2024 23:10:00 -0800 (PST) MIME-Version: 1.0 References: <20240227092326.340229-1-iboukris@gmail.com> <20240307223851.5786-1-stephen@networkplumber.org> In-Reply-To: <20240307223851.5786-1-stephen@networkplumber.org> From: Isaac Boukris Date: Fri, 8 Mar 2024 09:09:49 +0200 Message-ID: Subject: Re: [PATCH v2] dumpcap: correctly disable promiscuous mode at exit To: Stephen Hemminger Cc: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Fri, Mar 8, 2024 at 12:39=E2=80=AFAM Stephen Hemminger wrote: > > 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) =3D=3D 1)= { > /* promiscuous already enabled */ > intf->opts.promisc_mode =3D false; > - } else { > - ret =3D rte_eth_promiscuous_enable(intf->= port); > - if (ret !=3D 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 promiscuo= us failed\n", > + intf->port, intf->name); > intf->opts.promisc_mode =3D false; > } > } > -- > 2.43.0 > V2 looks good to me. Thanks!