net/mlx4_en: Add accelerated RFS support
authorAmir Vadai <amirv@mellanox.com>
Wed, 18 Jul 2012 22:33:52 +0000 (22:33 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 19 Jul 2012 15:34:37 +0000 (08:34 -0700)
commit1eb8c695bda92ccaec30e9a3351e37a1896da54f
treea5c73ef50598f37bc3bdead53425dcedb7ae9bca
parentd9236c3f10490cd0b3fd4516af12ba62dcbae0b0
net/mlx4_en: Add accelerated RFS support

Use RFS infrastructure and flow steering in HW to keep CPU
affinity of rx interrupts and application per TCP stream.

A flow steering filter is added to the HW whenever the RFS
ndo callback is invoked by core networking code.

Because the invocation takes place in interrupt context, the
actual setup of HW is done using workqueue. Whenever new filter
is added, the driver checks for expiry of existing filters.

Since there's window in time between the point where the core
RFS code invoked the ndo callback, to the point where the HW
is configured from the workqueue context, the 2nd, 3rd etc
packets from that stream will cause the net core to invoke
the callback again and again.

To prevent inefficient/double configuration of the HW, the filters
are kept in a database which is indexed using hash function to enable
fast access.

Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_cq.c
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
drivers/net/ethernet/mellanox/mlx4/en_rx.c
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h