OpenFastPath / ofp

OpenFastPath project
BSD 3-Clause "New" or "Revised" License
349 stars 126 forks source link

Does ofp support connectX5 ? #279

Closed Jude-Lu closed 7 months ago

Jude-Lu commented 2 years ago

Hi, I want to run ofp on connectX5, an IB card which also support DPDK. When I run DPDK samples on connectX5, there is no need to bind NIC since PWD implemented by mlx driver. I would like to ask what should I do to make it, or whether odp does not support connectX5 ?

Thanks ! Jude Lu

bogdanPricope commented 2 years ago

Hi @Jude-Lu

The error "ofp_bind failed, err='Can't assign requested address' is a socket bind error (similar with bsd socket bind() api) and not about NICs or dpdk, etc. That is, it failed to bind socket to IP/port (no IP address configured?). See https://github.com/OpenFastPath/ofp/blob/master/example/udpecho/udp_server.c line 100.

I have no idea if it works with connectX5 (I am playing with some Intel cards) but we can find out... Can you share the command line you used to start the application (parameters, etc) or/and logs? e.g.

./example/udpecho/udpecho -i 0 -f ./ofp.cli .....

Btw, I am using a different version of ofp (called nfp) but in many ways should work the same...

Jude-Lu commented 2 years ago

Hi @bogdanPricope

Thanks for your reply. I have realized the bind error is about socket bind :). The command line is as follows:

sudo ./udpecho -i p6p2

p6p2 is the name of connextX5 IB card.

The bind error exists, though I have never change the source code. I print the arg my_ip_addr, which result is 0. Maybe there is something wrong about getting the information of NIC device.

After knowing more detail about odp, which over dpdk and shield low-level info to ofp, I guess this problem that support IB card maybe the responsibility about odp.

bogdanPricope commented 2 years ago

Hi @Jude-Lu

There are two issues:

  1. If in your command you are using interface name ('p6p2') then you will actually use a slower type of interface support (basically a raw socket). If you want to use it with the dpdk you will need to: a) bound interface to dpdk ./usertools/dpdk-devbind.py -u ./usertools/dpdk-devbind.py --bind= e.g. ./usertools/dpdk-devbind.py -u 0000:03:00.0 ./usertools/dpdk-devbind.py --bind=uio_pci_generic 0000:03:00.0

b) call the udpecho with 0, 1, 2, etc interface name format, where the number is dpdk interface index e.g. ./udpecho -i 0

  1. You need to set an IP address to the interface. In your version code is done with a configuration file ./udpecho -i 0 -f ./ofp.cli and you have an example in https://github.com/OpenFastPath/ofp/blob/master/example/udpecho/ofp.cli

About the different layers, you can have: ofp, odp (different implementations) or ofp, odp (some implementations), dpdk

Initially there were multiple odp implementations available but AFAIK at this moment only odp (linux-generic platform) and odp-dpdk (linux-generic and linux-dpdk platforms) are available/up-to-date. So basically, if your board is supported by DPDK (with the correct version, etc.) it should work with odp or odp-dpdk.

You can ask odp/odp-dpdk guys about this: https://github.com/OpenDataPlane/odp https://github.com/OpenDataPlane/odp-dpdk

Jude-Lu commented 2 years ago

Hi @bogdanPricope

VERY Thanks for your reply. I will have a try according to your recommendation :)

It seems there are many details about ofp and odp remains to learn, maybe I should spend more time to try it first.

bogdanPricope commented 2 years ago

Hi @Jude-Lu

No problem. I am glad I could help. Indeed, it is a fairly complex project...but it is a user-space network stack... it is doing a lot of stuff.

You may also have a look at my version of ofp: https://github.com/NetInoSoftware/nfp . It is not open source but has a lot of other features and bug fixes.

Best regards