From patchwork Fri Jul 28 02:26:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Pettit X-Patchwork-Id: 794622 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=) 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 3xJXmX299jz9s03 for ; Fri, 28 Jul 2017 12:27:08 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id CF6CCABC; Fri, 28 Jul 2017 02:26:55 +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 CE3AE9B9 for ; Fri, 28 Jul 2017 02:26:53 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 472611F9 for ; Fri, 28 Jul 2017 02:26:53 +0000 (UTC) Received: by mail-pf0-f194.google.com with SMTP id q85so19485563pfq.2 for ; Thu, 27 Jul 2017 19:26:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=di76PIeXOQvW97AqQH4jkR840wAUTo2G50TGuj/Hb48=; b=ZxJuYOIWudr6MXMIur0GvcWX3TpEr7ZKGbeMtza1NKzcDloLBtZWsuAnM8CGViFGD2 86Ed4pN+jwwYAJi8fp+NXo8EX8EwwT33vJeAp96A7PqCYZ2Gl6edDi1XZhMaf9WOGM+8 36Rw0AY+aKy+eC8j7jowYrNQoFShlWltPKz8QFAdzm2raZ3QOnUO8IHzHZSsprvXoUTU LKV9XImCrnLb9KxmQpOkJ1ORN0USW1Yx5lUZwECSzbgjLuVdJpNDtwJBxN/Exk+3pSqU NnkmLXk+noPG7Pyp3A8uduKmudUH0PIifUOV26sVRK7KBBkoqHNvlIcPQOhzeyI/oc25 aLdQ== X-Gm-Message-State: AIVw113aK11yiuue8ju16CgApoaS3ZcskGGvXzJhoEeAhxkEfVXiO5x+ OROdQ4FO2oHSUmPAYHU= X-Received: by 10.101.89.3 with SMTP id f3mr5858301pgu.177.1501208812864; Thu, 27 Jul 2017 19:26:52 -0700 (PDT) Received: from htb-1n-eng-dhcp12.eng.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id o4sm34390748pga.47.2017.07.27.19.26.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jul 2017 19:26:51 -0700 (PDT) Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) From: Justin Pettit In-Reply-To: <20170727232427.GK6175@ovn.org> Date: Thu, 27 Jul 2017 19:26:49 -0700 Message-Id: References: <1500013851-89181-1-git-send-email-jpettit@ovn.org> <1500013851-89181-2-git-send-email-jpettit@ovn.org> <20170727232427.GK6175@ovn.org> To: Ben Pfaff X-Mailer: Apple Mail (2.3273) X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH 2/3] ofproto-dpif-rid: Store tunnel metadata in frozen metadata directly. 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 > On Jul 27, 2017, at 4:24 PM, Ben Pfaff wrote: > > On Thu, Jul 13, 2017 at 11:30:50PM -0700, Justin Pettit wrote: >> "recirc_id_node" contains a 'state_metadata_tunnel' member field. The >> "frozen_metadata" structure used by "recird_id_node" had a 'tunnel' >> member that always pointed to 'state_metadata_tunnel". This commit just >> stores the tunnel information directly in "frozen_metadata" instead of >> accessing it through a pointer. >> >> Signed-off-by: Justin Pettit > > Would you mind adding something to the commit message to explain why > this is a good thing? I think I can guess, but rationale is important. > > Acked-by: Ben Pfaff Thanks. I pushed this to master with some added rationale. I also added the patch below to address some Travis errors when using an older version of gcc. --Justin -=-=-=-=-=-=-=-=- diff --git a/ofproto/ofproto-dpif-rid.c b/ofproto/ofproto-dpif-rid.c index 013534c511f0..5355a83a0f88 100644 --- a/ofproto/ofproto-dpif-rid.c +++ b/ofproto/ofproto-dpif-rid.c @@ -291,9 +291,12 @@ recirc_alloc_id(struct ofproto_dpif *ofproto) struct frozen_state state = { .table_id = TBL_INTERNAL, .ofproto_uuid = ofproto->uuid, - .metadata = { .tunnel.ip_dst = htonl(0), - .tunnel.ipv6_dst = in6addr_any, - .in_port = OFPP_NONE }, + .metadata = { + .tunnel = { + .ip_dst = htonl(0), + .ipv6_dst = in6addr_any, + }, + .in_port = OFPP_NONE }, }; return recirc_alloc_id__(&state, frozen_state_hash(&state))->id;