RE: [PATCH net-next v3 06/14] net: ethernet: oa_tc6: Support for hardware timestamp
From: Selvamani Rajagopal
Date: Fri May 29 2026 - 22:00:34 EST
>
> > +static struct oa_tc6_ts_info_rx *oa_tc6_tsinfo_rx(struct sk_buff *skb)
> > +{
> > + return (struct oa_tc6_ts_info_rx *)((skb)->cb);
> > +}
>
> And here.
>
> I've not looked deep into this code yet. What is the lifetime of the
> data stored in cb?
>
In RX side, Its life starts when skb is allocated after seeing a chunk with beginning of a Ethernet frame.
It ends once code sees the chunk with end of that frame. At this stage, full frame is assembled, timestamp
field of the skb is updated. That is just before skb is passed to the stack using netif_rx.
> > +
> > +static void oa_tc6_defer_for_hwtstamp(struct oa_tc6 *tc6,
> > + struct sk_buff *skb)
> > +{
> > + if (!tc6->hw_tstamp_enabled)
> > + return;
> > + if (!skb || (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) == 0)
> > + return;
>
> Can skb be NULL?
I thought it can be NULL.
If we look at the caller, there is a loop that loops until 1) we run out of tx credits 2) ongoing_tx_skb is NULL.
This ongoing_tx_skb pointer is passed to the above function. NULL check for ongoing_tx_skb is made after this function is called.
>
> Andrew