Conversation
|
@zz912 Can you test if this branch works on your setup? |
|
I commented: It works: |
Thanks for testing! |
|
The last commit should theoretically solve the issue when two boards are on the same Ethernet interface using a switch. By first sending reset and then switching all interfaces from OOB to Posix, there should be no issue if the same interface is used for two boards. It also removes some duplicated code. But I can not test two boards, I have only one. The way Xenomai4 is implemented, there is no error if you switch an interface twice to OOB or twice to Posix. Tested again with posix and evl including the error cleanup case. I call this ready. |
62bab83 to
9b9b247
Compare
By attaching rtapi_app also to the EVL core, no posix initialization is needed and all can be set up in rtapi_app_main(). Deprecate realtime-init, this function is not needed anymore.
This way, the specific network implementations don't have to know anything about the firewall.
This should avoid an issue with hm2_eth_net_evl when an interface is already set back to posix mode in close_board when an other instance is using the same interface to reset an other board. Also reduce duplicated code and improve reset message.
This is a bug introduced in LinuxCNC#4199. Restores the behaivour from before where a failed ifname resulted in a skipped install_firewall_perinterface but does continue. Additionally, add a warning. For OOB, ifname is mandatory to be able to switch the interface to OOB mode.
The socket was leaked and oob was not disabled.
9b9b247 to
9a871db
Compare
While creating Xenomai3 support, a better way to do the initialization without needing to first use posix and then switch to OOB was discovered: By attaching also rtapi_app to the EVL core, OOB functions can also be used in rtapi_app_main.
This should have no side effects due to SCHED_WEAK is used for rtapi_app: https://v4.xenomai.org/core/user-api/scheduling/index.html#SCHED_WEAK. But it gets rid of the realtime-init function which is deprecated.
This PR also moves the firewall init / cleanup from the Ethernet implementations out to hm2_eth.c. This slightly alters the calling order but should have no side effects, simplifies the code and allows support library's with less shared symbols.
Tested:
Open:
Are there applications where multiple mesa cards are connected over a switch to a single Ethernet port? This might be an issue with the actual way of initializing the interfaces for Xenomai4. Different ports should work but I have no way of testing this due to I have only one card.Theoretically fixed. But I can not test it.