From patchwork Fri Jul 29 06:26:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Pettit X-Patchwork-Id: 653994 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3s0zKK60R2z9t0G for ; Fri, 29 Jul 2016 16:27:01 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id C33731149A; Thu, 28 Jul 2016 23:26:41 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 13B091145C for ; Thu, 28 Jul 2016 23:26:40 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id A063016252A for ; Fri, 29 Jul 2016 00:26:39 -0600 (MDT) X-ASG-Debug-ID: 1469773598-0b32374773383940001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar6.cudamail.com with ESMTP id FrFmeFkJEVT8Wh9M (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 29 Jul 2016 00:26:38 -0600 (MDT) X-Barracuda-Envelope-From: jpettit@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO relay5-d.mail.gandi.net) (217.70.183.197) by mx3-pf3.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 29 Jul 2016 06:26:38 -0000 Received-SPF: pass (mx3-pf3.cudamail.com: SPF record at ovn.org designates 217.70.183.197 as permitted sender) X-Barracuda-Apparent-Source-IP: 217.70.183.197 X-Barracuda-RBL-IP: 217.70.183.197 Received: from mfilter43-d.gandi.net (mfilter43-d.gandi.net [217.70.178.174]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id 54F9B41C09B for ; Fri, 29 Jul 2016 08:26:37 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter43-d.gandi.net Received: from relay5-d.mail.gandi.net ([IPv6:::ffff:217.70.183.197]) by mfilter43-d.gandi.net (mfilter43-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id Pm6PFZfb5Gkz for ; Fri, 29 Jul 2016 08:26:35 +0200 (CEST) X-Originating-IP: 108.70.244.32 Received: from raznick.localdomain (unknown [108.70.244.32]) (Authenticated sender: jpettit@ovn.org) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 6BBD041C08F for ; Fri, 29 Jul 2016 08:26:35 +0200 (CEST) X-CudaMail-Envelope-Sender: jpettit@ovn.org From: Justin Pettit To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V3-728000294 X-CudaMail-DTE: 072916 X-CudaMail-Originating-IP: 217.70.183.197 Date: Thu, 28 Jul 2016 23:26:14 -0700 X-ASG-Orig-Subj: [##CM-V3-728000294##][IPv6 v2 04/10] ovn: Rename "nd" action to "nd_na". Message-Id: <1469773580-33112-4-git-send-email-jpettit@ovn.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1469773580-33112-1-git-send-email-jpettit@ovn.org> References: <1469773580-33112-1-git-send-email-jpettit@ovn.org> X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1469773598 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [IPv6 v2 04/10] ovn: Rename "nd" action to "nd_na". X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Rename "nd" to "nd_na" to be more descriptive and consistent with other ND messages and actions. This commit also fixes some minor documentation issues and limits the action to responding to Neighbor Solicitation messages. Signed-off-by: Justin Pettit Acked-by: Ben Pfaff --- v1->v2: Change "nd_adv" to "nd_na". include/ovn/actions.h | 4 ++-- ovn/controller/pinctrl.c | 15 +++++++-------- ovn/lib/actions.c | 17 +++++++++-------- ovn/northd/ovn-northd.c | 2 +- ovn/ovn-sb.xml | 14 +++++++------- tests/ovn.at | 8 ++++---- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/include/ovn/actions.h b/include/ovn/actions.h index 114c71e..2ae9cd2 100644 --- a/include/ovn/actions.h +++ b/include/ovn/actions.h @@ -73,11 +73,11 @@ enum action_opcode { */ ACTION_OPCODE_PUT_DHCP_OPTS, - /* "na { ...actions... }". + /* "nd_na { ...actions... }". * * The actions, in OpenFlow 1.3 format, follow the action_header. */ - ACTION_OPCODE_NA, + ACTION_OPCODE_ND_NA, }; /* Header. */ diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c index 06103dd..c03e2cf 100644 --- a/ovn/controller/pinctrl.c +++ b/ovn/controller/pinctrl.c @@ -69,9 +69,9 @@ static void send_garp_run(const struct ovsrec_bridge *, const char *chassis_id, const struct lport_index *lports, struct hmap *local_datapaths); -static void pinctrl_handle_na(const struct flow *ip_flow, - const struct match *md, - struct ofpbuf *userdata); +static void pinctrl_handle_nd_na(const struct flow *ip_flow, + const struct match *md, + struct ofpbuf *userdata); static void reload_metadata(struct ofpbuf *ofpacts, const struct match *md); @@ -410,8 +410,8 @@ process_packet_in(const struct ofp_header *msg) pinctrl_handle_put_dhcp_opts(&packet, &pin, &userdata, &continuation); break; - case ACTION_OPCODE_NA: - pinctrl_handle_na(&headers, &pin.flow_metadata, &userdata); + case ACTION_OPCODE_ND_NA: + pinctrl_handle_nd_na(&headers, &pin.flow_metadata, &userdata); break; default: @@ -947,9 +947,8 @@ reload_metadata(struct ofpbuf *ofpacts, const struct match *md) } static void -pinctrl_handle_na(const struct flow *ip_flow, - const struct match *md, - struct ofpbuf *userdata) +pinctrl_handle_nd_na(const struct flow *ip_flow, const struct match *md, + struct ofpbuf *userdata) { /* This action only works for IPv6 ND packets, and the switch should only * send us ND packets this way, but check here just to be sure. */ diff --git a/ovn/lib/actions.c b/ovn/lib/actions.c index fd5a867..6b8ea3f 100644 --- a/ovn/lib/actions.c +++ b/ovn/lib/actions.c @@ -249,8 +249,8 @@ put_controller_op(struct ofpbuf *ofpacts, enum action_opcode opcode) finish_controller_op(ofpacts, ofs); } -/* Implements the "arp" and "na" actions, which execute nested actions on a - * packet derived from the one being processed. */ +/* Implements the "arp" and "nd_na" actions, which execute nested + * actions on a packet derived fro: the one being processed. */ static void parse_nested_action(struct action_context *ctx, enum action_opcode opcode, const char *prereq) @@ -278,10 +278,11 @@ parse_nested_action(struct action_context *ctx, enum action_opcode opcode, ctx->ofpacts = outer_ofpacts; - /* Add a "controller" action with the actions nested inside "{...}", - * converted to OpenFlow, as its userdata. ovn-controller will convert the - * packet to ARP or NA and then send the packet and actions back to the - * switch inside an OFPT_PACKET_OUT message. */ + /* Add a "controller" OpenFlow action with the actions nested inside the + * requested OVN action's "{...}", converted to OpenFlow, as its userdata. + * ovn-controller will convert the packet to the requested type and + * then send the packet and actions back to the switch inside an + * OFPT_PACKET_OUT message. */ size_t oc_offset = start_controller_op(ctx->ofpacts, opcode, false); ofpacts_put_openflow_actions(inner_ofpacts.data, inner_ofpacts.size, ctx->ofpacts, OFP13_VERSION); @@ -1064,8 +1065,8 @@ parse_action(struct action_context *ctx) parse_ct_lb_action(ctx); } else if (lexer_match_id(ctx->lexer, "arp")) { parse_nested_action(ctx, ACTION_OPCODE_ARP, "ip4"); - } else if (lexer_match_id(ctx->lexer, "na")) { - parse_nested_action(ctx, ACTION_OPCODE_NA, "nd"); + } else if (lexer_match_id(ctx->lexer, "nd_na")) { + parse_nested_action(ctx, ACTION_OPCODE_ND_NA, "nd_ns"); } else if (lexer_match_id(ctx->lexer, "get_arp")) { parse_get_arp_action(ctx); } else if (lexer_match_id(ctx->lexer, "put_arp")) { diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index 4a25fad..af13ec2 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -2496,7 +2496,7 @@ build_lswitch_flows(struct hmap *datapaths, struct hmap *ports, } ds_clear(&actions); ds_put_format(&actions, - "na { eth.src = %s; " + "nd_na { eth.src = %s; " "nd.tll = %s; " "outport = inport; " "inport = \"\"; /* Allow sending out inport. */ " diff --git a/ovn/ovn-sb.xml b/ovn/ovn-sb.xml index 01b7d45..792f495 100644 --- a/ovn/ovn-sb.xml +++ b/ovn/ovn-sb.xml @@ -1109,16 +1109,16 @@
- na { action; ... }; + nd_na { action; ... };

- Temporarily replaces the IPv6 packet being processed by an IPv6 - neighbor advertisement (NA) packet and executes each nested - action on the NA packet. Actions following the - na action, if any, apply to the original, unmodified - packet. + Temporarily replaces the IPv6 neighbor solicitation packet + being processed by an IPv6 neighbor advertisement (NA) + packet and executes each nested action on the NA + packet. Actions following the nd_na action, + if any, apply to the original, unmodified packet.

@@ -1144,7 +1144,7 @@

- Prerequisite: nd + Prerequisite: nd_ns

diff --git a/tests/ovn.at b/tests/ovn.at index ecad4d5..ab42c75 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -696,8 +696,8 @@ reg1[0] = put_dhcp_opts(offerip=1.2.3.4, xyzzy); => Syntax error at `xyzzy' expe reg1[0] = put_dhcp_opts(offerip="xyzzy"); => DHCP option offerip requires numeric value. reg1[0] = put_dhcp_opts(offerip=1.2.3.4, domain=1.2.3.4); => DHCP option domain requires string value. -# na -na { eth.src = 12:34:56:78:9a:bc; nd.tll = 12:34:56:78:9a:bc; outport = inport; inport = ""; /* Allow sending out inport. */ output; }; => actions=controller(userdata=00.00.00.03.00.00.00.00.00.19.00.10.80.00.08.06.12.34.56.78.9a.bc.00.00.00.19.00.10.80.00.42.06.12.34.56.78.9a.bc.00.00.ff.ff.00.18.00.00.23.20.00.06.00.20.00.00.00.00.00.01.1c.04.00.01.1e.04.00.19.00.10.00.01.1c.04.00.00.00.00.00.00.00.00.00.19.00.10.00.00.00.02.00.00.00.00.00.00.00.00.ff.ff.00.10.00.00.23.20.00.0e.ff.f8.40.00.00.00), prereqs=nd +# nd_na +nd_na { eth.src = 12:34:56:78:9a:bc; nd.tll = 12:34:56:78:9a:bc; outport = inport; inport = ""; /* Allow sending out inport. */ output; }; => actions=controller(userdata=00.00.00.03.00.00.00.00.00.19.00.10.80.00.08.06.12.34.56.78.9a.bc.00.00.00.19.00.10.80.00.42.06.12.34.56.78.9a.bc.00.00.ff.ff.00.18.00.00.23.20.00.06.00.20.00.00.00.00.00.01.1c.04.00.01.1e.04.00.19.00.10.00.01.1c.04.00.00.00.00.00.00.00.00.00.19.00.10.00.00.00.02.00.00.00.00.00.00.00.00.ff.ff.00.10.00.00.23.20.00.0e.ff.f8.40.00.00.00), prereqs=nd_ns # Contradictionary prerequisites (allowed but not useful): ip4.src = ip6.src[0..31]; => actions=move:NXM_NX_IPV6_SRC[0..31]->NXM_OF_IP_SRC[], prereqs=eth.type == 0x800 && eth.type == 0x86dd @@ -3630,8 +3630,8 @@ OVN_CLEANUP([hv1]) AT_CLEANUP -AT_SETUP([ovn -- nd ]) -AT_KEYWORDS([ovn-nd]) +AT_SETUP([ovn -- nd_na ]) +AT_KEYWORDS([ovn-nd_na]) AT_SKIP_IF([test $HAVE_PYTHON = no]) ovn_start