From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v4 1/3] lib/librte_ether: add support for port reset Date: Thu, 30 Mar 2017 21:55:19 +0200 Message-ID: <2969664.trJitADFWx@xps13> 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Wenzhuo Lu To: Wei Zhao , john.mcnamara@intel.com Return-path: 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 ; Thu, 30 Mar 2017 21:55:21 +0200 (CEST) Received: by mail-wr0-f180.google.com with SMTP id w11so74792280wrc.3 for ; Thu, 30 Mar 2017 12:55:21 -0700 (PDT) In-Reply-To: <1490866456-52241-2-git-send-email-wei.zhao1@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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?