From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10071.outbound.protection.outlook.com [40.107.1.71]) by dpdk.org (Postfix) with ESMTP id 840C25F0F for ; Wed, 15 May 2019 10:55:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pU7NJB75v5FFs6Vxm3Ne/vwsrfoGpJAlAY31jcX/+bY=; b=UNYZbcmS9kt/RzAfSbRQWLnDO8j5KYsS5lpIGK0LzTJpgoDtFkDWBxKCxdvtfC3qGxOD2dtkH1RPPCumQO1UehoklrraWowh+XXbOvCpm7UVM3Pu+2QwYUKs1YC8HIzuXOdvcVkSODnx5Rw5IzmSSQX4YaTrNTCqmwIrl2TBNJ4= Received: from AM6PR05MB6567.eurprd05.prod.outlook.com (20.179.6.215) by AM6PR05MB5508.eurprd05.prod.outlook.com (20.177.119.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.24; Wed, 15 May 2019 08:55:07 +0000 Received: from AM6PR05MB6567.eurprd05.prod.outlook.com ([fe80::1da7:7c33:b730:38f4]) by AM6PR05MB6567.eurprd05.prod.outlook.com ([fe80::1da7:7c33:b730:38f4%6]) with mapi id 15.20.1900.010; Wed, 15 May 2019 08:55:07 +0000 From: Jack Min To: Adrien Mazarguil CC: Andrew Rybchenko , Thomas Monjalon , Ferruh Yigit , "dev@dpdk.org" Thread-Topic: [RFC] ethdev: add GRE optional fields to flow API Thread-Index: AQHVCiVSUK0hXhoI+UWxSLmfa8K4SaZqOpoAgAAYFgCAAZDFgA== Date: Wed, 15 May 2019 08:55:07 +0000 Message-ID: <20190515085459.bq7za3ltttlot2kw@mellanox.com> References: <20190514071829.5251-1-jackmin@mellanox.com> <0dabe886-8cca-1d8a-b204-824393c8f240@solarflare.com> <20190514090034.GN4284@6wind.com> In-Reply-To: <20190514090034.GN4284@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK2PR04CA0068.apcprd04.prod.outlook.com (2603:1096:202:15::12) To AM6PR05MB6567.eurprd05.prod.outlook.com (2603:10a6:20b:bc::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=jackmin@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [139.227.41.201] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d88163a5-4513-42b1-4cfe-08d6d913072e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM6PR05MB5508; x-ms-traffictypediagnostic: AM6PR05MB5508: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 0038DE95A2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(396003)(39860400002)(346002)(376002)(199004)(189003)(53936002)(508600001)(53546011)(256004)(14454004)(6246003)(186003)(11346002)(14444005)(66476007)(36756003)(476003)(2616005)(486006)(86362001)(73956011)(66946007)(66556008)(66446008)(64756008)(446003)(66066001)(54906003)(68736007)(25786009)(4326008)(99286004)(8936002)(305945005)(7736002)(6506007)(386003)(71200400001)(71190400001)(229853002)(6436002)(6486002)(26005)(316002)(5660300002)(6916009)(6512007)(2906002)(1076003)(81156014)(81166006)(8676002)(102836004)(76176011)(52116002)(3846002)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB5508; H:AM6PR05MB6567.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 8iJ3sIcwwiddD5m8aRm4h48xnqxhqm5Wob2LbW+37Pjc+16PDe3YtI4a+gD6o3Zukau4uU1yd/2IkS87Fdog6Cjud1oV93DH/qjzL7QA2VCPyQqLUmvRRmvIKL3P9eN8H3nYxYiq9Bdp3I2XnUG5DtqXj34oetSVdmqlagLprPbvgjySAHobhm1pvsLMeuOvjCMOCpdDS5tXXfLXpCEFknjxndYPMhrtvW+kKgliEvF7tZmy2NyUwL0ra7EGe9eCP/Y+DXU7/FeH+PVW+BhLJji2pAcVixsRWTjpwjcE8h+TcAdhxK718jQc/y4sE3L7B6K8OodrYKbDbBs2ehD22lCqT+W+bVIoPfp/kq03LAo6iTIDBHv1RNEq1aQUg4mffudb7hXcdx90t1qlSaowwrQqIJyEx2uy1xjN+XpyD20= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: d88163a5-4513-42b1-4cfe-08d6d913072e X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2019 08:55:07.3221 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB5508 Subject: Re: [dpdk-dev] [RFC] ethdev: add GRE optional fields 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: , X-List-Received-Date: Wed, 15 May 2019 08:55:09 -0000 On Tue, 19-05-14, 11:00, Adrien Mazarguil wrote: > On Tue, May 14, 2019 at 10:34:22AM +0300, Andrew Rybchenko wrote: > > On 5/14/19 10:18 AM, Xiaoyu Min wrote: > > > Add GRE's checksum, key, and sequence field to the > > > struct rte_flow_item_gre in order to match. > > >=20 > > > Signed-off-by: Xiaoyu Min > > > --- > > > lib/librte_ethdev/rte_flow.h | 4 ++++ > > > 1 file changed, 4 insertions(+) > > >=20 > > > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flo= w.h > > > index 63f84fca65..fb04af3268 100644 > > > --- a/lib/librte_ethdev/rte_flow.h > > > +++ b/lib/librte_ethdev/rte_flow.h > > > @@ -847,6 +847,10 @@ struct rte_flow_item_gre { > > > */ > > > rte_be16_t c_rsvd0_ver; > > > rte_be16_t protocol; /**< Protocol type. */ > > > + rte_be16_t checksum; /**< chksum for the header and payload, option= al.*/ > > > + rte_be16_t rsvd1; /**< present when C bit is set, optional. */ > > > + rte_be32_t key; /**< application specific key value, optional. */ > > > + rte_be32_t sequence; /**< sequence num for the GRE packet, optional= . */ > > > }; > > > /** Default mask for RTE_FLOW_ITEM_TYPE_GRE. */ > >=20 > > What is the purpose to match checksum, reserved and sequence number? >=20 > I think it's not really an issue, this structure only describes a packet > header as found on the wire like other pattern items; rte_flow users only > have to provide a mask to select the fields to be matched. >=20 > However you can't just modify an existing public structure without going > through the lengthy API/ABI deprecation/versioning process. >=20 > The reason these fields were not initially part of rte_flow_item_gre is t= hat > each of them is optional, meaning the GRE header has variable length. > They should be handled through separate objects like IPv6 options (struct > rte_flow_item_ipv6_ext), ARP (struct rte_flow_item_arp_eth_ipv4) or ICMPv= 6 > neighbor discovery (struct rte_flow_item_icmp6_nd_opt), either all togeth= er > e.g.: >=20 > RTE_FLOW_ITEM_TYPE_GRE_OPTS >=20 > struct rte_flow_item_gre_opts { > rte_be16_t checksum; /**< Checksum for GRE header and payload (C bit= ). */ > rte_be16_t rsvd1; /**< Reserved bits (C bit). */ > rte_be32_t key; /**< Application specific key value (K bit). */ > rte_be32_t sequence; /**< Sequence number for GRE packet (S bit). */ > }; >=20 > Or separately, since I guess only key matters no need to define the other= s: >=20 > RTE_FLOW_ITEM_TYPE_GRE_KEY >=20 > struct rte_flow_item_gre_key { > rte_be32_t key; /**< Application specific key value (K bit). */ > }; I will go to this approach. >=20 > In both cases, the default mask for this object should cover "key". Make > sure to update documentation and testpmd in the same patch. >=20 Sure, I will do. Thank you, adrien, for your detail explaination. I'll send v2 RFC soon. > --=20 > Adrien Mazarguil > 6WIND From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 29609A00E6 for ; Wed, 15 May 2019 10:55:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2CDBC5F20; Wed, 15 May 2019 10:55:10 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10071.outbound.protection.outlook.com [40.107.1.71]) by dpdk.org (Postfix) with ESMTP id 840C25F0F for ; Wed, 15 May 2019 10:55:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pU7NJB75v5FFs6Vxm3Ne/vwsrfoGpJAlAY31jcX/+bY=; b=UNYZbcmS9kt/RzAfSbRQWLnDO8j5KYsS5lpIGK0LzTJpgoDtFkDWBxKCxdvtfC3qGxOD2dtkH1RPPCumQO1UehoklrraWowh+XXbOvCpm7UVM3Pu+2QwYUKs1YC8HIzuXOdvcVkSODnx5Rw5IzmSSQX4YaTrNTCqmwIrl2TBNJ4= Received: from AM6PR05MB6567.eurprd05.prod.outlook.com (20.179.6.215) by AM6PR05MB5508.eurprd05.prod.outlook.com (20.177.119.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.24; Wed, 15 May 2019 08:55:07 +0000 Received: from AM6PR05MB6567.eurprd05.prod.outlook.com ([fe80::1da7:7c33:b730:38f4]) by AM6PR05MB6567.eurprd05.prod.outlook.com ([fe80::1da7:7c33:b730:38f4%6]) with mapi id 15.20.1900.010; Wed, 15 May 2019 08:55:07 +0000 From: Jack Min To: Adrien Mazarguil CC: Andrew Rybchenko , Thomas Monjalon , Ferruh Yigit , "dev@dpdk.org" Thread-Topic: [RFC] ethdev: add GRE optional fields to flow API Thread-Index: AQHVCiVSUK0hXhoI+UWxSLmfa8K4SaZqOpoAgAAYFgCAAZDFgA== Date: Wed, 15 May 2019 08:55:07 +0000 Message-ID: <20190515085459.bq7za3ltttlot2kw@mellanox.com> References: <20190514071829.5251-1-jackmin@mellanox.com> <0dabe886-8cca-1d8a-b204-824393c8f240@solarflare.com> <20190514090034.GN4284@6wind.com> In-Reply-To: <20190514090034.GN4284@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK2PR04CA0068.apcprd04.prod.outlook.com (2603:1096:202:15::12) To AM6PR05MB6567.eurprd05.prod.outlook.com (2603:10a6:20b:bc::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=jackmin@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [139.227.41.201] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d88163a5-4513-42b1-4cfe-08d6d913072e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM6PR05MB5508; x-ms-traffictypediagnostic: AM6PR05MB5508: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 0038DE95A2 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(396003)(39860400002)(346002)(376002)(199004)(189003)(53936002)(508600001)(53546011)(256004)(14454004)(6246003)(186003)(11346002)(14444005)(66476007)(36756003)(476003)(2616005)(486006)(86362001)(73956011)(66946007)(66556008)(66446008)(64756008)(446003)(66066001)(54906003)(68736007)(25786009)(4326008)(99286004)(8936002)(305945005)(7736002)(6506007)(386003)(71200400001)(71190400001)(229853002)(6436002)(6486002)(26005)(316002)(5660300002)(6916009)(6512007)(2906002)(1076003)(81156014)(81166006)(8676002)(102836004)(76176011)(52116002)(3846002)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB5508; H:AM6PR05MB6567.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 8iJ3sIcwwiddD5m8aRm4h48xnqxhqm5Wob2LbW+37Pjc+16PDe3YtI4a+gD6o3Zukau4uU1yd/2IkS87Fdog6Cjud1oV93DH/qjzL7QA2VCPyQqLUmvRRmvIKL3P9eN8H3nYxYiq9Bdp3I2XnUG5DtqXj34oetSVdmqlagLprPbvgjySAHobhm1pvsLMeuOvjCMOCpdDS5tXXfLXpCEFknjxndYPMhrtvW+kKgliEvF7tZmy2NyUwL0ra7EGe9eCP/Y+DXU7/FeH+PVW+BhLJji2pAcVixsRWTjpwjcE8h+TcAdhxK718jQc/y4sE3L7B6K8OodrYKbDbBs2ehD22lCqT+W+bVIoPfp/kq03LAo6iTIDBHv1RNEq1aQUg4mffudb7hXcdx90t1qlSaowwrQqIJyEx2uy1xjN+XpyD20= Content-Type: text/plain; charset="UTF-8" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: d88163a5-4513-42b1-4cfe-08d6d913072e X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2019 08:55:07.3221 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB5508 Subject: Re: [dpdk-dev] [RFC] ethdev: add GRE optional fields 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" Message-ID: <20190515085507.8YDzsDWkesEppmlSgmQkQd8koCFa_gf2ZzmW7pQVrz8@z> On Tue, 19-05-14, 11:00, Adrien Mazarguil wrote: > On Tue, May 14, 2019 at 10:34:22AM +0300, Andrew Rybchenko wrote: > > On 5/14/19 10:18 AM, Xiaoyu Min wrote: > > > Add GRE's checksum, key, and sequence field to the > > > struct rte_flow_item_gre in order to match. > > >=20 > > > Signed-off-by: Xiaoyu Min > > > --- > > > lib/librte_ethdev/rte_flow.h | 4 ++++ > > > 1 file changed, 4 insertions(+) > > >=20 > > > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flo= w.h > > > index 63f84fca65..fb04af3268 100644 > > > --- a/lib/librte_ethdev/rte_flow.h > > > +++ b/lib/librte_ethdev/rte_flow.h > > > @@ -847,6 +847,10 @@ struct rte_flow_item_gre { > > > */ > > > rte_be16_t c_rsvd0_ver; > > > rte_be16_t protocol; /**< Protocol type. */ > > > + rte_be16_t checksum; /**< chksum for the header and payload, option= al.*/ > > > + rte_be16_t rsvd1; /**< present when C bit is set, optional. */ > > > + rte_be32_t key; /**< application specific key value, optional. */ > > > + rte_be32_t sequence; /**< sequence num for the GRE packet, optional= . */ > > > }; > > > /** Default mask for RTE_FLOW_ITEM_TYPE_GRE. */ > >=20 > > What is the purpose to match checksum, reserved and sequence number? >=20 > I think it's not really an issue, this structure only describes a packet > header as found on the wire like other pattern items; rte_flow users only > have to provide a mask to select the fields to be matched. >=20 > However you can't just modify an existing public structure without going > through the lengthy API/ABI deprecation/versioning process. >=20 > The reason these fields were not initially part of rte_flow_item_gre is t= hat > each of them is optional, meaning the GRE header has variable length. > They should be handled through separate objects like IPv6 options (struct > rte_flow_item_ipv6_ext), ARP (struct rte_flow_item_arp_eth_ipv4) or ICMPv= 6 > neighbor discovery (struct rte_flow_item_icmp6_nd_opt), either all togeth= er > e.g.: >=20 > RTE_FLOW_ITEM_TYPE_GRE_OPTS >=20 > struct rte_flow_item_gre_opts { > rte_be16_t checksum; /**< Checksum for GRE header and payload (C bit= ). */ > rte_be16_t rsvd1; /**< Reserved bits (C bit). */ > rte_be32_t key; /**< Application specific key value (K bit). */ > rte_be32_t sequence; /**< Sequence number for GRE packet (S bit). */ > }; >=20 > Or separately, since I guess only key matters no need to define the other= s: >=20 > RTE_FLOW_ITEM_TYPE_GRE_KEY >=20 > struct rte_flow_item_gre_key { > rte_be32_t key; /**< Application specific key value (K bit). */ > }; I will go to this approach. >=20 > In both cases, the default mask for this object should cover "key". Make > sure to update documentation and testpmd in the same patch. >=20 Sure, I will do. Thank you, adrien, for your detail explaination. I'll send v2 RFC soon. > --=20 > Adrien Mazarguil > 6WIND