From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80053.outbound.protection.outlook.com [40.107.8.53]) by dpdk.org (Postfix) with ESMTP id 7C0E7201 for ; Sat, 3 Nov 2018 18:10:36 +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=W9iUZVb7Lipc046zaBKUwQV90k21m5m4Z+Mci+6vHLY=; b=WoS+UNwKzs/cXTV9Ko2fQGDmSOzfhBqFQ7Dayzm5jHD8ORBVP3H1gtkjos/dTMZ1OFHH4fpNVtw23lcpPxfh6pNy8Y6ChNtxwQS9vO9B5YofyJHkQD2kCbd+wmP8W6e+7aemJ3EYm7yNoQNXUFHBeLRtch+HGCDcYlDbLZJPuHU= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3946.eurprd05.prod.outlook.com (52.134.71.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.26; Sat, 3 Nov 2018 17:10:33 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::58e7:97d8:f9c1:4323]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::58e7:97d8:f9c1:4323%3]) with mapi id 15.20.1294.028; Sat, 3 Nov 2018 17:10:33 +0000 From: Yongseok Koh To: Shahaf Shuler CC: "dev@dpdk.org" , Yongseok Koh , Or Gerlitz Thread-Topic: [PATCH] net/mlx5: limit priority range for Linux TC flower driver Thread-Index: AQHUc5ghW1HFR4XFb0GbR6sy/ZN+9g== Date: Sat, 3 Nov 2018 17:10:33 +0000 Message-ID: <20181103171022.22278-1-yskoh@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR02CA0069.namprd02.prod.outlook.com (2603:10b6:a03:54::46) To DB3PR0502MB3980.eurprd05.prod.outlook.com (2603:10a6:8:10::27) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB3PR0502MB3946; 6:37W4exGjgvuLRXMhIvTYiYKbcBj2StrBO/Yr8Q+iI5cS8oUAi5OFNMxo+icOb1u1Gy8mKbW1LG7LZQm0vQnbsCvRnnxakR3Zan/SfdoA8t7ielcr7kw0inW4rOXgmXlkJmuqfa0ZZux9PI2VBnNNegLPwGKojqs1TPEmJw63MgxZGvp3WfqbIsIt7ZbA1zsPJ0JzKA9wMZeLSkeBubrFvQL9npTgRbJIuLzBPOO96/vDzsN3BgOFVJmV385PtYGpFTAMI67ABCJA+DVBRG1iM6kZbQXb/j3t6UeWWDHssgKy3lS7xIY2f58/JvWdMqf468csrGY5E3US5MpYr7qe+eUot2DwAkMlVvX3+b64JTic7oe+Oy4+nTwCv+egOouJJCO94+KmV7jp50ttgXoi3Dzbu+RSQuwGBzrzitkRKz/XtDkQWS7q0/RNJcqzf/vuBFdTgmCirdoRLvv95T8wfA==; 5:SIXnHwb3PMuojKF5mhZPEpyAeZGlsYHGM0RLVhf+9VsKS4zNgknO0sQzBozwS9YzDoPuXy0xtSokn4Tz4ucgLv/RbS2F0LnZNOuxAs7NLzBxAmLzHxYXKqtaAKJYB2oIfJlr/gwpFKkcgOrgOPsD1ukjfm0/0WqQwtWIi9LX6QI=; 7:4NJi3F/mDRSRkTS7cVlCEOx+UHAC/ZE7ZfuA77Xj4euM2kioLZCm6L3ecqalyB+3KcAuK9bIH3kWAxSTD/JT0wWQT48PnceVviNNXSwq6beuE3ljHJZ/kcVFZBg8BeBd84aZB8BQ5fU+w+FQFtKznQ== x-ms-office365-filtering-correlation-id: e70a8796-3bb1-4e16-cbfd-08d641af43a1 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB3PR0502MB3946; x-ms-traffictypediagnostic: DB3PR0502MB3946: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231382)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:DB3PR0502MB3946; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB3946; x-forefront-prvs: 08457955C4 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(376002)(396003)(136003)(39860400002)(189003)(199004)(6636002)(102836004)(66066001)(86362001)(52116002)(2900100001)(386003)(6506007)(99286004)(316002)(7736002)(36756003)(37006003)(305945005)(54906003)(97736004)(106356001)(105586002)(71200400001)(71190400001)(6486002)(6436002)(8936002)(107886003)(486006)(8676002)(2616005)(25786009)(6862004)(1076002)(476003)(81156014)(4326008)(6512007)(6116002)(3846002)(53936002)(1857600001)(68736007)(14444005)(256004)(2906002)(14454004)(26005)(81166006)(5660300001)(478600001)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3946; H:DB3PR0502MB3980.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-microsoft-antispam-message-info: VbAKMuAqBLFg4gt+9Po2k2lQ6up8dXWnp4gL4Wi8W/cMSxq+EFuftsGgXyNEiojB5sC1zd/I/lnw+qw0lpyr99adm8Sl4TttVRk5TBbNejdsGNHiykLCw1KLVOB4dGW1RMrWmzTsoPctof385Cw7M4mlqmtm0GWnNo6qxg1gPkZeMtuUc8ALRqd3Bn2K8Xj9t1POBwPFkLiUzaFpoPf6ZIejKtCqF9UgB1CiHw9gCVOzkUgC78Sp6hGZU4DFzq0AGsue/Knigy+m3bH8knWZSXb4hfQWISkTFqkUKlYjtXBpizjPDKYSx0jJFTpGkh0RTvA2l+Pi1kBRcRY0+jzS+3mOdqLY7LvCJ7X8PFfhP2A= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: e70a8796-3bb1-4e16-cbfd-08d641af43a1 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2018 17:10:33.4263 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3946 Subject: [dpdk-dev] [PATCH] net/mlx5: limit priority range for Linux TC flower driver 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: Sat, 03 Nov 2018 17:10:36 -0000 Due to a limitation on driver/FW, priority ranges from 1 to 16 in kernel. Priority in rte_flow attribute starts from 0 and is added by 1 in translation. This is subject to be changed to determine the max priority based on trial-and-error like Verbs driver once the restriction is lifted or the range is extended. Cc: Or Gerlitz Signed-off-by: Yongseok Koh --- drivers/net/mlx5/mlx5_flow_tcf.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_= tcf.c index 483e490843..fe504fb648 100644 --- a/drivers/net/mlx5/mlx5_flow_tcf.c +++ b/drivers/net/mlx5/mlx5_flow_tcf.c @@ -337,7 +337,15 @@ struct flow_tcf_ptoi { =20 /* Due to a limitation on driver/FW. */ #define MLX5_TCF_GROUP_ID_MAX 3 -#define MLX5_TCF_GROUP_PRIORITY_MAX 14 + +/* + * Due to a limitation on driver/FW, priority ranges from 1 to 16 in kerne= l. + * Priority in rte_flow attribute starts from 0 and is added by 1 in + * translation. This is subject to be changed to determine the max priorit= y + * based on trial-and-error like Verbs driver once the restriction is lift= ed or + * the range is extended. + */ +#define MLX5_TCF_GROUP_PRIORITY_MAX 15 =20 #define MLX5_TCF_FATE_ACTIONS \ (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_PORT_ID | \ @@ -879,19 +887,13 @@ flow_tcf_validate_attributes(const struct rte_flow_at= tr *attr, "group ID larger than " RTE_STR(MLX5_TCF_GROUP_ID_MAX) " isn't supported"); - else if (attr->group > 0 && - attr->priority > MLX5_TCF_GROUP_PRIORITY_MAX) + else if (attr->priority > MLX5_TCF_GROUP_PRIORITY_MAX) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY, attr, - "lowest priority level is " + "priority more than " RTE_STR(MLX5_TCF_GROUP_PRIORITY_MAX) - " when group is configured"); - else if (attr->priority > 0xfffe) - return rte_flow_error_set(error, ENOTSUP, - RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY, - attr, - "lowest priority level is 0xfffe"); + " is not supported"); if (!attr->ingress) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ATTR_INGRESS, --=20 2.11.0