get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 573057,
    "url": "http://patchwork.ozlabs.org/api/patches/573057/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160126033300.16387.35470.stgit@localhost.localdomain/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20160126033300.16387.35470.stgit@localhost.localdomain>",
    "list_archive_url": null,
    "date": "2016-01-26T03:36:29",
    "name": "[next,2/3] ixgbe: Store VXLAN port number in network order",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "9f4023fecc57fa70c67cc650a7987e9b82ae2858",
    "submitter": {
        "id": 67293,
        "url": "http://patchwork.ozlabs.org/api/people/67293/?format=api",
        "name": "Alexander Duyck",
        "email": "aduyck@mirantis.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160126033300.16387.35470.stgit@localhost.localdomain/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/573057/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/573057/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Received": [
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ozlabs.org (Postfix) with ESMTP id C53201402F0\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 Jan 2016 14:36:37 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 02BF988B40;\n\tTue, 26 Jan 2016 03:36:36 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id TJYbg5hm-SEw; Tue, 26 Jan 2016 03:36:35 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 397F085684;\n\tTue, 26 Jan 2016 03:36:35 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 72C491C0F1D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 26 Jan 2016 03:36:34 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 53C7D2F94F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 26 Jan 2016 03:36:34 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id VhUS03N5JOvN for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 26 Jan 2016 03:36:33 +0000 (UTC)",
            "from mail-pa0-f49.google.com (mail-pa0-f49.google.com\n\t[209.85.220.49])\n\tby silver.osuosl.org (Postfix) with ESMTPS id A84852ED54\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 26 Jan 2016 03:36:30 +0000 (UTC)",
            "by mail-pa0-f49.google.com with SMTP id yy13so91015207pab.3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 25 Jan 2016 19:36:30 -0800 (PST)",
            "from localhost.localdomain\n\t(static-50-53-29-36.bvtn.or.frontiernet.net. [50.53.29.36])\n\tby smtp.gmail.com with ESMTPSA id\n\tf12sm31832508pat.20.2016.01.25.19.36.29\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 25 Jan 2016 19:36:29 -0800 (PST)"
        ],
        "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=mirantis.com header.i=@mirantis.com\n\theader.b=aLLQsySi; dkim-atps=neutral",
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "from auto-whitelisted by SQLgrey-1.7.6",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=mirantis.com;\n\ts=google; \n\th=subject:from:to:cc:date:message-id:in-reply-to:references\n\t:user-agent:mime-version:content-type:content-transfer-encoding;\n\tbh=kj7FW9ZLHR0pXWjYV8Yy9STh7lxPG8dTrBAhsCGSRjg=;\n\tb=aLLQsySi3ifAg3uvz/v9gFmTq7UdVtGNRJfYydGXPryl9JIbVhRKFT0y2/5QvuXAUK\n\t0T286vZ4hDaRli86McrkQHfDGk/f4SKxYMCoYVuZnHoyj+rDwvAlfaxvB3EIK21s7YFM\n\tpsWjMQIVFfghmCTR8fTtbN0BGea7L0ImtFX0s=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to\n\t:references:user-agent:mime-version:content-type\n\t:content-transfer-encoding;\n\tbh=kj7FW9ZLHR0pXWjYV8Yy9STh7lxPG8dTrBAhsCGSRjg=;\n\tb=S+g/yKZId6YyFOwOFqQlygDkDXTIPTkbiUu6hiClW4v5GkNLUaOJFPbGYvrnQ5x/xp\n\thzZdNe1bFlWkI/C6PkCTecXc3q0y3CIWdAPvGKXDwr+WjnIwi4yslsbuooCWxp5HB3AK\n\tOgJ5EI1Dcerv4zR71z2HXUPEBvbAvB/IEnWnHf2F6i/5gd+leBf7sxXjxli1/h8JdeKH\n\tU4VjSLeVkjKPalfstvj5aagyAHDO+6nwv6u1ev7ypTfuN6RewJt+flfMi3mMvs3oixA+\n\tmqgSNTG7UKp1oZY54PubjIN9oMjYucRm9ChIQqU3whmYp9mUymsskwnOqojehlejY0E7\n\tHx0Q==",
        "X-Gm-Message-State": "AG10YOSZjv4+fzmoI/dZHmYlfSSOTOdDzx2DOhEVu3tAxJ4NDJsgC07W1ZD997ryT8eXb8Ep",
        "X-Received": "by 10.66.242.17 with SMTP id wm17mr30442846pac.155.1453779390419;\n\tMon, 25 Jan 2016 19:36:30 -0800 (PST)",
        "From": "Alexander Duyck <aduyck@mirantis.com>",
        "To": "intel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com",
        "Date": "Mon, 25 Jan 2016 19:36:29 -0800",
        "Message-ID": "<20160126033300.16387.35470.stgit@localhost.localdomain>",
        "In-Reply-To": "<20160126032616.16387.86351.stgit@localhost.localdomain>",
        "References": "<20160126032616.16387.86351.stgit@localhost.localdomain>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [next PATCH 2/3] ixgbe: Store VXLAN port number\n\tin network order",
        "X-BeenThere": "intel-wired-lan@lists.osuosl.org",
        "X-Mailman-Version": "2.1.18-1",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>",
        "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>",
        "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "The VXLAN port number should be stored in network order instead of in host\norder as it is accessed from the hot-path in ATR.  This way we can avoid\nhaving to do any byte swaps in order to validate the port number.\n\nI moved the vxlan_port value into a hole in the read-mostly region of the\nadapter struct.  This way it should be in a warm cache-line instead of in\nsome isolated region in memory when it needs to be accessed.\n\nIn addition I went through and stripped a bunch of unneeded ifdef flags\nsince having an extra variable present doesn't really hurt anything and\nmakes the code easier to read.  I also went through and dropped the\nNETIF_F_RXCSUM flag which was being set in hw_encap_features but provides\nno value as the flag is not evaluated in the Rx path.\n\nSigned-off-by: Alexander Duyck <aduyck@mirantis.com>\n---\n\nTesting Hints:\nTest with X550 to verify that VXLAN offloads are still occurring as they should.\n\n drivers/net/ethernet/intel/ixgbe/ixgbe.h      |    8 +--\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   61 +++++++------------------\n 2 files changed, 20 insertions(+), 49 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\nindex 75dfbc36e138..12ae5963af64 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n@@ -661,9 +661,7 @@ struct ixgbe_adapter {\n #define IXGBE_FLAG2_RSS_FIELD_IPV6_UDP\t\t(u32)(1 << 9)\n #define IXGBE_FLAG2_PTP_PPS_ENABLED\t\t(u32)(1 << 10)\n #define IXGBE_FLAG2_PHY_INTERRUPT\t\t(u32)(1 << 11)\n-#ifdef CONFIG_IXGBE_VXLAN\n #define IXGBE_FLAG2_VXLAN_REREG_NEEDED\t\tBIT(12)\n-#endif\n #define IXGBE_FLAG2_VLAN_PROMISC\t\tBIT(13)\n \n \t/* Tx fast path data */\n@@ -675,6 +673,9 @@ struct ixgbe_adapter {\n \tint num_rx_queues;\n \tu16 rx_itr_setting;\n \n+\t/* Port number used to identify VXLAN traffic */\n+\t__be16 vxlan_port;\n+\n \t/* TX */\n \tstruct ixgbe_ring *tx_ring[MAX_TX_QUEUES] ____cacheline_aligned_in_smp;\n \n@@ -782,9 +783,6 @@ struct ixgbe_adapter {\n \tu32 timer_event_accumulator;\n \tu32 vferr_refcount;\n \tstruct ixgbe_mac_addr *mac_table;\n-#ifdef CONFIG_IXGBE_VXLAN\n-\tu16 vxlan_port;\n-#endif\n \tstruct kobject *info_kobj;\n #ifdef CONFIG_IXGBE_HWMON\n \tstruct hwmon_buff *ixgbe_hwmon_buff;\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 41bd7c4cecc1..88368d2f7e1a 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -4519,9 +4519,7 @@ static void ixgbe_clear_vxlan_port(struct ixgbe_adapter *adapter)\n \tcase ixgbe_mac_X550:\n \tcase ixgbe_mac_X550EM_x:\n \t\tIXGBE_WRITE_REG(&adapter->hw, IXGBE_VXLANCTRL, 0);\n-#ifdef CONFIG_IXGBE_VXLAN\n \t\tadapter->vxlan_port = 0;\n-#endif\n \t\tbreak;\n \tdefault:\n \t\tbreak;\n@@ -7504,9 +7502,6 @@ static void ixgbe_atr(struct ixgbe_ring *ring,\n \t} hdr;\n \tstruct tcphdr *th;\n \tstruct sk_buff *skb;\n-#ifdef CONFIG_IXGBE_VXLAN\n-\tu8 encap = false;\n-#endif /* CONFIG_IXGBE_VXLAN */\n \t__be16 vlan_id;\n \n \t/* if ring doesn't have a interrupt vector, cannot perform ATR */\n@@ -7522,28 +7517,21 @@ static void ixgbe_atr(struct ixgbe_ring *ring,\n \t/* snag network header to get L4 type and address */\n \tskb = first->skb;\n \thdr.network = skb_network_header(skb);\n-\tif (!skb->encapsulation) {\n-\t\tth = tcp_hdr(skb);\n-\t} else {\n+\tth = tcp_hdr(skb);\n #ifdef CONFIG_IXGBE_VXLAN\n+\tif (skb->encapsulation &&\n+\t    first->protocol == htons(ETH_P_IP) &&\n+\t    hdr.ipv4->protocol != IPPROTO_UDP) {\n \t\tstruct ixgbe_adapter *adapter = q_vector->adapter;\n \n-\t\tif (!adapter->vxlan_port)\n-\t\t\treturn;\n-\t\tif (first->protocol != htons(ETH_P_IP) ||\n-\t\t    hdr.ipv4->version != IPVERSION ||\n-\t\t    hdr.ipv4->protocol != IPPROTO_UDP) {\n-\t\t\treturn;\n+\t\t/* verify the port is recognized as VXLAN */\n+\t\tif (adapter->vxlan_port &&\n+\t\t    udp_hdr(skb)->dest == adapter->vxlan_port) {\n+\t\t\thdr.network = skb_inner_network_header(skb);\n+\t\t\tth = inner_tcp_hdr(skb);\n \t\t}\n-\t\tif (ntohs(udp_hdr(skb)->dest) != adapter->vxlan_port)\n-\t\t\treturn;\n-\t\tencap = true;\n-\t\thdr.network = skb_inner_network_header(skb);\n-\t\tth = inner_tcp_hdr(skb);\n-#else\n-\t\treturn;\n-#endif /* CONFIG_IXGBE_VXLAN */\n \t}\n+#endif /* CONFIG_IXGBE_VXLAN */\n \n \t/* Currently only IPv4/IPv6 with TCP is supported */\n \tswitch (hdr.ipv4->version) {\n@@ -7625,10 +7613,8 @@ static void ixgbe_atr(struct ixgbe_ring *ring,\n \t\tbreak;\n \t}\n \n-#ifdef CONFIG_IXGBE_VXLAN\n-\tif (encap)\n+\tif (hdr.network != skb_network_header(skb))\n \t\tinput.formatted.flow_type |= IXGBE_ATR_L4TYPE_TUNNEL_MASK;\n-#endif /* CONFIG_IXGBE_VXLAN */\n \n \t/* This assumes the Rx queue and Tx queue are bound to the same CPU */\n \tixgbe_fdir_add_signature_filter_82599(&q_vector->adapter->hw,\n@@ -8287,7 +8273,6 @@ static void ixgbe_add_vxlan_port(struct net_device *dev, sa_family_t sa_family,\n {\n \tstruct ixgbe_adapter *adapter = netdev_priv(dev);\n \tstruct ixgbe_hw *hw = &adapter->hw;\n-\tu16 new_port = ntohs(port);\n \n \tif (!(adapter->flags & IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE))\n \t\treturn;\n@@ -8295,18 +8280,18 @@ static void ixgbe_add_vxlan_port(struct net_device *dev, sa_family_t sa_family,\n \tif (sa_family == AF_INET6)\n \t\treturn;\n \n-\tif (adapter->vxlan_port == new_port)\n+\tif (adapter->vxlan_port == port)\n \t\treturn;\n \n \tif (adapter->vxlan_port) {\n \t\tnetdev_info(dev,\n \t\t\t    \"Hit Max num of VXLAN ports, not adding port %d\\n\",\n-\t\t\t    new_port);\n+\t\t\t    ntohs(port));\n \t\treturn;\n \t}\n \n-\tadapter->vxlan_port = new_port;\n-\tIXGBE_WRITE_REG(hw, IXGBE_VXLANCTRL, new_port);\n+\tadapter->vxlan_port = port;\n+\tIXGBE_WRITE_REG(hw, IXGBE_VXLANCTRL, ntohs(port));\n }\n \n /**\n@@ -8319,7 +8304,6 @@ static void ixgbe_del_vxlan_port(struct net_device *dev, sa_family_t sa_family,\n \t\t\t\t __be16 port)\n {\n \tstruct ixgbe_adapter *adapter = netdev_priv(dev);\n-\tu16 new_port = ntohs(port);\n \n \tif (!(adapter->flags & IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE))\n \t\treturn;\n@@ -8327,9 +8311,9 @@ static void ixgbe_del_vxlan_port(struct net_device *dev, sa_family_t sa_family,\n \tif (sa_family == AF_INET6)\n \t\treturn;\n \n-\tif (adapter->vxlan_port != new_port) {\n+\tif (adapter->vxlan_port != port) {\n \t\tnetdev_info(dev, \"Port %d was not found, not deleting\\n\",\n-\t\t\t    new_port);\n+\t\t\t    ntohs(port));\n \t\treturn;\n \t}\n \n@@ -8973,17 +8957,6 @@ skip_sriov:\n \tnetdev->priv_flags |= IFF_UNICAST_FLT;\n \tnetdev->priv_flags |= IFF_SUPP_NOFCS;\n \n-#ifdef CONFIG_IXGBE_VXLAN\n-\tswitch (adapter->hw.mac.type) {\n-\tcase ixgbe_mac_X550:\n-\tcase ixgbe_mac_X550EM_x:\n-\t\tnetdev->hw_enc_features |= NETIF_F_RXCSUM;\n-\t\tbreak;\n-\tdefault:\n-\t\tbreak;\n-\t}\n-#endif /* CONFIG_IXGBE_VXLAN */\n-\n #ifdef CONFIG_IXGBE_DCB\n \tnetdev->dcbnl_ops = &dcbnl_ops;\n #endif\n",
    "prefixes": [
        "next",
        "2/3"
    ]
}