diff options
author | Bogdan Hamciuc <bogdan.hamciuc@freescale.com> | 2013-05-24 06:24:14 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-05-29 23:36:47 (GMT) |
commit | 7f826f5a13a97af279498a9b981c9ef5e33e33da (patch) | |
tree | 1bba0bbc2ecaf5d74bcfd8969e032821c4e7e0f0 /drivers/net/ethernet/freescale | |
parent | 063272a003458470d1ce444afcce0a32fb1208f5 (diff) | |
download | linux-fsl-qoriq-7f826f5a13a97af279498a9b981c9ef5e33e33da.tar.xz |
dpaa_eth: Minor optimization to _dpa_cleanup_tx_fd()
Factor number of skb fragments out of the for loop.
Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
Change-Id: I750ebee25d92a9a609e1f17187c1e999d179836b
Reviewed-on: http://git.am.freescale.net:8181/2758
Reviewed-by: Radulescu Ruxandra Ioana-B05472 <ruxandra.radulescu@freescale.com>
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Sovaiala Cristian-Constantin-B39531 <Cristian.Sovaiala@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c index 0104790..0f0f726 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c @@ -189,12 +189,14 @@ struct sk_buff *_dpa_cleanup_tx_fd(const struct dpa_priv_s *priv, struct sk_buff **skbh; struct sk_buff *skb = NULL; const enum dma_data_direction dma_dir = DMA_TO_DEVICE; + int nr_frags; dma_unmap_single(dpa_bp->dev, addr, dpa_bp->size, dma_dir); /* retrieve skb back pointer */ skbh = (struct sk_buff **)phys_to_virt(addr); skb = *skbh; + nr_frags = skb_shinfo(skb)->nr_frags; if (fd->format == qm_fd_sg) { /* @@ -222,7 +224,7 @@ struct sk_buff *_dpa_cleanup_tx_fd(const struct dpa_priv_s *priv, sgt[0].length, dma_dir); /* remaining pages were mapped with dma_map_page() */ - for (i = 1; i < skb_shinfo(skb)->nr_frags; i++) { + for (i = 1; i < nr_frags; i++) { BUG_ON(sgt[i].extension); dma_unmap_page(dpa_bp->dev, sgt[i].addr, |