From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70075.outbound.protection.outlook.com [40.107.7.75]) by dpdk.org (Postfix) with ESMTP id BA0691B439 for ; Mon, 8 Oct 2018 20:02:18 +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=nM6Tg7zs42q0OFUduJgjUekU5FbJJ9UEDJtTiW49iSo=; b=MXBF6obFDKLAOeW/qXDOKAHgPpHLUFdDMk1q5sedm7bJCwfn0giN2wrunXODudJhl1Rou4ePFUNSdSIqAhbEIAuQoXRLdkcVBKqbIcHCdHtIX+MKLA5XjO58ualPxmHg1OALb2w1wanh84Z4++ybph3qtpnTFWb4ogWNmRZCTw0= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3979.eurprd05.prod.outlook.com (52.134.67.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.26; Mon, 8 Oct 2018 18:02:17 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::1cb0:661b:ecab:6045]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::1cb0:661b:ecab:6045%2]) with mapi id 15.20.1207.024; Mon, 8 Oct 2018 18:02:17 +0000 From: Yongseok Koh To: Shahaf Shuler CC: "dev@dpdk.org" , Yongseok Koh Thread-Topic: [PATCH 6/7] net/mlx5: add missing VLAN action constraints Thread-Index: AQHUXzEM2/YhtvssukqKWuftQuFGZg== Date: Mon, 8 Oct 2018 18:02:17 +0000 Message-ID: <20181008180150.39273-7-yskoh@mellanox.com> References: <20181008180150.39273-1-yskoh@mellanox.com> In-Reply-To: <20181008180150.39273-1-yskoh@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR02CA0016.namprd02.prod.outlook.com (2603:10b6:a02:ee::29) 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; DB3PR0502MB3979; 6:t41RkmNasMqdGTJkvws1KMJzTKVg7E0HuyMHqNNXeiTkMJ44IzA0nfuLtFjvBbWIRkOGyLVlmkp3DpfESmcF1gnsWptavy6OHz1+oUw4MBtYjRTfQLXHVFILu28FDEqfdLxVM7z//A5deQD2xMBs8Ue8xICrjY4ractCapsyipnqg0G95A8DU1QdZpsURZMOoBDQn53gOV5U/31Z3fm8WLhCQWaE0QdtKSF+t7h2h00phD8QkwHrJOS0me5g2z+G4Df0KSS/6LwWTPWdQiEw+35npMhUwrMtWTCFzpZ1RDlpJ2lo+F9iPbbb+OlKig6RM+KoE261vDzt2sSCDcuVSxVpNfcE+53RU0wpigQzAk8WPh5+IkrsfmL13LddOBJPwL3N0GqCOj8AS+XmtlwNzqxV+JZdyu1km8SuZlJwvfOVrwqsSc9w/psAMRsA0HOIt41Wo0nI+ss6U9gzsTXFBA==; 5:bdGQNu1ZjlDx/3G2Y9irAzeX/qT8LE1Btbo+1LlPyjnWiD69iF4w1/kA2XSExIGar9iRPmU32J17gS1J75Rj3Rg1Cx1bAo8u65WbLsDnM2XNcXgdYIT2GPnAco9JjCCZdTGhZmCKErDfnK7wJY1cPQ9e3nrgXNqpk0YOB1eSbNo=; 7:H3dcGE7TDXp0F+h0tta14vsiTlLEVc9iEuyUBT3pIw6P+KNADPEIyYhFlgEcf3K4h1xAOkChew7ohe+s3gElSAcNM5vv3sz0eg3DszppPrjZizGm2b8mwhJURlgO9qkQvDfl6XARij4VdD03kSwroRQwLztfu6+2jZVuyTylN16FM9BCe1y9yQVK8efRW1oz6kzHK/yzPypnwm31oqZ/XvC4Fw6ZtKLWKS7P2fBKFd9MYWWZlEsaFKxhToe8RdLi x-ms-office365-filtering-correlation-id: 7d2eea98-1383-4ab8-3000-08d62d482f3a 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:DB3PR0502MB3979; x-ms-traffictypediagnostic: DB3PR0502MB3979: 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)(93006095)(93001095)(3002001)(10201501046)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123562045)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:DB3PR0502MB3979; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB3979; x-forefront-prvs: 081904387B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(39860400002)(396003)(366004)(189003)(199004)(8676002)(2616005)(11346002)(8936002)(476003)(66066001)(446003)(99286004)(14454004)(71200400001)(105586002)(71190400001)(54906003)(97736004)(316002)(2900100001)(305945005)(106356001)(486006)(186003)(26005)(68736007)(76176011)(81166006)(86362001)(52116002)(5250100002)(81156014)(25786009)(7736002)(36756003)(5660300001)(6116002)(1076002)(256004)(3846002)(14444005)(37006003)(4326008)(6862004)(6506007)(478600001)(386003)(102836004)(53936002)(6512007)(6436002)(6636002)(2906002)(107886003)(6486002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3979; 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: 2r9r/A2hW3jUWteozSigEdeppbwkJwrrz2MRuctRn26Ksjhxy7eTPdHHbzusnOWjDm5DTB4dkb5U+cJhTB5gTAMBESL0RN6ELM59cUu3a8M8JVD0ruJg+Nc2773KaoJN5dWcxxRIOn8uyQHo8Tn6ONaxaQVUnu5917yycCsj5RiOv4EE6CREvfACTbpCzhxuL6x69lDMwawCGBx5d+qLDNURXUbmTwn2NnDMzHgkgDFh54yz1sX/XZ8kC1n8VKsXascYZZRnn2AKe254HOP/mSGebayAQ9mAXImZ6S70hvd5rdUQDdHTGvhXGIUpQ/a/gcRfnyyLNxXVOTNsrtVniuaWLAjDyyOFzOHoB2fTqeQ= 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: 7d2eea98-1383-4ab8-3000-08d62d482f3a X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2018 18:02:17.6144 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3979 Subject: [dpdk-dev] [PATCH 6/7] net/mlx5: add missing VLAN action constraints 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: Mon, 08 Oct 2018 18:02:19 -0000 1) VLAN modify isn't supported by driver. 2) FW syndrome (0xA9C090): set_flow_table_entry: push vlan action fte in fdb can ONLY be forward to the uplink. 3) FW syndrome (0x294609): set_flow_table_entry: modify/pop/push actions in fdb flow table are supported only while forwarding to vport. Signed-off-by: Yongseok Koh --- drivers/net/mlx5/mlx5_flow_tcf.c | 40 ++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 40 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_= tcf.c index 4c660d72b..0406e84f6 100644 --- a/drivers/net/mlx5/mlx5_flow_tcf.c +++ b/drivers/net/mlx5/mlx5_flow_tcf.c @@ -226,6 +226,9 @@ struct flow_tcf_ptoi { }; =20 #define MLX5_TCF_FATE_ACTIONS (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_PO= RT_ID) +#define MLX5_TCF_VLAN_ACTIONS \ + (MLX5_FLOW_ACTION_OF_POP_VLAN | MLX5_FLOW_ACTION_OF_PUSH_VLAN | \ + MLX5_FLOW_ACTION_OF_SET_VLAN_VID | MLX5_FLOW_ACTION_OF_SET_VLAN_PCP) =20 /** * Retrieve mask for pattern item. @@ -436,6 +439,7 @@ flow_tcf_validate(struct rte_eth_dev *dev, uint8_t next_protocol =3D -1; unsigned int tcm_ifindex =3D 0; struct flow_tcf_ptoi ptoi[PTOI_TABLE_SZ_MAX(dev)]; + struct rte_eth_dev *port_id_dev =3D NULL; bool in_port_id_set; int ret; =20 @@ -669,6 +673,7 @@ flow_tcf_validate(struct rte_eth_dev *dev, "missing data to convert port ID to" " ifindex"); action_flags |=3D MLX5_FLOW_ACTION_PORT_ID; + port_id_dev =3D &rte_eth_devices[conf.port_id->id]; break; case RTE_FLOW_ACTION_TYPE_DROP: if (action_flags & MLX5_TCF_FATE_ACTIONS) @@ -685,9 +690,21 @@ flow_tcf_validate(struct rte_eth_dev *dev, action_flags |=3D MLX5_FLOW_ACTION_OF_PUSH_VLAN; break; case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID: + if (!(action_flags & MLX5_FLOW_ACTION_OF_PUSH_VLAN)) + return rte_flow_error_set + (error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, actions, + "vlan modify is not supported," + " set action must follow push action"); action_flags |=3D MLX5_FLOW_ACTION_OF_SET_VLAN_VID; break; case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP: + if (!(action_flags & MLX5_FLOW_ACTION_OF_PUSH_VLAN)) + return rte_flow_error_set + (error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, actions, + "vlan modify is not supported," + " set action must follow push action"); action_flags |=3D MLX5_FLOW_ACTION_OF_SET_VLAN_PCP; break; default: @@ -697,6 +714,29 @@ flow_tcf_validate(struct rte_eth_dev *dev, "action not supported"); } } + /* + * FW syndrome (0xA9C090): + * set_flow_table_entry: push vlan action fte in fdb can ONLY be + * forward to the uplink. + */ + if ((action_flags & MLX5_FLOW_ACTION_OF_PUSH_VLAN) && + (action_flags & MLX5_FLOW_ACTION_PORT_ID) && + ((struct priv *)port_id_dev->data->dev_private)->representor) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, actions, + "vlan push can only be applied" + " when forwarding to uplink port"); + /* + * FW syndrome (0x294609): + * set_flow_table_entry: modify/pop/push actions in fdb flow table + * are supported only while forwarding to vport. + */ + if ((action_flags & MLX5_TCF_VLAN_ACTIONS) && + !(action_flags & MLX5_FLOW_ACTION_PORT_ID)) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, actions, + "vlan actions are supported" + " only with port_id action"); if (!(action_flags & MLX5_TCF_FATE_ACTIONS)) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, actions, --=20 2.11.0