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 DE3B9A00C4; Thu, 28 Jul 2022 16:12:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7BC4140151; Thu, 28 Jul 2022 16:12:51 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2048.outbound.protection.outlook.com [40.107.223.48]) by mails.dpdk.org (Postfix) with ESMTP id 4C0624014F; Thu, 28 Jul 2022 16:12:49 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mpBRoPOIJdzEyEzXpaK/Ij3PRJGa9YX2u7V/7plGJqvQ+LY447UV6iaiE0FBnIWLASRiH05PpPlCqmgoKKovac3mOe+rJt4OZfS9tetX5AVFvTX7BxE+ZppjFOwAQZNzlkUiDXL4jPUkjfudHzTq9xkffTDxqS38uFlc+W7zG4qdwq13g0Y5xtZHRabf5Ew4lgx741e1k7ga1233z6zafGlhVGEklcuzxqANxIjwpEo5v0P+sv+4RuB2D7P1DvvPEzHVwQ7XUxyjOD4tcIiL/eEbOXZuwk1ucUqTop0TVJoQ0JgtUCiaugWqfIY6yxz5ojV7cvpm72oDABJh2/pilA== 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=1uyks60Pj259JeNuitpqHjaFCY2Skk8tAVJQy2QPAMM=; b=R6TrzsfFoyA6+eNqNfeNpdGlM2qFvfVaCc5lVMcPidx/FAu+eXAT/1UrhuGOPHZUJFhTRS5zknPIequSDcc4DhpU3kO6rBpW48dvEMLWMCD6+YjqNU1gajL+eTx+LaS2gmNYNt9i2gN8bu69Dg5x/kKyqyUMDXdl1rYxW39FydOYD+DrUWf8EHly168fSXudI280Z8Dwb2rVj0gvYWfLp4SXNe+6d4JTdagiazJ1viGMoyHvIB7V36YtpQi9YetL2zTnZGpxGBSbTGD+YMCtroMJMEMDgMGJgKnQwFipED6Nd0ikR1DXT3T5T48u0yMK7sCwXcDtfsGeVdr0svvuRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) 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=1uyks60Pj259JeNuitpqHjaFCY2Skk8tAVJQy2QPAMM=; b=CbUNCj/YMg5f/A5dMhP8tVQ6a+vOdzo62K5wuoNhaWBLXEv7dj+6R4vqSkjdZNV3nZMoLwBMij0rINpG99t+aqNag8Dkxum25xZXH0bawSve5coHndqK0kWB13TQljxzFJ7eSgoyNIzH5w45lQA3fjLh646dkCVX4/hw89sbi03rm0TThy6cq98NUZY2rC2sgkLzPtle3nmJlOrp11bi1II2a3uHWmcTKumlOj4pZfqKDg9d6+tJKeuNhLiXO+jy/vL5vjYHiLay+jsvk9v0RnJV11+XOipyZrGIDSwrJx0xPWMDLeAGSXY7xa7lp52kgbnDYGsL+q9dr6HBlqjOoQ== Received: from DS7PR03CA0189.namprd03.prod.outlook.com (2603:10b6:5:3b6::14) by SN6PR12MB5695.namprd12.prod.outlook.com (2603:10b6:805:e1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.11; Thu, 28 Jul 2022 14:12:47 +0000 Received: from DM6NAM11FT048.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b6:cafe::cc) by DS7PR03CA0189.outlook.office365.com (2603:10b6:5:3b6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.7 via Frontend Transport; Thu, 28 Jul 2022 14:12:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) 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 12.22.5.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.235) by DM6NAM11FT048.mail.protection.outlook.com (10.13.173.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5482.10 via Frontend Transport; Thu, 28 Jul 2022 14:12:46 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Thu, 28 Jul 2022 14:12:45 +0000 Received: from nvidia.com (10.126.230.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.26; Thu, 28 Jul 2022 07:12:42 -0700 From: Bassam ZaidAlKilani To: CC: , , , Matan Azrad , Viacheslav Ovsiienko Subject: [PATCH] net/mlx5: fix matcher priority for esp item Date: Thu, 28 Jul 2022 17:12:01 +0300 Message-ID: <20220728141203.3191-1-bzalkilani@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d4d03afb-ae09-46eb-dd93-08da70a33f19 X-MS-TrafficTypeDiagnostic: SN6PR12MB5695:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8inY545Znb1eDqXFFogWK5V6ns+JSXLYIUzLEJPWYUW58WRg0s1eWgWd8kyq6cff9uMOr/hQ+I4gDT0XmHx63hqNiJhaZ7A5OVzdsPLttCGoB+o8cpNBcCUREV6oX+Al6JyjzKaaiNsIYeWWxLXjZHpwLxNIhm4oDLdUpZ9cM4Plh+GUH6FQi2tj+7S4E8S25EvielD2B7hLapWegyATwBehJusRioOgDzhdXveMtMo1Hft7D93L2E7maUMtbD5+t6q5Ze/WPwci+AP0uYErzACvI0v8q0yoLAZpNKipVpbIeEpNAlRtECqTFafrI39wobhWpaiOL9SMPkx/hWbP0Gau9HCMutMwJ0kzD+idbXgx3XB8kI8diFkQTk5ogW+gtkBXG0EQo1LcRMh373Pzh6341UDVyB+CcuLe4b9aFGvCp/a914incoydKawHnfYGp5NcLvne4n/TSzyceGw/Msx7uNIiEL0Bhkr+ULXH4f6vaGSHPgJm4ZoY4YPwAyS8XL62iKRyKk3b1uZssK02bhua9y6ZoBtwE+7iryazBX9KGOb0uJJ/hzelpTdkH1owOQOo3QbigT7A3oBzpq9kLYDmeeR80EgBlZFgRt/2K00mLySoK/kTl1P+lthM9ySCLLv5kNI2hSuKD5MgsZ0dcpl0F11Gk7R5gDBCqgahAU6O9CRxGLdwybLV+rQX4P/26kTGQbtO08x3vr/zFDjTqvqE2jnGkT+ItnKyvVpc06zrmBSwUogGYRlkn49AzS0f0AP/vZw47oTUX9U+9wXKLC5+LYDPhEfFyIQsDdD0MIB+wL3q0oQyPY4tEUyNP/zXPbB/IDQCpDAcvq8l4Q+MwA== X-Forefront-Antispam-Report: CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(136003)(346002)(396003)(39860400002)(376002)(40470700004)(36840700001)(46966006)(2906002)(36756003)(450100002)(5660300002)(47076005)(36860700001)(8936002)(54906003)(6916009)(70206006)(4326008)(8676002)(70586007)(478600001)(41300700001)(26005)(6666004)(40480700001)(7696005)(55016003)(316002)(336012)(1076003)(2616005)(426003)(82310400005)(186003)(16526019)(356005)(81166007)(107886003)(86362001)(40460700003)(82740400003)(6286002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2022 14:12:46.5892 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d4d03afb-ae09-46eb-dd93-08da70a33f19 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.235]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT048.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB5695 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 ESP is one of IPSec protocols over both IPv4 and IPv6 and is considered a tunnel layer that cannot be followed by any other layer. Taking that into consideration, esp is considered as a 4 layer. Not defining ESP's priority will make it match with the same priority as its prior IP layer, which has a layer 3 priority. This will lead to issues in matching and will match the packet with the first matching rule even if it doesn't have an esp layer in its pattern, disregarding any following rules that could have an esp item and can be actually a more accurate match since it will have a longer matching criterion. This is fixed by defining the priority for the ESP item to have a layer 4 priority, making the match be for the rule with the more accurate and longer matching criteria. Fixes: 18ca4a4ec73a ("net/mlx5: support ESP SPI match and RSS hash") Cc: rzidane@nvidia.com Cc: stable@dpdk.org Signed-off-by: Bassam ZaidAlKilani --- drivers/net/mlx5/mlx5_flow_dv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index bee9363515..47135a0208 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -13756,6 +13756,7 @@ flow_dv_translate(struct rte_eth_dev *dev, case RTE_FLOW_ITEM_TYPE_ESP: flow_dv_translate_item_esp(match_mask, match_value, items, tunnel); + matcher.priority = MLX5_PRIORITY_MAP_L4; last_item = MLX5_FLOW_ITEM_ESP; break; case RTE_FLOW_ITEM_TYPE_PORT_ID: -- 2.25.1