Show a patch.

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

{
    "id": 220,
    "url": "https://patches.dpdk.org/api/patches/220/?format=api",
    "web_url": "https://patches.dpdk.org/patch/220/",
    "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"
    },
    "msgid": "<1409038294-21693-4-git-send-email-jijiang.liu@intel.com>",
    "date": "2014-08-26T07:31:30",
    "name": "[dpdk-dev,v2,3/7] rte_ether:add API of VxLAN packet filter in librte_ether",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "aed9d52f6e31cedd3e66370250c8fbd521c5f5ba",
    "submitter": {
        "id": 52,
        "url": "https://patches.dpdk.org/api/people/52/?format=api",
        "name": "Jijiang Liu",
        "email": "jijiang.liu@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/patch/220/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/220/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/220/checks/",
    "tags": {},
    "headers": {
        "X-Mailman-Version": "2.1.15",
        "X-ExtLoop1": "1",
        "Received": [
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id E03D81FE\n\tfor <dev@dpdk.org>; Tue, 26 Aug 2014 09:27:51 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga101.fm.intel.com with ESMTP; 26 Aug 2014 00:31:49 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga002.fm.intel.com with ESMTP; 26 Aug 2014 00:31:48 -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 s7Q7VkmO027264;\n\tTue, 26 Aug 2014 15:31:46 +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 s7Q7Vhqk021827; Tue, 26 Aug 2014 15:31:45 +0800",
            "(from jijiangl@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s7Q7VhaZ021822; \n\tTue, 26 Aug 2014 15:31:43 +0800"
        ],
        "References": "<1409038294-21693-1-git-send-email-jijiang.liu@intel.com>",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1409038294-21693-4-git-send-email-jijiang.liu@intel.com>",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,402,1406617200\"; d=\"scan'208\";a=\"589889185\"",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Precedence": "list",
        "From": "Jijiang Liu <jijiang.liu@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "X-List-Received-Date": "Tue, 26 Aug 2014 07:27:52 -0000",
        "Return-Path": "<jijiangl@shecgisg004.sh.intel.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "In-Reply-To": "<1409038294-21693-1-git-send-email-jijiang.liu@intel.com>",
        "To": "dev@dpdk.org",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "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>",
        "Date": "Tue, 26 Aug 2014 15:31:30 +0800",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Subject": "[dpdk-dev] [PATCH v2 3/7]rte_ether:add API of VxLAN packet filter\n\tin librte_ether"
    },
    "content": "VxLAN packet filters, which use MAC and VLAN to point\n   to a queue. The filter types supported are listed below:\n   1. Inner MAC and Inner VLAN ID\n   2. Inner MAC address, inner VLAN ID and tenant ID.\n   3. Inner MAC and tenant ID\n   4. Inner MAC address\n   5. Outer MAC address, tenant ID and inner MAC\n\nSigned-off-by: jijiangl <jijiang.liu@intel.com>\nAcked-by: Helin Zhang <helin.zhang@intel.com>\nAcked-by: Jingjing Wu <jingjing.wu@intel.com>\nAcked-by: Jing Chen <jing.d.chen@intel.com>\n\n---\n lib/librte_ether/rte_ethdev.c |   50 ++++++++++++++++++++++++++++\n lib/librte_ether/rte_ethdev.h |   72 +++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 122 insertions(+), 0 deletions(-)",
    "diff": "diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex 325edb1..d941d86 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -1955,6 +1955,56 @@ rte_eth_dev_udp_tunnel_delete(uint8_t port_id,\n }\n \n int\n+rte_eth_dev_tunnel_filter_set(uint8_t port_id,\n+\t\t\t struct rte_eth_tunnel_filter_conf *tunnel_filter,\n+\t\t\t uint8_t filter_count, uint8_t add)\n+{\n+\tuint8_t i;\n+\tstruct rte_eth_dev *dev;\n+\tstruct rte_eth_tunnel_filter_conf *pfilter;\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+\n+\tif (tunnel_filter == NULL) {\n+\t\tPMD_DEBUG_TRACE(\"Invalid oud_filter parameter\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\tpfilter = tunnel_filter;\n+\n+\tdev = &rte_eth_devices[port_id];\n+\tfor (i = 0; i < filter_count; i++, pfilter++) {\n+\t\tif (pfilter->queue_id >= dev->data->nb_rx_queues) {\n+\t\t\tPMD_DEBUG_TRACE(\"Invalid queue number\\n\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\tif (pfilter->inner_vlan > ETHER_MAX_VLAN_ID) {\n+\t\t\tPMD_DEBUG_TRACE(\"Invalid inner VLAN ID\\n\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\tif (is_zero_ether_addr(pfilter->outer_mac)) {\n+\t\t\tPMD_DEBUG_TRACE(\"port %d: Cannot add NULL outer MAC address\\n\",\n+\t\t\t\tport_id);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\n+\t\tif (is_zero_ether_addr(pfilter->inner_mac)) {\n+\t\t\tPMD_DEBUG_TRACE(\"port %d: Cannot add NULL inner MAC address\\n\",\n+\t\t\t\tport_id);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n+\tFUNC_PTR_OR_ERR_RET(*dev->dev_ops->tunnel_filter_set, -ENOTSUP);\n+\treturn (*dev->dev_ops->tunnel_filter_set)(dev, tunnel_filter,\n+\t\t\t\t\t\tfilter_count, add);\n+}\n+\n+int\n rte_eth_led_on(uint8_t port_id)\n {\n \tstruct rte_eth_dev *dev;\ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex d24907f..47d50da 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -707,6 +707,28 @@ struct rte_fdir_conf {\n \tuint8_t drop_queue;\n };\n \n+enum rte_tunnel_filter_type {\n+\tRTE_TUNNEL_FILTER_TYPE_NONE = 0,\n+\tRTE_TUNNEL_FILTER_IMAC_IVLAN, /**< Filter by inner MAC and VLAN ID. */\n+\tRTE_TUNNEL_FILTER_IMAC_IVLAN_TENID,\n+\t/**< Filter by inner MAC address and VLAN ID, tenned ID. */\n+\tRTE_TUNNEL_FILTER_IMAC_TENID, /**< Filter by inner MAC and tenant ID. */\n+\tRTE_TUNNEL_FILTER_IMAC, /**< Filter by inner MAC address */\n+\tRTE_TUNNEL_FILTER_OMAC_TENID_IMAC,\n+\t/**< Filter by outer MAC address, tenant ID and Inner MAC */\n+\tRTE_TUNNEL_FILTER_TYPE_MAX,\n+};\n+\n+#define RTE_TUNNEL_FLAGS_TO_QUEUE               1\n+\n+/**\n+ *  Select IPv4 or IPv6 tunnel filters.\n+ */\n+enum rte_tunnel_iptype {\n+\tRTE_TUNNEL_IPTYPE_IPV4 = 0, /**< IPv4. */\n+\tRTE_TUNNEL_IPTYPE_IPV6,     /**< IPv6. */\n+};\n+\n /**\n  * Tunneled type.\n  */\n@@ -720,6 +742,26 @@ enum rte_eth_tunnel_type {\n };\n \n /**\n+ * Tunnel Packet filter configuration.\n+ */\n+struct rte_eth_tunnel_filter_conf {\n+\tstruct ether_addr *outer_mac;  /**< Outer MAC address fiter. */\n+\tstruct ether_addr *inner_mac;  /**< Inner MAC address fiter. */\n+\tuint16_t inner_vlan;           /**< Inner VLAN fiter. */\n+\tenum rte_tunnel_iptype ip_type; /**< IP address type. */\n+\tunion {\n+\t\tuint32_t ipv4_addr;    /**< IPv4 source address to match. */\n+\t\tuint32_t ipv6_addr[4]; /**< IPv6 source address to match. */\n+\t} ip_addr; /**< IPv4/IPv6 source address to match (union of above). */\n+\n+\tuint8_t filter_type;           /**< Filter type. */\n+\tuint8_t to_queue;              /**< Use MAC and VLAN to point to a queue. */\n+\tenum rte_eth_tunnel_type tunnel_type; /**< Tunnel Type. */\n+\tuint32_t tenant_id;            /** < Tenant number. */\n+\tuint16_t queue_id;             /** < queue number. */\n+};\n+\n+/**\n  * UDP tunneling configuration.\n  */\n struct rte_eth_udp_tunnel {\n@@ -1251,6 +1293,11 @@ typedef int (*eth_set_vf_rate_limit_t)(struct rte_eth_dev *dev,\n \t\t\t\tuint64_t q_msk);\n /**< @internal Set VF TX rate */\n \n+typedef int (*eth_tunnel_filter_set_t)(struct rte_eth_dev *dev,\n+\t\t\t\t      struct rte_eth_tunnel_filter_conf *tunnel_filter,\n+\t\t\t\t      uint8_t filter_count, uint8_t add);\n+/**< @internal Set tunnel filter */\n+\n typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,\n \t\t\t\t  struct rte_eth_vmdq_mirror_conf *mirror_conf,\n \t\t\t\t  uint8_t rule_id,\n@@ -1446,6 +1493,7 @@ struct eth_dev_ops {\n \teth_set_vf_vlan_filter_t   set_vf_vlan_filter;  /**< Set VF VLAN filter */\n \teth_udp_tunnel_add_t       udp_tunnel_add;\n \teth_udp_tunnel_del_t       udp_tunnel_del;\n+\teth_tunnel_filter_set_t     tunnel_filter_set;\n \teth_set_queue_rate_limit_t set_queue_rate_limit;   /**< Set queue rate limit */\n \teth_set_vf_rate_limit_t    set_vf_rate_limit;   /**< Set VF rate limit */\n \n@@ -3344,6 +3392,30 @@ rte_eth_dev_udp_tunnel_delete(uint8_t port_id,\n \t\t\tstruct rte_eth_udp_tunnel *tunnel_udp,\n \t\t\tuint8_t count);\n \n+ /**\n+ * Add tunnel filter configuration of Ethernet device\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param tunnel_filter\n+ *   Where to store the current Tunneling UDP configuration\n+ *   of the Ethernet device.\n+ * @param filter_count\n+ *   How many filters are going to added.\n+ * @param add\n+ *   0: remove tunnel filter\n+ *   1: add tunnel filter\n+ *\n+ * @return\n+ *   - (0) if successful.\n+ *   - (-ENODEV) if port identifier is invalid.\n+ *   - (-EINVAL) if bad parameter.\n+ *   - (-ENOTSUP) if hardware doesn't support tunnel type.\n+ */\n+int\n+rte_eth_dev_tunnel_filter_set(uint8_t port_id,\n+\t\t\tstruct rte_eth_tunnel_filter_conf *tunnel_filter,\n+\t\t\tuint8_t filter_count, uint8_t add);\n /**\n  * add syn filter\n  *\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "3/7"
    ]
}