From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CA1AFA00C2; Thu, 21 Jul 2022 14:14:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AB4ED40A87; Thu, 21 Jul 2022 14:14:34 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 49929400D7 for ; Thu, 21 Jul 2022 14:14:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658405673; x=1689941673; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=QeA9sEVUzr/begXf6hzhS6wfObeNGbDBrzS8D5++ziA=; b=VmcVyDZ3J91GmH1GKRqRXWGJ+/62s3EAJvOAOHZvskOy/xHewWWDUHhb DqIT/vCP8reaDHDHTefiE4MFsc9DN/Zugfl2eGgkShjUQVzDpXrNrrkSv 1Ey0Prg2wMAzljuQ3qgW6FuhUNXU1zKdByv/JTox8qAzAYsfi7RI1PlY2 bJGQirPnw7/tkcqNpQUzV8eCG8Bq/lGoVx2cdBD5hGQrS7VvbFb4sMRSX leJIfqoJJPR/amEppnAcNrqLRfm46PaeUvIvE7XA7+s/p2Hzv1ZxNbIdX rKulD+g4QPyAgGNsvsot5L9UAhu4PaJmCQrkrDWrD7KFI6VVHwXSL7KU1 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10414"; a="351017354" X-IronPort-AV: E=Sophos;i="5.92,289,1650956400"; d="scan'208";a="351017354" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2022 05:14:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,289,1650956400"; d="scan'208";a="573715903" Received: from silpixa00401086.ir.intel.com (HELO localhost.localdomain) ([10.55.128.124]) by orsmga006.jf.intel.com with ESMTP; 21 Jul 2022 05:14:27 -0700 From: Ciara Loftus To: dev@dpdk.org Cc: andrew.rybchenko@oktetlabs.ru, Ciara Loftus Subject: [RFC PATCH 1/3] net/af_xdp: simplify libbpf version checking in meson Date: Thu, 21 Jul 2022 12:14:13 +0000 Message-Id: <20220721121415.1709202-1-ciara.loftus@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Test if the libbpf version is >= v0.7.0 at the beginning of the meson build. Later when we want to check if the version is <= v0.6.0 just use the inverse of the first check ie. ! >= v0.7.0. Signed-off-by: Ciara Loftus --- drivers/net/af_xdp/meson.build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/af_xdp/meson.build b/drivers/net/af_xdp/meson.build index 1e0de23705..c90ab10a7b 100644 --- a/drivers/net/af_xdp/meson.build +++ b/drivers/net/af_xdp/meson.build @@ -9,10 +9,14 @@ endif sources = files('rte_eth_af_xdp.c') +bpf_ver_dep = false + xdp_dep = dependency('libxdp', version : '>=1.2.2', required: false, method: 'pkg-config') bpf_dep = dependency('libbpf', required: false, method: 'pkg-config') if not bpf_dep.found() bpf_dep = cc.find_library('bpf', required: false) +else + bpf_ver_dep = dependency('libbpf', version : '>=0.7.0', required: false, method: 'pkg-config') endif if cc.has_header('linux/if_xdp.h') @@ -22,8 +26,6 @@ if cc.has_header('linux/if_xdp.h') cflags += ['-DRTE_NET_AF_XDP_SHARED_UMEM'] ext_deps += xdp_dep ext_deps += bpf_dep - bpf_ver_dep = dependency('libbpf', version : '>=0.7.0', - required: false, method: 'pkg-config') if bpf_ver_dep.found() cflags += ['-DRTE_NET_AF_XDP_LIBBPF_OBJ_OPEN'] endif @@ -33,10 +35,8 @@ if cc.has_header('linux/if_xdp.h') endif elif bpf_dep.found() and cc.has_header('bpf/xsk.h') and cc.has_header('bpf/bpf.h') # libxdp not found. Rely solely on libbpf for xsk functionality - # which is only available in versions <= v0.6.0. - bpf_ver_dep = dependency('libbpf', version : '<=0.6.0', - required: false, method: 'pkg-config') - if bpf_ver_dep.found() + # which is only available in versions < v0.7.0. + if not bpf_ver_dep.found() ext_deps += bpf_dep bpf_shumem_ver_dep = dependency('libbpf', version : '>=0.2.0', required: false, method: 'pkg-config') -- 2.25.1