exanic-software icon indicating copy to clipboard operation
exanic-software copied to clipboard

I am not being able to execute Exasock example

Open chtrading opened this issue 5 years ago • 15 comments

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 avatar Aug 21 '20 21:08 chtrading

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?

chtrading avatar Aug 25 '20 05:08 chtrading

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

eigenmatt avatar Aug 25 '20 15:08 eigenmatt

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

chtrading avatar Aug 25 '20 21:08 chtrading

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?

ManishaRiyana avatar Jul 14 '21 12:07 ManishaRiyana

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

chtrading avatar Jul 14 '21 12:07 chtrading

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

ManishaRiyana avatar Jul 14 '21 13:07 ManishaRiyana

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

chtrading avatar Jul 14 '21 13:07 chtrading

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

ManishaRiyana avatar Jul 15 '21 05:07 ManishaRiyana

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

dworvos avatar Sep 10 '21 19:09 dworvos

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

ManishaRiyana avatar Sep 13 '21 04:09 ManishaRiyana

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

dworvos avatar Sep 13 '21 14:09 dworvos

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 avatar Sep 15 '21 07:09 ManishaRiyana

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

ManishaRiyana avatar Sep 15 '21 10:09 ManishaRiyana

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

dworvos avatar Sep 15 '21 11:09 dworvos

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!

dbergamin avatar Nov 03 '22 22:11 dbergamin