]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: enetc: save the parsed information of PTP packet to skb->cb
authorWei Fang <wei.fang@nxp.com>
Fri, 29 Aug 2025 05:06:10 +0000 (13:06 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 2 Sep 2025 11:13:34 +0000 (13:13 +0200)
commit19669a57d7a04d2581dc75f6b452ee2a59936942
tree209d89d438385010aad50f4e6d22e93fdd435557
parentdc331726469d4ac145478c5891ac7117d7a88440
net: enetc: save the parsed information of PTP packet to skb->cb

Currently, the Tx PTP packets are parsed twice in the enetc driver, once
in enetc_xmit() and once in enetc_map_tx_buffs(). The latter is duplicate
and is unnecessary, since the parsed information can be saved to skb->cb
so that enetc_map_tx_buffs() can get the previously parsed data from
skb->cb. Therefore, add struct enetc_skb_cb as the format of the data
in the skb->cb buffer to save the parsed information of PTP packet. Use
saved information in enetc_map_tx_buffs() to avoid parsing data again.

In addition, rename variables offset1 and offset2 in enetc_map_tx_buffs()
to corr_off and tstamp_off for better readability.

Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20250829050615.1247468-10-wei.fang@nxp.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/freescale/enetc/enetc.c
drivers/net/ethernet/freescale/enetc/enetc.h