net/hns3: fix statistics
authorHao Chen <chenhao164@huawei.com>
Fri, 25 Oct 2019 12:37:02 +0000 (20:37 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 25 Oct 2019 17:23:23 +0000 (19:23 +0200)
commit1e627b8d9956d149caa2cd4ba22479491b97b4ff
treebfa292947f03b41f852f1772c06e2cb0d6951a01
parent1526dd05328a97ebe77cf86cbf05edfa5ff17963
net/hns3: fix statistics

This patch fixes the statistics problems for sending and receiving
message as belows:

1.In receiving direction, for FCS error messages, drivers should not
record them in rte_eth_stats.ipackets statistics.

2.In sending direction, for messages of illegal length, too long or
equals 0, drivers should not notify the network card hardware to
send them, should not continue to send the remaining message in burst,
and record them in rte_eth_stats.opackets statistics.

Fixes: 8839c5e202f3 ("net/hns3: support device stats")

Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
drivers/net/hns3/hns3_rxtx.c
drivers/net/hns3/hns3_rxtx.h
drivers/net/hns3/hns3_stats.c