From 56f0b4f55b71f453c2ec6b6f70725c28dc437c32 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sun, 28 Jan 2024 21:10:48 +0100 Subject: [PATCH] qca_spi: Avoid skb_copy_expand in TX path The skb spare room needs to be expanded for SPI header, footer and possible padding within the TX path. So announce the necessary space in order to avoid expensive skb_copy_expand calls. Signed-off-by: Stefan Wahren Reviewed-by: Jacob Keller Signed-off-by: David S. Miller --- drivers/net/ethernet/qualcomm/qca_spi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c index 3f7e38a11ba0..5fabb40cca05 100644 --- a/drivers/net/ethernet/qualcomm/qca_spi.c +++ b/drivers/net/ethernet/qualcomm/qca_spi.c @@ -878,6 +878,8 @@ qcaspi_netdev_setup(struct net_device *dev) qcaspi_set_ethtool_ops(dev); dev->watchdog_timeo = QCASPI_TX_TIMEOUT; dev->priv_flags &= ~IFF_TX_SKB_SHARING; + dev->needed_tailroom = ALIGN(QCAFRM_FOOTER_LEN + QCAFRM_MIN_LEN, 4); + dev->needed_headroom = ALIGN(QCAFRM_HEADER_LEN, 4); dev->tx_queue_len = 100; /* MTU range: 46 - 1500 */