get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 128951,
    "url": "http://patchwork.dpdk.org/api/patches/128951/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230623111508.786020-2-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20230623111508.786020-2-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230623111508.786020-2-bruce.richardson@intel.com",
    "date": "2023-06-23T11:15:01",
    "name": "[v3,1/8] examples/l3fwd: make eventdev an optional dependency",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8f8f803c6fa63bb3efc9028f492e04de24f004b5",
    "submitter": {
        "id": 20,
        "url": "http://patchwork.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230623111508.786020-2-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 28623,
            "url": "http://patchwork.dpdk.org/api/series/28623/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28623",
            "date": "2023-06-23T11:15:00",
            "name": "expand list of optional libraries",
            "version": 3,
            "mbox": "http://patchwork.dpdk.org/series/28623/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/128951/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/128951/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id E23BD42D2F;\n\tFri, 23 Jun 2023 13:15:28 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D29C542D3C;\n\tFri, 23 Jun 2023 13:15:28 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id 6DCD442D3E\n for <dev@dpdk.org>; Fri, 23 Jun 2023 13:15:26 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 23 Jun 2023 04:15:25 -0700",
            "from silpixa00401385.ir.intel.com ([10.237.214.14])\n by fmsmga004.fm.intel.com with ESMTP; 23 Jun 2023 04:15:23 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1687518926; x=1719054926;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=T13DabFwCehEN2odYg3WeXsCTBcbCGMl9/BMNW8KwHU=;\n b=Os1WkhPiYe/cJEWWPDzUIZYu8wXv/iKbWmpFL5OAuE3QizWlBHZWtTPJ\n fz+dnsW0hoEespV6jsrl6+yhjbyA+9lgDlC+/Ct4xBo+FNaGDbd+03+6J\n +jE1oLMJMX1EPv4gJf8zK8Qf9x4fkZK/SLjOxQfxWYUirWr1Cf5hj636n\n VdSxHVJiZVxibwJD9ZVihUg29IDd6dvnF8/VZerM0QLcRHiFvAaof5blZ\n NkXUrn8YVxaXBERZMA9Ntfe6n1LFHA2boCsbAmSIk3VNRGPhTgCNfInfV\n wc6O4bEWp0yjyOMMzzCWjyOM9dU9Bw7RovIoiBbBkzFzgfCF2pEblLArH A==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10749\"; a=\"363295935\"",
            "E=Sophos;i=\"6.01,151,1684825200\"; d=\"scan'208\";a=\"363295935\"",
            "E=McAfee;i=\"6600,9927,10749\"; a=\"785307437\"",
            "E=Sophos;i=\"6.01,151,1684825200\"; d=\"scan'208\";a=\"785307437\""
        ],
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Bruce Richardson <bruce.richardson@intel.com>",
        "Subject": "[PATCH v3 1/8] examples/l3fwd: make eventdev an optional dependency",
        "Date": "Fri, 23 Jun 2023 12:15:01 +0100",
        "Message-Id": "<20230623111508.786020-2-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.39.2",
        "In-Reply-To": "<20230623111508.786020-1-bruce.richardson@intel.com>",
        "References": "<20230622134840.3225975-1-bruce.richardson@intel.com>\n <20230623111508.786020-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "With l3fwd being a very commonly used example app, and built as part of\nour CI tests, we need to ensure it's buildable with just about all\nsupported DPDK configurations.  To enable l3fwd application to be built\nwhen the eventdev library is disabled, we need to compile in the\neventdev support conditionally.  Thankfully, the eventdev support is\npretty self-contained, with only the main.c file having more than a\ncouple of ifdefs.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n examples/l3fwd/l3fwd_em.c  |  2 ++\n examples/l3fwd/l3fwd_fib.c |  2 ++\n examples/l3fwd/l3fwd_lpm.c |  2 ++\n examples/l3fwd/main.c      | 65 ++++++++++++++++++++++++++++++--------\n examples/l3fwd/meson.build | 13 +++++---\n 5 files changed, 66 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c\nindex 476ac0c54f..40e102b38a 100644\n--- a/examples/l3fwd/l3fwd_em.c\n+++ b/examples/l3fwd/l3fwd_em.c\n@@ -663,6 +663,7 @@ em_main_loop(__rte_unused void *dummy)\n \treturn 0;\n }\n \n+#ifdef RTE_LIB_EVENTDEV\n static __rte_always_inline void\n em_event_loop_single(struct l3fwd_event_resources *evt_rsrc,\n \t\tconst uint8_t flags)\n@@ -959,6 +960,7 @@ em_event_main_loop_tx_q_burst_vector(__rte_unused void *dummy)\n \tem_event_loop_vector(evt_rsrc, L3FWD_EVENT_TX_ENQ);\n \treturn 0;\n }\n+#endif\n \n /* Initialize exact match (hash) parameters. 8< */\n void\ndiff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c\nindex edc0dd69b9..8760016545 100644\n--- a/examples/l3fwd/l3fwd_fib.c\n+++ b/examples/l3fwd/l3fwd_fib.c\n@@ -253,6 +253,7 @@ fib_main_loop(__rte_unused void *dummy)\n \treturn 0;\n }\n \n+#ifdef RTE_LIB_EVENTDEV\n /* One eventdev loop for single and burst using fib. */\n static __rte_always_inline void\n fib_event_loop(struct l3fwd_event_resources *evt_rsrc,\n@@ -635,6 +636,7 @@ fib_event_main_loop_tx_q_burst_vector(__rte_unused void *dummy)\n \tfib_event_loop_vector(evt_rsrc, L3FWD_EVENT_TX_ENQ);\n \treturn 0;\n }\n+#endif\n \n /* Function to setup fib. 8< */\n void\ndiff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c\nindex 4ac1925c84..a484a33089 100644\n--- a/examples/l3fwd/l3fwd_lpm.c\n+++ b/examples/l3fwd/l3fwd_lpm.c\n@@ -226,6 +226,7 @@ lpm_main_loop(__rte_unused void *dummy)\n \treturn 0;\n }\n \n+#ifdef RTE_LIB_EVENTDEV\n static __rte_always_inline uint16_t\n lpm_process_event_pkt(const struct lcore_conf *lconf, struct rte_mbuf *mbuf)\n {\n@@ -554,6 +555,7 @@ lpm_event_main_loop_tx_q_burst_vector(__rte_unused void *dummy)\n \tlpm_event_loop_vector(evt_rsrc, L3FWD_EVENT_TX_ENQ);\n \treturn 0;\n }\n+#endif\n \n void\n setup_lpm(const int socketid)\ndiff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c\nindex a4f061537e..6063eb1399 100644\n--- a/examples/l3fwd/main.c\n+++ b/examples/l3fwd/main.c\n@@ -135,8 +135,10 @@ static struct rte_eth_conf port_conf = {\n \n uint32_t max_pkt_len;\n \n-static struct rte_mempool *pktmbuf_pool[RTE_MAX_ETHPORTS][NB_SOCKETS];\n+#ifdef RTE_LIB_EVENTDEV\n static struct rte_mempool *vector_pool[RTE_MAX_ETHPORTS];\n+#endif\n+static struct rte_mempool *pktmbuf_pool[RTE_MAX_ETHPORTS][NB_SOCKETS];\n static uint8_t lkp_per_socket[NB_SOCKETS];\n \n struct l3fwd_lkp_mode {\n@@ -398,8 +400,10 @@ print_usage(const char *prgname)\n \t\t\" [--parse-ptype]\"\n \t\t\" [--per-port-pool]\"\n \t\t\" [--mode]\"\n+#ifdef RTE_LIB_EVENTDEV\n \t\t\" [--eventq-sched]\"\n \t\t\" [--event-vector [--event-vector-size SIZE] [--event-vector-tmo NS]]\"\n+#endif\n \t\t\" [-E]\"\n \t\t\" [-L]\\n\\n\"\n \n@@ -422,6 +426,7 @@ print_usage(const char *prgname)\n \t\t\"  --per-port-pool: Use separate buffer pool per port\\n\"\n \t\t\"  --mode: Packet transfer mode for I/O, poll or eventdev\\n\"\n \t\t\"          Default mode = poll\\n\"\n+#ifdef RTE_LIB_EVENTDEV\n \t\t\"  --eventq-sched: Event queue synchronization method\\n\"\n \t\t\"                  ordered, atomic or parallel.\\n\"\n \t\t\"                  Default: atomic\\n\"\n@@ -432,6 +437,7 @@ print_usage(const char *prgname)\n \t\t\"  --event-vector:  Enable event vectorization.\\n\"\n \t\t\"  --event-vector-size: Max vector size if event vectorization is enabled.\\n\"\n \t\t\"  --event-vector-tmo: Max timeout to form vector in nanoseconds if event vectorization is enabled\\n\"\n+#endif\n \t\t\"  -E : Enable exact match, legacy flag please use --lookup=em instead\\n\"\n \t\t\"  -L : Enable longest prefix match, legacy flag please use --lookup=lpm instead\\n\"\n \t\t\"  --rule_ipv4=FILE: Specify the ipv4 rules entries file.\\n\"\n@@ -559,14 +565,16 @@ parse_eth_dest(const char *optarg)\n }\n \n static void\n-parse_mode(const char *optarg)\n+parse_mode(const char *optarg __rte_unused)\n {\n+#ifdef RTE_LIB_EVENTDEV\n \tstruct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();\n \n \tif (!strcmp(optarg, \"poll\"))\n \t\tevt_rsrc->enabled = false;\n \telse if (!strcmp(optarg, \"eventdev\"))\n \t\tevt_rsrc->enabled = true;\n+#endif\n }\n \n static void\n@@ -601,6 +609,7 @@ parse_queue_size(const char *queue_size_arg, uint16_t *queue_size, int rx)\n \t*queue_size = value;\n }\n \n+#ifdef RTE_LIB_EVENTDEV\n static void\n parse_eventq_sched(const char *optarg)\n {\n@@ -631,6 +640,7 @@ parse_event_eth_rx_queues(const char *eth_rx_queues)\n \n \tevt_rsrc->eth_rx_queues = num_eth_rx_queues;\n }\n+#endif\n \n static int\n parse_lookup(const char *optarg)\n@@ -756,9 +766,11 @@ parse_args(int argc, char **argv)\n \tint option_index;\n \tchar *prgname = argv[0];\n \tuint8_t lcore_params = 0;\n+#ifdef RTE_LIB_EVENTDEV\n \tuint8_t eventq_sched = 0;\n \tuint8_t eth_rx_q = 0;\n \tstruct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();\n+#endif\n \n \targvopt = argv;\n \n@@ -850,6 +862,7 @@ parse_args(int argc, char **argv)\n \t\t\tparse_mode(optarg);\n \t\t\tbreak;\n \n+#ifdef RTE_LIB_EVENTDEV\n \t\tcase CMD_LINE_OPT_EVENTQ_SYNC_NUM:\n \t\t\tparse_eventq_sched(optarg);\n \t\t\teventq_sched = 1;\n@@ -860,6 +873,20 @@ parse_args(int argc, char **argv)\n \t\t\teth_rx_q = 1;\n \t\t\tbreak;\n \n+\t\tcase CMD_LINE_OPT_ENABLE_VECTOR_NUM:\n+\t\t\tprintf(\"event vectorization is enabled\\n\");\n+\t\t\tevt_rsrc->vector_enabled = 1;\n+\t\t\tbreak;\n+\n+\t\tcase CMD_LINE_OPT_VECTOR_SIZE_NUM:\n+\t\t\tevt_rsrc->vector_size = strtol(optarg, NULL, 10);\n+\t\t\tbreak;\n+\n+\t\tcase CMD_LINE_OPT_VECTOR_TMO_NS_NUM:\n+\t\t\tevt_rsrc->vector_tmo_ns = strtoull(optarg, NULL, 10);\n+\t\t\tbreak;\n+#endif\n+\n \t\tcase CMD_LINE_OPT_LOOKUP_NUM:\n \t\t\tif (lookup_mode != L3FWD_LOOKUP_DEFAULT) {\n \t\t\t\tfprintf(stderr, \"Only one lookup mode is allowed at a time!\\n\");\n@@ -875,16 +902,6 @@ parse_args(int argc, char **argv)\n \t\t\t\treturn -1;\n \t\t\tbreak;\n \n-\t\tcase CMD_LINE_OPT_ENABLE_VECTOR_NUM:\n-\t\t\tprintf(\"event vectorization is enabled\\n\");\n-\t\t\tevt_rsrc->vector_enabled = 1;\n-\t\t\tbreak;\n-\t\tcase CMD_LINE_OPT_VECTOR_SIZE_NUM:\n-\t\t\tevt_rsrc->vector_size = strtol(optarg, NULL, 10);\n-\t\t\tbreak;\n-\t\tcase CMD_LINE_OPT_VECTOR_TMO_NS_NUM:\n-\t\t\tevt_rsrc->vector_tmo_ns = strtoull(optarg, NULL, 10);\n-\t\t\tbreak;\n \t\tcase CMD_LINE_OPT_RULE_IPV4_NUM:\n \t\t\tl3fwd_set_rule_ipv4_name(optarg);\n \t\t\tbreak;\n@@ -900,6 +917,8 @@ parse_args(int argc, char **argv)\n \t\t}\n \t}\n \n+\tRTE_SET_USED(lcore_params); /* needed if no eventdev block */\n+#ifdef RTE_LIB_EVENTDEV\n \tif (evt_rsrc->enabled && lcore_params) {\n \t\tfprintf(stderr, \"lcore config is not valid when event mode is selected\\n\");\n \t\treturn -1;\n@@ -927,6 +946,7 @@ parse_args(int argc, char **argv)\n \t\t\t\"vector timeout set to default (%\" PRIu64 \" ns)\\n\",\n \t\t\tevt_rsrc->vector_tmo_ns);\n \t}\n+#endif\n \n \t/*\n \t * Nothing is selected, pick longest-prefix match\n@@ -962,7 +982,9 @@ print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr)\n int\n init_mem(uint16_t portid, unsigned int nb_mbuf)\n {\n+#ifdef RTE_LIB_EVENTDEV\n \tstruct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();\n+#endif\n \tstruct lcore_conf *qconf;\n \tint socketid;\n \tunsigned lcore_id;\n@@ -1007,6 +1029,7 @@ init_mem(uint16_t portid, unsigned int nb_mbuf)\n \t\t\t}\n \t\t}\n \n+#ifdef RTE_LIB_EVENTDEV\n \t\tif (evt_rsrc->vector_enabled && vector_pool[portid] == NULL) {\n \t\t\tunsigned int nb_vec;\n \n@@ -1025,6 +1048,7 @@ init_mem(uint16_t portid, unsigned int nb_mbuf)\n \t\t\t\tprintf(\"Allocated vector pool for port %d\\n\",\n \t\t\t\t       portid);\n \t\t}\n+#endif\n \n \t\tqconf = &lcore_conf[lcore_id];\n \t\tqconf->ipv4_lookup_struct =\n@@ -1406,6 +1430,7 @@ l3fwd_service_enable(uint32_t service_id)\n \treturn 0;\n }\n \n+#ifdef RTE_LIB_EVENTDEV\n static void\n l3fwd_event_service_setup(void)\n {\n@@ -1458,16 +1483,20 @@ l3fwd_event_service_setup(void)\n \t\tl3fwd_service_enable(service_id);\n \t}\n }\n+#endif\n \n int\n main(int argc, char **argv)\n {\n+#ifdef RTE_LIB_EVENTDEV\n \tstruct l3fwd_event_resources *evt_rsrc;\n+\tint i;\n+#endif\n \tstruct lcore_conf *qconf;\n \tuint16_t queueid, portid;\n \tunsigned int lcore_id;\n \tuint8_t queue;\n-\tint i, ret;\n+\tint ret;\n \n \t/* init EAL */\n \tret = rte_eal_init(argc, argv);\n@@ -1487,7 +1516,9 @@ main(int argc, char **argv)\n \t\t*(uint64_t *)(val_eth + portid) = dest_eth_addr[portid];\n \t}\n \n+#ifdef RTE_LIB_EVENTDEV\n \tevt_rsrc = l3fwd_get_eventdev_rsrc();\n+#endif\n \t/* parse application arguments (after the EAL ones) */\n \tret = parse_args(argc, argv);\n \tif (ret < 0)\n@@ -1499,6 +1530,7 @@ main(int argc, char **argv)\n \t/* Add the config file rules */\n \tl3fwd_lkp.read_config_files();\n \n+#ifdef RTE_LIB_EVENTDEV\n \tevt_rsrc->per_port_pool = per_port_pool;\n \tevt_rsrc->pkt_pool = pktmbuf_pool;\n \tevt_rsrc->vec_pool = vector_pool;\n@@ -1514,6 +1546,7 @@ main(int argc, char **argv)\n \t\t\tl3fwd_lkp.main_loop = evt_rsrc->ops.lpm_event_loop;\n \t\tl3fwd_event_service_setup();\n \t} else\n+#endif\n \t\tl3fwd_poll_resource_setup();\n \n \t/* start ports */\n@@ -1562,6 +1595,8 @@ main(int argc, char **argv)\n \tret = 0;\n \t/* launch per-lcore init on every lcore */\n \trte_eal_mp_remote_launch(l3fwd_lkp.main_loop, NULL, CALL_MAIN);\n+\n+#ifdef RTE_LIB_EVENTDEV\n \tif (evt_rsrc->enabled) {\n \t\tfor (i = 0; i < evt_rsrc->rx_adptr.nb_rx_adptr; i++)\n \t\t\trte_event_eth_rx_adapter_stop(\n@@ -1589,7 +1624,9 @@ main(int argc, char **argv)\n \t\trte_event_dev_stop(evt_rsrc->event_d_id);\n \t\trte_event_dev_close(evt_rsrc->event_d_id);\n \n-\t} else {\n+\t} else\n+#endif\n+\t{\n \t\trte_eal_mp_wait_lcore();\n \n \t\tRTE_ETH_FOREACH_DEV(portid) {\ndiff --git a/examples/l3fwd/meson.build b/examples/l3fwd/meson.build\nindex b40244a941..8375b87425 100644\n--- a/examples/l3fwd/meson.build\n+++ b/examples/l3fwd/meson.build\n@@ -7,14 +7,19 @@\n # DPDK instance, use 'make'\n \n allow_experimental_apis = true\n-deps += ['acl', 'hash', 'lpm', 'fib', 'eventdev']\n+deps += ['acl', 'hash', 'lpm', 'fib']\n sources = files(\n         'l3fwd_acl.c',\n         'l3fwd_em.c',\n-        'l3fwd_event.c',\n-        'l3fwd_event_internal_port.c',\n-        'l3fwd_event_generic.c',\n         'l3fwd_fib.c',\n         'l3fwd_lpm.c',\n         'main.c',\n )\n+if dpdk_conf.has('RTE_LIB_EVENTDEV')\n+    sources += files(\n+            'l3fwd_event.c',\n+            'l3fwd_event_internal_port.c',\n+            'l3fwd_event_generic.c',\n+    )\n+    deps += 'eventdev'\n+endif\n",
    "prefixes": [
        "v3",
        "1/8"
    ]
}