Show a patch.

GET /api/patches/46928/
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 46928,
    "url": "http://patches.dpdk.org/api/patches/46928/",
    "web_url": "http://patches.dpdk.org/patch/46928/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk"
    },
    "msgid": "<20181017010412.23141-7-dg@adax.com>",
    "date": "2018-10-17T01:04:13",
    "name": "[v4,6/6] examples/kni: improve zeroing statistics",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f596d91eadc0abfe1a32e599b20a2eacbf8f8ea1",
    "submitter": {
        "id": 1040,
        "url": "http://patches.dpdk.org/api/people/1040/",
        "name": "Dan Gora",
        "email": "dg@adax.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/patch/46928/mbox/",
    "series": [
        {
            "id": 1288,
            "url": "http://patches.dpdk.org/api/series/1288/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1288",
            "date": "2018-09-11T23:29:04",
            "name": "kni: add API to set link status on kernel interface",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/1288/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/46928/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/46928/checks/",
    "tags": {},
    "headers": {
        "X-Mailman-Version": "2.1.15",
        "Date": "Tue, 16 Oct 2018 22:04:13 -0300",
        "In-Reply-To": "<20180911232906.18352-1-dg@adax.com>",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-Mailer": "git-send-email 2.19.0",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id E19785B36;\n\tWed, 17 Oct 2018 03:04:57 +0200 (CEST)",
            "from mail-qk1-f196.google.com (mail-qk1-f196.google.com\n\t[209.85.222.196]) by dpdk.org (Postfix) with ESMTP id D2C175B12\n\tfor <dev@dpdk.org>; Wed, 17 Oct 2018 03:04:52 +0200 (CEST)",
            "by mail-qk1-f196.google.com with SMTP id 84-v6so15464382qkf.0\n\tfor <dev@dpdk.org>; Tue, 16 Oct 2018 18:04:52 -0700 (PDT)",
            "from snappy.local.lan ([187.74.142.5])\n\tby smtp.gmail.com with ESMTPSA id\n\tv54-v6sm19547508qtc.81.2018.10.16.18.04.49\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tTue, 16 Oct 2018 18:04:51 -0700 (PDT)"
        ],
        "References": "<20180911232906.18352-1-dg@adax.com>",
        "X-Google-Smtp-Source": "ACcGV61vDquaGJXIXgw5hJnxNVcJzSdsPd1DQ37A7smWLjS7vEbzqbEz4RmLa1KvmhLPR/oHEAZSIg==",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=hJm2Nz7jWrFJUyXegi5KeKO7sLlN5Uz928Q+fW2s80k=;\n\tb=E9MFnC5yAJoLkVipzMVUF82P5VsPiOFz4KHQq+eLv6eVMV021ZahTDZfTpOYs5QMr2\n\t5io2dYWc6nXxnBH/CtApLicHFy1sZdofc2LoDlR7toLAtXipbApVhV1kG9uqnG9kI8+P\n\tHlNbdG7658gw4DKdulJA+qCuxvTj7vyur6rKTx98GCJdldDVQ3z27DzaAwmRqe78KuXb\n\tX3qbJQhF1fAtDqetRun9nju1nnm+4RkDz6axQHflUqTaCKweZdmK5t8eQMV+RHRQ3Shs\n\thztjzY7ryPgGgG6V4oz/35wtyBXKw1lFJOlRc3CquRBYKN1ICcgOKHTzq2rpid4Iuaaa\n\t2AvA==",
        "MIME-Version": "1.0",
        "X-Received": "by 2002:a37:634e:: with SMTP id\n\tx75-v6mr4041099qkb.122.1539738291885; \n\tTue, 16 Oct 2018 18:04:51 -0700 (PDT)",
        "Message-Id": "<20181017010412.23141-7-dg@adax.com>",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:from:to:cc:subject:date:message-id\n\t:in-reply-to:references:mime-version:content-transfer-encoding;\n\tbh=hJm2Nz7jWrFJUyXegi5KeKO7sLlN5Uz928Q+fW2s80k=;\n\tb=INzfkKAPsZECptQceoS741yKfp9FVmDGUyV/k5BZNBdNhBhCQiIdMEl+I2L1BtPgPt\n\tv+BGY/OPCnZ1udgRG+S1snE+4Vx3/m54sKYQTyBSO+dsTSihnbwpbNuvHSDynp+jIuFh\n\tGJOf6zpMdCaGzFzSNRWgAD+VLgGWERNhK7N+DIWbFkTomShEmNYsbIql3Lt/lCeFvScO\n\ty+SC33W270wpPzS+MMlp6O5aWfBAC+qEdcAB/nidRu8hzn9P4aXAT94DDb4fqVtxOleO\n\tpAQSHMEOu/+U62+FDtKTHXwBVDMOKp4bdzQeo3KnTDjsSzZ4F381g3H0IWktwhaYQj0I\n\tkYTg==",
        "Delivered-To": "patchwork@dpdk.org",
        "Content-Transfer-Encoding": "8bit",
        "From": "Dan Gora <dg@adax.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "To": "dev@dpdk.org",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-BeenThere": "dev@dpdk.org",
        "X-Gm-Message-State": "ABuFfojNS6p31IeSJ4nviouT8WaEMLsADvJuxZsFqnyTaamckeqgRAfo\n\tT1z/dJVkwUWmhMN6nnj69Jw4C9Wd5+4=",
        "Cc": "Igor Ryzhov <iryzhov@nfware.com>,\n\tStephen Hemminger <stephen@networkplumber.org>,\n\tFerruh Yigit <ferruh.yigit@intel.com>, Dan Gora <dg@adax.com>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Subject": "[dpdk-dev] [PATCH v4 6/6] examples/kni: improve zeroing statistics"
    },
    "content": "The worker threads incrementing the rx/tx_packets race with the signal\nhandler from the main thread zeroing the entire statistics structure.\nThis can cause the statistics to fail to be zeroed, even when there\nis no traffic on those interfaces.\n\nImprove zeroing the statistics by only incrementing rx/tx_packets\nin worker threads by a non-zero amount.  This limits the race to the\nperiods in which traffic is actually being received or transmitted.\n\nSigned-off-by: Dan Gora <dg@adax.com>\n---\n examples/kni/main.c | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/examples/kni/main.c b/examples/kni/main.c\nindex 314e19c68..3ae4c13a2 100644\n--- a/examples/kni/main.c\n+++ b/examples/kni/main.c\n@@ -223,7 +223,8 @@ kni_ingress(struct kni_port_params *p)\n \t\t}\n \t\t/* Burst tx to kni */\n \t\tnum = rte_kni_tx_burst(p->kni[i], pkts_burst, nb_rx);\n-\t\tkni_stats[port_id].rx_packets += num;\n+\t\tif (num)\n+\t\t\tkni_stats[port_id].rx_packets += num;\n \n \t\trte_kni_handle_request(p->kni[i]);\n \t\tif (unlikely(num < nb_rx)) {\n@@ -260,7 +261,8 @@ kni_egress(struct kni_port_params *p)\n \t\t}\n \t\t/* Burst tx to eth */\n \t\tnb_tx = rte_eth_tx_burst(port_id, 0, pkts_burst, (uint16_t)num);\n-\t\tkni_stats[port_id].tx_packets += nb_tx;\n+\t\tif (nb_tx)\n+\t\t\tkni_stats[port_id].tx_packets += nb_tx;\n \t\tif (unlikely(nb_tx < num)) {\n \t\t\t/* Free mbufs not tx to NIC */\n \t\t\tkni_burst_free_mbufs(&pkts_burst[nb_tx], num - nb_tx);\n",
    "prefixes": [
        "v4",
        "6/6"
    ]
}