Show a patch.

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

{
    "id": 41656,
    "url": "http://patches.dpdk.org/api/patches/41656/?format=api",
    "web_url": "http://patches.dpdk.org/patch/41656/",
    "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"
    },
    "msgid": "<1530096938-71399-6-git-send-email-nikhil.rao@intel.com>",
    "date": "2018-06-27T10:55:38",
    "name": "[v2,5/5] eventdev: add Rx adapter tests for interrupt driven queues",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "85e208d1ba1188334cf259915107627879653bcb",
    "submitter": {
        "id": 528,
        "url": "http://patches.dpdk.org/api/people/528/?format=api",
        "name": "Rao, Nikhil",
        "email": "nikhil.rao@intel.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerin.jacob@caviumnetworks.com"
    },
    "mbox": "http://patches.dpdk.org/patch/41656/mbox/",
    "series": [
        {
            "id": 260,
            "url": "http://patches.dpdk.org/api/series/260/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=260",
            "date": "2018-06-27T10:55:33",
            "name": "eventdev: add interrupt driven queues to Rx adapter",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/260/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/41656/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/41656/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,278,1526367600\"; d=\"scan'208\";a=\"52634805\"",
        "X-Amp-File-Uploaded": "False",
        "Precedence": "list",
        "X-Mailman-Version": "2.1.15",
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "References": "<1528481718-7241-1-git-send-email-nikhil.rao@intel.com>\n\t<1530096938-71399-1-git-send-email-nikhil.rao@intel.com>",
        "X-BeenThere": "dev@dpdk.org",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH v2 5/5] eventdev: add Rx adapter tests for\n\tinterrupt driven queues",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 87C4D1BEE6;\n\tWed, 27 Jun 2018 12:56:09 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 7B3291BE4E\n\tfor <dev@dpdk.org>; Wed, 27 Jun 2018 12:55:57 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Jun 2018 03:55:57 -0700",
            "from unknown (HELO localhost.localdomain.localdomain)\n\t([10.224.122.193])\n\tby orsmga008.jf.intel.com with ESMTP; 27 Jun 2018 03:55:55 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-ExtLoop1": "1",
        "Date": "Wed, 27 Jun 2018 16:25:38 +0530",
        "To": "jerin.jacob@caviumnetworks.com",
        "From": "Nikhil Rao <nikhil.rao@intel.com>",
        "In-Reply-To": "<1530096938-71399-1-git-send-email-nikhil.rao@intel.com>",
        "Cc": "nikhil.rao@intel.com,\n\tdev@dpdk.org",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<1530096938-71399-6-git-send-email-nikhil.rao@intel.com>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "Add test for queue add and delete, the add/delete calls\nalso switch queues between poll and interrupt mode.\n\nSigned-off-by: Nikhil Rao <nikhil.rao@intel.com>\n---\n test/test/test_event_eth_rx_adapter.c | 261 +++++++++++++++++++++++++++++++---\n 1 file changed, 242 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/test/test/test_event_eth_rx_adapter.c b/test/test/test_event_eth_rx_adapter.c\nindex d432731..2337e54 100644\n--- a/test/test/test_event_eth_rx_adapter.c\n+++ b/test/test/test_event_eth_rx_adapter.c\n@@ -25,28 +25,17 @@ struct event_eth_rx_adapter_test_params {\n \tstruct rte_mempool *mp;\n \tuint16_t rx_rings, tx_rings;\n \tuint32_t caps;\n+\tint rx_intr_port_inited;\n+\tuint16_t rx_intr_port;\n };\n \n static struct event_eth_rx_adapter_test_params default_params;\n \n static inline int\n-port_init(uint8_t port, struct rte_mempool *mp)\n+port_init_common(uint8_t port, const struct rte_eth_conf *port_conf,\n+\t\tstruct rte_mempool *mp)\n {\n-\tstatic const struct rte_eth_conf port_conf_default = {\n-\t\t.rxmode = {\n-\t\t\t.mq_mode = ETH_MQ_RX_RSS,\n-\t\t\t.max_rx_pkt_len = ETHER_MAX_LEN\n-\t\t},\n-\t\t.rx_adv_conf = {\n-\t\t\t.rss_conf = {\n-\t\t\t\t.rss_hf = ETH_RSS_IP |\n-\t\t\t\t\t  ETH_RSS_TCP |\n-\t\t\t\t\t  ETH_RSS_UDP,\n-\t\t\t}\n-\t\t}\n-\t};\n \tconst uint16_t rx_ring_size = 512, tx_ring_size = 512;\n-\tstruct rte_eth_conf port_conf = port_conf_default;\n \tint retval;\n \tuint16_t q;\n \tstruct rte_eth_dev_info dev_info;\n@@ -54,7 +43,7 @@ struct event_eth_rx_adapter_test_params {\n \tif (!rte_eth_dev_is_valid_port(port))\n \t\treturn -1;\n \n-\tretval = rte_eth_dev_configure(port, 0, 0, &port_conf);\n+\tretval = rte_eth_dev_configure(port, 0, 0, port_conf);\n \n \trte_eth_dev_info_get(port, &dev_info);\n \n@@ -64,7 +53,7 @@ struct event_eth_rx_adapter_test_params {\n \n \t/* Configure the Ethernet device. */\n \tretval = rte_eth_dev_configure(port, default_params.rx_rings,\n-\t\t\t\tdefault_params.tx_rings, &port_conf);\n+\t\t\t\tdefault_params.tx_rings, port_conf);\n \tif (retval != 0)\n \t\treturn retval;\n \n@@ -104,6 +93,77 @@ struct event_eth_rx_adapter_test_params {\n \treturn 0;\n }\n \n+static inline int\n+port_init_rx_intr(uint8_t port, struct rte_mempool *mp)\n+{\n+\tstatic const struct rte_eth_conf port_conf_default = {\n+\t\t.rxmode = {\n+\t\t\t.mq_mode = ETH_MQ_RX_RSS,\n+\t\t\t.max_rx_pkt_len = ETHER_MAX_LEN\n+\t\t},\n+\t\t.intr_conf = {\n+\t\t\t.rxq = 1,\n+\t\t},\n+\t};\n+\n+\treturn port_init_common(port, &port_conf_default, mp);\n+}\n+\n+static inline int\n+port_init(uint8_t port, struct rte_mempool *mp)\n+{\n+\tstatic const struct rte_eth_conf port_conf_default = {\n+\t\t.rxmode = {\n+\t\t\t.mq_mode = ETH_MQ_RX_RSS,\n+\t\t\t.max_rx_pkt_len = ETHER_MAX_LEN\n+\t\t},\n+\t\t.rx_adv_conf = {\n+\t\t\t.rss_conf = {\n+\t\t\t\t.rss_hf = ETH_RSS_IP |\n+\t\t\t\t\tETH_RSS_TCP |\n+\t\t\t\t\tETH_RSS_UDP,\n+\t\t\t}\n+\t\t}\n+\t};\n+\n+\treturn port_init_common(port, &port_conf_default, mp);\n+}\n+\n+static int\n+init_port_rx_intr(int num_ports)\n+{\n+\tint retval;\n+\tuint16_t portid;\n+\tint err;\n+\n+\tdefault_params.mp = rte_pktmbuf_pool_create(\"packet_pool\",\n+\t\t\t\t\t\t   NB_MBUFS,\n+\t\t\t\t\t\t   MBUF_CACHE_SIZE,\n+\t\t\t\t\t\t   MBUF_PRIV_SIZE,\n+\t\t\t\t\t\t   RTE_MBUF_DEFAULT_BUF_SIZE,\n+\t\t\t\t\t\t   rte_socket_id());\n+\tif (!default_params.mp)\n+\t\treturn -ENOMEM;\n+\n+\tRTE_ETH_FOREACH_DEV(portid) {\n+\t\tretval = port_init_rx_intr(portid, default_params.mp);\n+\t\tif (retval)\n+\t\t\tcontinue;\n+\t\terr = rte_event_eth_rx_adapter_caps_get(TEST_DEV_ID, portid,\n+\t\t\t\t\t\t\t&default_params.caps);\n+\t\tif (err)\n+\t\t\tcontinue;\n+\t\tif (!(default_params.caps &\n+\t\t\tRTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT)) {\n+\t\t\tdefault_params.rx_intr_port_inited = 1;\n+\t\t\tdefault_params.rx_intr_port = portid;\n+\t\t\treturn 0;\n+\t\t}\n+\t\trte_eth_dev_stop(portid);\n+\t}\n+\treturn 0;\n+}\n+\n static int\n init_ports(int num_ports)\n {\n@@ -181,6 +241,57 @@ struct event_eth_rx_adapter_test_params {\n \treturn err;\n }\n \n+static int\n+testsuite_setup_rx_intr(void)\n+{\n+\tint err;\n+\tuint8_t count;\n+\tstruct rte_event_dev_info dev_info;\n+\n+\tcount = rte_event_dev_count();\n+\tif (!count) {\n+\t\tprintf(\"Failed to find a valid event device,\"\n+\t\t\t\" testing with event_skeleton device\\n\");\n+\t\trte_vdev_init(\"event_skeleton\", NULL);\n+\t}\n+\n+\tstruct rte_event_dev_config config = {\n+\t\t.nb_event_queues = 1,\n+\t\t.nb_event_ports = 1,\n+\t};\n+\n+\terr = rte_event_dev_info_get(TEST_DEV_ID, &dev_info);\n+\tconfig.nb_event_queue_flows = dev_info.max_event_queue_flows;\n+\tconfig.nb_event_port_dequeue_depth =\n+\t\t\tdev_info.max_event_port_dequeue_depth;\n+\tconfig.nb_event_port_enqueue_depth =\n+\t\t\tdev_info.max_event_port_enqueue_depth;\n+\tconfig.nb_events_limit =\n+\t\t\tdev_info.max_num_events;\n+\n+\terr = rte_event_dev_configure(TEST_DEV_ID, &config);\n+\tTEST_ASSERT(err == 0, \"Event device initialization failed err %d\\n\",\n+\t\t\terr);\n+\n+\t/*\n+\t * eth devices like octeontx use event device to receive packets\n+\t * so rte_eth_dev_start invokes rte_event_dev_start internally, so\n+\t * call init_ports after rte_event_dev_configure\n+\t */\n+\terr = init_port_rx_intr(rte_eth_dev_count_total());\n+\tTEST_ASSERT(err == 0, \"Port initialization failed err %d\\n\", err);\n+\n+\tif (!default_params.rx_intr_port_inited)\n+\t\treturn 0;\n+\n+\terr = rte_event_eth_rx_adapter_caps_get(TEST_DEV_ID,\n+\t\t\t\t\t\tdefault_params.rx_intr_port,\n+\t\t\t\t\t\t&default_params.caps);\n+\tTEST_ASSERT(err == 0, \"Failed to get adapter cap err %d\\n\", err);\n+\n+\treturn err;\n+}\n+\n static void\n testsuite_teardown(void)\n {\n@@ -191,6 +302,16 @@ struct event_eth_rx_adapter_test_params {\n \trte_mempool_free(default_params.mp);\n }\n \n+static void\n+testsuite_teardown_rx_intr(void)\n+{\n+\tif (!default_params.rx_intr_port_inited)\n+\t\treturn;\n+\n+\trte_eth_dev_stop(default_params.rx_intr_port);\n+\trte_mempool_free(default_params.mp);\n+}\n+\n static int\n adapter_create(void)\n {\n@@ -401,6 +522,89 @@ struct event_eth_rx_adapter_test_params {\n }\n \n static int\n+adapter_intr_queue_add_del(void)\n+{\n+\tint err;\n+\tstruct rte_event ev;\n+\tuint32_t cap;\n+\tuint16_t eth_port;\n+\tstruct rte_event_eth_rx_adapter_queue_conf queue_config;\n+\n+\tif (!default_params.rx_intr_port_inited)\n+\t\treturn 0;\n+\n+\teth_port = default_params.rx_intr_port;\n+\terr = rte_event_eth_rx_adapter_caps_get(TEST_DEV_ID, eth_port, &cap);\n+\tTEST_ASSERT(err == 0, \"Expected 0 got %d\", err);\n+\n+\tev.queue_id = 0;\n+\tev.sched_type = RTE_SCHED_TYPE_ATOMIC;\n+\tev.priority = 0;\n+\n+\tqueue_config.rx_queue_flags = 0;\n+\tqueue_config.ev = ev;\n+\n+\t/* weight = 0 => interrupt mode */\n+\tqueue_config.servicing_weight = 0;\n+\n+\t/* add queue 0 */\n+\terr = rte_event_eth_rx_adapter_queue_add(TEST_INST_ID,\n+\t\t\t\t\t\tTEST_ETHDEV_ID, 0,\n+\t\t\t\t\t\t&queue_config);\n+\tTEST_ASSERT(err == 0, \"Expected 0 got %d\", err);\n+\n+\t/* add all queues */\n+\tqueue_config.servicing_weight = 0;\n+\terr = rte_event_eth_rx_adapter_queue_add(TEST_INST_ID,\n+\t\t\t\t\t\tTEST_ETHDEV_ID,\n+\t\t\t\t\t\t-1,\n+\t\t\t\t\t\t&queue_config);\n+\tTEST_ASSERT(err == 0, \"Expected 0 got %d\", err);\n+\n+\t/* del queue 0 */\n+\terr = rte_event_eth_rx_adapter_queue_del(TEST_INST_ID,\n+\t\t\t\t\t\tTEST_ETHDEV_ID,\n+\t\t\t\t\t\t0);\n+\tTEST_ASSERT(err == 0, \"Expected 0 got %d\", err);\n+\n+\t/* del remaining queues */\n+\terr = rte_event_eth_rx_adapter_queue_del(TEST_INST_ID,\n+\t\t\t\t\t\tTEST_ETHDEV_ID,\n+\t\t\t\t\t\t-1);\n+\tTEST_ASSERT(err == 0, \"Expected 0 got %d\", err);\n+\n+\t/* add all queues */\n+\tqueue_config.servicing_weight = 0;\n+\terr = rte_event_eth_rx_adapter_queue_add(TEST_INST_ID,\n+\t\t\t\t\t\tTEST_ETHDEV_ID,\n+\t\t\t\t\t\t-1,\n+\t\t\t\t\t\t&queue_config);\n+\tTEST_ASSERT(err == 0, \"Expected 0 got %d\", err);\n+\n+\t/* intr -> poll mode queue */\n+\tqueue_config.servicing_weight = 1;\n+\terr = rte_event_eth_rx_adapter_queue_add(TEST_INST_ID,\n+\t\t\t\t\t\tTEST_ETHDEV_ID,\n+\t\t\t\t\t\t0,\n+\t\t\t\t\t\t&queue_config);\n+\tTEST_ASSERT(err == 0, \"Expected 0 got %d\", err);\n+\n+\terr = rte_event_eth_rx_adapter_queue_add(TEST_INST_ID,\n+\t\t\t\t\t\tTEST_ETHDEV_ID,\n+\t\t\t\t\t\t-1,\n+\t\t\t\t\t\t &queue_config);\n+\tTEST_ASSERT(err == 0, \"Expected 0 got %d\", err);\n+\n+\t/* del queues */\n+\terr = rte_event_eth_rx_adapter_queue_del(TEST_INST_ID,\n+\t\t\t\t\t\tTEST_ETHDEV_ID,\n+\t\t\t\t\t\t-1);\n+\tTEST_ASSERT(err == 0, \"Expected 0 got %d\", err);\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n adapter_start_stop(void)\n {\n \tint err;\n@@ -470,7 +674,7 @@ struct event_eth_rx_adapter_test_params {\n \treturn TEST_SUCCESS;\n }\n \n-static struct unit_test_suite service_tests  = {\n+static struct unit_test_suite event_eth_rx_tests = {\n \t.suite_name = \"rx event eth adapter test suite\",\n \t.setup = testsuite_setup,\n \t.teardown = testsuite_teardown,\n@@ -485,11 +689,30 @@ struct event_eth_rx_adapter_test_params {\n \t}\n };\n \n+static struct unit_test_suite event_eth_rx_intr_tests = {\n+\t.suite_name = \"rx event eth adapter test suite\",\n+\t.setup = testsuite_setup_rx_intr,\n+\t.teardown = testsuite_teardown_rx_intr,\n+\t.unit_test_cases = {\n+\t\tTEST_CASE_ST(adapter_create, adapter_free,\n+\t\t\tadapter_intr_queue_add_del),\n+\t\tTEST_CASES_END() /**< NULL terminate unit test array */\n+\t}\n+};\n+\n static int\n test_event_eth_rx_adapter_common(void)\n {\n-\treturn unit_test_suite_runner(&service_tests);\n+\treturn unit_test_suite_runner(&event_eth_rx_tests);\n+}\n+\n+static int\n+test_event_eth_rx_intr_adapter_common(void)\n+{\n+\treturn unit_test_suite_runner(&event_eth_rx_intr_tests);\n }\n \n REGISTER_TEST_COMMAND(event_eth_rx_adapter_autotest,\n \t\ttest_event_eth_rx_adapter_common);\n+REGISTER_TEST_COMMAND(event_eth_rx_intr_adapter_autotest,\n+\t\ttest_event_eth_rx_intr_adapter_common);\n",
    "prefixes": [
        "v2",
        "5/5"
    ]
}