PENDING: net: ti: icssg-prueth: Add conditional checks for HSR offload behaviors

Add checks in the ICSSG transmit path to conditionally bypass HSR hardware
offload for PTP packets that require special handling.

When HSR is offloaded to hardware, the firmware normally handles:
- Packet duplication: sending copies on both ports
- HSR tag insertion: adding the HSR header

However, PTP (Precision Time Protocol) packets require precise timestamps
and may need to be sent on a specific port with their original HSR header
intact to maintain timestamp accuracy.

This patch uses the HSR skb extension (struct hsr_ptp_ext) to determine
when to bypass offload:
   - Skip hardware duplication if hsr_skb_has_port() indicates the
     packet is destined for a specific port (detected via SKB_EXT_HSR)

   - Skip hardware tag insertion if hsr_skb_has_header() indicates the
     packet already has an HSR header that should be preserved

These checks allow for more flexible control over HSR hardware offload
features on a per-packet basis, which is important for proper PTP
timing in HSR networks, where the default duplication and tag insertion
behavior might affect timestamp accuracy.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
1 file changed