summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBogdan Hamciuc <bogdan.hamciuc@freescale.com>2013-04-18 14:49:54 (GMT)
committerFleming Andrew-AFLEMING <AFLEMING@freescale.com>2013-04-19 23:30:35 (GMT)
commit108632df20890d69ed6ee8205ff32dd0c8815762 (patch)
tree8e937e2c46a5949435a61e3baf41c8d6e5b21874 /drivers
parent2d83f3b277c4ce1d9972abf3c6ea6fda72f0dc2c (diff)
downloadlinux-fsl-qoriq-108632df20890d69ed6ee8205ff32dd0c8815762.tar.xz
dpaa_eth: Move bpool refill thresholds to Kconfig
There have been requests to change the thresholds which control the buffer pool replenishment on the private path of DPAA-Ethernet. While we normally discourage this (since these values have been fine-tuned after numerous tests) we nevertheless expose these knobs into the driver's Kconfig. They now default to the original hardcoded values. Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com> Change-Id: Ia6634932e16e4fb771317a04110704a5c3bb5e44 Reviewed-on: http://git.am.freescale.net:8181/1629 Reviewed-by: Sovaiala Cristian-Constantin-B39531 <Cristian.Sovaiala@freescale.com> Reviewed-by: Radulescu Ruxandra Ioana-B05472 <ruxandra.radulescu@freescale.com> Reviewed-by: Bucur Madalin-Cristian-B32716 <madalin.bucur@freescale.com> Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/freescale/dpa/Kconfig20
-rw-r--r--drivers/net/ethernet/freescale/dpa/dpaa_eth.c11
2 files changed, 24 insertions, 7 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/Kconfig b/drivers/net/ethernet/freescale/dpa/Kconfig
index 7c4973d..b54831d 100644
--- a/drivers/net/ethernet/freescale/dpa/Kconfig
+++ b/drivers/net/ethernet/freescale/dpa/Kconfig
@@ -95,6 +95,26 @@ config DPAA_ETH_USE_NDO_SELECT_QUEUE
or simply don't want to use the driver's ndo_select_queue() callback, then unselect this
and use the standard XPS support instead.
+config DPAA_ETH_MAX_BUF_COUNT
+ int "Maximum nuber of buffers in private bpool"
+ depends on DPA_ETH
+ range 64 2048
+ default "128"
+ ---help---
+ The maximum number of buffers to be by default allocated in the DPAA-Ethernet private port's
+ buffer pool. One needn't normally modify this, as it has probably been tuned for performance
+ already. This cannot be lower than DPAA_ETH_REFILL_THRESHOLD.
+
+config DPAA_ETH_REFILL_THRESHOLD
+ int "Private bpool refill threshold"
+ depends on DPA_ETH
+ range 32 DPAA_ETH_MAX_BUF_COUNT
+ default "80"
+ ---help---
+ The DPAA-Ethernet driver will start replenishing buffer pools whose count
+ falls below this threshold. This must be related to DPAA_ETH_MAX_BUF_COUNT. One needn't normally
+ modify this value unless one has very specific performance reasons.
+
config DPAA_ETH_UNIT_TESTS
bool
depends on DPA_ETH
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c
index 20d0e20..2c24e1e 100644
--- a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c
+++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c
@@ -91,9 +91,6 @@
#undef CONFIG_DPAA_ETH_UNIT_TESTS
#endif
-#define DEFAULT_COUNT 128
-#define REFILL_THRESHOLD 80
-
#define DPA_NAPI_WEIGHT 64
/* Size in bytes of the Congestion State notification threshold on 10G ports */
@@ -411,15 +408,15 @@ static void dpaa_eth_refill_bpools(struct dpa_priv_s *priv,
const struct dpa_bp *dpa_bp = percpu_priv->dpa_bp;
#ifndef CONFIG_DPAA_ETH_SG_SUPPORT
- if (unlikely(count < REFILL_THRESHOLD)) {
+ if (unlikely(count < CONFIG_DPAA_ETH_REFILL_THRESHOLD)) {
int i;
- for (i = count; i < DEFAULT_COUNT; i += 8)
+ for (i = count; i < CONFIG_DPAA_ETH_MAX_BUF_COUNT; i += 8)
dpa_bp_add_8(dpa_bp);
}
#else
/* Add pages to the buffer pool */
- while (count < DEFAULT_COUNT)
+ while (count < CONFIG_DPAA_ETH_MAX_BUF_COUNT)
count += _dpa_bp_add_8_pages(dpa_bp);
*countptr = count;
@@ -3176,7 +3173,7 @@ dpa_bp_probe(struct platform_device *_of_dev, size_t *count)
dpa_bp = ERR_PTR(-EINVAL);
goto _return_of_node_put;
} else if (has_kernel_pool) {
- dpa_bp->target_count = DEFAULT_COUNT;
+ dpa_bp->target_count = CONFIG_DPAA_ETH_MAX_BUF_COUNT;
dpa_bp->kernel_pool = 1;
}