patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: Conor Walsh <conor.walsh@intel.com>, dpdk stable <stable@dpdk.org>
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	[thread overview]
Message-ID: <20220628151938.2278711-3-ktraynor@redhat.com> (raw)
In-Reply-To: <20220628151938.2278711-1-ktraynor@redhat.com>

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 <bruce.richardson@intel.com>
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 <bruce.richardson@intel.com>
Acked-by: Conor Walsh <conor.walsh@intel.com>
---
 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


  parent reply	other threads:[~2022-06-28 15:19 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 15:19 patch 'raw/ioat: fix build missing errno include' " Kevin Traynor
2022-06-28 15:19 ` patch 'raw/ioat: fix build when ioat dmadev enabled' " Kevin Traynor
2022-06-28 15:19 ` Kevin Traynor [this message]
2022-06-28 15:19 ` patch 'dma/idxd: fix non-AVX builds with old compilers' " Kevin Traynor
2022-06-28 15:19 ` patch 'rib: fix references for IPv6 implementation' " Kevin Traynor
2022-06-28 15:19 ` patch 'test/hash: fix out of bound access' " Kevin Traynor
2022-06-28 15:19 ` patch 'app/procinfo: show all non-owned ports' " Kevin Traynor
2022-06-28 15:19 ` patch 'test: check memory allocation for CRC' " Kevin Traynor
2022-06-28 15:19 ` patch 'app/testpmd: cleanup port resources after implicit close' " Kevin Traynor
2022-06-28 15:19 ` patch 'app/testpmd: fix flex parser destroy command' " Kevin Traynor
2022-06-28 15:19 ` patch 'net: fix GTP PSC headers' " Kevin Traynor
2022-06-28 15:19 ` patch 'app/testpmd: fix GTP PSC raw processing' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/hns3: fix link status capability query from VF' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/hns3: support backplane media type' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/hns3: fix PTP interrupt logging' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/hns3: fix statistics locking' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/hns3: fix descriptors check with SVE' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/hns3: delete unused code' " Kevin Traynor
2022-06-28 15:19 ` patch 'examples/distributor: fix distributor on Rx core' " Kevin Traynor
2022-06-28 15:19 ` patch 'doc: add more instructions for running as non-root' " Kevin Traynor
2022-06-28 20:26   ` Dmitry Kozlyuk
2022-06-28 15:19 ` patch 'net/bnxt: fix switch domain allocation' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/bnxt: allow Tx only or Rx only' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/bnxt: fix setting forced speed' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/bnxt: disallow MTU change when device is started' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/bnxt: cleanup MTU setting' " Kevin Traynor
2022-06-28 15:19 ` patch 'net/bnxt: fix check for autoneg enablement in the PHY FW' " Kevin Traynor
2022-07-06 20:34   ` patch 'test/crypto: fix authentication IV for ZUC SGL' " luca.boccassi
2022-07-06 20:34     ` patch 'test/crypto: fix ZUC vector IV format' " luca.boccassi
2022-07-06 20:34     ` patch 'test/crypto: fix SNOW3G " luca.boccassi
2022-07-06 20:34     ` patch 'examples/fips_validation: handle empty payload' " luca.boccassi
2022-07-07  7:22       ` [EXT] " Gowrishankar Muthukrishnan
2022-07-07  7:31         ` Gowrishankar Muthukrishnan
2022-07-06 20:34     ` patch 'crypto/qat: fix DOCSIS crash' " luca.boccassi
2022-07-06 20:34     ` patch 'doc: fix grammar and formatting in compressdev guide' " luca.boccassi
2022-07-06 20:34     ` patch 'doc: fix grammar and parameters in l2fwd-crypto " luca.boccassi
2022-07-06 20:34     ` patch 'eventdev/eth_tx: fix queue delete' " luca.boccassi
2022-07-06 20:34     ` patch 'app/testpmd: fix supported RSS offload display' " luca.boccassi
2022-07-06 20:34     ` patch 'net/netvsc: fix vmbus device reference in multi-process' " luca.boccassi
2022-07-06 20:34     ` patch 'net/virtio-user: fix socket non-blocking mode' " luca.boccassi
2022-07-06 20:34     ` patch 'doc: fix readability in vhost guide' " luca.boccassi
2022-07-06 20:34     ` patch 'net/vhost: fix deadlock on vring state change' " luca.boccassi
2022-07-06 20:34     ` patch 'vdpa/sfc: fix sync between QEMU and vhost-user' " luca.boccassi
2022-07-06 20:34     ` patch 'vhost: add some trailing newline in log messages' " luca.boccassi
2022-07-06 20:34     ` patch 'vhost: restore device information " luca.boccassi
2022-07-06 20:34     ` patch 'net/virtio-user: fix Rx interrupts with multi-queue' " luca.boccassi
2022-07-06 20:34     ` patch 'common/cnxk: fix GRE tunnel parsing' " luca.boccassi
2022-07-06 20:34     ` patch 'net/iavf: fix VF reset' " luca.boccassi
2022-07-06 20:34     ` patch 'net/igc: support multi-process' " luca.boccassi
2022-07-06 20:34     ` patch 'service: fix lingering active status' " luca.boccassi
2022-07-06 20:34     ` patch 'gro: fix identifying fragmented packets' " luca.boccassi
2022-07-06 20:34     ` patch 'common/cnxk: allow changing PTP mode on CN10K' " luca.boccassi
2022-07-06 20:34     ` patch 'common/mlx5: fix non-expandable global MR cache' " luca.boccassi
2022-07-06 20:35     ` patch 'net/mlx5: reject negative integrity item configuration' " luca.boccassi
2022-07-06 20:35     ` patch 'dma/idxd: fix memory leak in PCI close' " luca.boccassi
2022-07-06 20:35     ` patch 'dma/idxd: fix partial freeing " luca.boccassi
2022-07-06 20:35     ` patch 'dma/idxd: fix null dereference in PCI remove' " luca.boccassi
2022-07-06 20:35     ` patch 'app/regex: avoid division by zero' " luca.boccassi
2022-07-06 20:35     ` patch 'app/regex: fix mbuf size for multi-segment buffer' " luca.boccassi
2022-07-06 20:35     ` patch 'avoid AltiVec keyword vector' " luca.boccassi
2022-07-12 19:23       ` patch 'examples/link_status_interrupt: fix stats refresh rate' " luca.boccassi
2022-07-12 19:23         ` patch 'vdpa/mlx5: fix leak on event thread creation' " luca.boccassi
2022-07-12 19:23         ` patch 'vdpa/ifc/base: fix null pointer dereference' " luca.boccassi
2022-07-13  2:13           ` Pei, Andy
2022-07-12 19:23         ` patch 'vdpa/sfc: resolve race between vhost lib and device conf' " luca.boccassi
2022-07-12 19:23         ` patch 'net/iavf: fix GTP-U extension flow' " luca.boccassi
2022-07-12 19:23         ` patch 'app/testpmd: fix GTP PSC raw processing' " luca.boccassi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220628151938.2278711-3-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=conor.walsh@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).