From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10050.outbound.protection.outlook.com [40.107.1.50]) by dpdk.org (Postfix) with ESMTP id 9E1001B149 for ; Tue, 25 Sep 2018 01:18:07 +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=qcohSrrtsNWhMiGPM51J1JUAtahSv6t5z9LhBgqCJnw=; b=W6CirrDtDlYXD5LA1lS3AfTA4lPF+I4zFFb3/enPZh4zVxA45FFLGUDVzzGdCOwGUWB3usRhIoNnET3D5FilpEAyQicFpnwlGjzmnKJhHHFgKU1XqHOAHONq/7flFCSU4VJ3JbSAkE/ZN4VDf4JBAFn3tRgDO/j6UQDrzCQv4J8= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3996.eurprd05.prod.outlook.com (52.134.65.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1164.25; Mon, 24 Sep 2018 23:18:06 +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.1164.017; Mon, 24 Sep 2018 23:18:06 +0000 From: Yongseok Koh To: Thomas Monjalon , Shahaf Shuler CC: "dev@dpdk.org" , Ori Kam Thread-Topic: [PATCH v3 11/11] net/mlx5: add runtime parameter to enable Direct Verbs Thread-Index: AQHUVFzSKIklkix+D0KqO7KBYKdG4g== Date: Mon, 24 Sep 2018 23:17:54 +0000 Message-ID: <20180924231721.15799-12-yskoh@mellanox.com> References: <20180919072143.23211-1-yskoh@mellanox.com> <20180924231721.15799-1-yskoh@mellanox.com> In-Reply-To: <20180924231721.15799-1-yskoh@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BN6PR03CA0021.namprd03.prod.outlook.com (2603:10b6:404:23::31) 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; DB3PR0502MB3996; 6:WRwHLcx8cFTaEJfKD370ZeISZuMNWRqLFog6+zNbQxIbMBrvXOpFKO4tcP1bwFwJUNu45y5/fXQQmxDicKf3tszDECgHd5l4GIY1un+F9vBAUVjW19qHuGJml/rtNDGTO9glalGAFIQ7RSpyA/SCY8Hv4aycSn6ZD2Ele03cWbE30BGyHSXr7Syrvr71OWElzWfjtiy3OlBaPsSySC0S7bpvfzKamONDRVuqgfkqsH4cY9NE0W6x208qjqYtTLed1+dHeo0vgqJBAjKxaEsk5fvgujsu26x3zHtmwTI/1Y3rKy0a1GsLCsVqdTWxNVzwAK3MM/ry19RwzQ3H/r2cHjH2RzUVUzoI59Gmq5BCjVBfJAHfj0LXKpeu6F/Ty6M0fd+YcIq0W7YvuI5rdVDtus/7K3xOQPlC2vhF6LgJM1DRJMuDe8JFTK4Op/9twqUyEJnYIUiLxr23vtxqE3N9zg==; 5:WC9WmdXhyQxCyzoAfV1aIewy7qRbN0bkKHxFnijaESh2PPnZ8st1se5ne2/yFo+6WZC9TqVLiz2SWVkM2MdCC2BvlMUOF0PDopEJGoZ/wVHVlYvoNGiT9Cl0fKVdwvxKepF6HtcbYQ6XAIHJTVoHkIU3F94l67F/L4tvAyXcE/M=; 7:4T6H3CmbJ66tFyG9SdYpUiR4aQjRPFokCHGGGeY4YM9SZ1xmrHY1pZtLUI/iuyMW1+LrI+MMtrFlB/QpLncW0IOMnzFq5+zbnE/sGeEVCFSd2IsyxsxOBKQLMrp+XuaEEW1QJyLghvRw8yYVGfcG9XLKeeEYn4C5pYeM78RGUF/QZjcmNgM5ECSfP4N1yMJLJgtBXa5MZFloXZ4oZPoyMVjaDdKBvtH/XMsKhyzPhRNCbwuLJzaor3cLfArtAAw2 x-ms-office365-filtering-correlation-id: cc5225e5-4b40-414d-a06a-08d62273f4a3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB3PR0502MB3996; x-ms-traffictypediagnostic: DB3PR0502MB3996: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr 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)(10201501046)(3002001)(93006095)(93001095)(3231355)(944501410)(52105095)(6055026)(149066)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051); SRVR:DB3PR0502MB3996; BCL:0; PCL:0; RULEID:; SRVR:DB3PR0502MB3996; x-forefront-prvs: 0805EC9467 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(1496009)(396003)(376002)(346002)(366004)(39860400002)(136003)(199004)(189003)(66066001)(2616005)(476003)(446003)(486006)(11346002)(6436002)(305945005)(7736002)(386003)(6506007)(6486002)(6512007)(186003)(102836004)(5250100002)(76176011)(25786009)(26005)(68736007)(6116002)(54906003)(110136005)(99286004)(1076002)(3846002)(71200400001)(52116002)(86362001)(53936002)(71190400001)(97736004)(8936002)(107886003)(14444005)(256004)(4326008)(316002)(2900100001)(81156014)(8676002)(36756003)(81166006)(105586002)(2906002)(106356001)(6636002)(478600001)(5660300001)(14454004)(6666003)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3996; H:DB3PR0502MB3980.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: mWCAQpdHU/RmpuS3HVlhqKK3kpzKxWm7ZhgOoQYxvopD5o8xgai3BJx1U/ZB+HeKM2dOahfeSijUDOoeRsVI0RuwJ9U0rp+RGzb7d5LNZYfqt76BG/EfQU0LN/Uc4KmR+/jsNmyOE1RnneS4b2fnlW3WGad00y4YdcMlAPV5odN5rOB7Od2bQrZ5wLqV7b8OMKec78BnVxU1520cl7AfqYB/UCVMLSsj3mrb5A9sX7eAGwQE+u55Fab8kpRdrNiD4HIPOo0aJPkT5qMBepmBvCl9G4d8DIgaJa2GiMo0eS5xhGZxmjOdAIDkLX8/h3J5YazN1iUAMTU4V8P7DSYapIfvXir6MN/cz8j39J9GIwY= 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: cc5225e5-4b40-414d-a06a-08d62273f4a3 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Sep 2018 23:17:54.4045 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3996 Subject: [dpdk-dev] [PATCH v3 11/11] net/mlx5: add runtime parameter to enable Direct Verbs 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, 24 Sep 2018 23:18:07 -0000 From: Ori Kam DV flow API is based on new kernel API and is missing some functionality like counter but add other functionality like encap. In order not to affect current users even if the kernel supports the new DV API it should be enabled only manually. Signed-off-by: Ori Kam Acked-by: Yongseok Koh --- doc/guides/nics/mlx5.rst | 7 +++++++ drivers/net/mlx5/mlx5.c | 6 ++++++ drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_flow.c | 9 +++++++-- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index dbdb90b59..67696283e 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -397,6 +397,13 @@ Run-time configuration =20 Disabled by default. =20 +- ``dv_flow_en`` parameter [int] + + A nonzero value enables the DV flow steering assuming it is supported + by the driver. + + Disabled by default. + - ``representor`` parameter [list] =20 This parameter can be used to instantiate DPDK Ethernet devices from diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index ab44864e9..9b208109b 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -90,6 +90,9 @@ /* Allow L3 VXLAN flow creation. */ #define MLX5_L3_VXLAN_EN "l3_vxlan_en" =20 +/* Activate DV flow steering. */ +#define MLX5_DV_FLOW_EN "dv_flow_en" + /* Activate Netlink support in VF mode. */ #define MLX5_VF_NL_EN "vf_nl_en" =20 @@ -491,6 +494,8 @@ mlx5_args_check(const char *key, const char *val, void = *opaque) config->l3_vxlan_en =3D !!tmp; } else if (strcmp(MLX5_VF_NL_EN, key) =3D=3D 0) { config->vf_nl_en =3D !!tmp; + } else if (strcmp(MLX5_DV_FLOW_EN, key) =3D=3D 0) { + config->dv_flow_en =3D !!tmp; } else { DRV_LOG(WARNING, "%s: unknown parameter", key); rte_errno =3D EINVAL; @@ -528,6 +533,7 @@ mlx5_args(struct mlx5_dev_config *config, struct rte_de= vargs *devargs) MLX5_RX_VEC_EN, MLX5_L3_VXLAN_EN, MLX5_VF_NL_EN, + MLX5_DV_FLOW_EN, MLX5_REPRESENTOR, NULL, }; diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 8ff6d6987..8bb619d9e 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -111,6 +111,7 @@ struct mlx5_dev_config { unsigned int mpw_hdr_dseg:1; /* Enable DSEGs in the title WQEBB. */ unsigned int l3_vxlan_en:1; /* Enable L3 VXLAN flow creation. */ unsigned int vf_nl_en:1; /* Enable Netlink requests in VF mode. */ + unsigned int dv_flow_en:1; /* Enable DV flow. */ unsigned int swp:1; /* Tx generic tunnel checksum and TSO offload. */ struct { unsigned int enabled:1; /* Whether MPRQ is enabled. */ diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index c6c145021..6a4a5d17e 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2487,10 +2487,15 @@ mlx5_dev_filter_ctrl(struct rte_eth_dev *dev, * Pointer to Ethernet device structure. */ void -mlx5_flow_init_driver_ops(struct rte_eth_dev *dev __rte_unused) +mlx5_flow_init_driver_ops(struct rte_eth_dev *dev) { + struct priv *priv __rte_unused =3D dev->data->dev_private; + #ifdef HAVE_IBV_FLOW_DV_SUPPORT - mlx5_flow_dv_get_driver_ops(&nic_ops); + if (priv->config.dv_flow_en) + mlx5_flow_dv_get_driver_ops(&nic_ops); + else + mlx5_flow_verbs_get_driver_ops(&nic_ops); #else mlx5_flow_verbs_get_driver_ops(&nic_ops); #endif --=20 2.11.0