Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/609819/?format=api
{ "id": 609819, "url": "http://patchwork.ozlabs.org/api/patches/609819/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1460475052-6348-7-git-send-email-harshitha.ramamurthy@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": "<1460475052-6348-7-git-send-email-harshitha.ramamurthy@intel.com>", "list_archive_url": null, "date": "2016-04-12T15:30:45", "name": "[next,S33,06/13] i40e: Allow user to change input set mask for flow director", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "ed233cc16e7478bc6fc29d5f26dbb1d21cae9d4b", "submitter": { "id": 68642, "url": "http://patchwork.ozlabs.org/api/people/68642/?format=api", "name": "Harshitha Ramamurthy", "email": "harshitha.ramamurthy@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/1460475052-6348-7-git-send-email-harshitha.ramamurthy@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/609819/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/609819/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 silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ozlabs.org (Postfix) with ESMTP id 3ql3K13694z9sRZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Apr 2016 09:38:13 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id AD3D833236;\n\tTue, 12 Apr 2016 23:38:12 +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 V-R8cISIAPVS; Tue, 12 Apr 2016 23:38:07 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 1754631628;\n\tTue, 12 Apr 2016 23:38:07 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 6C0901C0E44\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Apr 2016 23:38:05 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 6009F332D5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Apr 2016 23:38:05 +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 YS6QN1pSeGrY for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Apr 2016 23:38:02 +0000 (UTC)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby silver.osuosl.org (Postfix) with ESMTP id D7C5130C7B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 12 Apr 2016 23:37:52 +0000 (UTC)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga101.fm.intel.com with ESMTP; 12 Apr 2016 16:36:30 -0700", "from harshitha-linux1.jf.intel.com ([10.166.45.81])\n\tby orsmga002.jf.intel.com with ESMTP; 12 Apr 2016 16:36:30 -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.24,476,1455004800\"; d=\"scan'208\";a=\"953677400\"", "From": "Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Tue, 12 Apr 2016 08:30:45 -0700", "Message-Id": "<1460475052-6348-7-git-send-email-harshitha.ramamurthy@intel.com>", "X-Mailer": "git-send-email 2.4.3", "In-Reply-To": "<1460475052-6348-1-git-send-email-harshitha.ramamurthy@intel.com>", "References": "<1460475052-6348-1-git-send-email-harshitha.ramamurthy@intel.com>", "Subject": "[Intel-wired-lan] [next PATCH S33 06/13] i40e: Allow user to change\n\tinput set mask for flow director", "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": "From: Kiran Patil <kiran.patil@intel.com>\n\nThis patch implements feature, which allows user to change\ninput set mask for flow director using side-band channel.\nThis patch adds definition of FLOW_TYPE_MASK into the header file.\nWith this patch, user can now specify less than 4 tuple(src ip, dsp ip,\nsrc port, dst port) for flow type tcp4/udp4.\n\nSigned-off-by: Kiran Patil <kiran.patil@intel.com>\nChange-Id: I90052508f8c172c0da5a4b78b949704b4a59ea78\n---\nTesting Hints :\ne.g. Using ethtoool, side-band filters are programmed such as:\n\tethtool -N p5p2 flow-type tcp4 src-ip 192.168.0.2 \\\n\t\t\t\tdst-ip 192.168.0.1 action 40\n\tethtool -N p5p2 flow-type tcp4 src-ip 192.168.0.2 action 41\n\tethtool -N p5p2 flow-type tcp4 dst-ip 192.168.0.1 action 42\n\tethtool -N p5p2 flow-type tcp4 dst-port 5001 action 43\n What to look for to see if side-band filter is matched or not:\n\tLook into port stats (using ethtool -S <ethx> | grep fdir) and\n specifically look for 'fdir_sb_match'. This counter should be\n incremented whenever filter is matched.\n\n drivers/net/ethernet/intel/i40e/i40e.h | 6 ++\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 116 +++++++++++++++++++++++++\n drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 +-\n 3 files changed, 123 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex e312adf..1f48e10 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -240,6 +240,12 @@ struct i40e_fdir_filter {\n \tu32 fd_id;\n };\n \n+#ifndef FLOW_TYPE_MASK\n+#define FLOW_TYPE_MASK 0xFF\n+#else\n+#error FLOW_TYPE_MASK already defined elsewhere\n+#endif\n+\n #define I40E_ETH_P_LLDP\t\t\t0x88cc\n \n #define I40E_DCB_PRIO_TYPE_STRICT\t0\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex 8e56c43..ada448b 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -2488,6 +2488,116 @@ static int i40e_del_fdir_entry(struct i40e_vsi *vsi,\n }\n \n /**\n+ * i40e_handle_input_set - Detect and handle input set changes\n+ * @vsi: pointer to the targeted VSI\n+ * @fsp: pointer to RX flow classification spec\n+ *\n+ * Reads register, detect change in input set based on existing register\n+ * value and what user has passed. Update input set mask register if needed.\n+ **/\n+static int i40e_handle_input_set(struct i40e_vsi *vsi,\n+\t\t\t\t struct ethtool_rx_flow_spec *fsp)\n+{\n+\tbool inset_mask_change = false;\n+\tstruct i40e_pf *pf;\n+\tu64 val;\n+\tu8 idx;\n+\n+\tif (unlikely(!vsi))\n+\t\treturn -EINVAL;\n+\n+\tpf = vsi->back;\n+\tswitch (fsp->flow_type & FLOW_TYPE_MASK) {\n+\tcase TCP_V4_FLOW:\n+\t\tidx = I40E_FILTER_PCTYPE_NONF_IPV4_TCP;\n+\t\tbreak;\n+\tcase UDP_V4_FLOW:\n+\t\tidx = I40E_FILTER_PCTYPE_NONF_IPV4_UDP;\n+\t\tbreak;\n+\tdefault:\n+\t\t/* for all other flow types */\n+\t\treturn 0;\n+\t}\n+\n+\tval = ((u64)i40e_read_rx_ctl(&pf->hw,\n+\t\t\t\t I40E_PRTQF_FD_INSET(idx, 1)) << 32) |\n+\t (u64)i40e_read_rx_ctl(&pf->hw,\n+\t\t\t\t I40E_PRTQF_FD_INSET(idx, 0));\n+\n+\t/* Default input set (TCP/UDP/SCTP) contains following\n+\t * fields: srcip + dest ip + src port + dest port\n+\t * For SCTP, there is one extra field, \"verification tag\"\n+\t */\n+\tif (val & I40E_L3_SRC_MASK) {\n+\t\tif (!fsp->h_u.tcp_ip4_spec.ip4src) {\n+\t\t\tval &= ~I40E_L3_SRC_MASK;\n+\t\t\tinset_mask_change = true;\n+\t\t}\n+\t} else {\n+\t\tif (fsp->h_u.tcp_ip4_spec.ip4src) {\n+\t\t\tval |= I40E_L3_SRC_MASK;\n+\t\t\tinset_mask_change = true;\n+\t\t}\n+\t}\n+\tif (val & I40E_L3_DST_MASK) {\n+\t\tif (!fsp->h_u.tcp_ip4_spec.ip4dst) {\n+\t\t\tval &= ~I40E_L3_DST_MASK;\n+\t\t\tinset_mask_change = true;\n+\t\t}\n+\t} else {\n+\t\tif (fsp->h_u.tcp_ip4_spec.ip4dst) {\n+\t\t\tval |= I40E_L3_DST_MASK;\n+\t\t\tinset_mask_change = true;\n+\t\t}\n+\t}\n+\tif (val & I40E_L4_SRC_MASK) {\n+\t\tif (!fsp->h_u.tcp_ip4_spec.psrc) {\n+\t\t\tval &= ~I40E_L4_SRC_MASK;\n+\t\t\tinset_mask_change = true;\n+\t\t}\n+\t} else {\n+\t\tif (fsp->h_u.tcp_ip4_spec.psrc) {\n+\t\t\tval |= I40E_L4_SRC_MASK;\n+\t\t\tinset_mask_change = true;\n+\t\t}\n+\t}\n+\tif (val & I40E_L4_DST_MASK) {\n+\t\tif (!fsp->h_u.tcp_ip4_spec.pdst) {\n+\t\t\tval &= ~I40E_L4_DST_MASK;\n+\t\t\tinset_mask_change = true;\n+\t\t}\n+\t} else {\n+\t\tif (fsp->h_u.tcp_ip4_spec.pdst) {\n+\t\t\tval |= I40E_L4_DST_MASK;\n+\t\t\tinset_mask_change = true;\n+\t\t}\n+\t}\n+\n+\tif (inset_mask_change) {\n+\t\tif (pf->flags & I40E_FLAG_MFP_ENABLED) {\n+\t\t\tnetif_err(pf, drv, vsi->netdev, \"Change of input set is not supported when MFP mode is enabled\\n\");\n+\t\t\treturn -EOPNOTSUPP;\n+\t\t}\n+\t\tif (pf->fdir_pf_active_filters) {\n+\t\t\tnetif_err(pf, drv, vsi->netdev, \"Change of input set is not supported when there are existing filters. Please delete them and re-try\\n\");\n+\t\t\treturn -EOPNOTSUPP;\n+\t\t}\n+\n+\t\tif (I40E_DEBUG_FD & pf->hw.debug_mask)\n+\t\t\tnetif_info(pf, drv, vsi->netdev, \"FD_INSET mask is changing to 0x%016llx\\n\",\n+\t\t\t\t val);\n+\t\t/* Update input mask register since input set mask changed */\n+\t\ti40e_write_rx_ctl(&pf->hw, I40E_PRTQF_FD_INSET(idx, 1),\n+\t\t\t\t (u32)(val >> 32));\n+\t\ti40e_write_rx_ctl(&pf->hw, I40E_PRTQF_FD_INSET(idx, 0),\n+\t\t\t\t (u32)val);\n+\t\tnetif_info(pf, drv, vsi->netdev, \"Input set mask change has been successful. Please note that this and all other interfaces on (related and derived from) this part are affected as well.\\n\");\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/**\n * i40e_add_fdir_ethtool - Add/Remove Flow Director filters\n * @vsi: pointer to the targeted VSI\n * @cmd: command to get or set RX flow classification rules\n@@ -2562,6 +2672,12 @@ static int i40e_add_fdir_ethtool(struct i40e_vsi *vsi,\n \tinput->dst_ip[0] = fsp->h_u.tcp_ip4_spec.ip4src;\n \tinput->src_ip[0] = fsp->h_u.tcp_ip4_spec.ip4dst;\n \n+\tret = i40e_handle_input_set(vsi, fsp);\n+\tif (ret) {\n+\t\tnetif_err(pf, drv, vsi->netdev, \"Unable to handle change in input set mask\\n\");\n+\t\tgoto free_input;\n+\t}\n+\n \tif (ntohl(fsp->m_ext.data[1])) {\n \t\tvf_id = ntohl(fsp->h_ext.data[1]);\n \t\tif (vf_id >= pf->num_alloc_vfs) {\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 7cad832..f4af60c 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -412,7 +412,7 @@ int i40e_add_del_fdir(struct i40e_vsi *vsi,\n \tstruct i40e_pf *pf = vsi->back;\n \tint ret;\n \n-\tswitch (input->flow_type & ~FLOW_EXT) {\n+\tswitch (input->flow_type & FLOW_TYPE_MASK) {\n \tcase TCP_V4_FLOW:\n \t\tret = i40e_add_del_fdir_tcpv4(vsi, input, add);\n \t\tbreak;\n", "prefixes": [ "next", "S33", "06/13" ] }