diff options
author | Claudiu Manoil <claudiu.manoil@freescale.com> | 2014-08-13 08:13:53 (GMT) |
---|---|---|
committer | Matthew Weigel <Matthew.Weigel@freescale.com> | 2014-12-11 18:39:24 (GMT) |
commit | 30e0b7dd208bcc1fa5728d6de84030f4a3c13651 (patch) | |
tree | 8244c42d560010ec9941e7ba3826466a3a694346 /drivers/net/ethernet/freescale/gianfar.c | |
parent | 7ac42ef158796c13dac8ff493fca8c98195bdbf3 (diff) | |
download | linux-fsl-qoriq-30e0b7dd208bcc1fa5728d6de84030f4a3c13651.tar.xz |
gianfar: Add debugfs packet forwarding loopback
Add the GFAR_DBG_LOOP config option and debugfs support
to be able to configure packet forwarding loops in the
Gianfar driver. This config option is disabled by default
and should be used only for debugging/ benchmarking
purposes.
For details on how to configure a packet forwarding debug
loop refer to the help section of CONFIG_GFAR_DBG_LOOP.
Change-Id: I24d440edc4c7d63a055205e022b743e30f58409b
Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/22861
Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com>
Tested-by: Richard Schmitt <richard.schmitt@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/gianfar.c')
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index 2f67fe8..03f9e72 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c @@ -1493,6 +1493,8 @@ static int gfar_probe(struct platform_device *ofdev) netdev_info(dev, "TX BD ring size for Q[%d]: %d\n", i, priv->tx_queue[i]->tx_ring_size); + gfar_dbg_ndev_init(priv); + return 0; register_fail: @@ -1514,6 +1516,8 @@ static int gfar_remove(struct platform_device *ofdev) { struct gfar_private *priv = platform_get_drvdata(ofdev); + gfar_dbg_ndev_exit(priv); + if (priv->phy_node) of_node_put(priv->phy_node); if (priv->tbi_node) @@ -3023,6 +3027,15 @@ static void gfar_process_frame(struct net_device *dev, struct sk_buff *skb, be16_to_cpu(fcb->vlctl)); /* Send the packet up the stack */ +#ifdef CONFIG_GFAR_DBG_LOOP + if (likely(priv->dbg_ndev_loopbk_tgt)) { + skb->dev = priv->dbg_ndev_loopbk_tgt; + skb->queue_mapping = 0; + skb_push(skb, ETH_HLEN); + gfar_start_xmit(skb, priv->dbg_ndev_loopbk_tgt); + return; + } +#endif napi_gro_receive(napi, skb); } @@ -3726,6 +3739,8 @@ static int __init gfar_init(void) { int i; + gfar_dbg_init(); + for_each_possible_cpu(i) { struct sk_buff_head *h = &per_cpu(skb_recycle_list, i); skb_queue_head_init(h); @@ -3738,6 +3753,8 @@ static void __exit gfar_exit(void) { int i; + gfar_dbg_exit(); + for_each_possible_cpu(i) { struct sk_buff_head *h = &per_cpu(skb_recycle_list, i); skb_queue_purge(h); |