Skip to content

Commit 492f5ad

Browse files
amirvdavem330
authored andcommitted
net/mlx4_en: Doorbell is byteswapped in Little Endian archs
iowrite32() will byteswap it's argument on big endian archs. iowrite32be() will byteswap on little endian archs. Since we don't want to do this unnecessary byteswap on the fast path, doorbell is stored in the NIC's native endianness. Using the right iowrite() according to the arch endianness. CC: Wei Yang <weiyang@linux.vnet.ibm.com> CC: David Laight <david.laight@aculab.com> Fixes: 6a4e812 ("net/mlx4_en: Avoid calling bswap in tx fast path") Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ea3c9e1 commit 492f5ad

File tree

1 file changed

+11
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx4

1 file changed

+11
-1
lines changed

drivers/net/ethernet/mellanox/mlx4/en_tx.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,17 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
962962
tx_desc->ctrl.owner_opcode = op_own;
963963
if (send_doorbell) {
964964
wmb();
965-
iowrite32(ring->doorbell_qpn,
965+
/* Since there is no iowrite*_native() that writes the
966+
* value as is, without byteswapping - using the one
967+
* the doesn't do byteswapping in the relevant arch
968+
* endianness.
969+
*/
970+
#if defined(__LITTLE_ENDIAN)
971+
iowrite32(
972+
#else
973+
iowrite32be(
974+
#endif
975+
ring->doorbell_qpn,
966976
ring->bf.uar->map + MLX4_SEND_DOORBELL);
967977
} else {
968978
ring->xmit_more++;

0 commit comments

Comments
 (0)