mlx5: support napi_complete_done()
authorEric Dumazet <edumazet@google.com>
Wed, 18 Nov 2015 14:30:56 +0000 (06:30 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Nov 2015 21:17:39 +0000 (16:17 -0500)
commit44fb6fbbac23ee304d113ceb5eed45666d8a32f9
tree2723e24ade07f1ecfc8c1aff475724b93bb41bd9
parent7ae92ae588c9f78006c106bb3398d50274c5d7de
mlx5: support napi_complete_done()

A NAPI poll handler should return number of RX packets processed,
instead of 0 / budget.

This allows proper busy poll accounting through LINUX_MIB_BUSYPOLLRXPACKETS
SNMP counter.

napi_complete_done() allows /sys/class/net/ethX/gro_flush_timeout
to be used for finer GRO aggregation control.

Tested:

Enabled busy polling, and checked TcpExtBusyPollRxPackets counter is increasing.

echo 70 >/proc/sys/net/core/busy_read
nstat >/dev/null
netperf -H target -t TCP_RR >/dev/null
nstat | grep TcpExtBusyPollRxPackets
TcpExtBusyPollRxPackets         490958             0.0

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Eli Cohen <eli@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c