From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 8EAAC5A9D for ; Thu, 11 Jun 2015 16:33:33 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 11 Jun 2015 07:33:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,595,1427785200"; d="scan'208";a="744971783" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 11 Jun 2015 07:33:31 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t5BEXU4T031785; Thu, 11 Jun 2015 15:33:30 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t5BEXUBo004384; Thu, 11 Jun 2015 15:33:30 +0100 Received: (from bairemon@localhost) by sivswdev01.ir.intel.com with id t5BEXUTl004380; Thu, 11 Jun 2015 15:33:30 +0100 From: Bernard Iremonger To: dev@dpdk.org Date: Thu, 11 Jun 2015 15:33:27 +0100 Message-Id: <1434033207-4288-1-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: References: Subject: [dpdk-dev] [PATCH] doc: update port attach and detach in Testpmd Runtime Functions chapter 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, 11 Jun 2015 14:33:34 -0000 Signed-off-by: Bernard Iremonger --- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 96 +++++++++++++++++++++++---- 1 files changed, 82 insertions(+), 14 deletions(-) diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 761172e..fef3ceb 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -1,5 +1,5 @@ .. BSD LICENSE - Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + Copyright(c) 2010-2015 Intel Corporation. All rights reserved. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -866,31 +866,61 @@ Attach a port specified by pci address or virtual device args. To attach a new pci device, the device should be recognized by kernel first. Then it should be moved under DPDK management. Finally the port can be attached to testpmd. -On the other hand, to attach a port created by virtual device, above steps are not needed. + +For example, to move a pci device using ixgbe under DPDK management: + +.. code-block:: console + + ./tools/dpdk_nic_bind.py --status + + Network devices using DPDK-compatible driver + ============================================ + + + Network devices using kernel driver + =================================== + 0000:0a:00.0 '82599ES 10-Gigabit SFI/SFP+ Network Connection' if=eth2 drv=ixgbe unused= + + ./tools/dpdk_nic_bind.py -b igb_uio 0000:0a:00.0 + ./tools/dpdk_nic_bind.py --status + + Network devices using DPDK-compatible driver + ============================================ + 0000:0a:00.0 '82599ES 10-Gigabit SFI/SFP+ Network Connection' drv=igb_uio unused= + +To attach a port created by virtual device, above steps are not needed. port attach (identifier) -For example, to attach a port whose pci address is 0000:02:00.0. +For example, to attach a port whose pci address is 0000:0a:00.0. .. code-block:: console - testpmd> port attach 0000:02:00.0 + testpmd> port attach 0000:0a:00.0 Attaching a new port... - ... snip ... + EAL: PCI device 0000:0a:00.0 on NUMA socket -1 + EAL: probe driver: 8086:10fb rte_ixgbe_pmd + EAL: PCI memory mapped at 0x7f83bfa00000 + EAL: PCI memory mapped at 0x7f83bfa80000 + PMD: eth_ixgbe_dev_init(): MAC: 2, PHY: 18, SFP+: 5 + PMD: eth_ixgbe_dev_init(): port 0 vendorID=0x8086 deviceID=0x10fb Port 0 is attached. Now total ports is 1 Done + testpmd> For example, to attach a port created by pcap PMD. .. code-block:: console - testpmd> port attach eth_pcap0,iface=eth0 + testpmd> port attach eth_pcap0 Attaching a new port... - ... snip ... + PMD: Initializing pmd_pcap for eth_pcap0 + PMD: Creating pcap-backed ethdev on numa socket 0 Port 0 is attached. Now total ports is 1 Done + testpmd> -In this case, identifier is "eth_pcap0,iface=eth0". +In this case, identifier is "eth_pcap0". This identifier format is the same as "--vdev" format of DPDK applications. port detach @@ -899,21 +929,59 @@ port detach Detach a specific port. Before detaching a port, the port should be closed. -Also to remove a pci device completely from the system, first detach the port from testpmd. -Then the device should be moved under kernel management. -Finally the device can be removed using kernel pci hotplug functionality. -On the other hand, to remove a port created by a virtual device, above steps are not needed. port detach (port_id) -For example, to detach a port 0. +For example, to detach a pci device port 0. + +.. code-block:: console + + testpmd> port close 0 + Closing ports... + Done + testpmd> port detach 0 + Detaching a port... + EAL: PCI device 0000:0a:00.0 on NUMA socket -1 + EAL: remove driver: 8086:10fb rte_ixgbe_pmd + EAL: PCI memory unmapped at 0x7f83bfa00000 + EAL: PCI memory unmapped at 0x7f83bfa80000 + Done + testpmd> + +For example, to detach a virtual device port 0. .. code-block:: console + testpmd> port close 0 + Closing ports... + Done testpmd> port detach 0 Detaching a port... - ... snip ... + PMD: Closing pcap ethdev on numa socket 0 + Port 'eth_pcap0' is detached. Now total ports is 0 Done + testpmd> + +To remove a pci device completely from the system, first detach the port from testpmd. +Then the device should be moved under kernel management. +Finally the device can be removed using kernel pci hotplug functionality. + +For example, to move a pci device under kernel management: + +.. code-block:: console + + ./tools/dpdk_nic_bind.py -b ixgbe 0000:0a:00.0 + ./tools/dpdk_nic_bind.py --status + + Network devices using DPDK-compatible driver + ============================================ + + + Network devices using kernel driver + =================================== + 0000:0a:00.0 '82599ES 10-Gigabit SFI/SFP+ Network Connection' if=eth2 drv=ixgbe unused=igb_uio + +To remove a port created by a virtual device, above steps are not needed. port start ~~~~~~~~~~ -- 1.7.4.1