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 28EE2A04FD for ; Thu, 10 Nov 2022 08:00:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5114540156; Thu, 10 Nov 2022 07:59:59 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2064.outbound.protection.outlook.com [40.107.92.64]) by mails.dpdk.org (Postfix) with ESMTP id 5321E400D4; Thu, 10 Nov 2022 07:59:57 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jWF9Fw3eAQfQZ5gL3WyDBAfA599PwZbQod3RLattK3H1/EO4QoKsgCoYkwJXGp8Ngt+rKOHBzyQd+LZICwzEz0AKyCXCt+oEaT91yXfi8OmiQif2TqLbgazN7Ee7pnDlHakQUjOHvlrHwd0dPiuCVl474a6tZfNoggPSIP5fkjkIKjGwxzvM/wGdQxqV01eu7dtgxwOdZ7n8J3Cug7Z2NnsJ0FsR9hJ0qhmVgh4qvE4XxfCNyOKLtJq7JJGWo+MWbEXPtn34npo1pZIYO7fdhApncATthIOQOOMmF7d18nJ4X7ohdEW3UCeuNf2Iqm4hrECAwrFkBEn1l67ISRUBgw== 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=hRTfY91xb0zVa3AZ6URBOg086dvIEpvlaRwKcJ3k5YM=; b=hhAAEbf7kfzoHzzStJz9SQTQtvep0wxzn5QSl+y1qwz2aPKFl3tjAZHBerKrlC71z/6SB1mqeABILR3n5RJyUbQNV45RTyBkK82uFysy8f6v3AAaUJR3aJlEviqjJf5aX3c8FYiIPkU27RLw5y06toC9kwwYmAJBMHpco4V/cnuqIVEpbP8aHMvvfRy5l/Z3ubYFnF7k0n360rA7095eZ04KeQ0bCAKX9ohdasdx+x1U4NmVXKVoSGsnV7ixBzwUNDd9QwfXFGj6kj0dV4IgCLgee2M7RdxoewpE04ZE0Q6ccltqSIU+KSpqegzy6GdIZaQhGF1n/5kFn1MsCKZnJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=hRTfY91xb0zVa3AZ6URBOg086dvIEpvlaRwKcJ3k5YM=; b=b0Lhw6S8LzB8CORcKfaM4262dCyBYfwIUOY5BU+K/CLrb4/xyyp/dSfmq+O4yBIlzreoZChjXCb4fqta1dqqrZWZUUPa99mfFVNECM7g7/g9rzKZdBG6BUuaTu6OAnLaPq8zo6PFrYHY4i52p0ePIRdZiw+9uMldGvWowka6KqCCy+RjDzTtEq8izBim9CZnf2Cx/7xS7vUTWMGd2JYQHGlgMZeQpdjwKIaJcg5rtHD83Lr5kiMZlgmaG45nEjDBcw6xihXkH+vvRiHXagAYdyX4YLR1EfFEc90XrDgKwzQtgYMFUNL8CptysaUAgydBxafJvrOUwZdhKLikp/KcfQ== Received: from DM6PR12CA0031.namprd12.prod.outlook.com (2603:10b6:5:1c0::44) by SA1PR12MB7343.namprd12.prod.outlook.com (2603:10b6:806:2b5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.13; Thu, 10 Nov 2022 06:59:54 +0000 Received: from DM6NAM11FT070.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1c0:cafe::5) by DM6PR12CA0031.outlook.office365.com (2603:10b6:5:1c0::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.13 via Frontend Transport; Thu, 10 Nov 2022 06:59:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT070.mail.protection.outlook.com (10.13.173.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.12 via Frontend Transport; Thu, 10 Nov 2022 06:59:54 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Wed, 9 Nov 2022 22:59:44 -0800 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.36; Wed, 9 Nov 2022 22:59:40 -0800 From: Shun Hao To: , , CC: , , Subject: [PATCH] net/mlx5: fix drop action validation Date: Thu, 10 Nov 2022 08:59:21 +0200 Message-ID: <20221110065921.1297561-1-shunh@nvidia.com> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT070:EE_|SA1PR12MB7343:EE_ X-MS-Office365-Filtering-Correlation-Id: ba9876dc-44bb-4cae-bc2b-08dac2e92bb8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pqXtNPPN4sjJ/qqcEVszzIDRF4bjt1MLisDBTOzGmGsIf3uMN4qPEBHMUg42k/f8ZBLlB/UlhzZtera+uDDW3VPepev1NuwGtumoMRa5kJrHeLSLBSFrLAP4sVZeBdvBzUJbvfZM3XIIJJLKm5w5zWULcEVAT2m2/oNIuwjI6a190YR3qYGqdb+oh7Msg+/LP88t9/xZysxQ6dqkQ7lynGPjSJdOADae9L7DmG8yp6A8yFFK5VKB+iep64eQnLnPGmBJoMLODdX/CyvBnYwiNtxu32sBh99STNXq4/+JcKcn56cVazdVtbmyWiZR84ze5JYiEGAb5pb7KOs/3Z6F/G7ve5sYqi66HbOMY7YwayFWiOKUPLdLsc0btBWoRnKYBkQdq4isfwzASLb22eelJ6TKEpcFjySWzd6zHQHnXes5ApBj9/VwswpIUhnAkqWdmFKLTkgTAgnmSFTDojfNdgy7mrfER2FJ8Y8XKOaYwSVkG1NrbQ09PXK+OgZAlOaxLu2/VAVwvBXsj6oBEVxxiOn277R9kwyvcKAPtx+aeMr169K1Ra2rQtQXOB0UBMHFZTXdoMNBbnjertKrT/FcuphlIw34xr0+x5jUB/b4i5tmDDTmlzIHMafO1fJmvJF3lFC8jGZCaDGIPswW36r8JQzDvgxqZnhb9r16m6Quw5TV5i4Sfi7052+AazrA8RHhPBIyn1kAMutUBRjHy7VKjnybwyo+IHvBq2wIO+MB/fivqOFPM3grjQiRA+5vyhDKoL+OHudKMMRZI65v5092yw== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(136003)(346002)(396003)(39860400002)(376002)(451199015)(36840700001)(40470700004)(46966006)(82310400005)(316002)(110136005)(54906003)(6636002)(2616005)(41300700001)(36860700001)(336012)(450100002)(5660300002)(186003)(16526019)(40460700003)(1076003)(426003)(2906002)(47076005)(86362001)(55016003)(40480700001)(7696005)(8936002)(4326008)(6286002)(26005)(8676002)(70206006)(70586007)(36756003)(356005)(478600001)(7636003)(83380400001)(6666004)(82740400003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2022 06:59:54.1635 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ba9876dc-44bb-4cae-bc2b-08dac2e92bb8 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT070.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7343 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Currently there's limitation for Drop action that can only co-exist with Count action. Sample and Age actions are also able to exist with Drop within the same flow, and this patch includes them in the Drop action validation. Fixes: acb67cc8 ("net/mlx5: fix action flag data type") Cc: stable@dpdk.org Signed-off-by: Shun Hao Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow.h | 3 +++ drivers/net/mlx5/mlx5_flow_dv.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 187e9a23bf..4375ad33bd 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -304,6 +304,9 @@ enum mlx5_feature_name { #define MLX5_FLOW_ACTION_INDIRECT_COUNT (1ull << 43) #define MLX5_FLOW_ACTION_INDIRECT_AGE (1ull << 44) +#define MLX5_FLOW_DROP_INCLUSIVE_ACTIONS \ + (MLX5_FLOW_ACTION_COUNT | MLX5_FLOW_ACTION_SAMPLE | MLX5_FLOW_ACTION_AGE) + #define MLX5_FLOW_FATE_ACTIONS \ (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE | \ MLX5_FLOW_ACTION_RSS | MLX5_FLOW_ACTION_JUMP | \ diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index d79dd8d5f0..bc9a75f225 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -8103,18 +8103,18 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, /* * Validate the drop action mutual exclusion with other actions. * Drop action is mutually-exclusive with any other action, except for - * Count action. + * Count/Sample/Age actions. * Drop action compatibility with tunnel offload was already validated. */ if (action_flags & (MLX5_FLOW_ACTION_TUNNEL_MATCH | MLX5_FLOW_ACTION_TUNNEL_MATCH)); else if ((action_flags & MLX5_FLOW_ACTION_DROP) && - (action_flags & ~(MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_COUNT))) + (action_flags & ~(MLX5_FLOW_ACTION_DROP | MLX5_FLOW_DROP_INCLUSIVE_ACTIONS))) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "Drop action is mutually-exclusive " "with any other action, except for " - "Count action"); + "Count/Sample/Age action"); /* Eswitch has few restrictions on using items and actions */ if (attr->transfer) { if (!mlx5_flow_ext_mreg_supported(dev) && -- 2.20.0