get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 245,
    "url": "https://patches.dpdk.org/api/patches/245/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1409105634-29980-3-git-send-email-jingjing.wu@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": "<1409105634-29980-3-git-send-email-jingjing.wu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1409105634-29980-3-git-send-email-jingjing.wu@intel.com",
    "date": "2014-08-27T02:13:49",
    "name": "[dpdk-dev,v2,2/7] ethdev: define new ethdev API rx_classification_filter_ctl",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b90ec75a09c358c60743596b503025479499a7ec",
    "submitter": {
        "id": 47,
        "url": "https://patches.dpdk.org/api/people/47/?format=api",
        "name": "Jingjing Wu",
        "email": "jingjing.wu@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1409105634-29980-3-git-send-email-jingjing.wu@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/245/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/245/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<wujingji@shecgisg004.sh.intel.com>",
        "Received": [
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 4747A58EE\n\tfor <dev@dpdk.org>; Wed, 27 Aug 2014 04:10:33 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP; 26 Aug 2014 19:14:17 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga002.jf.intel.com with ESMTP; 26 Aug 2014 19:14:15 -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 s7R2EEsb005232;\n\tWed, 27 Aug 2014 10:14:14 +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 s7R2EBCM030103; Wed, 27 Aug 2014 10:14:13 +0800",
            "(from wujingji@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s7R2EB8M030099; \n\tWed, 27 Aug 2014 10:14:11 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,408,1406617200\"; d=\"scan'208\";a=\"593783863\"",
        "From": "Jingjing Wu <jingjing.wu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Wed, 27 Aug 2014 10:13:49 +0800",
        "Message-Id": "<1409105634-29980-3-git-send-email-jingjing.wu@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": "<1409105634-29980-1-git-send-email-jingjing.wu@intel.com>",
        "References": "<1409105634-29980-1-git-send-email-jingjing.wu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 2/7] ethdev: define new ethdev API\n\trx_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": "Wed, 27 Aug 2014 02:10:34 -0000"
    },
    "content": "support a new ethdev API rx_classification_filter_ctl for all\nthe configuration or queries for receive classification filters.\nthis patch supports commands the API used below:\n  RTE_CMD_FDIR_RULE_ADD\n  RTE_CMD_FDIR_RULE_DEL\n  RTE_CMD_FDIR_FLUSH\n  RTE_CMD_FDIR_INFO_GET\n \nSigned-off-by: jingjing.wu <jingjing.wu@intel.com>\nReviewed-by: Helin Zhang <helin.zhang@intel.com>\nReviewed-by: Jing Chen <jing.d.chen@intel.com>\nReviewed-by: Jijiang Liu <jijiang.liu@intel.com>\n \n---\n lib/librte_ether/Makefile           |   3 +-\n lib/librte_ether/rte_eth_features.h |  65 ++++++++++++++++++++++\n lib/librte_ether/rte_ethdev.c       |  19 ++++++-\n lib/librte_ether/rte_ethdev.h       | 108 +++++++++++++++++++++++-------------\n 4 files changed, 155 insertions(+), 40 deletions(-)\n create mode 100644 lib/librte_ether/rte_eth_features.h",
    "diff": "diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile\nindex b310f8b..03dec8a 100644\n--- a/lib/librte_ether/Makefile\n+++ b/lib/librte_ether/Makefile\n@@ -46,8 +46,9 @@ SRCS-y += rte_ethdev.c\n #\n SYMLINK-y-include += rte_ether.h\n SYMLINK-y-include += rte_ethdev.h\n+SYMLINK-y-include += rte_eth_features.h\n \n # this lib depends upon:\n-DEPDIRS-y += lib/librte_eal lib/librte_mempool lib/librte_ring lib/librte_mbuf\n+DEPDIRS-y += lib/librte_eal lib/librte_mempool lib/librte_ring lib/librte_mbuf lib/librte_net\n \n include $(RTE_SDK)/mk/rte.lib.mk\ndiff --git a/lib/librte_ether/rte_eth_features.h b/lib/librte_ether/rte_eth_features.h\nnew file mode 100644\nindex 0000000..ea77b69\n--- /dev/null\n+++ b/lib/librte_ether/rte_eth_features.h\n@@ -0,0 +1,65 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ *   All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of Intel Corporation nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef _RTE_ETH_FEATURES_H_\n+#define _RTE_ETH_FEATURES_H_\n+\n+/**\n+ * @file\n+ *\n+ * Ethernet device specific features\n+ */\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+/* Commands defined for NIC specific features */\n+enum rte_eth_command {\n+\tRTE_CMD_UNKNOWN = 0,\n+\tRTE_CMD_FDIR_RULE_ADD,\n+\t/**< Command to add a new FDIR filter rule. */\n+\tRTE_CMD_FDIR_RULE_DEL,\n+\t/**< Command to delete a FDIR filter rule. */\n+\tRTE_CMD_FDIR_FLUSH,\n+\t/**< Command to clear all FDIR filter rules. */\n+\tRTE_CMD_FDIR_INFO_GET,\n+\t/**< Command to get FDIR information. */\n+\tRTE_CMD_MAX = 255,\n+};\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* _RTE_ETH_FEATURES_H_ */\ndiff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex fd1010a..10a08de 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -41,7 +41,6 @@\n #include <errno.h>\n #include <stdint.h>\n #include <inttypes.h>\n-#include <netinet/in.h>\n \n #include <rte_byteorder.h>\n #include <rte_log.h>\n@@ -66,6 +65,7 @@\n #include <rte_errno.h>\n #include <rte_spinlock.h>\n #include <rte_string_fns.h>\n+#include <rte_ip.h>\n \n #include \"rte_ether.h\"\n #include \"rte_ethdev.h\"\n@@ -3002,3 +3002,20 @@ 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_rx_classification_filter_ctl(uint8_t port_id,\n+\t\t\t\t\t enum rte_eth_command 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 50df654..a2d9596 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -177,6 +177,7 @@ extern \"C\" {\n #include <rte_pci.h>\n #include <rte_mbuf.h>\n #include \"rte_ether.h\"\n+#include \"rte_eth_features.h\"\n \n /**\n  * A structure used to retrieve statistics for an Ethernet port.\n@@ -345,47 +346,47 @@ struct rte_eth_rss_conf {\n #define ETH_RSS_IPV4_UDP_SHIFT                6\n #define ETH_RSS_IPV6_UDP_SHIFT                7\n #define ETH_RSS_IPV6_UDP_EX_SHIFT             8\n-/* for 40G only */\n-#define ETH_RSS_NONF_IPV4_UDP_SHIFT           31\n-#define ETH_RSS_NONF_IPV4_TCP_SHIFT           33\n-#define ETH_RSS_NONF_IPV4_SCTP_SHIFT          34\n-#define ETH_RSS_NONF_IPV4_OTHER_SHIFT         35\n-#define ETH_RSS_FRAG_IPV4_SHIFT               36\n-#define ETH_RSS_NONF_IPV6_UDP_SHIFT           41\n-#define ETH_RSS_NONF_IPV6_TCP_SHIFT           43\n-#define ETH_RSS_NONF_IPV6_SCTP_SHIFT          44\n-#define ETH_RSS_NONF_IPV6_OTHER_SHIFT         45\n-#define ETH_RSS_FRAG_IPV6_SHIFT               46\n-#define ETH_RSS_FCOE_OX_SHIFT                 48\n-#define ETH_RSS_FCOE_RX_SHIFT                 49\n-#define ETH_RSS_FCOE_OTHER_SHIFT              50\n-#define ETH_RSS_L2_PAYLOAD_SHIFT              63\n+/* Packet Classification Type for 40G only */\n+#define ETH_PCTYPE_NONF_IPV4_UDP              31\n+#define ETH_PCTYPE_NONF_IPV4_TCP              33\n+#define ETH_PCTYPE_NONF_IPV4_SCTP             34\n+#define ETH_PCTYPE_NONF_IPV4_OTHER            35\n+#define ETH_PCTYPE_FRAG_IPV4                  36\n+#define ETH_PCTYPE_NONF_IPV6_UDP              41\n+#define ETH_PCTYPE_NONF_IPV6_TCP              43\n+#define ETH_PCTYPE_NONF_IPV6_SCTP             44\n+#define ETH_PCTYPE_NONF_IPV6_OTHER            45\n+#define ETH_PCTYPE_FRAG_IPV6                  46\n+#define ETH_PCTYPE_FCOE_OX                    48 /* not used */\n+#define ETH_PCTYPE_FCOE_RX                    49 /* not used */\n+#define ETH_PCTYPE_FCOE_OTHER                 50 /* not used */\n+#define ETH_PCTYPE_L2_PAYLOAD                 63\n \n /* for 1G & 10G */\n-#define ETH_RSS_IPV4                    ((uint16_t)1 << ETH_RSS_IPV4_SHIFT)\n-#define ETH_RSS_IPV4_TCP                ((uint16_t)1 << ETH_RSS_IPV4_TCP_SHIFT)\n-#define ETH_RSS_IPV6                    ((uint16_t)1 << ETH_RSS_IPV6_SHIFT)\n-#define ETH_RSS_IPV6_EX                 ((uint16_t)1 << ETH_RSS_IPV6_EX_SHIFT)\n-#define ETH_RSS_IPV6_TCP                ((uint16_t)1 << ETH_RSS_IPV6_TCP_SHIFT)\n-#define ETH_RSS_IPV6_TCP_EX             ((uint16_t)1 << ETH_RSS_IPV6_TCP_EX_SHIFT)\n-#define ETH_RSS_IPV4_UDP                ((uint16_t)1 << ETH_RSS_IPV4_UDP_SHIFT)\n-#define ETH_RSS_IPV6_UDP                ((uint16_t)1 << ETH_RSS_IPV6_UDP_SHIFT)\n-#define ETH_RSS_IPV6_UDP_EX             ((uint16_t)1 << ETH_RSS_IPV6_UDP_EX_SHIFT)\n+#define ETH_RSS_IPV4                    (1 << ETH_RSS_IPV4_SHIFT)\n+#define ETH_RSS_IPV4_TCP                (1 << ETH_RSS_IPV4_TCP_SHIFT)\n+#define ETH_RSS_IPV6                    (1 << ETH_RSS_IPV6_SHIFT)\n+#define ETH_RSS_IPV6_EX                 (1 << ETH_RSS_IPV6_EX_SHIFT)\n+#define ETH_RSS_IPV6_TCP                (1 << ETH_RSS_IPV6_TCP_SHIFT)\n+#define ETH_RSS_IPV6_TCP_EX             (1 << ETH_RSS_IPV6_TCP_EX_SHIFT)\n+#define ETH_RSS_IPV4_UDP                (1 << ETH_RSS_IPV4_UDP_SHIFT)\n+#define ETH_RSS_IPV6_UDP                (1 << ETH_RSS_IPV6_UDP_SHIFT)\n+#define ETH_RSS_IPV6_UDP_EX             (1 << ETH_RSS_IPV6_UDP_EX_SHIFT)\n /* for 40G only */\n-#define ETH_RSS_NONF_IPV4_UDP           ((uint64_t)1 << ETH_RSS_NONF_IPV4_UDP_SHIFT)\n-#define ETH_RSS_NONF_IPV4_TCP           ((uint64_t)1 << ETH_RSS_NONF_IPV4_TCP_SHIFT)\n-#define ETH_RSS_NONF_IPV4_SCTP          ((uint64_t)1 << ETH_RSS_NONF_IPV4_SCTP_SHIFT)\n-#define ETH_RSS_NONF_IPV4_OTHER         ((uint64_t)1 << ETH_RSS_NONF_IPV4_OTHER_SHIFT)\n-#define ETH_RSS_FRAG_IPV4               ((uint64_t)1 << ETH_RSS_FRAG_IPV4_SHIFT)\n-#define ETH_RSS_NONF_IPV6_UDP           ((uint64_t)1 << ETH_RSS_NONF_IPV6_UDP_SHIFT)\n-#define ETH_RSS_NONF_IPV6_TCP           ((uint64_t)1 << ETH_RSS_NONF_IPV6_TCP_SHIFT)\n-#define ETH_RSS_NONF_IPV6_SCTP          ((uint64_t)1 << ETH_RSS_NONF_IPV6_SCTP_SHIFT)\n-#define ETH_RSS_NONF_IPV6_OTHER         ((uint64_t)1 << ETH_RSS_NONF_IPV6_OTHER_SHIFT)\n-#define ETH_RSS_FRAG_IPV6               ((uint64_t)1 << ETH_RSS_FRAG_IPV6_SHIFT)\n-#define ETH_RSS_FCOE_OX                 ((uint64_t)1 << ETH_RSS_FCOE_OX_SHIFT) /* not used */\n-#define ETH_RSS_FCOE_RX                 ((uint64_t)1 << ETH_RSS_FCOE_RX_SHIFT) /* not used */\n-#define ETH_RSS_FCOE_OTHER              ((uint64_t)1 << ETH_RSS_FCOE_OTHER_SHIFT) /* not used */\n-#define ETH_RSS_L2_PAYLOAD              ((uint64_t)1 << ETH_RSS_L2_PAYLOAD_SHIFT)\n+#define ETH_RSS_NONF_IPV4_UDP           (1ULL << ETH_PCTYPE_NONF_IPV4_UDP)\n+#define ETH_RSS_NONF_IPV4_TCP           (1ULL << ETH_PCTYPE_NONF_IPV4_TCP)\n+#define ETH_RSS_NONF_IPV4_SCTP          (1ULL << ETH_PCTYPE_NONF_IPV4_SCTP)\n+#define ETH_RSS_NONF_IPV4_OTHER         (1ULL << ETH_PCTYPE_NONF_IPV4_OTHER)\n+#define ETH_RSS_FRAG_IPV4               (1ULL << ETH_PCTYPE_FRAG_IPV4)\n+#define ETH_RSS_NONF_IPV6_UDP           (1ULL << ETH_PCTYPE_NONF_IPV6_UDP)\n+#define ETH_RSS_NONF_IPV6_TCP           (1ULL << ETH_PCTYPE_NONF_IPV6_TCP)\n+#define ETH_RSS_NONF_IPV6_SCTP          (1ULL << ETH_PCTYPE_NONF_IPV6_SCTP)\n+#define ETH_RSS_NONF_IPV6_OTHER         (1ULL << ETH_PCTYPE_NONF_IPV6_OTHER)\n+#define ETH_RSS_FRAG_IPV6               (1ULL << ETH_PCTYPE_FRAG_IPV6)\n+#define ETH_RSS_FCOE_OX                 (1ULL << ETH_PCTYPE_FCOE_OX)\n+#define ETH_RSS_FCOE_RX                 (1ULL << ETH_PCTYPE_FCOE_RX)\n+#define ETH_RSS_FCOE_OTHER              (1ULL << ETH_PCTYPE_FCOE_OTHER)\n+#define ETH_RSS_L2_PAYLOAD              (1ULL << ETH_PCTYPE_L2_PAYLOAD)\n \n #define ETH_RSS_IP ( \\\n \t\tETH_RSS_IPV4 | \\\n@@ -1361,6 +1362,11 @@ typedef int (*eth_get_flex_filter_t)(struct rte_eth_dev *dev,\n \t\t\tuint16_t *rx_queue);\n /**< @internal Get a flex filter rule on an Ethernet device */\n \n+typedef int (*eth_rx_classification_filter_ctl_t)(struct rte_eth_dev *dev,\n+\t\t\t\t\t\t  enum rte_eth_command cmd,\n+\t\t\t\t\t\t  void *arg);\n+/**< @internal receive classification filter control operations */\n+\n /**\n  * @internal A structure containing the functions exported by an Ethernet driver.\n  */\n@@ -1467,6 +1473,8 @@ 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+\t/*common ccontrol function for receive classification filters*/\n+\teth_rx_classification_filter_ctl_t rx_classification_filter_ctl;\n };\n \n /**\n@@ -3557,6 +3565,30 @@ 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+/**\n+ * Configure the receive classification filter, including hash function\n+ * selection. The commands are NIC specific in its exported public header\n+ * file. Different types of NIC may have different commands.\n+ * All the supported commands are defined in 'rte_eth_features.h'.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param cmd\n+ *   The command.\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     enum rte_eth_command cmd,\n+\t\t\t\t\t     void *args);\n+\n #ifdef __cplusplus\n }\n #endif\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "2/7"
    ]
}