From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2CDAC43A78; Mon, 5 Feb 2024 14:00:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CDC1B402BE; Mon, 5 Feb 2024 14:00:43 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id C69AC402A2 for ; Mon, 5 Feb 2024 14:00:41 +0100 (CET) Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 5E1985C013A; Mon, 5 Feb 2024 08:00:41 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Mon, 05 Feb 2024 08:00:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1707138041; x=1707224441; bh=v7THYxcNSXBD1XzuZEzf9QtDjp30McRt2tuK7fsI8A4=; b= jNqXd8d29UClTV1sFlAPCgcvPd/GHzpP5erHMOWE5deoqXa+kB/XAduvmJ/UAH0B Jggl44RycTfXkFkuRFPL8e5ExUOwCjl9bzig7ebXciMoxyePG2IZ46cUePjTn6EH b0KB1RYLVHkPHtXIH3penwdOk39UojKglSo3iCticMUEXQ7fsxqmZcK3TXONnwfy v7BYAnVN0dfFHCqXDEDvl6dT7Pv3BbGT37+VE7lYo7M0U5qyaYkc8zd1FKSj3D8p LdZJKuLsFB4UbnTyLeYfCPgA4QvLWzjYjbzxCkkAKcQLwCY22f67oHznIXs6QD7Y 3an/0nJrexe+odJfkyThZw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1707138041; x= 1707224441; bh=v7THYxcNSXBD1XzuZEzf9QtDjp30McRt2tuK7fsI8A4=; b=h YWOPk6TPC+/1PRn4+eZBCaA0snYwGIwtvQdlTu6tdA5FL46x5O/Mxn5wMMqH4FWZ I6BtxIzAnIasGkZPI+dC3LPib6FJVEp9bwRtimuJQ8aDNciuXiCPR5OgAYpTHoMu BgikDu1HM0Ezp0mhruzs2jhmRTFkCrnCDpWPQjoFObwg3Fhhx6W95RBWEOeikgkH pSpjnAyZLssO7QCSLW0iZ7P00sFPiUAVhtgwsOINtSRAH/cKSTRRyxNXmrycDJ3O +uH/Eg+wkbQXNp9mSh8OnkullPBx4gQyWiq6ZvCwvLEAxuDUtHdWOhbofuqnO5S9 /xCGwRXeoy01XgR23XsZw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedvtddggeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedtjeeiieefhedtfffgvdelteeufeefheeujefgueetfedttdei kefgkeduhedtgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 5 Feb 2024 08:00:38 -0500 (EST) From: Thomas Monjalon To: Suanming Mou Cc: ferruh.yigit@amd.com, Ori Kam , Aman Singh , Yuying Zhang , Andrew Rybchenko , dev@dpdk.org Subject: Re: [PATCH v6 2/3] ethdev: add compare item Date: Mon, 05 Feb 2024 14:00:36 +0100 Message-ID: <3205480.5fSG56mABF@thomas> In-Reply-To: <20240202004234.503097-3-suanmingm@nvidia.com> References: <20231214031227.363911-1-suanmingm@nvidia.com> <20240202004234.503097-1-suanmingm@nvidia.com> <20240202004234.503097-3-suanmingm@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 02/02/2024 01:42, Suanming Mou: > --- a/doc/guides/rel_notes/release_24_03.rst > +++ b/doc/guides/rel_notes/release_24_03.rst > +* **Added compare flow matching criteria.** Suggestion: "Added flow matching with various comparisons." Not sure how to illustrate the idea. > + Added ``RTE_FLOW_ITEM_TYPE_COMPARE`` to allow matching on compare s/compare/comparison/ > + result between the packet fields or value. remove "the" > --- a/lib/ethdev/rte_flow.h > +++ b/lib/ethdev/rte_flow.h > + /** > + * Matches the packet with compare result. Match packet with various comparison types. > + * > + * See struct rte_flow_item_compare. > + */ > + RTE_FLOW_ITEM_TYPE_COMPARE, > }; > > /** > @@ -2365,6 +2372,182 @@ static const struct rte_flow_item_ptype rte_flow_item_ptype_mask = { > }; > #endif > > +/** > + * Field IDs for packet field. > + * e.g. the packet field IDs used in RTE_FLOW_ACTION_TYPE_MODIFY_FIELD > + * and RTE_FLOW_ITEM_TYPE_COMPARE. > + */ > +enum rte_flow_field_id { > + RTE_FLOW_FIELD_START = 0, /**< Start of a packet. */ > + RTE_FLOW_FIELD_MAC_DST, /**< Destination MAC Address. */ > + RTE_FLOW_FIELD_MAC_SRC, /**< Source MAC Address. */ > + RTE_FLOW_FIELD_VLAN_TYPE, /**< VLAN Tag Identifier. */ > + RTE_FLOW_FIELD_VLAN_ID, /**< VLAN Identifier. */ > + RTE_FLOW_FIELD_MAC_TYPE, /**< EtherType. */ > + RTE_FLOW_FIELD_IPV4_DSCP, /**< IPv4 DSCP. */ > + RTE_FLOW_FIELD_IPV4_TTL, /**< IPv4 Time To Live. */ > + RTE_FLOW_FIELD_IPV4_SRC, /**< IPv4 Source Address. */ > + RTE_FLOW_FIELD_IPV4_DST, /**< IPv4 Destination Address. */ > + RTE_FLOW_FIELD_IPV6_DSCP, /**< IPv6 DSCP. */ > + RTE_FLOW_FIELD_IPV6_HOPLIMIT, /**< IPv6 Hop Limit. */ > + RTE_FLOW_FIELD_IPV6_SRC, /**< IPv6 Source Address. */ > + RTE_FLOW_FIELD_IPV6_DST, /**< IPv6 Destination Address. */ > + RTE_FLOW_FIELD_TCP_PORT_SRC, /**< TCP Source Port Number. */ > + RTE_FLOW_FIELD_TCP_PORT_DST, /**< TCP Destination Port Number. */ > + RTE_FLOW_FIELD_TCP_SEQ_NUM, /**< TCP Sequence Number. */ > + RTE_FLOW_FIELD_TCP_ACK_NUM, /**< TCP Acknowledgment Number. */ > + RTE_FLOW_FIELD_TCP_FLAGS, /**< TCP Flags. */ > + RTE_FLOW_FIELD_UDP_PORT_SRC, /**< UDP Source Port Number. */ > + RTE_FLOW_FIELD_UDP_PORT_DST, /**< UDP Destination Port Number. */ > + RTE_FLOW_FIELD_VXLAN_VNI, /**< VXLAN Network Identifier. */ > + RTE_FLOW_FIELD_GENEVE_VNI, /**< GENEVE Network Identifier. */ > + RTE_FLOW_FIELD_GTP_TEID, /**< GTP Tunnel Endpoint Identifier. */ > + RTE_FLOW_FIELD_TAG, /**< Tag value. */ > + RTE_FLOW_FIELD_MARK, /**< Mark value. */ > + RTE_FLOW_FIELD_META, /**< Metadata value. */ > + RTE_FLOW_FIELD_POINTER, /**< Memory pointer. */ > + RTE_FLOW_FIELD_VALUE, /**< Immediate value. */ > + RTE_FLOW_FIELD_IPV4_ECN, /**< IPv4 ECN. */ > + RTE_FLOW_FIELD_IPV6_ECN, /**< IPv6 ECN. */ > + RTE_FLOW_FIELD_GTP_PSC_QFI, /**< GTP QFI. */ > + RTE_FLOW_FIELD_METER_COLOR, /**< Meter color marker. */ > + RTE_FLOW_FIELD_IPV6_PROTO, /**< IPv6 next header. */ > + RTE_FLOW_FIELD_FLEX_ITEM, /**< Flex item. */ > + RTE_FLOW_FIELD_HASH_RESULT, /**< Hash result. */ > + RTE_FLOW_FIELD_GENEVE_OPT_TYPE, /**< GENEVE option type. */ > + RTE_FLOW_FIELD_GENEVE_OPT_CLASS,/**< GENEVE option class. */ > + RTE_FLOW_FIELD_GENEVE_OPT_DATA, /**< GENEVE option data. */ > + RTE_FLOW_FIELD_MPLS, /**< MPLS header. */ > + RTE_FLOW_FIELD_TCP_DATA_OFFSET, /**< TCP data offset. */ > + RTE_FLOW_FIELD_IPV4_IHL, /**< IPv4 IHL. */ > + RTE_FLOW_FIELD_IPV4_TOTAL_LEN, /**< IPv4 total length. */ > + RTE_FLOW_FIELD_IPV6_PAYLOAD_LEN,/**< IPv6 payload length. */ > + RTE_FLOW_FIELD_RANDOM /**< Random value. */ > +}; You should use spaces for aligmnent of the comments. [...] > +struct rte_flow_field_data { > + enum rte_flow_field_id field; /**< Field or memory type ID. */ > + union { > + struct { > + /** Encapsulation level and tag index or flex item handle. */ > + union { > + struct { > + /** > + * Packet encapsulation level containing > + * the field to modify. > + * > + * - @p 0 requests the default behavior. > + * Depending on the packet type, it > + * can mean outermost, innermost or > + * anything in between. > + * > + * It basically stands for the > + * innermost encapsulation level. > + * Modification can be performed > + * according to PMD and device > + * capabilities. > + * > + * - @p 1 requests modification to be > + * performed on the outermost packet > + * encapsulation level. > + * > + * - @p 2 and subsequent values request > + * modification to be performed on > + * the specified inner packet > + * encapsulation level, from > + * outermost to innermost (lower to > + * higher values). > + * > + * Values other than @p 0 are not > + * necessarily supported. > + * > + * @note that for MPLS field, > + * encapsulation level also include > + * tunnel since MPLS may appear in > + * outer, inner or tunnel. > + */ > + uint8_t level; > + union { > + /** > + * Tag index array inside > + * encapsulation level. > + * Used for VLAN, MPLS or TAG types. > + */ > + uint8_t tag_index; > + /** > + * Geneve option identifier. > + * Relevant only for > + * RTE_FLOW_FIELD_GENEVE_OPT_XXXX > + * modification type. > + */ > + struct { > + /** > + * Geneve option type. > + */ > + uint8_t type; > + /** > + * Geneve option class. > + */ > + rte_be16_t class_id; > + }; > + }; > + }; > + struct rte_flow_item_flex_handle *flex_handle; > + }; > + /** Number of bits to skip from a field. */ > + uint32_t offset; > + }; > + /** > + * Immediate value for RTE_FLOW_FIELD_VALUE, presented in the > + * same byte order and length as in relevant rte_flow_item_xxx. > + * The immediate source bitfield offset is inherited from > + * the destination's one. > + */ > + uint8_t value[16]; > + /** > + * Memory address for RTE_FLOW_FIELD_POINTER, memory layout > + * should be the same as for relevant field in the > + * rte_flow_item_xxx structure. > + */ > + void *pvalue; > + }; > +}; > + > +/** > + * Expected operation types for compare item. > + */ > +enum rte_flow_item_compare_op { > + RTE_FLOW_ITEM_COMPARE_EQ, /* Compare result equal. */ > + RTE_FLOW_ITEM_COMPARE_NE, /* Compare result not equal. */ > + RTE_FLOW_ITEM_COMPARE_LT, /* Compare result less than. */ > + RTE_FLOW_ITEM_COMPARE_LE, /* Compare result less than or equal. */ > + RTE_FLOW_ITEM_COMPARE_GT, /* Compare result great than. */ > + RTE_FLOW_ITEM_COMPARE_GE, /* Compare result great than or equal. */ > +}; It's a pity we cannot easily what changed because it moved. Maybe make the move in a separate patch before changing it?