From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com [209.85.128.175]) by dpdk.org (Postfix) with ESMTP id 2F0667CB8 for ; Wed, 6 Sep 2017 18:03:06 +0200 (CEST) Received: by mail-wr0-f175.google.com with SMTP id y15so14743358wrc.2 for ; Wed, 06 Sep 2017 09:03:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=rEtBLNTdtfFJ7L1PtRKJlehxR6h5fb5hMiVkjGiVG+o=; b=puTIwh94NI5/uGrNZlQBgGsUlmwsFMnNd3EjY0BtvkpMce4ku1XMh3YUaaPxs7dXN9 ju+MzCkmeViMqIuAjItclqSMgOGl/UuVB4qdxB4HFsRls0inNjwwAoIGQHBN3ThXGGNb fOhFXGLgMJnK8Bww8Jq4wetpkyZTEOIpWG6O3hXR5by5kGmLr9ovw8AosUUSbBCgAU4I uQQ89rTvgWGPld5WJI8v1MzpQDKd/rt3lQs3ISr8qiaj3zgAZ/HxuPyENGRUqsYms5v+ Rd79u6aQ2/1HSLFVQ+6I5BYMtdfUQflHlDpZp03/3LA98NUr0MDJrJeC3XZlG9T2boe+ HMFA== 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; bh=rEtBLNTdtfFJ7L1PtRKJlehxR6h5fb5hMiVkjGiVG+o=; b=WcpMk48h15ABGMA50ZpT2V2eno4hxT4MiP2V/XJdH861OsK0i6pCoKKTsUgLpV5nhr 1XrAVET9MVoM7EW4gm2cxZYMOq8cnRR+Zup1JZcDnZkETv70aXhWnR3yQoJWzPUfnrVV k8Gqs0Am1CI7ChBk+t9K3DTGht+8taIw90C28gZ4ar8z8kX/Kgn4HQtfBCK5nIjCExYC itXkmwVyyZpx4VQdiOoQC0b+aA+h7VQpYMVhChIkYUr6bwJJah/YeNMsq9PsdQ3EAL6m NssoVIFpkQgluyyF+mN7I1Bgb9zf6Xu58fV+lhyumg33mI7YzgRR1AXO+XjKeWZcYo2r epBg== X-Gm-Message-State: AHPjjUgA7ZEsNapZlt4kU4jC6rKwIkyp3tsMxUtEWdkb2NKKg8OuvQxu xFqm+0+9brkZaa81 X-Google-Smtp-Source: ADKCNb57KjSkR4kXQQyQNn9C03Xf88cwaKfiFnIBQ4HbcDCcCRhKuBvYfbEA2k5BAexj6EHNTewU+A== X-Received: by 10.223.174.150 with SMTP id y22mr2070739wrc.29.1504713785759; Wed, 06 Sep 2017 09:03:05 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 195sm1901789wmj.18.2017.09.06.09.03.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Sep 2017 09:03:04 -0700 (PDT) Date: Wed, 6 Sep 2017 18:02:55 +0200 From: Adrien Mazarguil To: Beilei Xing Cc: jingjing.wu@intel.com, dev@dpdk.org Message-ID: <20170906160255.GB4301@6wind.com> References: <1503647430-93905-1-git-send-email-beilei.xing@intel.com> <1503647430-93905-3-git-send-email-beilei.xing@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1503647430-93905-3-git-send-email-beilei.xing@intel.com> Subject: Re: [dpdk-dev] [PATCH 2/7] ethdev: add GTP item X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Sep 2017 16:03:06 -0000 Hi Beilei, On Fri, Aug 25, 2017 at 03:50:25PM +0800, Beilei Xing wrote: > This patch adds GTP items to generic rte flow. > > Signed-off-by: Beilei Xing Thanks, several comments below. > --- > doc/guides/prog_guide/rte_flow.rst | 12 ++++++++++++ > lib/librte_ether/rte_flow.h | 31 +++++++++++++++++++++++++++++++ > 2 files changed, 43 insertions(+) > > diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst > index 662a912..2843b71 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -955,6 +955,18 @@ Usage example, fuzzy match a TCPv4 packets: > | 4 | END | > +-------+----------+ > > +Item: ``GTP`` > +^^^^^^^^^^^^^^ > + > +Matches a GTP header. > + > +- ``v_pt_rsv_flags``: version (3b), protocol type (1b), reserved (1b), > + extension header flag (1b), sequence number flag (1b), N-PDU number flag(1b). Missing space after "flag", this line is also too long, you should add a line break after the last comma. > +- ``msg_type``: message type. > +- ``msg_len``: message length. > +- ``teid``: TEID. > +- Default ``mask`` matches teid only. > + > Actions > ~~~~~~~ > > diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h > index bba6169..73305aa 100644 > --- a/lib/librte_ether/rte_flow.h > +++ b/lib/librte_ether/rte_flow.h > @@ -309,6 +309,13 @@ enum rte_flow_item_type { > * See struct rte_flow_item_fuzzy. > */ > RTE_FLOW_ITEM_TYPE_FUZZY, > + > + /** > + * Matches a GTP header Missing "." (pedantic mode enabled). > + * > + * See struct rte_flow_item. Wrong structure, should be rte_flow_item_gtp. > + */ > + RTE_FLOW_ITEM_TYPE_GTP, > }; > > /** > @@ -735,6 +742,30 @@ static const struct rte_flow_item_fuzzy rte_flow_item_fuzzy_mask = { > #endif > > /** > + * RTE_FLOW_ITEM_TYPE_GTP. > + * > + * Matches a GTP header. > + */ > +struct rte_flow_item_gtp { > + /** > + * Version(2b), Protocol type(1b), Reserved(1b), > + * Extension header flag(1b), > + * Sequqnce number flag(1b), > + * N-PDU number flag(1b). > + */ No need to capitalize everything, only the first one. Several missing spaces betwen name and bit widths ("foo(42b)" => "foo (42b)"). There's also a typo on "Sequqnce". > + uint8_t v_pt_rsv_flags; > + uint8_t msg_type; /**< Message type */ > + rte_be16_t msg_len; /**< Message length */ These comments lack ending ".". > + rte_be32_t teid; This field lack a comment, even if obvious, please add it for consistency. You can use this opportunity to expand the acronym as well. > +}; > + > +/** Default mask for RTE_FLOW_ITEM_TYPE_GTP. */ > +#ifndef __cplusplus > + static const struct rte_flow_item_gtp rte_flow_item_gtp_mask = { > + .teid = RTE_BE32(0xffffffff), > + }; > +#endif Indentation is wrong. > +/** > * Matching pattern item definition. > * > * A pattern is formed by stacking items starting from the lowest protocol > -- > 2.5.5 > It's not a problem if you want to keep them separate, however note that you could make the testpmd update part of this commit. The API change can be considered useless without an implementation counterpart. -- Adrien Mazarguil 6WIND