get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 112562,
    "url": "https://patches.dpdk.org/api/patches/112562/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220608121400.3954603-4-ganapati.kundapura@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": "<20220608121400.3954603-4-ganapati.kundapura@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220608121400.3954603-4-ganapati.kundapura@intel.com",
    "date": "2022-06-08T12:13:57",
    "name": "[v6,4/7] eventdev/eth_tx: add instance get API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "863740ff46ad2141c65f89c59b0a6c041def6649",
    "submitter": {
        "id": 2287,
        "url": "https://patches.dpdk.org/api/people/2287/?format=api",
        "name": "Ganapati Kundapura",
        "email": "ganapati.kundapura@intel.com"
    },
    "delegate": {
        "id": 310,
        "url": "https://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220608121400.3954603-4-ganapati.kundapura@intel.com/mbox/",
    "series": [
        {
            "id": 23418,
            "url": "https://patches.dpdk.org/api/series/23418/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=23418",
            "date": "2022-06-08T12:13:54",
            "name": "[v6,1/7] eventdev/eth_rx: add adapter instance get API",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/23418/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/112562/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/112562/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 5F18BA04FD;\n\tWed,  8 Jun 2022 14:14:32 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2AA1D42BDE;\n\tWed,  8 Jun 2022 14:14:16 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by mails.dpdk.org (Postfix) with ESMTP id 3EE3042BB9\n for <dev@dpdk.org>; Wed,  8 Jun 2022 14:14:11 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 08 Jun 2022 05:14:10 -0700",
            "from txandevlnx322.an.intel.com ([10.123.117.44])\n by FMSMGA003.fm.intel.com with ESMTP; 08 Jun 2022 05:14:09 -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=1654690451; x=1686226451;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=waIqpRqXG1pk8ZoXSWL6qzavBjMyokk0+jiPk7YoO9M=;\n b=m2HC5PvNYu/fShb71zXxH7/Zuy1usfqDYwDZteqc8phXB7uDbBI8BhKi\n 2gVUGNK9FkIPA3uaOlCX+oJq7rk8WDFG1a/8BFmD2zmLwWos50IMeLw+Y\n nVquvJJrrOjA9TkAOghyRqYSKXmsmFneMwtdtuLX6ewANH/eSKjs/pTZk\n mbyyClfgHzZskgdZ8KWUD9Sa+IqewTAoqa36A5GP1iO8cMZ1s5baeEgb/\n aG2RPMLU/Toq4pFgcKiNfYt9H3KP+n/C87+x6hIOGqWnoLztZTPcB2oqs\n smRph5ZUKXCY5k71o3CbCBHWJ7TIrK7fxBGFGV9TVbBSL2BUFJoLm8jvq w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6400,9594,10371\"; a=\"276901998\"",
            "E=Sophos;i=\"5.91,286,1647327600\"; d=\"scan'208\";a=\"276901998\"",
            "E=Sophos;i=\"5.91,286,1647327600\"; d=\"scan'208\";a=\"670523284\""
        ],
        "X-ExtLoop1": "1",
        "From": "Ganapati Kundapura <ganapati.kundapura@intel.com>",
        "To": "jerinjacobk@gmail.com,\n\tdev@dpdk.org,\n\tjay.jayatheerthan@intel.com",
        "Cc": "s.v.naga.harish.k@intel.com",
        "Subject": "[PATCH v6 4/7] eventdev/eth_tx: add instance get API",
        "Date": "Wed,  8 Jun 2022 07:13:57 -0500",
        "Message-Id": "<20220608121400.3954603-4-ganapati.kundapura@intel.com>",
        "X-Mailer": "git-send-email 2.23.0",
        "In-Reply-To": "<20220608121400.3954603-1-ganapati.kundapura@intel.com>",
        "References": "<20220608111644.3939628-1-ganapati.kundapura@intel.com>\n <20220608121400.3954603-1-ganapati.kundapura@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": "Added rte_event_eth_tx_adapter_instance_get() to get the\nadapter instance id for specified ethernet device id and\ntx queue index.\n\nSigned-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>",
    "diff": "diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c\nindex 1b304f0..d9de6e5 100644\n--- a/lib/eventdev/rte_event_eth_tx_adapter.c\n+++ b/lib/eventdev/rte_event_eth_tx_adapter.c\n@@ -1,6 +1,8 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n  * Copyright(c) 2018 Intel Corporation.\n  */\n+#include <limits.h>\n+\n #include <rte_spinlock.h>\n #include <rte_service_component.h>\n #include <ethdev_driver.h>\n@@ -17,6 +19,11 @@\n #define TXA_MAX_NB_TX\t\t128\n #define TXA_INVALID_DEV_ID\tINT32_C(-1)\n #define TXA_INVALID_SERVICE_ID\tINT64_C(-1)\n+#define INVALID_INSTANCE_ID\tUINT8_MAX\n+\n+#define TXA_ADAPTER_ARRAY \"txa_adapter_array\"\n+#define TXA_SERVICE_DATA_ARRAY \"txa_service_data_array\"\n+#define TXA_ADAPTER_INSTANCE_ARRAY \"txa_adapter_instance_array\"\n \n #define txa_evdev(id) (&rte_eventdevs[txa_dev_id_array[(id)]])\n \n@@ -140,6 +147,10 @@ struct txa_service_ethdev {\n \tvoid *queues;\n };\n \n+struct event_eth_txa_inst_info {\n+\tuint8_t txa_inst_id;\n+};\n+\n /* Array of adapter instances, initialized with event device id\n  * when adapter is created\n  */\n@@ -148,6 +159,9 @@ static int *txa_dev_id_array;\n /* Array of pointers to service implementation data */\n static struct txa_service_data **txa_service_data_array;\n \n+/* array of adapter instances to store tx queue specific instance */\n+static struct event_eth_txa_inst_info **event_eth_txa_inst_info;\n+\n static int32_t txa_service_func(void *args);\n static int txa_service_adapter_create_ext(uint8_t id,\n \t\t\tstruct rte_eventdev *dev,\n@@ -194,12 +208,42 @@ txa_memzone_array_get(const char *name, unsigned int elt_size, int nb_elems)\n }\n \n static int\n+txa_memzone_lookup(void)\n+{\n+\tconst struct rte_memzone *mz;\n+\n+\tif (txa_dev_id_array == NULL) {\n+\t\tmz = rte_memzone_lookup(TXA_ADAPTER_ARRAY);\n+\t\tif (mz == NULL)\n+\t\t\treturn -ENOMEM;\n+\t\ttxa_dev_id_array = mz->addr;\n+\t}\n+\n+\tif (txa_service_data_array == NULL) {\n+\t\tmz = rte_memzone_lookup(TXA_SERVICE_DATA_ARRAY);\n+\t\tif (mz == NULL)\n+\t\t\treturn -ENOMEM;\n+\t\ttxa_service_data_array = mz->addr;\n+\t}\n+\n+\tif (event_eth_txa_inst_info == NULL) {\n+\t\tmz = rte_memzone_lookup(TXA_ADAPTER_INSTANCE_ARRAY);\n+\t\tif (mz == NULL)\n+\t\t\treturn -ENOMEM;\n+\t\tevent_eth_txa_inst_info = mz->addr;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+\n+static int\n txa_dev_id_array_init(void)\n {\n \tif (txa_dev_id_array == NULL) {\n \t\tint i;\n \n-\t\ttxa_dev_id_array = txa_memzone_array_get(\"txa_adapter_array\",\n+\t\ttxa_dev_id_array = txa_memzone_array_get(TXA_ADAPTER_ARRAY,\n \t\t\t\t\tsizeof(int),\n \t\t\t\t\tRTE_EVENT_ETH_TX_ADAPTER_MAX_INSTANCE);\n \t\tif (txa_dev_id_array == NULL)\n@@ -221,15 +265,30 @@ txa_init(void)\n static int\n txa_service_data_init(void)\n {\n+\tuint8_t i;\n+\n \tif (txa_service_data_array == NULL) {\n \t\ttxa_service_data_array =\n-\t\t\t\ttxa_memzone_array_get(\"txa_service_data_array\",\n+\t\t\t\ttxa_memzone_array_get(TXA_SERVICE_DATA_ARRAY,\n \t\t\t\t\tsizeof(int),\n \t\t\t\t\tRTE_EVENT_ETH_TX_ADAPTER_MAX_INSTANCE);\n \t\tif (txa_service_data_array == NULL)\n \t\t\treturn -ENOMEM;\n \t}\n \n+\tif (event_eth_txa_inst_info == NULL) {\n+\t\tevent_eth_txa_inst_info =\n+\t\t\ttxa_memzone_array_get(TXA_ADAPTER_INSTANCE_ARRAY,\n+\t\t\t\t\t      sizeof(*event_eth_txa_inst_info),\n+\t\t\t\t\t      RTE_MAX_ETHPORTS);\n+\t\tif (event_eth_txa_inst_info == NULL)\n+\t\t\treturn -ENOMEM;\n+\t}\n+\n+\t/* Reset the txa instance pointers */\n+\tfor (i = 0; i < RTE_MAX_ETHPORTS; i++)\n+\t\tevent_eth_txa_inst_info[i] = NULL;\n+\n \treturn 0;\n }\n \n@@ -763,6 +822,7 @@ txa_service_queue_add(uint8_t id,\n \tstruct rte_eth_dev_tx_buffer *tb;\n \tstruct txa_retry *txa_retry;\n \tint ret = 0;\n+\tuint16_t eth_dev_id = eth_dev->data->port_id;\n \n \ttxa = txa_service_id_to_data(id);\n \n@@ -831,6 +891,31 @@ txa_service_queue_add(uint8_t id,\n \trte_eth_tx_buffer_set_err_callback(tb,\n \t\ttxa_service_buffer_retry, txa_retry);\n \n+\t/* Allocate storage to store txa_inst_id for txq */\n+\tif (event_eth_txa_inst_info[eth_dev_id] == NULL) {\n+\t\tuint16_t n, i;\n+\t\tstruct event_eth_txa_inst_info *i_info;\n+\n+\t\tn = eth_dev->data->nb_tx_queues;\n+\n+\t\ti_info = rte_zmalloc_socket(\"event_eth_txa_inst_info\",\n+\t\t\t\t\tn * sizeof(event_eth_txa_inst_info),\n+\t\t\t\t\t0,\n+\t\t\t\t\ttxa->socket_id);\n+\t\tif (i_info == NULL) {\n+\t\t\tRTE_EDEV_LOG_ERR(\"Failed to allocate storage for \"\n+\t\t\t\t\t \"event_eth_txa_inst_info\");\n+\t\t\tgoto err_unlock;\n+\t\t}\n+\n+\t\tfor (i = 0; i < n; i++)\n+\t\t\ti_info[i].txa_inst_id = INVALID_INSTANCE_ID;\n+\n+\t\tevent_eth_txa_inst_info[eth_dev_id] = i_info;\n+\t}\n+\n+\tevent_eth_txa_inst_info[eth_dev_id][tx_queue_id].txa_inst_id = id;\n+\n \ttqi->tx_buf = tb;\n \ttqi->added = 1;\n \ttdi->nb_queues++;\n@@ -902,6 +987,12 @@ txa_service_queue_del(uint8_t id,\n \ttxa->nb_queues--;\n \ttxa->txa_ethdev[port_id].nb_queues--;\n \n+\t/* unset txa_inst_id for tx_queue_id */\n+\tif (event_eth_txa_inst_info[port_id])\n+\t\tevent_eth_txa_inst_info[port_id][tx_queue_id].txa_inst_id =\n+\t\t\t\t\t\t\tINVALID_INSTANCE_ID;\n+\n+\n \ttxa_service_queue_array_free(txa, port_id);\n \treturn 0;\n }\n@@ -1056,6 +1147,10 @@ int\n rte_event_eth_tx_adapter_free(uint8_t id)\n {\n \tint ret;\n+\tuint16_t eth_dev_id;\n+\n+\tif (txa_memzone_lookup())\n+\t\treturn -ENOMEM;\n \n \tTXA_CHECK_OR_ERR_RET(id);\n \n@@ -1067,6 +1162,13 @@ rte_event_eth_tx_adapter_free(uint8_t id)\n \t\tret = txa_service_adapter_free(id);\n \ttxa_dev_id_array[id] = TXA_INVALID_DEV_ID;\n \n+\tfor (eth_dev_id = 0; eth_dev_id < RTE_MAX_ETHPORTS; eth_dev_id++) {\n+\t\tif (event_eth_txa_inst_info[eth_dev_id]) {\n+\t\t\trte_free(event_eth_txa_inst_info[eth_dev_id]);\n+\t\t\tevent_eth_txa_inst_info[eth_dev_id] = NULL;\n+\t\t}\n+\t}\n+\n \trte_eventdev_trace_eth_tx_adapter_free(id, ret);\n \treturn ret;\n }\n@@ -1080,6 +1182,9 @@ rte_event_eth_tx_adapter_queue_add(uint8_t id,\n \tint ret;\n \tuint32_t caps;\n \n+\tif (txa_memzone_lookup())\n+\t\treturn -ENOMEM;\n+\n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(eth_dev_id, -EINVAL);\n \tTXA_CHECK_OR_ERR_RET(id);\n \n@@ -1113,6 +1218,9 @@ rte_event_eth_tx_adapter_queue_del(uint8_t id,\n \tint ret;\n \tuint32_t caps;\n \n+\tif (txa_memzone_lookup())\n+\t\treturn -ENOMEM;\n+\n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(eth_dev_id, -EINVAL);\n \tTXA_CHECK_OR_ERR_RET(id);\n \n@@ -1218,3 +1326,46 @@ rte_event_eth_tx_adapter_stop(uint8_t id)\n \trte_eventdev_trace_eth_tx_adapter_stop(id, ret);\n \treturn ret;\n }\n+\n+int\n+rte_event_eth_tx_adapter_instance_get(uint16_t eth_dev_id,\n+\t\t\t\t      uint16_t tx_queue_id,\n+\t\t\t\t      uint8_t *txa_inst_id)\n+{\n+\tuint8_t inst_id;\n+\n+\tif (txa_memzone_lookup())\n+\t\treturn -ENOMEM;\n+\n+\tif (eth_dev_id >= rte_eth_dev_count_avail()) {\n+\t\tRTE_EDEV_LOG_ERR(\"Invalid ethernet port id %u\", eth_dev_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (tx_queue_id >= rte_eth_devices[eth_dev_id].data->nb_tx_queues) {\n+\t\tRTE_EDEV_LOG_ERR(\"Invalid tx queue id %u\", tx_queue_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (txa_inst_id == NULL) {\n+\t\tRTE_EDEV_LOG_ERR(\"txa_instance_id cannot be NULL\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (event_eth_txa_inst_info[eth_dev_id] == NULL) {\n+\t\tRTE_EDEV_LOG_ERR(\"No valid txa instance for eth_dev_id %d\",\n+\t\t\t\t eth_dev_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tinst_id = event_eth_txa_inst_info[eth_dev_id][tx_queue_id].txa_inst_id;\n+\tif (inst_id == INVALID_INSTANCE_ID) {\n+\t\tRTE_EDEV_LOG_ERR(\"Invalid txa instance for eth_dev_id %u, \"\n+\t\t\t\t \"tx_queue_id %u\", eth_dev_id, tx_queue_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\t*txa_inst_id = inst_id;\n+\n+\treturn 0;\n+}\ndiff --git a/lib/eventdev/rte_event_eth_tx_adapter.h b/lib/eventdev/rte_event_eth_tx_adapter.h\nindex 3908c2d..20d28a7 100644\n--- a/lib/eventdev/rte_event_eth_tx_adapter.h\n+++ b/lib/eventdev/rte_event_eth_tx_adapter.h\n@@ -34,6 +34,7 @@\n  *  - rte_event_eth_tx_adapter_enqueue()\n  *  - rte_event_eth_tx_adapter_event_port_get()\n  *  - rte_event_eth_tx_adapter_service_id_get()\n+ *  - rte_event_eth_tx_adapter_instance_get()\n  *\n  * The application creates the adapter using\n  * rte_event_eth_tx_adapter_create() or rte_event_eth_tx_adapter_create_ext().\n@@ -423,6 +424,24 @@ rte_event_eth_tx_adapter_stats_reset(uint8_t id);\n int\n rte_event_eth_tx_adapter_service_id_get(uint8_t id, uint32_t *service_id);\n \n+/**\n+ * Get TX adapter instance id for TX queue\n+ *\n+ * @param eth_dev_id\n+ *  Port identifier of Ethernet device.\n+ *\n+ * @param tx_queue_id\n+ *  Etherdev device TX queue index.\n+ *\n+ * @param[out] txa_inst_id\n+ *  Pointer to store TX adapter instance identifier.\n+ */\n+__rte_experimental\n+int\n+rte_event_eth_tx_adapter_instance_get(uint16_t eth_dev_id,\n+\t\t\t\t      uint16_t tx_queue_id,\n+\t\t\t\t      uint8_t *txa_inst_id);\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/eventdev/version.map b/lib/eventdev/version.map\nindex f1818a2..1c99d52 100644\n--- a/lib/eventdev/version.map\n+++ b/lib/eventdev/version.map\n@@ -106,6 +106,7 @@ EXPERIMENTAL {\n \trte_event_eth_rx_adapter_queue_conf_get;\n \trte_event_eth_rx_adapter_queue_stats_get;\n \trte_event_eth_rx_adapter_queue_stats_reset;\n+\trte_event_eth_tx_adapter_instance_get;\n \n \t# added in 22.03\n \trte_event_eth_rx_adapter_event_port_get;\n",
    "prefixes": [
        "v6",
        "4/7"
    ]
}