From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-wr0-f180.google.com (mail-wr0-f180.google.com
 [209.85.128.180]) by dpdk.org (Postfix) with ESMTP id CD7AE37AC
 for <dev@dpdk.org>; Thu, 30 Mar 2017 21:55:21 +0200 (CEST)
Received: by mail-wr0-f180.google.com with SMTP id w11so74792280wrc.3
 for <dev@dpdk.org>; Thu, 30 Mar 2017 12:55:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=6wind-com.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:date:message-id:user-agent:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=F/v54wMcib5BxMXPrH2Gtc6FufS/HAA9Lavi6ruHero=;
 b=NvhY2ukUWU8+k/xPNlR+aZ2/6bq8/V3bnx4r9/a3pgzPuiFJMMx5yEXAmUMsQTPXqB
 m43T3OEDjwufsD2xPbTDu+CahVgWA7dALvf72JbO3RgdueiB8JKD4IyJgTVrJJPKAylJ
 ODzdf+OVTj6+lVuNW8S2FymSxSa2JBOVkWdLfQmJHp9WFSCzI06q28E10RRJo+0SM4nz
 EI2TNILrTFDxxo7WOl/ZHt7yDhkXEtPgmtxBIe7EDNj0SvFV9gll00YF+jl+MWHNWYT6
 cR21F3b5Z+wDfUtMGs+FW8XNw/YSp9VeBbl/n8iE+68iqFsSSh541yksHbMkFyzeyN7c
 7nzg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent
 :in-reply-to:references:mime-version:content-transfer-encoding;
 bh=F/v54wMcib5BxMXPrH2Gtc6FufS/HAA9Lavi6ruHero=;
 b=shfatO0tguI5bFgHMw9BSQV6MspM+T4eN/LzClCqKW3JfQR6f27s08iHMO0rKu6ifW
 DDVRLOP3zl3VHUaeVSg81+SdIAfBlvSNIAJm8LYVVwyM8L+fE+ALYyCYANWJYZrvag3A
 Ey4YMKL4w1Apq3bhH7/CSHyaVV38KSZZ6HjwwifOiZzKo7HAmP94tfB1i4h/ictyyPGP
 EU0Rf/HJ3c3iug2QUXiwWBbw19YQbDditTcz81SgCEIcc9UWTMcx3H6QppVFdrobz9dZ
 inayfyf6rSYaDilDKN77tuYWYrATRcgmwUZAMLiePse6FzWV4NT+/jD24mOdXu39nRmP
 LyrA==
X-Gm-Message-State: AFeK/H1XgxC18KB17ZaYCGLKthlKnWSqJxNUhaasps8fe38fYhwzYv2IO+JYbVFpuBGaPgpj
X-Received: by 10.223.139.80 with SMTP id v16mr1241594wra.133.1490903721226;
 Thu, 30 Mar 2017 12:55:21 -0700 (PDT)
Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184])
 by smtp.gmail.com with ESMTPSA id e72sm147146wma.5.2017.03.30.12.55.20
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 30 Mar 2017 12:55:20 -0700 (PDT)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Wei Zhao <wei.zhao1@intel.com>, john.mcnamara@intel.com
Cc: dev@dpdk.org, Wenzhuo Lu <wenzhuo.lu@intel.com>
Date: Thu, 30 Mar 2017 21:55:19 +0200
Message-ID: <2969664.trJitADFWx@xps13>
User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; )
In-Reply-To: <1490866456-52241-2-git-send-email-wei.zhao1@intel.com>
References: <1490866456-52241-1-git-send-email-wei.zhao1@intel.com>
 <1490866456-52241-2-git-send-email-wei.zhao1@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-dev] [PATCH v4 1/3] lib/librte_ether: add support for
	port reset
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 30 Mar 2017 19:55:22 -0000

Hi,

Please help reviewers, use --in-reply-to to keep patches threaded.

2017-03-30 17:34, Wei Zhao:
> Add support for port reset in rte layer.This reset
> feature can not only used in vf port reset in later code
> develop, but alsopf port.But in this patch set, we only
> limit the discussion scope to vf reset.
> This patch Add an API to restart the device.
> It's for VF device in this scenario, kernel PF + DPDK VF.
> When the PF port down->up, APP should call this API to
> restart VF port. Most likely, APP should call it in its
> management thread and guarantee the thread safe. It means
> APP should stop the rx/tx and the device, then restart
> the device, then recover the device and rx/tx.
> Also, it's APP's responsibilty to release the occupied
> memory.

Which memory should be released?

[...]
  /**
> + * Reset an ethernet device when it's not working. One scenario is, after PF
> + * port is down and up, the related VF port should be reset.
> + * The API will stop the port, clear the rx/tx queues, re-setup the rx/tx
> + * queues, restart the port.

s/The API/This function/

Please explain exactly the responsibility of this function,
and how it is different from calling stop/configure/start.

> + * Before calling this API, APP should stop the rx/tx. When tx is being stopped,
> + * APP can drop the packets and release the buffer instead of sending them.
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + *
> + * @return
> + *   - (0) if successful.
> + *   - (-ENODEV) if port identifier is invalid.
> + *   - (-ENOTSUP) if hardware doesn't support this function.
> + */
> +int
> +rte_eth_dev_reset(uint8_t port_id);

Please John, could you help with the API documentation here?