From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7725FA046B for ; Thu, 25 Jul 2019 11:04:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5E8CD1C2C5; Thu, 25 Jul 2019 11:04:04 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id B3EF31C2C0 for ; Thu, 25 Jul 2019 11:04:02 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x6P90Vab022814; Thu, 25 Jul 2019 02:04:01 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=pfpt0818; bh=oRlF+KglB7Uu2HtvSWNDcGASGyuW3gQBFqp9IuJGxLE=; b=ScorT7xorM33BeQ1AAJ9WzTcr5BQ19DTq+VirBFOKA0uYMz382Q3y3sSlFjO9HmcomlJ empHnjs5yvkEjVEpFJkNs1mnxtGSnwUfHzHp2vjjZGPMFyBH2ywxL5sw1Iji/7H3hBK1 dLnWzri03Q5MKmjN5ZglqpTUlVFlIQn1bH3L/pw48zBdm+UB914JP0Mgq7juaujvDKzA gGvljp3aHdkyGIAvxTvS7WwGsIFOp2itJD0UPkS0v2wSGyWGrTPuxBs1JOMXRKXLTlSY gTeEd5M4H3EQMOnIg/U/pMjejmhSAj8CI95Hkb+IifwVVkVZRbQSOKqFp7zJJZbkYJBw NA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2tx61rgr9y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 25 Jul 2019 02:04:01 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 25 Jul 2019 02:04:00 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 25 Jul 2019 02:04:00 -0700 Received: from localhost.localdomain (unknown [10.28.34.15]) by maili.marvell.com (Postfix) with ESMTP id E89153F7040; Thu, 25 Jul 2019 02:03:57 -0700 (PDT) From: To: Adrien Mazarguil , John McNamara , Marko Kovacevic , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko CC: , Kiran Kumar K Date: Thu, 25 Jul 2019 14:33:44 +0530 Message-ID: <20190725090345.31814-2-kirankumark@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190725090345.31814-1-kirankumark@marvell.com> References: <20190725090345.31814-1-kirankumark@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-07-25_04:2019-07-25,2019-07-25 signatures=0 Subject: [dpdk-dev] [PATCH v3 2/3] ethdev: add IGMP key field to flow API 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kiran Kumar K Add new rte_flow_item_igmp in order to match the Internet Group Management Protocol based on RFC 2236. Signed-off-by: Kiran Kumar K --- V3 changes: * Fixed checkpatch issue V2 changes: * updated supported items in doc doc/guides/prog_guide/rte_flow.rst | 12 ++++++++++++ lib/librte_ethdev/rte_flow.c | 1 + lib/librte_ethdev/rte_flow.h | 31 ++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 4109f199a..f786fa3c2 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -1237,6 +1237,18 @@ Matches a network service header (RFC 8300). - Default ``mask`` matches mdtype, next_proto, spi, sindex. +Item: ``IGMP`` +^^^^^^^^^^^^^^^^^^^ + +Matches a Internet Group Management Protocol (RFC 2236). + +- ``type``: IGMP message type (Query/Report). +- ``max_resp_time``: max time allowed before sending report. +- ``checksum``: checksum, 1s complement of whole IGMP message. +- ``group_addr``: group address, for Query value will be 0. +- Default ``mask`` matches group_addr. + + Actions ~~~~~~~ diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c index 39646167c..4dee4f9c2 100644 --- a/lib/librte_ethdev/rte_flow.c +++ b/lib/librte_ethdev/rte_flow.c @@ -76,6 +76,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = { MK_FLOW_ITEM(META, sizeof(struct rte_flow_item_meta)), MK_FLOW_ITEM(GRE_KEY, sizeof(rte_be32_t)), MK_FLOW_ITEM(NSH, sizeof(struct rte_flow_item_nsh)), + MK_FLOW_ITEM(IGMP, sizeof(struct rte_flow_item_igmp)), }; /** Generate flow_action[] entry. */ diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index f0e99fa3e..ce8072613 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -441,6 +441,14 @@ enum rte_flow_item_type { * */ RTE_FLOW_ITEM_TYPE_NSH, + + /** + * Matches Internet Group Management Protocol (IGMP). + * See struct rte_flow_item_igmp. + * + */ + RTE_FLOW_ITEM_TYPE_IGMP, + }; /** @@ -1253,6 +1261,29 @@ static const struct rte_flow_item_nsh rte_flow_item_nsh_mask = { }; #endif +/** + * @warning + * @b EXPERIMENTAL: this structure may change without prior notice + * + * RTE_FLOW_ITEM_TYPE_IGMP + * + * Match Internet Group Management Protocol (IGMP), RFC 2236 + * + */ +struct rte_flow_item_igmp { + uint32_t type:8; + uint32_t max_resp_time:8; + uint32_t checksum:16; + uint32_t group_addr; +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_IGMP. */ +#ifndef __cplusplus +static const struct rte_flow_item_igmp rte_flow_item_igmp_mask = { + .group_addr = 0xffffffff, +}; +#endif + /** * Matching pattern item definition. * -- 2.17.1