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=-9.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_NEOMUTT 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 18E26C282C8 for ; Mon, 28 Jan 2019 09:44:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC4E921736 for ; Mon, 28 Jan 2019 09:44:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="MwPFuwxD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726683AbfA1Jo1 (ORCPT ); Mon, 28 Jan 2019 04:44:27 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:33295 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726369AbfA1Jo1 (ORCPT ); Mon, 28 Jan 2019 04:44:27 -0500 Received: by mail-ed1-f65.google.com with SMTP id p6so12501532eds.0 for ; Mon, 28 Jan 2019 01:44:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ijF3xiwdaG6uXKn7CXhipa/RzUfymFmOgYLOv6hkkaQ=; b=MwPFuwxDDpJHYaqx4qkhe+nA9OZBaYwh9RzsCFmu0wA/GdjtLz4RToMilcY3Ho8HWW 6r7n80oan/iCA5yiFuZuR9MZ5/YQdbGy1GGkltLNELKdDz2YCqTImf6BdycrDlgdgBfQ tTbAa5MljrZED06j42zclKyd158E0V3xZZOqjtEDXqvq2jkbjyG02BlQI0lGDJNr8mBr 4gWzcOakX3qCt+zVsN/x7GbyCNbX+HSCZ8C5FUSX0kXKAuyKy9oo6i5A2eidws6J7F4Y WLJBX4RbnrJamx1/+RI5zPU5PEsux3Ib3P2fC3pSr4lQXxPgJm9xNkH0iztFKBV0BINt s5vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ijF3xiwdaG6uXKn7CXhipa/RzUfymFmOgYLOv6hkkaQ=; b=F2kKrrfobnh3ckmwC32Op+BZNPuhzvBbqtANJaQgaBkEbvi/X9qrdMguEkw2VkF+B1 zRJF23X8nHSmFCBjVo7kt7luCf4Iqn/o3WnUez5EHl0/laoO6d6A0jwuShRKHf9E/05m IdoT7h1zc7iPLcThR9O5uU/DYqFP1Bk5KR9gzgWWFrWvAgcbY0rVcx4kX/xHK+sfSdkT uiXg/hxvkkdpvqzIeMoRv6yqhv1y7zfEdBBpNFGaZLQQFh6tE4F1q5m/SoB5995Ivcm9 jqSvFLq7LINEwt3xexv/mgl0ucmBICut37PfxuW2jxUfGq+NUHZPp/Fd9khXt2eurg/R DpgA== X-Gm-Message-State: AJcUukedWVNgUFedqrKNU/UwA8RXPBwy/PgUsJamSihh5Dp0eK3RTh/c AXuvF0uDwuO7zkHqcaI/tgYQXA== X-Google-Smtp-Source: ALg8bN5Ck03OsB37s0aVvdmAxe3L4tWYR24hFoGx8aQKlcSDG32annotAO5Va+SkO9xcbRnvOSn/ig== X-Received: by 2002:a17:906:8596:: with SMTP id v22mr6863218ejx.41.1548668664854; Mon, 28 Jan 2019 01:44:24 -0800 (PST) Received: from netronome.com ([2001:982:756:703:d63d:7eff:fe99:ac9d]) by smtp.gmail.com with ESMTPSA id v11sm13398960edy.49.2019.01.28.01.44.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 01:44:23 -0800 (PST) Date: Mon, 28 Jan 2019 10:44:23 +0100 From: Simon Horman To: Marcelo Ricardo Leitner Cc: Guy Shattah , Aaron Conole , John Hurley , 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 2/6] net/sched: flower: add support for matching on ConnTrack Message-ID: <20190128094421.t7bc3ovnzpfavgsz@netronome.com> References: <6c976cc538f1f565b74bd2c750639af91a93adc1.1548285996.git.mleitner@redhat.com> <20190125133711.f3caew4d7osr5czg@netronome.com> <20190126155201.GI10660@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190126155201.GI10660@localhost.localdomain> User-Agent: NeoMutt/20170113 (1.7.2) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sat, Jan 26, 2019 at 01:52:01PM -0200, Marcelo Ricardo Leitner wrote: > On Fri, Jan 25, 2019 at 02:37:13PM +0100, Simon Horman wrote: > > Hi Marcelo, > > > > On Fri, Jan 25, 2019 at 12:32:31AM -0200, Marcelo Ricardo Leitner wrote: > > > Hook on flow dissector's new interface on ConnTrack from previous patch. > > > > > > Signed-off-by: Marcelo Ricardo Leitner > > > --- > > > include/uapi/linux/pkt_cls.h | 9 +++++++++ > > > net/sched/cls_flower.c | 33 +++++++++++++++++++++++++++++++++ > > > 2 files changed, 42 insertions(+) > > > > > > diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h > > > index 95d0db2a8350dffb1dd20816591f3b179913fb2e..ba1f3bc01b2fdfd810e37a2b3853a1da1f838acf 100644 > > > --- a/include/uapi/linux/pkt_cls.h > > > +++ b/include/uapi/linux/pkt_cls.h > > > @@ -490,6 +490,15 @@ enum { > > > TCA_FLOWER_KEY_PORT_DST_MIN, /* be16 */ > > > TCA_FLOWER_KEY_PORT_DST_MAX, /* be16 */ > > > > > > + TCA_FLOWER_KEY_CT_ZONE, /* u16 */ > > > + TCA_FLOWER_KEY_CT_ZONE_MASK, /* u16 */ > > > + TCA_FLOWER_KEY_CT_STATE, /* u8 */ > > > + TCA_FLOWER_KEY_CT_STATE_MASK, /* u8 */ > > > > With the corresponding flow dissector patch this API is > > exposing the contents of an instance of enum ip_conntrack_info > > as an ABI for conntrack state. > > > > I believe (after getting similar review for my geneve options macthing > > patches for flower) that this exposes implementation details as an ABI > > to a degree that is not desirable. > > > > My suggested would be to define, say in the form of named bits, > > an ABI, that describes the state information that is exposed. > > These bits may not correspond directly to the implementation of > > ip_conntrack_info. > > > > I think there should also be some consideration of if a mask makes > > sense for the state as, f.e. in the implementation of enum > > ip_conntrack_info not all bit combinations are valid. > > Right. ct_state must be handled differently. For conntrack it is a > linear enum and as we want to be able to OR match, we will have to > convert the states in a bitfield as you were saying or so. > > I don't think the representation above wouldn't change, though: we have > 8 bits wrapped under a u8. What would change is how we deal with it. > > If iproute tc is able to parse the cmdline and set a corresponding bit > for each state, the flower-side of flow dissector here should be > mostly fine (need to consider the invalid bits as you mentioned, as > part of sanity checking). > Then just need to change on how flow dissector is reading ct_state > from the packet. I'm not entirely opposed to a KABI which defines bits of TCA_FLOWER_KEY_CT_STATE in such a way that they match exactly the current implementation of enum ip_conntrack_info (though I do suspect that a better representation is possible, for some value of better). But, on the other hand, I am not comfortable in simply sating that TCA_FLOWER_KEY_CT_STATE is the same as enum ip_conntrack_info, because that exposes an internal implementation detail which may change. > Is your comment only related to ct_state or other fields too? I'm > thinking only ct_state. Sorry that I wasn't clear, I was only referring to ct_state. > > > + TCA_FLOWER_KEY_CT_MARK, /* u32 */ > > > + TCA_FLOWER_KEY_CT_MARK_MASK, /* u32 */ > > > + TCA_FLOWER_KEY_CT_LABEL, /* 128 bits */ > > > + TCA_FLOWER_KEY_CT_LABEL_MASK, /* 128 bits */ > > > + > > > __TCA_FLOWER_MAX, > > > }; > > > > ... > >