From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 823C9A054A; Fri, 23 Sep 2022 16:46:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0738E42C10; Fri, 23 Sep 2022 16:44:34 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2088.outbound.protection.outlook.com [40.107.223.88]) by mails.dpdk.org (Postfix) with ESMTP id 7B3B942C0A for ; Fri, 23 Sep 2022 16:44:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aLwEqJuqMlJy9Gp6PK/IGRswVb3pGSa81D7Bb4AaW26fVSTk7G69pBNzuiT3Zeg7C5FXLVKmx5mmzzL7NAtzKRzokA7Hbn/3FWBi+B3D2zp1xzwJV6UjdfQhtWNDOXo1MAs/+QXebN1rHOcJMGytNKoy1zA52Oc2F1LcE3HxLQgdGSZ8GjZGcA30aur5OAAPvHBckwdexO8lzvK6dnepy2l9NdBgFy5BFdaKUoOtGVCx4MCrRKHkfvtgNtcOr6G/meYD6g+DmYrMwQ7+fOIUQ6mMzs92b7Is1bVEjLD6AeLfN9daR8DusurmRR1ozRBXujdzwmJL2+XRAHQK8RyZbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9904UsvJEfjQpFH7iw9pHt/WVYUfuDIuviy2PwJO/o0=; b=NSwOklCmjaFysCNRch7NoqOxtYQZTrlst8WLsllE8QoIkhy1xx0sCC9j/uJ7F/T7NUG5L9Xtm/sUL0t1hYIIE8KQL4AUNRU/QAOjnK0qulk3SQYd1zLUKGLwlBp12ZaWk72ocTAtZbEWbztVkPcfjSfIeuIb0M1tAeK2HV4wnQ4P+RkizBk7TWEA1gkiYgVBcQCXk+k+KV8x4FdRHcbl4h/DA3KQowCtvM71k3IcTySCaMsL9g+f9k1iA82WXCyip4itgF+ygj4QBrV73J2AhdM4bPr1vYQ/bfIuymWzR0p0Z1uO21ZokYbgWaVHrgtNr+t36CbTEhsiJ3K8bvERyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9904UsvJEfjQpFH7iw9pHt/WVYUfuDIuviy2PwJO/o0=; b=DJSJj4Mm4D22vIfAMb8WhOg6lzS8sgHVt+onsV+EJMlPIHPoHl+fSEsWF1A5fK7ZZNHKCTYJXGqNEWlaNeCVGIfSN1yphPqi0X2iNqkZNr0y9kUuwfKUjgSvQimhx0ELBPMS42aW3jugzZ8kunZ0iimfSpEpn9q7cgx+6dUQcZUtiquSbbcOM865zM/+9s6pCknRRTcAUxNP93ANEgrJVDaoRFsbRd+K92X9UMZgeBOh1Qmru1rDkk/1IDlRr3fbgvaavlbtcd7EiEZbTfOTHZsSe/gI1aCwJYvCAsqixI3UjNBEeuwxa66LWwQs/QFLKQwv0nIYojRVHytp9QcXrQ== Received: from MW4PR04CA0293.namprd04.prod.outlook.com (2603:10b6:303:89::28) by SJ1PR12MB6028.namprd12.prod.outlook.com (2603:10b6:a03:489::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.20; Fri, 23 Sep 2022 14:44:29 +0000 Received: from CO1NAM11FT108.eop-nam11.prod.protection.outlook.com (2603:10b6:303:89:cafe::71) by MW4PR04CA0293.outlook.office365.com (2603:10b6:303:89::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.20 via Frontend Transport; Fri, 23 Sep 2022 14:44:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT108.mail.protection.outlook.com (10.13.175.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Fri, 23 Sep 2022 14:44:29 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Fri, 23 Sep 2022 07:44:14 -0700 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Fri, 23 Sep 2022 07:44:12 -0700 From: Suanming Mou To: Matan Azrad , Viacheslav Ovsiienko , Dariusz Sosnowski CC: Subject: [PATCH 14/27] net/mlx5: fix indirect action validate Date: Fri, 23 Sep 2022 17:43:21 +0300 Message-ID: <20220923144334.27736-15-suanmingm@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20220923144334.27736-1-suanmingm@nvidia.com> References: <20220923144334.27736-1-suanmingm@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT108:EE_|SJ1PR12MB6028:EE_ X-MS-Office365-Filtering-Correlation-Id: d12b7cbf-5872-48e8-a05a-08da9d721f0c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: af/X3FwH9/1n8LdDE4HOS+shGy0NPW90Wzt9pvl4Q+ixJ6s+/zvoqvJgIPr9ETmOTmEOmeVraPEKfaeExdjkvs7awZHRsUFKkWW5NQwyljIbirfKwmXhaZXZmJ8FNKFdyKtEfgfomtlrxF0Yc6uj7nwZq/yN1BwWiIswYw1ERliZQG9WPueK76PhhzBgcjU10I41rRg4klkA3TJlzldDZhWYpb3N68rIX8QHu8IyjzmkUdu7t1/s1luZ2eIilLBgONNq18nkcQNGeyPH9ukYNx6vIklkOcJwRjh7du9sf7pPBma5Y9FBb2Y71xzpJPUUh5fm2NRCnqXq7odl1EHcruhYhq/PU1zQ+NIiq+At7vDzg8WZ8UU2zPchUV95HqDSs02IXBSdU6EMYicQyQjeK5HDSfw/mS1s3CMuoLHSxHBNGorgndWnpXXH1qQXSUOaqZkTYBdjVy5CDTafU2BpZ7nNmp9mVAeD/zFDfSU04/Ah6ajZhCN59Ai4somd/PHlx6YwSjo70AWvovN98iSAaGhxSXwegyugkudSEeJKRE59dhUG/ieHW38it/DcHUiLXIqHPohL+DoHnfSSA4LIa7nmImWu6OLeNs+vQLtznVvLXVh2Cezq495En7JFSGES+w95FTFN2u3SBpKnuUQQsZ9eCXO/sKcQPZiiFZDwSFru/ycQGFGKS1sdDi2Tt+F/YfogH/xqW1gXvTl/3WT094o4hLe480rESseJgVPuNx3Cw4gQNJ9fthXpRvQ52XC6fQT4Nfs89KwkmllKC+6pCA== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(396003)(136003)(39860400002)(376002)(346002)(451199015)(46966006)(40470700004)(36840700001)(16526019)(186003)(426003)(1076003)(47076005)(336012)(2616005)(86362001)(55016003)(40460700003)(6286002)(26005)(6666004)(7696005)(41300700001)(5660300002)(15650500001)(4326008)(36756003)(82740400003)(7636003)(40480700001)(356005)(82310400005)(83380400001)(2906002)(36860700001)(316002)(6636002)(8936002)(8676002)(110136005)(478600001)(70206006)(70586007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 14:44:29.7537 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d12b7cbf-5872-48e8-a05a-08da9d721f0c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT108.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6028 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org For indirect actions, the action mask type indicates the indirect action type. And action mask conf be NULL means the indirect action will be provided by flow action conf. This commit fixes the indirect action validate. Fixes: 393e0eb555c0 ("net/mlx5: support DR action template API") Signed-off-by: Suanming Mou --- drivers/net/mlx5/mlx5_flow_hw.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 6a1ed7e790..d828d49613 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -2726,7 +2726,8 @@ flow_hw_actions_validate(struct rte_eth_dev *dev, const struct rte_flow_action *mask = &masks[i]; MLX5_ASSERT(i < MLX5_HW_MAX_ACTS); - if (action->type != mask->type) + if (action->type != RTE_FLOW_ACTION_TYPE_INDIRECT && + action->type != mask->type) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, action, @@ -2824,22 +2825,25 @@ flow_hw_dr_actions_template_handle_shared(const struct rte_flow_action *mask, uint16_t *curr_off, struct rte_flow_actions_template *at) { - uint32_t act_idx; uint32_t type; - if (!mask->conf) { + if (!mask) { DRV_LOG(WARNING, "Unable to determine indirect action type " "without a mask specified"); return -EINVAL; } - act_idx = (uint32_t)(uintptr_t)mask->conf; - type = act_idx >> MLX5_INDIRECT_ACTION_TYPE_OFFSET; + type = mask->type; switch (type) { - case MLX5_INDIRECT_ACTION_TYPE_RSS: + case RTE_FLOW_ACTION_TYPE_RSS: at->actions_off[action_src] = *curr_off; action_types[*curr_off] = MLX5DR_ACTION_TYP_TIR; *curr_off = *curr_off + 1; break; + case RTE_FLOW_ACTION_TYPE_COUNT: + at->actions_off[action_src] = *curr_off; + action_types[*curr_off] = MLX5DR_ACTION_TYP_CTR; + *curr_off = *curr_off + 1; + break; default: DRV_LOG(WARNING, "Unsupported shared action type: %d", type); return -EINVAL; -- 2.25.1