From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0063.outbound.protection.outlook.com [104.47.42.63]) by dpdk.org (Postfix) with ESMTP id E2EF2D08E for ; Thu, 6 Apr 2017 09:53:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/D1PgNdUz2MwpmDA7txX0yaTXROsI4TlfHRbbUanEnM=; b=mguyz+MPoh8xYpqJaUmjMR/Ar6uGXelicKI3v/UIyyobXukXyTYKYVqoh0tb6uTsCNvTrqv+GFbvwqwGb6fjmMhhhA4LqF/RhkS0OkwQUUrI2g0tDypjwESr2b2fFi+XQKmSJ2T+NH5q7w5f5rtPyh/h9GBmWsUOQe7xreTqK7Y= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by DM3PR07MB2284.namprd07.prod.outlook.com (10.164.33.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10; Thu, 6 Apr 2017 07:53:51 +0000 From: Shijith Thotton To: John Mcnamara , Ferruh Yigit Cc: dev@dpdk.org Date: Thu, 6 Apr 2017 13:21:50 +0530 Message-Id: <1491465117-11252-2-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1491465117-11252-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1491059040-20647-1-git-send-email-shijith.thotton@caviumnetworks.com> <1491465117-11252-1-git-send-email-shijith.thotton@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BM1PR01CA0027.INDPRD01.PROD.OUTLOOK.COM (10.163.198.162) To DM3PR07MB2284.namprd07.prod.outlook.com (10.164.33.158) X-MS-Office365-Filtering-Correlation-Id: 77f58b02-1ec4-4023-c440-08d47cc211e0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:DM3PR07MB2284; X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2284; 3:C5bJApJgd4ng2GEEhjfzJFSsiUaAO6CttwO4e1bnMNC+kkBwu3uPnCUo/XT58HJaUKGMDxJdwk35N7MkNmyOm9hsCall4tcfd+WZJhI5U9fOrP0/xPOESMm8M/4CsFdBt8ZMbsnhU3LVJUU+q/3MDfT27szpTsE318K19n6x5rmLxT9OLUWIZquisa1aRaBUIA5fFDzRO7aSsmg/i8BxrRKZAuAgIiZBr3Q4zZd3MlyTV/KJeF9bGNJSqy+Knk8bx5kul4Zf2vxPwP5/+6GE3fsw78m9zFhQ1XQPASvCVwITOVPg1qxVWQaWiPeq8Plb46a3FSDoKYvUMz3o1+Ulcw==; 25:yIEdz1pJYBK8wvKzF8YyGbPo0xJv8OFtKECAiIM+MSyT8itKs/dk/sX0k307hjTjWuDuYGtLCX0FvyUloWp9YdCyv+XdEfTstP+/F44HH76wO/YkB80pfJfOhSyfZcyJSNzzAW1yMq90iM5yM9wXId49Tbwio5kHCUb2W4s1y+KuF9bDgNlqog2GK/b9c37pZqaza0oWvYooh8GyVhpU4hs7tJt3lnAFCVf9nKILURKYHBNYGLMyVgpo2U+N40Ea+TZPolbYVRcLJ3Dg06L+NbDs5oyUEMtWqNVY1wSTum704cWS5IUOmWrJHE0pG3Oe77KHIdPat8c83xV4ignD1DAezy2t7cdH+lOWmhJ/six1eiaOsIgzDcvhEbgULuwUsB3pdfJMS33gV09uL87fyAEL6QCkpNxxER4aabA4RXWL/lIiREtYs2aH+nMkPTa8LWturMz6n2DwYY/+rC/Cjw== X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2284; 31:2EWcP5pwrfD+s+FNMmW7+COhxcimUzxMZ6HNvrgJOztUh6N9LdfJc0BVWH3d5EnNegwNpEuNEZbLzIWW8jrkDJLTB7e5AtfgHYjMHD3TLM78wKLRNXSi6JBzgIYNPkCiWB3Ll7wHldyL3uvd4Io0qmoA0ATA0VnDBzJig7rJYw/CwaIebmZZS+E21dtOihvnosBYgablTYG5nuTZiaX2KY4qpIuWmG8pwAGpouf21fuP5zFAsENHT3AThE2qg5fesTTTmCTkGyGwbqB3RZ9lNVUtHQG2YeTNdcBgpnJvEkk=; 20:bneDUkTyaK9Js7Ia6w6+v/sYrhSg4z1ibto0kNbDLjYlMisXF0FnYxkQ+HMaPVcQBmBKwLxcmHY+RPznBGuGiU5yAGZLE+U1cKrUtrlM4Un9KHgH8j2AIak/Jxq2bk95ioe7T1yelRdB869xT7glq7D2ZwFSwbDLp1stdoKW0TQMHbZy31/UYA6oE083VneauKsmRkK/VEangpCrQ3Rc4hawSZM6oOX8B7/kHrKL6Y4aML32OPlD30fQqjI6/o8NBXIEPxRGtPrGGZJ0LpBC+BGEMYxi3zdDZOK6H0uSgFh3HxbTs/T95aDAVx7C60QAQ0tROOwFtGJGp0wIDgqcR4cRpsbiLpok8aGb4EhcRllhTdvRHBYiu7MVmUuICx/WdyU4uVFR0leEVEHp5jvOMDB8NJNyqk031nX1wTW8L8uYttDGsJsFcydMCsuLrYZQMlqg3KAmxnNFVQ1XFvOJtzj++hBowH95GQJ2IMLVj6VZAOHYD9yCB6+SmvYJD+rpMtTwMS8tQaxAl/6/Bw0BgmgmkaWK1PJ0GoLIjiXWJRO2BxTfAJ2a6CZKaJYfBpdOfQ3KdRv3VCSmeyIroznnD97J+qLJlpV7TZQPCi+eJ+A= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(6041248)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(6072148); SRVR:DM3PR07MB2284; BCL:0; PCL:0; RULEID:; SRVR:DM3PR07MB2284; X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2284; 4:xIZRdkUA+fw53IZlPY7jtcTlptiiKfFETltsmSAGynhaddKK8mrLR1QyK5+2YuLQBsisGzWaNzhAgy+w44DxvzdE2R3H1y51eHL5NHEwjVUyblWJo8f2pEg+QaxT060lLX16xSdscIbdC0qg4JNgRa9803RIbO2dkP+ve6hEWDYUlIIJhetF60q5SnTzUBDv57Dpyv8WyzMCMdv8yJnGie/ul1A8IcYOIGdC/k080/HYcvLCPB9A4/3TFRLKOsctR8sRPoQCVHmtePWy2sZYbVhOlO5lvE5Kb/n0G77OtnXHLHYeUzRdp64xrArMf/7rmrHIS3dW7AWbEzh7MmO/NzjOCmC+si8PbZlQoE22KFFQOR2KC9caJU87msMu/i1Yi6f8TZmIcq9gk5to+7dN3gdYaFuJbKOObz2taIWiExHk1G2NGX/VW6Yz9uCNd5ML6tqD17jJqcwvqymqI3rWbcnNbdq/tjKx8GgKbDItzaoTZWH0oT5MYy+nkqZAc3BUbmj6qFGImDVZEgpbD5vGi7ifEKGiiK7Ls9633XnAgnad/gK4rlyEOiKMZENjmgUjO/GFDjgm/tXe6jz4N/9gQF0y4MbTqii1fWu0iVCo0Xux29bA4oaYkq5WkuwVdpLpd1iHMX3XM6+qciP2t0/8JG171fdLhx6gIiEOqNptSY5GlQzaYGHwnnqEEJPIF9tzS4yu+KUIPhRJ17u1GFZGD9GexOQ8VK46216/GpN4aVIIG8A7luLH44ZEFpnYwvBQ X-Forefront-PRVS: 02698DF457 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39840400002)(39450400003)(39400400002)(39850400002)(39410400002)(50986999)(76176999)(36756003)(50226002)(48376002)(6506006)(6512007)(4326008)(47776003)(53936002)(25786009)(66066001)(50466002)(42882006)(2950100002)(4720700003)(38730400002)(6486002)(6116002)(5660300001)(3846002)(33646002)(5003940100001)(2906002)(7736002)(305945005)(5009440100003)(8676002)(189998001)(81166006)(42186005)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR07MB2284; H:lio357.in.caveonetworks.com; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM3PR07MB2284; 23:uHlMyyvspr/GnaAg0DoknC5wagc/y7yo0br74+zzH?= =?us-ascii?Q?9Jq/EX/blg6XLlW8MtOm65qOkHoGqKFOVccxqRFDuwu3r2lCk/D3zA1jDpZY?= =?us-ascii?Q?dESCE+f6HHRUwoY7XIzrmsEyt1XI/U4XvvQjwiWZu3pMzeQqwJ4t+3PzrFX+?= =?us-ascii?Q?WjbLmH8edKyqXk14+LJ2yAE3pZRbjUSgoDFvY3oxrdtqbHK1Cis995ArO4QE?= =?us-ascii?Q?frLpVfEV+PsGU/My+lou+oPtqASySPQdReiJ9KBNJuoDjfZLx630Lq4y1ECG?= =?us-ascii?Q?Mfjr0zvVDZwXZfPlr4Y1+2FZekXhqB4/+QK3S5fE6f+EFrFvlBI0smor4rhi?= =?us-ascii?Q?6XFVE3LCGMYEwPfvmY53xx/3FS8iZZn1a91fwNFl3cJj87BXlcwsHnXaBF1m?= =?us-ascii?Q?gzszX8pZvyShzrWyhlIZC/lXxAqRpnTzCpfEx3TjWHVpB58T3/S4rJXTw7mB?= =?us-ascii?Q?BwXvFrhsvol8TJpaD86AtqOEht0wGGa5C04WZQzLEkyuPVbnl6/YderLvTXv?= =?us-ascii?Q?7oplbWsO98sqZALWzcNRLobbn4r9YXLgmbiIC2zBf1V1IYbNFBuGcwmV2QR9?= =?us-ascii?Q?RJTlCUkXsu4j9HDFg8+/P5q4FBbZv1K/99KELZkBv1NqaMiPohVKv+J6OTYF?= =?us-ascii?Q?/6BR19ShmrnHjTlZ9ie70Y4MSUGTMDuyu8Jx6yga0QRPyurq8uDmqFj4Jav/?= =?us-ascii?Q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W8nWOy+UhehU4hwaIpTCFPDS+5fzXUBj0OHpBOPmG5JT/WPYAuMBuYeoEMpSiAgGZkvFUrI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM3PR07MB2284; 7:PMl4ojS5jIHxbkCZIijto3d0OgVJ1V5R6Pr6RF47YDjnEz2IrBV0vEoIxajlpex/UpJ1NZ3LsGv9HItvV05dt3f7ECtGkWi4GmXr8pbM0hFu3qz010mucj9PEOBVuhm5JOPLvM7vmYO7AjahCCHpI1k+b/wm7MPfshBxQD74LnO9xh1fTkadXtc/hBSQnGKkqDCnSL+WgGH03Qn7oK5h4NhMRx5NlqaykxOFs13CAYkMFzDMVhuHMs82DtlmTLOT1miIOeeecnaQwjYKAompAqr824T5mY/oitBJorJGdCEUu/Fli4jNfAbD3yuvnrl1wXpvwrWjSL+T7+kfMVwLog== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2017 07:53:51.9325 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR07MB2284 Subject: [dpdk-dev] [PATCH 1/8] doc: add doc to explain compiling and testing of PMD 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, 06 Apr 2017 07:53:56 -0000 Add a section in NIC drivers documentation to explain compiling and testing of a PMD. It also mentions about host setup, which is required before running testpmd. Add label "testpmd_ug" to refer user guide. Signed-off-by: Shijith Thotton --- doc/guides/nics/build_and_test.rst | 134 ++++++++++++++++++++++++++++++++++++ doc/guides/nics/index.rst | 1 + doc/guides/testpmd_app_ug/index.rst | 2 + 3 files changed, 137 insertions(+) create mode 100644 doc/guides/nics/build_and_test.rst diff --git a/doc/guides/nics/build_and_test.rst b/doc/guides/nics/build_and_test.rst new file mode 100644 index 0000000..4b87af6 --- /dev/null +++ b/doc/guides/nics/build_and_test.rst @@ -0,0 +1,134 @@ +.. BSD LICENSE + Copyright(c) 2017 Cavium, Inc.. All rights reserved. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Cavium, Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +.. _pmd_build_and_test: + +Compiling and testing a PMD for a NIC +===================================== + +This section demonstrates how to compile and run a Poll Mode Driver (PMD) for +the available Network Interface Cards in DPDK using TestPMD. + +TestPMD is one of the reference applications distributed with the DPDK. Its main +purpose is to forward packets between Ethernet ports on a network interface and +as such is the best way to test a PMD. + +Refer to the :ref:`testpmd application user guide ` for detailed +information on how to build and run testpmd. + +Driver Compilation +------------------ + +To compile a PMD for Linux x86_64 gcc target, run the following "make" command. +It will also build testpmd. + +.. code-block:: console + + cd + make install T=x86_64-native-linuxapp-gcc + + +FreeBSD targets should use "gmake" command instead of "make". + +For more information, refer to the :ref:`Getting Started Guide for Linux ` +or :ref:`Getting Started Guide for FreeBSD ` depending on your platform. + +Running testpmd in Linux +------------------------ + +This section demonstrates how to setup and run ``testpmd`` in Linux. + +#. Mount huge pages: + + .. code-block:: console + + mkdir /mnt/huge + mount -t hugetlbfs nodev /mnt/huge + +#. Request huge pages: + + .. code-block:: console + + echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages/nr_hugepages + +#. Load ``igb_uio`` or ``vfio-pci`` driver: + + .. code-block:: console + + modprobe uio + insmod ./x86_64-native-linuxapp-gcc/kmod/igb_uio.ko + + or + + .. code-block:: console + + modprobe vfio-pci + +#. Setup VFIO permissions for regular users before binding to ``vfio-pci``: + + .. code-block:: console + + sudo chmod a+x /dev/vfio + + sudo chmod 0666 /dev/vfio/* + +#. Bind the adapters to ``igb_uio`` or ``vfio-pci`` loaded in the previous step: + + .. code-block:: console + + ./usertools/dpdk-devbind.py --bind igb_uio DEVICE1 DEVICE2 ... + + Or setup VFIO permissions for regular users and then bind to ``vfio-pci``: + + .. code-block:: console + + ./usertools/dpdk-devbind.py --bind vfio-pci DEVICE1 DEVICE2 ... + + .. note:: + + DEVICE1, DEVICE2 are specified via PCI "domain:bus:slot.func" syntax or + "bus:slot.func" syntax. + +#. Start ``testpmd`` with basic parameters: + + .. code-block:: console + + ./x86_64-native-linuxapp-gcc/app/testpmd -l 0-3 -n 4 -- -i + + Successful execution will show initialization messages from EAL, PMD and + testpmd application. A prompt will be displayed at the end for user commands + as interactive mode (``-i``) is on. + + .. code-block:: console + + testpmd> + + Refer to the :ref:`testpmd runtime functions ` for a list + of available commands. diff --git a/doc/guides/nics/index.rst b/doc/guides/nics/index.rst index 4537113..245b53d 100644 --- a/doc/guides/nics/index.rst +++ b/doc/guides/nics/index.rst @@ -36,6 +36,7 @@ Network Interface Controller Drivers :numbered: overview + build_and_test avp bnx2x bnxt diff --git a/doc/guides/testpmd_app_ug/index.rst b/doc/guides/testpmd_app_ug/index.rst index 1c39a17..61a9121 100644 --- a/doc/guides/testpmd_app_ug/index.rst +++ b/doc/guides/testpmd_app_ug/index.rst @@ -28,6 +28,8 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.. _testpmd_ug: + Testpmd Application User Guide ============================== -- 1.8.3.1