get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 11227,
    "url": "http://patches.dpdk.org/api/patches/11227/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1457494514-5862-4-git-send-email-wenzhuo.lu@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<1457494514-5862-4-git-send-email-wenzhuo.lu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1457494514-5862-4-git-send-email-wenzhuo.lu@intel.com",
    "date": "2016-03-09T03:35:12",
    "name": "[dpdk-dev,v8,3/5] ixgbe: support UDP tunnel port config",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ab6335cafe994790b3adec2343bbe3430793c49d",
    "submitter": {
        "id": 258,
        "url": "http://patches.dpdk.org/api/people/258/?format=api",
        "name": "Wenzhuo Lu",
        "email": "wenzhuo.lu@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1457494514-5862-4-git-send-email-wenzhuo.lu@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/11227/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/11227/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 703F1378B;\n\tWed,  9 Mar 2016 04:35:31 +0100 (CET)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 4B675374D\n\tfor <dev@dpdk.org>; Wed,  9 Mar 2016 04:35:29 +0100 (CET)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga102.jf.intel.com with ESMTP; 08 Mar 2016 19:35:28 -0800",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga003.jf.intel.com with ESMTP; 08 Mar 2016 19:35:27 -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 u293ZPNV015027;\n\tWed, 9 Mar 2016 11:35:25 +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 u293ZMqE005985; Wed, 9 Mar 2016 11:35:24 +0800",
            "(from wenzhuol@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u293ZM8L005981; \n\tWed, 9 Mar 2016 11:35:22 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.22,559,1449561600\"; d=\"scan'208\";a=\"760677124\"",
        "From": "Wenzhuo Lu <wenzhuo.lu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Wed,  9 Mar 2016 11:35:12 +0800",
        "Message-Id": "<1457494514-5862-4-git-send-email-wenzhuo.lu@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1457494514-5862-1-git-send-email-wenzhuo.lu@intel.com>",
        "References": "<1452496044-17524-1-git-send-email-wenzhuo.lu@intel.com>\n\t<1457494514-5862-1-git-send-email-wenzhuo.lu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v8 3/5] ixgbe: support UDP tunnel port config",
        "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 UDP tunnel port add/del support on ixgbe. Now only\nsupport VxLAN port configuration.\nAlthough according to the specification the VxLAN port has\na default value 4789, it can be changed. We support VxLAN\nport configuration to meet the change.\nNote, the default value of VxLAN port in ixgbe NICs is 0. So\nplease set it when using VxLAN off-load.\n\nSigned-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>\nAcked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\n---\n drivers/net/ixgbe/ixgbe_ethdev.c | 123 +++++++++++++++++++++++++++++++++++++++\n 1 file changed, 123 insertions(+)",
    "diff": "diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c\nindex 3e6fe86..25e2e38 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.c\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.c\n@@ -337,6 +337,10 @@ static int ixgbe_timesync_read_time(struct rte_eth_dev *dev,\n \t\t\t\t   struct timespec *timestamp);\n static int ixgbe_timesync_write_time(struct rte_eth_dev *dev,\n \t\t\t\t   const struct timespec *timestamp);\n+static int ixgbe_dev_udp_tunnel_port_add(struct rte_eth_dev *dev,\n+\t\t\t\t\t struct rte_eth_udp_tunnel *udp_tunnel);\n+static int ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,\n+\t\t\t\t\t struct rte_eth_udp_tunnel *udp_tunnel);\n \n /*\n  * Define VF Stats MACRO for Non \"cleared on read\" register\n@@ -495,6 +499,10 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = {\n \t.timesync_adjust_time = ixgbe_timesync_adjust_time,\n \t.timesync_read_time   = ixgbe_timesync_read_time,\n \t.timesync_write_time  = ixgbe_timesync_write_time,\n+\t.udp_tunnel_add       = ixgbe_dev_udp_tunnel_port_add,\n+\t.udp_tunnel_del       = ixgbe_dev_udp_tunnel_port_del,\n+\t.udp_tunnel_port_add  = ixgbe_dev_udp_tunnel_port_add,\n+\t.udp_tunnel_port_del  = ixgbe_dev_udp_tunnel_port_del,\n };\n \n /*\n@@ -6191,6 +6199,121 @@ ixgbe_dev_get_dcb_info(struct rte_eth_dev *dev,\n \treturn 0;\n }\n \n+static int\n+ixgbe_update_vxlan_port(struct ixgbe_hw *hw,\n+\t\t\tuint16_t port)\n+{\n+\tIXGBE_WRITE_REG(hw, IXGBE_VXLANCTRL, port);\n+\tIXGBE_WRITE_FLUSH(hw);\n+\n+\treturn 0;\n+}\n+\n+/* There's only one register for VxLAN UDP port.\n+ * So, we cannot add several ports. Will update it.\n+ */\n+static int\n+ixgbe_add_vxlan_port(struct ixgbe_hw *hw,\n+\t\t     uint16_t port)\n+{\n+\tif (port == 0) {\n+\t\tPMD_DRV_LOG(ERR, \"Add VxLAN port 0 is not allowed.\");\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn ixgbe_update_vxlan_port(hw, port);\n+}\n+\n+/* We cannot delete the VxLAN port. For there's a register for VxLAN\n+ * UDP port, it must have a value.\n+ * So, will reset it to the original value 0.\n+ */\n+static int\n+ixgbe_del_vxlan_port(struct ixgbe_hw *hw,\n+\t\t     uint16_t port)\n+{\n+\tuint16_t cur_port;\n+\n+\tcur_port = (uint16_t)IXGBE_READ_REG(hw, IXGBE_VXLANCTRL);\n+\n+\tif (cur_port != port) {\n+\t\tPMD_DRV_LOG(ERR, \"Port %u does not exist.\", port);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn ixgbe_update_vxlan_port(hw, 0);\n+}\n+\n+/* Add UDP tunneling port */\n+static int\n+ixgbe_dev_udp_tunnel_port_add(struct rte_eth_dev *dev,\n+\t\t\t      struct rte_eth_udp_tunnel *udp_tunnel)\n+{\n+\tint ret = 0;\n+\tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\n+\tif (hw->mac.type != ixgbe_mac_X550 &&\n+\t    hw->mac.type != ixgbe_mac_X550EM_x) {\n+\t\treturn -ENOTSUP;\n+\t}\n+\n+\tif (udp_tunnel == NULL)\n+\t\treturn -EINVAL;\n+\n+\tswitch (udp_tunnel->prot_type) {\n+\tcase RTE_TUNNEL_TYPE_VXLAN:\n+\t\tret = ixgbe_add_vxlan_port(hw, udp_tunnel->udp_port);\n+\t\tbreak;\n+\n+\tcase RTE_TUNNEL_TYPE_GENEVE:\n+\tcase RTE_TUNNEL_TYPE_TEREDO:\n+\t\tPMD_DRV_LOG(ERR, \"Tunnel type is not supported now.\");\n+\t\tret = -EINVAL;\n+\t\tbreak;\n+\n+\tdefault:\n+\t\tPMD_DRV_LOG(ERR, \"Invalid tunnel type\");\n+\t\tret = -EINVAL;\n+\t\tbreak;\n+\t}\n+\n+\treturn ret;\n+}\n+\n+/* Remove UDP tunneling port */\n+static int\n+ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,\n+\t\t\t      struct rte_eth_udp_tunnel *udp_tunnel)\n+{\n+\tint ret = 0;\n+\tstruct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\n+\tif (hw->mac.type != ixgbe_mac_X550 &&\n+\t    hw->mac.type != ixgbe_mac_X550EM_x) {\n+\t\treturn -ENOTSUP;\n+\t}\n+\n+\tif (udp_tunnel == NULL)\n+\t\treturn -EINVAL;\n+\n+\tswitch (udp_tunnel->prot_type) {\n+\tcase RTE_TUNNEL_TYPE_VXLAN:\n+\t\tret = ixgbe_del_vxlan_port(hw, udp_tunnel->udp_port);\n+\t\tbreak;\n+\tcase RTE_TUNNEL_TYPE_GENEVE:\n+\tcase RTE_TUNNEL_TYPE_TEREDO:\n+\t\tPMD_DRV_LOG(ERR, \"Tunnel type is not supported now.\");\n+\t\tret = -EINVAL;\n+\t\tbreak;\n+\tdefault:\n+\t\tPMD_DRV_LOG(ERR, \"Invalid tunnel type\");\n+\t\tret = -EINVAL;\n+\t\tbreak;\n+\t}\n+\n+\treturn ret;\n+}\n+\n static struct rte_driver rte_ixgbe_driver = {\n \t.type = PMD_PDEV,\n \t.init = rte_ixgbe_pmd_init,\n",
    "prefixes": [
        "dpdk-dev",
        "v8",
        "3/5"
    ]
}