luigirizzo / netmap

Automatically exported from code.google.com/p/netmap
BSD 2-Clause "Simplified" License
1.85k stars 536 forks source link

BNX2X driver Support #402

Open sinainnet opened 6 years ago

sinainnet commented 6 years ago

How can I add support of BNX2X drivers to netmap? Is it already possible to use it?

vmaffione commented 6 years ago

Hi, you can already use netmap on interface with no native support,because of the emulated netmap adapter. However you are welcome to add native support for bnx2x. You can follow the guidelines in #264

sinainnet commented 6 years ago

Thanks. How can I use emulated netmap adapter?

vmaffione commented 6 years ago

The emulated adapter is created on the fly when netmap does not find a native one. So you don't need to do anything. You can just use any netmap application, I.e. pkt-gen, bridge, lb, on your bnx interface.

sinainnet commented 6 years ago

I've got my own developed application based on netmap polling interface. So, does it work fine with emulated netmap adapter? Does the performance fall down seriously?

Thanks a lot.

vmaffione commented 6 years ago

Your performance will be similar to what you can get with the in kernel pktgen. Depending on your expectations it may be ok for you.

leleobhz commented 6 years ago

@vmaffione I interest too in bnx* drivers too. I'm not a developer (Or at least a skilled one), but the guidelines isnt too bad to implement, but sometime ago, when I tried to read the source code and add the support, I see kernel do a lot of different things than the patches for - as example ixgbe - does. So, for a mainline kernel module, what do you recommend to start looking at?

vmaffione commented 6 years ago

But also ixgbe is a mainline kernel module. Kernel drivers must handle sk_buffs and offloadings, so the datapath is usually more complex. Also, errata in the hw often make the driver more convoluted. I guess you are referring to the complexity here http://elixir.free-electrons.com/linux/latest/source/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c#L3723 You should ignore anything related to offloadings and sk_buff structure, and only extract the instructions to program the hardware ring and descriptors (where to put the physical address, length, and how to tell the NIC that the new descriptors are ready).

There is no easy solution, unfortunately. One should either "reverse engineer" the source code or read the transmission/reception sections of the NIC documentation.