qca_spi: Avoid skb_copy_expand in TX path
authorStefan Wahren <wahrenst@gmx.net>
Sun, 28 Jan 2024 20:10:48 +0000 (21:10 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Jan 2024 13:38:50 +0000 (13:38 +0000)
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 <wahrenst@gmx.net>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qualcomm/qca_spi.c

index 3f7e38a11ba0a1c756af1f8774e3c305c3e44588..5fabb40cca050eb354e22741677e3aec031958ef 100644 (file)
@@ -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 */