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 22D20A04DB; Thu, 15 Oct 2020 23:45:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 782E11DED4; Thu, 15 Oct 2020 23:45:02 +0200 (CEST) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 4F8211DE9D for ; Thu, 15 Oct 2020 23:45:00 +0200 (CEST) Received: by mail-pl1-f196.google.com with SMTP id y1so98495plp.6 for ; Thu, 15 Oct 2020 14:45:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6R6hwovuiQbeNza46w+CdYkpXCoZ30k+ShBgCoqCi3k=; b=NW7rfJkZSFNlFCNjpBWd2Ky7p1gEVzZ8MD/Xslkx/nYAqZnrEgX4hJrUjqEYzhCAKa PX2kO+Yj6DPr0NzhafASdbxQp7wfCpM3b0mXXb0w88FLA1nrf4qZDNplbYem8ev9yZqI o9lxZi/iBdJicp/A4nDKtRa67gQ2r+8jiJSq3CvA8LNj9TQ0UFT3hAkaHi+XjH4GIIv6 n4ZJ/oV2LcCcsD1MbVQdiLqDuaR6eXaQc0JC81L96wXKq3Q1C941V0W6DLU2KltEuD8x xrPjsX8Er46ux9w89bzEFxcZ5+X8UTf4YfcH/VAl5x/rDTImKBTRz50Hyybs3E5WTM1n YrvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6R6hwovuiQbeNza46w+CdYkpXCoZ30k+ShBgCoqCi3k=; b=UZlaSuoHi0d3So6usVi/aCLZ6N5KHxKxaGmaLCtZkbBzbyUXUiOzqya2CaQQIys2v/ yorZ237mg9R3whRr/Rbd3XwsB4kak327GX3DDLVXLmJxVW4PdzkSOe5VcvspT0SBt9OK 6wr9S1qgj4Ue5U1npHH9VY6SahIa/rik24DhiXw8EGu+URZrEYcWqtMzzFRZcMOByIQm DxlvA5edzVtXd5BRsA3uL3w2KOh009ZTVSbRz2c7M/Ftds9cxTGBjR4wnSOGsCPKIKjY w0NPBH9hjqKmIa6l52vQhSsJ9xvl3UI7iWEtCooYtCB/ot6OMkVjPJYNveT1/dKRCFi/ UigQ== X-Gm-Message-State: AOAM53053gbmsuM9JKwxrbA5djeidcLbMK5kYcT5S5LfQvtdSyrNrcHk WyIkzD63VQY5J+QXYM2LkTPOBQ== X-Google-Smtp-Source: ABdhPJyCyak5wRF+j9wMQ2gx4LnStgl2UAF7WdW7CczJ27mr//kf7DozaZaDYQy6OT0turTbf19FEQ== X-Received: by 2002:a17:902:bf45:b029:d5:b36d:56eb with SMTP id u5-20020a170902bf45b02900d5b36d56ebmr734548pls.28.1602798298303; Thu, 15 Oct 2020 14:44:58 -0700 (PDT) Received: from hermes.local (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id k9sm258787pgt.72.2020.10.15.14.44.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2020 14:44:58 -0700 (PDT) Date: Thu, 15 Oct 2020 14:44:49 -0700 From: Stephen Hemminger To: Thomas Monjalon Cc: Ali Alnubani , Bruce Richardson , "dev@dpdk.org" , Asaf Penso , david.marchand@redhat.com, arybchenko@solarflare.com, ferruh.yigit@intel.com, honnappa.nagarahalli@arm.com, jerinj@marvell.com Message-ID: <20201015144449.3c78230c@hermes.local> In-Reply-To: <2573869.E7my6rS1tG@thomas> References: <20201015170804.GG554@bricha3-MOBL.ger.corp.intel.com> <2573869.E7my6rS1tG@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] performance degradation with fpic 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" On Thu, 15 Oct 2020 19:14:48 +0200 Thomas Monjalon wrote: > 15/10/2020 19:08, Bruce Richardson: > > On Thu, Oct 15, 2020 at 04:00:44PM +0000, Ali Alnubani wrote: =20 > > > We have been seeing in some cases that the DPDK forwarding perform= ance > > > is up to 9% lower when DPDK is built as static with meson compared= to a > > > build with makefiles. > > >=20 > > > The same degradation can be reproduced with makefiles on older DPDK > > > releases when building with EXTAR_CFLAGS set to =E2=80=9C-fPIC=E2= =80=9D, it can also be > > > resolved in meson when passing =E2=80=9Cpic: false=E2=80=9D to mes= on=E2=80=99s static_library > > > call (more tweaking needs to be done to prevent building shared > > > libraries because this change breaks them). =20 > [...] > > > Should we disable PIC in static builds? =20 > >=20 > > thanks for reporting, though it's strange that you see such a big impac= t. > > In my previous tests with i40e driver I never noticed a difference betw= een > > make and meson builds, and I and some others here have been using meson > > builds for any performance work for over a year now. That being said le= t me > > reverify what I see on my end. > >=20 > > In terms of solutions, disabling the -fPIC flag globally implies that we > > can no longer build static and shared libs from the same sources, so we > > would need to revert to doing either a static or a shared library build > > but not both. If the issue is limited to only some drivers or some case= s, > > we can perhaps add in a build option to have no-fpic-static builds, to = be > > used in a cases where it is problematic. =20 >=20 > I assume only some Rx/Tx functions are impacted. > We probably need such disabling option per-file. >=20 > > However, at this point, I think we need a little more investigation. Is > > there any testing you can do to see if it's just in your driver, or in > > perhaps a mempool driver/lib that the issue appears, or if it's just a > > global slowdown? Do you see the impact with both clang and gcc? I'll > > retest things a bit tomorrow on my end to see what I see. =20 >=20 > Yes we need to know which libs or files are impacted by -fPIC. The issue is that all shared libraries need to be built with PIC. So it is a question of static vs shared library build.