get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 91,
    "url": "https://patches.dpdk.org/api/patches/91/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1406184149-11531-3-git-send-email-helin.zhang@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": "<1406184149-11531-3-git-send-email-helin.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1406184149-11531-3-git-send-email-helin.zhang@intel.com",
    "date": "2014-07-24T06:42:26",
    "name": "[dpdk-dev,2/5] ethdev: add new ops of 'check_command_supported' and 'rx_classification_filter_ctl'",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c99da025ab8ae365173d2cfbff1e4b014dce110a",
    "submitter": {
        "id": 14,
        "url": "https://patches.dpdk.org/api/people/14/?format=api",
        "name": "Zhang, Helin",
        "email": "helin.zhang@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1406184149-11531-3-git-send-email-helin.zhang@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/91/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/91/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<hzhan75@shecgisg004.sh.intel.com>",
        "Received": [
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 593975930\n\tfor <dev@dpdk.org>; Thu, 24 Jul 2014 08:41:28 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga103.fm.intel.com with ESMTP; 23 Jul 2014 23:36:16 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga001.fm.intel.com with ESMTP; 23 Jul 2014 23:42:39 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id s6O6gcKr017098;\n\tThu, 24 Jul 2014 14:42:38 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid s6O6gYab011654; Thu, 24 Jul 2014 14:42:36 +0800",
            "(from hzhan75@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s6O6gYTE011650; \n\tThu, 24 Jul 2014 14:42:34 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.01,722,1400050800\"; d=\"scan'208\";a=\"566441297\"",
        "From": "Helin Zhang <helin.zhang@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Thu, 24 Jul 2014 14:42:26 +0800",
        "Message-Id": "<1406184149-11531-3-git-send-email-helin.zhang@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": "<1406184149-11531-1-git-send-email-helin.zhang@intel.com>",
        "References": "<1406184149-11531-1-git-send-email-helin.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 2/5] ethdev: add new ops of\n\t'check_command_supported' and 'rx_classification_filter_ctl'",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <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>",
        "X-List-Received-Date": "Thu, 24 Jul 2014 06:41:29 -0000"
    },
    "content": "Two ops of 'check_command_supported' and 'rx_classification_filter_ctl'\nare added.\n* 'check_command_supported' is for capability discovery. In anothoer\n  word, it is to check if specific feature/command is supported by\n  the specific port.\n* 'rx_classification_filter_ctl' is for receive classifcation filter\n  configuring. e.g. hash function configuration, flow director\n  configuration. It is a common API where a lot of commands can\n  be implemented for different sub features.\n\nSigned-off-by: Helin Zhang <helin.zhang@intel.com>\n---\n lib/librte_ether/rte_ethdev.c | 31 ++++++++++++++++++++++++++\n lib/librte_ether/rte_ethdev.h | 52 +++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 83 insertions(+)",
    "diff": "diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex fd1010a..7afffb4 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -3002,3 +3002,34 @@ rte_eth_dev_get_flex_filter(uint8_t port_id, uint16_t index,\n \treturn (*dev->dev_ops->get_flex_filter)(dev, index, filter,\n \t\t\t\t\t\trx_queue);\n }\n+\n+int\n+rte_eth_dev_check_command_supported(uint8_t port_id, uint32_t cmd)\n+{\n+\tstruct rte_eth_dev *dev;\n+\n+\tif (port_id >= nb_ports) {\n+\t\tPMD_DEBUG_TRACE(\"Invalid port_id=%d\\n\", port_id);\n+\t\treturn -ENODEV;\n+\t}\n+\tdev = &rte_eth_devices[port_id];\n+\tFUNC_PTR_OR_ERR_RET(*dev->dev_ops->check_command_supported, -ENOTSUP);\n+\treturn (*dev->dev_ops->check_command_supported)(dev, cmd);\n+}\n+\n+int\n+rte_eth_dev_rx_classification_filter_ctl(uint8_t port_id,\n+\t\t\t\t\t uint32_t cmd,\n+\t\t\t\t\t void *args)\n+{\n+\tstruct rte_eth_dev *dev;\n+\n+\tif (port_id >= nb_ports) {\n+\t\tPMD_DEBUG_TRACE(\"Invalid port_id=%d\\n\", port_id);\n+\t\treturn -ENODEV;\n+\t}\n+\tdev = &rte_eth_devices[port_id];\n+\tFUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_classification_filter_ctl,\n+\t\t\t\t\t\t\t\t-ENOTSUP);\n+\treturn (*dev->dev_ops->rx_classification_filter_ctl)(dev, cmd, args);\n+}\ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex a262463..482e64d 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -1240,6 +1240,15 @@ typedef int (*eth_mirror_rule_reset_t)(struct rte_eth_dev *dev,\n \t\t\t\t  uint8_t rule_id);\n /**< @internal Remove a traffic mirroring rule on an Ethernet device */\n \n+typedef int (*eth_check_command_supported_t)(struct rte_eth_dev *dev,\n+\t\t\t\t\t     uint32_t cmd);\n+/**< @internal check if the command is supported by the Ethernet device */\n+\n+typedef int (*eth_rx_classification_filter_ctl_t)(struct rte_eth_dev *dev,\n+\t\t\t\t\t\t  uint32_t cmd,\n+\t\t\t\t\t\t  void *arg);\n+/**< @internal receive classification filter control operations */\n+\n #ifdef RTE_NIC_BYPASS\n \n enum {\n@@ -1467,6 +1476,10 @@ struct eth_dev_ops {\n \teth_add_flex_filter_t          add_flex_filter;      /**< add flex filter. */\n \teth_remove_flex_filter_t       remove_flex_filter;   /**< remove flex filter. */\n \teth_get_flex_filter_t          get_flex_filter;      /**< get flex filter. */\n+\teth_check_command_supported_t  check_command_supported;\n+\t/**< check if a command is supported. */\n+\teth_rx_classification_filter_ctl_t rx_classification_filter_ctl;\n+\t/**< common control function of hw hash */\n };\n \n /**\n@@ -3557,6 +3570,45 @@ int rte_eth_dev_remove_flex_filter(uint8_t port_id, uint16_t index);\n int rte_eth_dev_get_flex_filter(uint8_t port_id, uint16_t index,\n \t\t\tstruct rte_flex_filter *filter, uint16_t *rx_queue);\n \n+/**\n+ * Check if the command is supported by an Ethernet device.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param cmd\n+ *   The command.\n+ *\n+ * @return\n+ *   - (> 0) The command is supported.\n+ *   - (0) The command is not supported.\n+ *   - (-ENOTSUP) if hardware doesn't support.\n+ *   - (-ENODEV) if <port_id> is invalid.\n+ */\n+int rte_eth_dev_check_command_supported(uint8_t port_id, uint32_t cmd);\n+\n+/**\n+ * Control the receive classification filter, including hash function\n+ * selection. The commands are NIC specific in its exported public\n+ * header file. Different types of NIC may have different commands.\n+ * For example, the supported commands for i40e can be found in rte_i40e.h.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param cmd\n+ *   The commands.\n+ * @param args\n+ *   A pointer to arguments defined specifically for the command.\n+ *\n+ * @return\n+ *   - (0) if successful.\n+ *   - (-ENOTSUP) if hardware doesn't support.\n+ *   - (-ENODEV) if <port_id> is invalid.\n+ *   - others depends on the specific command implementation.\n+ */\n+int rte_eth_dev_rx_classification_filter_ctl(uint8_t port_id,\n+\t\t\t\t\t     uint32_t cmd,\n+\t\t\t\t\t     void *args);\n+\n #ifdef __cplusplus\n }\n #endif\n",
    "prefixes": [
        "dpdk-dev",
        "2/5"
    ]
}