[{"id":1758558,"web_url":"http://patchwork.ozlabs.org/comment/1758558/","msgid":"<CFF8EF42F1132E4CBE2BF0AB6C21C58D787DDAFE@ESESSMB110.ericsson.se>","list_archive_url":null,"date":"2017-08-28T12:47:52","subject":"Re: [ovs-dev] [PATCH v4 3/3] nsh: add dec_nsh_ttl action","submitter":{"id":68449,"url":"http://patchwork.ozlabs.org/api/people/68449/","name":"Jan Scheurich","email":"jan.scheurich@ericsson.com"},"content":"> -----Original Message-----\n> From: Yi Yang [mailto:yi.y.yang@intel.com]\n> \n> +static bool\n> +compose_dec_nsh_ttl_action(struct xlate_ctx *ctx) {\n> +    struct flow *flow = &ctx->xin->flow;\n> +\n> +    if ((flow->packet_type == htonl(PT_NSH)) ||\n> +        (flow->dl_type == htons(ETH_TYPE_NSH))) {\n> +        ctx->wc->masks.nsh.ttl = 0xff;\n> +        if (flow->nsh.ttl > 1) {\n> +            flow->nsh.ttl--;\n> +            return false;\n> +        } else {\n> +            execute_controller_action(ctx, UINT16_MAX, OFPR_INVALID_TTL,\n> 0,\n> +                                      NULL, 0);\n> +        }\n> +    }\n> +\n> +    /* Stop processing for current table. */\n> +    xlate_report(ctx, OFT_WARN, \"NSH decrement TTL exception\");\n> +    return true;\n\nI see you followed the dec_mpls_ttl implementation here in that you terminate\ntranslation and drop the packet when trying to decrement TTL of a non-NSH\npacket. This is different from the dec_nw_ttl action, which does nothing when\nexecuted on a non-IP packet. \n\n@Ben: What is the reason for different approaches in OVS?\n\n@Yi: Why have you opted for the MPLS approach?\n\nBR, Jan","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>)","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 3xgs5832K6z9sDB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 28 Aug 2017 22:48:27 +1000 (AEST)","from mail.linux-foundation.org (localhost [127.0.0.1])\n\tby mail.linuxfoundation.org (Postfix) with ESMTP id 8A7238A1;\n\tMon, 28 Aug 2017 12:48:24 +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 C6C5988A\n\tfor <dev@openvswitch.org>; Mon, 28 Aug 2017 12:48:22 +0000 (UTC)","from sesbmg23.ericsson.net (sesbmg23.ericsson.net [193.180.251.37])\n\tby smtp1.linuxfoundation.org (Postfix) with ESMTPS id 264111F2\n\tfor <dev@openvswitch.org>; Mon, 28 Aug 2017 12:48:21 +0000 (UTC)","from ESESSHC023.ericsson.se (Unknown_Domain [153.88.183.87])\n\tby sesbmg23.ericsson.net (Symantec Mail Security) with SMTP id\n\tEC.EB.21299.41114A95; Mon, 28 Aug 2017 14:48:20 +0200 (CEST)","from ESESSMB110.ericsson.se ([169.254.10.108]) by\n\tESESSHC023.ericsson.se ([153.88.183.87]) with mapi id 14.03.0352.000; \n\tMon, 28 Aug 2017 14:47:52 +0200"],"X-Greylist":"domain auto-whitelisted by SQLgrey-1.7.6","X-AuditID":"c1b4fb25-d31059c000005333-b5-59a411146fe1","From":"Jan Scheurich <jan.scheurich@ericsson.com>","To":"Yi Yang <yi.y.yang@intel.com>,\n\t\"dev@openvswitch.org\" <dev@openvswitch.org>","Thread-Topic":"[PATCH v4 3/3] nsh: add dec_nsh_ttl action","Thread-Index":"AQHTHVeXGAiUwNKUBESHn/ysaCPIAqKZr4Ew","Date":"Mon, 28 Aug 2017 12:47:52 +0000","Message-ID":"<CFF8EF42F1132E4CBE2BF0AB6C21C58D787DDAFE@ESESSMB110.ericsson.se>","References":"<1503633771-112384-1-git-send-email-yi.y.yang@intel.com>\n\t<1503633771-112384-4-git-send-email-yi.y.yang@intel.com>","In-Reply-To":"<1503633771-112384-4-git-send-email-yi.y.yang@intel.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","x-originating-ip":"[153.88.183.17]","MIME-Version":"1.0","X-Brightmail-Tracker":"H4sIAAAAAAAAA+NgFmplkeLIzCtJLcpLzFFi42KZGbE9XFdEcEmkwZSnYhavJjcwWhw9vYfZ\n\t4vfXbUwOzB6L97xk8nh28z+jx/NrPSwBzFFcNimpOZllqUX6dglcGV/nH2EqWMBZ8XLRU+YG\n\txqtsXYycHBICJhK37jazdzFycQgJHGGUOP19ESOEs5RRYvPPZqAqDg42AQOJ2bsdQBpEBPwk\n\tjlzqYwKxmQXkJZpWbQUbJCxgLtGxfxYrRI2FxNR7fVC2kcSjiw+ZQWwWAVWJC1e+M4LYvAK+\n\tEmfefmMHsYUE6iXe338DNpNTwFXi05wpYDajgJjE91NroHaJS9x6Mp8J4mgBiSV7zjND2KIS\n\tLx//YwU5U0JAUWJ5vxxEuY7Egt2f2CBsbYllC18zQ6wVlDg58wnLBEbRWUimzkLSMgtJyywk\n\tLQsYWVYxihanFiflphsZ66UWZSYXF+fn6eWllmxiBEbOwS2/VXcwXn7jeIhRgINRiYfX5fni\n\tSCHWxLLiytxDjBIczEoivOr8SyKFeFMSK6tSi/Lji0pzUosPMUpzsCiJ8zruuxAhJJCeWJKa\n\tnZpakFoEk2Xi4JRqYLT+cKWe5Yif9N777OmxfBG7m9albxQMnLy+e1Wr1uyLV3IZPjdkPhDq\n\t05CaeCHmqemxJLNZ3I9M315IOG184Mry69ldniHbJL2uP2jVaTHcm2F/64e8zpniXQcP7VrM\n\tkv9Lueh2zJ51/DPXV7htKQ3xulAx2bn60dqTjzfscf714Z8W85JVD0OVWIozEg21mIuKEwE1\n\t0jz/mAIAAA==","X-Spam-Status":"No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED\n\tautolearn=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] [PATCH v4 3/3] nsh: add dec_nsh_ttl action","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-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"ovs-dev-bounces@openvswitch.org","Errors-To":"ovs-dev-bounces@openvswitch.org"}},{"id":1759475,"web_url":"http://patchwork.ozlabs.org/comment/1759475/","msgid":"<20170829154042.GX6175@ovn.org>","list_archive_url":null,"date":"2017-08-29T15:40:42","subject":"Re: [ovs-dev] [PATCH v4 3/3] nsh: add dec_nsh_ttl action","submitter":{"id":67603,"url":"http://patchwork.ozlabs.org/api/people/67603/","name":"Ben Pfaff","email":"blp@ovn.org"},"content":"On Mon, Aug 28, 2017 at 12:47:52PM +0000, Jan Scheurich wrote:\n> > -----Original Message-----\n> > From: Yi Yang [mailto:yi.y.yang@intel.com]\n> > \n> > +static bool\n> > +compose_dec_nsh_ttl_action(struct xlate_ctx *ctx) {\n> > +    struct flow *flow = &ctx->xin->flow;\n> > +\n> > +    if ((flow->packet_type == htonl(PT_NSH)) ||\n> > +        (flow->dl_type == htons(ETH_TYPE_NSH))) {\n> > +        ctx->wc->masks.nsh.ttl = 0xff;\n> > +        if (flow->nsh.ttl > 1) {\n> > +            flow->nsh.ttl--;\n> > +            return false;\n> > +        } else {\n> > +            execute_controller_action(ctx, UINT16_MAX, OFPR_INVALID_TTL,\n> > 0,\n> > +                                      NULL, 0);\n> > +        }\n> > +    }\n> > +\n> > +    /* Stop processing for current table. */\n> > +    xlate_report(ctx, OFT_WARN, \"NSH decrement TTL exception\");\n> > +    return true;\n> \n> I see you followed the dec_mpls_ttl implementation here in that you terminate\n> translation and drop the packet when trying to decrement TTL of a non-NSH\n> packet. This is different from the dec_nw_ttl action, which does nothing when\n> executed on a non-IP packet. \n> \n> @Ben: What is the reason for different approaches in OVS?\n> \n> @Yi: Why have you opted for the MPLS approach?\n\nI don't recall why these are different.\n\nI don't think the difference is that significant in practice because,\noutside of OpenFlow 1.0, OVS only allows an IP TTL decrement action in a\nflow matches only IP packets, and similarly for MPLS TTL decrement.\n\nI wouldn't object to making the behavior uniform.","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>)","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 3xhXsf3wDXz9s4q\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 01:40:54 +1000 (AEST)","from mail.linux-foundation.org (localhost [127.0.0.1])\n\tby mail.linuxfoundation.org (Postfix) with ESMTP id BA9AA94F;\n\tTue, 29 Aug 2017 15:40:52 +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 3AA4C96F\n\tfor <dev@openvswitch.org>; Tue, 29 Aug 2017 15:40:51 +0000 (UTC)","from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[217.70.183.194])\n\tby smtp1.linuxfoundation.org (Postfix) with ESMTPS id BD9B2B0\n\tfor <dev@openvswitch.org>; Tue, 29 Aug 2017 15:40:50 +0000 (UTC)","from ovn.org (173-228-112-34.dsl.dynamic.fusionbroadband.com\n\t[173.228.112.34]) (Authenticated sender: blp@ovn.org)\n\tby relay2-d.mail.gandi.net (Postfix) with ESMTPSA id BE23CC5A85;\n\tTue, 29 Aug 2017 17:40:46 +0200 (CEST)"],"X-Greylist":"domain auto-whitelisted by SQLgrey-1.7.6","X-Originating-IP":"173.228.112.34","Date":"Tue, 29 Aug 2017 08:40:42 -0700","From":"Ben Pfaff <blp@ovn.org>","To":"Jan Scheurich <jan.scheurich@ericsson.com>","Message-ID":"<20170829154042.GX6175@ovn.org>","References":"<1503633771-112384-1-git-send-email-yi.y.yang@intel.com>\n\t<1503633771-112384-4-git-send-email-yi.y.yang@intel.com>\n\t<CFF8EF42F1132E4CBE2BF0AB6C21C58D787DDAFE@ESESSMB110.ericsson.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<CFF8EF42F1132E4CBE2BF0AB6C21C58D787DDAFE@ESESSMB110.ericsson.se>","User-Agent":"Mutt/1.5.23 (2014-03-12)","X-Spam-Status":"No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW\n\tautolearn=disabled version=3.3.1","X-Spam-Checker-Version":"SpamAssassin 3.3.1 (2010-03-16) on\n\tsmtp1.linux-foundation.org","Cc":"\"dev@openvswitch.org\" <dev@openvswitch.org>","Subject":"Re: [ovs-dev] [PATCH v4 3/3] nsh: add dec_nsh_ttl action","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-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"ovs-dev-bounces@openvswitch.org","Errors-To":"ovs-dev-bounces@openvswitch.org"}}]