patches for DPDK stable branches
 help / color / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Andrew Rybchenko <arybchenko@solarflare.com>
Cc: dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'net/sfc: unify power of 2 alignment check macro' has been queued to LTS release 18.11.3
Date: Thu,  5 Sep 2019 11:17:09 +0100
Message-ID: <20190905101754.21933-9-ktraynor@redhat.com> (raw)
In-Reply-To: <20190905101754.21933-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to LTS release 18.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 09/12/19. 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-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/fc3912e3ff0a47ae476fa41067724f804283aa0c

Thanks.

Kevin Traynor

---
From fc3912e3ff0a47ae476fa41067724f804283aa0c Mon Sep 17 00:00:00 2001
From: Andrew Rybchenko <arybchenko@solarflare.com>
Date: Wed, 24 Jul 2019 14:16:34 +0100
Subject: [PATCH] net/sfc: unify power of 2 alignment check macro

[ upstream commit 0270853d94e298820f3361b43dfdbf95e6a05c88 ]

Substitute driver-defined IS_P2ALIGNED() with EFX_IS_P2ALIGNED()
defined in libefx.

Add type argument and cast value and alignment to one specified type.

Fixes: e1b944598579 ("net/sfc: build libefx")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/sfc/base/ef10_rx.c |  4 ++--
 drivers/net/sfc/base/efx.h     |  4 ++++
 drivers/net/sfc/efsys.h        | 43 +++++++++++++++++++---------------
 3 files changed, 30 insertions(+), 21 deletions(-)

diff --git a/drivers/net/sfc/base/ef10_rx.c b/drivers/net/sfc/base/ef10_rx.c
index 6e3277daf..d182ec801 100644
--- a/drivers/net/sfc/base/ef10_rx.c
+++ b/drivers/net/sfc/base/ef10_rx.c
@@ -1097,10 +1097,10 @@ ef10_rx_qcreate(
 			goto fail7;
 		}
-		if (!IS_P2ALIGNED(es_max_dma_len,
+		if (!EFX_IS_P2ALIGNED(uint32_t, es_max_dma_len,
 			    EFX_RX_ES_SUPER_BUFFER_BUF_ALIGNMENT)) {
 			rc = EINVAL;
 			goto fail8;
 		}
-		if (!IS_P2ALIGNED(es_buf_stride,
+		if (!EFX_IS_P2ALIGNED(uint32_t, es_buf_stride,
 			    EFX_RX_ES_SUPER_BUFFER_BUF_ALIGNMENT)) {
 			rc = EINVAL;
diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h
index eacd431df..444f6d1db 100644
--- a/drivers/net/sfc/base/efx.h
+++ b/drivers/net/sfc/base/efx.h
@@ -37,4 +37,8 @@ extern "C" {
 	((_type)(_value) & -(_type)(_align))
 
+/* Test if value is power of 2 aligned. */
+#define	EFX_IS_P2ALIGNED(_type, _value, _align)	\
+	((((_type)(_value)) & ((_type)(_align) - 1)) == 0)
+
 /* Return codes */
 
diff --git a/drivers/net/sfc/efsys.h b/drivers/net/sfc/efsys.h
index 8fd6e1bb5..2bfa29e79 100644
--- a/drivers/net/sfc/efsys.h
+++ b/drivers/net/sfc/efsys.h
@@ -70,11 +70,4 @@ typedef bool boolean_t;
 #endif
 
-/* There are macros for alignment in DPDK, but we need to make a proper
- * correspondence here, if we want to re-use them at all
- */
-#ifndef IS_P2ALIGNED
-#define IS_P2ALIGNED(v, a)	((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)
-#endif
-
 #ifndef ISP2
 #define ISP2(x)			rte_is_power_of_2(x)
@@ -228,5 +221,6 @@ typedef struct efsys_mem_s {
 									\
 		_NOTE(CONSTANTCONDITION);				\
-		SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_dword_t)));	\
+		SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset,		\
+					    sizeof(efx_dword_t)));	\
 									\
 		_addr = (volatile uint32_t *)(_base + (_offset));	\
@@ -245,5 +239,6 @@ typedef struct efsys_mem_s {
 									\
 		_NOTE(CONSTANTCONDITION);				\
-		SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_qword_t)));	\
+		SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset,		\
+					    sizeof(efx_qword_t)));	\
 									\
 		_addr = (volatile uint64_t *)(_base + (_offset));	\
@@ -263,5 +258,6 @@ typedef struct efsys_mem_s {
 									\
 		_NOTE(CONSTANTCONDITION);				\
-		SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_oword_t)));	\
+		SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset,		\
+					    sizeof(efx_oword_t)));	\
 									\
 		_addr = (volatile __m128i *)(_base + (_offset));	\
@@ -284,5 +280,6 @@ typedef struct efsys_mem_s {
 									\
 		_NOTE(CONSTANTCONDITION);				\
-		SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_dword_t)));	\
+		SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset,		\
+					    sizeof(efx_dword_t)));	\
 									\
 		EFSYS_PROBE2(mem_writed, unsigned int, (_offset),	\
@@ -301,5 +298,6 @@ typedef struct efsys_mem_s {
 									\
 		_NOTE(CONSTANTCONDITION);				\
-		SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_qword_t)));	\
+		SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset,		\
+					    sizeof(efx_qword_t)));	\
 									\
 		EFSYS_PROBE3(mem_writeq, unsigned int, (_offset),	\
@@ -319,5 +317,6 @@ typedef struct efsys_mem_s {
 									\
 		_NOTE(CONSTANTCONDITION);				\
-		SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_oword_t)));	\
+		SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset,		\
+					    sizeof(efx_oword_t)));	\
 									\
 									\
@@ -384,5 +383,6 @@ typedef struct efsys_bar_s {
 									\
 		_NOTE(CONSTANTCONDITION);				\
-		SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_dword_t)));	\
+		SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset,		\
+					    sizeof(efx_dword_t)));	\
 		_NOTE(CONSTANTCONDITION);				\
 		if (_lock)						\
@@ -408,5 +408,6 @@ typedef struct efsys_bar_s {
 									\
 		_NOTE(CONSTANTCONDITION);				\
-		SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_qword_t)));	\
+		SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset,		\
+					    sizeof(efx_qword_t)));	\
 									\
 		SFC_BAR_LOCK(_esbp);					\
@@ -430,5 +431,6 @@ typedef struct efsys_bar_s {
 									\
 		_NOTE(CONSTANTCONDITION);				\
-		SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_oword_t)));	\
+		SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset,		\
+					    sizeof(efx_oword_t)));	\
 									\
 		_NOTE(CONSTANTCONDITION);				\
@@ -460,5 +462,6 @@ typedef struct efsys_bar_s {
 									\
 		_NOTE(CONSTANTCONDITION);				\
-		SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_dword_t)));	\
+		SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset,		\
+					    sizeof(efx_dword_t)));	\
 									\
 		_NOTE(CONSTANTCONDITION);				\
@@ -485,5 +488,6 @@ typedef struct efsys_bar_s {
 									\
 		_NOTE(CONSTANTCONDITION);				\
-		SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_qword_t)));	\
+		SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset,		\
+					    sizeof(efx_qword_t)));	\
 									\
 		SFC_BAR_LOCK(_esbp);					\
@@ -519,5 +523,6 @@ typedef struct efsys_bar_s {
 									\
 		_NOTE(CONSTANTCONDITION);				\
-		SFC_ASSERT(IS_P2ALIGNED(_offset, sizeof(efx_oword_t)));	\
+		SFC_ASSERT(EFX_IS_P2ALIGNED(size_t, _offset,		\
+					    sizeof(efx_oword_t)));	\
 									\
 		_NOTE(CONSTANTCONDITION);				\
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-09-05 10:36:48.058773883 +0100
+++ 0009-net-sfc-unify-power-of-2-alignment-check-macro.patch	2019-09-05 10:36:47.473701408 +0100
@@ -1 +1 @@
-From 0270853d94e298820f3361b43dfdbf95e6a05c88 Mon Sep 17 00:00:00 2001
+From fc3912e3ff0a47ae476fa41067724f804283aa0c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0270853d94e298820f3361b43dfdbf95e6a05c88 ]
+
@@ -12 +13,0 @@
-Cc: stable@dpdk.org
@@ -22 +23 @@
-index bb4489bbf..5f5dd3c62 100644
+index 6e3277daf..d182ec801 100644
@@ -25,2 +26,2 @@
-@@ -1120,10 +1120,10 @@ ef10_rx_qcreate(
- 			goto fail9;
+@@ -1097,10 +1097,10 @@ ef10_rx_qcreate(
+ 			goto fail7;
@@ -32 +33 @@
- 			goto fail10;
+ 			goto fail8;
@@ -39 +40 @@
-index 6aff68b54..53ddaa987 100644
+index eacd431df..444f6d1db 100644
@@ -42 +43 @@
-@@ -38,4 +38,8 @@ extern "C" {
+@@ -37,4 +37,8 @@ extern "C" {
@@ -52 +53 @@
-index 79fd3c144..eab5479a4 100644
+index 8fd6e1bb5..2bfa29e79 100644
@@ -67 +68 @@
-@@ -232,5 +225,6 @@ typedef struct efsys_mem_s {
+@@ -228,5 +221,6 @@ typedef struct efsys_mem_s {
@@ -75 +76 @@
-@@ -249,5 +243,6 @@ typedef struct efsys_mem_s {
+@@ -245,5 +239,6 @@ typedef struct efsys_mem_s {
@@ -83 +84 @@
-@@ -267,5 +262,6 @@ typedef struct efsys_mem_s {
+@@ -263,5 +258,6 @@ typedef struct efsys_mem_s {
@@ -91 +92 @@
-@@ -288,5 +284,6 @@ typedef struct efsys_mem_s {
+@@ -284,5 +280,6 @@ typedef struct efsys_mem_s {
@@ -99 +100 @@
-@@ -305,5 +302,6 @@ typedef struct efsys_mem_s {
+@@ -301,5 +298,6 @@ typedef struct efsys_mem_s {
@@ -107 +108 @@
-@@ -323,5 +321,6 @@ typedef struct efsys_mem_s {
+@@ -319,5 +317,6 @@ typedef struct efsys_mem_s {
@@ -115 +116 @@
-@@ -388,5 +387,6 @@ typedef struct efsys_bar_s {
+@@ -384,5 +383,6 @@ typedef struct efsys_bar_s {
@@ -123 +124 @@
-@@ -412,5 +412,6 @@ typedef struct efsys_bar_s {
+@@ -408,5 +408,6 @@ typedef struct efsys_bar_s {
@@ -131 +132 @@
-@@ -434,5 +435,6 @@ typedef struct efsys_bar_s {
+@@ -430,5 +431,6 @@ typedef struct efsys_bar_s {
@@ -139 +140 @@
-@@ -464,5 +466,6 @@ typedef struct efsys_bar_s {
+@@ -460,5 +462,6 @@ typedef struct efsys_bar_s {
@@ -147 +148 @@
-@@ -489,5 +492,6 @@ typedef struct efsys_bar_s {
+@@ -485,5 +488,6 @@ typedef struct efsys_bar_s {
@@ -155 +156 @@
-@@ -523,5 +527,6 @@ typedef struct efsys_bar_s {
+@@ -519,5 +523,6 @@ typedef struct efsys_bar_s {

  parent reply index

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05 10:17 [dpdk-stable] patch 'ethdev: avoid getting uninitialized info for bad port' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'vfio: use contiguous mapping for IOVA as VA mode' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'compress/zlib: fix error handling' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'cryptodev: fix typo in comment' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'security: remove duplicated symbols from map file' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/i40e: fix RSS hash update for X722 VF' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/sfc: fix power of 2 round up when align has smaller type' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/sfc: fix align to power of 2 " Kevin Traynor
2019-09-05 10:17 ` Kevin Traynor [this message]
2019-09-05 10:17 ` [dpdk-stable] patch 'net/bnxt: fix extended port counter statistics' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/bnxt: reduce verbosity of a message' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/pcap: fix Rx with small buffers' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/pcap: fix Tx return count in error conditions' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/avf: fix endless loop' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/ixgbe: fix RETA size for VF' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'igb_uio: fix build on Linux 5.3 for fall through' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'distributor: fix livelock on flush' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'app/testpmd: fix eth packet dump for small buffers' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'app/testpmd: rename ambiguous VF config variable' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'examples/ip_frag: remove Tx fast free offload flag' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'examples/ptpclient: fix delay request message' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'test: enable installing app with meson' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'test/eal: fix --socket-mem option' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/virtio: fix build' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'examples/l3fwd: fix unaligned memory access on x86' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'eal: fix control thread affinity with --lcores' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'doc: update features supported by mlx' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'usertools: replace unsafe input function' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'devtools: fix building kernel component tags' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'test/flow_classify: fix undefined behavior' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'acl: fix undefined behavior of bit shifts' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'test: remove link to ixgbe/i40e with meson' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'eal: hide internal function' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'bus/pci: remove unused x86 Linux constant' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/dpaa: fix build with 0 headroom' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'bus/fslmc: " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/virtio: " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/ena: fix L4 checksum Tx offload' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'doc: add co-existence consideration for bnx2x' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'doc: add co-existence consideration for qede' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/thunderx: fix crash on detach' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'examples/bpf: fix build' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/ixgbe: fix address of first segment' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/i40e: " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/avf: " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/fm10k: " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/mlx4: fix crash on info query in secondary process' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/mlx5: fix validation of VLAN PCP item' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/mlx5: fix VLAN inner type matching on DR/DV' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/mlx5: fix link speed info when link is down' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'app/testpmd: fix latency stats deinit on signal' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/ixgbe/base: fix product version check' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'eal: increase maximum different hugepage sizes on Arm' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'usertools: fix input handling in telemetry script' " Kevin Traynor

Reply instructions:

You may reply publically 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=20190905101754.21933-9-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=arybchenko@solarflare.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

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox