• Yunsheng Lin's avatar
    net: hns3: fix for miscalculation of rx unused desc · 9f9f0f19
    Yunsheng Lin authored
    rx unused desc is the desc that need attatching new buffer
    before refilling to hw to receive new packet, the number of
    desc need attatching new buffer is calculated using next_to_use
    and next_to_clean. when next_to_use == next_to_clean, currently
    hns3 driver assumes that all the desc has the buffer attatched,
    but 'next_to_use == next_to_clean' also means all the desc need
    attatching new buffer if hw has comsumed all the desc and the
    driver has not attatched any buffer to the desc yet.
    
    This patch adds 'refill' in desc_cb to indicate whether a new
    buffer has been refilled to a desc.
    
    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 avatarGuangbin Huang <huangguangbin2@huawei.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9f9f0f19
hns3_enet.h 17.5 KB