net: thunderx: Program LMAC credits based on MTU
authorSunil Goutham <sgoutham@cavium.com>
Tue, 15 Nov 2016 12:07:36 +0000 (17:37 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Nov 2016 18:28:33 +0000 (13:28 -0500)
commit712c3185344050c591d78584542bd945e4f6f778
treece9261287883d127ed3de07d2d55b934fc52ff66
parent612e94bd99912f3b2ac616c00c3dc7f166a98005
net: thunderx: Program LMAC credits based on MTU

Programming LMAC credits taking 9K frame size by default is incorrect
as for an interface which is one of the many on the same BGX/QLM
no of credits available will be less as Tx FIFO will be divided
across all interfaces. So let's say a BGX with 40G interface and another
BGX with multiple 10G, bandwidth of 10G interfaces will be effected when
traffic is running on both 40G and 10G interfaces simultaneously.

This patch fixes this issue by programming credits based on netdev's MTU.
Also fixed configuring MTU to HW and added CQE counter for pkts which
exceed this value.

Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/thunder/nic.h
drivers/net/ethernet/cavium/thunder/nic_main.c
drivers/net/ethernet/cavium/thunder/nic_reg.h
drivers/net/ethernet/cavium/thunder/nicvf_main.c
drivers/net/ethernet/cavium/thunder/nicvf_queues.c
drivers/net/ethernet/cavium/thunder/nicvf_queues.h