Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4942473ybp; Mon, 14 Oct 2019 12:36:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSPq4FM3hCPfO1jECEUWKlFkHPNYQAUTHtK43BmbRz0ZyvUiDNshTC24A73pHiutYYiJCh X-Received: by 2002:aa7:ca52:: with SMTP id j18mr29732319edt.299.1571081784113; Mon, 14 Oct 2019 12:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571081784; cv=none; d=google.com; s=arc-20160816; b=u/nAZfjysW4E5RCxzX9IxUtyS2wSJjb9BFGW6t7pC9UgfPGaR5WQ+RxMoX5nTZb3nN WlTRRyD8BEiLDkC3jnQ2BP/sgEBXx9coUvvigiIFllJykNtRM+j9+NFFolK97eOJhFdR F0yGJawMGDFdEE18DvWLKgPXmBhtU084eWrQGb4USWz9uSL9hhrXS/wBc4dr/wLT8Ihy Yy3haydNb02rgXcVS6waLaVIfw+gDx/HDhAC9wU512PZ2/n0GpJeWxbnB8+1IY7g69Ga 8hod0yZ2HVX/ybVcR7/KuLlWcKzI4BO08JTW2a5sKiYYaHU4hBZtQGFJawwtuWzGUbVv flGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=TcYwlh8m3rpWuvsgEGDkIAHPtWJgLexaUieVa+euzDE=; b=DQocXTmLTcGYhJcED9usa9llqoDKyqZk5eP2peXfFFqE6U0XpM1nSynVK3hEYhixsz NZ4UBwH944ZFDhC04Ty1gibtnUIkFIhGX0e9YVKrVFn6uSi8vPki8v+KII4i2La2+Leq l+fxURtjfb0kA52MNHCWXDW/t3KVYZZ2xkuQdyugAr1IJYGQQ3z7BNqnejUYquaJZBqw n/mGrEKQ73N62LmgRFxWzem3Bw6rllIryuVHZMblqrxz7xGVpaQb/qxFwBIyweXRMGxg Rq0yGAFxp2IttLnOkoyqOtYKB/nUeyJHrQQuiVVfchebhXNrS3D+WWg4IwDX+0RL+4Et nARw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H09Y8AeH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gg10si11364603ejb.206.2019.10.14.12.36.00; Mon, 14 Oct 2019 12:36:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H09Y8AeH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730760AbfJNR5z (ORCPT + 99 others); Mon, 14 Oct 2019 13:57:55 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:46432 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728941AbfJNR5y (ORCPT ); Mon, 14 Oct 2019 13:57:54 -0400 Received: by mail-pl1-f196.google.com with SMTP id q24so8312363plr.13; Mon, 14 Oct 2019 10:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TcYwlh8m3rpWuvsgEGDkIAHPtWJgLexaUieVa+euzDE=; b=H09Y8AeHXNPww5ZTPyskS0U8BkXT6T/s7oAw66f1FBkQzznWYU7d7Z3Le+gLVUH8OG ihgN/JetUuPSBO4ZUqUBOaxPRjAbJxSDUSON6lLJ+r1tngmnE6RYx2iOYp4MnoZB0Hv3 YcCUy9/AH+nujDIP0yurBRxNrYCe5qYTbHQb6sVC1J9CaLpAb6pR2e2Tq4xdssZ+Vljc h/V8Ghl7tADXhjuMxRMV6gv1mvfBv1rd2knhJGaIVjJ3w5hZ+G93rYGNYtG/HRq6L1L+ x2AxvWIlYjFfP1d6MI5DlJroaJwmcw95HDFANcwj57hFbmJq2a4Se8WgNSjmGmXs6nzB FEPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TcYwlh8m3rpWuvsgEGDkIAHPtWJgLexaUieVa+euzDE=; b=uhgIr/nlmj4L465eVvO7cCYZVt2jBBJkRTvXG95OI695dyMQ4phSmm91UNRBfvviK9 ruLM5s0Ibyuzq5FUXR3gbHEHyK5cvwE0BnMTYfTyD84RF9HDifq8MokOQnyDxfH6jtg8 2aYuAExieYcfKXaoEbho+PyQE3TgZp1191Am7niV20qMmtgp6OJoFEKI3stcKiX9lLAN BFuf/dhp94ma1uibnWb2SNbrVO5u9hW0VNP7kvgnfjq7XrK8fpSDX2RdBTa7bU8B+drX Qj36h7QwC4GT5MsDb0nyYHquz/255TMsZbmukpklZUafAp5BVifa8+88Bi0qM5Pv6ge9 m7Fg== X-Gm-Message-State: APjAAAW/Y0jHB8U6U0NyFQGX/v7qlmqTPPKHd5DmYz1RpXMQPXF2Qf4B WjeCVaPe2kxbeMzeFnnpODQ98v1tXG5wG3gNy7b9FA== X-Received: by 2002:a17:902:321:: with SMTP id 30mr31388615pld.61.1571075873894; Mon, 14 Oct 2019 10:57:53 -0700 (PDT) MIME-Version: 1.0 References: <20191012071620.8595-1-zhiyuan2048@linux.alibaba.com> In-Reply-To: <20191012071620.8595-1-zhiyuan2048@linux.alibaba.com> From: Cong Wang Date: Mon, 14 Oct 2019 10:57:42 -0700 Message-ID: Subject: Re: [PATCH net] net: sched: act_mirred: drop skb's dst_entry in ingress redirection To: Zhiyuan Hou Cc: Jamal Hadi Salim , Jiri Pirko , "David S . Miller" , Linux Kernel Network Developers , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 12, 2019 at 12:16 AM Zhiyuan Hou wrote: > diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c > index 9ce073a05414..6108a64c0cd5 100644 > --- a/net/sched/act_mirred.c > +++ b/net/sched/act_mirred.c > @@ -18,6 +18,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -298,8 +299,10 @@ static int tcf_mirred_act(struct sk_buff *skb, const struct tc_action *a, > > if (!want_ingress) > err = dev_queue_xmit(skb2); > - else > + else { > + skb_dst_drop(skb2); > err = netif_receive_skb(skb2); > + } Good catch! I don't want to be picky, but it seems this is only needed when redirecting from egress to ingress, right? That is, ingress to ingress, or ingress to egress is okay? If not, please fix all the cases while you are on it? Thanks.