gianfar: Remove redundant ops for do_tstamp from xmit()
Timestamp BD status updates that can be merged into the same "do_tstamp" block, no need for extra save/restore to the BD area. The code is more readable too. Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
42f397adfc
commit
48963b4492
@ -2436,15 +2436,8 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||||||
txbdp_tstamp = txbdp = next_txbd(txbdp, base,
|
txbdp_tstamp = txbdp = next_txbd(txbdp, base,
|
||||||
tx_queue->tx_ring_size);
|
tx_queue->tx_ring_size);
|
||||||
|
|
||||||
if (nr_frags == 0) {
|
if (likely(!nr_frags)) {
|
||||||
if (unlikely(do_tstamp)) {
|
lstatus |= BD_LFLAG(TXBD_LAST | TXBD_INTERRUPT);
|
||||||
u32 lstatus_ts = be32_to_cpu(txbdp_tstamp->lstatus);
|
|
||||||
|
|
||||||
lstatus_ts |= BD_LFLAG(TXBD_LAST | TXBD_INTERRUPT);
|
|
||||||
txbdp_tstamp->lstatus = cpu_to_be32(lstatus_ts);
|
|
||||||
} else {
|
|
||||||
lstatus |= BD_LFLAG(TXBD_LAST | TXBD_INTERRUPT);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
u32 lstatus_start = lstatus;
|
u32 lstatus_start = lstatus;
|
||||||
|
|
||||||
@ -2488,8 +2481,11 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||||||
|
|
||||||
bufaddr = be32_to_cpu(txbdp_start->bufPtr);
|
bufaddr = be32_to_cpu(txbdp_start->bufPtr);
|
||||||
bufaddr += fcb_len;
|
bufaddr += fcb_len;
|
||||||
|
|
||||||
lstatus_ts |= BD_LFLAG(TXBD_READY) |
|
lstatus_ts |= BD_LFLAG(TXBD_READY) |
|
||||||
(skb_headlen(skb) - fcb_len);
|
(skb_headlen(skb) - fcb_len);
|
||||||
|
if (!nr_frags)
|
||||||
|
lstatus_ts |= BD_LFLAG(TXBD_LAST | TXBD_INTERRUPT);
|
||||||
|
|
||||||
txbdp_tstamp->bufPtr = cpu_to_be32(bufaddr);
|
txbdp_tstamp->bufPtr = cpu_to_be32(bufaddr);
|
||||||
txbdp_tstamp->lstatus = cpu_to_be32(lstatus_ts);
|
txbdp_tstamp->lstatus = cpu_to_be32(lstatus_ts);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user