From patchwork Wed Oct 5 09:50:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Rybchenko X-Patchwork-Id: 117379 X-Patchwork-Delegate: andrew.rybchenko@oktetlabs.ru Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 053A1A0542; Wed, 5 Oct 2022 11:51:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B035A4280E; Wed, 5 Oct 2022 11:50:50 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id AF07040DFB for ; Wed, 5 Oct 2022 11:50:47 +0200 (CEST) Received: by shelob.oktetlabs.ru (Postfix, from userid 115) id 7D28490; Wed, 5 Oct 2022 12:50:47 +0300 (MSK) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mail1.oktetlabs.ru X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_DISCARD, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from aros.oktetlabs.ru (aros.oktetlabs.ru [192.168.38.17]) by shelob.oktetlabs.ru (Postfix) with ESMTP id 707B274; Wed, 5 Oct 2022 12:50:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 707B274 Authentication-Results: shelob.oktetlabs.ru/707B274; dkim=none; dkim-atps=neutral From: Andrew Rybchenko To: Ciara Loftus , Qi Zhang Cc: dev@dpdk.org Subject: [PATCH v3 3/6] net/af_xdp: avoid version-based check for shared UMEM Date: Wed, 5 Oct 2022 12:50:34 +0300 Message-Id: <20221005095037.997006-5-andrew.rybchenko@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221005095037.997006-1-andrew.rybchenko@oktetlabs.ru> References: <20220624102354.1516606-1-ciara.loftus@intel.com> <20221005095037.997006-1-andrew.rybchenko@oktetlabs.ru> MIME-Version: 1.0 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 Check for xsk_socket__create_shared() function instead. Signed-off-by: Andrew Rybchenko --- drivers/net/af_xdp/meson.build | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/net/af_xdp/meson.build b/drivers/net/af_xdp/meson.build index fa011c357d..a01a67c7e7 100644 --- a/drivers/net/af_xdp/meson.build +++ b/drivers/net/af_xdp/meson.build @@ -19,7 +19,6 @@ endif if cc.has_header('linux/if_xdp.h') if xdp_dep.found() and cc.has_header('xdp/xsk.h') cflags += ['-DRTE_NET_AF_XDP_LIBXDP'] - cflags += ['-DRTE_NET_AF_XDP_SHARED_UMEM'] ext_deps += xdp_dep if bpf_dep.found() and cc.has_header('bpf/bpf.h') ext_deps += bpf_dep @@ -39,11 +38,6 @@ if cc.has_header('linux/if_xdp.h') required: false, method: 'pkg-config') if bpf_ver_dep.found() ext_deps += bpf_dep - bpf_shumem_ver_dep = dependency('libbpf', version : '>=0.2.0', - required: false, method: 'pkg-config') - if bpf_shumem_ver_dep.found() - cflags += ['-DRTE_NET_AF_XDP_SHARED_UMEM'] - endif else build = false reason = 'missing dependency, "libxdp ' + libxdp_ver + '" or "libbpf <= v0.6.0"' @@ -56,3 +50,18 @@ else build = false reason = 'missing header, "linux/if_xdp.h"' endif + +if build + xsk_check_prefix = ''' +#ifdef RTE_NET_AF_XDP_LIBXDP +#include +#else +#include +#endif + ''' + + if cc.has_function('xsk_socket__create_shared', prefix : xsk_check_prefix, + dependencies : ext_deps) + cflags += ['-DRTE_NET_AF_XDP_SHARED_UMEM'] + endif +endif