aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb
diff options
context:
space:
mode:
authorOliver Hartkopp <socketcan@hartkopp.net>2010-08-17 04:59:14 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-19 03:08:30 -0400
commit2244d07bfa2097cb00600da91c715a8aa547917e (patch)
tree44d67d9ffba3697fffeb05c13e88aa76ebc3fd4a /drivers/net/igb
parent4d5870ec103e6569851b9710f0093f072b08439a (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 'drivers/net/igb')
-rw-r--r--drivers/net/igb/igb.h2
-rw-r--r--drivers/net/igb/igb_main.c11
2 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
index 6e63d9a7fc75..44e0ff1494e0 100644
--- a/drivers/net/igb/igb.h
+++ b/drivers/net/igb/igb.h
@@ -143,7 +143,7 @@ struct igb_buffer {
143 u16 next_to_watch; 143 u16 next_to_watch;
144 unsigned int bytecount; 144 unsigned int bytecount;
145 u16 gso_segs; 145 u16 gso_segs;
146 union skb_shared_tx shtx; 146 u8 tx_flags;
147 u8 mapped_as_page; 147 u8 mapped_as_page;
148 }; 148 };
149 /* RX */ 149 /* RX */
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 9b4e5895f5f9..985e37cf17b6 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -3954,7 +3954,7 @@ static inline int igb_tx_map_adv(struct igb_ring *tx_ring, struct sk_buff *skb,
3954 } 3954 }
3955 3955
3956 tx_ring->buffer_info[i].skb = skb; 3956 tx_ring->buffer_info[i].skb = skb;
3957 tx_ring->buffer_info[i].shtx = skb_shinfo(skb)->tx_flags; 3957 tx_ring->buffer_info[i].tx_flags = skb_shinfo(skb)->tx_flags;
3958 /* multiply data chunks by size of headers */ 3958 /* multiply data chunks by size of headers */
3959 tx_ring->buffer_info[i].bytecount = ((gso_segs - 1) * hlen) + skb->len; 3959 tx_ring->buffer_info[i].bytecount = ((gso_segs - 1) * hlen) + skb->len;
3960 tx_ring->buffer_info[i].gso_segs = gso_segs; 3960 tx_ring->buffer_info[i].gso_segs = gso_segs;
@@ -4088,7 +4088,6 @@ netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
4088 u32 tx_flags = 0; 4088 u32 tx_flags = 0;
4089 u16 first; 4089 u16 first;
4090 u8 hdr_len = 0; 4090 u8 hdr_len = 0;
4091 union skb_shared_tx *shtx = skb_tx(skb);
4092 4091
4093 /* need: 1 descriptor per page, 4092 /* need: 1 descriptor per page,
4094 * + 2 desc gap to keep tail from touching head, 4093 * + 2 desc gap to keep tail from touching head,
@@ -4100,8 +4099,8 @@ netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
4100 return NETDEV_TX_BUSY; 4099 return NETDEV_TX_BUSY;
4101 } 4100 }
4102 4101
4103 if (unlikely(shtx->hardware)) { 4102 if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) {
4104 shtx->in_progress = 1; 4103 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
4105 tx_flags |= IGB_TX_FLAGS_TSTAMP; 4104 tx_flags |= IGB_TX_FLAGS_TSTAMP;
4106 } 4105 }
4107 4106
@@ -5319,7 +5318,7 @@ static void igb_tx_hwtstamp(struct igb_q_vector *q_vector, struct igb_buffer *bu
5319 u64 regval; 5318 u64 regval;
5320 5319
5321 /* if skb does not support hw timestamp or TX stamp not valid exit */ 5320 /* if skb does not support hw timestamp or TX stamp not valid exit */
5322 if (likely(!buffer_info->shtx.hardware) || 5321 if (likely(!(buffer_info->tx_flags & SKBTX_HW_TSTAMP)) ||
5323 !(rd32(E1000_TSYNCTXCTL) & E1000_TSYNCTXCTL_VALID)) 5322 !(rd32(E1000_TSYNCTXCTL) & E1000_TSYNCTXCTL_VALID))
5324 return; 5323 return;
5325 5324
@@ -5500,7 +5499,7 @@ static void igb_rx_hwtstamp(struct igb_q_vector *q_vector, u32 staterr,
5500 * values must belong to this one here and therefore we don't need to 5499 * values must belong to this one here and therefore we don't need to
5501 * compare any of the additional attributes stored for it. 5500 * compare any of the additional attributes stored for it.
5502 * 5501 *
5503 * If nothing went wrong, then it should have a skb_shared_tx that we 5502 * If nothing went wrong, then it should have a shared tx_flags that we
5504 * can turn into a skb_shared_hwtstamps. 5503 * can turn into a skb_shared_hwtstamps.
5505 */ 5504 */
5506 if (staterr & E1000_RXDADV_STAT_TSIP) { 5505 if (staterr & E1000_RXDADV_STAT_TSIP) {