• Yunsheng Lin's avatar
    net: hns3: optimize the tx clean process · 20d06ca2
    Yunsheng Lin authored
    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: default avatarYunsheng Lin <linyunsheng@huawei.com>
    Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    20d06ca2
hns3_enet.h 15.2 KB