From patchwork Thu Sep 28 09:25:53 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: 132097 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 C81094265E; Thu, 28 Sep 2023 11:26:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4696540273; Thu, 28 Sep 2023 11:26:02 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 36B9E40150 for ; Thu, 28 Sep 2023 11:26:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695893160; x=1727429160; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=25FJAGAA6Z8hYYsFIemIophdfwlq4TjHlfE2SbEHeIY=; b=CAquvbbiUiUrX9ojCrMGSpiF9qeOmm+NfHQ/VuAoqWEd7000Tx76xUW2 SPo8zvaKPqUPZ8PnW+F7ZrK8oJLb9pNLKZlNNay7Kz31iHrrz8OtInpf6 DoIRsWFxXfh4uzk8Gawo3b4Ks0zCq6wi9wLhqXo8pojJpAG9jQcX7ijNd At4MU0T9VRp1XxdZyWAhjUAr4AM6OYBj3U+FkhCOBkAybTmxHJy/VYDDp nmiXxxxqGvwpRSb26usepZAwsDOAmQlixua5QXtVnMUl0pM7u0gNqgYTl uHLhi62/rJv46v05ZFupOII97I3BwtOsAsID9EWl92PQ9IXmTgImxyXBo Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10846"; a="380896325" X-IronPort-AV: E=Sophos;i="6.03,183,1694761200"; d="scan'208";a="380896325" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Sep 2023 02:25:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10846"; a="743017233" X-IronPort-AV: E=Sophos;i="6.03,183,1694761200"; d="scan'208";a="743017233" Received: from silpixa00401350.ir.intel.com ([10.55.128.41]) by orsmga007.jf.intel.com with ESMTP; 28 Sep 2023 02:25: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 v3] net/af_xdp: fix missing UMEM feature Date: Thu, 28 Sep 2023 09:25:53 +0000 Message-Id: <20230928092553.339452-1-shibin.koikkara.reeny@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230922093103.58541-1-shibin.koikkara.reeny@intel.com> References: <20230922093103.58541-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 Option Controlling C Dialect [1]. Fixes: 33d66940e9ba ("build: use C11 standard") [1] https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html v3: Used alternative keywords fix. v2: Added original commit causing the issue. Signed-off-by: Shibin Koikkara Reeny Acked-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