Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/509142/?format=api
{ "id": 509142, "url": "http://patchwork.ozlabs.org/api/patches/509142/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1440096383-8915-3-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-3-git-send-email-anjali.singhai@intel.com>", "list_archive_url": null, "date": "2015-08-20T18:46:22", "name": "[3/4] i40e: Generalize the UDP tunnel offload flow", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "afd2f3e3eb56452044f95655016f02b6dc8b3c54", "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-3-git-send-email-anjali.singhai@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/509142/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/509142/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 B9460140291\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 21 Aug 2015 04:31:12 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 0CFA28ABBF;\n\tThu, 20 Aug 2015 18:31:12 +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 1lw9LqbnEHqb; Thu, 20 Aug 2015 18:31:10 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 88D2394920;\n\tThu, 20 Aug 2015 18:31:10 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 96E551C1652\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Aug 2015 18:31:09 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 92C0688DFA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Aug 2015 18:31:09 +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 O1kTYQyVVKNo for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Aug 2015 18:31:07 +0000 (UTC)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id D942488DC2\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:07 -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=\"772608389\"", "From": "Anjali Singhai Jain <anjali.singhai@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Thu, 20 Aug 2015 11:46:22 -0700", "Message-Id": "<1440096383-8915-3-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 3/4] i40e: Generalize the UDP tunnel\n\toffload flow", "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 generalizes the implementation for UDP based tunnel offloads\nso that VXLAN and any other UDP based tunnel protocols such\nas Geneve can utilize it.\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 | 11 +++++--\n drivers/net/ethernet/intel/i40e/i40e_main.c | 50 ++++++++++++++---------------\n drivers/net/ethernet/intel/i40e/i40e_txrx.c | 6 ++--\n drivers/net/ethernet/intel/i40e/i40e_txrx.h | 2 +-\n 4 files changed, 37 insertions(+), 32 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex 257f7d8..71752c6 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -237,6 +237,11 @@ struct i40e_tc_configuration {\n \tstruct i40e_tc_info tc_info[I40E_MAX_TRAFFIC_CLASS];\n };\n \n+struct i40e_udp_port_config {\n+\t__be16 index;\n+\tu8 type;\n+};\n+\n /* struct that defines the Ethernet device */\n struct i40e_pf {\n \tstruct pci_dev *pdev;\n@@ -274,8 +279,8 @@ struct i40e_pf {\n \tu32 fd_atr_cnt;\n \tu32 fd_tcp_rule;\n \n-\t__be16 vxlan_ports[I40E_MAX_PF_UDP_OFFLOAD_PORTS];\n-\tu16 pending_vxlan_bitmap;\n+\tstruct i40e_udp_port_config udp_ports[I40E_MAX_PF_UDP_OFFLOAD_PORTS];\n+\tu16 pending_udp_bitmap;\n \n \tenum i40e_interrupt_policy int_policy;\n \tu16 rx_itr_default;\n@@ -314,7 +319,7 @@ struct i40e_pf {\n #define I40E_FLAG_FD_ATR_ENABLED\t\tBIT_ULL(22)\n #define I40E_FLAG_PTP\t\t\t\tBIT_ULL(25)\n #define I40E_FLAG_MFP_ENABLED\t\t\tBIT_ULL(26)\n-#define I40E_FLAG_VXLAN_FILTER_SYNC\t\tBIT_ULL(27)\n+#define I40E_FLAG_UDP_FILTER_SYNC BIT_ULL(27)\n #define I40E_FLAG_PORT_ID_VALID\t\t\tBIT_ULL(28)\n #define I40E_FLAG_DCB_CAPABLE\t\t\tBIT_ULL(29)\n #define I40E_FLAG_RSS_AQ_CAPABLE\t\tBIT_ULL(31)\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 05081d1..bbc704b 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -6660,10 +6660,10 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf)\n }\n \n /**\n- * i40e_sync_vxlan_filters_subtask - Sync the VSI filter list with HW\n+ * i40e_sync_udp_filters_subtask - Sync the VSI filter list with HW\n * @pf: board private structure\n **/\n-static void i40e_sync_vxlan_filters_subtask(struct i40e_pf *pf)\n+static void i40e_sync_udp_filters_subtask(struct i40e_pf *pf)\n {\n #if defined(CONFIG_VXLAN) || defined(CONFIG_VXLAN_MODULE)\n \tstruct i40e_hw *hw = &pf->hw;\n@@ -6671,18 +6671,18 @@ static void i40e_sync_vxlan_filters_subtask(struct i40e_pf *pf)\n \t__be16 port;\n \tint i;\n \n-\tif (!(pf->flags & I40E_FLAG_VXLAN_FILTER_SYNC))\n+\tif (!(pf->flags & I40E_FLAG_UDP_FILTER_SYNC))\n \t\treturn;\n \n-\tpf->flags &= ~I40E_FLAG_VXLAN_FILTER_SYNC;\n+\tpf->flags &= ~I40E_FLAG_UDP_FILTER_SYNC;\n \n \tfor (i = 0; i < I40E_MAX_PF_UDP_OFFLOAD_PORTS; i++) {\n-\t\tif (pf->pending_vxlan_bitmap & BIT_ULL(i)) {\n-\t\t\tpf->pending_vxlan_bitmap &= ~BIT_ULL(i);\n-\t\t\tport = pf->vxlan_ports[i];\n+\t\tif (pf->pending_udp_bitmap & BIT_ULL(i)) {\n+\t\t\tpf->pending_udp_bitmap &= ~BIT_ULL(i);\n+\t\t\tport = pf->udp_ports[i].index;\n \t\t\tif (port)\n \t\t\t\tret = i40e_aq_add_udp_tunnel(hw, ntohs(port),\n-\t\t\t\t\t\t I40E_AQC_TUNNEL_TYPE_VXLAN,\n+\t\t\t\t\t\t pf->udp_ports[i].type,\n \t\t\t\t\t\t NULL, NULL);\n \t\t\telse\n \t\t\t\tret = i40e_aq_del_udp_tunnel(hw, i, NULL);\n@@ -6695,7 +6695,7 @@ static void i40e_sync_vxlan_filters_subtask(struct i40e_pf *pf)\n \t\t\t\t\t i40e_stat_str(&pf->hw, ret),\n \t\t\t\t\t i40e_aq_str(&pf->hw,\n \t\t\t\t\t\t pf->hw.aq.asq_last_status));\n-\t\t\t\tpf->vxlan_ports[i] = 0;\n+\t\t\t\tpf->udp_ports[i].index = 0;\n \t\t\t}\n \t\t}\n \t}\n@@ -6725,7 +6725,7 @@ static void i40e_service_task(struct work_struct *work)\n \ti40e_watchdog_subtask(pf);\n \ti40e_fdir_reinit_subtask(pf);\n \ti40e_sync_filters_subtask(pf);\n-\ti40e_sync_vxlan_filters_subtask(pf);\n+\ti40e_sync_udp_filters_subtask(pf);\n \ti40e_clean_adminq_subtask(pf);\n \n \ti40e_service_event_complete(pf);\n@@ -7943,18 +7943,18 @@ static int i40e_set_features(struct net_device *netdev,\n }\n \n /**\n- * i40e_get_vxlan_port_idx - Lookup a possibly offloaded for Rx UDP port\n+ * i40e_get_udp_port_idx - Lookup a possibly offloaded for Rx UDP port\n * @pf: board private structure\n * @port: The UDP port to look up\n *\n * Returns the index number or I40E_MAX_PF_UDP_OFFLOAD_PORTS if port not found\n **/\n-static u8 i40e_get_vxlan_port_idx(struct i40e_pf *pf, __be16 port)\n+static u8 i40e_get_udp_port_idx(struct i40e_pf *pf, __be16 port)\n {\n \tu8 i;\n \n \tfor (i = 0; i < I40E_MAX_PF_UDP_OFFLOAD_PORTS; i++) {\n-\t\tif (pf->vxlan_ports[i] == port)\n+\t\tif (pf->udp_ports[i].index == port)\n \t\t\treturn i;\n \t}\n \n@@ -7979,28 +7979,28 @@ static void i40e_add_vxlan_port(struct net_device *netdev,\n \tif (sa_family == AF_INET6)\n \t\treturn;\n \n-\tidx = i40e_get_vxlan_port_idx(pf, port);\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, \"vxlan port %d already offloaded\\n\",\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_vxlan_port_idx(pf, 0);\n-\n+\tnext_idx = i40e_get_udp_port_idx(pf, 0);\n \tif (next_idx == I40E_MAX_PF_UDP_OFFLOAD_PORTS) {\n-\t\tnetdev_info(netdev, \"maximum number of vxlan UDP ports reached, not adding port %d\\n\",\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->vxlan_ports[next_idx] = port;\n-\tpf->pending_vxlan_bitmap |= BIT_ULL(next_idx);\n-\tpf->flags |= I40E_FLAG_VXLAN_FILTER_SYNC;\n+\tpf->udp_ports[next_idx].index = port;\n+\tpf->udp_ports[next_idx].type = I40E_AQC_TUNNEL_TYPE_VXLAN;\n+\tpf->pending_udp_bitmap |= BIT_ULL(next_idx);\n+\tpf->flags |= I40E_FLAG_UDP_FILTER_SYNC;\n }\n \n /**\n@@ -8020,16 +8020,16 @@ static void i40e_del_vxlan_port(struct net_device *netdev,\n \tif (sa_family == AF_INET6)\n \t\treturn;\n \n-\tidx = i40e_get_vxlan_port_idx(pf, port);\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->vxlan_ports[idx] = 0;\n-\t\tpf->pending_vxlan_bitmap |= BIT_ULL(idx);\n-\t\tpf->flags |= I40E_FLAG_VXLAN_FILTER_SYNC;\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, \"vxlan port %d was not found, not deleting\\n\",\n \t\t\t ntohs(port));\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 0fbcd05..424c5cc 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -2007,7 +2007,7 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \tif (!(tx_flags & (I40E_TX_FLAGS_IPV4 | I40E_TX_FLAGS_IPV6)))\n \t\treturn;\n \n-\tif (!(tx_flags & I40E_TX_FLAGS_VXLAN_TUNNEL)) {\n+\tif (!(tx_flags & I40E_TX_FLAGS_UDP_TUNNEL)) {\n \t\t/* snag network header to get L4 type and address */\n \t\thdr.network = skb_network_header(skb);\n \n@@ -2092,7 +2092,7 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb,\n \t\t I40E_TXD_FLTR_QW1_FD_STATUS_SHIFT;\n \n \tdtype_cmd |= I40E_TXD_FLTR_QW1_CNT_ENA_MASK;\n-\tif (!(tx_flags & I40E_TX_FLAGS_VXLAN_TUNNEL))\n+\tif (!(tx_flags & I40E_TX_FLAGS_UDP_TUNNEL))\n \t\tdtype_cmd |=\n \t\t\t((u32)I40E_FD_ATR_STAT_IDX(pf->hw.pf_id) <<\n \t\t\tI40E_TXD_FLTR_QW1_CNTINDEX_SHIFT) &\n@@ -2323,7 +2323,7 @@ static void i40e_tx_enable_csum(struct sk_buff *skb, u32 *tx_flags,\n \t\t\toudph = udp_hdr(skb);\n \t\t\toiph = ip_hdr(skb);\n \t\t\tl4_tunnel = I40E_TXD_CTX_UDP_TUNNELING;\n-\t\t\t*tx_flags |= I40E_TX_FLAGS_VXLAN_TUNNEL;\n+\t\t\t*tx_flags |= I40E_TX_FLAGS_UDP_TUNNEL;\n \t\t\tbreak;\n \t\tdefault:\n \t\t\treturn;\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.h b/drivers/net/ethernet/intel/i40e/i40e_txrx.h\nindex a992cb8f..db2130f 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.h\n@@ -151,7 +151,7 @@ enum i40e_dyn_idx_t {\n #define I40E_TX_FLAGS_FSO\t\tBIT(7)\n #define I40E_TX_FLAGS_TSYN\t\tBIT(8)\n #define I40E_TX_FLAGS_FD_SB\t\tBIT(9)\n-#define I40E_TX_FLAGS_VXLAN_TUNNEL\tBIT(10)\n+#define I40E_TX_FLAGS_UDP_TUNNEL\tBIT(10)\n #define I40E_TX_FLAGS_VLAN_MASK\t\t0xffff0000\n #define I40E_TX_FLAGS_VLAN_PRIO_MASK\t0xe0000000\n #define I40E_TX_FLAGS_VLAN_PRIO_SHIFT\t29\n", "prefixes": [ "3/4" ] }