Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/562651/?format=api
{ "id": 562651, "url": "http://patchwork.ozlabs.org/api/patches/562651/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1451932392-15538-8-git-send-email-deepthi.kavalur@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": "<1451932392-15538-8-git-send-email-deepthi.kavalur@intel.com>", "list_archive_url": null, "date": "2016-01-04T18:33:07", "name": "[next,S26,07/12] i40e: APIs to Add/remove port mirroring rules", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "5680f41326d25737ebb60ddf04b40a6d1a31286d", "submitter": { "id": 67654, "url": "http://patchwork.ozlabs.org/api/people/67654/?format=api", "name": "Deepthi Kavalur", "email": "deepthi.kavalur@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/1451932392-15538-8-git-send-email-deepthi.kavalur@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/562651/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/562651/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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ozlabs.org (Postfix) with ESMTP id E58FE14016A\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 5 Jan 2016 05:33:27 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id D54AB88065;\n\tMon, 4 Jan 2016 18:33:26 +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 qPZV8JW7i7vs; Mon, 4 Jan 2016 18:33:22 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 29ACF886A9;\n\tMon, 4 Jan 2016 18:33:19 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 0957A1C0FD9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 4 Jan 2016 18:33:16 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 05DDD2324A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 4 Jan 2016 18:33:16 +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 BoFIFDGkTBQv for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 4 Jan 2016 18:33:13 +0000 (UTC)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby silver.osuosl.org (Postfix) with ESMTP id B6F2232235\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 4 Jan 2016 18:33:13 +0000 (UTC)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga101.fm.intel.com with ESMTP; 04 Jan 2016 10:33:13 -0800", "from kehelms-mobl.amr.corp.intel.com (HELO\n\tlocalhost.localdomain.localdomain) ([10.254.109.59])\n\tby orsmga003.jf.intel.com with ESMTP; 04 Jan 2016 10:33:13 -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.20,521,1444719600\"; d=\"scan'208\";a=\"720053591\"", "From": "Deepthi Kavalur <deepthi.kavalur@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Mon, 4 Jan 2016 10:33:07 -0800", "Message-Id": "<1451932392-15538-8-git-send-email-deepthi.kavalur@intel.com>", "X-Mailer": "git-send-email 2.1.0", "In-Reply-To": "<1451932392-15538-1-git-send-email-deepthi.kavalur@intel.com>", "References": "<1451932392-15538-1-git-send-email-deepthi.kavalur@intel.com>", "Subject": "[Intel-wired-lan] [next PATCH S26 07/12] i40e: APIs to Add/remove\n\tport mirroring rules", "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 necessary functions related to port\nmirroring features such as add/delete mirror rule, function\nto set promiscuous VLAN mode for VSI if mirror rule_type is\n\"VLAN Mirroring\".\n\nSigned-off-by: Kiran Patil <kiran.patil@intel.com>\nChange-ID: Iaf513fd5f188f99dcb977b48f99e73185dfddc40\n---\nTesting-Hints:\nThese APIs will be tested as part of testing 'Cisco CSX - Port Mirroring)'.\nHooks to test this APIs will be exposed via. debugfs.\n\n drivers/net/ethernet/intel/i40e/i40e_common.c | 162 +++++++++++++++++++++++\n drivers/net/ethernet/intel/i40e/i40e_prototype.h | 12 ++\n 2 files changed, 174 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c\nindex 3b03a31..fb7b48c 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_common.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c\n@@ -2041,6 +2041,37 @@ i40e_status i40e_aq_set_vsi_broadcast(struct i40e_hw *hw,\n }\n \n /**\n+ * i40e_aq_set_vsi_vlan_promisc - control the VLAN promiscuous setting\n+ * @hw: pointer to the hw struct\n+ * @seid: vsi number\n+ * @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN\n+ * @cmd_details: pointer to command details structure or NULL\n+ **/\n+i40e_status i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw,\n+\t\t\t\tu16 seid, bool enable,\n+\t\t\t\tstruct i40e_asq_cmd_details *cmd_details)\n+{\n+\tstruct i40e_aq_desc desc;\n+\tstruct i40e_aqc_set_vsi_promiscuous_modes *cmd =\n+\t\t(struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw;\n+\ti40e_status status;\n+\tu16 flags = 0;\n+\n+\ti40e_fill_default_direct_cmd_desc(&desc,\n+\t\t\t\t\ti40e_aqc_opc_set_vsi_promiscuous_modes);\n+\tif (enable)\n+\t\tflags |= I40E_AQC_SET_VSI_PROMISC_VLAN;\n+\n+\tcmd->promiscuous_flags = cpu_to_le16(flags);\n+\tcmd->valid_flags = cpu_to_le16(I40E_AQC_SET_VSI_PROMISC_VLAN);\n+\tcmd->seid = cpu_to_le16(seid);\n+\n+\tstatus = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);\n+\n+\treturn status;\n+}\n+\n+/**\n * i40e_get_vsi_params - get VSI configuration info\n * @hw: pointer to the hw struct\n * @vsi_ctx: pointer to a vsi context struct\n@@ -2478,6 +2509,137 @@ i40e_status i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 seid,\n }\n \n /**\n+ * i40e_mirrorrule_op - Internal helper function to add/delete mirror rule\n+ * @hw: pointer to the hw struct\n+ * @opcode: AQ opcode for add or delete mirror rule\n+ * @sw_seid: Switch SEID (to which rule refers)\n+ * @rule_type: Rule Type (ingress/egress/VLAN)\n+ * @id: Destination VSI SEID or Rule ID\n+ * @count: length of the list\n+ * @mr_list: list of mirrored VSI SEIDs or VLAN IDs\n+ * @cmd_details: pointer to command details structure or NULL\n+ * @rule_id: Rule ID returned from FW\n+ * @rule_used: Number of rules used in internal switch\n+ * @rule_free: Number of rules free in internal switch\n+ *\n+ * Add/Delete a mirror rule to a specific switch. Mirror rules are supported for\n+ * VEBs/VEPA elements only\n+ **/\n+static i40e_status i40e_mirrorrule_op(struct i40e_hw *hw,\n+\t\t\tu16 opcode, u16 sw_seid, u16 rule_type, u16 id,\n+\t\t\tu16 count, __le16 *mr_list,\n+\t\t\tstruct i40e_asq_cmd_details *cmd_details,\n+\t\t\tu16 *rule_id, u16 *rules_used, u16 *rules_free)\n+{\n+\tstruct i40e_aq_desc desc;\n+\tstruct i40e_aqc_add_delete_mirror_rule *cmd =\n+\t\t(struct i40e_aqc_add_delete_mirror_rule *)&desc.params.raw;\n+\tstruct i40e_aqc_add_delete_mirror_rule_completion *resp =\n+\t(struct i40e_aqc_add_delete_mirror_rule_completion *)&desc.params.raw;\n+\ti40e_status status;\n+\tu16 buf_size;\n+\n+\tbuf_size = count * sizeof(*mr_list);\n+\n+\t/* prep the rest of the request */\n+\ti40e_fill_default_direct_cmd_desc(&desc, opcode);\n+\tcmd->seid = cpu_to_le16(sw_seid);\n+\tcmd->rule_type = cpu_to_le16(rule_type &\n+\t\t\t\t I40E_AQC_MIRROR_RULE_TYPE_MASK);\n+\tcmd->num_entries = cpu_to_le16(count);\n+\t/* Dest VSI for add, rule_id for delete */\n+\tcmd->destination = cpu_to_le16(id);\n+\tif (mr_list) {\n+\t\tdesc.flags |= cpu_to_le16((u16)(I40E_AQ_FLAG_BUF |\n+\t\t\t\t\t\tI40E_AQ_FLAG_RD));\n+\t\tif (buf_size > I40E_AQ_LARGE_BUF)\n+\t\t\tdesc.flags |= cpu_to_le16((u16)I40E_AQ_FLAG_LB);\n+\t}\n+\n+\tstatus = i40e_asq_send_command(hw, &desc, mr_list, buf_size,\n+\t\t\t\t cmd_details);\n+\tif (!status ||\n+\t hw->aq.asq_last_status == I40E_AQ_RC_ENOSPC) {\n+\t\tif (rule_id)\n+\t\t\t*rule_id = le16_to_cpu(resp->rule_id);\n+\t\tif (rules_used)\n+\t\t\t*rules_used = le16_to_cpu(resp->mirror_rules_used);\n+\t\tif (rules_free)\n+\t\t\t*rules_free = le16_to_cpu(resp->mirror_rules_free);\n+\t}\n+\treturn status;\n+}\n+\n+/**\n+ * i40e_aq_add_mirrorrule - add a mirror rule\n+ * @hw: pointer to the hw struct\n+ * @sw_seid: Switch SEID (to which rule refers)\n+ * @rule_type: Rule Type (ingress/egress/VLAN)\n+ * @dest_vsi: SEID of VSI to which packets will be mirrored\n+ * @count: length of the list\n+ * @mr_list: list of mirrored VSI SEIDs or VLAN IDs\n+ * @cmd_details: pointer to command details structure or NULL\n+ * @rule_id: Rule ID returned from FW\n+ * @rule_used: Number of rules used in internal switch\n+ * @rule_free: Number of rules free in internal switch\n+ *\n+ * Add mirror rule. Mirror rules are supported for VEBs or VEPA elements only\n+ **/\n+i40e_status i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid,\n+\t\t\tu16 rule_type, u16 dest_vsi, u16 count, __le16 *mr_list,\n+\t\t\tstruct i40e_asq_cmd_details *cmd_details,\n+\t\t\tu16 *rule_id, u16 *rules_used, u16 *rules_free)\n+{\n+\tif (!(rule_type == I40E_AQC_MIRROR_RULE_TYPE_ALL_INGRESS ||\n+\t rule_type == I40E_AQC_MIRROR_RULE_TYPE_ALL_EGRESS)) {\n+\t\tif (count == 0 || !mr_list)\n+\t\t\treturn I40E_ERR_PARAM;\n+\t}\n+\n+\treturn i40e_mirrorrule_op(hw, i40e_aqc_opc_add_mirror_rule, sw_seid,\n+\t\t\t\t rule_type, dest_vsi, count, mr_list,\n+\t\t\t\t cmd_details, rule_id, rules_used, rules_free);\n+}\n+\n+/**\n+ * i40e_aq_delete_mirrorrule - delete a mirror rule\n+ * @hw: pointer to the hw struct\n+ * @sw_seid: Switch SEID (to which rule refers)\n+ * @rule_type: Rule Type (ingress/egress/VLAN)\n+ * @count: length of the list\n+ * @rule_id: Rule ID that is returned in the receive desc as part of\n+ *\t\tadd_mirrorrule.\n+ * @mr_list: list of mirrored VLAN IDs to be removed\n+ * @cmd_details: pointer to command details structure or NULL\n+ * @rule_used: Number of rules used in internal switch\n+ * @rule_free: Number of rules free in internal switch\n+ *\n+ * Delete a mirror rule. Mirror rules are supported for VEBs/VEPA elements only\n+ **/\n+i40e_status i40e_aq_delete_mirrorrule(struct i40e_hw *hw, u16 sw_seid,\n+\t\t\tu16 rule_type, u16 rule_id, u16 count, __le16 *mr_list,\n+\t\t\tstruct i40e_asq_cmd_details *cmd_details,\n+\t\t\tu16 *rules_used, u16 *rules_free)\n+{\n+\t/* Rule ID has to be valid except rule_type: INGRESS VLAN mirroring */\n+\tif (rule_type != I40E_AQC_MIRROR_RULE_TYPE_VLAN) {\n+\t\tif (!rule_id)\n+\t\t\treturn I40E_ERR_PARAM;\n+\t} else {\n+\t\t/* count and mr_list shall be valid for rule_type INGRESS VLAN\n+\t\t * mirroring. For other rule_type, count and rule_type should\n+\t\t * not matter.\n+\t\t */\n+\t\tif (count == 0 || !mr_list)\n+\t\t\treturn I40E_ERR_PARAM;\n+\t}\n+\n+\treturn i40e_mirrorrule_op(hw, i40e_aqc_opc_delete_mirror_rule, sw_seid,\n+\t\t\t\t rule_type, rule_id, count, mr_list,\n+\t\t\t\t cmd_details, NULL, rules_used, rules_free);\n+}\n+\n+/**\n * i40e_aq_send_msg_to_vf\n * @hw: pointer to the hardware structure\n * @vfid: VF id to send msg\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h\nindex bb9d583..45af29b 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h\n@@ -127,6 +127,9 @@ i40e_status i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,\n \t\tu16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);\n i40e_status i40e_aq_set_vsi_multicast_promiscuous(struct i40e_hw *hw,\n \t\tu16 vsi_id, bool set, struct i40e_asq_cmd_details *cmd_details);\n+i40e_status i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw,\n+\t\t\t\tu16 seid, bool enable,\n+\t\t\t\tstruct i40e_asq_cmd_details *cmd_details);\n i40e_status i40e_aq_get_vsi_params(struct i40e_hw *hw,\n \t\t\t\tstruct i40e_vsi_context *vsi_ctx,\n \t\t\t\tstruct i40e_asq_cmd_details *cmd_details);\n@@ -149,6 +152,15 @@ i40e_status i40e_aq_add_macvlan(struct i40e_hw *hw, u16 vsi_id,\n i40e_status i40e_aq_remove_macvlan(struct i40e_hw *hw, u16 vsi_id,\n \t\t\tstruct i40e_aqc_remove_macvlan_element_data *mv_list,\n \t\t\tu16 count, struct i40e_asq_cmd_details *cmd_details);\n+i40e_status i40e_aq_add_mirrorrule(struct i40e_hw *hw, u16 sw_seid,\n+\t\t\tu16 rule_type, u16 dest_vsi, u16 count, __le16 *mr_list,\n+\t\t\tstruct i40e_asq_cmd_details *cmd_details,\n+\t\t\tu16 *rule_id, u16 *rules_used, u16 *rules_free);\n+i40e_status i40e_aq_delete_mirrorrule(struct i40e_hw *hw, u16 sw_seid,\n+\t\t\tu16 rule_type, u16 rule_id, u16 count, __le16 *mr_list,\n+\t\t\tstruct i40e_asq_cmd_details *cmd_details,\n+\t\t\tu16 *rules_used, u16 *rules_free);\n+\n i40e_status i40e_aq_send_msg_to_vf(struct i40e_hw *hw, u16 vfid,\n \t\t\t\tu32 v_opcode, u32 v_retval, u8 *msg, u16 msglen,\n \t\t\t\tstruct i40e_asq_cmd_details *cmd_details);\n", "prefixes": [ "next", "S26", "07/12" ] }