get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8337,
    "url": "http://patches.dpdk.org/api/patches/8337/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1446193240-2223-1-git-send-email-xutao.sun@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "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",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1446193240-2223-1-git-send-email-xutao.sun@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1446193240-2223-1-git-send-email-xutao.sun@intel.com",
    "date": "2015-10-30T08:20:40",
    "name": "[dpdk-dev,v5] i40e: Fix the statistics issue of i40e",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f8fc6582a84b267e56e44e4ebbcb857e1e0c691f",
    "submitter": {
        "id": 347,
        "url": "http://patches.dpdk.org/api/people/347/?format=api",
        "name": "Xutao Sun",
        "email": "xutao.sun@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1446193240-2223-1-git-send-email-xutao.sun@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/8337/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/8337/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 518048E7B;\n\tFri, 30 Oct 2015 09:20:53 +0100 (CET)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 293048D9F\n\tfor <dev@dpdk.org>; Fri, 30 Oct 2015 09:20:51 +0100 (CET)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga103.fm.intel.com with ESMTP; 30 Oct 2015 01:20:50 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga002.fm.intel.com with ESMTP; 30 Oct 2015 01:20:47 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t9U8KjvW024532;\n\tFri, 30 Oct 2015 16:20:45 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t9U8Kf7e002257; Fri, 30 Oct 2015 16:20:43 +0800",
            "(from xutaosun@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9U8KfNh002253; \n\tFri, 30 Oct 2015 16:20:41 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,217,1444719600\"; d=\"scan'208\";a=\"839134203\"",
        "From": "Xutao Sun <xutao.sun@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 30 Oct 2015 16:20:40 +0800",
        "Message-Id": "<1446193240-2223-1-git-send-email-xutao.sun@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1446185369-29221-1-git-send-email-xutao.sun@intel.com>",
        "References": "<1446185369-29221-1-git-send-email-xutao.sun@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v5] i40e: Fix the statistics issue of i40e",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The old statistics on i40e only counted the packets on ports.\nSo the discarding packets on VSI were not counted.\nThis patch is to make statistics for packets both on ports and VSI.\nAlso update release notes.\n\nSigned-off-by: Xutao Sun <xutao.sun@intel.com>\n---\nv2:\n - reword comments\nv3:\n - update release notes\nv4:\n - fix the wrong release notes and move the doc as part of this patch\nv5:\n - fix the patch_apply issue\n\n doc/guides/rel_notes/release_2_2.rst |  4 ++++\n drivers/net/i40e/i40e_ethdev.c       | 23 ++++++++++++++---------\n 2 files changed, 18 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/release_2_2.rst b/doc/guides/rel_notes/release_2_2.rst\nindex 89e4d58..8991209 100644\n--- a/doc/guides/rel_notes/release_2_2.rst\n+++ b/doc/guides/rel_notes/release_2_2.rst\n@@ -67,6 +67,10 @@ Drivers\n   Fixed i40e issue that occurred when a DPDK application didn't initialize\n   ports if memory wasn't available on socket 0.\n \n+* **i40e: Fix statistics of packets.**\n+\n+  Add discarding packets on VSI to the stats and rectify the old statistics.\n+\n * **vhost: Fixed Qemu shutdown.**\n \n   Fixed issue with libvirt ``virsh destroy`` not killing the VM.\ndiff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c\nindex 2dd9fdc..5365192 100644\n--- a/drivers/net/i40e/i40e_ethdev.c\n+++ b/drivers/net/i40e/i40e_ethdev.c\n@@ -1511,21 +1511,26 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)\n \tif (pf->main_vsi)\n \t\ti40e_update_vsi_stats(pf->main_vsi);\n \n-\tstats->ipackets = ns->eth.rx_unicast + ns->eth.rx_multicast +\n-\t\t\t\t\t\tns->eth.rx_broadcast;\n-\tstats->opackets = ns->eth.tx_unicast + ns->eth.tx_multicast +\n-\t\t\t\t\t\tns->eth.tx_broadcast;\n-\tstats->ibytes   = ns->eth.rx_bytes;\n-\tstats->obytes   = ns->eth.tx_bytes;\n-\tstats->oerrors  = ns->eth.tx_errors;\n-\tstats->imcasts  = ns->eth.rx_multicast;\n+\tstats->ipackets = pf->main_vsi->eth_stats.rx_unicast +\n+\t\t\tpf->main_vsi->eth_stats.rx_multicast +\n+\t\t\tpf->main_vsi->eth_stats.rx_broadcast -\n+\t\t\tpf->main_vsi->eth_stats.rx_discards;\n+\tstats->opackets = pf->main_vsi->eth_stats.tx_unicast +\n+\t\t\tpf->main_vsi->eth_stats.tx_multicast +\n+\t\t\tpf->main_vsi->eth_stats.tx_broadcast;\n+\tstats->ibytes   = pf->main_vsi->eth_stats.rx_bytes;\n+\tstats->obytes   = pf->main_vsi->eth_stats.tx_bytes;\n+\tstats->oerrors  = ns->eth.tx_errors +\n+\t\t\tpf->main_vsi->eth_stats.tx_errors;\n+\tstats->imcasts  = pf->main_vsi->eth_stats.rx_multicast;\n \tstats->fdirmatch = ns->fd_sb_match;\n \n \t/* Rx Errors */\n \tstats->ibadcrc  = ns->crc_errors;\n \tstats->ibadlen  = ns->rx_length_errors + ns->rx_undersize +\n \t\t\tns->rx_oversize + ns->rx_fragments + ns->rx_jabber;\n-\tstats->imissed  = ns->eth.rx_discards;\n+\tstats->imissed  = ns->eth.rx_discards +\n+\t\t\tpf->main_vsi->eth_stats.rx_discards;\n \tstats->ierrors  = stats->ibadcrc + stats->ibadlen + stats->imissed;\n \n \tPMD_DRV_LOG(DEBUG, \"***************** PF stats start *******************\");\n",
    "prefixes": [
        "dpdk-dev",
        "v5"
    ]
}