From patchwork Mon Dec 4 08:47:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Deep Ajmera X-Patchwork-Id: 844153 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ericsson.onmicrosoft.com header.i=@ericsson.onmicrosoft.com header.b="DOx8vqF7"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yqz6B3NNJz9s74 for ; Mon, 4 Dec 2017 19:47:46 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id BC88E8F5; Mon, 4 Dec 2017 08:47:44 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 8F98D5AA for ; Mon, 4 Dec 2017 08:47:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from sessmg22.ericsson.net (sessmg22.ericsson.net [193.180.251.58]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 65F8F271 for ; Mon, 4 Dec 2017 08:47:41 +0000 (UTC) X-AuditID: c1b4fb3a-3edff70000003538-d9-5a250babb57d Received: from ESESSHC005.ericsson.se (Unknown_Domain [153.88.183.33]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id 43.57.13624.BAB052A5; Mon, 4 Dec 2017 09:47:39 +0100 (CET) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.33) with Microsoft SMTP Server (TLS) id 14.3.352.0; Mon, 4 Dec 2017 09:47:38 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.onmicrosoft.com; s=selector1-ericsson-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Figgjf4Boe8vUQUMpFBVTD2s6BGLqClDVh1HOFVZD9M=; b=DOx8vqF7FSECUJdK4xnNbfWv2dD/h7xkDPIQMTWJAmJduVinO4jBNpTsnKZT2einJLf9/5CBJTUyntmIHFVHYNw7MN0VA7WN4m9gvwKTHVCejqJuI7u3KfkIbKl1j7lbXbMexq1mICdVCWv+RSvCb/yIZPPW1DnpnC3h6RLdJoc= Received: from AM5PR0701MB2961.eurprd07.prod.outlook.com (10.168.156.135) by AM5PR0701MB2962.eurprd07.prod.outlook.com (10.168.156.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.2; Mon, 4 Dec 2017 08:47:38 +0000 Received: from AM5PR0701MB2961.eurprd07.prod.outlook.com ([fe80::4973:a9b1:5e22:2e0e]) by AM5PR0701MB2961.eurprd07.prod.outlook.com ([fe80::4973:a9b1:5e22:2e0e%17]) with mapi id 15.20.0302.006; Mon, 4 Dec 2017 08:47:38 +0000 From: Vishal Deep Ajmera To: "dev@openvswitch.org" Thread-Topic: [PATCH] ofproto-dpif-xlate: Incorrect handling of errors in group action processing Thread-Index: AdNs2/vKzS4GxFHkTzW98amblG8nLg== Date: Mon, 4 Dec 2017 08:47:38 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=vishal.deep.ajmera@ericsson.com; x-originating-ip: [125.16.128.122] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM5PR0701MB2962; 6:bTINRFi5+iOA1wEmR78SXxrPeD0hdMu0akubXSvfGVLuTSEVTMq5YeIlU8X58MvNrYMJLJv7AeRf4NSFkwC11D1YysDU6tcAIw5nrkJR5h6VwAOJjvctBfXdlgUIopX61Z2PRWwjhhcaxyAxMjQneKiDhQyuOAOqY/1BxZW9/Sf+s1ib4Jy64fkyDjY6Tb6sDLu3HImS1bSCW/ynn5cNiugbS7QMPkCoPfWdBWdlYfm3H8YQv5FmyTWE9Aj7sEM9Z80mD9uf4pIFjWXWJ0pCboP6E3r418N6bqNfBC0ydin5rHRkwEOJHyBtD6jLrSqI0W6EsBabPMTu6j1115J3NPClf6xbvpLxk6UwyLjejT8=; 5:EbJv1sfRgT85seRphzRZ1acGTIpSDAhAgFfOvO+TIxQUOMWRVyjfTqm31nepEoPygJkQU/Mob+JbI7XBk/TlCthy33q85S1NCzcmaSnmLTWAcil9HmxC8UKLy4SCiU4cav4lD+HRDs326rIlPwJ3NMWyRq1/GMrzA7ATQsGfRkk=; 24:yZkgW56psb1GcquscIRaUgOX3im2lJq+EcuXhu7cQGHa++WTucgfIaTJ39McKInaTtH11MPkPdJhTV2oYYANihEcZ7bO6ew2t8382BwOCvg=; 7:mBzd78skyXnClqODhcRC406X/5vPEBj4NEfsb4uHjnOdY3acpFoY+POrQ4x/jGjoLXoKEU49WsGOAd8HDNEcS7XoX/dOjQVUv5uTJ3TJim61QuwReTqH8WW1PG8LRWR1XzfAnDiiTMjU9Z4Zc8cBGwlVXtLt73e1y4wW6IcsMcRXLG1W0H3An2kNO/KGPD4WwQxfE5r4CqKF1AQ2hiSmAtYQiH9PDGqCKEPqHxQWmFAmGkkE79MowABVxO50ndRU x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: d49ac9b2-7b30-4f29-cd59-08d53af3ac30 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(2017052603286); SRVR:AM5PR0701MB2962; x-ms-traffictypediagnostic: AM5PR0701MB2962: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(37575265505322)(227612066756510)(21748063052155); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(3231022)(10201501046)(3002001)(93006095)(93001095)(6041248)(20161123562025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(6072148)(201708071742011); SRVR:AM5PR0701MB2962; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM5PR0701MB2962; x-forefront-prvs: 051158ECBB x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(366004)(346002)(39860400002)(199003)(189002)(2906002)(3280700002)(19609705001)(3660700001)(106356001)(54356011)(81156014)(81166006)(1730700003)(33656002)(5660300001)(2501003)(5250100002)(2900100001)(97736004)(6916009)(66066001)(6506006)(316002)(6306002)(54896002)(101416001)(6436002)(86362001)(6116002)(102836003)(790700001)(230783001)(55016002)(3846002)(9686003)(14454004)(53936002)(8936002)(5640700003)(2351001)(99286004)(7696005)(5630700001)(478600001)(74316002)(8676002)(105586002)(7736002)(25786009)(68736007)(55236003)(189998001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0701MB2962; H:AM5PR0701MB2961.eurprd07.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: d49ac9b2-7b30-4f29-cd59-08d53af3ac30 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Dec 2017 08:47:38.1886 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0701MB2962 X-OriginatorOrg: ericsson.com X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprPKsWRmVeSWpSXmKPExsUyM2K7ou5qbtUogwcHNCyOnt7D7MDo8ezm f8YAxigum5TUnMyy1CJ9uwSujN//Z7IU/AuqWHv3P1sD41/3LkZODgkBE4ljf6YwdzFycQgJ HGaUWLTlPwuEc5xRYs/dKUwgDotAL7NE69ZudpAWIYG5TBL3+4Ihqp4xSuxf940FJMEmYCXx a0o/mC0ioC9xqOcsmC0sECfx+8groB0cQPFkiSdLpCBK9CQ29h1hArFZBFQkbjw8xAxi8wok SDTf2cEGYjMKiEl8P7UGrIZZQFzi1pP5TBBnC0gs2XOeGcIWlXj5+B8rRH2SxJstfxgh4koS m2e+gKqXlbg0v5sR5GYJgSPsEvOWP4Iq0pPYOvEtI8htEgK+Ek/3c0LUrGeUWLrvDlSNjsTL HZOgluVLrG9qgLKjJQ68eAg1dAmzxIOdS6ASMhKPnvVAJZ6zSuxvusYGCbpUieVrWxkhoSIl cfdKJ+MERq1ZSL6DsPMl1kz5DmbzCghKnJz5hAUiriOxYPcnNghbW2LZwtfMMPaZA4+ZkMUX MLKvYhQtTi0uzk03MtJLLcpMLi7Oz9PLSy3ZxAhMNge3/LbawXjwueMhRgEORiUeXnZm1Sgh 1sSy4srcQ4wSHMxKIrwODEAh3pTEyqrUovz4otKc1OJDjNIcLErivCc9eaOEBNITS1KzU1ML UotgskwcnFINjLZpazdpPbq/JOrald8TFttOylTfs0i4NGS78a8p317c0u25G8pw/WRc9R7R /6t8NbZpX5c93ZEv7fz1sGL65sdPDhR9EdxhdC/7gHh90UxRJqZL0qIyKz9NMD1S0dxW/nq3 qjWre9y7vNaPV/r3O/Y+do7/oT+r+PJ1/XV/rQQ1JwVf/y56zkOJpTgj0VCLuag4EQATttwS MgMAAA== X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HTML_MESSAGE, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Content-Filtered-By: Mailman/MimeDel 2.1.12 Subject: [ovs-dev] [PATCH] ofproto-dpif-xlate: Incorrect handling of errors in group action processing X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org As per OpenFlow v1.3 specification, when an action list contains a group action a copy of the packet is passed to the group for processing by the group. This means that if there is an error encountered during group processing, only the copy of packet should be dropped, but subsequent actions in the action list should be executed on the original packet. Additionally, if the group type is "ALL", each action bucket of the group should process a copy of the packet. If there is an error while processing one bucket other buckets should still be processed. Example 1: table=0,in_port=tap0 actions=output:tap1,group:10,output:tap2 Even if any error is encountered while processing the group action, the packet should still be forwarded to ports tap1 and tap2. Example 2: group_id=1,type=all,bucket=actions=output:tap1,bucket=actions=encap(eth) Even if processing the action in the second bucket fails because the packet already has an Ethernet header, the other copy of the packet should still be processed by the first bucket and output to port tap1. Currently the error handling in OVS does not comply with those rules. When any group bucket execution fails the error is recorded in the so-called "translation context" which is global for the processing of the original packet. Once an error is recorded, OVS skips processing subsequent buckets and installs a drop action in the datapath even if parts of the action list were previously processed successfully. This patch clears the error flag after any bucket of a group is executed. This way the error encountered in processing any bucket of the group will not impact other actions of action-list or other buckets of the group. Signed-off-by: Vishal Deep Ajmera Signed-off-by: Keshav Gupta --- ofproto/ofproto-dpif-xlate.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 1.9.1 diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index fcced34..7e6d423 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -4063,6 +4063,14 @@ xlate_group_bucket(struct xlate_ctx *ctx, struct ofputil_bucket *bucket, * the group bucket freezes translation, the actions after the group action * must continue processing with the original, not the frozen packet! */ ctx->exit = false; + + /* Context error in a bucket should not impact processing of other buckets + * or actions. This is similar to cloning a packet for group buckets. + * There is no need to restore the error back to old value due to the fact + * that we actually processed group action which can happen only when there + * is no previous context error. + */ + ctx->error = 0; } static void