summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale/dpa/dpaa_eth_unit_test.c
diff options
context:
space:
mode:
authorIoana Radulescu <ruxandra.radulescu@freescale.com>2013-07-26 16:46:48 (GMT)
committerFleming Andrew-AFLEMING <AFLEMING@freescale.com>2013-07-31 21:49:41 (GMT)
commitafebf20c2a5616f00c3a8160e2c23a2868954813 (patch)
tree5737d6fca08324b90e84ba750883bd61be2f8c52 /drivers/net/ethernet/freescale/dpa/dpaa_eth_unit_test.c
parent85699c3e9fedd9393a5405015f958cf23c6d5997 (diff)
downloadlinux-fsl-qoriq-afebf20c2a5616f00c3a8160e2c23a2868954813.tar.xz
dpaa_eth: Remove dpa_bp_count from percpu_priv structure
Instead just rely on the percpu field in dpa_bp structure. The performance lost due to the extra indirection is compensated by the smaller size of the percpu_priv structure. This way we begin to eliminate the assumption that private interfaces only have one default buffer pool, which may not remain true for long. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@freescale.com> Change-Id: I0b2c199c3f8883fa7d5fa1a06d2940f8170fc959 Reviewed-on: http://git.am.freescale.net:8181/3655 Reviewed-by: Bucur Madalin-Cristian-B32716 <madalin.bucur@freescale.com> Reviewed-by: Hamciuc Bogdan-BHAMCIU1 <bogdan.hamciuc@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/dpa/dpaa_eth_unit_test.c')
-rw-r--r--drivers/net/ethernet/freescale/dpa/dpaa_eth_unit_test.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_unit_test.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_unit_test.c
index 46e8808..5df53a5 100644
--- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_unit_test.c
+++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_unit_test.c
@@ -87,6 +87,7 @@ static enum qman_cb_dqrr_result tx_unit_test_dqrr(
dma_addr_t addr;
unsigned char *startaddr;
struct dpa_percpu_priv_s *percpu_priv;
+ int *countptr;
tx_unit_test_passed = false;
@@ -126,9 +127,10 @@ static enum qman_cb_dqrr_result tx_unit_test_dqrr(
* If we didn't recycle, but the buffer was big enough,
* increment the counter to put it back
*/
+ countptr = __this_cpu_ptr(priv->dpa_bp->percpu_count);
if (skb_end_pointer(skb) - skb->head >=
dpa_get_max_frm())
- (*percpu_priv->dpa_bp_count)++;
+ (*countptr)++;
/* If we didn't recycle, the data pointer should be good */
if (skb->data != startaddr + dpa_fd_offset(fd))
@@ -234,6 +236,8 @@ static int dpa_tx_unit_test(struct net_device *net_dev)
headroom += 16) {
int ret;
struct sk_buff *skb;
+ int *countptr =
+ __this_cpu_ptr(priv->dpa_bp->percpu_count);
test_count++;
@@ -247,7 +251,7 @@ static int dpa_tx_unit_test(struct net_device *net_dev)
if (skb_end_pointer(skb) - skb->head >=
dpa_get_max_frm())
- (*percpu_priv->dpa_bp_count)--;
+ (*countptr)--;
skb_put(skb, size + headroom);
skb_pull(skb, headroom);
@@ -368,7 +372,6 @@ void dpa_unit_test_drain_default_pool(struct net_device *net_dev)
for_each_online_cpu(i) {
percpu_priv = per_cpu_ptr(priv->percpu_priv, i);
percpu_priv->dpa_bp = NULL;
- percpu_priv->dpa_bp_count = NULL;
}
}
@@ -387,9 +390,6 @@ void dpa_unit_test_seed_default_pool(struct net_device *net_dev)
percpu_priv = per_cpu_ptr(priv->percpu_priv, i);
if (!percpu_priv->dpa_bp) {
percpu_priv->dpa_bp = priv->dpa_bp;
- percpu_priv->dpa_bp_count =
- per_cpu_ptr(priv->dpa_bp->percpu_count,
- i);
}
}
}