List comments

GET /api/patches/74620/comments/
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

[
    {
        "id": 116953,
        "web_url": "https://patches.dpdk.org/comment/116953/",
        "msgid": "<3232006.abz6jIGztJ@thomas>",
        "date": "2020-07-30T21:15:21",
        "subject": "Re: [dpdk-dev] [PATCH 2/2] examples/l2fwd-crypto: Free resources on\n\texit",
        "submitter": {
            "id": 685,
            "url": "https://patches.dpdk.org/api/people/685/",
            "name": "Thomas Monjalon",
            "email": "thomas@monjalon.net"
        },
        "content": "Declan is not reviewing patches anymore.\nAdding more maintainers in Cc.\n\nPS: Maybe we should update the file MAINTAINERS\nto avoid patches being stuck.\n\n\n22/07/2020 14:50, Ibtisam Tariq:\n> When exiting the application, resources should be cleared.\n> \n> Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>\n> ---\n>  examples/l2fwd-crypto/main.c | 31 ++++++++++++++++++++++++++++++-\n>  1 file changed, 30 insertions(+), 1 deletion(-)\n> \n> diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c\n> index 827da9b3e..5b00e2ade 100644\n> --- a/examples/l2fwd-crypto/main.c\n> +++ b/examples/l2fwd-crypto/main.c\n> @@ -18,6 +18,7 @@\n>  #include <getopt.h>\n>  #include <fcntl.h>\n>  #include <unistd.h>\n> +#include <signal.h>\n>  \n>  #include <rte_string_fns.h>\n>  #include <rte_atomic.h>\n> @@ -47,6 +48,8 @@\n>  #include <rte_cryptodev_scheduler.h>\n>  #endif\n>  \n> +static volatile bool force_quit;\n> +\n>  enum cdev_type {\n>  \tCDEV_TYPE_ANY,\n>  \tCDEV_TYPE_HW,\n> @@ -838,7 +841,7 @@ l2fwd_main_loop(struct l2fwd_crypto_options *options)\n>  \t * so user can see the crypto information.\n>  \t */\n>  \tprev_tsc = rte_rdtsc();\n> -\twhile (1) {\n> +\twhile (!force_quit) {\n>  \n>  \t\tcur_tsc = rte_rdtsc();\n>  \n> @@ -1738,8 +1741,12 @@ check_all_ports_link_status(uint32_t port_mask)\n>  \tprintf(\"\\nChecking link status\");\n>  \tfflush(stdout);\n>  \tfor (count = 0; count <= MAX_CHECK_TIME; count++) {\n> +\t\tif (force_quit)\n> +\t\t\treturn;\n>  \t\tall_ports_up = 1;\n>  \t\tRTE_ETH_FOREACH_DEV(portid) {\n> +\t\t\tif (force_quit)\n> +\t\t\t\treturn;\n>  \t\t\tif ((port_mask & (1 << portid)) == 0)\n>  \t\t\t\tcontinue;\n>  \t\t\tmemset(&link, 0, sizeof(link));\n> @@ -2662,6 +2669,16 @@ reserve_key_memory(struct l2fwd_crypto_options *options)\n>  \toptions->aad.phys_addr = rte_malloc_virt2iova(options->aad.data);\n>  }\n>  \n> +static void\n> +signal_handler(int signum)\n> +{\n> +\tif (signum == SIGINT || signum == SIGTERM) {\n> +\t\tprintf(\"\\n\\nSignal %d received, preparing to exit...\\n\",\n> +\t\t\t\tsignum);\n> +\t\tforce_quit = true;\n> +\t}\n> +}\n> +\n>  int\n>  main(int argc, char **argv)\n>  {\n> @@ -2681,6 +2698,10 @@ main(int argc, char **argv)\n>  \targc -= ret;\n>  \targv += ret;\n>  \n> +\tforce_quit = false;\n> +\tsignal(SIGINT, signal_handler);\n> +\tsignal(SIGTERM, signal_handler);\n> +\n>  \t/* reserve memory for Cipher/Auth key and IV */\n>  \treserve_key_memory(&options);\n>  \n> @@ -2807,6 +2828,14 @@ main(int argc, char **argv)\n>  \t\tif (rte_eal_wait_lcore(lcore_id) < 0)\n>  \t\t\treturn -1;\n>  \t}\n> +\tRTE_ETH_FOREACH_DEV(portid) {\n> +\t\tprintf(\"Closing port %d...\", portid);\n> +\t\trte_eth_dev_stop(portid);\n> +\t\trte_eth_dev_close(portid);\n> +\t\tprintf(\" Done\\n\");\n> +\t}\n> +\trte_eal_cleanup();\n> +\tprintf(\"Bye...\\n\");\n>  \n>  \treturn 0;\n>  }\n>",
        "headers": {
            "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
            "X-Mailman-Version": "2.1.15",
            "Precedence": "list",
            "X-ME-Sender": "<xms:azgjX1Yhnv-YMMkZkDaRVxPPeLs_Fwh5XmHSXa_FGHFt3XRwh_byMQ>",
            "X-Original-To": "patchwork@inbox.dpdk.org",
            "X-ME-Proxy": "<xmx:azgjX8aRhX9XNBblLi1o0UKqbYypvpBEE6tAMwts9YsQrXaJH4PpeQ>\n <xmx:azgjX39Nv1r2TzbwkPhmvOpymTUbNE8m1o2wRyZHqkFVldHErLwPkw>\n <xmx:azgjXzqFC1sypEKN2y5nwVFPvGT3WVf6SHpL9FKuCeYl9abpPv99Xw>\n <xmx:bTgjX1ARu5cr8LcMo4qn8CNems4RuXorjxSTYU-APdRJqmubvuJqvQ>",
            "List-Post": "<mailto:dev@dpdk.org>",
            "MIME-Version": "1.0",
            "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
            "X-BeenThere": "dev@dpdk.org",
            "References": "<20200722125026.2595-1-ibtisam.tariq@emumba.com>\n <20200722125026.2595-2-ibtisam.tariq@emumba.com>",
            "Subject": "Re: [dpdk-dev] [PATCH 2/2] examples/l2fwd-crypto: Free resources on\n\texit",
            "Content-Type": "text/plain; charset=\"us-ascii\"",
            "Delivered-To": "patchwork@inbox.dpdk.org",
            "Received": [
                "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 07C80A052B;\n\tThu, 30 Jul 2020 23:15:29 +0200 (CEST)",
                "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BE0402BB8;\n\tThu, 30 Jul 2020 23:15:28 +0200 (CEST)",
                "from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com\n [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id C6E8010A3\n for <dev@dpdk.org>; Thu, 30 Jul 2020 23:15:26 +0200 (CEST)",
                "from compute7.internal (compute7.nyi.internal [10.202.2.47])\n by mailout.nyi.internal (Postfix) with ESMTP id 12EE65C0189;\n Thu, 30 Jul 2020 17:15:25 -0400 (EDT)",
                "from mailfrontend1 ([10.202.2.162])\n by compute7.internal (MEProxy); Thu, 30 Jul 2020 17:15:25 -0400",
                "from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])\n by mail.messagingengine.com (Postfix) with ESMTPA id DA9EF3280060;\n Thu, 30 Jul 2020 17:15:22 -0400 (EDT)"
            ],
            "Sender": "\"dev\" <dev-bounces@dpdk.org>",
            "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
            "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
            "DKIM-Signature": [
                "v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=\n from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding:content-type; s=fm1; bh=\n 0MhvvsnI33N2dgfJFR5DyXcX/3/fYo+r8zUopEsFkDQ=; b=GyKgGo98ALbzNeXs\n empN/CHXjljQeAUpXfOovNJWfzyyn6MLF0KMZ4p7LLxutcMS6z6Z37OnrKmkpkKM\n G7lQbF/1SP+6bi5fr2vKVUkjWqsxLuXN/xBGaPb4vY8afrgudUnqwiOJvfG268Oc\n MnE7nJSTM/3dWFBcwtdiHIHqc/5AyhhlVPwNiLtP2G1iFhHOQJnYCGa9o9wO+5lK\n LSbY8+jEaFLbCK3AUQ2qxUEHYugXZNRkPwhTxjIvWn/4fBqATvuhkbxJfIqfSWtx\n XpEynFcAqr+QDg2U0qoxroU3x/2MhyOdFkSfAZ8jlCmGmvi1O8CINQe1m1GEjo2/\n Y8fZVA==",
                "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n messagingengine.com; h=cc:content-transfer-encoding:content-type\n :date:from:in-reply-to:message-id:mime-version:references\n :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender\n :x-sasl-enc; s=fm3; bh=0MhvvsnI33N2dgfJFR5DyXcX/3/fYo+r8zUopEsFk\n DQ=; b=Mp5SsPMBgCfOjcPfkjZihToNfx0TyRMyvP+58agQnqDHBtZjFZ/K9NNDi\n HLLTDzvKOl5Npg7UHRYXcRSlvuXIfhTcf1S3HKDtcYa7qo/3PoLYo55gjlaUylQJ\n k08ZffWe5qkg4osbqqsRVg3u6hdgECe8EQ2xeSUFT7rN2nZScseB97NKLs/tHzxF\n 2K/66kDRq5lHApQYWTkd+fr/B3qmLGaaKMV7M5nwdOyg+py2VGe6VarYODmbyG/+\n /E3Tg16a4kDFdmZUwIUOf/5H/IaJnWZh3LiSpdHj7ojVq+GfCbyMyEp6uhEQFaoL\n L9vJvP+tHuUhJumEPO1M9fPe+Redw=="
            ],
            "Message-ID": "<3232006.abz6jIGztJ@thomas>",
            "Date": "Thu, 30 Jul 2020 23:15:21 +0200",
            "Content-Transfer-Encoding": "7Bit",
            "To": "Ibtisam Tariq <ibtisam.tariq@emumba.com>",
            "From": "Thomas Monjalon <thomas@monjalon.net>",
            "X-ME-Proxy-Cause": "\n gggruggvucftvghtrhhoucdtuddrgeduiedrieeigdduiedtucetufdoteggodetrfdotf\n fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen\n uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne\n cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr\n shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg\n ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu\n ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf\n hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl\n ohhnrdhnvght",
            "In-Reply-To": "<20200722125026.2595-2-ibtisam.tariq@emumba.com>",
            "Cc": "declan.doherty@intel.com, dev@dpdk.org, akhil.goyal@nxp.com,\n anoobj@marvell.com, bruce.richardson@intel.com, fiona.trahe@intel.com,\n ruifeng.wang@arm.com, pablo.de.lara.guarch@intel.com",
            "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
            "Errors-To": "dev-bounces@dpdk.org",
            "Return-Path": "<dev-bounces@dpdk.org>"
        }
    }
]