From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v7 1/3] lib/librte_ether: add support for port reset Date: Thu, 20 Apr 2017 22:49:58 +0200 Message-ID: <2289948.sETW63YaRv@xps> 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Wei Zhao , Wenzhuo Lu 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) In-Reply-To: <1491793349-46840-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" 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.