From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20044.outbound.protection.outlook.com [40.107.2.44]) by dpdk.org (Postfix) with ESMTP id AB9605B16 for ; Tue, 9 Oct 2018 09:49:02 +0200 (CEST) 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=15zeY9z9DU7tISwJ/GKuHJ1vs+xH+Xf/vywV+6OhqYQ=; b=K+6SHViNvpv9gDdlja8D/2cd0q4hJOJ+ls8bU8WvgB26Qy0Uheg+SvVvnpIbq/oxi4pOiP3fBPzfgP1k24LCJcehb4Li4Ax+mzTGDPCEpTmoNxVMhdDO6xKvmW/1o3P/F5Ngh7SIB/u63ruRZmHztDDDJ6JVOFADccO3nq8evb8= Received: from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.187.142) by AM4PR05MB3137.eurprd05.prod.outlook.com (10.171.186.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.27; Tue, 9 Oct 2018 07:49:01 +0000 Received: from AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::fdeb:3890:f0f0:2202]) by AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::fdeb:3890:f0f0:2202%4]) with mapi id 15.20.1207.024; Tue, 9 Oct 2018 07:49:01 +0000 From: Ori Kam To: Yongseok Koh , Shahaf Shuler CC: "dev@dpdk.org" Thread-Topic: [PATCH 5/7] net/mlx5: fix flow validation for no fate action Thread-Index: AQHUXzEM8infCsBmYUeClCiUReVwz6UWipwQ Date: Tue, 9 Oct 2018 07:49:01 +0000 Message-ID: References: <20181008180150.39273-1-yskoh@mellanox.com> <20181008180150.39273-6-yskoh@mellanox.com> In-Reply-To: <20181008180150.39273-6-yskoh@mellanox.com> 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=orika@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR05MB3137; 6:GYG/xo3ZJtgWguV1vc4dyAUK2/TIZPsUxCl8O/vLIc0zSUdP4tDXXu00M/QL61ufhe66mAUEYN5DJIPslhUafBpTToLlAgk5MaxlwiH3j4k5u52Xyn7P5oao4otVBISpg/KpfqHllTMp/c7LedSyv504bNirDcq3hQdUYYQ9BP5zZ02uIJ+2Src259FM7YMEoqsJ76jp30iUhndu6aMrRd7t/0Q3uLevK/oRnijxfEcy1hUz3/7AvDFLHx3pjDx9/MkJ1j/0SG33aJmyMoPcRqxb4Imm8tIaeBWhH5W2IzjzI8NDOLjVOelMjMeLm/perwByhfvm4WksMNcf+o6ve5q/giK8tNnCBxzifM7c3nX+l76Unfe5l8FzpuPzIFZQwglJdwwqyh1fX9DpMq24TKWutwX0edIRrzBxq/0S2CrD6EPbDd45Mx0bQeMtFXNXnhKcUrpPyBF3gcyZoSUV9A==; 5:jmxXKX1FYhf4Pja1DogQc0NqwNR6bRO4DRX7JyMAqZZiF9ErFXCLqmnbc2oRtSRfHX9cYObPc0J5ZXh2bxcKXENfubHXcfCax25i+gRGp20Sp60qJZvQgs1R/E56nTKLYduD5P2Rqipsfk2AadA4gJ2i3Zg2CtxgzVEXvU1qckY=; 7:7zuppSd153hNE2PDS1gfm1VKID+uu7ZXn6G3FfN5wZiysuNDtOkS4hKtMNDAaqzwU+gHZ87Q7sNQHBfT3dQCP4RtNcpgheELqA+XVRL/gLO3tKULWZGGpbyRXgfNzq7Cq1hVVSB2RgPbG3VghVIErtLRA4NnJ4G+mIOXoPmtlGeIw3rsmX5zeB5AVcmoFs/rQlrHvERANRYYpkhfGZ/Z3fuB3RaKV4WrxPGJFCh+wPj/BNGuHuDJLc8cfZn4hqoH x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 4b8d26d8-0ca6-4185-04c0-08d62dbbada6 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB3137; x-ms-traffictypediagnostic: AM4PR05MB3137: 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)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(201708071742011)(7699051); SRVR:AM4PR05MB3137; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB3137; x-forefront-prvs: 08200063E9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(366004)(136003)(346002)(39860400002)(376002)(396003)(13464003)(189003)(199004)(6246003)(97736004)(2900100001)(71190400001)(71200400001)(86362001)(3846002)(6116002)(478600001)(14454004)(55016002)(9686003)(33656002)(6436002)(25786009)(4326008)(53936002)(106356001)(105586002)(229853002)(5250100002)(66066001)(8676002)(11346002)(446003)(81156014)(486006)(81166006)(6506007)(53546011)(102836004)(7736002)(76176011)(7696005)(5660300001)(8936002)(26005)(186003)(476003)(99286004)(14444005)(316002)(68736007)(6636002)(2906002)(110136005)(256004)(305945005)(74316002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3137; H:AM4PR05MB3425.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: ip/J+7ukp1N+UmR11O1zgbNK5KjAZMukJRX0R1vD4MyAT0jG3S2nTvDpYwJgafeO6861S3j3hcrCcp+LIfCUCFWw9OC96d2YPQ5o9w/pG5pX6RtXRdATLGSxo8hkrSVbUNd5jYmTyYktn+X8EbdRwGbmQFHErGF12EXeOOWdtCff/+OyPVHc8NIvTHLmU0pRSUJwBxlUfFfgtJSKwTVrqbK76sa2AisxDG7pltepFbx2+NY/M8f6iO8YdOLm9HNlYyEJlzYsUOOdx7lOaMcx7U14//rPN6uS/ODoQRb8U57Bu1HToZPe84FV5eDbdqNMlRlOu/eac3/zfLEA/3qcrepm9n4gFcNi+PgMWs8s1Zs= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM 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: 4b8d26d8-0ca6-4185-04c0-08d62dbbada6 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Oct 2018 07:49:01.4039 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3137 Subject: Re: [dpdk-dev] [PATCH 5/7] net/mlx5: fix flow validation for no fate action 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: Tue, 09 Oct 2018 07:49:03 -0000 > -----Original Message----- > From: Yongseok Koh > Sent: Monday, October 8, 2018 9:02 PM > To: Shahaf Shuler > Cc: dev@dpdk.org; Yongseok Koh ; Ori Kam > > Subject: [PATCH 5/7] net/mlx5: fix flow validation for no fate action >=20 > Fixes: 4f07e13d6af5 ("net/mlx5: split flow validation to dedicated functi= on") > Fixes: f7adfffa3de1 ("net/mlx5: add Direct Verbs validation function") > Fixes: edcdef4e5fe4 ("net/mlx5: add Linux TC flower driver for E-Switch f= low") > Cc: Ori Kam >=20 > Signed-off-by: Yongseok Koh > --- > drivers/net/mlx5/mlx5_flow.c | 12 +++--------- > drivers/net/mlx5/mlx5_flow.h | 3 +++ > drivers/net/mlx5/mlx5_flow_dv.c | 4 ++++ > drivers/net/mlx5/mlx5_flow_tcf.c | 4 ++++ > drivers/net/mlx5/mlx5_flow_verbs.c | 4 ++++ > 5 files changed, 18 insertions(+), 9 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index c497cacce..30aa95f14 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -742,9 +742,7 @@ mlx5_flow_validate_action_drop(uint64_t action_flags, > return rte_flow_error_set(error, ENOTSUP, > RTE_FLOW_ERROR_TYPE_ACTION, > NULL, > "can't drop and mark in same flow"); > - if (action_flags & > - (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE | > - MLX5_FLOW_ACTION_RSS)) > + if (action_flags & MLX5_FLOW_FATE_ACTIONS) > return rte_flow_error_set(error, ENOTSUP, > RTE_FLOW_ERROR_TYPE_ACTION, > NULL, > "can't have 2 fate actions in" > @@ -776,9 +774,7 @@ mlx5_flow_validate_action_queue(const struct > rte_flow_action *action, > struct priv *priv =3D dev->data->dev_private; > const struct rte_flow_action_queue *queue =3D action->conf; >=20 > - if (action_flags & > - (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE | > - MLX5_FLOW_ACTION_RSS)) > + if (action_flags & MLX5_FLOW_FATE_ACTIONS) > return rte_flow_error_set(error, ENOTSUP, > RTE_FLOW_ERROR_TYPE_ACTION, > NULL, > "can't have 2 fate actions in" > @@ -821,9 +817,7 @@ mlx5_flow_validate_action_rss(const struct > rte_flow_action *action, > const struct rte_flow_action_rss *rss =3D action->conf; > unsigned int i; >=20 > - if (action_flags & > - (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE | > - MLX5_FLOW_ACTION_RSS)) > + if (action_flags & MLX5_FLOW_FATE_ACTIONS) > return rte_flow_error_set(error, ENOTSUP, > RTE_FLOW_ERROR_TYPE_ACTION, > NULL, > "can't have 2 fate actions" > diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h > index 309e4d4f2..12de841e8 100644 > --- a/drivers/net/mlx5/mlx5_flow.h > +++ b/drivers/net/mlx5/mlx5_flow.h > @@ -79,6 +79,9 @@ > #define MLX5_FLOW_ACTION_OF_SET_VLAN_VID (1u << 9) > #define MLX5_FLOW_ACTION_OF_SET_VLAN_PCP (1u << 10) >=20 > +#define MLX5_FLOW_FATE_ACTIONS \ > + (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE | > MLX5_FLOW_ACTION_RSS) > + > #ifndef IPPROTO_MPLS > #define IPPROTO_MPLS 137 > #endif > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c > index e6c84d444..2fb1d9ee7 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -288,6 +288,10 @@ flow_dv_validate(struct rte_eth_dev *dev, const stru= ct > rte_flow_attr *attr, > "action not supported"); > } > } > + if (!(action_flags & MLX5_FLOW_FATE_ACTIONS)) > + return rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ACTION, > actions, > + "no fate action is found"); > return 0; > } >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c > b/drivers/net/mlx5/mlx5_flow_tcf.c > index c87046365..4c660d72b 100644 > --- a/drivers/net/mlx5/mlx5_flow_tcf.c > +++ b/drivers/net/mlx5/mlx5_flow_tcf.c > @@ -697,6 +697,10 @@ flow_tcf_validate(struct rte_eth_dev *dev, > "action not supported"); > } > } > + if (!(action_flags & MLX5_TCF_FATE_ACTIONS)) > + return rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ACTION, > actions, > + "no fate action is found"); > return 0; > } >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c > b/drivers/net/mlx5/mlx5_flow_verbs.c > index 0ecbc8121..3df467214 100644 > --- a/drivers/net/mlx5/mlx5_flow_verbs.c > +++ b/drivers/net/mlx5/mlx5_flow_verbs.c > @@ -1162,6 +1162,10 @@ flow_verbs_validate(struct rte_eth_dev *dev, > "action not supported"); > } > } > + if (!(action_flags & MLX5_FLOW_FATE_ACTIONS)) > + return rte_flow_error_set(error, EINVAL, > + RTE_FLOW_ERROR_TYPE_ACTION, > actions, > + "no fate action is found"); > return 0; > } >=20 > -- > 2.11.0 Acked-by: Ori Kam Thanks, Ori Kam