[{"id":1772988,"web_url":"http://patchwork.ozlabs.org/comment/1772988/","msgid":"<567f4888-c88c-803e-a53e-f7b5583013a7@gmail.com>","list_archive_url":null,"date":"2017-09-21T16:48:30","subject":"Re: [ovs-dev] [merge native tunneling and patch port 3/7]\n\tofproto-dpif: Refactor compose_clone()","submitter":{"id":69140,"url":"http://patchwork.ozlabs.org/api/people/69140/","name":"Gregory Rose","email":"gvrose8192@gmail.com"},"content":"On 09/12/2017 12:49 PM, Andy Zhou wrote:\n> Add a new function clone_xlate_actions(), which shares the same\n> signature as do_xlate_actions();  Later patch will make use\n> of this function.\n> \n> Signed-off-by: Andy Zhou <azhou@ovn.org>\n> ---\n>   ofproto/ofproto-dpif-xlate.c | 20 ++++++++++++++------\n>   1 file changed, 14 insertions(+), 6 deletions(-)\n> \n> diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c\n> index d5b47666e974..223313d4ecba 100644\n> --- a/ofproto/ofproto-dpif-xlate.c\n> +++ b/ofproto/ofproto-dpif-xlate.c\n> @@ -5334,7 +5334,8 @@ reversible_actions(const struct ofpact *ofpacts, size_t ofpacts_len)\n>   }\n>   \n>   static void\n> -compose_clone(struct xlate_ctx *ctx, const struct ofpact_nest *oc)\n> +clone_xlate_actions(const struct ofpact *actions, size_t actions_len,\n> +                    struct xlate_ctx *ctx)\n>   {\n>       struct ofpbuf old_stack = ctx->stack;\n>       union mf_subvalue new_stack[1024 / sizeof(union mf_subvalue)];\n> @@ -5347,12 +5348,11 @@ compose_clone(struct xlate_ctx *ctx, const struct ofpact_nest *oc)\n>       ofpbuf_put(&ctx->action_set, old_action_set.data, old_action_set.size);\n>   \n>       size_t offset, ac_offset;\n> -    size_t oc_actions_len = ofpact_nest_get_action_len(oc);\n>       struct flow old_flow = ctx->xin->flow;\n>   \n> -    if (reversible_actions(oc->actions, oc_actions_len)) {\n> +    if (reversible_actions(actions, actions_len)) {\n>           old_flow = ctx->xin->flow;\n> -        do_xlate_actions(oc->actions, oc_actions_len, ctx);\n> +        do_xlate_actions(actions, actions_len, ctx);\n>           if (ctx->freezing) {\n>               finish_freezing(ctx);\n>           }\n> @@ -5373,7 +5373,7 @@ compose_clone(struct xlate_ctx *ctx, const struct ofpact_nest *oc)\n>       if (ctx->xbridge->support.clone) { /* Use clone action */\n>           /* Use clone action as datapath clone. */\n>           offset = nl_msg_start_nested(ctx->odp_actions, OVS_ACTION_ATTR_CLONE);\n> -        do_xlate_actions(oc->actions, oc_actions_len, ctx);\n> +        do_xlate_actions(actions, actions_len, ctx);\n>           if (ctx->freezing) {\n>               finish_freezing(ctx);\n>           }\n> @@ -5386,7 +5386,7 @@ compose_clone(struct xlate_ctx *ctx, const struct ofpact_nest *oc)\n>           offset = nl_msg_start_nested(ctx->odp_actions, OVS_ACTION_ATTR_SAMPLE);\n>           ac_offset = nl_msg_start_nested(ctx->odp_actions,\n>                                           OVS_SAMPLE_ATTR_ACTIONS);\n> -        do_xlate_actions(oc->actions, oc_actions_len, ctx);\n> +        do_xlate_actions(actions, actions_len, ctx);\n>           if (ctx->freezing) {\n>               finish_freezing(ctx);\n>           }\n> @@ -5425,6 +5425,14 @@ xlate_done:\n>   }\n>   \n>   static void\n> +compose_clone(struct xlate_ctx *ctx, const struct ofpact_nest *oc)\n> +{\n> +    size_t oc_actions_len = ofpact_nest_get_action_len(oc);\n> +\n> +    clone_xlate_actions(oc->actions, oc_actions_len, ctx);\n> +}\n> +\n> +static void\n>   xlate_meter_action(struct xlate_ctx *ctx, const struct ofpact_meter *meter)\n>   {\n>       if (meter->provider_meter_id != UINT32_MAX) {\n> \n\nTested-by: Greg Rose <gvrose8192@gmail.com>\nReviewed-by: Greg Rose <gvrose8192@gmail.com>","headers":{"Return-Path":"<ovs-dev-bounces@openvswitch.org>","X-Original-To":["incoming@patchwork.ozlabs.org","dev@openvswitch.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","ovs-dev@mail.linuxfoundation.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=openvswitch.org\n\t(client-ip=140.211.169.12; helo=mail.linuxfoundation.org;\n\tenvelope-from=ovs-dev-bounces@openvswitch.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"CqUpgxGi\"; dkim-atps=neutral"],"Received":["from mail.linuxfoundation.org (mail.linuxfoundation.org\n\t[140.211.169.12])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xyjHB10zFz9s06\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 22 Sep 2017 02:48:38 +1000 (AEST)","from mail.linux-foundation.org (localhost [127.0.0.1])\n\tby mail.linuxfoundation.org (Postfix) with ESMTP id B731EBC0;\n\tThu, 21 Sep 2017 16:48:35 +0000 (UTC)","from smtp1.linuxfoundation.org (smtp1.linux-foundation.org\n\t[172.17.192.35])\n\tby mail.linuxfoundation.org (Postfix) with ESMTPS id 1AB00BAA\n\tfor <dev@openvswitch.org>; Thu, 21 Sep 2017 16:48:35 +0000 (UTC)","from mail-pg0-f68.google.com (mail-pg0-f68.google.com\n\t[74.125.83.68])\n\tby smtp1.linuxfoundation.org (Postfix) with ESMTPS id 3367E49E\n\tfor <dev@openvswitch.org>; Thu, 21 Sep 2017 16:48:34 +0000 (UTC)","by mail-pg0-f68.google.com with SMTP id m30so3712353pgn.5\n\tfor <dev@openvswitch.org>; Thu, 21 Sep 2017 09:48:34 -0700 (PDT)","from gizo.bigblue.kilchis.com (67-5-132-83.ptld.qwest.net.\n\t[67.5.132.83]) by smtp.gmail.com with ESMTPSA id\n\tz30sm4340640pfg.54.2017.09.21.09.48.31\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 21 Sep 2017 09:48:32 -0700 (PDT)"],"X-Greylist":"whitelisted by SQLgrey-1.7.6","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=subject:to:references:from:message-id:date:user-agent:mime-version\n\t:in-reply-to:content-language:content-transfer-encoding;\n\tbh=+Q2mJruRmLn1tv2ZzYTNPuiyC+6V1iF8wSmuBZCXRqY=;\n\tb=CqUpgxGiUkbqzC7B9DgiYl3tC1ZlpIeYgRAHJAcbvjriHdLxz5tyr2Op1PA/ChK525\n\tIvtoGjJWQdI7Be9aybOJdJwkUp4HQvNqiEhv/o4QiblhAstqr7l37Muqo/QHxAf6KH+0\n\tSZOPEyTyh0iJzl0aooziv91GHPmK+F8OpA+a/MkPbUeReCxrnUCHoHzMqGh+hS7IvX3M\n\tmyp6JAkoS12AktUApa96ysYOqjvGeVvMTZYjFBFbXTn31n3Ouu08gpaGpNIQzH/yIwRj\n\t4cANBOHnAqHfExVaxYx3gMc6dFWRpN8fOnHmp+EnpbLk+tZ8ncDe9VGv2Y3MA22SMlfY\n\t4Wkw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=+Q2mJruRmLn1tv2ZzYTNPuiyC+6V1iF8wSmuBZCXRqY=;\n\tb=SyVNaVwqVtMT1yfgVjSuZHFQdDDeC3WITcxupMydG31ZfDDjRJxImDvXeXcAIIy9N/\n\tFA6W1jF5nFX4GNifVm6taAqRyIxHhccgKxUjifEO5YIf958Rtma8JZ8EHOYgMU23nzlw\n\tZ3h/E4lBEHcgrWn1Z+CCtD6PuVNHXsCjTjzsX748Kyd/TTdCCfT3DfyviTcqBESDhlYU\n\tWKHXrUhhpjGw84YdhJB2HnGV7GOP7JzkOLHl8glyhEKFd33rN0Smhc/8NmSKH5ae8n0p\n\tbR9JjpPlKvdLoXAEaEtGsX8mO5R+D38N2FVoD+LIBXX/LhfV/+3/yAKdAaG6rhmDZ/Qo\n\tfI1A==","X-Gm-Message-State":"AHPjjUgi1+5kf76OTD6i8La248b5sxipRbL+oDh+a8sOfKtTo6j9jIQA\n\trKkuCCE1fZhxt2E2sivGQpyKxe34","X-Google-Smtp-Source":"AOwi7QAHptC0oQXkDEk8DQTn2Tf3/ewo+BrVQtQxis5AfZJ2VuIOb/t8RmJ4hHXCtSkTJdvbK0KfQQ==","X-Received":"by 10.101.75.201 with SMTP id p9mr6448357pgr.281.1506012513379; \n\tThu, 21 Sep 2017 09:48:33 -0700 (PDT)","To":"Andy Zhou <azhou@ovn.org>, dev@openvswitch.org","References":"<1505245749-3402-1-git-send-email-azhou@ovn.org>\n\t<1505245749-3402-3-git-send-email-azhou@ovn.org>","From":"Greg Rose <gvrose8192@gmail.com>","Message-ID":"<567f4888-c88c-803e-a53e-f7b5583013a7@gmail.com>","Date":"Thu, 21 Sep 2017 09:48:30 -0700","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.1.0","MIME-Version":"1.0","In-Reply-To":"<1505245749-3402-3-git-send-email-azhou@ovn.org>","Content-Language":"en-US","X-Spam-Status":"No, score=0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID,\n\tDKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, \n\tRCVD_IN_SORBS_SPAM autolearn=disabled version=3.3.1","X-Spam-Checker-Version":"SpamAssassin 3.3.1 (2010-03-16) on\n\tsmtp1.linux-foundation.org","Subject":"Re: [ovs-dev] [merge native tunneling and patch port 3/7]\n\tofproto-dpif: Refactor compose_clone()","X-BeenThere":"ovs-dev@openvswitch.org","X-Mailman-Version":"2.1.12","Precedence":"list","List-Id":"<ovs-dev.openvswitch.org>","List-Unsubscribe":"<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n\t<mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>","List-Archive":"<http://mail.openvswitch.org/pipermail/ovs-dev/>","List-Post":"<mailto:ovs-dev@openvswitch.org>","List-Help":"<mailto:ovs-dev-request@openvswitch.org?subject=help>","List-Subscribe":"<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n\t<mailto:ovs-dev-request@openvswitch.org?subject=subscribe>","Content-Transfer-Encoding":"7bit","Content-Type":"text/plain; charset=\"us-ascii\"; Format=\"flowed\"","Sender":"ovs-dev-bounces@openvswitch.org","Errors-To":"ovs-dev-bounces@openvswitch.org"}}]