Skip to contentSkip to conversation

RFC: VETH patch to zero timestamp.

PATCH Ben Greear 2 participants 2 messages Jul 16, 2009 – Jul 17, 2009

Subsystems (2)
lore
Share & tools
lore

Ben Greear

author
#0 lore raw

The patch below helps when using VETH and bridge(s)
This makes sure that the pkt timestamp is properly (re)calculated on receiving the packet on the peer veth device.

I'm sure this patch is white-space damaged. If this looks useful, I'll generate a clean patch and send as attachment.

drivers/net/veth.c +6 -1
index 1097c72..e9136af 100644
@@ -170,7 +173,12 @@ static int veth_xmit(struct sk_buff *skb, struct net_device *dev)
 
        if (skb->len > (rcv->mtu + MTU_PAD))
                goto rx_drop;
-
+
+       /* Zero out the time-stamp so that receiving code is forced
+        * to recalculate it.
+        */
+       skb->tstamp.tv64 = 0;
+
        skb->pkt_type = PACKET_HOST;
        skb->protocol = eth_type_trans(skb, rcv);
        if (dev->features & NETIF_F_NO_CSUM)

Thanks,
Ben

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
#1 lore raw
Quoted 6 lines · Ben Greear

The patch below helps when using VETH and bridge(s)
This makes sure that the pkt timestamp is properly (re)calculated on receiving the packet on the peer veth device.

I'm sure this patch is white-space damaged. If this looks useful, I'll generate a clean patch and send as attachment.

We reset everything else that needs to be reset. So we might as well reset the timestamps as well. Unless there is a big performance impact by doing so.

Quoted 29 lines
drivers/net/veth.c +6 -1
index 1097c72..e9136af 100644
@@ -170,7 +173,12 @@ static int veth_xmit(struct sk_buff *skb, struct net_device *dev)
 
        if (skb->len > (rcv->mtu + MTU_PAD))
                goto rx_drop;
-
+
+       /* Zero out the time-stamp so that receiving code is forced
+        * to recalculate it.
+        */
+       skb->tstamp.tv64 = 0;
+
        skb->pkt_type = PACKET_HOST;
        skb->protocol = eth_type_trans(skb, rcv);
        if (dev->features & NETIF_F_NO_CSUM)

Thanks,
Ben

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com