From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8ABAC11D2F for ; Mon, 24 Feb 2020 15:58:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A419920828 for ; Mon, 24 Feb 2020 15:58:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727976AbgBXP63 (ORCPT ); Mon, 24 Feb 2020 10:58:29 -0500 Received: from dispatch1-us1.ppe-hosted.com ([148.163.129.52]:39088 "EHLO dispatch1-us1.ppe-hosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727359AbgBXP63 (ORCPT ); Mon, 24 Feb 2020 10:58:29 -0500 X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us3.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id E7F01B4007E; Mon, 24 Feb 2020 15:58:27 +0000 (UTC) Received: from [10.17.20.203] (10.17.20.203) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 24 Feb 2020 15:58:13 +0000 Subject: Re: [PATCH net-next 4/6] net/sched: act_ct: Create nf flow table per zone To: Paul Blakey , Saeed Mahameed , "Oz Shlomo" , Jakub Kicinski , Vlad Buslov , David Miller , "netdev@vger.kernel.org" , Jiri Pirko , Roi Dayan References: <1582458307-17067-1-git-send-email-paulb@mellanox.com> <1582458307-17067-5-git-send-email-paulb@mellanox.com> From: Edward Cree Message-ID: <97c2e036-6334-9818-f8cd-4c2671273eed@solarflare.com> Date: Mon, 24 Feb 2020 15:58:10 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <1582458307-17067-5-git-send-email-paulb@mellanox.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Originating-IP: [10.17.20.203] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1020-25250.003 X-TM-AS-Result: No-7.659100-8.000000-10 X-TMASE-MatchedRID: QfHZjzml1E/mLzc6AOD8DfHkpkyUphL9CwT2DH7iMm5v/W4eavUSar0E v48zkQ1BuvJP2tI8V/sWsp6eJb7A26H2g9syPs888Kg68su2wyGrcyxAHgzswgaYevV4zG3ZQBz oPKhLashW+rzIcpyAZh2Hg3YJOrAmRe7UNYLzDks1TzxKO8pZtAKflB9+9kWVT7zqZowzdpIDE6 k/i6Y0RS84Nf6AzMJsUVDDZpJlenBarFKFj/o9tPbta0OAYFzy2LlbtF/6zpAcNByoSo036Wm3Y eujho7/585VzGMOFzABi3kqJOK62QtuKBGekqUpm+MB6kaZ2g4xi1AR6sx0/fXAL7AUDhbJDlcC N9qTwCPb3YtTMtmeQ5S8E/SWXRgGbxRMw8GphfCvaBbe8WTmfAfCg4wbLbsmKr/XZw2p5eqPgCD bAY3P7tVH8LonOSWy/S2A05ietQe2WKPzVcog4boOfFLgUu3n X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--7.659100-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1020-25250.003 X-MDID: 1582559908-yPrZhb_mcz64 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 23/02/2020 11:45, Paul Blakey wrote: > Use the NF flow tables infrastructure for CT offload. > > Create a nf flow table per zone. > > Next patches will add FT entries to this table, and do > the software offload. > > Signed-off-by: Paul Blakey > Reviewed-by: Jiri Pirko > --- > drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 1 + > include/net/tc_act/tc_ct.h | 2 + > net/sched/Kconfig | 2 +- > net/sched/act_ct.c | 159 +++++++++++++++++++++++- > 4 files changed, 162 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c > index 70b5fe2..eb16136 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c > @@ -45,6 +45,7 @@ > #include > #include > #include > +#include > #include > #include > #include "en.h" > diff --git a/include/net/tc_act/tc_ct.h b/include/net/tc_act/tc_ct.h > index a8b1564..cf3492e 100644 > --- a/include/net/tc_act/tc_ct.h > +++ b/include/net/tc_act/tc_ct.h > @@ -25,6 +25,8 @@ struct tcf_ct_params { > u16 ct_action; > > struct rcu_head rcu; > + > + struct tcf_ct_flow_table *ct_ft; > }; > > struct tcf_ct { > diff --git a/net/sched/Kconfig b/net/sched/Kconfig > index edde0e5..bfbefb7 100644 > --- a/net/sched/Kconfig > +++ b/net/sched/Kconfig > @@ -972,7 +972,7 @@ config NET_ACT_TUNNEL_KEY > > config NET_ACT_CT > tristate "connection tracking tc action" > - depends on NET_CLS_ACT && NF_CONNTRACK && NF_NAT > + depends on NET_CLS_ACT && NF_CONNTRACK && NF_NAT && NF_FLOW_TABLE Is it not possible to keep sensible/old behaviour in the case  of NF_FLOW_TABLE=n?  (And what about NF_FLOW_TABLE=m, which is  what its Kconfig help seems to advise...) > help > Say Y here to allow sending the packets to conntrack module. > > diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c > index f685c0d..4267d7d 100644 > --- a/net/sched/act_ct.c > +++ b/net/sched/act_ct.c > @@ -15,6 +15,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -24,6 +25,7 @@ > #include > #include > > +#include > #include > #include > #include > @@ -31,6 +33,133 @@ > #include > #include > > +static struct workqueue_struct *act_ct_wq; > + > +struct tcf_ct_flow_table { > + struct rhash_head node; /* In zones tables */ > + > + struct rcu_work rwork; > + struct nf_flowtable nf_ft; > + u16 zone; > + u32 ref; Any reason this isn't using a refcount_t? -ed