get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 509143,
    "url": "http://patchwork.ozlabs.org/api/patches/509143/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1440096383-8915-4-git-send-email-anjali.singhai@intel.com/",
    "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": "<1440096383-8915-4-git-send-email-anjali.singhai@intel.com>",
    "list_archive_url": null,
    "date": "2015-08-20T18:46:23",
    "name": "[4/4] i40e: geneve tunnel offload support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "e017c781bd28be8f234bb897dcccda58735770e3",
    "submitter": {
        "id": 65487,
        "url": "http://patchwork.ozlabs.org/api/people/65487/?format=api",
        "name": "Singhai, Anjali",
        "email": "anjali.singhai@intel.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/1440096383-8915-4-git-send-email-anjali.singhai@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/509143/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/509143/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 3387B140291\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 21 Aug 2015 04:31:14 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 826758B219;\n\tThu, 20 Aug 2015 18:31:13 +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 nAn5hXEKx46l; Thu, 20 Aug 2015 18:31:12 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id B08E89189F;\n\tThu, 20 Aug 2015 18:31:12 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 4D5AF1C1652\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Aug 2015 18:31:10 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 4A07788F3E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Aug 2015 18:31:10 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id SMjsXN4DL4A1 for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Aug 2015 18:31:08 +0000 (UTC)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id EEA8D88DEE\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Aug 2015 18:31:07 +0000 (UTC)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga102.jf.intel.com with ESMTP; 20 Aug 2015 11:31:08 -0700",
            "from asinghai-cp.jf.intel.com ([134.134.3.57])\n\tby fmsmga001.fm.intel.com with ESMTP; 20 Aug 2015 11:31:08 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.15,715,1432623600\"; d=\"scan'208\";a=\"772608392\"",
        "From": "Anjali Singhai Jain <anjali.singhai@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Thu, 20 Aug 2015 11:46:23 -0700",
        "Message-Id": "<1440096383-8915-4-git-send-email-anjali.singhai@intel.com>",
        "X-Mailer": "git-send-email 1.8.1.4",
        "In-Reply-To": "<1440096383-8915-1-git-send-email-anjali.singhai@intel.com>",
        "References": "<1440096383-8915-1-git-send-email-anjali.singhai@intel.com>",
        "Subject": "[Intel-wired-lan] [PATCH 4/4] i40e: geneve tunnel offload support",
        "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>",
        "MIME-Version": "1.0",
        "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": "This patch adds driver hooks to implement ndo_ops to add/del udp\nport in the HW to identify GENEVE tunnels.\n\nSigned-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>\nSigned-off-by: Kiran Patil <kiran.patil@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e.h      |  1 +\n drivers/net/ethernet/intel/i40e/i40e_main.c | 89 ++++++++++++++++++++++++++++-\n drivers/net/ethernet/intel/i40e/i40e_txrx.c |  2 +-\n 3 files changed, 89 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex 71752c6..12c96da 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -330,6 +330,7 @@ struct i40e_pf {\n #define I40E_FLAG_VEB_STATS_ENABLED\t\tBIT_ULL(37)\n #define I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE\tBIT_ULL(38)\n #define I40E_FLAG_VEB_MODE_ENABLED\t\tBIT_ULL(40)\n+#define I40E_FLAG_GENEVE_OFFLOAD_CAPABLE\tBIT_ULL(41)\n \n \t/* tracks features that get auto disabled by errors */\n \tu64 auto_disable_flags;\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex bbc704b..7b41e1a 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -6665,7 +6665,7 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)\n  **/\n static void i40e_sync_udp_filters_subtask(struct i40e_pf *pf)\n {\n-#if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE)\n+#if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE) || defined(CONFIG_GENEVE_CORE)\n \tstruct i40e_hw *hw = &pf->hw;\n \ti40e_status ret;\n \t__be16 port;\n@@ -7843,7 +7843,8 @@ static int i40e_sw_init(struct i40e_pf *pf)\n \t\t\t     I40E_FLAG_HW_ATR_EVICT_CAPABLE |\n \t\t\t     I40E_FLAG_OUTER_UDP_CSUM_CAPABLE |\n \t\t\t     I40E_FLAG_WB_ON_ITR_CAPABLE |\n-\t\t\t     I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE;\n+\t\t\t     I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE |\n+\t\t\t     I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;\n \t}\n \tpf->eeprom_version = 0xDEAD;\n \tpf->lan_veb = I40E_NO_VEB;\n@@ -8036,6 +8037,88 @@ static void i40e_del_vxlan_port(struct net_device *netdev,\n \t}\n }\n \n+/**\n+ * i40e_add_geneve_port - Get notifications about GENEVE ports that come up\n+ * @netdev: This physical port's netdev\n+ * @sa_family: Socket Family that GENEVE is notifying us about\n+ * @port: New UDP port number that GENEVE started listening to\n+ **/\n+static void i40e_add_geneve_port(struct net_device *netdev,\n+\t\t\t\t sa_family_t sa_family, __be16 port)\n+{\n+\tstruct i40e_netdev_priv *np = netdev_priv(netdev);\n+\tstruct i40e_vsi *vsi = np->vsi;\n+\tstruct i40e_pf *pf = vsi->back;\n+\tu8 next_idx;\n+\tu8 idx;\n+\n+\tif (!(pf->flags & I40E_FLAG_GENEVE_OFFLOAD_CAPABLE))\n+\t\treturn;\n+\n+\tif (sa_family == AF_INET6)\n+\t\treturn;\n+\n+\tidx = i40e_get_udp_port_idx(pf, port);\n+\n+\t/* Check if port already exists */\n+\tif (idx < I40E_MAX_PF_UDP_OFFLOAD_PORTS) {\n+\t\tnetdev_info(netdev, \"udp port %d already offloaded\\n\",\n+\t\t\t    ntohs(port));\n+\t\treturn;\n+\t}\n+\n+\t/* Now check if there is space to add the new port */\n+\tnext_idx = i40e_get_udp_port_idx(pf, 0);\n+\n+\tif (next_idx == I40E_MAX_PF_UDP_OFFLOAD_PORTS) {\n+\t\tnetdev_info(netdev, \"maximum number of UDP ports reached, not adding port %d\\n\",\n+\t\t\t    ntohs(port));\n+\t\treturn;\n+\t}\n+\n+\t/* New port: add it and mark its index in the bitmap */\n+\tpf->udp_ports[next_idx].index = port;\n+\tpf->udp_ports[next_idx].type = I40E_AQC_TUNNEL_TYPE_NGE;\n+\tpf->pending_udp_bitmap |= BIT_ULL(next_idx);\n+\tpf->flags |= I40E_FLAG_UDP_FILTER_SYNC;\n+}\n+\n+/**\n+ * i40e_del_geneve_port - Get notifications about GENEVE ports that go away\n+ * @netdev: This physical port's netdev\n+ * @sa_family: Socket Family that GENEVE is notifying us about\n+ * @port: UDP port number that GENEVE stopped listening to\n+ **/\n+static void i40e_del_geneve_port(struct net_device *netdev,\n+\t\t\t\t sa_family_t sa_family, __be16 port)\n+{\n+\tstruct i40e_netdev_priv *np = netdev_priv(netdev);\n+\tstruct i40e_vsi *vsi = np->vsi;\n+\tstruct i40e_pf *pf = vsi->back;\n+\tu8 idx;\n+\n+\tif (!(pf->flags & I40E_FLAG_GENEVE_OFFLOAD_CAPABLE))\n+\t\treturn;\n+\n+\tif (sa_family == AF_INET6)\n+\t\treturn;\n+\n+\tidx = i40e_get_udp_port_idx(pf, port);\n+\n+\t/* Check if port already exists */\n+\tif (idx < I40E_MAX_PF_UDP_OFFLOAD_PORTS) {\n+\t\t/* if port exists, set it to 0 (mark for deletion)\n+\t\t * and make it pending\n+\t\t */\n+\t\tpf->udp_ports[idx].index = 0;\n+\t\tpf->pending_udp_bitmap |= BIT_ULL(idx);\n+\t\tpf->flags |= I40E_FLAG_UDP_FILTER_SYNC;\n+\t} else {\n+\t\tnetdev_warn(netdev, \"geneve port %d was not found, not deleting\\n\",\n+\t\t\t    ntohs(port));\n+\t}\n+}\n+\n static int i40e_get_phys_port_id(struct net_device *netdev,\n \t\t\t\t struct netdev_phys_item_id *ppid)\n {\n@@ -8260,6 +8343,8 @@ static const struct net_device_ops i40e_netdev_ops = {\n \t.ndo_set_vf_spoofchk\t= i40e_ndo_set_vf_spoofchk,\n \t.ndo_add_vxlan_port\t= i40e_add_vxlan_port,\n \t.ndo_del_vxlan_port\t= i40e_del_vxlan_port,\n+\t.ndo_add_geneve_port\t= i40e_add_geneve_port,\n+\t.ndo_del_geneve_port\t= i40e_del_geneve_port,\n \t.ndo_get_phys_port_id\t= i40e_get_phys_port_id,\n \t.ndo_fdb_add\t\t= i40e_ndo_fdb_add,\n \t.ndo_features_check\t= i40e_features_check,\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 424c5cc..b93c2dc 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -1425,7 +1425,7 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi,\n \tif (rx_error & BIT(I40E_RX_DESC_ERROR_PPRS_SHIFT))\n \t\treturn;\n \n-\t/* If VXLAN traffic has an outer UDPv4 checksum we need to check\n+\t/* If VXLAN/GENEVE traffic has an outer UDPv4 checksum we need to check\n \t * it in the driver, hardware does not do it for us.\n \t * Since L3L4P bit was set we assume a valid IHL value (>=5)\n \t * so the total length of IPv4 header is IHL*4 bytes\n",
    "prefixes": [
        "4/4"
    ]
}