From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140051.outbound.protection.outlook.com [40.107.14.51]) by dpdk.org (Postfix) with ESMTP id 716932C52 for ; Thu, 7 Mar 2019 09:51:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7jfgdXlNqLV3YNrJPJuy5saFQeG1uZLyGrywf/y3W8Q=; b=vnxBWIPmhQNAe2cRUMlZe1pvzQyz6/5pyasIZxgkd1ObMSJz+oD96c/3fL0bR0vRD6SKov/5d63kaNrqJNw5yo6JeS4Rn7JZ2sF/1Gd2Pf4fsM15Kz+nABtk3YvHMsqIeBij9qoq8ndugR0BIB30YZ7x76Kf0IXbxCrOu7APl3o= Received: from AM6PR05MB5926.eurprd05.prod.outlook.com (20.179.2.27) by AM6PR05MB6056.eurprd05.prod.outlook.com (20.179.2.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.18; Thu, 7 Mar 2019 08:51:40 +0000 Received: from AM6PR05MB5926.eurprd05.prod.outlook.com ([fe80::a0b3:8140:c1f1:dd89]) by AM6PR05MB5926.eurprd05.prod.outlook.com ([fe80::a0b3:8140:c1f1:dd89%3]) with mapi id 15.20.1686.018; Thu, 7 Mar 2019 08:51:40 +0000 From: Raslan Darawsheh To: Andrew Bainbridge , users Thread-Topic: [dpdk-users] How to use .last and .spec fields in the Generic Flow API? Thread-Index: AdTULfMpOywd9MpSS1qLnFZ916l9YwAlAyJQ Date: Thu, 7 Mar 2019 08:51:40 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; x-originating-ip: [82.213.2.186] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 25713804-003b-4380-1513-08d6a2da1dec x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR05MB6056; x-ms-traffictypediagnostic: AM6PR05MB6056: x-microsoft-exchange-diagnostics: =?us-ascii?Q?1; AM6PR05MB6056; 23:LBTD7iN8znHzu6QfWOn/9XVHK/yHutVkCtjUoXCTu?= =?us-ascii?Q?KhYDcPJCyuxis2XM7zpfxVmxZKynsmJT7maI8kym8TVGGMfhvlEA1O/29Fu8?= =?us-ascii?Q?xUFAN6kpcP4ZVqcZF2jg8V5wG/JDKWhn1ABsR0sM6xY+mNdudYpGke7fWWAa?= =?us-ascii?Q?24th/ZqPVbf32DXYFaqwrm3AxqpB0g2nyg5jybhE7vAjpEnw7xUXFjlSQ7G2?= =?us-ascii?Q?uo7aFartB+iJFDSPBaJR6+EgxzOJgVnBDou9boL2Gs+LV/KtyG+Pgo++i/vB?= =?us-ascii?Q?B61ePIXSrcxQfyVmrb6uFFIv/UC+SkYz5weuZF+O3ftfVcMaJJH5XmdB5au3?= =?us-ascii?Q?Ygx1+tISDIJtpKw4Ael14SVV3r3BMw/G3H6rE6AwBlv3g+DyDzwcSvc7Lz7S?= =?us-ascii?Q?xO+hHDXf3H2U3/A9azzEDtfh7nx9Jz/n3kc7/nqTYj0dlTELS7S5PHQuoZmG?= =?us-ascii?Q?0O5kcPuSbqqRZaNQWRHK+7AAB/hKh9PGhjnL72tHIixLn4naniaGSC3sYL9a?= =?us-ascii?Q?2CM2jnR5oS2ZHg4HdHHxANW3wGR5HTZdOCo7xoCzO03m6aDNNK42djwOcOrk?= =?us-ascii?Q?PgyT0znIAH9c9tvDnjIkMvZPhm2Z4gC/2HbYGCcr4Zh4bWDwsp99L9KF9h8N?= =?us-ascii?Q?2X/IXSdN/0ALa1AeM75GuKAZKJXwg6ZidYsAoaYMcSgxmai7+jTofVbtVWnY?= =?us-ascii?Q?6k3C9yrXThnhq0kJ7QwLJxM/PZ/2hzNqcUh3rmK/ygxArImtvuyHQbzfKzpO?= =?us-ascii?Q?9jVYtHB8lpZ7jvb12tz9GIOyplcwhGIXy9+gKN1yrSNSqDkwidPZjvwKqokh?= =?us-ascii?Q?3DX1GN2pkdSp/TUOxzr1Z0vrLLMf/iCCOEJLddESO/Kwp+q4T8/YDf2taK+O?= =?us-ascii?Q?HXr/d0XaUZBbIyF5gGyO5RiZTZCY7XycqKvOvi0itNV65JdKRa60yTS+CWhj?= =?us-ascii?Q?8wgT8Zc1sYembUISWlHLxjCchTXOBsI4W4pnZ7rfKo32sf6zlaR4SRftXuvD?= =?us-ascii?Q?6n/ARQ334ctDaEmUPtDzIAhlWCLfWEW7P+zACxsxXHT0RGEiocBOKEKZ8ZUH?= =?us-ascii?Q?gbPlOHkOqDvNrezF/NBsPV7eUXkOP2ryPfTkkrJs5hbzJxnmVOWQOvMnQfCJ?= =?us-ascii?Q?3utAC3Lz9jeAqesEl4sIGdRppEF0eMw7hLXeepi1pDYeZL4OIQ971FSTg2YZ?= =?us-ascii?Q?41B0so7bw99aiZiCIP90xkmZQDzxa46Edi9FqL7Txl96dKFUfWHn+WrisAKo?= =?us-ascii?Q?NF4BjQwZf8fogh0K1U=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 096943F07A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(366004)(136003)(396003)(346002)(13464003)(189003)(199004)(478600001)(66066001)(14454004)(1511001)(71190400001)(86362001)(6436002)(68736007)(71200400001)(9686003)(486006)(476003)(97736004)(52536013)(5660300002)(2906002)(3846002)(105586002)(446003)(106356001)(81166006)(81156014)(229853002)(76176011)(8936002)(11346002)(55016002)(74316002)(99286004)(6246003)(256004)(26005)(305945005)(6506007)(53546011)(33656002)(25786009)(6116002)(110136005)(53936002)(7696005)(7736002)(186003)(102836004)(316002)(41533002)(142923001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB6056; H:AM6PR05MB5926.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: G8/CV1aW6SeGbCOQisVJl+zZ6GfCluhdiWXZK1WtTtZB9V/aakvxFBMMmAxxz5TtzggnIfkzXd54OKCIHaRZXMgfjtsAzqcz01NNRQ7cPi74f+scjxUOek0XDUhia52jNepY9fbI5p7mTyHrG3Btz/3a9G4NFon0FlIEae4vmCmmL/MdCkmvHsLAf+ZF6sTO5IglwuFr3xLEEkNZtYhoxlrDniAUwE7qLODnqh0bMbxnqcBxR5N9jZlNCkXFn6ihsoF1MJRu7G3wO4GhgJr2epDK14fTm12i/gfPbVO1vscgUcZWbrBcGEW0go140Z7XBSLyswE6vKiW8PQvU1uxSZymZtQwgyz8aOEIFchn+2i5Ixky5s+uRBJg1Q2hyW/+D8Xu7Pf+nUu/CFmRLiSCZCnd9xfk+58Su/CiZ7ADrSA= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25713804-003b-4380-1513-08d6a2da1dec X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Mar 2019 08:51:40.6794 (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: AM6PR05MB6056 Subject: Re: [dpdk-users] How to use .last and .spec fields in the Generic Flow API? X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Mar 2019 08:51:43 -0000 Hi Andrew, You are specifying a mask and the last for the item. Based on the mask that you specified it means that match only the udp_dst_p= ort that was specified since the mask is 0xffff Which is causing conflicts with the range. Try it without setting the mask or set the mask to be 0x0 Kindest regards, Raslan Darawsheh > -----Original Message----- > From: users On Behalf Of Andrew Bainbridge > Sent: Wednesday, March 6, 2019 5:30 PM > To: users > Subject: [dpdk-users] How to use .last and .spec fields in the Generic Fl= ow > API? >=20 > Hi >=20 > How should I specify a range of UDP ports in the generic flow API? Here's > what I've tried... >=20 > I'm trying to create a flow to move packets with UDP dest ports from 1234= to > 1244 into a specified queue. It works fine if I specify a single port of = 1234, > instead of the range. Here's how I set the flow item for that: >=20 > struct rte_flow_item_udp udp_spec =3D { 0 }; > struct rte_flow_item_udp udp_mask =3D { 0 }; > udp_spec.hdr.dst_port =3D htons(udp_dst_port); > udp_mask.hdr.dst_port =3D 0xffff; > pattern[2].type =3D RTE_FLOW_ITEM_TYPE_UDP; > pattern[2].spec =3D &udp_spec; > pattern[2].mask =3D &udp_mask; >=20 > But if I attempt to specify the range, I believe I have to use the .last = field. > When I do that, I get this error, 'range between "spec" and "last" is lar= ger > than "mask"'. Here's how I set that flow item: >=20 > struct rte_flow_item_udp udp_spec =3D { 0 }; > struct rte_flow_item_udp udp_last =3D { 0 }; > struct rte_flow_item_udp udp_mask =3D { 0 }; > udp_spec.hdr.dst_port =3D htons(1234); > udp_last.hdr.dst_port =3D htons(1244); > udp_mask.hdr.dst_port =3D 0xffff; > pattern[2].type =3D RTE_FLOW_ITEM_TYPE_UDP; > pattern[2].spec =3D &udp_spec; > pattern[2].last =3D &udp_last; > pattern[2].mask =3D &udp_mask; >=20 > I don't understand the error message. The range between spec and last is = 10. > The mask is 0xffff. The error message seems wrong. But probably I just > misunderstood something. >=20 > More details: >=20 > I'm using the mlx4 PMD. The source of the error message is in > mlx4_flow_item_check(), where the code appears goes through each byte > of the spec and last and checks that: >=20 > (((const uint8_t *)item->spec)[i] & mask[i]) !=3D (((const uint8_t *)= item- > >last)[i] & mask[i])) >=20 > Which makes no sense to me. That appears to require that spec and last ar= e > equal wherever mask is not zero. >=20 > Any ideas? >=20 > Thanks, > Andy