fsl_l2_switch driver on Vybrid makes CPU load to 100%

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

fsl_l2_switch driver on Vybrid makes CPU load to 100%

1,947 Views
bhuvanchandradv
Contributor II

Hi All,

I was working on vybrid internal l2 switch driver (fsl_l2_switch).

As expected the driver loaded successfully and switch functionality worked, but the switch driver makes the CPU load to ~100 percent.

After debugging the driver found that the 'schedule_timeout' function used in the thread had 1 jiffie (HZ/100). ~10 milli second.

Why is it required to poll the learning record valid bit (FEC_ESW_LSR) .... so frequently ?

Best regards,

Bhuvanchandra DV

Labels (3)
9 Replies

1,503 Views
jeremyesquirol
Contributor III

Hello Bhuvanchandra,

Have you find a way to reduce the CPU load when the switch is enabled? I've the same issue than yours (test on Freescale tower with dual IP using TWR-SER2).

And i've noticed another problem when L2 switch is enabled, the 'reboot' linux command don't work, it kill services but don't restart. Have you the same thing?

0 Kudos

1,503 Views
bhuvanchandradv
Contributor II

Hi Jemery,

>Have you find a way to reduce the CPU load when the switch is enabled?

The scheduled timeout in the switch_enet_learning kthread was 10 mill sec, which is making the CPU to 100 % loaded. I tried increasing the delay to 100 mill seconds, now CPU was with 13 % load.

--- a/drivers/net/ethernet/freescale/fsl_l2_switch.c

+++ b/drivers/net/ethernet/freescale/fsl_l2_switch.c

@@ -2251,7 +2251,7 @@ static int switch_enet_learning(void *arg)

             esw_atable_dynamicms_learn_migration(fep,

                     fep->currTime);

         else

-            schedule_timeout(HZ/100);

+            schedule_timeout(HZ/10);

     }

     return 0;

--


>And i've noticed another problem when L2 switch is enabled, the 'reboot' linux command don't work, it kill services but don't restart. Have you the same thing?

I didn’t faced any other issues apart from the CPU load


Best regards,

Bhuvanchandra DV

1,503 Views
timesyssupport
Senior Contributor II

Hello Bhuvanchandra,

     We could not reproduce your issue and l2 switch driver doesn't  makes much CPU load. If you would share the steps to reproduce your issue along with the kernel configuration, it will help us  to analyse the issue.

Thanks,

Timesys Support

0 Kudos

1,503 Views
bhuvanchandradv
Contributor II

>We could not reproduce your issue and l2 switch driver doesn't  makes much CPU load. If you would share the steps to reproduce your issue along with the kernel configuration, it will help us  to analyse the issue.

Had a dual ethernet custom board with Micrel KS8041 PHYs over RMII interface.

Enabled l2_switch driver and done the appropriate pinmuxing required.

kernel debug messages:

...

[    8.707633] Ethernet Switch Version 1.0

[    8.714306] eth_switch_probe: ethernet switch init

[    8.725622] fsl l2 switch MII Bus: probed

[    8.732405] fsl l2 switch MII Bus mdiobus(0) register ok.

[    8.741190] eth0: ethernet switch 00:14:2d:49:3d:8d

[  20.262069] attached phy 0 to driver Micrel KS8041 (mii_bus:phy_addr=0:00, irq=-1)

[  20.269955] attached phy 1 to driver Micrel KS8041 (mii_bus:phy_addr=0:01, irq=-1)

...

/proc/interrupts | grep switch

114:        161      GIC  switch

ps -e | grep switch

  49 ?        00:00:00 fsl_l2switch_le

Top output:

top - 16:39:19 up 3 min,  1 user,  load average: 0.08, 0.22, 0.12

Tasks:  69 total,  2 running,  67 sleeping,  0 stopped,  0 zombie

Cpu(s):  1.0%us,  0.0%sy,  0.0%ni,  0.0%id,  0.0%wa, 99.0%hi,  0.0%si,  0.0%st

Mem:    253008k total,    63544k used,  189464k free,        0k buffers

Swap:        0k total,        0k used,        0k free,    30784k cached

kindly find the config file in the attachment.

Best regards,

Bhuvanchandra DV

0 Kudos

1,503 Views
timesyssupport
Senior Contributor II

Hello Bhuvanchandra,

We have not previously experienced issues as you have reported. Our reference hardware does not include dual ethernet PHY, so as you are using custom hardware with dual ethernet, we would need to debug this issue on your hardware, review your code changes, and attempt to determine a cause. If you will require assistance with this issue, please contact sales@timesys.com to discuss dedicated engineering services.

Thanks,

Timesys Support

0 Kudos

1,503 Views
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport can you continue with the follow up?

0 Kudos

1,503 Views
karina_valencia
NXP Apps Support
NXP Apps Support

reminder

Timesys Support can you continue with the follow up?

0 Kudos

1,503 Views
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport can you attend this case?

0 Kudos

1,503 Views
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport do you have an update?

0 Kudos