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 ACF74A0C4E; Tue, 2 Nov 2021 13:24:43 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3DFA04068F; Tue, 2 Nov 2021 13:24:43 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2071.outbound.protection.outlook.com [40.107.243.71]) by mails.dpdk.org (Postfix) with ESMTP id E708840689; Tue, 2 Nov 2021 13:24:41 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EVZ2KvHLFgNb0MfD2j+IpSx62qjeB3xsQbfpdkLWrVBzRTjQs8G0U2xXSAoxj9jPCckY7csp9BecsdYd3bn1jcyLyEWmnIalYKpZUC9OvPSGS2tRkpgAeIzDdqiqsB/+kAUyU7czjuyi6sbxwsRpUGC8tADpzP8A2wZ2bfCWuWh1LSJuV3X86Ya/NY0iJDLxe2HvSY2ImZ6e4M6a5m26VhPG2CGAi2RHIZrqsGYm1Hr8xOjEeDSlxceCmZ33LJQ3QF4YdDpLIr/luc+32DDeaS8sXqi6MXiki1hPN7jv9ttm+NdXZLHLvLEV2q3tB4vFFrVA/FGIJ4tAQLvoLSz8EQ== 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=PaFzIobRodPe37wyUzopcxmVejErpdDJeOLMR7ugc2M=; b=ey4hx47nmjk9c60blCDxuO6xXnhIScYp3KeoAdo7fR3W++heKaNPK8SAoZlc715djXTHyWQu3RqiF6O9PwmmbTEyVv51KV3DolkrsB4KLgHL7Y3mApQakJp7lM3Wx9AIU5EVKSvCJ5LWtj/q4yENTZp8OoS2iuEQZOyRd+P1lzhxJ7yfhp4l5OaYzwNli0RgEDyluvckM+F2iuBBHLBTBsRJ7cQeW7QgL7Z1iouK4KmjP8zgVITTf/cF6dcUZm0jDQOBwOdL+1gw0RN44aIGmgUhIca3z5zQV90cupXYOElAAzLWRg3AcYR+ER550pbgG6kRrPlTAInfO4Swp0W9Ig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=PaFzIobRodPe37wyUzopcxmVejErpdDJeOLMR7ugc2M=; b=rqC1l+/gArPH52NdDkogv3I8y21lTGyfwnRPiujVLzlb/KuPNnNYokNVlJmBaeI/RRG9adfCWwsowQEHLtswh+3fxVAcXN1IE4F6b8slB/UNPyf0iz3bSDNU3FqJg3IoJh5Hb/q4MOLTl/k2UTqU+n9dxgnCevYZgnTKz79P0x3RhpcMDEZ51rjKXbmsjbtUYmrcwMTuhy+veb5nCPKUKTjdX+ucEEMzYSa2KHPzPbJkBPU75ZYCA5Hrx7xrTMXLNNGusVjXchjlUN8ZenEQbP+eqJGc4WpEtRgueFJBBW0hfBpj/LjNSjrnoRL+Iuc92fBB08Oiq8BpTokOT4aBTA== Received: from MW4PR03CA0242.namprd03.prod.outlook.com (2603:10b6:303:b4::7) by BN7PR12MB2801.namprd12.prod.outlook.com (2603:10b6:408:2d::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Tue, 2 Nov 2021 12:24:40 +0000 Received: from CO1NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b4:cafe::6) by MW4PR03CA0242.outlook.office365.com (2603:10b6:303:b4::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15 via Frontend Transport; Tue, 2 Nov 2021 12:24:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT065.mail.protection.outlook.com (10.13.174.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4649.14 via Frontend Transport; Tue, 2 Nov 2021 12:24:39 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 2 Nov 2021 12:24:34 +0000 From: Gregory Etelson To: , CC: , , , Xiaoyun Li Date: Tue, 2 Nov 2021 14:24:21 +0200 Message-ID: <20211102122421.4190-1-getelson@nvidia.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c2a1964c-e970-4be7-f879-08d99dfbbdc9 X-MS-TrafficTypeDiagnostic: BN7PR12MB2801: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: svYACwB9tie44mVcKfghfCo001DQTn8bs+J1zA4KeFaq4sNlRCnqf00uxVAiPhDjH8rArXUwxQIYlUBhvvoHk472Nw7oZXr5loWQ+fl6fy0AZNy47eqigOeBFVF2braGNWlDtXt3Z5gPx7LYN+8c5Y4ItBh08KgEDR8zAEdyDi9RlZff2J4LeglHL+Tc1Bei4w9EK11gujvmrbOtu3GsaZPhtY7jDnFdSJ4HecL8d3NTqOtibd6J8vtxo80DII93AmuccyPyDACJmVozhKXEEvYHHbmOjNqx3Pg1nKSFLLrt+AoKU4e+jpiCSasNm21KE4thydTGbxhbJr5898LT44kPTtHw6rv3byqHDvo7vZv21kGyNLZB4TjGnwmsgQKfoV2fXL3b9Q+QX8BAqhlMFFL/d4ATsBZ+TKJkADEFSjhHhpgFoGY0nIef6xe2Nx+4CzA2BhVEEpQs6R+auBhiOmTD5FIbqs3pYu3sA8surKPq4sHjYwWaJXLRcWN2pF3DhmFVcIrMnnI/+puPrqwTSaGqEcm8k0o4cHUPm4zEk+p+ROB1bQMMI1V1T5tLDsqO9Jhl/OUTXEWDPZuUvGBZ81Yh3d+yHjjDMI7WcU+z1/A0WWh282rfU8aqqfRcAmW09mrLMWvy2MXiV23jT06F9pED8VWNwUwmT1o7U7RJWtjH5UzbXgZT+DnQryqjQrJhGoCZcnOMJx18RDPblSwQbA== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(336012)(7049001)(426003)(8676002)(26005)(316002)(110136005)(4326008)(5660300002)(83380400001)(54906003)(8936002)(36756003)(186003)(508600001)(55016002)(7636003)(70206006)(356005)(82310400003)(2906002)(7696005)(70586007)(86362001)(47076005)(6666004)(1076003)(2616005)(36860700001)(6286002)(16526019); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2021 12:24:39.4948 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c2a1964c-e970-4be7-f879-08d99dfbbdc9 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT065.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2801 Subject: [dpdk-dev] [PATCH] app/testpmd: fix tunnel offload validation 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 Sender: "dev" Tunnel offload API allows application to restore packet to its original form if chain of flows missed after DECAP action. The main idea of the tunnel offload API was to query port PMD to provide flow elements - actions or items. Flow elements supplied by PMD are merged with original flow rule elements provided by testpmd operator to create a new flow rule, optimal for PMD, to implement the tunnel offload API. That flow rule transformation is hidden form testpmd operator and uses internal testpmd resources. Current testpmd did not release tunnel offload resources if flow rule validation failed. The patch always releases tunnel offload resources after flow rule validation returns. Cc: stable@dpdk.org Fixes: 1b9f274623b8 ("app/testpmd: add commands for tunnel offload") Signed-off-by: Gregory Etelson --- app/test-pmd/config.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index a18871d461..4870aaeba6 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2011,6 +2011,7 @@ port_flow_validate(portid_t port_id, struct rte_flow_error error; struct port_flow_tunnel *pft = NULL; struct rte_port *port; + int ret; if (port_id_is_invalid(port_id, ENABLED_WARN) || port_id == (portid_t)RTE_PORT_ALL) @@ -2037,10 +2038,11 @@ port_flow_validate(portid_t port_id, if (pft->actions) actions = pft->actions; } - if (rte_flow_validate(port_id, attr, pattern, actions, &error)) - return port_flow_complain(&error); + ret = rte_flow_validate(port_id, attr, pattern, actions, &error); if (tunnel_ops->enabled) port_flow_tunnel_offload_cmd_release(port_id, tunnel_ops, pft); + if (ret) + return port_flow_complain(&error); printf("Flow rule validated\n"); return 0; } -- 2.33.1