get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 21018,
    "url": "https://patches.dpdk.org/api/patches/21018/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1488388752-1819-2-git-send-email-olivier.matz@6wind.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": "<1488388752-1819-2-git-send-email-olivier.matz@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1488388752-1819-2-git-send-email-olivier.matz@6wind.com",
    "date": "2017-03-01T17:19:07",
    "name": "[dpdk-dev,1/6] ethdev: add descriptor status API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "607460209a8a66fe2cc1415fbf8306127aefeba4",
    "submitter": {
        "id": 8,
        "url": "https://patches.dpdk.org/api/people/8/?format=api",
        "name": "Olivier Matz",
        "email": "olivier.matz@6wind.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1488388752-1819-2-git-send-email-olivier.matz@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/21018/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/21018/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 0FCE36CB4;\n\tWed,  1 Mar 2017 18:20:46 +0100 (CET)",
            "from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com\n\t[62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 1B8B22C2B\n\tfor <dev@dpdk.org>; Wed,  1 Mar 2017 18:20:03 +0100 (CET)",
            "from glumotte.dev.6wind.com (unknown [10.16.0.195])\n\tby proxy.6wind.com (Postfix) with ESMTP id 12F5A25327;\n\tWed,  1 Mar 2017 18:19:58 +0100 (CET)"
        ],
        "From": "Olivier Matz <olivier.matz@6wind.com>",
        "To": "dev@dpdk.org, thomas.monjalon@6wind.com, konstantin.ananyev@intel.com,\n\twenzhuo.lu@intel.com, helin.zhang@intel.com, jingjing.wu@intel.com,\n\tadrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com",
        "Cc": "ferruh.yigit@intel.com,\n\tbruce.richardson@intel.com",
        "Date": "Wed,  1 Mar 2017 18:19:07 +0100",
        "Message-Id": "<1488388752-1819-2-git-send-email-olivier.matz@6wind.com>",
        "X-Mailer": "git-send-email 2.8.1",
        "In-Reply-To": "<1488388752-1819-1-git-send-email-olivier.matz@6wind.com>",
        "References": "<1479981261-19512-1-git-send-email-olivier.matz@6wind.com>\n\t<1488388752-1819-1-git-send-email-olivier.matz@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH 1/6] ethdev: add descriptor status API",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <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": "Introduce a new API to get the status of a descriptor.\n\nFor Rx, it is almost similar to rx_descriptor_done API, except it\ndifferentiates \"used\" descriptors (which are hold by the driver and not\nreturned to the hardware).\n\nFor Tx, it is a new API.\n\nThe descriptor_done() API, and probably the rx_queue_count() API could\nbe replaced by this new API as soon as it is implemented on all PMDs.\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n lib/librte_ether/rte_ethdev.h | 86 +++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 86 insertions(+)",
    "diff": "diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex 97f3e2d..9ac9c61 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -1179,6 +1179,14 @@ typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev,\n typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset);\n /**< @internal Check DD bit of specific RX descriptor */\n \n+typedef int (*eth_rx_descriptor_status_t)(struct rte_eth_dev *dev,\n+\tuint16_t rx_queue_id, uint16_t offset);\n+/**< @internal Check the status of a Rx descriptor */\n+\n+typedef int (*eth_tx_descriptor_status_t)(struct rte_eth_dev *dev,\n+\tuint16_t tx_queue_id, uint16_t offset);\n+/**< @internal Check the status of a Tx descriptor */\n+\n typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,\n \t\t\t\t     char *fw_version, size_t fw_size);\n /**< @internal Get firmware information of an Ethernet device. */\n@@ -1483,6 +1491,10 @@ struct eth_dev_ops {\n \teth_queue_release_t        rx_queue_release; /**< Release RX queue. */\n \teth_rx_queue_count_t       rx_queue_count;/**< Get Rx queue count. */\n \teth_rx_descriptor_done_t   rx_descriptor_done; /**< Check rxd DD bit. */\n+\teth_rx_descriptor_status_t rx_descriptor_status;\n+\t/**< Check the status of a Rx descriptor. */\n+\teth_tx_descriptor_status_t tx_descriptor_status;\n+\t/**< Check the status of a Tx descriptor. */\n \teth_rx_enable_intr_t       rx_queue_intr_enable;  /**< Enable Rx queue interrupt. */\n \teth_rx_disable_intr_t      rx_queue_intr_disable; /**< Disable Rx queue interrupt. */\n \teth_tx_queue_setup_t       tx_queue_setup;/**< Set up device TX queue. */\n@@ -2768,6 +2780,80 @@ rte_eth_rx_descriptor_done(uint8_t port_id, uint16_t queue_id, uint16_t offset)\n \t\tdev->data->rx_queues[queue_id], offset);\n }\n \n+#define RTE_ETH_RX_DESC_AVAIL 0 /**< Desc available for hw. */\n+#define RTE_ETH_RX_DESC_DONE  1 /**< Desc done, filled by hw. */\n+#define RTE_ETH_RX_DESC_USED  2 /**< Desc used by driver. */\n+\n+/**\n+ * Check the status of a Rx descriptor in the queue\n+ *\n+ * @param port_id\n+ *  The port identifier of the Ethernet device.\n+ * @param queue_id\n+ *  The Rx queue identifier on this port.\n+ * @param offset\n+ *  The offset of the descriptor starting from tail (0 is the next\n+ *  packet to be received by the driver).\n+ *\n+ * @return\n+ *  - (RTE_ETH_DESC_AVAIL): Descriptor is available for the hardware to\n+ *    receive a packet.\n+ *  - (RTE_ETH_DESC_DONE): Descriptor is done, it is filled by hw, but\n+ *    not yet processed by the driver (i.e. in the receive queue).\n+ *  - (RTE_ETH_DESC_USED): Descriptor is unavailable (hold by driver,\n+ *    not yet returned to hw).\n+ *  - (-ENODEV) if *port_id* invalid.\n+ *  - (-EINVAL) bad descriptor offset.\n+ *  - (-ENOTSUP) if the device does not support this function.\n+ */\n+static inline int\n+rte_eth_rx_descriptor_status(uint8_t port_id, uint16_t queue_id,\n+\tuint16_t offset)\n+{\n+\tstruct rte_eth_dev *dev;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_descriptor_status, -ENOTSUP);\n+\n+\treturn (*dev->dev_ops->rx_descriptor_status)(dev, queue_id, offset);\n+}\n+\n+#define RTE_ETH_TX_DESC_FULL 0 /**< Desc filled by pmd for hw, waiting xmit. */\n+#define RTE_ETH_TX_DESC_DONE 1 /**< Desc done, packet is transmitted. */\n+\n+/**\n+ * Check the status of a Tx descriptor in the queue.\n+ *\n+ * @param port_id\n+ *  The port identifier of the Ethernet device.\n+ * @param queue_id\n+ *  The Tx queue identifier on this port.\n+ * @param offset\n+ *  The offset of the descriptor starting from tail (0 is the place where\n+ *  the next packet will be send).\n+ *\n+ * @return\n+ *  - (RTE_ETH_DESC_FULL) Descriptor is being processed by the hw, i.e.\n+ *    in the transmit queue.\n+ *  - (RTE_ETH_DESC_DONE) Hardware is done with this descriptor, it can be\n+ *    reused by the driver.\n+ *  - (-ENODEV) if *port_id* invalid.\n+ *  - (-EINVAL) bad descriptor offset.\n+ *  - (-ENOTSUP) if the device does not support this function.\n+ */\n+static inline int rte_eth_tx_descriptor_status(uint8_t port_id,\n+\tuint16_t queue_id, uint16_t offset)\n+{\n+\tstruct rte_eth_dev *dev;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_descriptor_status, -ENOTSUP);\n+\n+\treturn (*dev->dev_ops->tx_descriptor_status)(dev, queue_id, offset);\n+}\n+\n /**\n  * Send a burst of output packets on a transmit queue of an Ethernet device.\n  *\n",
    "prefixes": [
        "dpdk-dev",
        "1/6"
    ]
}