• Yunsheng Lin's avatar
    net: hns3: schedule the polling again when allocation fails · 68752b24
    Yunsheng Lin authored
    Currently when there is a rx page allocation failure, it is
    possible that polling may be stopped if there is no more packet
    to be reveiced, which may cause queue stall problem under memory
    pressure.
    
    This patch makes sure polling is scheduled again when there is
    any rx page allocation failure, and polling will try to allocate
    receive buffers until it succeeds.
    
    Now the allocation retry is added, it is unnecessary to do the rx
    page allocation at the end of rx cleaning, so remove it. And reset
    the unused_count to zero after calling hns3_nic_alloc_rx_buffers()
    to avoid calling hns3_nic_alloc_rx_buffers() repeatedly under
    memory pressure.
    
    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>
    68752b24
hns3_enet.c 150 KB