
From: Miaohe Lin <linmiaohe@huawei.com> euler inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4IHL1 CVE: NA ------------------------------------------------- Ipvlan l2e mode will cache skbuff for local xmit in ipvlan_xmit_mode_l2e. But when tso/gso is disabled, this would result in performance loss. So we should stop caching the skbuff when tso/gso is disabled. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Reviewed-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com> Signed-off-by: Keefe Liu <liuqifa@huawei.com> Reviewed-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Yuehaibing <yuehaibing@huawei.com> Reviewed-by: Wenan Mao <maowenan@huawei.com> Signed-off-by: Chen Zhou <chenzhou10@huawei.com> Signed-off-by: Wang Hai <wanghai38@huawei.com> Reviewed-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Yue Haibing <yuehaibing@huawei.com> Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> --- drivers/net/ipvlan/ipvlan_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c index 8de1f58d2fab..56ae0814982e 100644 --- a/drivers/net/ipvlan/ipvlan_core.c +++ b/drivers/net/ipvlan/ipvlan_core.c @@ -793,8 +793,9 @@ static int ipvlan_xmit_mode_l2e(struct sk_buff *skb, struct net_device *dev) return NET_XMIT_DROP; } - if (unlikely(ipvlan_l2e_local_xmit_event(ipvlan, - &skb))) + if (unlikely((dev->features & + (NETIF_F_GSO | NETIF_F_TSO)) && + ipvlan_l2e_local_xmit_event(ipvlan, &skb))) return NET_XMIT_DROP; return ipvlan_rcv_frame(addr, &skb, true); } -- 2.20.1