From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 40231A09E0;
	Fri, 13 Nov 2020 14:53:33 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 22BB0C868;
	Fri, 13 Nov 2020 14:53:32 +0100 (CET)
Received: from mga17.intel.com (mga17.intel.com [192.55.52.151])
 by dpdk.org (Postfix) with ESMTP id 7A8614CA6
 for <dev@dpdk.org>; Fri, 13 Nov 2020 14:53:29 +0100 (CET)
IronPort-SDR: +KP7vZAlnfclJX2nGF06eIPKwkNUcoU0x4GMEjs6KErkJkxJYYreuztwqPjtiTwfKDE3hAOv6d
 dYwm4f0nK0XQ==
X-IronPort-AV: E=McAfee;i="6000,8403,9803"; a="150322166"
X-IronPort-AV: E=Sophos;i="5.77,475,1596524400"; d="scan'208";a="150322166"
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga004.jf.intel.com ([10.7.209.38])
 by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 13 Nov 2020 05:53:20 -0800
IronPort-SDR: /bXVuE8wQNOOkqDxFt6Kwjut2GzvHtvIK/Ckasr6cF+mU/XEwR+reAtdz1w7VmfNtPP5re067j
 YK4BSIaEr8sg==
X-IronPort-AV: E=Sophos;i="5.77,475,1596524400"; d="scan'208";a="474667027"
Received: from bricha3-mobl.ger.corp.intel.com ([10.252.3.226])
 by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA;
 13 Nov 2020 05:53:18 -0800
Date: Fri, 13 Nov 2020 13:53:14 +0000
From: Bruce Richardson <bruce.richardson@intel.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev@dpdk.org, thomas@monjalon.net,
 Declan Doherty <declan.doherty@intel.com>,
 Pablo de Lara <pablo.de.lara.guarch@intel.com>,
 Akhil Goyal <akhil.goyal@nxp.com>, Fiona Trahe <fiona.trahe@intel.com>,
 Fan Zhang <roy.fan.zhang@intel.com>
Message-ID: <20201113135314.GB53@bricha3-MOBL.ger.corp.intel.com>
References: <20201110151219.4893-1-david.marchand@redhat.com>
 <20201113122430.25354-1-david.marchand@redhat.com>
 <20201113122430.25354-5-david.marchand@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20201113122430.25354-5-david.marchand@redhat.com>
Subject: Re: [dpdk-dev] [PATCH v2 04/11] examples/l2fwd-crypto: fix build
	with pkg-config
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Fri, Nov 13, 2020 at 01:24:23PM +0100, David Marchand wrote:
> Two issues fixed here.
> 
> First add the experimental flag.
> Then fix a link issue with the crypto scheduler driver:
> /usr/bin/ld: /tmp/cchr7aHA.o: in function `main':
> main.c:(.text.startup+0x1673): undefined reference to
> `rte_cryptodev_scheduler_workers_get'
> collect2: error: ld returned 1 exit status
> 
> Fixes: e3bcb99a5e13 ("examples/l2fwd-crypto: limit number of sessions")
> Fixes: 261bbff75e34 ("examples: use separate crypto session mempools")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  examples/l2fwd-crypto/Makefile | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/examples/l2fwd-crypto/Makefile b/examples/l2fwd-crypto/Makefile
> index 4953ee2b95..211a076699 100644
> --- a/examples/l2fwd-crypto/Makefile
> +++ b/examples/l2fwd-crypto/Makefile
> @@ -24,8 +24,14 @@ PKGCONF ?= pkg-config
>  PC_FILE := $(shell $(PKGCONF) --path libdpdk 2>/dev/null)
>  CFLAGS += -O3 $(shell $(PKGCONF) --cflags libdpdk)
>  LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
> +NEED_CRYPTO_SCHEDULER = $(shell echo RTE_CRYPTO_SCHEDULER | $(CPP) $(CFLAGS) -P - | tail -1)
> +ifeq ($(NEED_CRYPTO_SCHEDULER), 1)

Sorry for the last-minute comment, but I wonder for this check if we can do
better by adding into each makefile something like:

CONFIG_DEFINES=$(shell $(CC) $(CFLAGS) -dM -E - < /dev/null)

Then we can easily do multiple checks for vars as needed using findstring,
e.g.

ifeq ($(findstring RTE_CRYPTO_SCHEDULER,$(CONFIG_DEFINES),)
$(info No crypto scheduler found)
else
...
endif

Whatever approach we use here, I'd like applicable across all makefiles for
consistency, and shelling out per-value seems wasteful. Pulling all macro
values also allows checks for architecture and instruction set levels too,
if so desired.

/Bruce

> +LDFLAGS_SHARED += -lrte_crypto_scheduler
> +endif
>  LDFLAGS_STATIC = $(shell $(PKGCONF) --static --libs libdpdk)
>  
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
> +
>  build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
>  	$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)
>  
> -- 
> 2.23.0
>