From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 1D9BF2C5 for ; Thu, 20 Apr 2017 22:49:59 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 53A6A2210A; Thu, 20 Apr 2017 16:49:59 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Thu, 20 Apr 2017 16:49:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=fHF/gWk/Fc2zSJa HRT7d5O0gQbzT21jPjdZ7psnhDx8=; b=JMh4EO+FS/6y3WwocKHsh7hwjh1BTpl Ev8n++QPW6+ZxnB9/wC6P6w5qYZgFqDiq/cxykkPeicAM85SmALq7HUlTa/WzHNw PzOV8skw9pvJ36aMyNaqViqtzMmo269yKwWQd0vNLuT38v+OFlOdBFXH/3WQDv4X aCH+9t/YbO9I= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=fHF/gWk/Fc2zSJaHRT7d5O0gQbzT21jPjdZ7psnhDx8=; b=h436mDSV aT8r0zK0mDSvCZyQWhN5dBKod6Q099p976CU8lJQDehwE3V1oBb9+G7KDZNBon1y HdMgq4yLcS3MmZX3ykob7ENmBYPjETGBEN1wjDBV/sGLEF86YGa7OPz/kOGV7PA4 fneVdg8Ix8WF/ZL32CzZZGAqvESnEmuRzvmvenYgSoc2sERzN5OeUqr520aTBfE6 CMgvzG0jRIYe1OGVncuwIbw5SEB9SyEGSf6tPN3x6/1WXpS1WvxQTUcmM7ab52cx ZbQudJjUq6x8g4kke2jxTyV6l5dtTvfR0tE+DIWl/Xqx8J5JdahZKhGGHLmCv7sh RIiOYkPHVshiHQ== X-ME-Sender: X-Sasl-enc: xU/AAABaWoNhaDFWePplyn3ucUs63aeW+CxyzzXpsjvl 1492721398 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id EC6CD7E6A3; Thu, 20 Apr 2017 16:49:58 -0400 (EDT) From: Thomas Monjalon To: Wei Zhao , Wenzhuo Lu Cc: dev@dpdk.org Date: Thu, 20 Apr 2017 22:49:58 +0200 Message-ID: <2289948.sETW63YaRv@xps> In-Reply-To: <1491793349-46840-2-git-send-email-wei.zhao1@intel.com> References: <1491461483-39861-1-git-send-email-wei.zhao1@intel.com> <1491793349-46840-1-git-send-email-wei.zhao1@intel.com> <1491793349-46840-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 v7 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Apr 2017 20:50:00 -0000 10/04/2017 05:02, Wei Zhao: > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -1509,6 +1512,9 @@ struct eth_dev_ops { > eth_l2_tunnel_offload_set_t l2_tunnel_offload_set; > /** Enable/disable l2 tunnel offload functions. */ > > + /** Reset device. */ > + eth_dev_reset_t dev_reset; > + > eth_set_queue_rate_limit_t set_queue_rate_limit; /**< Set queue rate > limit. */ > > rss_hash_update_t rss_hash_update; /** Configure RSS hash This new op should be added at the end of the structure to avoid ABI issue. > protocols. */ @@ -4413,6 +4419,28 @@ int > rte_eth_dev_get_name_by_port(uint8_t port_id, char *name); > > /** > + * 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. > + * 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. + * This function can also do some restore work for the port, > for example, it can + * restore the added parameters of vlan, mac_addrs, > promisc_unicast_enabled + * flag and promisc_multicast_enabled flag. > + * > + * @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); The declarations and function definitions should be better placed after start and stop functions.