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>
MFC after:	1 week
This commit is contained in:
Kevin Bowling 2023-08-13 18:47:09 -07:00
parent 69f8cc60aa
commit bef7d49101
2 changed files with 3 additions and 3 deletions

View File

@ -4641,7 +4641,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]);
}
/*
@ -4677,7 +4677,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:

View File

@ -135,7 +135,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