From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 220B92C08 for ; Fri, 21 Apr 2017 05:20:25 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Apr 2017 20:20:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,228,1488873600"; d="scan'208";a="92450170" Received: from kmsmsx152.gar.corp.intel.com ([172.21.73.87]) by fmsmga006.fm.intel.com with ESMTP; 20 Apr 2017 20:20:23 -0700 Received: from pgsmsx103.gar.corp.intel.com ([169.254.2.175]) by KMSMSX152.gar.corp.intel.com ([169.254.11.200]) with mapi id 14.03.0319.002; Fri, 21 Apr 2017 11:20:22 +0800 From: "Zhao1, Wei" To: Thomas Monjalon , "Lu, Wenzhuo" CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v7 1/3] lib/librte_ether: add support for port reset Thread-Index: AQHSsafSqRpERVrvLUKop8jyomBdbaHORewAgADyznA= Date: Fri, 21 Apr 2017 03:20:21 +0000 Message-ID: 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> <2289948.sETW63YaRv@xps> In-Reply-To: <2289948.sETW63YaRv@xps> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.30.20.206] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Fri, 21 Apr 2017 03:20:26 -0000 Hi, Thomas > -----Original Message----- > From: Thomas Monjalon [mailto:thomas@monjalon.net] > Sent: Friday, April 21, 2017 4:50 AM > To: Zhao1, Wei ; Lu, Wenzhuo > > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v7 1/3] lib/librte_ether: add support for = port > reset >=20 > 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 >=20 > This new op should be added at the end of the structure to avoid ABI issu= e. Ok, I will change as your suggestion in next version. >=20 > > 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); >=20 > The declarations and function definitions should be better placed after s= tart > and stop functions. Ok, I will change as your suggestion in next version.