From patchwork Fri Jun 2 16:29:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zoltan Balogh X-Patchwork-Id: 770488 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 3wfV9q4mCPz9ryv for ; Sat, 3 Jun 2017 02:32:31 +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="JAHekJjy"; dkim-atps=neutral Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 5537EBA3; Fri, 2 Jun 2017 16:31:40 +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 C68CBB8E for ; Fri, 2 Jun 2017 16:31:38 +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 A92B617B for ; Fri, 2 Jun 2017 16:31:36 +0000 (UTC) X-AuditID: c1b4fb3a-6e3519a000004a6a-c5-593192e756ba Received: from ESESSHC008.ericsson.se (Unknown_Domain [153.88.183.42]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id 13.94.19050.7E291395; Fri, 2 Jun 2017 18:31:36 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (153.88.183.145) by oa.msg.ericsson.com (153.88.183.42) with Microsoft SMTP Server (TLS) id 14.3.339.0; Fri, 2 Jun 2017 18:30:07 +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=gnz8jtzrAjwma+m8tR6QNFh2ML7Y5ag6ZYK1WV6WMeQ=; b=JAHekJjyU6u30KUmOpzGiANkG7qMYO3hmkur/+CPaJa/U1Z7VUEu+3hebG/26SoX+d2NYh22MtqytVa/DdrAJ3+wmKhpiqLwbuj4LvCZtEFtfOu5hPJjdRcnqd/tPj96fisGTErbOpdJv9ox3Ecbv48CZ3lpyCqa4LRABxFa8fw= Received: from AM2PR07MB1042.eurprd07.prod.outlook.com (10.162.37.27) by AM2PR07MB1041.eurprd07.prod.outlook.com (10.162.37.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.6; Fri, 2 Jun 2017 16:29:03 +0000 Received: from AM2PR07MB1042.eurprd07.prod.outlook.com ([fe80::20fa:17e:7fc2:7fee]) by AM2PR07MB1042.eurprd07.prod.outlook.com ([fe80::20fa:17e:7fc2:7fee%14]) with mapi id 15.01.1143.009; Fri, 2 Jun 2017 16:29:03 +0000 From: =?iso-8859-1?Q?Zolt=E1n_Balogh?= To: "'dev@openvswitch.org'" Thread-Topic: [PATCH v3 5/6] userspace: Complete Packet In handling Thread-Index: AdLbvQbUIyVKRFlHQ/CL6NMlQSgT/w== Date: Fri, 2 Jun 2017 16:29:03 +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-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM2PR07MB1041; 7:t/Lnyy8N+jLeHJNt54tspyzYcugxpIuBT9BQS2q5sAvIMSuE7Qxm5zaYGRNPR/Ik5SRctAqeN0V02a8Pydx/MoXYFWWbYtV5Ud2iPrFGzikV5s98MPR8YPPl6orwF74/nZc6x1+SEq3AQo5IT5KOk/ISgybpPYq3vRADP34Qs6+fbl9G7b+6tJ11vTrv+J+oLBeMqAcvOJtmrJ5OJJ/W1HRL+4HBc103eAA+/m//QWQKd+dO92wtCFwdXz5YXKf2DTBJ9OOGA/jMqHd1lhNY0ebLGOy9XauYWxLdY58dktr+wGgMRA8HoB1VKeaRJII8Q07cED5V/t+bKvrUwjoQwA== x-ld-processed: 92e84ceb-fbfd-47ab-be52-080c6b87953f,ExtAddr x-ms-traffictypediagnostic: AM2PR07MB1041: x-ms-office365-filtering-correlation-id: 850dc6b6-bdf1-4013-d0e6-08d4a9d47b9d x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:AM2PR07MB1041; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(37575265505322); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(100000703101)(100105400095)(6041248)(20161123564025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM2PR07MB1041; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM2PR07MB1041; x-forefront-prvs: 03264AEA72 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39450400003)(39840400002)(39860400002)(39400400002)(39850400002)(39410400002)(33656002)(50986999)(8676002)(8936002)(54356999)(478600001)(6916009)(4326008)(39060400002)(81166006)(14454004)(68736007)(5660300001)(305945005)(189998001)(2900100001)(25786009)(7736002)(6436002)(7696004)(6506006)(54906002)(86362001)(9686003)(74316002)(53936002)(55016002)(99286003)(5250100002)(110136004)(102836003)(2906002)(3846002)(38730400002)(66066001)(3280700002)(6116002)(3660700001)(491001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR07MB1041; H:AM2PR07MB1042.eurprd07.prod.outlook.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jun 2017 16:29:03.7246 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR07MB1041 X-OriginatorOrg: ericsson.com X-Brightmail-Tracker: H4sIAAAAAAAAA02Sa0iTYRTHe/a8m6+XwZPXwzSTEUELrwQNE1OsGEVgYKWR1NA3Fa/sNdE+ 1CgjdTNFzc0ppihqYpEmXkpFZyqm5LW8dTGV5iVwJBlmZm7vgr79zvn/zznPOTw0tq/mi+i4 pFRGkSRPEAtsqJLwVonncoFvhE/xOpauFiqRtG+oA0vrmoawdLrdWrr9o4UXxJdVdazwZBrV Fyz7OrOLZIb3akq23vVOEMq/YhMQzSTEpTEK78DrNrFqrZpKKXJO1235KFEHyUHWNJBj8PZ3 HZWDbGh78hqBQTmDuGAAgbF/EJsCiuRimBrOx5xSyINeVQGPC+YRDC2qBKZmAhICU69WzOxI fGG8YJBvMmGi5EF3q9EsOJBAWNz+QHGmEKhoGMMce8G9ZzVWOYjem3cIhocUprSQXIX83W6z BRFn+PmmgWdiTFxgdukxj1uCQHXHCObYCVYW/5jnIlKKYKc902LygKaKdSuOD8D4Y5V5USBq DL0N9YgTAkCr0lg6SaC/cpXP8XnYmc+0FOQhGCntsxTEQ3nLQ2x6NRB/KB+O5Dx6Pugf9Fsm u8Hn3ixLcSUf7nbWYu4UIvg4mY3ykUT330oce8H0oyIBx0ehpnIN68zn2A+DJUtUBaLqkRPL sGxijJ+fF6OIi2LZ5CSvJCa1Ce39nZ7mbf821GMI1iNCI7Gd0CjxjbDny9PYjEQ9AhqLHYU1 eXspYbQ84xajSL6muJnAsHrkSlNiF2FQ12i4PYmRpzLxDJPCKP6pPNpapEQnNr9PzmovGIif rHHj5IA+1+FTY9F9uVtU4cap5rUwQZugLFxb9eSsne0N0YtRz2Vv99uu+4xzx8s22w/qNM8X QnUR5+pLbSequ8anLrs7jH7bMI41hsVerO6cPZOuGTtdrGzJ2PKpDWwOCz7s9DQyK/kXHklf 8HiZPXFnTnMJjogpNlbuK8EKVv4XQy6igjcDAAA= 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 Cc: "simon.horman@netronome.com" , Jiri Benc Subject: [ovs-dev] [PATCH v3 5/6] 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 ++++ lib/ofp-print.c | 3 +-- ofproto/ofproto-dpif-xlate.c | 10 +++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/flow.c b/lib/flow.c index 306874363..8d3c92904 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -991,6 +991,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/lib/ofp-print.c b/lib/ofp-print.c index 423df3102..5b37ed8f4 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -218,10 +218,9 @@ ofp_print_packet_in(struct ds *string, const struct ofp_header *oh, } if (verbosity > 0) { - /* Packet In can only carry Ethernet packets. */ char *packet = ofp_packet_to_string(public->packet, public->packet_len, - htonl(PT_ETH)); + public->flow_metadata.flow.packet_type); ds_put_cstr(string, packet); free(packet); } diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index c22647289..8d3389b90 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -4262,11 +4262,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. */ @@ -4300,6 +4295,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) {