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 DBE3FA057F for ; Tue, 28 Jun 2022 17:19:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D30B940042; Tue, 28 Jun 2022 17:19:53 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id B422240042 for ; Tue, 28 Jun 2022 17:19:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656429590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Yr8xS+nSbyaJffEwnIxGrZddSiu+JvD8fGFj6Rqi1RM=; b=Dq8PbEMeISy/VlgC87JpR5CTBptTBaq07BtXomaaW1k3a/btsI5CT0YAf1N//PqzqtHulx Vii7jIvkxFkOIgkDyGTsegp6OHQaObjptKhpDvR8aQkEnfGN0C15H0aw+Aj93yNL9PC4f7 7n5cVqu7NC/CJXXdsllKXZ0dfw4gGhw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-327-JRSfae-1N52I5v1ryzG5dw-1; Tue, 28 Jun 2022 11:19:47 -0400 X-MC-Unique: JRSfae-1N52I5v1ryzG5dw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D17B4801E80; Tue, 28 Jun 2022 15:19:46 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.194.217]) by smtp.corp.redhat.com (Postfix) with ESMTP id E144F1410F3B; Tue, 28 Jun 2022 15:19:45 +0000 (UTC) From: Kevin Traynor To: Bruce Richardson Cc: Conor Walsh , dpdk stable Subject: patch 'dma/idxd: fix AVX2 in non-datapath functions' has been queued to stable release 21.11.2 Date: Tue, 28 Jun 2022 16:19:15 +0100 Message-Id: <20220628151938.2278711-3-ktraynor@redhat.com> In-Reply-To: <20220628151938.2278711-1-ktraynor@redhat.com> References: <20220628151938.2278711-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 21.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/30/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/d6e109f8aaac7b80ae2ba3a43419ae63739ac4d6 Thanks. Kevin --- >From d6e109f8aaac7b80ae2ba3a43419ae63739ac4d6 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Fri, 17 Jun 2022 11:59:20 +0100 Subject: [PATCH] dma/idxd: fix AVX2 in non-datapath functions [ upstream commit aa802b10237c2f7d3b0d0498de9b2fb438f9b9a2 ] While all systems which will use the idxd driver for hardware will support AVX2, if the driver is present the initialization functions e.g. to register logs, will be called on all systems - irrespective of HW support. This can cause issues if the system running DPDK does not have AVX2, and the compiler has included AVX instructions in the initialization code. To fix this, remove AVX2 instruction set from the whole build of the driver. Instead, we add "target(avx2)" attribute to all datapath functions, so those - and only those functions - will having AVX2 instructions in them. Bugzilla ID: 1038 Fixes: 3d36a0a1c7de ("dma/idxd: add data path job submission") Signed-off-by: Bruce Richardson Acked-by: Conor Walsh --- drivers/dma/idxd/idxd_common.c | 23 +++++++++++++++++++++++ drivers/dma/idxd/meson.build | 1 - 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/dma/idxd/idxd_common.c b/drivers/dma/idxd/idxd_common.c index ea6413cc7a..c77200a457 100644 --- a/drivers/dma/idxd/idxd_common.c +++ b/drivers/dma/idxd/idxd_common.c @@ -14,4 +14,14 @@ #define IDXD_PMD_NAME_STR "dmadev_idxd" +/* systems with DSA all support AVX2 so allow our data-path functions to + * always use at least that instruction set + */ +#ifndef __AVX2__ +#define __use_avx2 __attribute__((target("avx2"))) +#else +#define __use_avx2 +#endif + +__use_avx2 static __rte_always_inline rte_iova_t __desc_idx_to_iova(struct idxd_dmadev *idxd, uint16_t n) @@ -20,4 +30,5 @@ __desc_idx_to_iova(struct idxd_dmadev *idxd, uint16_t n) } +__use_avx2 static __rte_always_inline void __idxd_movdir64b(volatile void *dst, const struct idxd_hw_desc *src) @@ -29,4 +40,5 @@ __idxd_movdir64b(volatile void *dst, const struct idxd_hw_desc *src) } +__use_avx2 static __rte_always_inline void __submit(struct idxd_dmadev *idxd) @@ -75,4 +87,5 @@ __submit(struct idxd_dmadev *idxd) } +__use_avx2 static __rte_always_inline int __idxd_write_desc(struct idxd_dmadev *idxd, @@ -113,4 +126,5 @@ __idxd_write_desc(struct idxd_dmadev *idxd, } +__use_avx2 int idxd_enqueue_copy(void *dev_private, uint16_t qid __rte_unused, rte_iova_t src, @@ -127,4 +141,5 @@ idxd_enqueue_copy(void *dev_private, uint16_t qid __rte_unused, rte_iova_t src, } +__use_avx2 int idxd_enqueue_fill(void *dev_private, uint16_t qid __rte_unused, uint64_t pattern, @@ -137,4 +152,5 @@ idxd_enqueue_fill(void *dev_private, uint16_t qid __rte_unused, uint64_t pattern } +__use_avx2 int idxd_submit(void *dev_private, uint16_t qid __rte_unused) @@ -144,4 +160,5 @@ idxd_submit(void *dev_private, uint16_t qid __rte_unused) } +__use_avx2 static enum rte_dma_status_code get_comp_status(struct idxd_completion *c) @@ -164,4 +181,5 @@ get_comp_status(struct idxd_completion *c) } +__use_avx2 int idxd_vchan_status(const struct rte_dma_dev *dev, uint16_t vchan __rte_unused, @@ -181,4 +199,5 @@ idxd_vchan_status(const struct rte_dma_dev *dev, uint16_t vchan __rte_unused, } +__use_avx2 static __rte_always_inline int batch_ok(struct idxd_dmadev *idxd, uint16_t max_ops, enum rte_dma_status_code *status) @@ -225,4 +244,5 @@ batch_ok(struct idxd_dmadev *idxd, uint16_t max_ops, enum rte_dma_status_code *s } +__use_avx2 static inline uint16_t batch_completed(struct idxd_dmadev *idxd, uint16_t max_ops, bool *has_error) @@ -276,4 +296,5 @@ batch_completed(struct idxd_dmadev *idxd, uint16_t max_ops, bool *has_error) } +__use_avx2 static uint16_t batch_completed_status(struct idxd_dmadev *idxd, uint16_t max_ops, enum rte_dma_status_code *status) @@ -367,4 +388,5 @@ batch_completed_status(struct idxd_dmadev *idxd, uint16_t max_ops, enum rte_dma_ } +__use_avx2 uint16_t idxd_completed(void *dev_private, uint16_t qid __rte_unused, uint16_t max_ops, @@ -384,4 +406,5 @@ idxd_completed(void *dev_private, uint16_t qid __rte_unused, uint16_t max_ops, } +__use_avx2 uint16_t idxd_completed_status(void *dev_private, uint16_t qid __rte_unused, uint16_t max_ops, diff --git a/drivers/dma/idxd/meson.build b/drivers/dma/idxd/meson.build index f1396be945..dcc0a297d7 100644 --- a/drivers/dma/idxd/meson.build +++ b/drivers/dma/idxd/meson.build @@ -6,5 +6,4 @@ reason = 'only supported on x86' deps += ['bus_pci'] -cflags += '-mavx2' # all platforms with idxd HW support AVX sources = files( 'idxd_common.c', -- 2.34.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-28 16:18:04.131063251 +0100 +++ 0003-dma-idxd-fix-AVX2-in-non-datapath-functions.patch 2022-06-28 16:18:03.998387177 +0100 @@ -1 +1 @@ -From aa802b10237c2f7d3b0d0498de9b2fb438f9b9a2 Mon Sep 17 00:00:00 2001 +From d6e109f8aaac7b80ae2ba3a43419ae63739ac4d6 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit aa802b10237c2f7d3b0d0498de9b2fb438f9b9a2 ] + @@ -20 +21,0 @@ -Cc: stable@dpdk.org