From patchwork Thu Jun 23 13:49:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 113345 X-Patchwork-Delegate: thomas@monjalon.net 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 7F68FA0093; Thu, 23 Jun 2022 15:49:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D77B40A82; Thu, 23 Jun 2022 15:49:55 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id CF5C040042; Thu, 23 Jun 2022 15:49:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655992194; x=1687528194; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EaLyQHQeanlzllpBi3gJc/ZPz5CGUnbywnMf9SI/5LY=; b=nboFw34IWAvoqxxsl+Uq84TNB84UFiTEzwxfPRh0jkaRivcNtwAhatEk aBEXvMjj1pVGdwG0iUVyRUUJHsTKIDIEqhkuG0G4L7k9Gzbj5hQGVsDCb 5BlTq2FUm+N6wjj69PXSQ+y74CEhBw/ClG+xXRPUqTmGjsHEm7J7TsNyk 9HrLdUoW9K5VvRAVhzGtRf+HGc8yzKI3HL9W+lcilTJ7+OEUsg18yYvmM W6cnaxvFyZqMPutsIw/rbl+n9C+6c08RXSvWZG+uVvEoB+xdteVf16CLv 4NjbYcFrEHgQUT423Pf0P67kTH1uzIwxepieMfzOamBwslcjJbbiIzP8P A==; X-IronPort-AV: E=McAfee;i="6400,9594,10386"; a="281800691" X-IronPort-AV: E=Sophos;i="5.92,216,1650956400"; d="scan'208";a="281800691" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2022 06:49:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,216,1650956400"; d="scan'208";a="678065767" Received: from silpixa00401385.ir.intel.com (HELO silpixa00401385.ger.corp.intel.com.) ([10.237.223.125]) by FMSMGA003.fm.intel.com with ESMTP; 23 Jun 2022 06:49:51 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , stable@dpdk.org Subject: [PATCH 1/3] raw/ioat: fix build error for missing errno Date: Thu, 23 Jun 2022 14:49:31 +0100 Message-Id: <20220623134933.469240-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220623134933.469240-1-bruce.richardson@intel.com> References: <20220623134933.469240-1-bruce.richardson@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 The inline functions in rte_idxd_rawdev_fns.h make use of rte_errno, but the header with its definition is not included by that file leading to build errors. Fixes: f82c87eb14a4 ("raw/ioat: move idxd functions to separate file") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson --- drivers/raw/ioat/rte_idxd_rawdev_fns.h | 1 + 1 file changed, 1 insertion(+) -- 2.34.1 diff --git a/drivers/raw/ioat/rte_idxd_rawdev_fns.h b/drivers/raw/ioat/rte_idxd_rawdev_fns.h index 3ea25f6ca9..a07892faa0 100644 --- a/drivers/raw/ioat/rte_idxd_rawdev_fns.h +++ b/drivers/raw/ioat/rte_idxd_rawdev_fns.h @@ -16,6 +16,7 @@ */ #include +#include /* * Defines used in the data path for interacting with IDXD hardware. From patchwork Thu Jun 23 13:49:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 113346 X-Patchwork-Delegate: thomas@monjalon.net 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 7FB0AA0093; Thu, 23 Jun 2022 15:50:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B1206427EE; Thu, 23 Jun 2022 15:49:57 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 87FD541143; Thu, 23 Jun 2022 15:49:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655992195; x=1687528195; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hW4tS+WMGQjQI0YI2IgeNnORED+pKqlt93gaEO2OXiY=; b=N35uhNcyijSk+LkWeeJEdkiLWYbaVvVdTdboFrnQu996/ovlydsRkCBu tMaOzqTKlpplps6B7oYlQHvI9tuoXuBP6ZsqK0WKZwvwJk0gsP7IrSJM+ IEsdG2txMxCtACEemQrvBychPGjBR91h8rhr+2P+MrMxha8PwXjijDnay HtjoBQg+8fVQCVy+/14NxdvXIPc1YMXRIgvmM/SIYDIuSeEuXFyl5Soc8 2gjLsP+kvcewDcyXH0uOIVwaZ68umXNaIZjNX3KsbLoQgiybwi4Jgde48 G8bbFWOWJVWjF2hqhJ8MCUtH+GQOh6Twj98S4RDCY4JYynuO5Lr+RvLGQ g==; X-IronPort-AV: E=McAfee;i="6400,9594,10386"; a="281800702" X-IronPort-AV: E=Sophos;i="5.92,216,1650956400"; d="scan'208";a="281800702" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2022 06:49:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,216,1650956400"; d="scan'208";a="678065793" Received: from silpixa00401385.ir.intel.com (HELO silpixa00401385.ger.corp.intel.com.) ([10.237.223.125]) by FMSMGA003.fm.intel.com with ESMTP; 23 Jun 2022 06:49:54 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , stable@dpdk.org Subject: [PATCH 2/3] raw/ioat: fix build when ioat dmadev enabled Date: Thu, 23 Jun 2022 14:49:32 +0100 Message-Id: <20220623134933.469240-3-bruce.richardson@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220623134933.469240-1-bruce.richardson@intel.com> References: <20220623134933.469240-1-bruce.richardson@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 The build of the raw/ioat driver only occurs when the equivalent dmadev drivers are disabled. Complications occur when the ioat dmadev is being built but not the idxd. In this case, only the idxd part of raw/ioat gets built, but the definition of the logtype is in the ioat part, causing build errors. .../raw_ioat_idxd_bus.c.o: In function `idxd_vdev_mmap_wq': idxd_bus.c:(.text+0x116): undefined reference to `ioat_pmd_logtype' Fix this by moving the logtype definition to the common C file, and renaming it to avoid conflicts with a similarly named value in the dma/ioat driver. Fixes: ff06fa2cf3ba ("raw/ioat: probe idxd PCI") Cc: stable@dpdk.org Signed-off-by: Bruce Richardson --- drivers/raw/ioat/ioat_common.c | 2 ++ drivers/raw/ioat/ioat_private.h | 4 ++-- drivers/raw/ioat/ioat_rawdev.c | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/raw/ioat/ioat_common.c b/drivers/raw/ioat/ioat_common.c index 60de41152a..e44e181e58 100644 --- a/drivers/raw/ioat/ioat_common.c +++ b/drivers/raw/ioat/ioat_common.c @@ -9,6 +9,8 @@ #include "ioat_private.h" +RTE_LOG_REGISTER_DEFAULT(ioat_rawdev_logtype, INFO); + static const char * const xstat_names[] = { "failed_enqueues", "successful_enqueues", "copies_started", "copies_completed" diff --git a/drivers/raw/ioat/ioat_private.h b/drivers/raw/ioat/ioat_private.h index f032d5fe3d..7fb685a3d7 100644 --- a/drivers/raw/ioat/ioat_private.h +++ b/drivers/raw/ioat/ioat_private.h @@ -18,10 +18,10 @@ #include #include "rte_ioat_rawdev.h" -extern int ioat_pmd_logtype; +extern int ioat_rawdev_logtype; #define IOAT_PMD_LOG(level, fmt, args...) rte_log(RTE_LOG_ ## level, \ - ioat_pmd_logtype, "IOAT: %s(): " fmt "\n", __func__, ##args) + ioat_rawdev_logtype, "IOAT: %s(): " fmt "\n", __func__, ##args) #define IOAT_PMD_DEBUG(fmt, args...) IOAT_PMD_LOG(DEBUG, fmt, ## args) #define IOAT_PMD_INFO(fmt, args...) IOAT_PMD_LOG(INFO, fmt, ## args) diff --git a/drivers/raw/ioat/ioat_rawdev.c b/drivers/raw/ioat/ioat_rawdev.c index 5396671d4f..11341fcf5d 100644 --- a/drivers/raw/ioat/ioat_rawdev.c +++ b/drivers/raw/ioat/ioat_rawdev.c @@ -28,8 +28,6 @@ static struct rte_pci_driver ioat_pmd_drv; #define IOAT_DEVICE_ID_BDXF 0x6f2F #define IOAT_DEVICE_ID_ICX 0x0b00 -RTE_LOG_REGISTER_DEFAULT(ioat_pmd_logtype, INFO); - #define DESC_SZ sizeof(struct rte_ioat_generic_hw_desc) #define COMPLETION_SZ sizeof(__m128i) From patchwork Thu Jun 23 13:49:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 113347 X-Patchwork-Delegate: thomas@monjalon.net 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 73467A0093; Thu, 23 Jun 2022 15:50:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D551E4280B; Thu, 23 Jun 2022 15:49:58 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 990DF40042 for ; Thu, 23 Jun 2022 15:49:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655992197; x=1687528197; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XFH0349hlIyrhRodaeg7AvGz/fy9Mf/vKfcJF2xfmb4=; b=ZmPBAKwphaZOpIXG9gOs9HRYK2ZMFYpIvS/mlpXnp9Os+5vmf+VdU7As n7j7GpqR/y7UkMf54v/zUlPB1BNhhy1L7TKLpwAJdHNhjj5auhZ9yRxnW P2s/W+Nwf7V7cPBSIVByinOL/KXcm3dGGA5v9U5qC9N46e3z4nuH/JNmb yGeODXMTwq6ah7FVEywIodzMV8gneJqb9xQ2y7+pOrtRJBT9RDFNy6ZM3 0dKgTaq5DlEh2ZgMmIxyOLOQCptgMk6XUp/m/2lFHfgvZufk93X8Sagkz 4xZXdh8B5h/2WPssgDf47Dst3DR7E9Yqbxr2w739TrSGwPGEU6WdQIRzB g==; X-IronPort-AV: E=McAfee;i="6400,9594,10386"; a="281800711" X-IronPort-AV: E=Sophos;i="5.92,216,1650956400"; d="scan'208";a="281800711" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2022 06:49:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,216,1650956400"; d="scan'208";a="678065803" Received: from silpixa00401385.ir.intel.com (HELO silpixa00401385.ger.corp.intel.com.) ([10.237.223.125]) by FMSMGA003.fm.intel.com with ESMTP; 23 Jun 2022 06:49:56 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH 3/3] dma/idxd: fix non-AVX builds with older compilers Date: Thu, 23 Jun 2022 14:49:33 +0100 Message-Id: <20220623134933.469240-4-bruce.richardson@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220623134933.469240-1-bruce.richardson@intel.com> References: <20220623134933.469240-1-bruce.richardson@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 When building without AVX2 support using an older compiler e.g. gcc 4.8 on Centos/RHEL 7, we get build errors due to the use of AVX2 intrinsics. This is because the compiler does not support "__attribute__((target(AVX2)))" function attribute. Disable build of this driver such edge cases. Generic builds using recent compilers, and all builds with a minimum baseline of AVX2 are unaffected by this change. Fixes: aa802b10237c ("dma/idxd: fix AVX2 in non-datapath functions") Signed-off-by: Bruce Richardson Tested-by: Yu Jiang --- drivers/dma/idxd/meson.build | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.34.1 diff --git a/drivers/dma/idxd/meson.build b/drivers/dma/idxd/meson.build index dcc0a297d7..c5403b431c 100644 --- a/drivers/dma/idxd/meson.build +++ b/drivers/dma/idxd/meson.build @@ -4,6 +4,17 @@ build = dpdk_conf.has('RTE_ARCH_X86') reason = 'only supported on x86' +test_avx2_code = ''' +#include +__attribute__((target("avx2"))) +__m256i fn(void *x) { return _mm256_loadu_si256(x); } +''' +if build and not cc.compiles(test_avx2_code, args:machine_args) + build = false + reason = 'missing support for AVX2 function attribute' + subdir_done() +endif + deps += ['bus_pci'] sources = files( 'idxd_common.c',