diff options
author | Oliver Hartkopp <socketcan@hartkopp.net> | 2010-08-17 04:59:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-19 03:08:30 -0400 |
commit | 2244d07bfa2097cb00600da91c715a8aa547917e (patch) | |
tree | 44d67d9ffba3697fffeb05c13e88aa76ebc3fd4a /include/linux | |
parent | 4d5870ec103e6569851b9710f0093f072b08439a (diff) |
net: simplify flags for tx timestamping
This patch removes the abstraction introduced by the union skb_shared_tx in
the shared skb data.
The access of the different union elements at several places led to some
confusion about accessing the shared tx_flags e.g. in skb_orphan_try().
http://marc.info/?l=linux-netdev&m=128084897415886&w=2
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/skbuff.h | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index d8050382b189..f067c95cf18a 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -163,26 +163,19 @@ struct skb_shared_hwtstamps { | |||
163 | ktime_t syststamp; | 163 | ktime_t syststamp; |
164 | }; | 164 | }; |
165 | 165 | ||
166 | /** | 166 | /* Definitions for tx_flags in struct skb_shared_info */ |
167 | * struct skb_shared_tx - instructions for time stamping of outgoing packets | 167 | enum { |
168 | * @hardware: generate hardware time stamp | 168 | /* generate hardware time stamp */ |
169 | * @software: generate software time stamp | 169 | SKBTX_HW_TSTAMP = 1 << 0, |
170 | * @in_progress: device driver is going to provide | 170 | |
171 | * hardware time stamp | 171 | /* generate software time stamp */ |
172 | * @prevent_sk_orphan: make sk reference available on driver level | 172 | SKBTX_SW_TSTAMP = 1 << 1, |
173 | * @flags: all shared_tx flags | 173 | |
174 | * | 174 | /* device driver is going to provide hardware time stamp */ |
175 | * These flags are attached to packets as part of the | 175 | SKBTX_IN_PROGRESS = 1 << 2, |
176 | * &skb_shared_info. Use skb_tx() to get a pointer. | 176 | |
177 | */ | 177 | /* ensure the originating sk reference is available on driver level */ |
178 | union skb_shared_tx { | 178 | SKBTX_DRV_NEEDS_SK_REF = 1 << 3, |
179 | struct { | ||
180 | __u8 hardware:1, | ||
181 | software:1, | ||
182 | in_progress:1, | ||
183 | prevent_sk_orphan:1; | ||
184 | }; | ||
185 | __u8 flags; | ||
186 | }; | 179 | }; |
187 | 180 | ||
188 | /* This data is invariant across clones and lives at | 181 | /* This data is invariant across clones and lives at |
@@ -195,7 +188,7 @@ struct skb_shared_info { | |||
195 | unsigned short gso_segs; | 188 | unsigned short gso_segs; |
196 | unsigned short gso_type; | 189 | unsigned short gso_type; |
197 | __be32 ip6_frag_id; | 190 | __be32 ip6_frag_id; |
198 | union skb_shared_tx tx_flags; | 191 | __u8 tx_flags; |
199 | struct sk_buff *frag_list; | 192 | struct sk_buff *frag_list; |
200 | struct skb_shared_hwtstamps hwtstamps; | 193 | struct skb_shared_hwtstamps hwtstamps; |
201 | 194 | ||
@@ -587,11 +580,6 @@ static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb) | |||
587 | return &skb_shinfo(skb)->hwtstamps; | 580 | return &skb_shinfo(skb)->hwtstamps; |
588 | } | 581 | } |
589 | 582 | ||
590 | static inline union skb_shared_tx *skb_tx(struct sk_buff *skb) | ||
591 | { | ||
592 | return &skb_shinfo(skb)->tx_flags; | ||
593 | } | ||
594 | |||
595 | /** | 583 | /** |
596 | * skb_queue_empty - check if a queue is empty | 584 | * skb_queue_empty - check if a queue is empty |
597 | * @list: queue head | 585 | * @list: queue head |
@@ -1996,8 +1984,8 @@ extern void skb_tstamp_tx(struct sk_buff *orig_skb, | |||
1996 | 1984 | ||
1997 | static inline void sw_tx_timestamp(struct sk_buff *skb) | 1985 | static inline void sw_tx_timestamp(struct sk_buff *skb) |
1998 | { | 1986 | { |
1999 | union skb_shared_tx *shtx = skb_tx(skb); | 1987 | if (skb_shinfo(skb)->tx_flags & SKBTX_SW_TSTAMP && |
2000 | if (shtx->software && !shtx->in_progress) | 1988 | !(skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS)) |
2001 | skb_tstamp_tx(skb, NULL); | 1989 | skb_tstamp_tx(skb, NULL); |
2002 | } | 1990 | } |
2003 | 1991 | ||