get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 10864,
    "url": "https://patches.dpdk.org/api/patches/10864/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1456475710-20355-4-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": "<1456475710-20355-4-git-send-email-wenzhuo.lu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1456475710-20355-4-git-send-email-wenzhuo.lu@intel.com",
    "date": "2016-02-26T08:35:08",
    "name": "[dpdk-dev,v4,3/5] ixgbe: support UDP tunnel port config",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "adf0633e9e45df6d4cea6c19170d705b95dc351a",
    "submitter": {
        "id": 258,
        "url": "https://patches.dpdk.org/api/people/258/?format=api",
        "name": "Wenzhuo Lu",
        "email": "wenzhuo.lu@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1456475710-20355-4-git-send-email-wenzhuo.lu@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/10864/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/10864/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 DF6B52C4B;\n\tFri, 26 Feb 2016 09:35:50 +0100 (CET)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 561292C29\n\tfor <dev@dpdk.org>; Fri, 26 Feb 2016 09:35:47 +0100 (CET)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga103.fm.intel.com with ESMTP; 26 Feb 2016 00:35:27 -0800",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga004.fm.intel.com with ESMTP; 26 Feb 2016 00:35:26 -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 u1Q8ZOlH004172;\n\tFri, 26 Feb 2016 16:35:24 +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 u1Q8ZK4u020415; Fri, 26 Feb 2016 16:35:22 +0800",
            "(from wenzhuol@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u1Q8ZKWw020411; \n\tFri, 26 Feb 2016 16:35:20 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.22,498,1449561600\"; d=\"scan'208\";a=\"55147518\"",
        "From": "Wenzhuo Lu <wenzhuo.lu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 26 Feb 2016 16:35:08 +0800",
        "Message-Id": "<1456475710-20355-4-git-send-email-wenzhuo.lu@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1456475710-20355-1-git-send-email-wenzhuo.lu@intel.com>",
        "References": "<1452496044-17524-1-git-send-email-wenzhuo.lu@intel.com>\n\t<1456475710-20355-1-git-send-email-wenzhuo.lu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 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 the VxLAN port has a default value 4789, it can be\nchanged. We support VxLAN port configuration to meet the\nchange.\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>\n---\n drivers/net/ixgbe/ixgbe_ethdev.c | 95 ++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 95 insertions(+)",
    "diff": "diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c\nindex 3e6fe86..eadf793 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,93 @@ ixgbe_dev_get_dcb_info(struct rte_eth_dev *dev,\n \treturn 0;\n }\n \n+#define DEFAULT_VXLAN_PORT 4789\n+\n+/* on x550, there's only one register for VxLAN UDP port.\n+ * So, we cannot add or del the port. We only update it.\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+/* 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\t/* cannot add a port, update the port value */\n+\t\tret = ixgbe_update_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 = -1;\n+\t\tbreak;\n+\n+\tdefault:\n+\t\tPMD_DRV_LOG(ERR, \"Invalid tunnel type\");\n+\t\tret = -1;\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\t/* cannot del the port, reset it to default */\n+\t\tret = ixgbe_update_vxlan_port(hw, DEFAULT_VXLAN_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 = -1;\n+\t\tbreak;\n+\tdefault:\n+\t\tPMD_DRV_LOG(ERR, \"Invalid tunnel type\");\n+\t\tret = -1;\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",
        "v4",
        "3/5"
    ]
}