Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/724791/?format=api
{ "id": 724791, "url": "http://patchwork.ozlabs.org/api/patches/724791/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170206223852.31177-9-jacob.e.keller@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": "<20170206223852.31177-9-jacob.e.keller@intel.com>", "list_archive_url": null, "date": "2017-02-06T22:38:51", "name": "[PART2,8/9] i40e: add support for SCTPv4 FDir filters", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "ed83dbac493300a14d6b2adba29f318b4765e288", "submitter": { "id": 9784, "url": "http://patchwork.ozlabs.org/api/people/9784/?format=api", "name": "Jacob Keller", "email": "jacob.e.keller@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/20170206223852.31177-9-jacob.e.keller@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/724791/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/724791/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\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3vHMpl5jqWz9s1y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 7 Feb 2017 09:39:27 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 4B304309F8;\n\tMon, 6 Feb 2017 22:39:26 +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 cTrFIW78ePeP; Mon, 6 Feb 2017 22:39:21 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 7FC9F30A98;\n\tMon, 6 Feb 2017 22:39:03 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 44FBF1BFF07\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 6 Feb 2017 22:38:59 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 4349A815B4\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 6 Feb 2017 22:38:59 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id DooYQxGqUe-O for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 6 Feb 2017 22:38:57 +0000 (UTC)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id C14FE8885E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 6 Feb 2017 22:38:55 +0000 (UTC)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga102.fm.intel.com with ESMTP; 06 Feb 2017 14:38:54 -0800", "from jekeller-desk.amr.corp.intel.com (HELO\n\tjekeller-desk.jekeller.internal) ([10.166.35.174])\n\tby fmsmga005.fm.intel.com with ESMTP; 06 Feb 2017 14:38:54 -0800" ], "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.33,342,1477983600\"; d=\"scan'208\";a=\"61907704\"", "From": "Jacob Keller <jacob.e.keller@intel.com>", "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>", "Date": "Mon, 6 Feb 2017 14:38:51 -0800", "Message-Id": "<20170206223852.31177-9-jacob.e.keller@intel.com>", "X-Mailer": "git-send-email 2.12.0.rc0.151.g8a5726c42288", "In-Reply-To": "<20170206223852.31177-1-jacob.e.keller@intel.com>", "References": "<20170206223852.31177-1-jacob.e.keller@intel.com>", "Subject": "[Intel-wired-lan] [PART2 PATCH 8/9] i40e: add support for SCTPv4\n\tFDir filters", "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": "Enable FDir filters for SCTPv4 packets using the ethtool ntuple\ninterface to enable filters. The ethtool API does not allow masking on\nthe verification tag.\n\nTesting-hints:\n Ethtool commands to enable sctp4 filters should not produce errors,\n and should properly direct traffic to the desired queue.\n\n ethtool -N <device> flow-type sctp4 <input set> action 1\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\nChange-Id: I093e88a8143994c7e6f4b7b17a0bd5cf861d18e4\n---\n drivers/net/ethernet/intel/i40e/i40e.h | 1 +\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 10 ++++\n drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +\n drivers/net/ethernet/intel/i40e/i40e_txrx.c | 80 ++++++++++++++++++++++++++\n 4 files changed, 93 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex f218a5bb7a16..33d1730878b7 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -381,6 +381,7 @@ struct i40e_pf {\n \t */\n \tu16 fd_tcp4_filter_cnt;\n \tu16 fd_udp4_filter_cnt;\n+\tu16 fd_sctp4_filter_cnt;\n \tu16 fd_ip4_filter_cnt;\n \n \t/* Flexible filter table values that need to be programmed into\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex 2dce5f5a486e..d9b379ef203b 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -2469,6 +2469,9 @@ static int i40e_get_ethtool_fdir_entry(struct i40e_pf *pf,\n \tfsp->h_u.tcp_ip4_spec.ip4dst = rule->src_ip;\n \n \tswitch (rule->flow_type) {\n+\tcase SCTP_V4_FLOW:\n+\t\tindex = I40E_FILTER_PCTYPE_NONF_IPV4_SCTP;\n+\t\tbreak;\n \tcase TCP_V4_FLOW:\n \t\tindex = I40E_FILTER_PCTYPE_NONF_IPV4_TCP;\n \t\tbreak;\n@@ -3291,6 +3294,10 @@ static int i40e_check_fdir_input_set(struct i40e_vsi *vsi,\n \tint err;\n \n \tswitch (fsp->flow_type & ~FLOW_EXT) {\n+\tcase SCTP_V4_FLOW:\n+\t\tindex = I40E_FILTER_PCTYPE_NONF_IPV4_SCTP;\n+\t\tfdir_filter_count = &pf->fd_sctp4_filter_cnt;\n+\t\tbreak;\n \tcase TCP_V4_FLOW:\n \t\tindex = I40E_FILTER_PCTYPE_NONF_IPV4_TCP;\n \t\tfdir_filter_count = &pf->fd_tcp4_filter_cnt;\n@@ -3322,6 +3329,9 @@ static int i40e_check_fdir_input_set(struct i40e_vsi *vsi,\n \t * ip4dst fields.\n \t */\n \tswitch (fsp->flow_type & ~FLOW_EXT) {\n+\tcase SCTP_V4_FLOW:\n+\t\tnew_mask &= ~I40E_VERIFY_TAG_MASK;\n+\t\t/* Fall through */\n \tcase TCP_V4_FLOW:\n \tcase UDP_V4_FLOW:\n \t\ttcp_ip4_spec = &fsp->m_u.tcp_ip4_spec;\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex a2cd3979b81a..6223db6ac728 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -3323,6 +3323,7 @@ static void i40e_fdir_filter_restore(struct i40e_vsi *vsi)\n \t/* Reset FDir counters as we're replaying all existing filters */\n \tpf->fd_tcp4_filter_cnt = 0;\n \tpf->fd_udp4_filter_cnt = 0;\n+\tpf->fd_sctp4_filter_cnt = 0;\n \tpf->fd_ip4_filter_cnt = 0;\n \n \thlist_for_each_entry_safe(filter, node,\n@@ -5912,6 +5913,7 @@ static void i40e_fdir_filter_exit(struct i40e_pf *pf)\n \tpf->fdir_pf_active_filters = 0;\n \tpf->fd_tcp4_filter_cnt = 0;\n \tpf->fd_udp4_filter_cnt = 0;\n+\tpf->fd_sctp4_filter_cnt = 0;\n \tpf->fd_ip4_filter_cnt = 0;\n \n \t/* Reprogram the default input set for TCP/IPv4 */\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex cb38a248c38f..1dabe5c57a88 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -347,6 +347,80 @@ static int i40e_add_del_fdir_tcpv4(struct i40e_vsi *vsi,\n \treturn 0;\n }\n \n+#define I40E_SCTPIP_DUMMY_PACKET_LEN 46\n+/**\n+ * i40e_add_del_fdir_sctpv4 - Add/Remove SCTPv4 Flow Director filters for\n+ * a specific flow spec\n+ * @vsi: pointer to the targeted VSI\n+ * @fd_data: the flow director data required for the FDir descriptor\n+ * @add: true adds a filter, false removes it\n+ *\n+ * Returns 0 if the filters were successfully added or removed\n+ **/\n+static int i40e_add_del_fdir_sctpv4(struct i40e_vsi *vsi,\n+\t\t\t\t struct i40e_fdir_filter *fd_data,\n+\t\t\t\t bool add)\n+{\n+\tstruct i40e_pf *pf = vsi->back;\n+\tstruct sctphdr *sctp;\n+\tstruct iphdr *ip;\n+\tu8 *raw_packet;\n+\tint ret;\n+\t/* Dummy packet */\n+\tstatic char packet[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x08, 0,\n+\t\t0x45, 0, 0, 0x20, 0, 0, 0x40, 0, 0x40, 0x84, 0, 0, 0, 0, 0, 0,\n+\t\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n+\n+\traw_packet = kzalloc(I40E_FDIR_MAX_RAW_PACKET_SIZE, GFP_KERNEL);\n+\tif (!raw_packet)\n+\t\treturn -ENOMEM;\n+\tmemcpy(raw_packet, packet, I40E_SCTPIP_DUMMY_PACKET_LEN);\n+\n+\tip = (struct iphdr *)(raw_packet + IP_HEADER_OFFSET);\n+\tsctp = (struct sctphdr *)(raw_packet + IP_HEADER_OFFSET\n+\t + sizeof(struct iphdr));\n+\n+\tip->daddr = fd_data->dst_ip;\n+\tsctp->dest = fd_data->dst_port;\n+\tip->saddr = fd_data->src_ip;\n+\tsctp->source = fd_data->src_port;\n+\n+\tif (fd_data->flex_filter) {\n+\t\tu8 *payload = raw_packet + I40E_SCTPIP_DUMMY_PACKET_LEN;\n+\t\t__be16 pattern = fd_data->flex_word;\n+\t\tu16 off = fd_data->flex_offset;\n+\n+\t\t*((__force __be16 *)(payload + off)) = pattern;\n+\t}\n+\n+\tfd_data->pctype = I40E_FILTER_PCTYPE_NONF_IPV4_SCTP;\n+\tret = i40e_program_fdir_filter(fd_data, raw_packet, pf, add);\n+\tif (ret) {\n+\t\tdev_info(&pf->pdev->dev,\n+\t\t\t \"PCTYPE:%d, Filter command send failed for fd_id:%d (ret = %d)\\n\",\n+\t\t\t fd_data->pctype, fd_data->fd_id, ret);\n+\t\t/* Free the packet buffer since it wasn't added to the ring */\n+\t\tkfree(raw_packet);\n+\t\treturn -EOPNOTSUPP;\n+\t} else if (I40E_DEBUG_FD & pf->hw.debug_mask) {\n+\t\tif (add)\n+\t\t\tdev_info(&pf->pdev->dev,\n+\t\t\t\t \"Filter OK for PCTYPE %d loc = %d\\n\",\n+\t\t\t\t fd_data->pctype, fd_data->fd_id);\n+\t\telse\n+\t\t\tdev_info(&pf->pdev->dev,\n+\t\t\t\t \"Filter deleted for PCTYPE %d loc = %d\\n\",\n+\t\t\t\t fd_data->pctype, fd_data->fd_id);\n+\t}\n+\n+\tif (add)\n+\t\tpf->fd_sctp4_filter_cnt++;\n+\telse\n+\t\tpf->fd_sctp4_filter_cnt--;\n+\n+\treturn 0;\n+}\n+\n #define I40E_IP_DUMMY_PACKET_LEN 34\n /**\n * i40e_add_del_fdir_ipv4 - Add/Remove IPv4 Flow Director filters for\n@@ -441,6 +515,9 @@ int i40e_add_del_fdir(struct i40e_vsi *vsi,\n \tcase UDP_V4_FLOW:\n \t\tret = i40e_add_del_fdir_udpv4(vsi, input, add);\n \t\tbreak;\n+\tcase SCTP_V4_FLOW:\n+\t\tret = i40e_add_del_fdir_sctpv4(vsi, input, add);\n+\t\tbreak;\n \tcase IP_USER_FLOW:\n \t\tswitch (input->ip4_proto) {\n \t\tcase IPPROTO_TCP:\n@@ -449,6 +526,9 @@ int i40e_add_del_fdir(struct i40e_vsi *vsi,\n \t\tcase IPPROTO_UDP:\n \t\t\tret = i40e_add_del_fdir_udpv4(vsi, input, add);\n \t\t\tbreak;\n+\t\tcase IPPROTO_SCTP:\n+\t\t\tret = i40e_add_del_fdir_sctpv4(vsi, input, add);\n+\t\t\tbreak;\n \t\tcase IPPROTO_IP:\n \t\t\tret = i40e_add_del_fdir_ipv4(vsi, input, add);\n \t\t\tbreak;\n", "prefixes": [ "PART2", "8/9" ] }