OSDN Git Service

net: hns3: optimize the tx clean process
authorYunsheng Lin <linyunsheng@huawei.com>
Wed, 16 Sep 2020 09:33:47 +0000 (17:33 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Sep 2020 23:14:28 +0000 (16:14 -0700)
commit20d06ca2679cb1810135c70be340e5477c83a808
tree327f5e5ade5c0aaee20e0e60c45e7d4e181db237
parentf6061a056c8b5cc76f23e61859519ea555b9e6fc
net: hns3: optimize the tx clean process

Currently HNS3_RING_TX_RING_HEAD_REG register is read to determine
how many tx desc can be cleaned. To avoid the register read operation
in the critical data path, use the valid bit in the tx desc to determine
if a specific tx desc can be cleaned.

The hns3 driver sets valid bit in the tx desc before ringing a doorbell
to the hw, and hw will only clear the valid bit of the tx desc after
corresponding packet is sent out to the wire. And because next_to_use
for tx ring is a changing variable when the driver is filling the tx
desc, so reuse the pull_len for rx ring to record the tx desc that has
notified to the hw, so that hns3_nic_reclaim_desc() can decide how many
tx desc's valid bit need checking when reclaiming tx desc.

And io_err_cnt stat is also removed for it is not used anymore.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c