cisco / exanic-software

ExaNIC drivers, utilities and development libraries
Other
131 stars 79 forks source link

I am not being able to execute Exasock example #31

Open chtrading opened 3 years ago

chtrading commented 3 years ago

Steps to repeat the problem: 1- Generate the .fw using exanic devkit + trigger_example 2- Update the firmware 3- Download this software source 4- make && make install 5- cd exanic-software/examples/devkit 6- gcc exasock-tcp-responder-example.c -lexanic -lexasock_ext 7- $ ./a.out 541 192.168.1.50 8000 Connected to 192.168.1.50:8000 exasock_tcp_get_device: Operation not supported

I have noticed exasock is using stub.c which always returns -1 with errno=EOPNOTSUPP (I know this because when I add printfs in the stub.c I can see them and adding printfs to tcp.c doesn't have any effect) image

I've noticed the absence of the "/dev/exasock" as well.

chtrading commented 3 years ago

I am trying for hours to solve this problem. The only solution that I can do is: $ sudo rmmod exanic $ sudo modprobe exanic $ sudo modprobe exasock

That is: unload exanic, load exanic, and ... load exasock.

I am using the version 2.5.0.

It is like as exanic wasn't loaded. When I try to load exasock the modprobe says something like "Unknown symbol exanic_netdev_get_id_and_port".

The only solution that I've found is this above, unfortunately. Can you help?

eigenmatt commented 3 years ago

Re:

$ ./a.out 541 192.168.1.50 8000
Connected to 192.168.1.50:8000
exasock_tcp_get_device: Operation not supported

You need to run exasock ./a.out 541 192.168.1.50 8000. Linking with -lexasock_ext just provides the extension functions, you still need to use the exasock script to enable the exasock socket acceleration. Otherwise the stubs will be called. This allows you to use the same binary with/without exasock.

It is like as exanic wasn't loaded. When I try to load exasock the modprobe says something like "Unknown symbol exanic_netdev_get_id_and_port".

If I understand you correctly, the exasock module is not working after boot with messages like the above, but after unloading and reloading the drivers it starts to work. I think probably you have an older version of the ExaNIC driver on an initramfs/initrd that is loading at boot. How to fix this depends on your distribution. On Ubuntu/Debian, try sudo update-initramfs -k all -u On RHEL/CentOS/Fedora, try sudo dracut -f

I hope this helps. Please note that this is not an actively monitored support channel, if you want more responsive support, it is best to contact support@exablaze or Cisco TAC.

Best regards, Matt

chtrading commented 3 years ago

eigenmatt, Your answer was perfectly accurate. Thank you a thousand times.

ManishaRiyana commented 3 years ago

Hey im facing the similar issue, I tried the solution suggested, but that does not seem to have any impact on the issue. If you could please help out?

chtrading commented 3 years ago

@ManishaRiyana , "sudo dracut -f" was the command I needed.

ManishaRiyana commented 3 years ago

Im working on Ubuntu.. so I tried sudo update-initramfs -k all -u That did not seem to solve the issue.. I even tried invoking exasock by calling it before executing the tcp-responder code, even that did not resolve it.. any other ideas on what might be causing this issue

chtrading commented 3 years ago

@ManishaRiyana Does your Ubuntu have /dev/exasock presence?

ManishaRiyana commented 3 years ago

Hey, My dev/ shows exanic0 as well as exasock presence. Even then my exasock is not running simple commands like sudo exasock nc -u -l 1234.. listening to UDP datagrams on port 1234 does not yield any results, whereas my Linux network interface without exasock command receives datagrams correctly

dworvos commented 2 years ago

Hope this might help others who stumble here... Had this same issue running on CentOS 7. To resolve I had to make sure to have interface up using exanic-config xyz up (to get /dev/exasock) and then additionally had to cable the exanic to another host. I suspect changing the exanic host to support multi-home would work but using another host was an easier alternative in my situation

ManishaRiyana commented 2 years ago

What do you exactly mean by using another host? Could you please elaborate?

dworvos commented 2 years ago

Sure - the TCP responder application needs to connect to a TCP server - I was getting this error trying to direct connect to a different NIC on the same host. I put the TCP server on a different host and direct attach from the exanic card to that different host

ManishaRiyana commented 2 years ago

Right, I've tested this, the issue is slightly different in my case. I have an active intel connection as well on my host. So when I'm trying to run TCP responder example, the connections are being directed through the intel network IP and not exanic IP. That's why its throwing the not supported error. I disabled the intel IP and ran the example again, which is giving me accurate results.

ManishaRiyana commented 2 years ago

And one more thing, executing with exasock helps eliminate the Operation not supported error, EXASOCK_DEBUG=1 sudo /usr/local/bin/exasock --debug --trace ./tcp_test_03_09.out xx.xx.x.xx 1234

dworvos commented 2 years ago

I should mention it may be easier to put the interfaces on different subnets or look into multihoming your linux network setup (different Linuxes require different instructions for that). Linux loves to route traffic on the same subnet through only one interface if the interfaces are on the same subnet (i.e. if you have two different NICs on 192.168.1.x and 192.168.1.y) Something like this may help you in your setup: https://serverfault.com/questions/524054/simple-multihomed-linux-server-issue

dbergamin commented 1 year ago

It is like as exanic wasn't loaded. When I try to load exasock the modprobe says something like "Unknown symbol exanic_netdev_get_id_and_port".

If I understand you correctly, the exasock module is not working after boot with messages like the above, but after unloading and reloading the drivers it starts to work. I think probably you have an older version of the ExaNIC driver on an initramfs/initrd that is loading at boot. How to fix this depends on your distribution. On Ubuntu/Debian, try sudo update-initramfs -k all -u On RHEL/CentOS/Fedora, try sudo dracut -f

I hope this helps. Please note that this is not an actively monitored support channel, if you want more responsive support, it is best to contact support@exablaze or Cisco TAC.

Best regards, Matt

Bit of a bump, but just noting I had the same issue -- was getting Unknown symbol exanic_netdev_get_id_and_port specifically on boot when trying to load exasock.

dracut -f to rebuild the initramfs got it sorted. Thanks very much for your helpful answer @eigenmatt!