From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (unknown [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 687ED1B9CF for ; Thu, 26 Oct 2017 10:08:12 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Oct 2017 01:08:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,434,1503385200"; d="scan'208";a="1029593777" Received: from kmsmsx156.gar.corp.intel.com ([172.21.138.133]) by orsmga003.jf.intel.com with ESMTP; 26 Oct 2017 01:08:10 -0700 Received: from pgsmsx106.gar.corp.intel.com ([169.254.9.199]) by KMSMSX156.gar.corp.intel.com ([169.254.1.25]) with mapi id 14.03.0248.002; Thu, 26 Oct 2017 16:08:09 +0800 From: "Dai, Wei" To: "luca.boccassi@gmail.com" , "dev@dpdk.org" CC: "Lu, Wenzhuo" , "Horton, Remy" Thread-Topic: [PATCH 0/3] RFC: implement VF reset for i40e, e1000 and ixgbe Thread-Index: AQHTTMpYZs133AIgjkCbe4HMiL9DTqL1wnJA Date: Thu, 26 Oct 2017 08:08:08 +0000 Message-ID: <49759EB36A64CF4892C1AFEC9231E8D650BA4316@PGSMSX106.gar.corp.intel.com> References: <20171024131630.16595-1-luca.boccassi@gmail.com> In-Reply-To: <20171024131630.16595-1-luca.boccassi@gmail.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmUzMTIwNDQtYmI5ZC00MzYwLTk1MzUtYTAyYjczMWIxNDY4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjFDdGFkXC8xbFdpREVTWmw4N0lqaVkraUthajloRFhHRTZkY1IwaEc1ZDNZPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action 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 0/3] RFC: implement VF reset for i40e, e1000 and ixgbe 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, 26 Oct 2017 08:08:13 -0000 Current rte_eth_dev_reset( ) from my patches are just to reset the NIC port= , NOT recovery its traffic. All my patches for NIC reset have already been accepted. It is the duty of user application to recovery any settings and traffic by = going through rte_eth_dev_configure(...),=20 rte_eth_rx_queue_setup(...)/rte_eth_tx_queue_setup(...), rte_eth_dev_start(= ...)=20 and then rte_eth_rx_burst(...)/rte_eth_tx_burst(...). In the recovery process, user application can use same or different settin= gs from those before reset. Indeed, my patch use more generic way to reset NIC. It has only been implemented on ixgbe VF and i40e VF currently. You can test ixgbe VF reset with testpmd as follows: 1. run testpmd with 2 ixgbe VF ports belonging to same PF in rxonly mode 2. testpmd > set verbose 1 //to observe VF working=20 3. testpmd > show port info all //show port number and MAC addr=20 4. testpmd > start=20 5. let all ports forwarding work for a while=20 6. testpmd > show port stats all=20 7. ifconfig name-of-PF down=20 8. A message is shown in testpmd to indicate PF reset=20 9. ifconfig name-of-PF up=20 10. testpmd > stop // stop forwarding to avoid crash during reset=20 11. testpmd > port stop all=20 12. testpmd > port reset all=20 13. testpmd > port start all //recofnig all ports {color}=20 14. testpmd > show port info all //get mapping of port id and MAC addr f= or forwarding=20 15. testpmd > start // restore forwarding=20 16. let all ports forwarding work for a while=20 17. testpmd > show port stats all //confirm all port can work again=20 18. repeat above step 7 - 17 The codes to recover traffic using rte_eth_dev_reset(...) should like as fo= llows: 1. rte_eth_dev_configure(...) 2. rte_eth_rx_queue_setup(...) + rte_eth_tx_queue_setup(...) 3. rte_eth_dev_callback_register(port_id, RTE_ETH_EVENT_INTR_RESET, eth_eve= nt_callback, cb_arg) 4. rte_eth_dev_start(...) 5. start transmitting and receiving 6. When detecting Reset event due to 'ifconfig PF down', eth_event_callback= will be called.=20 eth_event_callback( ) should trigger following step 7-14 7. stop transmitting and receiving 8. wait and confirm both transmitting and receiving are stopped. 9. rte_eth_dev_stop(...) 10. try rte_eth_dev_reset(...) multiple times until it return 0, and then f= ollowing step 11-14 to restart the port 11. rte_eth_dev_configure(...) 12. rte_eth_rx_queue_setup(...) + rte_eth_tx_queue_setup(...) 13. rte_eth_dev_start(...) 14. restart transmitting and receiving All configurations including step 1/2/3/4/6/8/9/10/11/12/13 had better be r= un in same thread like testpmd main thread. In above step 10, if the PF is down, rte_eth_dev_reset(...) will fail, so i= t should try multiple times until the PF is UP. =20 Regards -Wei > -----Original Message----- > From: luca.boccassi@gmail.com [mailto:luca.boccassi@gmail.com] > Sent: Tuesday, October 24, 2017 9:16 PM > To: dev@dpdk.org > Cc: Lu, Wenzhuo ; Dai, Wei ; > Horton, Remy > Subject: [PATCH 0/3] RFC: implement VF reset for i40e, e1000 and ixgbe >=20 > From: Luca Boccassi >=20 > These patches were originally sent by Wenzhuo Lu: >=20 > http://dpdk.org/dev/patchwork/patch/14009/ > http://dpdk.org/dev/patchwork/patch/14010/ > http://dpdk.org/dev/patchwork/patch/14011/ >=20 > The current rte_eth_dev_reset API does not correctly reset the VF when th= e > PF flaps on the host. With these patches, at least the ixgbe driver with = a X540 > card (Linux kernel 4.9 on the host) appears to work correctly. > The test is as simple ip link down/up on the host, and then check that tr= affic > still flows through the VF in the guest. >=20 > I am not an expert in these PMDs hence the RFC mark - I would like to ask= for > feedback and help from the PMD maintainers and developers. >=20 > Thanks! >=20 > Luca Boccassi (3): > net/i40e: implement VF reset > net/e1000: implement VF reset > net/ixgbe: implement VF reset >=20 > drivers/net/e1000/igb_ethdev.c | 59 > ++++++++++++++++++++++++++++++++++++++ > drivers/net/i40e/i40e_ethdev.h | 3 ++ > drivers/net/i40e/i40e_ethdev_vf.c | 56 > +++++++++++++++++++++++++++++++++--- > drivers/net/i40e/i40e_rxtx.c | 11 +++++++ > drivers/net/i40e/i40e_rxtx.h | 4 +++ > drivers/net/ixgbe/ixgbe_ethdev.c | 60 > ++++++++++++++++++++++++++++++++++----- > drivers/net/ixgbe/ixgbe_ethdev.h | 2 +- > drivers/net/ixgbe/ixgbe_rxtx.c | 12 ++++++-- > 8 files changed, 192 insertions(+), 15 deletions(-) >=20 > -- > 2.11.0