From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 08DFD2BA3 for ; Sat, 27 May 2017 10:31:17 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 May 2017 01:31:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,400,1491289200"; d="scan'208";a="1135329734" Received: from dpdk6.bj.intel.com ([172.16.182.81]) by orsmga001.jf.intel.com with ESMTP; 27 May 2017 01:31:15 -0700 From: Wei Dai To: wenzhuo.lu@intel.com, konstantin.ananyev@intel.com, helin.zhang@intel.com, jingjing.wu@intel.com Cc: dev@dpdk.org, Wei Dai Date: Sat, 27 May 2017 16:22:02 +0800 Message-Id: <1495873329-43303-1-git-send-email-wei.dai@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH 0/7] NIC port restoration 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: Sat, 27 May 2017 08:31:18 -0000 Sometimes configuration and run time environment in PMD layer of a running port is changed and the port has to stop all bi-directional traffic and initialize the port device and restore its configurations and traffic again. Such this procedure can be regarded as restoration. Some customers found that in some VFN scenario a running port with i40e VF DPDK PMD has to be restored when the host PF with kernel driver need to reset the whole PF due to some reasons. For example, i40e HW may need a reset after reconfiguring a few key registers. Then PF host needs to Inform all VFs generated by that PF with the event of 'PF reset'. After VF driver see this event, VF driver needs to restore the VF port. In order to make restoration as a common functionality of all PMD, based on current implementation of rte_ethdev, most of restoration work can be done in rte_ethdev layer with the settings stored in data structures in rte_ethdev layer. If some settings is not stored in rte_ethdev after they are configured before, they should be stored for restoration by adding data structure in rte_ethdev layer. Ethdev should also add a API like dev_restore( ) for PMD possible specific work in restoration process. The outline of restoration procedure is as follows. 1. rte_eth_dev_stop(port_id); 2. (*dev->dev_ops->dev_uninit)(dev); 3. (*dev->dev_ops->dev_init)(dev); 4. rte_eth_dev_configure(...); 5. rte_eth_dev_rx_queue_config(...) invoked for all Rx queues. 6. rte_eth_dev_tx_queue_config(...) invoked for all Tx queues; 7. rte_eth_start(port) 7.1 rte_eth_dev_config_restore(port); // need to be enhanced 8. (*dev->dev_ops->dev_restore)(dev); // doing PMD specific restoration Wei Dai (7): ethdev: add support of NIC restoration ethdev: add support of restoration of queue state ethdev: add support of restoration of port status ethdev: add support of MTU restoration ethdev: add support of restoration of multicast addr net/ixgbe: add support of restoration net/i40e: add support of restoration drivers/net/i40e/i40e_ethdev.c | 2 + drivers/net/i40e/i40e_ethdev_vf.c | 5 + drivers/net/ixgbe/ixgbe_ethdev.c | 4 + lib/librte_ether/rte_ethdev.c | 280 +++++++++++++++++++++++++++++++-- lib/librte_ether/rte_ethdev.h | 45 +++++- lib/librte_ether/rte_ether_version.map | 6 + 6 files changed, 326 insertions(+), 16 deletions(-) -- 2.7.4