From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [119.145.14.66]) by dpdk.org (Postfix) with ESMTP id 0FD257E72 for ; Thu, 16 Oct 2014 04:32:43 +0200 (CEST) Received: from 172.24.2.119 (EHLO szxeml448-hub.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id AVP84993; Thu, 16 Oct 2014 10:40:23 +0800 (CST) Received: from [127.0.0.1] (10.177.19.236) by szxeml448-hub.china.huawei.com (10.82.67.191) with Microsoft SMTP Server id 14.3.158.1; Thu, 16 Oct 2014 10:40:21 +0800 Message-ID: <543F3008.4040800@huawei.com> Date: Thu, 16 Oct 2014 10:40:08 +0800 From: Lilijun User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: "Richardson, Bruce" , "dev@dpdk.org" , "stephen@networkplumber.org" References: <20130813225821.3e23ad90@nehalam.linuxnetplumber.net> <543D0FF3.6020306@huawei.com> <543E419A.70509@huawei.com> <59AF69C657FD0841A61C55336867B5B03441EDC0@IRSMSX103.ger.corp.intel.com> In-Reply-To: <59AF69C657FD0841A61C55336867B5B03441EDC0@IRSMSX103.ger.corp.intel.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.236] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020209.543F3018.015A, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 71753cff9712b8159e7fd2347ff1df36 Subject: Re: [dpdk-dev] kernel panic when stop my test demo X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Oct 2014 02:32:45 -0000 On 2014/10/15 18:08, Richardson, Bruce wrote: > > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Lilijun >> Sent: Wednesday, October 15, 2014 10:43 AM >> To: dev@dpdk.org; stephen@networkplumber.org >> Subject: Re: [dpdk-dev] kernel panic when stop my test demo >> >> Hi all, >> >> After adding unmap uio resources operations in process signal handler functions, >> An new error was found as follows: >> Call Trace: >> [] uio_release+0x40/0x60 [uio] >> [] __fput+0xe9/0x270 >> [] ____fput+0xe/0x10 >> [] task_work_run+0xa7/0xe0 >> [] do_notify_resume+0x97/0xb0 >> [] int_signal+0x12/0x17 >> >> The code for unmap uio resources is shown: >> static void pci_dev_uio_unmap(struct rte_pci_device *pci_dev, uint8_t port_id) >> { >> int i; >> >> RTE_LOG(INFO, EAL, "begin unmap port %d uio resource! \n", port_id); >> if (NULL == pci_dev) >> { >> RTE_LOG(ERR, EAL, "begin unmap port %d uio resource! \n", port_id); >> return; >> } >> >> for (i = 0; i != PCI_MAX_RESOURCE; i++) >> { >> /* skip empty BAR */ >> if (0 == pci_dev->mem_resource[i].phys_addr) >> continue; >> if (munmap(pci_dev->mem_resource[i].addr, pci_dev- >>> mem_resource[i].len) >> == -1){ >> RTE_LOG(ERR, EAL, "Error with munmap\n"); >> return; >> } >> } >> if (close(pci_dev->intr_handle.fd) == -1){ >> RTE_LOG(ERR, EAL, "Error closing interrupt handle\n"); >> return; >> } >> pci_dev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN; >> RTE_LOG(INFO, EAL, "unmap port %d uio resource successfully!\n", >> port_id); >> } >> >> Does anyone has some ideas? >> >> Thanks for any help. >> Jerry >> >> On 2014/10/14 19:58, Lilijun wrote: >>> Hi Stephen and all, >>> >>> I have a same problem as this older email describes on Aug 14, 2013. >>> Any help will be appreciated. >>> >>> The details is shown as follows. >>> The key step implementation of my demo is: >>> 1. Firstly, call rte_eal_init() to do some initialization. >>> 2. Switch the driver of my Intel 82599 NIC from ixgbe.ko to igb_uio.ko >>> like tools/dpdk_nic_bind.py written in C source code. >>> 3. Configure rte_dev and start it. >>> 4. Do some rx/tx tests. >>> 5. call rte_eth_dev_stop(dpdk_port_id) to stop the hardware as your history >> emails. >>> 6. Switch the driver of the NIC from igb_uio.ko to ixgbe.ko. >>> 7. Kill the demo using commands: kill -9. > > Just to clarify one point - you have an application running which was using the NICs with DPDK while you remove the uio driver and replace it with ixgbe? I would expect doing such a thing to cause problems as stopping the device does not cause the NIC BAR memory to be unmapped from the DPDK process. Therefore removing the driver providing that memory map and getting another driver to start using those same BARs would not be recommended. > Thanks for your reply. Yes, I want to change the NIC driver by replacing the uio driver with ixgbe in order to recover the NIC to origin kernel ether-net devices while keeping the application running. Then my application can use the NICs with DPDK or with kernel ixgbe driver on demand. I am confusing with how to release all uio resources when stop my application. Would you like to give me any suggestions for my requirements? > /Bruce > > > . >