From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yongseok Koh Subject: [PATCH v2 1/5] net/mlx5: add warning message for Direct Verbs flow Date: Tue, 23 Oct 2018 16:52:09 +0000 Message-ID: <20181023165200.2454-2-yskoh@mellanox.com> References: <20181017020739.11203-1-yskoh@mellanox.com> <20181023165200.2454-1-yskoh@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , Yongseok Koh , Ori Kam To: Shahaf Shuler Return-path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10086.outbound.protection.outlook.com [40.107.1.86]) by dpdk.org (Postfix) with ESMTP id 9F52A1B3EA for ; Tue, 23 Oct 2018 18:52:10 +0200 (CEST) In-Reply-To: <20181023165200.2454-1-yskoh@mellanox.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" In case that the library doesn't support DV flow, if enabled by 'dv_flow_en=3D1', print out a warning message and disable it. Fixes: 51e72d386c99 ("net/mlx5: add runtime parameter to enable Direct Verb= s") Cc: orika@mellanox.com Signed-off-by: Yongseok Koh Acked-by: Ori Kam --- drivers/net/mlx5/mlx5.c | 6 ++++++ drivers/net/mlx5/mlx5_flow.c | 20 +++++++------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 97be494de9..10a724e944 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1016,6 +1016,12 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, cs_desc.counter_type, cs_desc.num_of_cs, cs_desc.attributes); #endif +#ifndef HAVE_IBV_FLOW_DV_SUPPORT + if (config.dv_flow_en) { + DRV_LOG(WARNING, "DV flow is not supported"); + config.dv_flow_en =3D 0; + } +#endif config.ind_table_max_size =3D attr.rss_caps.max_rwq_indirection_table_size; /* diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index df5c34e81c..6219c9d68a 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1685,25 +1685,19 @@ const struct mlx5_flow_driver_ops mlx5_flow_null_dr= v_ops =3D { * Pointer to the flow attributes. * * @return - * flow driver type if supported, MLX5_FLOW_TYPE_MAX otherwise. + * flow driver type, MLX5_FLOW_TYPE_MAX otherwise. */ static enum mlx5_flow_drv_type -flow_get_drv_type(struct rte_eth_dev *dev __rte_unused, - const struct rte_flow_attr *attr) +flow_get_drv_type(struct rte_eth_dev *dev, const struct rte_flow_attr *att= r) { - struct priv *priv __rte_unused =3D dev->data->dev_private; + struct priv *priv =3D dev->data->dev_private; enum mlx5_flow_drv_type type =3D MLX5_FLOW_TYPE_MAX; =20 - if (attr->transfer) { + if (attr->transfer) type =3D MLX5_FLOW_TYPE_TCF; - } else { -#ifdef HAVE_IBV_FLOW_DV_SUPPORT - type =3D priv->config.dv_flow_en ? MLX5_FLOW_TYPE_DV : - MLX5_FLOW_TYPE_VERBS; -#else - type =3D MLX5_FLOW_TYPE_VERBS; -#endif - } + else + type =3D priv->config.dv_flow_en ? MLX5_FLOW_TYPE_DV : + MLX5_FLOW_TYPE_VERBS; return type; } =20 --=20 2.11.0