From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0066.outbound.protection.outlook.com [104.47.0.66]) by dpdk.org (Postfix) with ESMTP id 021901DA4 for ; Fri, 25 May 2018 09:00:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XiaDv1T7TsU/w38Ynvh/wg4C35ycmpW4Zlfsh5AW1ho=; b=PkcJFfzvfCc4G/L7Voc8P6P9f43w9NX/YbTnuiwD7g9soRI6Tl8oDq/tnOKF3iZD3EqUIqiG6om98ot373kcLu6B2vcfO5Jw3ssX1IpgCLZ3ab99TtUFXFauO5ZJFmPFAI+p/V7liyl6Y8NQwjKAzzDoQjK42ik8OhYClFKGMsQ= Received: from VI1PR08MB3167.eurprd08.prod.outlook.com (52.133.15.142) by VI1PR08MB3022.eurprd08.prod.outlook.com (52.133.14.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.797.11; Fri, 25 May 2018 07:00:03 +0000 Received: from VI1PR08MB3167.eurprd08.prod.outlook.com ([fe80::a105:3320:f324:a919]) by VI1PR08MB3167.eurprd08.prod.outlook.com ([fe80::a105:3320:f324:a919%13]) with mapi id 15.20.0797.011; Fri, 25 May 2018 07:00:04 +0000 From: Gavin Hu To: Bruce Richardson , Jerin Jacob CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 2/2] doc: add a guide doc for cross compiling from x86 Thread-Index: AQHT82ITrBN/70fXJEK9kTGZK3rSeaRAAefQ Date: Fri, 25 May 2018 07:00:03 +0000 Message-ID: References: <1527133127-29407-1-git-send-email-gavin.hu@arm.com> <1527133127-29407-3-git-send-email-gavin.hu@arm.com> <20180524111754.GA5098@jerin> <20180524132058.GA11756@bricha3-MOBL.ger.corp.intel.com> In-Reply-To: <20180524132058.GA11756@bricha3-MOBL.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Gavin.Hu@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR08MB3022; 7:uNbec0vehyxN6QYPcCovmySgRO0fuydGbWjRcDUf64ehG2KTGBoJ5z3rGE4QCiWJr7CDw5czLt/4b7LHZwlad6PQM9zt1RkDwvCKLRr1wNgL4I7wLTyCfzZcQfGQ6lPXCZosbL3/8PipGNl4wzBXrPgVc37QOBy2wgGcXu5zctl/k9KkXqFxltbZ5stLSbOBHaaIUE+ES/OZJ4m2O3In5UdVM13HQKu2jgKQ7Blu5ClIDeNUNq6YhL7JHc+P5x54 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:VI1PR08MB3022; x-ms-traffictypediagnostic: VI1PR08MB3022: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(166708455590820)(73538370219878)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231254)(2232076)(944501410)(52105095)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:VI1PR08MB3022; BCL:0; PCL:0; RULEID:; SRVR:VI1PR08MB3022; x-forefront-prvs: 06833C6A67 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(396003)(376002)(366004)(39380400002)(39860400002)(189003)(199004)(13464003)(40434004)(55016002)(2906002)(81156014)(81166006)(53936002)(7696005)(106356001)(8936002)(105586002)(76176011)(966005)(102836004)(72206003)(3846002)(6116002)(186003)(14454004)(26005)(59450400001)(3280700002)(5660300001)(6306002)(9686003)(8676002)(478600001)(68736007)(33656002)(55236004)(6506007)(53546011)(3660700001)(2900100001)(7736002)(11346002)(476003)(4326008)(229853002)(446003)(74316002)(110136005)(316002)(305945005)(25786009)(97736004)(93886005)(66066001)(6436002)(6246003)(5250100002)(86362001)(5890100001)(486006)(99286004)(53376002)(59010400001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB3022; H:VI1PR08MB3167.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: yyQIiWVWtCyubdaIAM0uXiV6quDkiP6ft3mtrYYrt+uodMN8/NsHy5VdcYB6W6XA6OzIeVKcDVM4dzCnd1kZfmvOo2mYmjLB3NSXhsGKQBAzPRhBCaxBbqemuyY9NbgEzA2FKbPShGwfNV8E8ftqePZ22sAw/JkngIawdRpx/D+SqerxXRs54m/Ffbl3vtLnjd33Bm58sQZwJDAo9AU+8r+xP8kkLX0/zaBVXV5xzjTlTQwZR+kL0P42n7fF/D5Rsqjg42dIIInnNWct2Z3zq4Ebh2QVgdiwwN3pLH9YvuNvc1sJbzQg5dt8BailHbvc4zNn8s5gTWHCMf1AfePyww== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 1f196d4b-5ba9-4de3-68bb-08d5c20d2440 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f196d4b-5ba9-4de3-68bb-08d5c20d2440 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 May 2018 07:00:03.9951 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3022 Subject: Re: [dpdk-dev] [PATCH 2/2] doc: add a guide doc for cross compiling from x86 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: Fri, 25 May 2018 07:00:06 -0000 Hi Bruce and Jerin, Thanks for your comments, some inline feedback for your comments. Any further comments are welcome. Best Regards, Gavin -----Original Message----- From: Bruce Richardson Sent: Thursday, May 24, 2018 9:21 PM To: Jerin Jacob Cc: Gavin Hu ; dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 2/2] doc: add a guide doc for cross compilin= g from x86 On Thu, May 24, 2018 at 04:47:56PM +0530, Jerin Jacob wrote: > -----Original Message----- > > Date: Wed, 23 May 2018 23:38:47 -0400 > > From: Gavin Hu > > To: dev@dpdk.org > > Subject: [dpdk-dev] [PATCH 2/2] doc: add a guide doc for cross > > compiling from x86 > > X-Mailer: git-send-email 2.1.4 > > > > Signed-off-by: Gavin Hu > > Reviewed-by: Steve Capper > > Reviewed-by: Honnappa Nagarahalli > > In addition to comments from Marko, > > > --- > > doc/cross_compiling_sdk.txt | 58 > > +++++++++++++++++++++++++++++++++++++++++++++ > > I think, instead of keeping it as a orphan document, IMO, it should > linked with https://dpdk.org/doc/guides/ I think, it can go a new > section or "HowTo Guides" section, So that in future armv7 and/or > PowerPC cross compilation details can be added. > I can move it to "HowTo Guides", but all the guides are not for compiling. On the contrary, there are two other docs for compiling in this place To maintain relevancy and consistency, should we keep it here? http://dpdk.org/browse/dpdk/tree/doc/build-sdk-meson.txt http://dpdk.org/browse/dpdk/tree/doc/build-sdk-quick.txt > > 1 file changed, 58 insertions(+) > > create mode 100644 doc/cross_compiling_sdk.txt > > > > diff --git a/doc/cross_compiling_sdk.txt > > b/doc/cross_compiling_sdk.txt new file mode 100644 index > > 0000000..aa08871 > > --- /dev/null > > +++ b/doc/cross_compiling_sdk.txt > > @@ -0,0 +1,58 @@ > > +How to cross compile DPDK for ARM64 > > +----------------------------------- > > + > > +NOTE: Whilst it is recommended to natively build DPDK on ARM64 > > +(just like with x86), it is also possible to cross-build DPDK for > > +ARM64. An > > +ARM64 cross compile GNU toolchain is used for this, which currently > > +requires the NUMA libraries to be integrated. Following are the steps = to follow. > > + > > +1. Obtain the cross tool chain > > +------------------------------ > > +The latest cross compile tool chain can be downloaded from: > > +https://releases.linaro.org/components/toolchain/binaries/latest/aa > > +rch64-linux-gnu/ Following is the step to get the version 7.2.1, > > +latest so far. > > +$ wget > > +https://releases.linaro.org/components/toolchain/binaries/latest/ > > +aarch64-linux-gnu/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu > > +.tar.xz > > + > > +2. Unzip and add into the PATH > > +------------------------------ > > +$ tar -xvf gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu.tar.xz > > +$ export PATH=3D$PATH: > +dir>/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin > > +Note: For the host requirements and ohter info, refer to the release n= ote section: > > +https://releases.linaro.org/components/toolchain/binaries/latest/ > > + > > +3. Getting the prerequisite library > > +----------------------------------- > > +-- NUMA > > +--Prequisite: make sure the installed libtool version >=3D 2.2(run > > +libtool --version to check), otherwise the compilation will fail with = errors. > > +$ git clone https://github.com/numactl/numactl.git > > +$ cd numactl > > +$ git checkout v2.0.11 -b v2.0.11 > > +$ ./autogen.sh > > +$ autoconf -i > > +$ ./configure --host=3Dx86_64 CC=3Daarch64-linux-gnu-gcc $ make > > + > > +4. Install the numa header and lib > > +---------------------------------- > > +Copy the header files to the cross compiler's include directory: > > +$ cp numa*.h > +dir>/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin/../aarch > > +64-linux-gnu/libc/usr/include/ Copy the numa lib to the cross > > +compiler;s lib directory: > > +$ cp .libs/libnuma.a > +dir>/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/lib/gcc/aarc > > +h64-linux-gnu/7.2.1/ > > Installing numactrl header files and library files to toolchain area > does not looks very correct. IMO, You can use --prefix option in > numactrl to install to separate directory and add the include details > through EXTRA_CFLAGS and EXTRA_LDFLAGS. This will help in meson for > pkg-config related case as well. I simply tried, it did not work out yet, will try again. > > + > > +5. Configuring the DPDK Build > > +----------------------------- > > +To configure a build, follow the build-sdk-quick.txt file to select > > +the target configuration. > > +$ make config T=3Darm64-armv8a-linuxapp-gcc > > IMO, You can mentioned about other armv8 target such as > defconfig_arm64-dpaa2-linuxapp-gcc/defconfig_arm64-thunderx-linuxapp-g > cc for optimized build specific to target. Ok, I will fix it in next version. > > +6. Cross Compiling DPDK > > +----------------------- > > +To cross-compile DPDK for ARM64 target machine, without compiling > > +the kernel modules, use the following > > +command: > > +$ make -j CROSS=3Daarch64-linux-gnu- CONFIG_RTE_KNI_KMOD=3Dn > > +CONFIG_RTE_EAL_IGB_UIO=3Dn > > I think, you could mention to set CONFIG_RTE_LIBRTE_VHOST_NUMA=3Dn and > CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=3Dn for NON numa systems to avoid > building numactl for single node systems. Ok, I will fix it in next version. > > + > > +To cross-compile DPDK for ARM64, including the kernel modules, the ker= nel source tree is required. > > +Set RTE_KERNEL_SRC_ROOTDIR to the kernel source tree folder and use th= e following command: > > +$ make -j CROSS=3Daarch64-linux-gnu- RTE_KERNELDIR=3DKERNEL_SRC_ROOTDI= R > > +CROSS_COMPILE=3Daarch64-linux-gnu- > > You could add meson cross build details too. > > export MESON_PARAMS=3D'-Dwerror=3Dtrue > -Dexamples=3Dbond,bbdev_app,cmdline,distributor,eventdev_pipeline,excepti= on_path,flow_classify,flow_filtering,helloworld,ip_fragmentation,ip_pipelin= e,ip_reassembly,ipsec-secgw,ipv4_multicast,kni,l2fwd,l2fwd-crypto,l2fwd-job= stats,l2fwd-keepalive,l3fwd,l3fwd-acl,l3fwd-power,l3fwd-vf,link_status_inte= rrupt,load_balancer,packet_ordering,ptpclient,qos_meter,qos_sched,rxtx_call= backs,service_cores,skeleton,tep_termination,timer,vhost,vhost_scsi,vmdq,vm= dq_dcb' > This long list of examples can now be shortened to "all", since meson now h= as each app detecting if it can be compiled or not. > meson --default-library=3Dstatic $MESON_PARAMS --cross-file > config/arm/arm64_armv8_linuxapp_gcc arm64-static-build ninja -C > arm64-static-build > There is already a section for meson cross compiling in http://dpdk.org/bro= wse/dpdk/tree/doc/build-sdk-meson.txt This doc will cover GNU Makefile cross gcc. IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.