From 36ca28088b9fa80edc82d390652301c1de9185ea Mon Sep 17 00:00:00 2001 From: linmiaohe Date: Sat, 4 May 2019 10:51:23 +0800 Subject: [PATCH] ipvlan: disable l2e local xmit euler inclusion category: bugfix bugzilla: NA 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: linmiaohe Reviewed-by: Wei Yongjun Signed-off-by: Zhang Xiaoxu Signed-off-by: Keefe Liu Reviewed-by: Wei Yongjun Signed-off-by: Yang Yingliang --- 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 39cefb987c09..4f863abbf4c1 100644 --- a/drivers/net/ipvlan/ipvlan_core.c +++ b/drivers/net/ipvlan/ipvlan_core.c @@ -796,8 +796,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); } -- GitLab