get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 11254,
    "url": "https://patches.dpdk.org/api/patches/11254/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1457509482-4297-3-git-send-email-wenzhuo.lu@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": "<1457509482-4297-3-git-send-email-wenzhuo.lu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1457509482-4297-3-git-send-email-wenzhuo.lu@intel.com",
    "date": "2016-03-09T07:44:39",
    "name": "[dpdk-dev,v7,2/5] lib/librte_ether: support l2 tunnel operations",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b3416d667fe29848dfaea3a29a3b533fa58b5ffc",
    "submitter": {
        "id": 258,
        "url": "https://patches.dpdk.org/api/people/258/?format=api",
        "name": "Wenzhuo Lu",
        "email": "wenzhuo.lu@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/1457509482-4297-3-git-send-email-wenzhuo.lu@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/11254/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/11254/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 8423A2C5D;\n\tWed,  9 Mar 2016 08:44:57 +0100 (CET)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id E24612C5D\n\tfor <dev@dpdk.org>; Wed,  9 Mar 2016 08:44:55 +0100 (CET)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga102.jf.intel.com with ESMTP; 08 Mar 2016 23:44:54 -0800",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga003.jf.intel.com with ESMTP; 08 Mar 2016 23:44:54 -0800",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id u297iqQZ007171;\n\tWed, 9 Mar 2016 15:44:52 +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 u297imjn004346; Wed, 9 Mar 2016 15:44:50 +0800",
            "(from wenzhuol@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u297imwm004342; \n\tWed, 9 Mar 2016 15:44:48 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.24,310,1455004800\"; d=\"scan'208\";a=\"760774194\"",
        "From": "Wenzhuo Lu <wenzhuo.lu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Wed,  9 Mar 2016 15:44:39 +0800",
        "Message-Id": "<1457509482-4297-3-git-send-email-wenzhuo.lu@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1457509482-4297-1-git-send-email-wenzhuo.lu@intel.com>",
        "References": "<1454051035-25757-1-git-send-email-wenzhuo.lu@intel.com>\n\t<1457509482-4297-1-git-send-email-wenzhuo.lu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v7 2/5] lib/librte_ether: support l2 tunnel\n\toperations",
        "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>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Add functions to support l2 tunnel configuration and operations.\n1, L2 tunnel ether type modification.\n   It means modifying the ether type of a specific type of tunnel.\n   So the packet with this ether type will be parsed as this type\n   of tunnel.\n2, Enabling/disabling l2 tunnel support.\n   It means enabling/disabling the ability of parsing the specific\n   type of tunnel. This ability should be enabled before we enable\n   filtering, forwarding, offloading for this specific type of\n   tunnel.\n3, Insertion and stripping for l2 tunnel tag.\n4, Forwarding the packets to a pool based on l2 tunnel tag.\n\nOnly support e-tag tunnel now.\n\nSigned-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>\n---\n lib/librte_ether/rte_eth_ctrl.h        | 18 ++++++++\n lib/librte_ether/rte_ethdev.c          | 54 ++++++++++++++++++++++++\n lib/librte_ether/rte_ethdev.h          | 75 ++++++++++++++++++++++++++++++++++\n lib/librte_ether/rte_ether_version.map |  7 ++++\n 4 files changed, 154 insertions(+)",
    "diff": "diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h\nindex ce224ad..0b71f47 100644\n--- a/lib/librte_ether/rte_eth_ctrl.h\n+++ b/lib/librte_ether/rte_eth_ctrl.h\n@@ -89,6 +89,7 @@ enum rte_filter_type {\n \tRTE_ETH_FILTER_TUNNEL,\n \tRTE_ETH_FILTER_FDIR,\n \tRTE_ETH_FILTER_HASH,\n+\tRTE_ETH_FILTER_L2_TUNNEL,\n \tRTE_ETH_FILTER_MAX\n };\n \n@@ -804,6 +805,23 @@ struct rte_eth_hash_filter_info {\n \t} info;\n };\n \n+/**\n+ * l2 tunnel type.\n+ */\n+enum rte_eth_l2_tunnel_type {\n+\tRTE_L2_TUNNEL_TYPE_NONE = 0,\n+\tRTE_L2_TUNNEL_TYPE_E_TAG,\n+\tRTE_L2_TUNNEL_TYPE_MAX,\n+};\n+\n+struct rte_eth_l2_tunnel_conf {\n+\tenum rte_eth_l2_tunnel_type l2_tunnel_type;\n+\tuint16_t ether_type;\n+\tuint32_t tunnel_id; /* port tag id for e-tag */\n+\tuint16_t vf_id;\n+\tuint32_t pool;\n+};\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex 756b234..dfd4541 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -3237,3 +3237,57 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_de\n \teth_dev->data->numa_node = pci_dev->numa_node;\n \teth_dev->data->drv_name = pci_dev->driver->name;\n }\n+\n+int\n+rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id,\n+\t\t\t\t    struct rte_eth_l2_tunnel_conf *l2_tunnel)\n+{\n+\tstruct rte_eth_dev *dev;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tif (l2_tunnel == NULL) {\n+\t\tRTE_PMD_DEBUG_TRACE(\"Invalid l2_tunnel parameter\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (l2_tunnel->l2_tunnel_type >= RTE_L2_TUNNEL_TYPE_MAX) {\n+\t\tRTE_PMD_DEBUG_TRACE(\"Invalid l2 tunnel type\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tdev = &rte_eth_devices[port_id];\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->l2_tunnel_eth_type_conf,\n+\t\t\t\t-ENOTSUP);\n+\treturn (*dev->dev_ops->l2_tunnel_eth_type_conf)(dev, l2_tunnel);\n+}\n+\n+int\n+rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id,\n+\t\t\t\t  struct rte_eth_l2_tunnel_conf *l2_tunnel,\n+\t\t\t\t  uint32_t mask,\n+\t\t\t\t  uint8_t en)\n+{\n+\tstruct rte_eth_dev *dev;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\n+\tif (l2_tunnel == NULL) {\n+\t\tRTE_PMD_DEBUG_TRACE(\"Invalid l2_tunnel parameter\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (l2_tunnel->l2_tunnel_type >= RTE_L2_TUNNEL_TYPE_MAX) {\n+\t\tRTE_PMD_DEBUG_TRACE(\"Invalid l2 tunnel type.\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (mask == 0) {\n+\t\tRTE_PMD_DEBUG_TRACE(\"Mask should have a value.\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tdev = &rte_eth_devices[port_id];\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->l2_tunnel_offload_set,\n+\t\t\t\t-ENOTSUP);\n+\treturn (*dev->dev_ops->l2_tunnel_offload_set)(dev, l2_tunnel, mask, en);\n+}\ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex 16da821..2008f1c 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -957,6 +957,19 @@ TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);\n \t} \\\n } while (0)\n \n+/**\n+ * l2 tunnel configuration.\n+ */\n+\n+/**< l2 tunnel enable mask */\n+#define ETH_L2_TUNNEL_ENABLE_MASK       0x00000001\n+/**< l2 tunnel insertion mask */\n+#define ETH_L2_TUNNEL_INSERTION_MASK    0x00000002\n+/**< l2 tunnel stripping mask */\n+#define ETH_L2_TUNNEL_STRIPPING_MASK    0x00000004\n+/**< l2 tunnel forwarding mask */\n+#define ETH_L2_TUNNEL_FORWARDING_MASK   0x00000008\n+\n /*\n  * Definitions of all functions exported by an Ethernet driver through the\n  * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*\n@@ -1261,6 +1274,17 @@ typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,\n \t\t\t\tstruct rte_dev_eeprom_info *info);\n /**< @internal Program eeprom data  */\n \n+typedef int (*eth_l2_tunnel_eth_type_conf_t)\n+\t(struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);\n+/**< @internal config l2 tunnel ether type */\n+\n+typedef int (*eth_l2_tunnel_offload_set_t)\n+\t(struct rte_eth_dev *dev,\n+\t struct rte_eth_l2_tunnel_conf *l2_tunnel,\n+\t uint32_t mask,\n+\t uint8_t en);\n+/**< @internal enable/disable the l2 tunnel offload functions */\n+\n #ifdef RTE_NIC_BYPASS\n \n enum {\n@@ -1443,6 +1467,10 @@ struct eth_dev_ops {\n \teth_timesync_read_time timesync_read_time;\n \t/** Set the device clock time. */\n \teth_timesync_write_time timesync_write_time;\n+\t/** Config ether type of l2 tunnel */\n+\teth_l2_tunnel_eth_type_conf_t l2_tunnel_eth_type_conf;\n+\t/** Enable/disable l2 tunnel offload functions */\n+\teth_l2_tunnel_offload_set_t l2_tunnel_offload_set;\n };\n \n /**\n@@ -3880,6 +3908,53 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name,\n \t\t\t uint16_t queue_id, size_t size,\n \t\t\t unsigned align, int socket_id);\n \n+ /**\n+ * Config l2 tunnel ether type of an Ethernet device for filtering specific\n+ * tunnel packets by ether type.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param l2_tunnel\n+ *   l2 tunnel configuration.\n+ *\n+ * @return\n+ *   - (0) if successful.\n+ *   - (-ENODEV) if port identifier is invalid.\n+ *   - (-ENOTSUP) if hardware doesn't support tunnel type.\n+ */\n+int\n+rte_eth_dev_l2_tunnel_eth_type_conf(uint8_t port_id,\n+\t\t\t\t    struct rte_eth_l2_tunnel_conf *l2_tunnel);\n+\n+ /**\n+ * Enable/disable l2 tunnel offload functions. Include,\n+ * 1, The ability of parsing a type of l2 tunnel of an Ethernet device.\n+ *    Filtering, forwarding and offloading this type of tunnel packets depend on\n+ *    this ability.\n+ * 2, Stripping the l2 tunnel tag.\n+ * 3, Insertion of the l2 tunnel tag.\n+ * 4, Forwarding the packets based on the l2 tunnel tag.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param l2_tunnel\n+ *   l2 tunnel parameters.\n+ * @param mask\n+ *   Indicate the offload function.\n+ * @param en\n+ *   Enable or disable this function.\n+ *\n+ * @return\n+ *   - (0) if successful.\n+ *   - (-ENODEV) if port identifier is invalid.\n+ *   - (-ENOTSUP) if hardware doesn't support tunnel type.\n+ */\n+int\n+rte_eth_dev_l2_tunnel_offload_set(uint8_t port_id,\n+\t\t\t\t  struct rte_eth_l2_tunnel_conf *l2_tunnel,\n+\t\t\t\t  uint32_t mask,\n+\t\t\t\t  uint8_t en);\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map\nindex d8db24d..3a8aa94 100644\n--- a/lib/librte_ether/rte_ether_version.map\n+++ b/lib/librte_ether/rte_ether_version.map\n@@ -117,3 +117,10 @@ DPDK_2.2 {\n \n \tlocal: *;\n };\n+\n+DPDK_2.3 {\n+\tglobal:\n+\n+\trte_eth_dev_l2_tunnel_eth_type_conf;\n+\trte_eth_dev_l2_tunnel_offload_set;\n+}DPDK_2.2;\n",
    "prefixes": [
        "dpdk-dev",
        "v7",
        "2/5"
    ]
}