[dpdk-dev] [PATCH v3] net/af_packet: remove timestamp from packet status
Ferruh Yigit
ferruh.yigit at intel.com
Tue Sep 28 15:01:06 CEST 2021
On 9/23/2021 7:13 PM, Tudor Cornea wrote:
> We should eliminate the timestamp status from the packet
> status. This should only matter if timestamping is enabled
> on the socket, but we might hit a kernel bug, which is fixed
> in newer releases.
>
> For interfaces of type 'veth', the sent skb is forwarded
> to the peer and back into the network stack which timestamps
> it on the RX path if timestamping is enabled globally
> (which happens if any socket enables timestamping).
>
> When the skb is destructed, tpacket_destruct_skb() is called
> and it calls __packet_set_timestamp() which doesn't check
> the flags on the socket and returns the timestamp if it is
> set in the skb (and for veth it is, as mentioned above).
>
> See the following kernel commit for reference [1]:
>
> net: packetmmap: fix only tx timestamp on request
>
> The packetmmap tx ring should only return timestamps if requested
> via setsockopt PACKET_TIMESTAMP, as documented. This allows
> compatibility with non-timestamp aware user-space code which checks
> tp_status == TP_STATUS_AVAILABLE; not expecting additional timestamp
> flags to be set in tp_status.
>
> [1] https://www.spinics.net/lists/kernel/msg3959391.html
>
> Signed-off-by: Mihai Pogonaru <pogonarumihai at gmail.com>
> Signed-off-by: Tudor Cornea <tudor.cornea at gmail.com>
>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
Applied to dpdk-next-net/main, thanks.
More information about the dev
mailing list