Closed ghost closed 6 years ago
Hmm, well the reinit stuff was never properly tested as I don't have a multi-host setup.
I don't think your solution is very good though. For starters, link_sta should be set to 1 or 0 not NTB_SPEED_GEN1.
It should probably be set to the value it was at before the reinit is done. I expect it would also be a good idea to ensure the local spads keep their values too. Which probably means we should rework it so that it sets up the peer's registers and doesn't deallocate/reallocate the shared memory.
Hi Logan,
Thanks for the comment. I updated the fix. please help to review it.
For the local spads, we can rework it later on.
Thanks Joey
The link_sta is initialized by switchtec_ntb_link_enable() when loading ntb_transport module. Because the peer does not load driver, the ntb link will not be up. When the peer loads the ntb_hw_switchtec module, the switchtec_ntb_reinit_peer() and switchtec_ntb_init_shared_mw() will be called. The link_sta will not be re-initialized. the ntb link cannot be up.
This issue can be reproduced by following test. Test Setup: Host 1 <- -> Switchtec <- -> Host 2
Test Steps:
Thanks joey