Message ID | 20230420225601.2358327-4-vladimir.oltean@nxp.com (mailing list archive) |
---|---|
State | Accepted |
Commit | e2fdfd7119128b49d81972a75e74169802aa8ae0 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | Remove skb_mac_header() dependency in DSA xmit path | expand |
Context | Check | Description |
---|---|---|
netdev/series_format | success | Posting correctly formatted |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/fixes_present | success | Fixes tag not required for -next series |
netdev/header_inline | success | No static functions without inline keyword in header files |
netdev/build_32bit | success | Errors and warnings before: 8 this patch: 8 |
netdev/cc_maintainers | success | CCed 6 of 6 maintainers |
netdev/build_clang | success | Errors and warnings before: 8 this patch: 8 |
netdev/verify_signedoff | success | Signed-off-by tag matches author and committer |
netdev/deprecated_api | success | None detected |
netdev/check_selftest | success | No net selftest shell script |
netdev/verify_fixes | success | No Fixes tag |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 8 this patch: 8 |
netdev/checkpatch | warning | WARNING: line length of 84 exceeds 80 columns |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/source_inline | success | Was 0 now: 0 |
> -----Original Message----- > From: Vladimir Oltean <vladimir.oltean@nxp.com> > Sent: 21 April 2023 01:56 > To: netdev@vger.kernel.org > Cc: David S. Miller <davem@davemloft.net>; Eric Dumazet > <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni > <pabeni@redhat.com>; Andrew Lunn <andrew@lunn.ch>; Florian Fainelli > <f.fainelli@gmail.com>; linux-kernel@vger.kernel.org; Simon Horman > <simon.horman@corigine.com>; Madalin Bucur <madalin.bucur@nxp.com> > 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@nxp.com> > Reviewed-by: Eric Dumazet <edumazet@google.com> > Reviewed-by: Simon Horman <simon.horman@corigine.com> > Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> > --- > Cc: Madalin Bucur <madalin.bucur@nxp.com> > > drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) Acked-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 9318a2554056..1fa676308c5e 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -1482,13 +1482,8 @@ static int dpaa_enable_tx_csum(struct dpaa_priv *priv, parse_result = (struct fman_prs_result *)parse_results; /* If we're dealing with VLAN, get the real Ethernet type */ - if (ethertype == ETH_P_8021Q) { - /* We can't always assume the MAC header is set correctly - * by the stack, so reset to beginning of skb->data - */ - skb_reset_mac_header(skb); - ethertype = ntohs(vlan_eth_hdr(skb)->h_vlan_encapsulated_proto); - } + if (ethertype == ETH_P_8021Q) + ethertype = ntohs(skb_vlan_eth_hdr(skb)->h_vlan_encapsulated_proto); /* Fill in the relevant L3 parse result fields * and read the L4 protocol type