Hi everyone,
I am using S32K344 board for a CAN related project for a while. Recently, When I was doing stress tests, I found out that S32K344 had issue to receive/process/send CAN messages. Please point out anything wrong with my Program.
1. Project goal and structure
The project is basically to receive a CAN message from a CAN channel and send the same CAN message to another or multiple CAN channels, it's a "CAN forwarding gateway". Here's my program blocks:

CAN Rx -> process block

Process block, inside it's some simple program to find out which CAN channel(s) should the CAN messages go to. After that, the program will call Simulink functions for sending.

Simulink functions for sending

Inside of Simulink sending function, each channel has its own send function to call.
The current issues:
1. I am not seeing right amount of CAN messages. In this case, CAN1->CAN1, CAN2->CAN2 etc.

Even at every low loading, a message per 5ms, I saw CAN 1 & 2 had less CAN data, while CAN 3 & 4 had more data.
2. The above issue happened to S32K344 especially when CAN messages are received from multiple CAN channels. I similar tests to CAN 1 only, it seems ok.
My questions:
1. Are there potential issues where there is only one receive block to handle 6 CAN channels? Is there a way to separate them into each channel?
2. Since all CAN messages go to receive block, there is bigger risk of CAN message collision, where two CAN messages received at the same time. How to avoid this?
3. Should a queue be added into process block? Any recommendations on what queue should I use?
4. Any improvement suggestions on sending side for my project?
Thank you in advance
S32K344-WB @robertv