diff options
author | Madalin Bucur <madalin.bucur@freescale.com> | 2013-07-30 14:16:55 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-07-31 21:50:31 (GMT) |
commit | 6d18c6a02d3046116956aff531febdaed611ea85 (patch) | |
tree | 294477006a8b56af0727519a6d0b1f63b0a03af5 /drivers/net/ethernet/freescale/dpa | |
parent | 6a6d176012d6a16f7e1f44862dbfa3d65458a5d2 (diff) | |
download | linux-fsl-qoriq-6d18c6a02d3046116956aff531febdaed611ea85.tar.xz |
dpaa_eth: replace pointer to default bpool
Replace pointer to default bpool by bpid.
Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Change-Id: I10248ab7f01807c4e0b13f59c32ef9c4314b9635
Reviewed-on: http://git.am.freescale.net:8181/3661
Reviewed-by: Hamciuc Bogdan-BHAMCIU1 <bogdan.hamciuc@freescale.com>
Reviewed-by: Radulescu Ruxandra Ioana-B05472 <ruxandra.radulescu@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')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth.c | 10 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth_unit_test.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth_unit_test.h | 2 |
3 files changed, 11 insertions, 8 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c index c588d3f..5709765 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c @@ -118,7 +118,7 @@ int dpa_free_pcd_fqids(struct device *, uint32_t) __attribute__((weak)); #define DPAA_ETH_MAX_PAD (L1_CACHE_BYTES * 8) -struct dpa_bp *default_pool; +uint8_t dpa_priv_common_bpid; /* A set of callbacks for hooking into the fastpath at different points. */ struct dpaa_eth_hooks_s dpaa_eth_hooks; @@ -512,7 +512,7 @@ static int __cold dpa_eth_priv_start(struct net_device *net_dev) * of a private port. Update the percpu buffer counters * of each private interface. */ - dpa_bp_priv_non_sg_seed(default_pool); + dpa_bp_priv_non_sg_seed(priv->dpa_bp); #endif dpaa_eth_napi_enable(priv); @@ -652,13 +652,11 @@ static int dpa_priv_bp_create(struct net_device *net_dev, struct dpa_bp *dpa_bp, dev_dbg(net_dev->dev.parent, "Using private BM buffer pools\n"); - priv->dpa_bp = dpa_bp; priv->bp_count = count; for (i = 0; i < count; i++) { int err; err = dpa_bp_alloc(&dpa_bp[i]); - default_pool = &dpa_bp[i]; if (err < 0) { dpa_bp_free(priv, dpa_bp); priv->dpa_bp = NULL; @@ -668,6 +666,7 @@ static int dpa_priv_bp_create(struct net_device *net_dev, struct dpa_bp *dpa_bp, priv->dpa_bp = &dpa_bp[i]; } + dpa_priv_common_bpid = priv->dpa_bp->bpid; return 0; } @@ -700,7 +699,8 @@ dpaa_eth_priv_probe(struct platform_device *_of_dev) /* Get the buffer pools assigned to this interface; * run only once the default pool probing code */ - dpa_bp = (default_pool) ? default_pool : dpa_priv_bp_probe(dev); + dpa_bp = (dpa_bpid2pool(dpa_priv_common_bpid)) ? : + dpa_priv_bp_probe(dev); if (IS_ERR(dpa_bp)) return PTR_ERR(dpa_bp); 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 224720f..62095a7 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_unit_test.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_unit_test.c @@ -341,11 +341,14 @@ fq_create_fail: return err; } +extern struct dpa_bp *dpa_bpid2pool(int bpid); + void dpa_unit_test_drain_default_pool(struct net_device *net_dev) { int i; int num; struct dpa_priv_s *priv; + struct dpa_bp *default_pool = dpa_bpid2pool(dpa_priv_common_bpid); priv = netdev_priv(net_dev); @@ -375,13 +378,13 @@ void dpa_unit_test_drain_default_pool(struct net_device *net_dev) void dpa_unit_test_seed_default_pool(struct net_device *net_dev) { struct dpa_priv_s *priv; + struct dpa_bp *default_pool = dpa_bpid2pool(dpa_priv_common_bpid); priv = netdev_priv(net_dev); #ifndef CONFIG_FSL_DPAA_ETH_SG_SUPPORT default_pool->size = dpa_bp_default_buf_size_get(); #endif /* CONFIG_FSL_DPAA_ETH_SG_SUPPORT */ - dpa_bp_priv_seed(default_pool); } @@ -390,7 +393,7 @@ void dpa_unit_tests(struct net_device *net_dev) int err; /* the unit tests use the default pool */ - if (!default_pool) + if (!dpa_priv_common_bpid) return; if (!tx_unit_test_ran) { diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_unit_test.h b/drivers/net/ethernet/freescale/dpa/dpaa_eth_unit_test.h index fbc9035..0343e43 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_unit_test.h +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_unit_test.h @@ -34,7 +34,7 @@ #define DPAA_ETH_UNIT_TEST_H_ extern int dpa_max_frm; -extern struct dpa_bp *default_pool; +extern uint8_t dpa_priv_common_bpid; void dpa_unit_tests(struct net_device *net_dev); |