From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id D19E3A0540;
	Wed,  6 Jul 2022 11:50:04 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id C3D1540A7F;
	Wed,  6 Jul 2022 11:50:04 +0200 (CEST)
Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com
 [209.85.208.50]) by mails.dpdk.org (Postfix) with ESMTP id 4163540691
 for <dev@dpdk.org>; Wed,  6 Jul 2022 11:50:03 +0200 (CEST)
Received: by mail-ed1-f50.google.com with SMTP id fd6so18557348edb.5
 for <dev@dpdk.org>; Wed, 06 Jul 2022 02:50:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=emumba-com.20210112.gappssmtp.com; s=20210112;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=gvhh5hK0zCfyZzB9iJj1/jD6U2QamS86/Ekz9ttN7KE=;
 b=a6IfAUvNqErwg/tIH4//30w6IVDAI8epCqWmeIeDft/ZRJYm0NvZLZ0O4W0k8coAU9
 evGJfPoR5EUHNfmXo69RnNxxdqSAv0oz4Ob/zC3NbJ5e8jiqi4IwATL/CaZundQL9gE8
 XyaQY8TksQxSMVbCQsIb5jdEvRzlt3stOZHKmxaCdfHnR5bVVL5n+0PzdrTBVX2LwXbR
 tgGqrS6jn4Qfm6qep7x240FlzEZWTUEoRv3YraCv1+dCGQFCMW2SjySUPOBz8nmvFCEa
 KkH3UJ6oqMH4tEMoQ9/C95Rb79ZOFtsSCo9tUfHk22XZZZG3Mzx7C1vQ7RwOwAnV17kq
 uqbA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=gvhh5hK0zCfyZzB9iJj1/jD6U2QamS86/Ekz9ttN7KE=;
 b=IR6rbh7ajvyb6PGl3m9k07to2Xf6bc7G+YQ2IBABoouRJTVwT9LMYeQ9LPUdUU3Ked
 F6KdvjwEIuAfTgfnKtmHD6YlCuS0FlO+EC00pialvDW+7y8kCA3C7rZ1hb3gNtEd/GuX
 Y8bUteVMgpzyBu6SHXGfii033massKwcJFvW5UykzaDPEhvAyjNQ9/efKoAlSsBnt+9P
 4+zAV6+MKt6pw4wsC3Ggoa2T8eya5gfMhM+pm4IQJl5di86WYCbJfR2WKU1rD3un/o7W
 4bxEWc55+sY7wzKs0dOhymeHTZuGbe55QdgeXJvTgLTKHjw+XNNELXM4Zxz0OvlL4LdG
 s3GA==
X-Gm-Message-State: AJIora+4owNpUcT+eL9aUOBlSwtSWU6vcp99Ufr3NkGE5WZxcsmK25mE
 +jCkeF/QC0NrB6SQTqMska8uTAstDM/84F88X+FEOUpd95Sn5g==
X-Google-Smtp-Source: AGRyM1tX8dHtDHV+6e0tEp2VCGv283g5lVe94VMb97u6PNwdDCEKGRtDv13pgsSeBDEPWSFygHD4xnPwwduYXDHs3Vw=
X-Received: by 2002:a05:6402:189:b0:437:8a8a:d08a with SMTP id
 r9-20020a056402018900b004378a8ad08amr52595319edv.241.1657101002996; Wed, 06
 Jul 2022 02:50:02 -0700 (PDT)
MIME-Version: 1.0
References: <20220527064244.10224-1-usman.tanveer@emumba.com>
 <28911775.czjnFlTdjD@thomas>
In-Reply-To: <28911775.czjnFlTdjD@thomas>
From: Usman Tanveer <usman.tanveer@emumba.com>
Date: Wed, 6 Jul 2022 14:49:51 +0500
Message-ID: <CAH_O0by0+yqCPnKvrHXxhFzFgZ3eJGOiveiaHTPzCu7yBZkrhg@mail.gmail.com>
Subject: Re: [PATCH] ethtool: remove a redundant call to rte_eth_dev_stop()
To: Thomas Monjalon <thomas@monjalon.net>
Cc: dev@dpdk.org
Content-Type: text/plain; charset="UTF-8"
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

It has been there since the file was added (2015). I'm not able to
find any purpose for this.

Although, it's misleading the messages it shows upon calling
rte_ethtool_net_open() as mentioned above. And when this function is
called even when the port is already UP, it should print a message
"device already started", but it's not like that because it first
stops the device and then starts it again.

The above change fixes both misleading messages.


On Mon, Jun 27, 2022 at 2:16 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 27/05/2022 08:42, Usman Tanveer:
> > There is a call to rte_eth_dev_stop() in rte_ethtool_net_open()
> > due to which user gets misleading message upon first open/start call.
> > It says that the
> > device is already stopped, which should not be the case. This patch
> > removes rte_eth_dev_stop() from rte_ethtool_net_open().
>
> Why was it there?
> Any opinion? Is it safe to remove?
>
> >  int
> >  rte_ethtool_net_open(uint16_t port_id)
> >  {
> > -     int ret;
> > -
> > -     ret = rte_eth_dev_stop(port_id);
> > -     if (ret != 0)
> > -             return ret;
> > -
> >       return rte_eth_dev_start(port_id);
> >  }
>
>
>