summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
diff options
context:
space:
mode:
authorYunsheng Lin <linyunsheng@huawei.com>2020-09-16 17:33:48 +0800
committerDavid S. Miller <davem@davemloft.net>2020-09-17 16:14:28 -0700
commit8c30e19460e1bb935c788a077cc063fb15f1ef04 (patch)
treef21de7e3f7feda0232579bd524a1456132c38346 /drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
parent20d06ca2679cb1810135c70be340e5477c83a808 (diff)
net: hns3: optimize the rx clean process
Currently HNS3_RING_RX_RING_FBDNUM_REG register is read to determine how many rx desc can be cleaned. To avoid the register read operation in the critical data path, use the valid bit in the rx desc to determine if a specific rx desc can be cleaned. The hns3 driver clear valid bit in the rx desc before notifying the rx desc to the hw, and hw will only set the valid bit of the rx desc after corresponding buffer is filled with packet data and other field in the rx desc is set accordingly. Add hns3_rx_ring_move_fw() function to clear the valid bit in the rx desc before moving rx ring's next_to_clean forward to avoid double cleaning a rx desc, also add a dma_rmb() barrier in hns3_handle_rx_bd() to make sure valid bit is set before reading other field in the rx desc. 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>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hns3_enet.h')
0 files changed, 0 insertions, 0 deletions