From patchwork Mon Apr 8 18:22:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1081355 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=none (p=none dis=none) header.from=ovn.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 44dJjl5l5Qz9sR0 for ; Tue, 9 Apr 2019 04:24:43 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id CB467C84; Mon, 8 Apr 2019 18:22:23 +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 B26ECC3F for ; Mon, 8 Apr 2019 18:22:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 2AC4D623 for ; Mon, 8 Apr 2019 18:22:21 +0000 (UTC) X-Originating-IP: 66.170.99.95 Received: from sigill.benpfaff.org (unknown [66.170.99.95]) (Authenticated sender: blp@ovn.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id A7459240009; Mon, 8 Apr 2019 18:22:19 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Mon, 8 Apr 2019 11:22:06 -0700 Message-Id: <20190408182206.15688-5-blp@ovn.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190408182206.15688-1-blp@ovn.org> References: <20190408182206.15688-1-blp@ovn.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 5/5] odp-util: Add FLOW_WC_SEQ assertions. 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 The assertions make it easier to find all the places that need to be updated when adding protocol support. Signed-off-by: Ben Pfaff Acked-by: Numan Siddique --- lib/odp-util.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/odp-util.c b/lib/odp-util.c index 6e545b80ba6c..f60536c1d9dc 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -5819,6 +5819,11 @@ static void odp_flow_key_from_flow__(const struct odp_flow_key_parms *parms, bool export_mask, struct ofpbuf *buf) { + /* New "struct flow" fields that are visible to the datapath (including all + * data fields) should be translated into equivalent datapath flow fields + * here (you will have to add a OVS_KEY_ATTR_* for them). */ + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 41); + struct ovs_key_ethernet *eth_key; size_t encap[FLOW_MAX_VLAN_HEADERS] = {0}; size_t max_vlans; @@ -6900,6 +6905,11 @@ odp_flow_key_to_flow__(const struct nlattr *key, size_t key_len, struct flow *flow, const struct flow *src_flow, char **errorp) { + /* New "struct flow" fields that are visible to the datapath (including all + * data fields) should be translated from equivalent datapath flow fields + * here (you will have to add a OVS_KEY_ATTR_* for them). */ + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 41); + enum odp_key_fitness fitness = ODP_FIT_ERROR; if (errorp) { *errorp = NULL;