From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EC424A2EEB for ; Mon, 7 Oct 2019 15:56:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A4E221C1E9; Mon, 7 Oct 2019 15:56:09 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id F3D021C1D0 for ; Mon, 7 Oct 2019 15:56:08 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from viacheslavo@mellanox.com) with ESMTPS (AES256-SHA encrypted); 7 Oct 2019 15:56:05 +0200 Received: from pegasus11.mtr.labs.mlnx (pegasus11.mtr.labs.mlnx [10.210.16.104]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x97Du5VP017073; Mon, 7 Oct 2019 16:56:05 +0300 Received: from pegasus11.mtr.labs.mlnx (localhost [127.0.0.1]) by pegasus11.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id x97Du5U4004993; Mon, 7 Oct 2019 13:56:05 GMT Received: (from viacheslavo@localhost) by pegasus11.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id x97Du5lD004992; Mon, 7 Oct 2019 13:56:05 GMT X-Authentication-Warning: pegasus11.mtr.labs.mlnx: viacheslavo set sender to viacheslavo@mellanox.com using -f From: Viacheslav Ovsiienko To: dev@dpdk.org Cc: matan@mellanox.com, rasland@mellanox.com Date: Mon, 7 Oct 2019 13:56:03 +0000 Message-Id: <1570456563-4951-1-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix port id action domain check 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The validating routines flow_dv_validate_action_port_id() and flow_dv_validate_item_port_id() could return the positive or ever zero value in case of domains mismatch and the validation routine missed the rules for ports belonging to different switching domains. Fixes: 812909392b52 ("net/mlx5: elaborate E-Switch port parameters query") Signed-off-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 2a7e3ed..20e66f6 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -847,18 +847,18 @@ struct field_modify_info modify_tcp[] = { return 0; esw_priv = mlx5_port_to_eswitch_info(spec->id); if (!esw_priv) - return rte_flow_error_set(error, -rte_errno, + return rte_flow_error_set(error, rte_errno, RTE_FLOW_ERROR_TYPE_ITEM_SPEC, spec, "failed to obtain E-Switch info for" " port"); dev_priv = mlx5_dev_to_eswitch_info(dev); if (!dev_priv) - return rte_flow_error_set(error, -rte_errno, + return rte_flow_error_set(error, rte_errno, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, "failed to obtain E-Switch info"); if (esw_priv->domain_id != dev_priv->domain_id) - return rte_flow_error_set(error, -ret, + return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM_SPEC, spec, "cannot match on a port from a" " different E-Switch"); @@ -2462,7 +2462,7 @@ struct field_modify_info modify_tcp[] = { " a flow"); dev_priv = mlx5_dev_to_eswitch_info(dev); if (!dev_priv) - return rte_flow_error_set(error, -rte_errno, + return rte_flow_error_set(error, rte_errno, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, "failed to obtain E-Switch info"); @@ -2471,12 +2471,12 @@ struct field_modify_info modify_tcp[] = { act_priv = mlx5_port_to_eswitch_info(port); if (!act_priv) return rte_flow_error_set - (error, -rte_errno, + (error, rte_errno, RTE_FLOW_ERROR_TYPE_ACTION_CONF, port_id, "failed to obtain E-Switch port id for port"); if (act_priv->domain_id != dev_priv->domain_id) return rte_flow_error_set - (error, -rte_errno, + (error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "port does not belong to" " E-Switch being configured"); -- 1.8.3.1