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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT 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 1926FC169C4 for ; Tue, 29 Jan 2019 18:07:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E9FDF2184D for ; Tue, 29 Jan 2019 18:07:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728631AbfA2SHX (ORCPT ); Tue, 29 Jan 2019 13:07:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37920 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727492AbfA2SHX (ORCPT ); Tue, 29 Jan 2019 13:07:23 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF1D923E6F4; Tue, 29 Jan 2019 18:07:22 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-32.gru2.redhat.com [10.97.116.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 62ADF5D97A; Tue, 29 Jan 2019 18:07:17 +0000 (UTC) Received: by localhost.localdomain (Postfix, from userid 1000) id 92FA3180B7C; Tue, 29 Jan 2019 16:07:15 -0200 (-02) Date: Tue, 29 Jan 2019 16:07:15 -0200 From: Marcelo Leitner To: Paul Blakey Cc: Guy Shattah , Aaron Conole , John Hurley , Simon Horman , Justin Pettit , Gregory Rose , Eelco Chaudron , Flavio Leitner , Florian Westphal , Jiri Pirko , Rashid Khan , Sushil Kulkarni , Andy Gospodarek , Roi Dayan , Yossi Kuperman , Or Gerlitz , Rony Efraim , "davem@davemloft.net" , netdev@vger.kernel.org Subject: Re: [RFC PATCH net-next 0/6 v2] connection tracking in tc and OVS offload Message-ID: <20190129180715.GW10660@localhost.localdomain> References: <1548748753-22540-1-git-send-email-paulb@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1548748753-22540-1-git-send-email-paulb@mellanox.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 29 Jan 2019 18:07:23 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Jan 29, 2019 at 09:59:07AM +0200, Paul Blakey wrote: > Hi, > As you may know, we are working on connection tracking for a while, and we already > had patches for tc that matched our connection tracking offload RFC. > > Marcelo already shared his tc patches for a similar action ct and flower match on ct_info state, > and this patches are pretty close to his. We would like to share ours and see what's the difference > so maybe we can merge the two. > > I think the main difference here is that we propose the usage of a new metadata that resembles > ovs recirc id, so one can use tc recirculation in a similar way that ovs does. This is a very interesting approach. Seems it can avoid the necessity of offloading multiple chains at all and, with that, we don't need a special fallback path for when chain X is not present in HW: it will be just another miss. Such skb may have an extra meta data, but no need to look for a special chain and so. Two points on it for further discussion. I'll reply on the specific patches. > > The plan is to support offloading of OVS rules to tc, so this recirculation id will > be shared with and from OVS. > > The following is an example using the recirc id metadata (aa_rep and bb_rep are two veth devices) > > tc qdisc add dev bb_rep ingress > tc qdisc add dev aa_rep ingress > tc filter add dev aa_rep ingress prio 1 chain 0 proto ip flower match 'meta(tc_recirc mask 0xffffffff eq 0x1)' ct_state +trk+est ip_proto tcp action mirred egress redirect dev bb_rep > tc filter add dev aa_rep ingress prio 1 chain 0 proto ip flower ct_state -trk ip_proto tcp action ct recirc 1 reclassify > tc filter add dev aa_rep ingress prio 1 chain 0 proto ip flower match 'meta(tc_recirc mask 0xffffffff eq 0x1)' ct_state +trk+new ip_proto tcp action ct commit pipe action mirred egress redirect dev bb_rep > > tc filter add dev bb_rep ingress prio 1 chain 0 proto ip flower ct_state -trk ip_proto tcp action ct recirc 2 reclassify > tc filter add dev bb_rep ingress prio 1 chain 0 proto ip flower match 'meta(tc_recirc mask 0xffffffff eq 0x2)' ct_state +trk+est ip_proto tcp action mirred egress redirect dev aa_rep > > of course, goto chain instead of reclassify will also work. > > There might be some difference in how we handle action ct and I'll follow up on that. > > > Changelog: > v1->v2: > Missed first patch :| > Added netdev mailing list > > Paul Blakey (6): > net/sched: Introduce act_ct > net/sched: cls_flower: add match on ct info > net/sched: cls_flower: Add ematch support > net: Add new tc recirc id skb extension > net/sched: em_meta: add match on tc recirc id skb extension > net/sched: act_ct: Add tc recirc id set/del support > > include/linux/skbuff.h | 1 + > include/net/tc_act/tc_ct.h | 2 + > include/uapi/linux/pkt_cls.h | 19 ++++ > include/uapi/linux/tc_act/tc_ct.h | 2 + > include/uapi/linux/tc_ematch/tc_em_meta.h | 1 + > net/core/skbuff.c | 2 + > net/sched/act_ct.c | 18 ++++ > net/sched/cls_flower.c | 148 ++++++++++++++++++++++++++++-- > net/sched/em_meta.c | 8 ++ > 9 files changed, 194 insertions(+), 7 deletions(-) > > -- > 1.8.3.1 >