From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40127.outbound.protection.outlook.com [40.107.4.127]) by dpdk.org (Postfix) with ESMTP id 1C6EB5F17 for ; Wed, 6 Mar 2019 16:30:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MtMLsyk1FDz1XX/+s/a5Agx/pMvhaqle8Vs5Y08nXYw=; b=fJVLt2vxQN6hDONr79UPcWH0BM+NW9tPa71q9aMlFJ+AnLmzMqTmJpharX89kIqx/NTY7ojMvLCXk6V/6SANyK3wyiFXY73Eh6xiuQy4B5OgEdhxktUC5SNQ2sZzq1TbtZYojenEgViBLT7Rz1AjNEsEYVBcgQKFzo03IYQl0FU= Received: from DB7PR83MB0235.EURPRD83.prod.outlook.com (20.176.228.150) by DB7PR83MB0299.EURPRD83.prod.outlook.com (20.176.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.2; Wed, 6 Mar 2019 15:30:03 +0000 Received: from DB7PR83MB0235.EURPRD83.prod.outlook.com ([fe80::e5a4:9c7f:7b70:302b]) by DB7PR83MB0235.EURPRD83.prod.outlook.com ([fe80::e5a4:9c7f:7b70:302b%6]) with mapi id 15.20.1709.005; Wed, 6 Mar 2019 15:30:03 +0000 From: Andrew Bainbridge To: users Thread-Topic: How to use .last and .spec fields in the Generic Flow API? Thread-Index: AdTULfMpOywd9MpSS1qLnFZ916l9Yw== Date: Wed, 6 Mar 2019 15:30:02 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=andbain@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2019-03-06T15:30:01.8167712Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=44275825-5af7-4364-918b-5c8c23dd7d25; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic x-originating-ip: [2a01:110:8012:1010:c884:30fc:39ca:97cc] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5a9d1c42-d88a-4ba1-6b80-08d6a2489a68 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)(7193020); SRVR:DB7PR83MB0299; x-ms-traffictypediagnostic: DB7PR83MB0299: x-o365-sonar-daas-pilot: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 0968D37274 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(366004)(396003)(346002)(376002)(136003)(199004)(189003)(9686003)(25786009)(53936002)(54896002)(6306002)(55016002)(256004)(478600001)(6436002)(68736007)(86362001)(7696005)(9326002)(2906002)(10290500003)(476003)(486006)(8936002)(46003)(71200400001)(71190400001)(86612001)(14454004)(99286004)(81166006)(6346003)(81156014)(97736004)(6506007)(8676002)(316002)(102836004)(8990500004)(186003)(74316002)(22452003)(33656002)(6916009)(5660300002)(106356001)(7736002)(105586002)(6116002)(790700001)(52536013)(10090500001)(41533002)(142923001); DIR:OUT; SFP:1102; SCL:1; SRVR:DB7PR83MB0299; H:DB7PR83MB0235.EURPRD83.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=andbain@microsoft.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: QBNGAMV7QbJmHQ3AvM64x/TL5gMenB7Po602ZXcQ4NMp2UhtoAQ+/C1uqPVM2aAkwMrC3g2/9IByz4oG7mQyPzXQ18kJ7yez55HX9Qvzri5iayJNKdtNpNq4+JyFCCsajzKNCiD8UO5jQ15De9jzKlwmNhU34hzhyKnXLh5x303xwMDetdKyUNjnQksOM+pIiuEu4ZnqTMsZS/zY+jq4leV3YzzH6E6WvKujcJ1j+7gTs0Mo8xk69ETKjIP3q6ASD5Fnn1xuWCHPnhoYTiCcKSqEU6dk3zklorOlizSN+4FU/99Dn6zyNGscFQfU48wRfgovwa4HskprXBEOWwLqpwD99yyLJmY/jrTXnHwrhf1ZCen8UvEgkhV5k85HLMMFyxe6ElvE4P17EgadjDm7sEAbrHbmUvx+LFIeBvHNhzQ= MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5a9d1c42-d88a-4ba1-6b80-08d6a2489a68 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Mar 2019 15:30:02.8210 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR83MB0299 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [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: Wed, 06 Mar 2019 15:30:04 -0000 Hi How should I specify a range of UDP ports in the generic flow API? Here's w= hat I've tried... I'm trying to create a flow to move packets with UDP dest ports from 1234 t= o 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: 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; But if I attempt to specify the range, I believe I have to use the .last fi= eld. When I do that, I get this error, 'range between "spec" and "last" is = larger than "mask"'. Here's how I set that flow item: 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; 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 mi= sunderstood something. More details: I'm using the mlx4 PMD. The source of the error message is in mlx4_flow_ite= m_check(), where the code appears goes through each byte of the spec and la= st and checks that: (((const uint8_t *)item->spec)[i] & mask[i]) !=3D (((const uint8_t *)it= em->last)[i] & mask[i])) Which makes no sense to me. That appears to require that spec and last are = equal wherever mask is not zero. Any ideas? Thanks, Andy