From patchwork Mon Oct 2 12:48:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Koikkara Reeny, Shibin" X-Patchwork-Id: 132264 X-Patchwork-Delegate: ferruh.yigit@amd.com 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 2B530426A2; Mon, 2 Oct 2023 14:49:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EDA4C40294; Mon, 2 Oct 2023 14:49:00 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id ACBC44003C for ; Mon, 2 Oct 2023 14:48:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696250939; x=1727786939; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9xN+hiNu6qmvuzLzPXw0u/dsQkg6oF7ZpYbKg8QV2k4=; b=LVC6YOWcKbUZOB2dKWVTrPIJDNAGYBfZ9fgwgkaZgrekrGgyB33J+8tC QDlJTZt/pts6UmrWAA80Nc1KO4FCWjIFMS3gVjLFCcsjn2IqTl/T93fCL x9BXD7bJRhK9SI9lrfGdkjAKEUqHwWvWzMrmusVDNXcYeoaQ4hoh0ioO+ XxGuFk4WMJgWX0h+0ztExzI4gPoeuxXptJhAAw+En048aLbRKlvJH+QKe PgKrqszAajp4GJTkNTEz4UJ17+5rErQLiYTjvSZWugd8A2JF4PKJfZbSX FLEy83nS3PzrpaV0/Us7pXSLQblW3dvJp40IOBpjavCp+yVLkhiuh65BM A==; X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="362901214" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="362901214" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 05:48:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="840970483" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="840970483" Received: from silpixa00401350.ir.intel.com ([10.55.128.166]) by FMSMGA003.fm.intel.com with ESMTP; 02 Oct 2023 05:48:56 -0700 From: Shibin Koikkara Reeny To: dev@dpdk.org, ciara.loftus@intel.com, bruce.richardson@intel.com Cc: qi.z.zhang@intel.com, john.mcnamara@intel.com, Shibin Koikkara Reeny Subject: [PATCH v4] net/af_xdp: fix missing UMEM feature Date: Mon, 2 Oct 2023 12:48:52 +0000 Message-Id: <20231002124852.76374-1-shibin.koikkara.reeny@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230928092553.339452-1-shibin.koikkara.reeny@intel.com> References: <20230928092553.339452-1-shibin.koikkara.reeny@intel.com> 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 Shared UMEM feature is missing in the af_xdp driver build after the commit 33d66940e9ba ("build: use C11 standard"). Runtime Error log while using Shared UMEM feature: rte_pmd_af_xdp_probe(): Initializing pmd_af_xdp for net_af_xdp0 init_internals(): Shared UMEM feature not available. Check kernel and libbpf version rte_pmd_af_xdp_probe(): Failed to init internals vdev_probe(): failed to initialize net_af_xdp0 device EAL: Bus (vdev) probe failed. Reason for the missing UMEM feature is because the C11 standard doesn't include the GNU compiler extensions typeof and asm, used by the libbpf and libxdp header files. Meson error log: In file included from dpdk/build/meson-private/tmpf74nkhqd/testfile.c:5: /usr/local/include/bpf/xsk.h: In function 'xsk_prod_nb_free': /usr/local/include/bpf/xsk.h:165:26: error: expected ';' before '___p1' 165 | r->cached_cons = libbpf_smp_load_acquire(r->consumer); | ^~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/bpf/xsk.h:165:26: error: 'asm' undeclared (first use in this function) ... /usr/local/include/bpf/xsk.h:199:9: error: unknown type name 'typeof' 199 | libbpf_smp_store_release(prod->producer, *prod->producer + nb); | ^~~~~~~~~~~~~~~~~~~~~~~~ Fix is to provide alternative keywords by using macros [1]. Fixes: 33d66940e9ba ("build: use C11 standard") [1] https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html v4: Updated the commit message. v3: Used alternative keywords fix. v2: Added original commit causing the issue. Signed-off-by: Shibin Koikkara Reeny Reviewed-by: Bruce Richardson --- drivers/net/af_xdp/meson.build | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/net/af_xdp/meson.build b/drivers/net/af_xdp/meson.build index 9a8dbb4d49..9f33e57fa2 100644 --- a/drivers/net/af_xdp/meson.build +++ b/drivers/net/af_xdp/meson.build @@ -48,6 +48,14 @@ endif if build xsk_check_prefix = ''' +#ifndef typeof +#define typeof __typeof__ +#endif + +#ifndef asm +#define asm __asm__ +#endif + #ifdef RTE_NET_AF_XDP_LIBXDP #include #else @@ -56,17 +64,17 @@ if build ''' if cc.has_function('xsk_socket__create_shared', prefix : xsk_check_prefix, - dependencies : ext_deps) + dependencies : ext_deps, args: cflags) cflags += ['-DRTE_NET_AF_XDP_SHARED_UMEM'] endif if cc.has_function('bpf_object__next_program', prefix : '#include ', - dependencies : bpf_dep) + dependencies : bpf_dep, args: cflags) cflags += ['-DRTE_NET_AF_XDP_LIBBPF_OBJ_OPEN'] endif if cc.has_function('bpf_xdp_attach', prefix : '#include ', - dependencies : bpf_dep) + dependencies : bpf_dep, args: cflags) cflags += ['-DRTE_NET_AF_XDP_LIBBPF_XDP_ATTACH'] endif endif