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 B8FEAA0487 for ; Thu, 4 Jul 2019 15:01:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6D2DB1BE35; Thu, 4 Jul 2019 15:01:37 +0200 (CEST) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30065.outbound.protection.outlook.com [40.107.3.65]) by dpdk.org (Postfix) with ESMTP id 651431BE32 for ; Thu, 4 Jul 2019 15:01:35 +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=ljNoe9e+/pMBjSR1fwV8/wIsRc3vQ+5naU2Aoy3GmIE=; b=QrqLgq0dPs06jeuR3hPDbLK4n/IhbDTVNjMMicdpndHAzva3GuDBymsULNU9XkWjLKA8H75VVM6hl1wjUqU2HQu3wmjUZleqJUWFBPvkiEd+s9nKsHHyKqtXLP7Mcj/DuGuyxnvHDinZR3r1Y6657hcryUtkOa/4bld8DAXq0ak= Received: from AM6PR05MB6567.eurprd05.prod.outlook.com (20.179.6.215) by AM6PR05MB5473.eurprd05.prod.outlook.com (20.177.118.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.17; Thu, 4 Jul 2019 13:01:34 +0000 Received: from AM6PR05MB6567.eurprd05.prod.outlook.com ([fe80::496b:bd1c:863a:ed47]) by AM6PR05MB6567.eurprd05.prod.outlook.com ([fe80::496b:bd1c:863a:ed47%3]) with mapi id 15.20.2052.010; Thu, 4 Jul 2019 13:01:34 +0000 From: Jack Min To: Adrien Mazarguil CC: Ori Kam , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , John McNamara , Marko Kovacevic , "dev@dpdk.org" Thread-Topic: [PATCH v4 4/4] app/testpmd: match GRE's key and present bits Thread-Index: AQHVMbOGAwBXQhdzs0+/81VXrsYI96a6fAuA//+8zwCAACLBgIAABNOAgAANVQA= Date: Thu, 4 Jul 2019 13:01:33 +0000 Message-ID: <20190704130124.qjz4vpu4conjjsop@mellanox.com> References: <20190624154018.128379-1-jackmin@mellanox.com> <5d9e2fcd3a1bf439b0cff354ca5b5bf1f43e090d.1562058723.git.jackmin@mellanox.com> <20190703152516.GI4512@6wind.com> <20190704055231.bpwbvbd6g2zosbl6@mellanox.com> <20190704095202.GL4512@6wind.com> <20190704115625.umjpfsztht3ypcnn@mellanox.com> <20190704121341.GM4512@6wind.com> In-Reply-To: <20190704121341.GM4512@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HK0PR03CA0057.apcprd03.prod.outlook.com (2603:1096:203:52::21) 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.226.40.4] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 36767d1d-c54f-4522-aded-08d7007fbd70 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:AM6PR05MB5473; x-ms-traffictypediagnostic: AM6PR05MB5473: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:962; x-forefront-prvs: 0088C92887 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(39860400002)(136003)(346002)(366004)(396003)(189003)(199004)(446003)(6512007)(11346002)(52116002)(1076003)(54906003)(6436002)(229853002)(486006)(476003)(2616005)(256004)(99286004)(14444005)(386003)(478600001)(6506007)(86362001)(305945005)(8676002)(76176011)(6486002)(8936002)(53936002)(81166006)(81156014)(3846002)(6116002)(7736002)(14454004)(6246003)(66066001)(25786009)(6916009)(2906002)(102836004)(4326008)(5660300002)(71200400001)(71190400001)(36756003)(66946007)(66476007)(66556008)(64756008)(66446008)(73956011)(26005)(186003)(68736007)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB5473; H:AM6PR05MB6567.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: 69KPzcbru7Jn4IsoPHBfZDx9GOr96VVpn39mnr8gO7F2D8RUt9ctdVYK8frXri/drw6feImZCtR6WzDMp9V+p6xKdaLNXiQFcftb74bj9y9yfrGs4K2I8YjyODKtvulKwosvRqp1UfMnYbeBHujxafq4b+37NkqrTzf6Slstl7ChKUnztp5Bzb0ZD86qCVhKVGkZz2lmcKnZnpPTNfBVkhxM6GETEyABFq1rltS+HFmAUnn23qKuSlkF5XaVU0TiKzxlQ4xr0YlNIhqcyFEXrZLL+j/KzuyF75SNsy0dil13wPvaWFKwdeoDZwcOvLrzeAEa7EIZUlu91EDszb8hMMmLh2lZoXzJx1xaZl+G9rLZ1W9DU66pxN1tHeMj4V7morSMC0qWJobaJd7+ItAtOFO1L+rbRY0sVCvdK8hEXzE= Content-Type: text/plain; charset="us-ascii" Content-ID: <6AA90D40550DBF40BB2EFE62B7D99FBC@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 36767d1d-c54f-4522-aded-08d7007fbd70 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2019 13:01:33.9237 (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-CrossTenant-userprincipalname: jackmin@mellanox.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB5473 Subject: Re: [dpdk-dev] [PATCH v4 4/4] app/testpmd: match GRE's key and present bits 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" On Thu, 19-07-04, 14:13, Adrien Mazarguil wrote: > On Thu, Jul 04, 2019 at 11:56:35AM +0000, Jack Min wrote: > > On Thu, 19-07-04, 11:52, Adrien Mazarguil wrote: > > > On Thu, Jul 04, 2019 at 05:52:43AM +0000, Jack Min wrote: > > > > On Wed, 19-07-03, 17:25, Adrien Mazarguil wrote: > > > > > On Tue, Jul 02, 2019 at 05:45:55PM +0800, Xiaoyu Min wrote: > > > > > > support matching on GRE key and present bits (C,K,S) > > > > > >=20 > > > > > > example testpmd command could be: > > > > > > testpmd>flow create 0 ingress group 1 pattern eth / ipv4 / > > > > > > gre crksv is 0x2000 crksv mask 0xb000 / > > > > > > gre_key key is 0x12345678 / end > > > > > > actions rss queues 1 0 end / mark id 196 / end > > > > > >=20 > > > > > > Which will match GRE packet with k present bit set and key valu= e is > > > > > > 0x12345678. > > > > > >=20 > > > > > > Signed-off-by: Xiaoyu Min > [...] > > > > Well, actullay, when a user explicitly set spec/mask K as "0" and s= till > > > > provide gre_key item, MLX5 PMD will implicitly set match on K bit a= s > > > > "1", just ingore the K bit set by user. > > >=20 > > > Not good then. You should spit an error out if it's an impossible > > > combination. You can't match both K =3D=3D 0 *and* a GRE key, unless = perhaps if > > > key mask is also 0, e.g.: > > >=20 > > > gre crksv is 0x0000 crksv mask 0xb000 / > > > gre_key value spec 0x00000000 value mask 0x00000000 > > >=20 > >=20 > > Never thought man will wirte thing like this, they don't wanna match > > gre_key why put the item there ? > > But, since you have raised this example, I'll update PMD part to handle= this. >=20 > It's just an example of valid yet convoluted command mind you, I'm not > forcing you to support it, however if you don't, you must raise an error, > you can't just ignore the K bit if user provides GRE_KEY. >=20 OK, make sense. > [...] > > > Depends. They may want to match all GRE traffic with a key, doesn't m= atter > > > which, in order to process it through a different path. To do so they= could > > > either: > > >=20 > > > 1. Use the GRE item only to match K bit =3D=3D 1. > > >=20 > > > 2. Use the GRE_KEY item to match a nonspecific key value (mask =3D=3D= 0). > > >=20 > > > 3. Use a combination of both. > > >=20 > > > I think you can easily support all three of them with mlx5 if you sup= port > > > partial masks on GRE keys (I haven't checked), even if you're unable = to > > > specifically match the K bit itself. > > >=20 > >=20 > > Already support this. >=20 > OK, nice. >=20 > [...] > > > > Well, actully, we also wanna testpmd can match on C,S bits with K b= it > > > > together so we can test on gre packet with key only or csum + key, = or > > > > csum + key + sequence. > > >=20 > > > OK no problem. Perhaps you could make this easier by allowing users t= o match > > > individual bits, let me explain: > > >=20 > > > The flow command in testpmd is a direct interface to manipulate rte_f= low's > > > structures. The "crksv" field doesn't exist in rte_flow_item_gre, its= name > > > is "c_rsvd0_ver". Testpmd must use the same in its command and intern= al > > > code. > > >=20 > > > However since bit-masks are usually a pain to mentally work out, you = can > > > provide extras for convenience. The "types" field of the RSS action > > > (ACTION_RSS_TYPES) is an extreme example of this approach. > > >=20 > > > So I suggest adding ITEM_GRE_C_RSVD0_VER taking a 16-bit value like C= RKSV, > > > and complete it with ITEM_GRE_C_BIT, ITEM_GRE_S_BIT and ITEM_GRE_K_BI= T > > > addressing the individual bits you would like to expose for convenien= ce. > > >=20 > >=20 > > So something like: > > eth / ipv4 / gre c_rsvd0_ver c_bit is 0 s_bit is 0 k_bit is 1 / ... > >=20 > > Is it right? >=20 > Looks like "c_rsvd0_ver" is incomplete, I assume you meant: >=20 > eth / ipv4 / gre c_rsvd0_ver is 0 c_bit is 0 s_bit is 0 k_bit is 1 / ... >=20 > And yes it's valid. Of course since nothing is matched by default, users > will typically not provide c_rsvd0_ver at all and focus on the relevant b= its > for their use case:=20 >=20 > eth / ipv4 / gre k_bit is 1 / ... >=20 > Another suggestion, use BOOLEAN instead of INTEGER type for C/K/S to supp= ort > other binary expressions: >=20 > eth / ipv4 / gre k_bit is on / ... > OK~=20 > --=20 > Adrien Mazarguil > 6WIND