get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 20730,
    "url": "https://patches.dpdk.org/api/patches/20730/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1487953692-107094-2-git-send-email-cristian.dumitrescu@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": "<1487953692-107094-2-git-send-email-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1487953692-107094-2-git-send-email-cristian.dumitrescu@intel.com",
    "date": "2017-02-24T16:28:11",
    "name": "[dpdk-dev,v2,1/2] ethdev: add capability control API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ab569fb7c6256d138224955efa9e429cc968bcea",
    "submitter": {
        "id": 19,
        "url": "https://patches.dpdk.org/api/people/19/?format=api",
        "name": "Cristian Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1487953692-107094-2-git-send-email-cristian.dumitrescu@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/20730/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/20730/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 6412737AA;\n\tFri, 24 Feb 2017 17:28:45 +0100 (CET)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 2D8E82B88\n\tfor <dev@dpdk.org>; Fri, 24 Feb 2017 17:28:16 +0100 (CET)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t24 Feb 2017 08:28:15 -0800",
            "from silpixa00382659.ir.intel.com ([10.237.223.208])\n\tby orsmga005.jf.intel.com with ESMTP; 24 Feb 2017 08:28:14 -0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.35,201,1484035200\"; d=\"scan'208\";a=\"68698642\"",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas.monjalon@6wind.com, jerin.jacob@caviumnetworks.com,\n\themant.agrawal@nxp.com",
        "Date": "Fri, 24 Feb 2017 16:28:11 +0000",
        "Message-Id": "<1487953692-107094-2-git-send-email-cristian.dumitrescu@intel.com>",
        "X-Mailer": "git-send-email 2.5.0",
        "In-Reply-To": "<1487953692-107094-1-git-send-email-cristian.dumitrescu@intel.com>",
        "References": "<1487953692-107094-1-git-send-email-cristian.dumitrescu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 1/2] ethdev: add capability control 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": "The rte_flow feature breaks the current monolithic approach for ethdev and\nintroduces the new generic flow API to ethdev using a plugin-like approach.\n\nBasically, the rte_flow API is still logically part of ethdev:\n- It extends the ethdev functionality: rte_flow is a new feature/capability\n  of ethdev;\n- all its functions work on an Ethernet device: the first parameter of the\n  rte_flow functions is Ethernet device port ID.\n\nAt the same time, the rte_flow API is a sort of capability plugin for ethdev:\n- the rte_flow API functions have their own name space: they are called\n  rte_flow_operationXYZ() as opposed to rte_eth_dev_flow_operationXYZ());\n- the rte_flow API functions are placed in separate files in the same\n  librte_ether folder as opposed to rte_ethdev.[hc].\n\nThe way it works is by using the existing ethdev API function\nrte_eth_dev_filter_ctrl() to query the current Ethernet device port ID for the\nsupport of the rte_flow capability and return the pointer to the\nrte_flow operations when supported and NULL otherwise:\n\nstruct rte_flow_ops *eth_flow_ops;\nint rte = rte_eth_dev_filter_ctrl(eth_port_id,\n\tRTE_ETH_FILTER_GENERIC, RTE_ETH_FILTER_GET, &eth_flow_ops);\n\nUnfortunately, the rte_flow opportunistically uses the rte_eth_dev_filter_ctrl()\nAPI function, which is applicable just to RX-side filters as opposed to\nintroducing a mechanism that could be used by any capability in a generic way.\n\nThis is the gap that addressed by the current patch. This mechanism is intended\nto be used to introduce new capabilities into ethdev in a modular plugin-like\napproach, such as hierarchical scheduler. Over time, if agreed, it can also be\nused for exposing the existing Ethernet device capabilities in a modular way,\nsuch as: xstats, filters, multicast, mirroring, tunnels, time stamping, eeprom,\nbypass, etc.\n\nChanges in v2:\n-Followed up on suggestion from Jerin and Hemant: renamed capability_control()\n to capability_ops_get()\n-Added ACK from Keith, Jerin and Hemant\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\nAcked-by: Keith Wiles <keith.wiles@intel.com>\nAcked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>\nAcked-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n lib/librte_ether/rte_ethdev.c          | 13 +++++++++++++\n lib/librte_ether/rte_ethdev.h          | 29 +++++++++++++++++++++++++++++\n lib/librte_ether/rte_ether_version.map |  7 +++++++\n 3 files changed, 49 insertions(+)",
    "diff": "diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex eb0a94a..674bbae 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -2802,6 +2802,19 @@ rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type,\n \treturn (*dev->dev_ops->filter_ctrl)(dev, filter_type, filter_op, arg);\n }\n \n+int\n+rte_eth_dev_capability_ops_get(uint8_t port_id, enum rte_eth_capability cap,\n+\tvoid *arg)\n+{\n+\tstruct rte_eth_dev *dev;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\n+\tdev = &rte_eth_devices[port_id];\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->cap_ops_get, -ENOTSUP);\n+\treturn (*dev->dev_ops->cap_ops_get)(dev, cap, arg);\n+}\n+\n void *\n rte_eth_add_rx_callback(uint8_t port_id, uint16_t queue_id,\n \t\trte_rx_callback_fn fn, void *user_param)\ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex 97f3e2d..e56d160 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -1073,6 +1073,12 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);\n  * structure associated with an Ethernet device.\n  */\n \n+enum rte_eth_capability {\n+\tRTE_ETH_CAPABILITY_FLOW = 0, /**< Flow */\n+\tRTE_ETH_CAPABILITY_SCHED, /**< Hierarchical Scheduler */\n+\tRTE_ETH_CAPABILITY_MAX\n+};\n+\n typedef int  (*eth_dev_configure_t)(struct rte_eth_dev *dev);\n /**< @internal Ethernet device configuration. */\n \n@@ -1427,6 +1433,10 @@ typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,\n \t\t\t\t void *arg);\n /**< @internal Take operations to assigned filter type on an Ethernet device */\n \n+typedef int (*eth_capability_ops_get_t)(struct rte_eth_dev *dev,\n+\tenum rte_eth_capability cap, void *arg);\n+/**< @internal Take capability operations on an Ethernet device */\n+\n typedef int (*eth_get_dcb_info)(struct rte_eth_dev *dev,\n \t\t\t\t struct rte_eth_dcb_info *dcb_info);\n /**< @internal Get dcb information on an Ethernet device */\n@@ -1548,6 +1558,8 @@ struct eth_dev_ops {\n \teth_timesync_adjust_time   timesync_adjust_time; /** Adjust the device clock. */\n \teth_timesync_read_time     timesync_read_time; /** Get the device clock time. */\n \teth_timesync_write_time    timesync_write_time; /** Set the device clock time. */\n+\n+\teth_capability_ops_get_t   cap_ops_get; /**< capability control. */\n };\n \n /**\n@@ -3890,6 +3902,23 @@ int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type,\n \t\t\tenum rte_filter_op filter_op, void *arg);\n \n /**\n+ * Take capability operations on an Ethernet device.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param cap\n+ *   The capability of the Ethernet device\n+ * @param arg\n+ *   A pointer to arguments defined specifically for the operation.\n+ * @return\n+ *   - (0) if successful.\n+ *   - (-ENOTSUP) if hardware doesn't support.\n+ *   - (-ENODEV) if *port_id* invalid.\n+ */\n+int rte_eth_dev_capability_ops_get(uint8_t port_id,\n+\tenum rte_eth_capability cap, void *arg);\n+\n+/**\n  * Get DCB information on an Ethernet device.\n  *\n  * @param port_id\ndiff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map\nindex c6c9d0d..637317c 100644\n--- a/lib/librte_ether/rte_ether_version.map\n+++ b/lib/librte_ether/rte_ether_version.map\n@@ -154,3 +154,10 @@ DPDK_17.02 {\n \trte_flow_validate;\n \n } DPDK_16.11;\n+\n+DPDK_17.05 {\n+\tglobal:\n+\n+\trte_eth_dev_capability_ops_get;\n+\n+} DPDK_17.02;\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "1/2"
    ]
}