]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: hns3: fix return value check bug of rx copybreak
authorJie Wang <wangjie125@huawei.com>
Mon, 14 Nov 2022 08:20:47 +0000 (16:20 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 15 Nov 2022 12:29:26 +0000 (13:29 +0100)
The refactoring of rx copybreak modifies the original return logic, which
will make this feature unavailable. So this patch fixes the return logic of
rx copybreak.

Fixes: e74a726da2c4 ("net: hns3: refactor hns3_nic_reuse_page()")
Fixes: 99f6b5fb5f63 ("net: hns3: use bounce buffer when rx page can not be reused")
Signed-off-by: Jie Wang <wangjie125@huawei.com>
Signed-off-by: Hao Lan <lanhao@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

index 7fc83409f25739217ec5f14c51467112e7c7a2b6..028577943ec577ea026223837674aec8a0a9c816 100644 (file)
@@ -3778,8 +3778,8 @@ static void hns3_nic_reuse_page(struct sk_buff *skb, int i,
                desc_cb->reuse_flag = 1;
        } else if (frag_size <= ring->rx_copybreak) {
                ret = hns3_handle_rx_copybreak(skb, i, ring, pull_len, desc_cb);
-               if (ret)
-                       goto out;
+               if (!ret)
+                       return;
        }
 
 out: