aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Bowling <kbowling@FreeBSD.org>2023-08-14 01:47:09 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2023-08-25 07:17:23 +0000
commit42d73e9ec1464a4ebc26d32201def571550e9ba9 (patch)
tree1e7b628c9f98f6e3ab1af4368a7809f9b2c71a82
parent94fb5053dabdb0e5877d246b6569f37d680290fb (diff)
downloadsrc-42d73e9ec1464a4ebc26d32201def571550e9ba9.tar.gz
src-42d73e9ec1464a4ebc26d32201def571550e9ba9.zip
ixgbe: define IXGBE_LE32_TO_CPUS
Richard Lowe notes in PR 170267 IXGBE_LE32_TO_CPUS was previously directly defined as le32dec() which is a pure function but the shared code is expecting an in place conversion. In SVN r282289 its assignment was removed altogether. There was some deliberation in the PR on what to define this as, we just need to do the update in place which is easy enough. The uintptr_t casts in the shared code were from a DPDK sync and are unwanted with our new ixgbe_osdep.h implementation. PR: 170267 Reported by: Richard Lowe <richlowe@richlowe.net> (cherry picked from commit bef7d49101cdf28830a648f63ff00998fbe54715)
-rw-r--r--sys/dev/ixgbe/ixgbe_common.c4
-rw-r--r--sys/dev/ixgbe/ixgbe_osdep.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c
index 91c12eadd1e3..6c1396ad964f 100644
--- a/sys/dev/ixgbe/ixgbe_common.c
+++ b/sys/dev/ixgbe/ixgbe_common.c
@@ -4640,7 +4640,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
/* first pull in the header so we know the buffer length */
for (bi = 0; bi < dword_len; bi++) {
buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);
- IXGBE_LE32_TO_CPUS((uintptr_t)&buffer[bi]);
+ IXGBE_LE32_TO_CPUS(&buffer[bi]);
}
/*
@@ -4676,7 +4676,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
/* Pull in the rest of the buffer (bi is where we left off) */
for (; bi <= dword_len; bi++) {
buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi);
- IXGBE_LE32_TO_CPUS((uintptr_t)&buffer[bi]);
+ IXGBE_LE32_TO_CPUS(&buffer[bi]);
}
rel_out:
diff --git a/sys/dev/ixgbe/ixgbe_osdep.h b/sys/dev/ixgbe/ixgbe_osdep.h
index 92942cbab103..7aabfea66484 100644
--- a/sys/dev/ixgbe/ixgbe_osdep.h
+++ b/sys/dev/ixgbe/ixgbe_osdep.h
@@ -134,7 +134,7 @@ enum {
#define IXGBE_CPU_TO_LE16 htole16
#define IXGBE_CPU_TO_LE32 htole32
#define IXGBE_LE32_TO_CPU le32toh
-#define IXGBE_LE32_TO_CPUS(x)
+#define IXGBE_LE32_TO_CPUS(x) *(x) = le32dec(x)
#define IXGBE_CPU_TO_BE16 htobe16
#define IXGBE_CPU_TO_BE32 htobe32
#define IXGBE_BE32_TO_CPU be32toh