diff options
author | Cristian Sovaiala <cristian.sovaiala@freescale.com> | 2013-09-23 13:28:59 (GMT) |
---|---|---|
committer | Rivera Jose-B46482 <German.Rivera@freescale.com> | 2013-10-01 20:14:07 (GMT) |
commit | f101a60e9772908826dc88971fe52a96968e2408 (patch) | |
tree | e917f7c6019d301ff59169a3ba7a303058d00ed8 /drivers/net/ethernet/freescale/dpa | |
parent | 6950fbb9458118286ccdf9e11f554b1731984a9b (diff) | |
download | linux-fsl-qoriq-f101a60e9772908826dc88971fe52a96968e2408.tar.xz |
dpaa_eth: Replace for_each_online_cpu with for_each_possible_cpu
At bootime, we currently initialize a NAPI instance per each
online core, per interface. Booting with a subset of cores and
bringing up more cores afterwards means that no NAPI instances
are created for the newly added cores.
Therefore we create a NAPI instance for each possible core in
the system such that there will always be <total_no_of_cores>
NAPI instances for each interface.
This also gurantees that we do enable/disable NAPI on all possible
cores at ifconfig up/down thus eliminating the need to keep track
of the cores that were online at the previous ifconfig operation.
Even though we do create a NAPI instance and enable it for all
possible cores (including offline cores), the scheduler ensures
that NAPI will not be scheduled on offline cores.
Signed-off-by: Cristian Sovaiala <cristian.sovaiala@freescale.com>
Change-Id: I666bbb870fb8645495a80343cdbefb047c086f4c
Reviewed-on: http://git.am.freescale.net:8181/5118
Reviewed-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Rivera Jose-B46482 <German.Rivera@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/dpa')
6 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c index f540e94..7e04f25 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c @@ -481,7 +481,7 @@ static void dpaa_eth_napi_enable(struct dpa_priv_s *priv) struct dpa_percpu_priv_s *percpu_priv; int i; - for_each_online_cpu(i) { + for_each_possible_cpu(i) { percpu_priv = per_cpu_ptr(priv->percpu_priv, i); napi_enable(&percpu_priv->napi); } @@ -492,7 +492,7 @@ static void dpaa_eth_napi_disable(struct dpa_priv_s *priv) struct dpa_percpu_priv_s *percpu_priv; int i; - for_each_online_cpu(i) { + for_each_possible_cpu(i) { percpu_priv = per_cpu_ptr(priv->percpu_priv, i); napi_disable(&percpu_priv->napi); } @@ -584,7 +584,7 @@ static int dpa_private_netdev_init(struct device_node *dpa_node, /* Although we access another CPU's private data here * we do it at initialization so it is safe */ - for_each_online_cpu(i) { + for_each_possible_cpu(i) { percpu_priv = per_cpu_ptr(priv->percpu_priv, i); percpu_priv->net_dev = net_dev; @@ -822,7 +822,7 @@ dpaa_eth_priv_probe(struct platform_device *_of_dev) err = -ENOMEM; goto alloc_percpu_failed; } - for_each_online_cpu(i) { + for_each_possible_cpu(i) { percpu_priv = per_cpu_ptr(priv->percpu_priv, i); memset(percpu_priv, 0, sizeof(*percpu_priv)); } diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c index 892b333..e04b3b7 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c @@ -220,7 +220,7 @@ dpa_get_stats64(struct net_device *net_dev, struct dpa_percpu_priv_s *percpu_priv; int numstats = sizeof(struct rtnl_link_stats64) / sizeof(u64); - for_each_online_cpu(i) { + for_each_possible_cpu(i) { percpu_priv = per_cpu_ptr(priv->percpu_priv, i); cpustats = (u64 *)&percpu_priv->stats; diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c index 0e89aed..8065a81 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c @@ -335,7 +335,7 @@ static int dpaa_eth_macless_probe(struct platform_device *_of_dev) err = -ENOMEM; goto alloc_percpu_failed; } - for_each_online_cpu(i) { + for_each_possible_cpu(i) { percpu_priv = per_cpu_ptr(priv->percpu_priv, i); memset(percpu_priv, 0, sizeof(*percpu_priv)); } diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_non_sg.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_non_sg.c index b4d26ce..f1f9fce 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_non_sg.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_non_sg.c @@ -138,7 +138,7 @@ int dpa_bp_priv_seed(struct dpa_bp *dpa_bp) dpa_bp->size = default_buf_size; /* Give each cpu an allotment of "count" buffers */ - for_each_online_cpu(i) { + for_each_possible_cpu(i) { int j; for (j = 0; j < dpa_bp->target_count; j += 8) diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c index fff3926..38580c9 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c @@ -135,7 +135,7 @@ int dpa_bp_priv_seed(struct dpa_bp *dpa_bp) int i; /* Give each CPU an allotment of "config_count" buffers */ - for_each_online_cpu(i) { + for_each_possible_cpu(i) { int j; /* Although we access another CPU's counters here diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c index 565b46e..300c456 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c @@ -693,7 +693,7 @@ dpaa_eth_shared_probe(struct platform_device *_of_dev) err = -ENOMEM; goto alloc_percpu_failed; } - for_each_online_cpu(i) { + for_each_possible_cpu(i) { percpu_priv = per_cpu_ptr(priv->percpu_priv, i); memset(percpu_priv, 0, sizeof(*percpu_priv)); } |