From patchwork Tue Jul 3 15:15:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Keshav Gupta X-Patchwork-Id: 938439 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="MCIO1p0r"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ericsson.com header.i=@ericsson.com header.b="enQ/VIs3"; 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 41Kb3f0yLfz9s3C for ; Tue, 3 Jul 2018 17:14:52 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id C4448CD4; Tue, 3 Jul 2018 07:14:49 +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 17812C97 for ; Tue, 3 Jul 2018 07:14:49 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from sesbmg23.ericsson.net (sesbmg23.ericsson.net [193.180.251.37]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 41F17334 for ; Tue, 3 Jul 2018 07:14:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1530602085; 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=m1ZxZQAMp0p0olyoobvg+bwAA9/wNgB9YXSBXYEVAYU=; b=MCIO1p0ripZvGaWboxUhfwnJVu4zWEY2YEPEfFNL4YjgEhmZtnf54/olAZzIJMBV RkHlF0OIFzsnZkPA7zzpiYBhd4/zj013I9xKWKBiKaWPPizfpNLkWBrhxJk2+nWy SB1gNkpLPnb9jgOxoqIpOquFYEvStT0ASkmcXVXp36M=; X-AuditID: c1b4fb25-202c69c000006310-c7-5b3b22658150 Received: from ESESBMB501.ericsson.se (Unknown_Domain [153.88.183.114]) by sesbmg23.ericsson.net (Symantec Mail Security) with SMTP id 46.28.25360.5622B3B5; Tue, 3 Jul 2018 09:14:45 +0200 (CEST) Received: from ESESSMB505.ericsson.se (153.88.183.166) by ESESBMB501.ericsson.se (153.88.183.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Tue, 3 Jul 2018 09:14:44 +0200 Received: from EUR03-AM5-obe.outbound.protection.outlook.com (153.88.183.157) by ESESSMB505.ericsson.se (153.88.183.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Tue, 3 Jul 2018 09:14:44 +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:X-MS-Exchange-SenderADCheck; bh=25eO04u2i4vaqZqpfnjs55cqwZ16UxDjeReZfI89Oh4=; b=enQ/VIs3Lz6gGiKofsvDGF6f27giLSgPV7rgbzsahCZNeEntau44MELiCiXuFASR1lbyi+Ai2B2nHEVSaqFRwN/bJgRIcOymuZ+EciFvaWyDusgm0qsIarnp3ON70GGrkpZCj68lnhVwJn9R1bEJefs/15ivDyc2LBFxT6ReXXA= Received: from localhost.localdomain (125.16.128.122) by DB6PR07MB4232.eurprd07.prod.outlook.com (2603:10a6:6:51::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.16; Tue, 3 Jul 2018 07:14:39 +0000 From: Keshav Gupta To: Date: Tue, 3 Jul 2018 20:45:25 +0530 Message-Id: <1530630925-26177-1-git-send-email-keshav.gupta@ericsson.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [125.16.128.122] X-ClientProxiedBy: BM1PR01CA0088.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1::28) To DB6PR07MB4232.eurprd07.prod.outlook.com (2603:10a6:6:51::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 09734138-f07c-4b38-c600-08d5e0b4a4b3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:DB6PR07MB4232; X-Microsoft-Exchange-Diagnostics: 1; DB6PR07MB4232; 3:FImcks4kZKPwo4Hn8K9kxQmUpYSid9WosZWieGiLks/KA+MrJrLFlWXkdFhPrUGVQFD8mZsuOCi+OpEzybSKfhFotWPxb4Ff9QvDMPSOFz7/oJgurWNrClFR5yWwuBGoaIJUPaq+FJVRhlxQONzTGuWTiJDRuKJf+AVC77n+QStHN8KAkMembBKR8YGlqRQ4/nvVkFGKFKnHP1b6RV0/CeTZj6FIvxos5WQpN8ap2vwHxf6VOFLqLaDlnx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8fb1y7b87YAS5xnF1uqWUckoUaOjj7fP5ZJQ9RDpmDXjtpy0LWIA1fpEdWdNsghVNxs8IHm2uxeJ+uYQzsO23BdXvwal; 4:1xh3LcVR+gsy8logZd86bpQmDbZ2LZINZqIUSR9AGlt9ndIHpP1p44Dj1EKEF+ZuCBTHNSmcR0HI2C2MvpHqHp4WnlGd2boKwGQRIR2BrG/8xw1BuV4JeQGbmCx+vvHIW2u9OHK8obzOCTFqdyiX0EpqWfy9cPAKZGZqnUSYIP9WCVlmx9RUcquzcbbqXuE1EyS4+jwvDITXEQJYlg9DucSQC3s4CYTNpoXvb19ioN8563f7P4rXw5gwRx528sBeCl0Ef0nUgCtg4SO5dgNGS/8sUhxhTw+XFQiBhqzzfm5vPIrhMtfXQlilFgjC1ZjSh4m7F4NOflWLnCnfYhWFSjIryAcDGagQIcmZB54EbkA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(37575265505322)(85827821059158); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231277)(944501410)(52105095)(149027)(150027)(6041310)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:DB6PR07MB4232; BCL:0; PCL:0; RULEID:; SRVR:DB6PR07MB4232; X-Forefront-PRVS: 0722981D2A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(346002)(136003)(376002)(396003)(366004)(39860400002)(199004)(189003)(51234002)(23676004)(39060400002)(575784001)(1857600001)(8676002)(47776003)(54906003)(2906002)(50466002)(25786009)(316002)(14444005)(8936002)(4326008)(86362001)(6486002)(97736004)(66066001)(478600001)(55236004)(26005)(6666003)(106356001)(6916009)(81166006)(486006)(81156014)(6346003)(186003)(476003)(53936002)(2616005)(386003)(44832011)(2351001)(2361001)(6506007)(956004)(36756003)(7736002)(305945005)(52116002)(5660300001)(6512007)(16526019)(2870700001)(68736007)(105586002)(6116002)(50226002)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR07MB4232; H:localhost.localdomain; 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) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=keshav.gupta@ericsson.com; X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BDB6PR07MB4232=3B23=3AI+Mf?= =?utf-8?q?P3msfKOjy3EnIXhdjlcSBXhvweAOs72JX8ZoAy2lAvDChWfDp+Q72Ndu?= =?utf-8?q?XRMETLiVq52ZVhWSlpARyPfuaKs6ZW8IIIsKBDXXVk+od7GP0CPKYoBk?= =?utf-8?q?t28euq51lQ5nKuuZNi3ei3afazQs47ruXirfLPkBVitm/MbYBtO8tsb+?= =?utf-8?q?YboUi7oaMD78y+jnWAZIuIJgH5Zfrwq52Lchm7lV0Azy1+UTLlaBWSUv?= =?utf-8?q?gebkiKwWjPNzvibv6I8XhIBsYFey3VwrG27r8/0sEClfSHj3c1pvGbOg?= =?utf-8?q?/RKrnMhtl1dC5IAqi1cKYLGEw/jeXX1fIsV62hYDQMYjEQzjOQHQHsvP?= =?utf-8?q?dyuGCKgwBObawz2zJW7w2udFoUxzUDxsuNtBEu0TDojb3GsBLlV09AKX?= =?utf-8?q?azQqFWQD7yksc72eOegkbWtjcXMAq7resUmaTV5CpnkOGwrkWwT+Nog6?= =?utf-8?q?rzK8GSKSPvbg6HBcQ4IO9GMMawsGHpeyS8MbnU3jMhuHxb70ZTHCv20q?= =?utf-8?q?YKl3owvP96Alca9V9GMDBCst+S5MeUyiykq3MqzAmEGuxC/R9PvfA7wm?= =?utf-8?q?geFYkZgFD7WPN//Nl8O5XffEiYneo/HAT2i3r0JALlDiMXbAiGFHSq0z?= =?utf-8?q?bExPT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B4232; 7:gm1q/7da416hzHSYfi3gpc6AHJq6J06diocawTUAOTapmWmZNsTvzC3pZb9rdvQRMddle9Ep+MFoF9Amt3ytASrIcF2hP0cXgYMZj2RXdfJfVCJlNoLOBi7vSiEFJuSuxlvP9ut07skU0MoM/sVQLiA2IcxCHpmTB5e67y7zU0n808HJxhxM5HPlebltKw3KwTy93IOJ/eOCPLil6Si7eVV/jM1TZi+uamMLAYzgeKUHbpvdYeG/7jFIY/VXQwlA X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2018 07:14:39.6637 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 09734138-f07c-4b38-c600-08d5e0b4a4b3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR07MB4232 X-OriginatorOrg: ericsson.com X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNIsWRmVeSWpSXmKPExsUyM2J7kW6qknW0wcNmJYujp/cwWyz63cro wOSxc9Zddo9nN/8zBjBFcdmkpOZklqUW6dslcGXsOX6TqeB+N2PFnO+32BsYt2Z0MXJwSAiY SJw7o9XFyMUhJHCUUeLm7x+MEM5XRokbVz6xQTiLmSR2T/wL5rAITGCW2PVmMitEppVJYsPO H0xdjJwcbAJ6Eof73jCD2CICkhL/Fm9hA7GZBeIlLk1sAasRFvCVOH71JSuIzSKgKrF58mow m1fAU6Jjw0dGEFtCQE7i5LHJUHFBiZMzn7CA3MosoC6xfp4QxEh5ieats5khypUkdm2+zwxy j4TAFEaJP2f/s4PUCwmoSUx57wVRIytx9OwcFgjbV+LnvSZGiPqbjBJzbz9jg3Aa2CXuvO1j hajSkmh4O5UdIrGEXeLGjEZ2iES2xJM/e9ggbC+J1WuWw119qvccE0TDPmaJp1/boe6Tkehr WMoCkXjLKnFtdSNYt5BAqsSWGy1sExh1ZyF5dRbCq7OQvLqAkXkVo2hxanFSbrqRsV5qUWZy cXF+nl5easkmRmCSOLjlt+oOxstvHA8xCnAwKvHwMnJbRwuxJpYVV+YeYpTgYFYS4d2mahUt xJuSWFmVWpQfX1Sak1p8iFGag0VJnPeh+eYoIYH0xJLU7NTUgtQimCwTB6dUA2O+V3BDW9r0 FbM9PLbfVpssPNmuw8xbXl+Gd2Zg18llHky/LmtcX3fh+EXV5YHbvttp36lMOmlhqGY5r/ht noq7x3qXqT4Xq0TPblEWXynEpFQQ8dlZ6eYOqaXpD81+h/5cHLz1joqLnPKjk/KJ+1ouud8J PqH1yysh/4Vk/E+tzLL8OYHsS5VYijMSDbWYi4oTAepUpyEOAwAA X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_06_12, 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] ofproto-dpif-xlate: Fix packet_in reason for Table-miss rule 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 Currently in OvS if we hit "Table-miss" rules (associated with Controller action) then we send PACKET_IN message to controller with reason as OFPR_NO_MATCH. “Table-miss” rule is one whose priority is 0 and its catch all rule. But if we hit same "Table-miss" rule after executing group entry we will send the reason as OFPR_ACTION (for OF1.3 and below) and OFPR_GROUP (for OF1.4 and above). This is because once we execute group entry we set ctx->in_group and later when we hit the "Table-miss" rule, Since ctx->in_group is set we send reason as OFPR_ACTION (for OF1.3) and OFPR_GROUP (for OF1.4 and above). For eg: for the following pipeline, we will send the reason as OFPR_ACTION even if we hit The “Table-miss” rule. cookie=0x8000000, duration=761.189s, table=0, n_packets=1401, n_bytes=67954, priority=4,in_port=9,vlan_tci=0x0000/0x1fff actions=write_metadata:0x67870000000000/0xffffff0000000001,goto_table:17 cookie=0x6800001, duration=768.848s, table=17, n_packets=1418, n_bytes=68776, priority=10,metadata=0x67870000000000/0xffffff0000000000 actions=write_metadata:0xe067870000000000/0xfffffffffffffffe,goto_table:60 cookie=0x6800000, duration=24944.312s, table=60, n_packets=58244, n_bytes=2519520, priority=0 actions=resubmit(,17) cookie=0x8040000, duration=785.733s, table=17, n_packets=1450, n_bytes=69724, priority=10,metadata=0xe067870000000000/0xffffff0000000000 actions=write_metadata:0x67871d4d000000/0xfffffffffffffffe,goto_table:43 cookie=0x822002d, duration=24960.795s, table=43, n_packets=53097, n_bytes=2230074, priority=100,arp,arp_op=1 actions=group:6000 group_id=6000,type=all,bucket=actions=CONTROLLER:65535, bucket=actions=resubmit(,48), bucket=actions=resubmit(,81) cookie=0x8500000, duration=24977.323s, table=48, n_packets=58309, n_bytes=2522634, priority=0 actions=resubmit(,49),resubmit(,50) cookie=0x8050000, duration=24984.679s, table=50, n_packets=6, n_bytes=264, priority=0 actions=CONTROLLER:65535 Currently we are sending table_id as 50 and packet_in reason as OFPR_ACTION. Instead of sending packet_in reason as OFPR_NO_MATCH. Signed-off-by: Keshav Gupta Signed-off-by: Rohith Basavaraja --- ofproto/ofproto-dpif-xlate.c | 72 ++++++++++++++++++++++++++------------------ tests/ofproto-dpif.at | 38 +++++++++++++++++++++++ 2 files changed, 81 insertions(+), 29 deletions(-) diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index c02a032..0ce6823 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -528,12 +528,12 @@ static OVSRCU_TYPE(struct xlate_cfg *) xcfgp = OVSRCU_INITIALIZER(NULL); static struct xlate_cfg *new_xcfg = NULL; typedef void xlate_actions_handler(const struct ofpact *, size_t ofpacts_len, - struct xlate_ctx *, bool); + struct xlate_ctx *, bool, bool); static bool may_receive(const struct xport *, struct xlate_ctx *); static void do_xlate_actions(const struct ofpact *, size_t ofpacts_len, - struct xlate_ctx *, bool); + struct xlate_ctx *, bool, bool); static void clone_xlate_actions(const struct ofpact *, size_t ofpacts_len, - struct xlate_ctx *, bool); + struct xlate_ctx *, bool, bool); static void xlate_normal(struct xlate_ctx *); static void xlate_table_action(struct xlate_ctx *, ofp_port_t in_port, uint8_t table_id, bool may_packet_in, @@ -4104,7 +4104,7 @@ xlate_recursively(struct xlate_ctx *ctx, struct rule_dpif *rule, ctx->rule_cookie = rule->up.flow_cookie; actions = rule_get_actions(&rule->up); actions_xlator(actions->ofpacts, actions->ofpacts_len, ctx, - is_last_action); + is_last_action, false); ctx->rule_cookie = old_cookie; ctx->rule = old_rule; ctx->depth -= deepens; @@ -4279,7 +4279,7 @@ xlate_group_bucket(struct xlate_ctx *ctx, struct ofputil_bucket *bucket, ofpacts_execute_action_set(&action_list, &action_set); ctx->depth++; - do_xlate_actions(action_list.data, action_list.size, ctx, is_last_action); + do_xlate_actions(action_list.data, action_list.size, ctx, is_last_action, true); ctx->depth--; ofpbuf_uninit(&action_list); @@ -4958,7 +4958,8 @@ compose_dec_mpls_ttl_action(struct xlate_ctx *ctx) static void xlate_output_action(struct xlate_ctx *ctx, ofp_port_t port, uint16_t controller_len, bool may_packet_in, - bool is_last_action, bool truncate) + bool is_last_action, bool truncate, + bool group_bucket_action) { ofp_port_t prev_nf_output_iface = ctx->nf_output_iface; @@ -4986,7 +4987,7 @@ xlate_output_action(struct xlate_ctx *ctx, ofp_port_t port, case OFPP_CONTROLLER: xlate_controller_action(ctx, controller_len, (ctx->in_packet_out ? OFPR_PACKET_OUT - : ctx->in_group ? OFPR_GROUP + : group_bucket_action ? OFPR_GROUP : ctx->in_action_set ? OFPR_ACTION_SET : OFPR_ACTION), 0, NULL, 0); @@ -5016,7 +5017,8 @@ xlate_output_action(struct xlate_ctx *ctx, ofp_port_t port, static void xlate_output_reg_action(struct xlate_ctx *ctx, const struct ofpact_output_reg *or, - bool is_last_action) + bool is_last_action, + bool group_bucket_action) { uint64_t port = mf_get_subfield(&or->src, &ctx->xin->flow); if (port <= UINT16_MAX) { @@ -5027,7 +5029,8 @@ xlate_output_reg_action(struct xlate_ctx *ctx, memset(&value, 0xff, sizeof value); mf_write_subfield_flow(&or->src, &value, &ctx->wc->masks); xlate_output_action(ctx, u16_to_ofp(port), or->max_len, - false, is_last_action, false); + false, is_last_action, false, + group_bucket_action); } else { xlate_report(ctx, OFT_WARN, "output port %"PRIu64" is out of range", port); @@ -5037,7 +5040,8 @@ xlate_output_reg_action(struct xlate_ctx *ctx, static void xlate_output_trunc_action(struct xlate_ctx *ctx, ofp_port_t port, uint32_t max_len, - bool is_last_action) + bool is_last_action, + bool group_bucket_action) { bool support_trunc = ctx->xbridge->support.trunc; struct ovs_action_trunc *trunc; @@ -5074,7 +5078,8 @@ xlate_output_trunc_action(struct xlate_ctx *ctx, OVS_ACTION_ATTR_TRUNC, sizeof *trunc); trunc->max_len = max_len; - xlate_output_action(ctx, port, 0, false, is_last_action, true); + xlate_output_action(ctx, port, 0, false, is_last_action, true, + group_bucket_action); if (!support_trunc) { ctx->xout->slow |= SLOW_ACTION; } @@ -5088,7 +5093,8 @@ xlate_output_trunc_action(struct xlate_ctx *ctx, static void xlate_enqueue_action(struct xlate_ctx *ctx, const struct ofpact_enqueue *enqueue, - bool is_last_action) + bool is_last_action, + bool group_bucket_action) { ofp_port_t ofp_port = enqueue->port; uint32_t queue_id = enqueue->queue; @@ -5100,7 +5106,8 @@ xlate_enqueue_action(struct xlate_ctx *ctx, if (error) { /* Fall back to ordinary output action. */ xlate_output_action(ctx, enqueue->port, 0, false, - is_last_action, false); + is_last_action, false, + group_bucket_action); return; } @@ -5163,7 +5170,8 @@ slave_enabled_cb(ofp_port_t ofp_port, void *xbridge_) static void xlate_bundle_action(struct xlate_ctx *ctx, const struct ofpact_bundle *bundle, - bool is_last_action) + bool is_last_action, + bool group_bucket_action) { ofp_port_t port; @@ -5173,7 +5181,7 @@ xlate_bundle_action(struct xlate_ctx *ctx, nxm_reg_load(&bundle->dst, ofp_to_u16(port), &ctx->xin->flow, ctx->wc); xlate_report_subfield(ctx, &bundle->dst); } else { - xlate_output_action(ctx, port, 0, false, is_last_action, false); + xlate_output_action(ctx, port, 0, false, is_last_action, false, group_bucket_action); } } @@ -5472,7 +5480,8 @@ reversible_actions(const struct ofpact *ofpacts, size_t ofpacts_len) static void clone_xlate_actions(const struct ofpact *actions, size_t actions_len, - struct xlate_ctx *ctx, bool is_last_action) + struct xlate_ctx *ctx, bool is_last_action, + bool group_bucket_action OVS_UNUSED) { struct ofpbuf old_stack = ctx->stack; union mf_subvalue new_stack[1024 / sizeof(union mf_subvalue)]; @@ -5489,7 +5498,7 @@ clone_xlate_actions(const struct ofpact *actions, size_t actions_len, if (reversible_actions(actions, actions_len) || is_last_action) { old_flow = ctx->xin->flow; - do_xlate_actions(actions, actions_len, ctx, is_last_action); + do_xlate_actions(actions, actions_len, ctx, is_last_action, false); if (!ctx->freezing) { xlate_action_set(ctx); } @@ -5513,7 +5522,7 @@ clone_xlate_actions(const struct ofpact *actions, size_t actions_len, if (ctx->xbridge->support.clone) { /* Use clone action */ /* Use clone action as datapath clone. */ offset = nl_msg_start_nested(ctx->odp_actions, OVS_ACTION_ATTR_CLONE); - do_xlate_actions(actions, actions_len, ctx, true); + do_xlate_actions(actions, actions_len, ctx, true, false); if (!ctx->freezing) { xlate_action_set(ctx); } @@ -5529,7 +5538,7 @@ clone_xlate_actions(const struct ofpact *actions, size_t actions_len, offset = nl_msg_start_nested(ctx->odp_actions, OVS_ACTION_ATTR_SAMPLE); ac_offset = nl_msg_start_nested(ctx->odp_actions, OVS_SAMPLE_ATTR_ACTIONS); - do_xlate_actions(actions, actions_len, ctx, true); + do_xlate_actions(actions, actions_len, ctx, true, false); if (!ctx->freezing) { xlate_action_set(ctx); } @@ -5576,7 +5585,7 @@ compose_clone(struct xlate_ctx *ctx, const struct ofpact_nest *oc, { size_t oc_actions_len = ofpact_nest_get_action_len(oc); - clone_xlate_actions(oc->actions, oc_actions_len, ctx, is_last_action); + clone_xlate_actions(oc->actions, oc_actions_len, ctx, is_last_action, false); } static void @@ -5658,7 +5667,7 @@ xlate_action_set(struct xlate_ctx *ctx) struct ovs_list *old_trace = ctx->xin->trace; ctx->xin->trace = xlate_report(ctx, OFT_TABLE, "--. Executing action set:"); - do_xlate_actions(action_list.data, action_list.size, ctx, true); + do_xlate_actions(action_list.data, action_list.size, ctx, true, false); ctx->xin->trace = old_trace; ctx->in_action_set = false; @@ -5901,7 +5910,7 @@ compose_conntrack_action(struct xlate_ctx *ctx, struct ofpact_conntrack *ofc, ctx->wc->masks.ct_mark = 0; ctx->wc->masks.ct_label = OVS_U128_ZERO; do_xlate_actions(ofc->actions, ofpact_ct_get_action_len(ofc), ctx, - is_last_action); + is_last_action, false); if (ofc->zone_src.field) { zone = mf_get_subfield(&ofc->zone_src, &ctx->xin->flow); @@ -6313,7 +6322,8 @@ xlate_ofpact_unroll_xlate(struct xlate_ctx *ctx, static void do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len, - struct xlate_ctx *ctx, bool is_last_action) + struct xlate_ctx *ctx, bool is_last_action, + bool group_bucket_action) { struct flow_wildcards *wc = ctx->wc; struct flow *flow = &ctx->xin->flow; @@ -6362,7 +6372,7 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len, case OFPACT_OUTPUT: xlate_output_action(ctx, ofpact_get_OUTPUT(a)->port, ofpact_get_OUTPUT(a)->max_len, true, last, - false); + false, group_bucket_action); break; case OFPACT_GROUP: @@ -6393,7 +6403,8 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len, case OFPACT_ENQUEUE: memset(&wc->masks.skb_priority, 0xff, sizeof wc->masks.skb_priority); - xlate_enqueue_action(ctx, ofpact_get_ENQUEUE(a), last); + xlate_enqueue_action(ctx, ofpact_get_ENQUEUE(a), last, + group_bucket_action); break; case OFPACT_SET_VLAN_VID: @@ -6609,16 +6620,19 @@ do_xlate_actions(const struct ofpact *ofpacts, size_t ofpacts_len, break; case OFPACT_BUNDLE: - xlate_bundle_action(ctx, ofpact_get_BUNDLE(a), last); + xlate_bundle_action(ctx, ofpact_get_BUNDLE(a), last, + group_bucket_action); break; case OFPACT_OUTPUT_REG: - xlate_output_reg_action(ctx, ofpact_get_OUTPUT_REG(a), last); + xlate_output_reg_action(ctx, ofpact_get_OUTPUT_REG(a), last, + group_bucket_action); break; case OFPACT_OUTPUT_TRUNC: xlate_output_trunc_action(ctx, ofpact_get_OUTPUT_TRUNC(a)->port, - ofpact_get_OUTPUT_TRUNC(a)->max_len, last); + ofpact_get_OUTPUT_TRUNC(a)->max_len, last, + group_bucket_action); break; case OFPACT_LEARN: @@ -7285,7 +7299,7 @@ xlate_actions(struct xlate_in *xin, struct xlate_out *xout) } mirror_ingress_packet(&ctx); - do_xlate_actions(ofpacts, ofpacts_len, &ctx, true); + do_xlate_actions(ofpacts, ofpacts_len, &ctx, true, false); if (ctx.error) { goto exit; } diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at index d798925..caa9b43 100644 --- a/tests/ofproto-dpif.at +++ b/tests/ofproto-dpif.at @@ -3421,6 +3421,44 @@ OFPST_FLOW reply (OF1.4): OVS_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.3)]) + +OVS_VSWITCHD_START([dnl + set bridge br0 datapath_type=dummy \ + protocols=OpenFlow10,OpenFlow13,OpenFlow14,OpenFlow15 -- \ + add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1]) + +AT_CHECK([ + ovs-ofctl -OOpenFlow13 del-flows br0 + ovs-ofctl -OOpenFlow13 add-group br0 "group_id=6000,type=all,bucket=actions=controller,bucket=actions=resubmit(,48),bucket=actions=resubmit(,81)" + ovs-ofctl -OOpenFlow13 add-flow br0 "table=0, in_port=1, vlan_tci=0x0000/0x1fff actions=write_metadata:0x67870000000000/0xffffff0000000001,goto_table:17" + ovs-ofctl -OOpenFlow13 add-flow br0 "table=17, priority=10,metadata=0x67870000000000/0xffffff0000000000 actions=write_metadata:0xe067870000000000/0xfffffffffffffffe,goto_table:60" + ovs-ofctl -OOpenFlow13 add-flow br0 "table=60, priority=0 actions=resubmit(,17)" + ovs-ofctl -OOpenFlow13 add-flow br0 "table=17, priority=10,metadata=0xe067870000000000/0xffffff0000000000 actions=write_metadata:0x67871d4d000000/0xfffffffffffffffe,goto_table:43" + ovs-ofctl -OOpenFlow13 add-flow br0 "table=43, priority=100,icmp actions=group:6000" + ovs-ofctl -OOpenFlow13 add-flow br0 "table=48, priority=0 actions=resubmit(,49),resubmit(,50)" + ovs-ofctl -OOpenFlow13 add-flow br0 "table=50, priority=0 actions=controller" +], [0], [ignore]) + +AT_CHECK([ovs-ofctl monitor -OOpenFlow13 -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log]) + +AT_CHECK([ + ovs-appctl netdev-dummy/receive p1 1e2ce92a669e3a6dd2099cab0800450000548a53400040011addc0a80a0ac0a80a1e08006f200a4d0001fc509a58000000002715020000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637 +], [0], [ignore]) + +OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 1]) +OVS_APP_EXIT_AND_WAIT(ovs-ofctl) + +AT_CHECK([cat ofctl_monitor.log], [0], [dnl +OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=43 cookie=0x0 total_len=98 metadata=0x67871d4d000000,in_port=1 (via action) data_len=98 (unbuffered) +icmp,vlan_tci=0x0000,dl_src=3a:6d:d2:09:9c:ab,dl_dst=1e:2c:e9:2a:66:9e,nw_src=192.168.10.10,nw_dst=192.168.10.30,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:6f20 +dnl +OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=50 cookie=0x0 total_len=98 metadata=0x67871d4d000000,in_port=1 (via no_match) data_len=98 (unbuffered) +icmp,vlan_tci=0x0000,dl_src=3a:6d:d2:09:9c:ab,dl_dst=1e:2c:e9:2a:66:9e,nw_src=192.168.10.10,nw_dst=192.168.10.30,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:6f20 +]) + +OVS_VSWITCHD_STOP +AT_CLEANUP AT_SETUP([ofproto-dpif - ARP modification slow-path]) OVS_VSWITCHD_START