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 B6C96A0525; Sun, 16 Feb 2020 12:04:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BEFFB2C4F; Sun, 16 Feb 2020 12:04:29 +0100 (CET) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by dpdk.org (Postfix) with ESMTP id 48341374 for ; Sun, 16 Feb 2020 12:04:28 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 02E585A4; Sun, 16 Feb 2020 06:04:26 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 16 Feb 2020 06:04:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=X5O/4mtfMEN2hrH9RdGZF3QfHqGHQsLH0RRY9gb1dRU=; b=caRUbj8j27y5 iYZjfVPjv4bKy0B6rLIF6BUVRZwYs1Y/j+T9VCL6EaWmtu7dMzolcI5NZqC2/2Da dY+BRxfntAyvZjBWpC6Al4JNHkAOXvSSHCeFvi17yYVjnnmlPbybQCT9Pm4pWwv4 HURxvX95Equ58qqWxUOaTdXKo86xCSc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=X5O/4mtfMEN2hrH9RdGZF3QfHqGHQsLH0RRY9gb1d RU=; b=WuZdTT/XkKmX6bcUWHVXhCDyGyExAKC3ENpVPhckR8LkuGst9CprsQtUM ogB7sBVNZZM/AqXM23GVvWTUiBqpBQZx5eZMeP9wwJd7ByCj//BpDshqIhFjCg4j N9yTtvLPqi47cjgVXm7YKzoiwlYLLZxSbdSRgitgAW46SlAMvnYvaARg5PzpKFOE Ph/2HFjV0S9+zUZsxIRrblyOlX3W1gwcUiZEJYN8JcIoafipBvU0k6ihK/l0aXLB L/H4a0Uj/R3kCaeIuFuIUVF7qQWovGfRH2Jo8oglpY8dv3YBW4TtCyN7co6ByvoR mpI16MCBMlaRGmDoCSxpFFOs83M8w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrjeeggddvfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucffoh hmrghinhepohhpvghnfihrthdrohhrghenucfkphepjeejrddufeegrddvtdefrddukeeg necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhoh hmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 85F3A30606E9; Sun, 16 Feb 2020 06:04:25 -0500 (EST) From: Thomas Monjalon To: John McNamara , Marko Kovacevic , Xiaolong Ye Cc: dev@dpdk.org, dev@dpdk.org, Bruce Richardson , Stephen Hemminger Date: Sun, 16 Feb 2020 12:04:24 +0100 Message-ID: <2438326.H8VbNj7W2P@xps> In-Reply-To: <20200118054856.18807-1-xiaolong.ye@intel.com> References: <20191129081911.92988-1-xiaolong.ye@intel.com> <20200118054856.18807-1-xiaolong.ye@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v5] doc: introduce openwrt how-to guide 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" 18/01/2020 06:48, Xiaolong Ye: > This doc describes how to enable DPDK on Openwrt in both virtual and > physical x86 environment. > > Signed-off-by: Xiaolong Ye > --- > --- /dev/null > +++ b/doc/guides/howto/openwrt.rst > +Enable DPDK on openwrt > +====================== > + > +This document describes how to enable Data Plane Development Kit (DPDK) on > +Openwrt in both a virtual and physical x86 environment. Please take care of the uppercases in OpenWrt. > + > +Introduction > +------------ > + > +The OpenWrt project is a Linux operating system targeting embedded devices. > +Instead of trying to create a single, static firmware, OpenWrt provides a fully > +writable filesystem with package management. This frees the user from the > +application selection and configuration provided by the vendor and allows users > +to customize the device through the use of packages to suit any application. For > +developers OpenWrt is the framework to build an application without having to > +build a complete firmware around it. For users is offers full customization > +to use the device in ways never envisioned. Why doing marketing for OpenWrt in DPDK doc? It is a copy paste from https://openwrt.org/ I think it is enough to say OpenWrt is a source-based router OS with package management. > + > +Pre-requisites > +~~~~~~~~~~~~~~ > + > +You need gcc, binutils, bzip2, flex, python3.5+, perl, make, find, grep, diff, > +unzip, gawk, getopt, subversion, libz-dev and libc headers installed. These are prerequisites for building, so should be in section below. Maybe we can just provide a link to the official doc instead. > + > +Build OpenWrt > +------------- > + > +You can obtain OpenWrt image through https://downloads.openwrt.org/releases. To Please take the habit of splitting lines after a punctuation. > +fully customize your own OpenWrt, it is highly recommended to build it from > +the source code. You can clone the OpenWrt source code as follows: > + > +.. code-block:: console > + > + git clone https://git.openwrt.org/openwrt/openwrt.git > + > +OpenWrt configuration > +~~~~~~~~~~~~~~~~~~~~~ > + > +* Select ``x86`` in ``Target System`` > +* Select ``x86_64`` in ``Subtarget`` > +* Select ``Build the OpenWrt SDK`` for cross-compilation environment > +* Select ``Use glibc`` in ``Advanced configuration options (for developers)`` > + then ``ToolChain Options`` and ``C Library implementation`` > + > +Kernel configuration > +~~~~~~~~~~~~~~~~~~~~ > + > +The following configurations should be enabled: > + > +* ``CONFIG_UIO=y`` No, UIO is not recommended anymore. > +* ``CONFIG_HUGETLBFS=y`` > +* ``CONFIG_HUGETLB_PAGE=y`` > +* ``CONFIG_PAGE_MONITOR=y`` Why PAGE_MONITOR? > + > +Build steps > +~~~~~~~~~~~ > + > +For detailed OpenWrt build steps, please refer to the > +`OpenWrt build guide > +`_. > + > +After the build is completed, you can find the images and sdk in > +``/bin/targets/x86/64-glibc/``. s/sdk/SDK/ [...] > + [binaries] > + c = 'x86_64-openwrt-linux-gcc' > + cpp = 'x86_64-openwrt-linux-cpp' > + ar = 'x86_64-openwrt-linux-ar' > + strip = 'x86_64-openwrt-linux-strip' > + > + meson builddir --cross-file openwrt-cross This is really a good example why meson should allow to override the toolchain prefix. Please work with meson on this topic. [...] > +To cross compile with make: > + > +.. code-block:: console > + > + export STAGING_DIR=/glibc/openwrt-sdk-x86-64_gcc-8.3.0_glibc.Linux-x86_64/staging_dir > + export RTE_SDK=`pwd` > + export RTE_KERNELDIR=/build_dir/target-x86_64_glibc/linux-x86_64/linux-4.19.81/ > + make config T=x86_64-native-linuxapp-gcc > + make -j 100 CROSS=x86_64-openwrt-linux-gnu- The make build system should not be documented as it is going to be deprecated. > + > +Running DPDK application on OpenWrt > +----------------------------------- > + > +Virtual machine > +~~~~~~~~~~~~~~~ > + > +* Extract the boot image > + > +.. code-block:: console > + > + gzip -d openwrt-x86-64-combined-ext4.img.gz > + > +* Launch Qemu > + > +.. code-block:: console > + > + qemu-system-x86_64 \ > + -cpu host \ > + -smp 8 \ > + -enable-kvm \ > + -M q35 \ > + -m 2048M \ > + -object memory-backend-file,id=mem,size=2048M,mem-path=/tmp/hugepages,share=on \ > + -drive file=/openwrt-x86-64-combined-ext4.img,id=d0,if=none,bus=0,unit=0 \ > + -device ide-hd,drive=d0,bus=ide.0 \ > + -net nic,vlan=0 \ > + -net nic,vlan=1 \ > + -net user,vlan=1 \ > + -display none \ > + > + > +Physical machine > +~~~~~~~~~~~~~~~~ > + > +If you are using a Windows PC, you can use an image writer application such as > +``Win32 Disk Imager`` and ``Etcher`` to write the OpenWrt image > +(openwrt-x86-64-combined-ext4.img) to a USB flash driver or SDcard. If you just built a DPDK for Linux, you are not running Windows, except if you are using a Linux server for compilation. Anyway, we should not try to document such procedure in my opinion. I'm sure you can refer to the OpenWrt documentation for flashing the image. > + > +If you are using Linux, you can use the ``dd`` tool to write the OpenWrt image > +to the drive you want to write the image on. > + > +.. code-block:: console > + > + dd if=openwrt-18.06.1-x86-64-combined-squashfs.img of=/dev/sdX > + > +Where sdX is name of the drive. (You can find it though ``fdisk -l``) > + > +Running DPDK > +~~~~~~~~~~~~ > + > +More detailed info about how to run a DPDK application please refer to > +``Running DPDK Applications`` section of :ref:`the DPDK documentation `. > + > +.. note:: > + > + You need to install pre-built numa libraries (including soft link) s/numa/NUMA/ > + to /usr/lib64 in OpenWrt. libnuma is not packaged in OpenWrt? > --- a/doc/guides/rel_notes/release_20_02.rst > +++ b/doc/guides/rel_notes/release_20_02.rst > @@ -116,6 +116,10 @@ New Features > > Added support for ESP rte_flow patterns to the testpmd application. > > +* **Added OpenWrt howto guide.** > + > + Added document describes how to enable DPDK on OpenWrt in both virtual and > + physical machine. > > Removed Items > ------------- You miss a doubled blank line before this title.