• Yunsheng Lin's avatar
    net: hns3: fix error handling for desc filling · 8ceca59f
    Yunsheng Lin authored
    The content of the TX desc is automatically cleared by the HW
    when the HW has sent out the packet to the wire. When desc filling
    fails in hns3_nic_net_xmit(), it will call hns3_clear_desc() to do
    the error handling, which miss zeroing of the TX desc and the
    checking if a unmapping is needed.
    
    So add the zeroing and checking in hns3_clear_desc() to avoid the
    above problem. Also add DESC_TYPE_UNKNOWN to indicate the info in
    desc_cb is not valid, because hns3_nic_reclaim_desc() may treat
    the desc_cb->type of zero as packet and add to the sent pkt
    statistics accordingly.
    
    Fixes: 76ad4f0e ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
    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>
    8ceca59f
hnae3.h 22 KB