From patchwork Mon Apr 16 12:32:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Scheurich X-Patchwork-Id: 898617 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; dmarc=fail (p=none dis=none) header.from=ericsson.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ericsson.com header.i=@ericsson.com header.b="dbh/SsTs"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ericsson.com header.i=@ericsson.com header.b="UTIISr/8"; 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 40Pnqg2sMwz9s1R for ; Mon, 16 Apr 2018 22:33:51 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id EE017E23; Mon, 16 Apr 2018 12:32:46 +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 F294FD97 for ; Mon, 16 Apr 2018 12:32:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from sessmg23.ericsson.net (sessmg23.ericsson.net [193.180.251.45]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id E52CE671 for ; Mon, 16 Apr 2018 12:32:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1523881963; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=kwFZdBrDUMMfOPdGnhAZBLapnFPB7IZe4S5gLyeq868=; b=dbh/SsTsNHSRre2tgFa3/bVkmAGFgzFMyM8eErZGt00AgXhDa4bXaexedvHKvi5J 0vEcYR7dyj4GyMIkVOYf7w4WAh+UU1M/Go7zK08re4KPlVQhy211WPdKZ8Zb2bf/ I/AnCorc/x/exhO1G3rxPZ/ZfamuBD8Xs4lTPRMQpdk=; X-AuditID: c1b4fb2d-82dff70000003563-07-5ad497ea044f Received: from ESESSHC001.ericsson.se (Unknown_Domain [153.88.183.21]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id 03.1A.13667.AE794DA5; Mon, 16 Apr 2018 14:32:43 +0200 (CEST) Received: from ESESBMR503.ericsson.se (153.88.183.135) by ESESSHC001.ericsson.se (153.88.183.21) with Microsoft SMTP Server (TLS) id 14.3.382.0; Mon, 16 Apr 2018 14:32:34 +0200 Received: from ESESBMB502.ericsson.se (153.88.183.169) by ESESBMR503.ericsson.se (153.88.183.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26; Mon, 16 Apr 2018 14:32:33 +0200 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (153.88.183.157) by ESESBMB502.ericsson.se (153.88.183.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26 via Frontend Transport; Mon, 16 Apr 2018 14:32:33 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=vM/M9MRiWPMKB4o38xhzvMtCzCO0Wr5srC8UH7TVBgE=; b=UTIISr/8Ah8rM7F5I6Per/O9TDxAzeU6/qZJZRWPwzLmHyxUpifwtBfWbm4mez6Wdd5BRQsfSA05vVQYr+i/jCCksiOuAEmpHTSC/umX0vYROpw+jTFD9S1eVJhuziKP9rpbA1F225XrHzcPdUrfA4r1Z03GEriYi1g7mMYYl4I= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jan.scheurich@ericsson.com; Received: from ubuntu.eed.ericsson.se (129.192.10.2) by AM2PR07MB0643.eurprd07.prod.outlook.com (2a01:111:e400:840f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.675.10; Mon, 16 Apr 2018 12:32:31 +0000 From: Jan Scheurich To: Date: Mon, 16 Apr 2018 14:32:12 +0200 Message-ID: <1523881933-24485-2-git-send-email-jan.scheurich@ericsson.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1523881933-24485-1-git-send-email-jan.scheurich@ericsson.com> References: <1523881933-24485-1-git-send-email-jan.scheurich@ericsson.com> MIME-Version: 1.0 X-Originating-IP: [129.192.10.2] X-ClientProxiedBy: HE1PR05CA0354.eurprd05.prod.outlook.com (2603:10a6:7:92::49) To AM2PR07MB0643.eurprd07.prod.outlook.com (2a01:111:e400:840f::19) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM2PR07MB0643; X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0643; 3:+yb2yOdyTVew2tSM+0rEtRLxCSgE6OXQM513KBA+1tWho9sYkPdFt+Xe8jNnZILZ4USPE0iOFGnFn3vvu/rT6jF8gMIooYL96YTckG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YprXNGKH7Na2x4myVq3OxMaWViXpKYVHj5bZ3jJQQ47H/4mH4nQDcqVijw7q3oKVfaNJyLiIoHglij9lnaOOnq0S+rpC2pE2/7wYpPRA8g7/gg/q46Xo8C6FGfPmsHFza+ivHmtExMZOgI/pJQf2mQEufoWytH3mLhgnjsS3W7TIIF/5NU6hB4F53AiwR54OwFa5fwWZ39yR8g7tRpWZBbtDo55YpIWljNNb97KCecT7ks3cqK6VkjpH01QrZxR+gdS; 4:taZT7YPPEdKmQaE1cakL6gCWEqG8Y6G0JRoTLxGywW/5MwJ0Rjsw5Hw2LmAXD9vqGHucbFy1kprWYeUOfm1Oxvdt8xtwxvbL3Gvga0nnsRYOilkbsJzIDilqTu4MFEtb/a4hkhzwPNNsVCQyrYA+Zdw0ocwBJIeft+etxzZ2g/GsQBd6avShZZPl3WJethNYVLbIugkQAi+mxQGQ0baIhIKYKAJprxmSLeUqiuJBoHufcHzWGvutsUVOQYOulH729sdRgFzDNxCtJhs9u8qDTDEbFfm9rSRvK4NVT/a5m5q+QevcTFJyF1BkYoVjYf93 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(37575265505322); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231232)(944501327)(52105095)(10201501046)(3002001)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:AM2PR07MB0643; BCL:0; PCL:0; RULEID:; SRVR:AM2PR07MB0643; X-Forefront-PRVS: 0644578634 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(376002)(346002)(396003)(366004)(199004)(189003)(476003)(86362001)(6916009)(16526019)(186003)(2906002)(2361001)(956004)(2616005)(478600001)(305945005)(4326008)(7736002)(47776003)(6116002)(25786009)(3846002)(446003)(2351001)(11346002)(6666003)(107886003)(50226002)(36756003)(52116002)(6486002)(8676002)(81156014)(66066001)(6506007)(386003)(106356001)(59450400001)(68736007)(51416003)(81166006)(76176011)(8936002)(316002)(97736004)(53936002)(486006)(50466002)(5660300001)(26005)(16586007)(6512007)(105586002)(48376002)(44832011); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR07MB0643; H:ubuntu.eed.ericsson.se; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR07MB0643; 23:FdCWxRCZRNict/kZp3qfT7tMoPhFO6tlbNSX7tip/?= 5a2tPhmier5MAjV+95rmAakWZexNxL2t7VYmfj24y8Jbq82QT1EBBnHQcz7xzRl67TOK86dr7DREizdCmLtUr8h0CZ8gE7Yy4Ga4MdEr3p6jottCRQ8CpXhHdWVoPMUp0oIw/Seu1WW/DygXK+/gHa5/em1cRXXb9q4C/y1I46s+TaVGHynymYBiY443NJVwnaR9XoqP3IO19MeMa82DdDHvjwtdxvqtoBcANTpxwbLysj4MP1gBHr2RYO0d7Y2/BiXUb1KhDorJIcwym6pF/BXyVrfYIppSQAzhEyY3wEh8FjDSz1mifBfGdm7U3VidWkuqErv0KN9kiomhsHU+Kx/BOtSUdQW6b2QwXsbntyFYGrZvFAPAWLEnzV/kEAxS5FH97utEM1aAgj2ZBgLZ2zr4b8MrVypeiyy4oWv5b4NCBi3GgY4Tk/ywKM4KS6Per2Feqr5NLg0hJwzjkOGhyPjyIZB46usrkUdAyLkPzhlHPg/O2APcbNS178ZpbC6C2ZemGxETlQGiHDWaYzauPfqzoYzutjDM7dvpDBxJdzyMspdVP6APzKyuPrRkIEv1BnD3WUpWEWBqiI5SU21ARWh2+mLd3ZVQAk6z2BeZ8Lu/zat0samHUWbjv6yictTKXuiuSV36QszAoBo+SiAaFu47CUoidLBBp7hJPFeUpcrjkQcrpIR+92jZWs3Qu6uJgME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aD75JhHo99XDixS7108+GuED+66Ua1mPQN8GXtF9WV/+Na8Vb4s5c2ixTmNIQCXxEvjZcOtN7yPHbqNnVRFeE/z77yG9dvxprfHJ3wcg0v90B12kK5kcYVYjJtVsE/s6FcgHpfQC0SwhJU3FYnWxixPtRuxRjU/kmHxkQeMo3mJGwdPTfM4BMEkKnwfqPMQQA==; 5:ryEr95Q0SgQPmKsCP4jR4B6uZlUTX6/l3SLz9aTl0jID0Pgz+z6o4Z27W3VMpwgLUUt5PbB5VsHsElmnOnNAScAODgnopW7XjdLxQry9/Hi5FUtegTp3N6F+xbiJ/RzRvTqd/ZYyjJJYdf2OPbkKtmAPZz3CXrIWVMZxOpDklbI=; 24:k6QVgWo6kNsUbbiL4Thp4i29z2VCxepKqvrwAkpdfAk5yX3DqCjblPgCbd8W2swhC0yCTHNQfr+h22Zy0C+8qb9Rj7YVAGUb1ZQiw9OMYHc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM2PR07MB0643; 7:JRAQ5G4GTKxseKQdBZt7qBbvCRCip/DG//r2wWV9/iBmI124A/PM4n5MBtQtCUB/kLOtF0qQaT5evYr5Je7z+yMrFOY6tfMUD2V++vAAZ6UN7z1M9ak5U1sOme7ALMZznAKXiIs6XlGU3/Lm9Vbod5wxwfQ7F7ye1oF2AJ3GoEuO1e3K/SOKDWYgFyK/ZOsDJt1UHy01T3IKVfEuqpBZOdn2HL2KCMb+A0dBFoPJ4RsjcIDuglf39QJJ1BK/gH6e X-MS-Office365-Filtering-Correlation-Id: 73dec779-876c-4320-89e3-08d5a3961fdc X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Apr 2018 12:32:31.3368 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 73dec779-876c-4320-89e3-08d5a3961fdc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR07MB0643 X-OriginatorOrg: ericsson.com X-Brightmail-Tracker: H4sIAAAAAAAAA02SbUhTYRiGec85247DxfGk9OQXNojAdK4s0BBRxM8gNSpiEDryoOacuqMj +1H7YQgzSjER57RClqLgV0urGeKalqSl5DSzUsPSXFAZw/ld85zAf/fz3tfzcP14SZx2Eb5k rrqY0aiVKqlQTNRd7PUJddROKOTvB/GI5Wodihh83YdHbDh7sBg8qanvO5b0bXoHJS1O3iLS cIU4KotR5WoZTVh0pjhnbRIKn4dcNQ7dEemQM0CPPEigTkDH8gyuR2KSpmwI+h/ZCXdBU2YE T7/Ec8Uqgkr9J4wbTBiUG97gboqgVjCYq/JyZ0RdgrLHNTxUgcGM3oD0iCSFlBzqLTFuxps6 CNtNZqE749QFaFmwIXfeT6XDnOOXiLt5GGZbGnbfJVQKrLX9EXCqgTA8VL2bPajTUDE9inOm KeCa3+R5LxiuWyC4+wADS0s4txsEXeY6wu0GVC2C3qkPAm75CGxZnQQHBcDgqJGHehAYP3ci btCJYGzRwVPB0Gi08IVLCM4Hv3m/PLj7w8xDp8CxvspDJhyat27zIv4wVa7jF8YFsNGeXIlk hj3uhj3u9xHWinxYhmXzs4+HyxhN7mWWLVDL1ExxN/r3HwbMG6FPUJsj1oooEkk9JYn6CQUt UGrZ0nwrAhKXekseKt8paEmWsvQaoynI0JSoGNaK/EhCekAia+1T0FS2spjJY5hCRvO/xUgP Xx0Ky7JvLnf0d9Oz6Tvr9QL7KziaWpMTQqxoVSPD6ijLyyK/e1RUdOy+9CuJNu24eSiy+UWZ KaDTNdJlF50/5G/8SC/FBSbb/M7EnUtQecrlTq+bWyV5X8N76emM8bHtINP1zJ+R9aJnqf4Z DWcb3262x89np6UE3ShKP6lOsFRJCTZHeSwY17DKvyEz6WALAwAA X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 Subject: [ovs-dev] [PATCH branch-2.8 1/2] xlate: Correct handling of double encap() actions 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 When the same encap() header was pushed twice onto a packet (e.g in the case of NSH in NSH), the translation logic only generated a datapath push action for the first encap() action. The second encap() did not emit a push action because the packet type was unchanged. commit_encap_decap_action() (renamed from commit_packet_type_change) must solely rely on ctx->pending_encap to generate an datapath push action. Similarly, the first decap() action on a double header packet does not change the packet_type either. Add a corresponding ctx->pending_decap flag and use that to trigger emitting a datapath pop action. Fixes: f839892a2 ("OF support and translation of generic encap and decap") Fixes: 1fc11c594 ("Generic encap and decap support for NSH") Signed-off-by: Jan Scheurich --- lib/odp-util.c | 16 ++++++---------- lib/odp-util.h | 1 + ofproto/ofproto-dpif-xlate.c | 7 ++++++- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/odp-util.c b/lib/odp-util.c index 7f42b98..78cc903 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -6883,17 +6883,13 @@ odp_put_encap_nsh_action(struct ofpbuf *odp_actions, } static void -commit_packet_type_change(const struct flow *flow, +commit_encap_decap_action(const struct flow *flow, struct flow *base_flow, struct ofpbuf *odp_actions, struct flow_wildcards *wc, - bool pending_encap, + bool pending_encap, bool pending_decap, struct ofpbuf *encap_data) { - if (flow->packet_type == base_flow->packet_type) { - return; - } - if (pending_encap) { switch (ntohl(flow->packet_type)) { case PT_ETH: { @@ -6918,7 +6914,7 @@ commit_packet_type_change(const struct flow *flow, * The check is done at action translation. */ OVS_NOT_REACHED(); } - } else { + } else if (pending_decap || flow->packet_type != base_flow->packet_type) { /* This is an explicit or implicit decap case. */ if (pt_ns(flow->packet_type) == OFPHTN_ETHERTYPE && base_flow->packet_type == htonl(PT_ETH)) { @@ -6957,14 +6953,14 @@ commit_packet_type_change(const struct flow *flow, enum slow_path_reason commit_odp_actions(const struct flow *flow, struct flow *base, struct ofpbuf *odp_actions, struct flow_wildcards *wc, - bool use_masked, bool pending_encap, + bool use_masked, bool pending_encap, bool pending_decap, struct ofpbuf *encap_data) { enum slow_path_reason slow1, slow2; bool mpls_done = false; - commit_packet_type_change(flow, base, odp_actions, wc, - pending_encap, encap_data); + commit_encap_decap_action(flow, base, odp_actions, wc, + pending_encap, pending_decap, encap_data); commit_set_ether_action(flow, base, odp_actions, wc, use_masked); /* Make packet a non-MPLS packet before committing L3/4 actions, * which would otherwise do nothing. */ diff --git a/lib/odp-util.h b/lib/odp-util.h index 27c2ab4..9d6cc45 100644 --- a/lib/odp-util.h +++ b/lib/odp-util.h @@ -278,6 +278,7 @@ enum slow_path_reason commit_odp_actions(const struct flow *, struct flow_wildcards *wc, bool use_masked, bool pending_encap, + bool pending_decap, struct ofpbuf *encap_data); /* ofproto-dpif interface. diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 3890b2e..54fd06c 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -241,6 +241,8 @@ struct xlate_ctx { * true. */ bool pending_encap; /* True when waiting to commit a pending * encap action. */ + bool pending_decap; /* True when waiting to commit a pending + * decap action. */ struct ofpbuf *encap_data; /* May contain a pointer to an ofpbuf with * context for the datapath encap action.*/ @@ -3537,8 +3539,9 @@ xlate_commit_actions(struct xlate_ctx *ctx) ctx->xout->slow |= commit_odp_actions(&ctx->xin->flow, &ctx->base_flow, ctx->odp_actions, ctx->wc, use_masked, ctx->pending_encap, - ctx->encap_data); + ctx->pending_decap, ctx->encap_data); ctx->pending_encap = false; + ctx->pending_decap = false; ofpbuf_delete(ctx->encap_data); ctx->encap_data = NULL; } @@ -6067,6 +6070,7 @@ xlate_generic_decap_action(struct xlate_ctx *ctx, break; } ctx->wc->masks.nsh.np = UINT8_MAX; + ctx->pending_decap = true; /* Trigger recirculation. */ return true; default: @@ -6922,6 +6926,7 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout) .in_action_set = false, .in_packet_out = xin->in_packet_out, .pending_encap = false, + .pending_decap = false, .encap_data = NULL, .table_id = 0,