[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210517170401.188563-9-idosch@nvidia.com>
Date: Mon, 17 May 2021 20:03:58 +0300
From: Ido Schimmel <idosch@....NVIDIA.COM>
To: <netdev@...r.kernel.org>
CC: <davem@...emloft.net>, <kuba@...nel.org>, <jiri@....NVIDIA.COM>,
<petrm@....NVIDIA.COM>, <danieller@....NVIDIA.COM>,
<amcohen@....NVIDIA.COM>, <mlxsw@....NVIDIA.COM>,
Ido Schimmel <idosch@....NVIDIA.COM>
Subject: [PATCH net-next 08/11] 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@...dia.com>
---
drivers/net/ethernet/mellanox/mlxsw/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c
index 7e9a7cb31720..ad93e01b2cda 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.c
@@ -630,7 +630,7 @@ static int mlxsw_emad_transmit(struct mlxsw_core *mlxsw_core,
struct sk_buff *skb;
int err;
- skb = skb_copy(trans->tx_skb, GFP_KERNEL);
+ skb = skb_clone(trans->tx_skb, GFP_KERNEL);
if (!skb)
return -ENOMEM;
--
2.31.1
Powered by blists - more mailing lists