get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1226,
    "url": "https://patches.dpdk.org/api/patches/1226/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1415579379-2891-3-git-send-email-huawei.xie@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1415579379-2891-3-git-send-email-huawei.xie@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1415579379-2891-3-git-send-email-huawei.xie@intel.com",
    "date": "2014-11-10T00:29:39",
    "name": "[dpdk-dev,v2,2/2] examples/vmdq: fix cs issues in vmdq example",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "9487a43c1c5ee6da1881437625cd3e9595c0ceb8",
    "submitter": {
        "id": 16,
        "url": "https://patches.dpdk.org/api/people/16/?format=api",
        "name": "Huawei Xie",
        "email": "huawei.xie@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1415579379-2891-3-git-send-email-huawei.xie@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1226/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1226/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 CD7C858F1;\n\tMon, 10 Nov 2014 01:20:35 +0100 (CET)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 788FC4A6E\n\tfor <dev@dpdk.org>; Mon, 10 Nov 2014 01:20:28 +0100 (CET)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga102.jf.intel.com with ESMTP; 09 Nov 2014 16:28:22 -0800",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga003.jf.intel.com with ESMTP; 09 Nov 2014 16:28:31 -0800",
            "from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com\n\t[10.239.29.90])\n\tby shvmail01.sh.intel.com with ESMTP id sAA0U8KP001245;\n\tMon, 10 Nov 2014 08:30:08 +0800",
            "from shecgisg003.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid sAA0U6kR002974; Mon, 10 Nov 2014 08:30:08 +0800",
            "(from hxie5@localhost)\n\tby shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id sAA0U65Z002970; \n\tMon, 10 Nov 2014 08:30:06 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,691,1406617200\"; d=\"scan'208\";a=\"486046153\"",
        "From": "Huawei Xie <huawei.xie@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Mon, 10 Nov 2014 08:29:39 +0800",
        "Message-Id": "<1415579379-2891-3-git-send-email-huawei.xie@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1415579379-2891-1-git-send-email-huawei.xie@intel.com>",
        "References": "<1415579379-2891-1-git-send-email-huawei.xie@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 2/2] examples/vmdq: fix cs issues in vmdq\n\texample",
        "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": "Signed-off-by: Huawei Xie <huawei.xie@intel.com>\n---\n examples/vmdq/main.c | 64 +++++++++++++++++++++++++++++-----------------------\n 1 file changed, 36 insertions(+), 28 deletions(-)",
    "diff": "diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c\nindex 5a2305f..e60b671 100644\n--- a/examples/vmdq/main.c\n+++ b/examples/vmdq/main.c\n@@ -92,7 +92,7 @@\n #define INVALID_PORT_ID 0xFF\n \n /* mask of enabled ports */\n-static uint32_t enabled_port_mask = 0;\n+static uint32_t enabled_port_mask;\n \n /* number of pools (if user does not specify any, 8 by default */\n static uint32_t num_queues = 8;\n@@ -129,10 +129,10 @@ static const struct rte_eth_conf vmdq_conf_default = {\n \n static unsigned lcore_ids[RTE_MAX_LCORE];\n static uint8_t ports[RTE_MAX_ETHPORTS];\n-static unsigned num_ports = 0; /**< The number of ports specified in command line */\n+static unsigned num_ports; /**< The number of ports specified in command line */\n \n /* array used for printing out statistics */\n-volatile unsigned long rxPackets[ MAX_QUEUES ] = {0};\n+volatile unsigned long rxPackets[MAX_QUEUES] = {0};\n \n const uint16_t vlan_tags[] = {\n \t0,  1,  2,  3,  4,  5,  6,  7,\n@@ -161,8 +161,11 @@ static struct ether_addr vmdq_ports_eth_addr[RTE_MAX_ETHPORTS];\n #define MAX_POOL_MAP_NUM_1G 32\n #define MAX_POOL_NUM_10G 64\n #define MAX_POOL_NUM_1G 8\n-/* Builds up the correct configuration for vmdq based on the vlan tags array\n- * given above, and determine the queue number and pool map number according to valid pool number */\n+/*\n+ * Builds up the correct configuration for vmdq based on the vlan tags array\n+ * given above, and determine the queue number and pool map number according to\n+ * valid pool number\n+ */\n static inline int\n get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_pools)\n {\n@@ -174,8 +177,8 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_pools)\n \tconf.enable_default_pool = 0;\n \tconf.default_pool = 0; /* set explicit value, even if not used */\n \n-\tfor (i = 0; i < conf.nb_pool_maps; i++){\n-\t\tconf.pool_map[i].vlan_id = vlan_tags[ i ];\n+\tfor (i = 0; i < conf.nb_pool_maps; i++) {\n+\t\tconf.pool_map[i].vlan_id = vlan_tags[i];\n \t\tconf.pool_map[i].pools = (1UL << (i % num_pools));\n \t}\n \n@@ -202,8 +205,11 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)\n \tuint16_t queues_per_pool;\n \tuint32_t max_nb_pools;\n \n-\t/* The max pool number from dev_info will be used to validate the pool number specified in cmd line */\n-\trte_eth_dev_info_get (port, &dev_info);\n+\t/*\n+\t * The max pool number from dev_info will be used to validate the pool\n+\t * number specified in cmd line\n+\t */\n+\trte_eth_dev_info_get(port, &dev_info);\n \tmax_nb_pools = (uint32_t)dev_info.max_vmdq_pools;\n \t/*\n \t * We allow to process part of VMDQ pools specified by num_pools in\n@@ -234,7 +240,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)\n \t\tnum_pf_queues, num_pools, queues_per_pool);\n \tprintf(\"vmdq queue base: %d pool base %d\\n\",\n \t\tvmdq_queue_base, vmdq_pool_base);\n-\tif (port >= rte_eth_dev_count()) return -1;\n+\tif (port >= rte_eth_dev_count())\n+\t\treturn -1;\n \n \t/*\n \t * Though in this example, we only receive packets from the first queue\n@@ -253,7 +260,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)\n \trte_eth_dev_info_get(port, &dev_info);\n \trxconf = &dev_info.default_rxconf;\n \trxconf->rx_drop_en = 1;\n-\tfor (q = 0; q < rxRings; q ++) {\n+\tfor (q = 0; q < rxRings; q++) {\n \t\tretval = rte_eth_rx_queue_setup(port, q, rxRingSize,\n \t\t\t\t\trte_eth_dev_socket_id(port),\n \t\t\t\t\trxconf,\n@@ -264,7 +271,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)\n \t\t}\n \t}\n \n-\tfor (q = 0; q < txRings; q ++) {\n+\tfor (q = 0; q < txRings; q++) {\n \t\tretval = rte_eth_tx_queue_setup(port, q, txRingSize,\n \t\t\t\t\trte_eth_dev_socket_id(port),\n \t\t\t\t\tNULL);\n@@ -380,7 +387,8 @@ vmdq_parse_args(int argc, char **argv)\n \t};\n \n \t/* Parse command line */\n-\twhile ((opt = getopt_long(argc, argv, \"p:\",long_option,&option_index)) != EOF) {\n+\twhile ((opt = getopt_long(argc, argv, \"p:\", long_option,\n+\t\t&option_index)) != EOF) {\n \t\tswitch (opt) {\n \t\t/* portmask */\n \t\tcase 'p':\n@@ -392,7 +400,7 @@ vmdq_parse_args(int argc, char **argv)\n \t\t\t}\n \t\t\tbreak;\n \t\tcase 0:\n-\t\t\tif (vmdq_parse_num_pools(optarg) == -1){\n+\t\t\tif (vmdq_parse_num_pools(optarg) == -1) {\n \t\t\t\tprintf(\"invalid number of pools\\n\");\n \t\t\t\tvmdq_usage(prgname);\n \t\t\t\treturn -1;\n@@ -405,14 +413,14 @@ vmdq_parse_args(int argc, char **argv)\n \t\t}\n \t}\n \n-\tfor(i = 0; i < RTE_MAX_ETHPORTS; i++) {\n+\tfor (i = 0; i < RTE_MAX_ETHPORTS; i++) {\n \t\tif (enabled_port_mask & (1 << i))\n \t\t\tports[num_ports++] = (uint8_t)i;\n \t}\n \n \tif (num_ports < 2 || num_ports % 2) {\n \t\tprintf(\"Current enabled port number is %u,\"\n-\t\t\t\"but it should be even and at least 2\\n\",num_ports);\n+\t\t\t\"but it should be even and at least 2\\n\", num_ports);\n \t\treturn -1;\n \t}\n \n@@ -441,10 +449,10 @@ static void\n sighup_handler(int signum)\n {\n \tunsigned q;\n-\tfor (q = 0; q < num_queues; q ++) {\n+\tfor (q = 0; q < num_queues; q++) {\n \t\tif (q % (num_queues/num_pools) == 0)\n \t\t\tprintf(\"\\nPool %u: \", q/(num_queues/num_pools));\n-\t\tprintf(\"%lu \", rxPackets[ q ]);\n+\t\tprintf(\"%lu \", rxPackets[q]);\n \t}\n \tprintf(\"\\nFinished handling signal %d\\n\", signum);\n }\n@@ -455,7 +463,7 @@ sighup_handler(int signum)\n  * and writing to OUTPUT_PORT\n  */\n static int\n-lcore_main(__attribute__((__unused__)) void* dummy)\n+lcore_main(__attribute__((__unused__)) void *dummy)\n {\n \tconst uint16_t lcore_id = (uint16_t)rte_lcore_id();\n \tconst uint16_t num_cores = (uint16_t)rte_lcore_count();\n@@ -464,7 +472,7 @@ lcore_main(__attribute__((__unused__)) void* dummy)\n \tuint16_t q, i, p;\n \tconst uint16_t remainder = (uint16_t)(num_vmdq_queues % num_cores);\n \n-\tfor (i = 0; i < num_cores; i ++)\n+\tfor (i = 0; i < num_cores; i++)\n \t\tif (lcore_ids[i] == lcore_id) {\n \t\t\tcore_id = i;\n \t\t\tbreak;\n@@ -498,7 +506,7 @@ lcore_main(__attribute__((__unused__)) void* dummy)\n \n \tif (startQueue == endQueue) {\n \t\tprintf(\"lcore %u has nothing to do\\n\", lcore_id);\n-\t\treturn (0);\n+\t\treturn 0;\n \t}\n \n \tfor (;;) {\n@@ -507,8 +515,8 @@ lcore_main(__attribute__((__unused__)) void* dummy)\n \n \t\tfor (p = 0; p < num_ports; p++) {\n \t\t\tconst uint8_t sport = ports[p];\n-\t\t\tconst uint8_t dport = ports[p ^ 1]; /* 0 <-> 1, 2 <-> 3 etc */\n-\n+\t\t\t/* 0 <-> 1, 2 <-> 3 etc */\n+\t\t\tconst uint8_t dport = ports[p ^ 1];\n \t\t\tif ((sport == INVALID_PORT_ID) || (dport == INVALID_PORT_ID))\n \t\t\t\tcontinue;\n \n@@ -553,12 +561,12 @@ static unsigned check_ports_num(unsigned nb_ports)\n \t\tnum_ports = nb_ports;\n \t}\n \n-\tfor (portid = 0; portid < num_ports; portid ++) {\n+\tfor (portid = 0; portid < num_ports; portid++) {\n \t\tif (ports[portid] >= nb_ports) {\n \t\t\tprintf(\"\\nSpecified port ID(%u) exceeds max system port ID(%u)\\n\",\n \t\t\t\tports[portid], (nb_ports - 1));\n \t\t\tports[portid] = INVALID_PORT_ID;\n-\t\t\tvalid_num_ports --;\n+\t\t\tvalid_num_ports--;\n \t\t}\n \t}\n \treturn valid_num_ports;\n@@ -590,12 +598,12 @@ MAIN(int argc, char *argv[])\n \tif (ret < 0)\n \t\trte_exit(EXIT_FAILURE, \"Invalid VMDQ argument\\n\");\n \n-\tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id ++)\n+\tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++)\n \t\tif (rte_lcore_is_enabled(lcore_id))\n-\t\t\tlcore_ids[core_id ++] = lcore_id;\n+\t\t\tlcore_ids[core_id++] = lcore_id;\n \n \tif (rte_lcore_count() > RTE_MAX_LCORE)\n-\t\trte_exit(EXIT_FAILURE,\"Not enough cores\\n\");\n+\t\trte_exit(EXIT_FAILURE, \"Not enough cores\\n\");\n \n \tnb_ports = rte_eth_dev_count();\n \tif (nb_ports > RTE_MAX_ETHPORTS)\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "2/2"
    ]
}