RE: [PATCH v2 net-next 3/9] net: dpaa: avoid one skb_reset_mac_header() in dpaa_enable_tx_csum()
From: Madalin Bucur (OSS)
Date: Fri Apr 21 2023 - 04:31:11 EST
> -----Original Message-----
> From: Vladimir Oltean <vladimir.oltean@xxxxxxx>
> Sent: 21 April 2023 01:56
> To: netdev@xxxxxxxxxxxxxxx
> Cc: David S. Miller <davem@xxxxxxxxxxxxx>; Eric Dumazet
> <edumazet@xxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; Paolo Abeni
> <pabeni@xxxxxxxxxx>; Andrew Lunn <andrew@xxxxxxx>; Florian Fainelli
> <f.fainelli@xxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx; Simon Horman
> <simon.horman@xxxxxxxxxxxx>; Madalin Bucur <madalin.bucur@xxxxxxx>
> Subject: [PATCH v2 net-next 3/9] net: dpaa: avoid one
> skb_reset_mac_header() in dpaa_enable_tx_csum()
>
> It appears that dpaa_enable_tx_csum() only calls skb_reset_mac_header()
> to get to the VLAN header using skb_mac_header().
>
> We can use skb_vlan_eth_hdr() to get to the VLAN header based on
> skb->data directly. This avoids spending a few cycles to set
> skb->mac_header.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@xxxxxxx>
> Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>
> Reviewed-by: Simon Horman <simon.horman@xxxxxxxxxxxx>
> Reviewed-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
> ---
> Cc: Madalin Bucur <madalin.bucur@xxxxxxx>
>
> drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
Acked-by: Madalin Bucur <madalin.bucur@xxxxxxxxxxx>