• Yunsheng Lin's avatar
    net: hns3: optimize the rx page reuse handling process · fa7711b8
    Yunsheng Lin authored
    Current rx page offset only reset to zero when all the below
    conditions are satisfied:
    1. rx page is only owned by driver.
    2. rx page is reusable.
    3. the page offset that is above to be given to the stack has
    reached the end of the page.
    
    If the page offset is over the hns3_buf_size(), it means the
    buffer below the offset of the page is usable when the above
    condition 1 & 2 are satisfied, so page offset can be reset to
    zero instead of increasing the offset. We may be able to always
    reuse the first 4K buffer of a 64K page, which means we can
    limit the hot buffer size as much as possible.
    
    The above optimization is a side effect when refacting the
    rx page reuse handling in order to support the rx copybreak.
    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>
    fa7711b8
hns3_enet.c 146 KB