From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9E93FA051B; Wed, 10 Jun 2020 13:59:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6CFF458C4; Wed, 10 Jun 2020 13:59:02 +0200 (CEST) Received: from inbox.dpdk.org (xvm-172-178.dc0.ghst.net [95.142.172.178]) by dpdk.org (Postfix) with ESMTP id 692D05681 for ; Wed, 10 Jun 2020 13:59:01 +0200 (CEST) Received: by inbox.dpdk.org (Postfix, from userid 33) id 5F247A051C; Wed, 10 Jun 2020 13:59:01 +0200 (CEST) From: bugzilla@dpdk.org To: dev@dpdk.org Date: Wed, 10 Jun 2020 11:59:01 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DPDK X-Bugzilla-Component: other X-Bugzilla-Version: 18.11 X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: david.marchand@redhat.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: dev@dpdk.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All MIME-Version: 1.0 Subject: [dpdk-dev] [Bug 488] mlx4: cannot reattach devices 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" https://bugs.dpdk.org/show_bug.cgi?id=3D488 Bug ID: 488 Summary: mlx4: cannot reattach devices Product: DPDK Version: 18.11 Hardware: All OS: All Status: UNCONFIRMED Severity: major Priority: Normal Component: other Assignee: dev@dpdk.org Reporter: david.marchand@redhat.com Target Milestone: --- I reproduced on master and stable/18.11: # ./master/app/testpmd -c 0x3 -w 0000:00:00.0 -m 2048 --log-level '*:debug'= -- --total-num-mbufs 2048 -i ... testpmd: No probed ethernet devices Interactive-mode selected testpmd: create a new mbuf pool : n=3D2048, size=3D2176, socket=3D0 testpmd: preferred mempool ops selected: ring_mp_mc testpmd: create a new mbuf pool : n=3D2048, size=3D2176, socket=3D1 testpmd: preferred mempool ops selected: ring_mp_mc Done testpmd> port attach 0000:03:00.0 Attaching a new port... EAL: PCI device 0000:03:00.0 on NUMA socket 0 EAL: probe driver: 15b3:1007 net_mlx4 EAL: Probe PCI driver: net_mlx4 (15b3:1007) device: 0000:03:00.0 (socket 0) EAL: Mem event callback 'MLX4_MEM_EVENT_CB:(nil)' registered net_mlx4: PCI information matches, using device "mlx4_0" (VF: false) net_mlx4: 2 port(s) detected net_mlx4: port 1 MAC address is 24:8a:07:f7:36:d0 net_mlx4: port 2 MAC address is 24:8a:07:f7:36:d1 EAL: request: eal_dev_mp_request Port 0 is attached. Now total ports is 1 Done Port 1 is attached. Now total ports is 2 Done testpmd> port close all Closing ports... Port closing is using an old behaviour. The driver net_mlx4 should migrate to the new behaviour. Port closing is using an old behaviour. The driver net_mlx4 should migrate to the new behaviour. Done testpmd> port detach 0 Removing a device... EAL: request: eal_dev_mp_request EAL: PCI device 0000:03:00.0 on NUMA socket 0 EAL: remove driver: 15b3:1007 net_mlx4 Device is detached Now total ports is 2 Done Here, we can see that the 2 ports associated to this device are still seen = in ethdev. (gdb) p rte_eth_devices[0].data.name $1 =3D "mlx4_0 port 1", '\000' (gdb) p rte_eth_devices[0].state $2 =3D RTE_ETH_DEV_ATTACHED I had a look at the mlx4 driver and I can't find where port releasing happe= ns when detaching a device. I suppose this driver still has to undergo the RTE_ETH_DEV_CLOSE_REMOVE migration. Subsequent attach request fails with: testpmd> port attach 0000:03:00.0 Attaching a new port... EAL: PCI device 0000:03:00.0 on NUMA socket 0 EAL: probe driver: 15b3:1007 net_mlx4 EAL: Probe PCI driver: net_mlx4 (15b3:1007) device: 0000:03:00.0 (socket 0) net_mlx4: PCI information matches, using device "mlx4_0" (VF: false) net_mlx4: 2 port(s) detected net_mlx4: port 1 MAC address is 24:8a:07:f7:36:d0 Ethernet device with name mlx4_0 port 1 already allocated net_mlx4: can not allocate rte ethdev EAL: Driver cannot attach the device (0000:03:00.0) EAL: Failed to attach device on primary process testpmd: Failed to attach port 0000:03:00.0 --=20 You are receiving this mail because: You are the assignee for the bug.=