]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: core: Avoid unnecessary EMAD buffer copy
authorIdo Schimmel <idosch@OSS.NVIDIA.COM>
Mon, 17 May 2021 17:03:58 +0000 (20:03 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 May 2021 22:15:46 +0000 (15:15 -0700)
commit1778c66b1c91eb3c7e738afec8d9194ebbe990a9
tree78fcdac003feb56d1d26ba4cccf705f5f6f968d0
parent18096fa8fdd4b73caa3e4b3dd3c0e223a9cc9611
mlxsw: core: Avoid unnecessary EMAD buffer copy

mlxsw_emad_transmit() takes care of sending EMAD transactions to the
device. Since these transactions can time out, the driver performs up to
5 retransmissions, each time copying the skb with the original request.

The data of the skb does not change throughout the process, so there is
no need to copy it each time. Instead, only the skb itself can be
copied. Therefore, use skb_clone() instead of skb_copy().

This reduces the latency of the function by about 16%.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core.c