From e6966c11a2b71c0031d9160dac94d1375fef7cb8 Mon Sep 17 00:00:00 2001 From: Bogdan Hamciuc Date: Thu, 18 Apr 2013 12:13:22 +0300 Subject: dpaa_eth: Add NETPOLL support Add NETPOLL support to the dpaa-ethernet driver. This is particularly useful in tandem with the Netconsole module, when we'd want to drop tons of logs (e.g. Ftrace logs) and the serial console is just too slow for that. Signed-off-by: Bogdan Hamciuc Change-Id: Ic20b62603c58910d86d17afdd9a85e4b049526f1 Reviewed-on: http://git.am.freescale.net:8181/1538 Reviewed-by: Sovaiala Cristian-Constantin-B39531 Reviewed-by: Bucur Madalin-Cristian-B32716 Reviewed-by: Fleming Andrew-AFLEMING Tested-by: Fleming Andrew-AFLEMING diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c index 5c020f2..bc1e53d 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c @@ -3034,6 +3034,20 @@ static void __cold dpa_timeout(struct net_device *net_dev) percpu_priv->stats.tx_errors++; } +#ifdef CONFIG_NET_POLL_CONTROLLER +static void dpaa_eth_poll_controller(struct net_device *net_dev) +{ + struct dpa_priv_s *priv = netdev_priv(net_dev); + struct dpa_percpu_priv_s *percpu_priv = + this_cpu_ptr(priv->percpu_priv); + struct napi_struct napi = percpu_priv->napi; + + qman_irqsource_remove(QM_PIRQ_DQRI); + qman_poll_dqrr(napi.weight); + qman_irqsource_add(QM_PIRQ_DQRI); +} +#endif + static int dpa_bp_cmp(const void *dpa_bp0, const void *dpa_bp1) { return ((struct dpa_bp *)dpa_bp0)->size - @@ -3505,6 +3519,9 @@ static const struct net_device_ops dpa_private_ops = { .ndo_set_features = dpa_set_features, .ndo_fix_features = dpa_fix_features, .ndo_do_ioctl = dpa_ioctl, +#ifdef CONFIG_NET_POLL_CONTROLLER + .ndo_poll_controller = dpaa_eth_poll_controller, +#endif }; static const struct net_device_ops dpa_shared_ops = { -- cgit v0.10.2