From patchwork Tue Apr 18 11:20:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Balogh X-Patchwork-Id: 751810 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3w6jTt38yrz9ryT for ; Tue, 18 Apr 2017 21:25:06 +1000 (AEST) 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="PLabm600"; dkim-atps=neutral Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id ABE2BBEC; Tue, 18 Apr 2017 11:20:25 +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 6C3BFBE8 for ; Tue, 18 Apr 2017 11:20:23 +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 7F79A18F for ; Tue, 18 Apr 2017 11:20:22 +0000 (UTC) X-AuditID: c1b4fb25-84bff70000006af2-9c-58f5f674b921 Received: from ESESSHC010.ericsson.se (Unknown_Domain [153.88.183.48]) by (Symantec Mail Security) with SMTP id 28.15.27378.476F5F85; Tue, 18 Apr 2017 13:20:20 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.48) with Microsoft SMTP Server (TLS) id 14.3.339.0; Tue, 18 Apr 2017 13:20:20 +0200 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=kbse7xjRXQ/ixPxsGgo8zpzrbxZP3XXtYc626YonGlQ=; b=PLabm600+xQ8CMi9cwCIzB2OhyxjaCUwyW1SQNobmYNm5vFPKRtP8Jp5UlKssINsj+wtF33tUzhOGrFH7jJ741dhGjvqROUzvfjlNaNXRcO+lyVFbB0++SDYhx1ncllElQKUmznzQILIe29t/y4Z4gjUXXWi428gD5a7v9Ap9AM= Received: from AM2PR07MB1042.eurprd07.prod.outlook.com (10.162.37.27) by AM2PR07MB1044.eurprd07.prod.outlook.com (10.162.38.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1047.6; Tue, 18 Apr 2017 11:20:19 +0000 Received: from AM2PR07MB1042.eurprd07.prod.outlook.com ([fe80::90cd:8ba4:2442:e4d]) by AM2PR07MB1042.eurprd07.prod.outlook.com ([fe80::90cd:8ba4:2442:e4d%15]) with mapi id 15.01.1047.006; Tue, 18 Apr 2017 11:20:19 +0000 From: =?iso-8859-1?Q?Zolt=E1n_Balogh?= To: "'dev@openvswitch.org'" Thread-Topic: [PATCH 09/10] userspace: Complete Packet In handling Thread-Index: AdK4NHMbcBYPptGzR5+o0JLOYpQc6A== Date: Tue, 18 Apr 2017 11:20:19 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: openvswitch.org; dkim=none (message not signed) header.d=none;openvswitch.org; dmarc=none action=none header.from=ericsson.com; x-originating-ip: [91.82.100.59] x-microsoft-exchange-diagnostics: 1; AM2PR07MB1044; 7:bjIeg6DIug2xwQB+YkAf9AcnHONkbneaKT70LOO2XoOgVmM6gLGBrtGsT47ZI01bqyZ/qiDsja1hMSIoM4fwQPiXITC4fplQ7xGR/irribAID5CnAv54E6RcWqqhFAPykJUkEQwLxIjurz86X2R3JgUNyUaiKbcicCakj7zn05O1iwqlkznW7l0HlBE0gjwcTSQTaMrAG7nveCdbOluyKgbwgRoQHwClXAX/LscSX8BaBNMdFvy/0jKcLucoTxpyOIxZvRl2fit2vx/dud+9SA9/kajZZy9zM4FJNhcqnIkTizA5BNbT42kozEgd+693zlMOWKP7/4PDcOYI1MGngA== x-ld-processed: 92e84ceb-fbfd-47ab-be52-080c6b87953f,ExtAddr x-ms-office365-filtering-correlation-id: 822ad56f-2b79-4449-79d3-08d4864ce57a x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:AM2PR07MB1044; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(37575265505322); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(20161123562025)(20161123560025)(20161123564025)(6072148); SRVR:AM2PR07MB1044; BCL:0; PCL:0; RULEID:; SRVR:AM2PR07MB1044; x-forefront-prvs: 028166BF91 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39450400003)(39410400002)(39400400002)(39860400002)(39840400002)(39850400002)(38730400002)(110136004)(86362001)(575784001)(7736002)(6916009)(66066001)(5660300001)(107886003)(81166006)(3846002)(2900100001)(6116002)(102836003)(33656002)(7696004)(3660700001)(2906002)(25786009)(99286003)(189998001)(6436002)(4326008)(55016002)(6506006)(53936002)(74316002)(9686003)(8676002)(3280700002)(305945005)(8936002)(54356999)(50986999)(491001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR07MB1044; H:AM2PR07MB1042.eurprd07.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2017 11:20:19.0367 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR07MB1044 X-OriginatorOrg: ericsson.com X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrJIsWRmVeSWpSXmKPExsUyM2K7gW7Jt68RBov3GVgcPb2H2YHR49nN /4wBjFFcNimpOZllqUX6dglcGfcnKBXsE6iYeIK9gfEHTxcjJ4eEgInEq5ar7F2MXBxCAusZ JT5928sI4ZxglJj+bw8LiMMi0MsssezUVRaIzBQmiUkNE9lB+oUEHjJKNJ3zB7HZBJwlru9+ yQZiiwgYSlyadJIVxGYWSJG4N3kvE4gtLGArcfv+DEaIGieJJ3eeQNXrSbxbuQtsJouAqsTe 85fBenkFYiQmT+4EizMKiEl8P7WGCWKmuMStJ/OZIH4QkFiy5zwzhC0q8fLxP1aQQxkFZjNK /N3ZAlWkILFpwXuwRyUEepgl5h2fyQ6RsJGY0T0dqttX4v3vb2wQdp3E8raJjBB2tsTrd/uB bA4g20pi3plYiPBFJonX82whbBmJzS+XMELMv88isenQRBaIj6Uk7l7pZISwZSRe3NkLDRU9 iRtTp7BNYNSYheShWUhSELa2xLKFr5lngQNDUOLkzCcsCxhZVjGKFqcWJ+WmGxnrpRZlJhcX 5+fp5aWWbGIEJoiDW36r7mC8/MbxEKMAB6MSD2/CqS8RQqyJZcWVuYcYJTiYlUR4f20ACvGm JFZWpRblxxeV5qQWH2KU5mBREud13HchQkggPbEkNTs1tSC1CCbLxMEp1cCoePjospf+k/1i zk2RsLp/+NjxFa9Wr+SJ53GPSWlIDvzz1H5P70qBxxX3VKc6rPzV/Vj/+I3PW94cnb/1t+KC 8+dispcuCLWf8dX2Iu++sCuxl/+33PK2bTjFPfOu6HY2tbxai0Ad0SW7OY0/yn+epPt2wtyJ NdJJ3Y2Gi/rOrV6Qfuq3iW3+ByWW4oxEQy3mouJEAJoJVfYMAwAA X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 09/10] userspace: Complete Packet In handling 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 From: Jan Scheurich Send packet_in for non-Ethernet packets. Include packet_type in Packet In for ptap bridges. Signed-off-by: Jan Scheurich --- lib/flow.c | 4 ++++ ofproto/ofproto-dpif-xlate.c | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/flow.c b/lib/flow.c index 81824e0..bd0b36e 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -993,6 +993,10 @@ flow_get_metadata(const struct flow *flow, struct match *flow_metadata) } match_set_in_port(flow_metadata, flow->in_port.ofp_port); + if (flow->packet_type != htonl(PT_ETH)) { + match_set_packet_type(flow_metadata, flow->packet_type); + } + if (flow->ct_state != 0) { match_set_ct_state(flow_metadata, flow->ct_state); if (is_ct_valid(flow, NULL, NULL) && flow->ct_nw_proto != 0) { diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 5039758..8625445 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -4278,11 +4278,6 @@ execute_controller_action(struct xlate_ctx *ctx, int len, return; } - if (packet->packet_type != htonl(PT_ETH)) { - dp_packet_delete(packet); - return; - } - /* A packet sent by an action in a table-miss rule is considered an * explicit table miss. OpenFlow before 1.3 doesn't have that concept so * it will get translated back to OFPR_ACTION for those versions. */ @@ -4316,6 +4311,11 @@ execute_controller_action(struct xlate_ctx *ctx, int len, }; flow_get_metadata(&ctx->xin->flow, &am->pin.up.public.flow_metadata); + /* Send packet_type only from packet-type-aware bridges. */ + if (!ctx->xbridge->packet_type_aware) { + am->pin.up.public.flow_metadata.wc.masks.packet_type = 0; + } + /* Async messages are only sent once, so if we send one now, no * xlate cache entry is created. */ if (ctx->xin->allow_side_effects) {