Skip to content

Commit

Permalink
net: add driver hook for tx time stamping.
Browse files Browse the repository at this point in the history
This patch adds a hook for transmit time stamps. The transmit hook
allows a software fallback for transmit time stamps, for MACs
lacking time stamping hardware. Using the hook will still require
adding an inline function call to each MAC driver.

Signed-off-by: Richard Cochran <richard.cochran@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Richard Cochran authored and David S. Miller committed Jul 19, 2010
1 parent ad1afb0 commit 4507a71
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -1947,6 +1947,27 @@ static inline ktime_t net_invalid_timestamp(void)
extern void skb_tstamp_tx(struct sk_buff *orig_skb,
struct skb_shared_hwtstamps *hwtstamps);

static inline void sw_tx_timestamp(struct sk_buff *skb)
{
union skb_shared_tx *shtx = skb_tx(skb);
if (shtx->software && !shtx->in_progress)
skb_tstamp_tx(skb, NULL);
}

/**
* skb_tx_timestamp() - Driver hook for transmit timestamping
*
* Ethernet MAC Drivers should call this function in their hard_xmit()
* function as soon as possible after giving the sk_buff to the MAC
* hardware, but before freeing the sk_buff.
*
* @skb: A socket buffer.
*/
static inline void skb_tx_timestamp(struct sk_buff *skb)
{
sw_tx_timestamp(skb);
}

extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len);
extern __sum16 __skb_checksum_complete(struct sk_buff *skb);

Expand Down

0 comments on commit 4507a71

Please sign in to comment.