Skip to contentSkip to conversation

endianness of rlc buffers (SI)

DISCUSSION Sylvain BERTRAND 2 participants 4 messages Oct 22, 2013

lore
Share & tools
lore
#0 lore raw

Hi,

commit 555b1b651acf44bf27ebbb04235d38a8fd2d58dc (drm-fixes-3.12)

evergreen.c, SI code path, line 4045 and 4046 shouldn't be swapped? Should cpu_to_le32 be used?

Basically, is the endianness enforcement right for the rlc BOs? Or is there a bit somewhere to switch the RLC to host endianness? Or the kmap is swapping dwords?

regards,

Signature · 1 line
Sylvain
#1 lore raw
Quoted 10 lines · Sylvain BERTRAND

Hi,

commit 555b1b651acf44bf27ebbb04235d38a8fd2d58dc (drm-fixes-3.12)

evergreen.c, SI code path, line 4045 and 4046 shouldn't be swapped? Should cpu_to_le32 be used?

Basically, is the endianness enforcement right for the rlc BOs? Or is there a bit somewhere to switch the RLC to host endianness? Or the kmap is swapping dwords?

The rlc buffers should be little endian. They will need to be swapped on big endian systems.

Alex

#2 lore raw
Quoted 11 lines
Quoted 8 lines

commit 555b1b651acf44bf27ebbb04235d38a8fd2d58dc (drm-fixes-3.12)

evergreen.c, SI code path, line 4045 and 4046 shouldn't be swapped? Should cpu_to_le32 be used?

Basically, is the endianness enforcement right for the rlc BOs? Or is there a bit somewhere to switch the RLC to host endianness? Or the kmap is swapping dwords?

The rlc buffers should be little endian. They will need to be swapped on big endian systems.

Right, then cpu_to_le32 should be used.

Still for endianness, upper dword is written first (line 4045) and lower dword is written second (line 4046): Should the lower dword be written first then second the upper dword if we want little endian? Or maybe in that specific case, the rlc expect the upper dword first?

Signature · 1 line
Sylvain
#3 lore raw
Quoted 12 lines · Sylvain BERTRAND
Quoted 11 lines
Quoted 8 lines

commit 555b1b651acf44bf27ebbb04235d38a8fd2d58dc (drm-fixes-3.12)

evergreen.c, SI code path, line 4045 and 4046 shouldn't be swapped? Should cpu_to_le32 be used?

Basically, is the endianness enforcement right for the rlc BOs? Or is there a bit somewhere to switch the RLC to host endianness? Or the kmap is swapping dwords?

The rlc buffers should be little endian. They will need to be swapped on big endian systems.

Quoted 6 lines

Right, then cpu_to_le32 should be used.

Still for endianness, upper dword is written first (line 4045) and lower dword is written second (line 4046): Should the lower dword be written first then second the upper dword if we want little endian? Or maybe in that specific case, the rlc expect the upper dword first?

The rlc expects the upper 32 bits of the address in the lowest dword, followed by the lower 32 bits, followed by the buffer size.

Alex