Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/972074/?format=api
{ "id": 972074, "url": "http://patchwork.ozlabs.org/api/patches/972074/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180920004308.13772-8-anirudh.venkataramanan@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": "<20180920004308.13772-8-anirudh.venkataramanan@intel.com>", "list_archive_url": null, "date": "2018-09-20T00:42:59", "name": "[v2,07/16] ice: Implement virtchnl commands for AVF support", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "52b8144c5e9358fbe72fb8d2cbe8b0bc1d3ff1d7", "submitter": { "id": 73601, "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api", "name": "Anirudh Venkataramanan", "email": "anirudh.venkataramanan@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/20180920004308.13772-8-anirudh.venkataramanan@intel.com/mbox/", "series": [ { "id": 66527, "url": "http://patchwork.ozlabs.org/api/series/66527/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=66527", "date": "2018-09-20T00:42:53", "name": "Add SR-IOV support, feature updates", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/66527/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/972074/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/972074/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@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" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.137; helo=fraxinus.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com" ], "Received": [ "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 42FydS22GXz9sBW\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 20 Sep 2018 10:43:24 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id B7A40876DA;\n\tThu, 20 Sep 2018 00:43:22 +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 ldaiPzO5h8Rr; Thu, 20 Sep 2018 00:43:20 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 742AF87599;\n\tThu, 20 Sep 2018 00:43:20 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id C7DA61C08AF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Sep 2018 00:43:12 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id BAC7E8755F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Sep 2018 00:43:12 +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 FAFxSAezfbfI for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Sep 2018 00:43:10 +0000 (UTC)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 5085187648\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 20 Sep 2018 00:43:10 +0000 (UTC)", "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Sep 2018 17:43:10 -0700", "from shasta.jf.intel.com ([10.166.241.11])\n\tby orsmga004.jf.intel.com with ESMTP; 19 Sep 2018 17:43:09 -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-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.53,396,1531810800\"; d=\"scan'208\";a=\"234371597\"", "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 19 Sep 2018 17:42:59 -0700", "Message-Id": "<20180920004308.13772-8-anirudh.venkataramanan@intel.com>", "X-Mailer": "git-send-email 2.14.3", "In-Reply-To": "<20180920004308.13772-1-anirudh.venkataramanan@intel.com>", "References": "<20180920004308.13772-1-anirudh.venkataramanan@intel.com>", "Subject": "[Intel-wired-lan] [PATCH v2 07/16] ice: Implement virtchnl commands\n\tfor AVF support", "X-BeenThere": "intel-wired-lan@osuosl.org", "X-Mailman-Version": "2.1.24", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@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@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "virtchnl is a protocol/interface specification that allows the Intel\n\"Adaptive Virtual Function (AVF)\" driver (iavf.ko) to work with more than\none physical function driver. The AVF driver sends \"virtchnl commands\"\n(control plane only) to the PF driver over mailbox queues and the PF driver\nexecutes these commands and returns a result to the VF, again over mailbox.\n\nThis patch adds AVF support for the ice PF driver by implementing the\nfollowing virtchnl commands:\n\nVIRTCHNL_OP_VERSION\nVIRTCHNL_OP_GET_VF_RESOURCES\nVIRTCHNL_OP_RESET_VF\nVIRTCHNL_OP_ADD_ETH_ADDR\nVIRTCHNL_OP_DEL_ETH_ADDR\nVIRTCHNL_OP_CONFIG_VSI_QUEUES\nVIRTCHNL_OP_ENABLE_QUEUES\nVIRTCHNL_OP_DISABLE_QUEUES\nVIRTCHNL_OP_ADD_ETH_ADDR\nVIRTCHNL_OP_DEL_ETH_ADDR\nVIRTCHNL_OP_CONFIG_VSI_QUEUES\nVIRTCHNL_OP_ENABLE_QUEUES\nVIRTCHNL_OP_DISABLE_QUEUES\nVIRTCHNL_OP_REQUEST_QUEUES\nVIRTCHNL_OP_CONFIG_IRQ_MAP\nVIRTCHNL_OP_CONFIG_RSS_KEY\nVIRTCHNL_OP_CONFIG_RSS_LUT\nVIRTCHNL_OP_GET_STATS\nVIRTCHNL_OP_ADD_VLAN\nVIRTCHNL_OP_DEL_VLAN\nVIRTCHNL_OP_ENABLE_VLAN_STRIPPING\nVIRTCHNL_OP_DISABLE_VLAN_STRIPPING\n\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice.h | 1 +\n drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 1 +\n drivers/net/ethernet/intel/ice/ice_main.c | 3 +\n drivers/net/ethernet/intel/ice/ice_switch.c | 1 +\n drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 1204 ++++++++++++++++++++++\n drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h | 11 +\n 6 files changed, 1221 insertions(+)", "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h\nindex 30eeb0d2d582..fbd6e72e02bb 100644\n--- a/drivers/net/ethernet/intel/ice/ice.h\n+++ b/drivers/net/ethernet/intel/ice/ice.h\n@@ -71,6 +71,7 @@ extern const char ice_drv_ver[];\n #define ICE_MAX_QS_PER_VF\t\t256\n #define ICE_MIN_QS_PER_VF\t\t1\n #define ICE_DFLT_QS_PER_VF\t\t4\n+#define ICE_MAX_BASE_QS_PER_VF\t\t16\n #define ICE_MAX_INTR_PER_VF\t\t65\n #define ICE_MIN_INTR_PER_VF\t\t(ICE_MIN_QS_PER_VF + 1)\n #define ICE_DFLT_INTR_PER_VF\t\t(ICE_DFLT_QS_PER_VF + 1)\ndiff --git a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\nindex 2c8f590316e9..6653555f55dd 100644\n--- a/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\n+++ b/drivers/net/ethernet/intel/ice/ice_adminq_cmd.h\n@@ -1446,6 +1446,7 @@ enum ice_adminq_opc {\n \tice_aqc_opc_nvm_read\t\t\t\t= 0x0701,\n \n \t/* PF/VF mailbox commands */\n+\tice_mbx_opc_send_msg_to_pf\t\t\t= 0x0801,\n \tice_mbx_opc_send_msg_to_vf\t\t\t= 0x0802,\n \n \t/* RSS commands */\ndiff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c\nindex bb66b614be90..61273cce46ed 100644\n--- a/drivers/net/ethernet/intel/ice/ice_main.c\n+++ b/drivers/net/ethernet/intel/ice/ice_main.c\n@@ -800,6 +800,9 @@ static int __ice_clean_ctrlq(struct ice_pf *pf, enum ice_ctl_q q_type)\n \t\t\t\tdev_err(&pf->pdev->dev,\n \t\t\t\t\t\"Could not handle link event\\n\");\n \t\t\tbreak;\n+\t\tcase ice_mbx_opc_send_msg_to_pf:\n+\t\t\tice_vc_process_vf_msg(pf, &event);\n+\t\t\tbreak;\n \t\tcase ice_aqc_opc_fw_logging:\n \t\t\tice_output_fw_log(hw, &event.desc, event.msg_buf);\n \t\t\tbreak;\ndiff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c\nindex 324232e5d99b..47815359e2ec 100644\n--- a/drivers/net/ethernet/intel/ice/ice_switch.c\n+++ b/drivers/net/ethernet/intel/ice/ice_switch.c\n@@ -187,6 +187,7 @@ ice_aq_add_vsi(struct ice_hw *hw, struct ice_vsi_ctx *vsi_ctx,\n \tif (!vsi_ctx->alloc_from_pool)\n \t\tcmd->vsi_num = cpu_to_le16(vsi_ctx->vsi_num |\n \t\t\t\t\t ICE_AQ_VSI_IS_VALID);\n+\tcmd->vf_id = vsi_ctx->vf_num;\n \n \tcmd->vsi_flags = cpu_to_le16(vsi_ctx->flags);\n \ndiff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\nindex a73bfc5f434c..ddc7720bf292 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n@@ -79,6 +79,35 @@ ice_set_pfe_link_forced(struct ice_vf *vf, struct virtchnl_pf_event *pfe,\n \tice_set_pfe_link(vf, pfe, link_speed, link_up);\n }\n \n+/**\n+ * ice_vc_notify_vf_link_state - Inform a VF of link status\n+ * @vf: pointer to the VF structure\n+ *\n+ * send a link status message to a single VF\n+ */\n+static void ice_vc_notify_vf_link_state(struct ice_vf *vf)\n+{\n+\tstruct virtchnl_pf_event pfe = { 0 };\n+\tstruct ice_link_status *ls;\n+\tstruct ice_pf *pf = vf->pf;\n+\tstruct ice_hw *hw;\n+\n+\thw = &pf->hw;\n+\tls = &hw->port_info->phy.link_info;\n+\n+\tpfe.event = VIRTCHNL_EVENT_LINK_CHANGE;\n+\tpfe.severity = PF_EVENT_SEVERITY_INFO;\n+\n+\tif (vf->link_forced)\n+\t\tice_set_pfe_link_forced(vf, &pfe, vf->link_up);\n+\telse\n+\t\tice_set_pfe_link(vf, &pfe, ls->link_speed, ls->link_info &\n+\t\t\t\t ICE_AQ_LINK_UP);\n+\n+\tice_aq_send_msg_to_vf(hw, vf->vf_id, VIRTCHNL_OP_EVENT, 0, (u8 *)&pfe,\n+\t\t\t sizeof(pfe), NULL);\n+}\n+\n /**\n * ice_get_vf_vector - get VF interrupt vector register offset\n * @vf_msix: number of msix vector per VF on a PF\n@@ -1107,6 +1136,866 @@ static void ice_vc_dis_vf(struct ice_vf *vf)\n \tice_reset_vf(vf, false);\n }\n \n+/**\n+ * ice_vc_send_msg_to_vf - Send message to VF\n+ * @vf: pointer to the VF info\n+ * @v_opcode: virtual channel opcode\n+ * @v_retval: virtual channel return value\n+ * @msg: pointer to the msg buffer\n+ * @msglen: msg length\n+ *\n+ * send msg to VF\n+ */\n+static int ice_vc_send_msg_to_vf(struct ice_vf *vf, u32 v_opcode,\n+\t\t\t\t enum ice_status v_retval, u8 *msg, u16 msglen)\n+{\n+\tenum ice_status aq_ret;\n+\tstruct ice_pf *pf;\n+\n+\t/* validate the request */\n+\tif (!vf || vf->vf_id >= vf->pf->num_alloc_vfs)\n+\t\treturn -EINVAL;\n+\n+\tpf = vf->pf;\n+\n+\t/* single place to detect unsuccessful return values */\n+\tif (v_retval) {\n+\t\tvf->num_inval_msgs++;\n+\t\tdev_info(&pf->pdev->dev, \"VF %d failed opcode %d, retval: %d\\n\",\n+\t\t\t vf->vf_id, v_opcode, v_retval);\n+\t\tif (vf->num_inval_msgs > ICE_DFLT_NUM_INVAL_MSGS_ALLOWED) {\n+\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\t\"Number of invalid messages exceeded for VF %d\\n\",\n+\t\t\t\tvf->vf_id);\n+\t\t\tdev_err(&pf->pdev->dev, \"Use PF Control I/F to enable the VF\\n\");\n+\t\t\tset_bit(ICE_VF_STATE_DIS, vf->vf_states);\n+\t\t\treturn -EIO;\n+\t\t}\n+\t} else {\n+\t\tvf->num_valid_msgs++;\n+\t\t/* reset the invalid counter, if a valid message is received. */\n+\t\tvf->num_inval_msgs = 0;\n+\t}\n+\n+\taq_ret = ice_aq_send_msg_to_vf(&pf->hw, vf->vf_id, v_opcode, v_retval,\n+\t\t\t\t msg, msglen, NULL);\n+\tif (aq_ret) {\n+\t\tdev_info(&pf->pdev->dev,\n+\t\t\t \"Unable to send the message to VF %d aq_err %d\\n\",\n+\t\t\t vf->vf_id, pf->hw.mailboxq.sq_last_status);\n+\t\treturn -EIO;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * ice_vc_get_ver_msg\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ *\n+ * called from the VF to request the API version used by the PF\n+ */\n+static int ice_vc_get_ver_msg(struct ice_vf *vf, u8 *msg)\n+{\n+\tstruct virtchnl_version_info info = {\n+\t\tVIRTCHNL_VERSION_MAJOR, VIRTCHNL_VERSION_MINOR\n+\t};\n+\n+\tvf->vf_ver = *(struct virtchnl_version_info *)msg;\n+\t/* VFs running the 1.0 API expect to get 1.0 back or they will cry. */\n+\tif (VF_IS_V10(&vf->vf_ver))\n+\t\tinfo.minor = VIRTCHNL_VERSION_MINOR_NO_VF_CAPS;\n+\n+\treturn ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_VERSION, ICE_SUCCESS,\n+\t\t\t\t (u8 *)&info,\n+\t\t\t\t sizeof(struct virtchnl_version_info));\n+}\n+\n+/**\n+ * ice_vc_get_vf_res_msg\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ *\n+ * called from the VF to request its resources\n+ */\n+static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg)\n+{\n+\tstruct virtchnl_vf_resource *vfres = NULL;\n+\tenum ice_status aq_ret = 0;\n+\tstruct ice_pf *pf = vf->pf;\n+\tstruct ice_vsi *vsi;\n+\tint len = 0;\n+\tint ret;\n+\n+\tif (!test_bit(ICE_VF_STATE_INIT, vf->vf_states)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto err;\n+\t}\n+\n+\tlen = sizeof(struct virtchnl_vf_resource);\n+\n+\tvfres = devm_kzalloc(&pf->pdev->dev, len, GFP_KERNEL);\n+\tif (!vfres) {\n+\t\taq_ret = ICE_ERR_NO_MEMORY;\n+\t\tlen = 0;\n+\t\tgoto err;\n+\t}\n+\tif (VF_IS_V11(&vf->vf_ver))\n+\t\tvf->driver_caps = *(u32 *)msg;\n+\telse\n+\t\tvf->driver_caps = VIRTCHNL_VF_OFFLOAD_L2 |\n+\t\t\t\t VIRTCHNL_VF_OFFLOAD_RSS_REG |\n+\t\t\t\t VIRTCHNL_VF_OFFLOAD_VLAN;\n+\n+\tvfres->vf_cap_flags = VIRTCHNL_VF_OFFLOAD_L2;\n+\tvsi = pf->vsi[vf->lan_vsi_idx];\n+\tif (!vsi->info.pvid)\n+\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_VLAN;\n+\n+\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RSS_PF) {\n+\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_RSS_PF;\n+\t} else {\n+\t\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RSS_AQ)\n+\t\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_RSS_AQ;\n+\t\telse\n+\t\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_RSS_REG;\n+\t}\n+\n+\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2)\n+\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2;\n+\n+\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_ENCAP)\n+\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_ENCAP;\n+\n+\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM)\n+\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM;\n+\n+\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_RX_POLLING)\n+\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_RX_POLLING;\n+\n+\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR)\n+\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_WB_ON_ITR;\n+\n+\tif (vf->driver_caps & VIRTCHNL_VF_OFFLOAD_REQ_QUEUES)\n+\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_OFFLOAD_REQ_QUEUES;\n+\n+\tif (vf->driver_caps & VIRTCHNL_VF_CAP_ADV_LINK_SPEED)\n+\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_CAP_ADV_LINK_SPEED;\n+\n+\tvfres->num_vsis = 1;\n+\t/* Tx and Rx queue are equal for VF */\n+\tvfres->num_queue_pairs = vsi->num_txq;\n+\tvfres->max_vectors = pf->num_vf_msix;\n+\tvfres->rss_key_size = ICE_VSIQF_HKEY_ARRAY_SIZE;\n+\tvfres->rss_lut_size = ICE_VSIQF_HLUT_ARRAY_SIZE;\n+\n+\tvfres->vsi_res[0].vsi_id = vf->lan_vsi_num;\n+\tvfres->vsi_res[0].vsi_type = VIRTCHNL_VSI_SRIOV;\n+\tvfres->vsi_res[0].num_queue_pairs = vsi->num_txq;\n+\tether_addr_copy(vfres->vsi_res[0].default_mac_addr,\n+\t\t\tvf->dflt_lan_addr.addr);\n+\n+\tset_bit(ICE_VF_STATE_ACTIVE, vf->vf_states);\n+\n+err:\n+\t/* send the response back to the VF */\n+\tret = ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_GET_VF_RESOURCES, aq_ret,\n+\t\t\t\t (u8 *)vfres, len);\n+\n+\tdevm_kfree(&pf->pdev->dev, vfres);\n+\treturn ret;\n+}\n+\n+/**\n+ * ice_vc_reset_vf_msg\n+ * @vf: pointer to the VF info\n+ *\n+ * called from the VF to reset itself,\n+ * unlike other virtchnl messages, PF driver\n+ * doesn't send the response back to the VF\n+ */\n+static void ice_vc_reset_vf_msg(struct ice_vf *vf)\n+{\n+\tif (test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states))\n+\t\tice_reset_vf(vf, false);\n+}\n+\n+/**\n+ * ice_find_vsi_from_id\n+ * @pf: the pf structure to search for the vsi\n+ * @id: id of the vsi it is searching for\n+ *\n+ * searches for the vsi with the given id\n+ */\n+static struct ice_vsi *ice_find_vsi_from_id(struct ice_pf *pf, u16 id)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i < pf->num_alloc_vsi; i++)\n+\t\tif (pf->vsi[i] && pf->vsi[i]->vsi_num == id)\n+\t\t\treturn pf->vsi[i];\n+\n+\treturn NULL;\n+}\n+\n+/**\n+ * ice_vc_isvalid_vsi_id\n+ * @vf: pointer to the VF info\n+ * @vsi_id: VF relative VSI id\n+ *\n+ * check for the valid VSI id\n+ */\n+static bool ice_vc_isvalid_vsi_id(struct ice_vf *vf, u16 vsi_id)\n+{\n+\tstruct ice_pf *pf = vf->pf;\n+\tstruct ice_vsi *vsi;\n+\n+\tvsi = ice_find_vsi_from_id(pf, vsi_id);\n+\n+\treturn (vsi && (vsi->vf_id == vf->vf_id));\n+}\n+\n+/**\n+ * ice_vc_isvalid_q_id\n+ * @vf: pointer to the VF info\n+ * @vsi_id: vsi id\n+ * @qid: vsi relative queue id\n+ *\n+ * check for the valid queue id\n+ */\n+static bool ice_vc_isvalid_q_id(struct ice_vf *vf, u16 vsi_id, u8 qid)\n+{\n+\tstruct ice_vsi *vsi = ice_find_vsi_from_id(vf->pf, vsi_id);\n+\t/* allocated Tx and Rx queues should be always equal for VF VSI */\n+\treturn (vsi && (qid < vsi->alloc_txq));\n+}\n+\n+/**\n+ * ice_vc_config_rss_key\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ *\n+ * Configure the VF's RSS key\n+ */\n+static int ice_vc_config_rss_key(struct ice_vf *vf, u8 *msg)\n+{\n+\tstruct virtchnl_rss_key *vrk =\n+\t\t(struct virtchnl_rss_key *)msg;\n+\tstruct ice_vsi *vsi = NULL;\n+\tenum ice_status aq_ret;\n+\tint ret;\n+\n+\tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (!ice_vc_isvalid_vsi_id(vf, vrk->vsi_id)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tvsi = ice_find_vsi_from_id(vf->pf, vrk->vsi_id);\n+\tif (!vsi) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (vrk->key_len != ICE_VSIQF_HKEY_ARRAY_SIZE) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (!test_bit(ICE_FLAG_RSS_ENA, vf->pf->flags)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tret = ice_set_rss(vsi, vrk->key, NULL, 0);\n+\taq_ret = ret ? ICE_ERR_PARAM : ICE_SUCCESS;\n+error_param:\n+\treturn ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_RSS_KEY, aq_ret,\n+\t\t\t\t NULL, 0);\n+}\n+\n+/**\n+ * ice_vc_config_rss_lut\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ *\n+ * Configure the VF's RSS LUT\n+ */\n+static int ice_vc_config_rss_lut(struct ice_vf *vf, u8 *msg)\n+{\n+\tstruct virtchnl_rss_lut *vrl = (struct virtchnl_rss_lut *)msg;\n+\tstruct ice_vsi *vsi = NULL;\n+\tenum ice_status aq_ret;\n+\tint ret;\n+\n+\tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (!ice_vc_isvalid_vsi_id(vf, vrl->vsi_id)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tvsi = ice_find_vsi_from_id(vf->pf, vrl->vsi_id);\n+\tif (!vsi) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (vrl->lut_entries != ICE_VSIQF_HLUT_ARRAY_SIZE) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (!test_bit(ICE_FLAG_RSS_ENA, vf->pf->flags)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tret = ice_set_rss(vsi, NULL, vrl->lut, ICE_VSIQF_HLUT_ARRAY_SIZE);\n+\taq_ret = ret ? ICE_ERR_PARAM : ICE_SUCCESS;\n+error_param:\n+\treturn ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_RSS_LUT, aq_ret,\n+\t\t\t\t NULL, 0);\n+}\n+\n+/**\n+ * ice_vc_get_stats_msg\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ *\n+ * called from the VF to get VSI stats\n+ */\n+static int ice_vc_get_stats_msg(struct ice_vf *vf, u8 *msg)\n+{\n+\tstruct virtchnl_queue_select *vqs =\n+\t\t(struct virtchnl_queue_select *)msg;\n+\tenum ice_status aq_ret = 0;\n+\tstruct ice_eth_stats stats;\n+\tstruct ice_vsi *vsi;\n+\n+\tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (!ice_vc_isvalid_vsi_id(vf, vqs->vsi_id)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tvsi = ice_find_vsi_from_id(vf->pf, vqs->vsi_id);\n+\tif (!vsi) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tmemset(&stats, 0, sizeof(struct ice_eth_stats));\n+\tice_update_eth_stats(vsi);\n+\n+\tstats = vsi->eth_stats;\n+\n+error_param:\n+\t/* send the response to the VF */\n+\treturn ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_GET_STATS, aq_ret,\n+\t\t\t\t (u8 *)&stats, sizeof(stats));\n+}\n+\n+/**\n+ * ice_vc_ena_qs_msg\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ *\n+ * called from the VF to enable all or specific queue(s)\n+ */\n+static int ice_vc_ena_qs_msg(struct ice_vf *vf, u8 *msg)\n+{\n+\tstruct virtchnl_queue_select *vqs =\n+\t (struct virtchnl_queue_select *)msg;\n+\tenum ice_status aq_ret = 0;\n+\tstruct ice_vsi *vsi;\n+\n+\tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (!ice_vc_isvalid_vsi_id(vf, vqs->vsi_id)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (!vqs->rx_queues && !vqs->tx_queues) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tvsi = ice_find_vsi_from_id(vf->pf, vqs->vsi_id);\n+\tif (!vsi) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\t/* Enable only Rx rings, Tx rings were enabled by the FW when the\n+\t * Tx queue group list was configured and the context bits were\n+\t * programmed using ice_vsi_cfg_txqs\n+\t */\n+\tif (ice_vsi_start_rx_rings(vsi))\n+\t\taq_ret = ICE_ERR_PARAM;\n+\n+\t/* Set flag to indicate that queues are enabled */\n+\tif (!aq_ret)\n+\t\tset_bit(ICE_VF_STATE_ENA, vf->vf_states);\n+\n+error_param:\n+\t/* send the response to the VF */\n+\treturn ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ENABLE_QUEUES, aq_ret,\n+\t\t\t\t NULL, 0);\n+}\n+\n+/**\n+ * ice_vc_dis_qs_msg\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ *\n+ * called from the VF to disable all or specific\n+ * queue(s)\n+ */\n+static int ice_vc_dis_qs_msg(struct ice_vf *vf, u8 *msg)\n+{\n+\tstruct virtchnl_queue_select *vqs =\n+\t (struct virtchnl_queue_select *)msg;\n+\tenum ice_status aq_ret = 0;\n+\tstruct ice_vsi *vsi;\n+\n+\tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states) &&\n+\t !test_bit(ICE_VF_STATE_ENA, vf->vf_states)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (!ice_vc_isvalid_vsi_id(vf, vqs->vsi_id)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (!vqs->rx_queues && !vqs->tx_queues) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tvsi = ice_find_vsi_from_id(vf->pf, vqs->vsi_id);\n+\tif (!vsi) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (ice_vsi_stop_tx_rings(vsi, ICE_NO_RESET, vf->vf_id)) {\n+\t\tdev_err(&vsi->back->pdev->dev,\n+\t\t\t\"Failed to stop tx rings on VSI %d\\n\",\n+\t\t\tvsi->vsi_num);\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t}\n+\n+\tif (ice_vsi_stop_rx_rings(vsi)) {\n+\t\tdev_err(&vsi->back->pdev->dev,\n+\t\t\t\"Failed to stop rx rings on VSI %d\\n\",\n+\t\t\tvsi->vsi_num);\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t}\n+\n+\t/* Clear enabled queues flag */\n+\tif (!aq_ret)\n+\t\tclear_bit(ICE_VF_STATE_ENA, vf->vf_states);\n+\n+error_param:\n+\t/* send the response to the VF */\n+\treturn ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_DISABLE_QUEUES, aq_ret,\n+\t\t\t\t NULL, 0);\n+}\n+\n+/**\n+ * ice_vc_cfg_irq_map_msg\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ *\n+ * called from the VF to configure the irq to queue map\n+ */\n+static int ice_vc_cfg_irq_map_msg(struct ice_vf *vf, u8 *msg)\n+{\n+\tstruct virtchnl_irq_map_info *irqmap_info =\n+\t (struct virtchnl_irq_map_info *)msg;\n+\tu16 vsi_id, vsi_q_id, vector_id;\n+\tstruct virtchnl_vector_map *map;\n+\tstruct ice_vsi *vsi = NULL;\n+\tstruct ice_pf *pf = vf->pf;\n+\tenum ice_status aq_ret = 0;\n+\tunsigned long qmap;\n+\tint i;\n+\n+\tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tfor (i = 0; i < irqmap_info->num_vectors; i++) {\n+\t\tmap = &irqmap_info->vecmap[i];\n+\n+\t\tvector_id = map->vector_id;\n+\t\tvsi_id = map->vsi_id;\n+\t\t/* validate msg params */\n+\t\tif (!(vector_id < pf->hw.func_caps.common_cap\n+\t\t .num_msix_vectors) || !ice_vc_isvalid_vsi_id(vf, vsi_id)) {\n+\t\t\taq_ret = ICE_ERR_PARAM;\n+\t\t\tgoto error_param;\n+\t\t}\n+\n+\t\tvsi = ice_find_vsi_from_id(vf->pf, vsi_id);\n+\t\tif (!vsi) {\n+\t\t\taq_ret = ICE_ERR_PARAM;\n+\t\t\tgoto error_param;\n+\t\t}\n+\n+\t\t/* lookout for the invalid queue index */\n+\t\tqmap = map->rxq_map;\n+\t\tfor_each_set_bit(vsi_q_id, &qmap, ICE_MAX_BASE_QS_PER_VF) {\n+\t\t\tif (!ice_vc_isvalid_q_id(vf, vsi_id, vsi_q_id)) {\n+\t\t\t\taq_ret = ICE_ERR_PARAM;\n+\t\t\t\tgoto error_param;\n+\t\t\t}\n+\t\t\tvsi->q_vectors[i]->num_ring_rx++;\n+\t\t\tvsi->rx_rings[vsi_q_id]->itr_setting =\n+\t\t\t\tmap->rxitr_idx;\n+\t\t\tvsi->rx_rings[vsi_q_id]->q_vector = vsi->q_vectors[i];\n+\t\t}\n+\n+\t\tqmap = map->txq_map;\n+\t\tfor_each_set_bit(vsi_q_id, &qmap, ICE_MAX_BASE_QS_PER_VF) {\n+\t\t\tif (!ice_vc_isvalid_q_id(vf, vsi_id, vsi_q_id)) {\n+\t\t\t\taq_ret = ICE_ERR_PARAM;\n+\t\t\t\tgoto error_param;\n+\t\t\t}\n+\t\t\tvsi->q_vectors[i]->num_ring_tx++;\n+\t\t\tvsi->tx_rings[vsi_q_id]->itr_setting =\n+\t\t\t\tmap->txitr_idx;\n+\t\t\tvsi->tx_rings[vsi_q_id]->q_vector = vsi->q_vectors[i];\n+\t\t}\n+\t}\n+\n+\tif (vsi)\n+\t\tice_vsi_cfg_msix(vsi);\n+error_param:\n+\t/* send the response to the VF */\n+\treturn ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_IRQ_MAP, aq_ret,\n+\t\t\t\t NULL, 0);\n+}\n+\n+/**\n+ * ice_vc_cfg_qs_msg\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ *\n+ * called from the VF to configure the Rx/Tx queues\n+ */\n+static int ice_vc_cfg_qs_msg(struct ice_vf *vf, u8 *msg)\n+{\n+\tstruct virtchnl_vsi_queue_config_info *qci =\n+\t (struct virtchnl_vsi_queue_config_info *)msg;\n+\tstruct virtchnl_queue_pair_info *qpi;\n+\tenum ice_status aq_ret = 0;\n+\tstruct ice_vsi *vsi;\n+\tint i;\n+\n+\tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (!ice_vc_isvalid_vsi_id(vf, qci->vsi_id)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tvsi = ice_find_vsi_from_id(vf->pf, qci->vsi_id);\n+\tif (!vsi) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tfor (i = 0; i < qci->num_queue_pairs; i++) {\n+\t\tqpi = &qci->qpair[i];\n+\t\tif (qpi->txq.vsi_id != qci->vsi_id ||\n+\t\t qpi->rxq.vsi_id != qci->vsi_id ||\n+\t\t qpi->rxq.queue_id != qpi->txq.queue_id ||\n+\t\t !ice_vc_isvalid_q_id(vf, qci->vsi_id, qpi->txq.queue_id)) {\n+\t\t\taq_ret = ICE_ERR_PARAM;\n+\t\t\tgoto error_param;\n+\t\t}\n+\t\t/* copy Tx queue info from VF into vsi */\n+\t\tvsi->tx_rings[i]->dma = qpi->txq.dma_ring_addr;\n+\t\tvsi->tx_rings[i]->count = qpi->txq.ring_len;\n+\t\t/* copy Rx queue info from VF into vsi */\n+\t\tvsi->rx_rings[i]->dma = qpi->rxq.dma_ring_addr;\n+\t\tvsi->rx_rings[i]->count = qpi->rxq.ring_len;\n+\t\tif (qpi->rxq.databuffer_size > ((16 * 1024) - 128)) {\n+\t\t\taq_ret = ICE_ERR_PARAM;\n+\t\t\tgoto error_param;\n+\t\t}\n+\t\tvsi->rx_buf_len = qpi->rxq.databuffer_size;\n+\t\tif (qpi->rxq.max_pkt_size >= (16 * 1024) ||\n+\t\t qpi->rxq.max_pkt_size < 64) {\n+\t\t\taq_ret = ICE_ERR_PARAM;\n+\t\t\tgoto error_param;\n+\t\t}\n+\t\tvsi->max_frame = qpi->rxq.max_pkt_size;\n+\t}\n+\n+\t/* VF can request to configure less than allocated queues\n+\t * or default allocated queues. So update the vsi with new number\n+\t */\n+\tvsi->num_txq = qci->num_queue_pairs;\n+\tvsi->num_rxq = qci->num_queue_pairs;\n+\n+\tif (!ice_vsi_cfg_txqs(vsi) && !ice_vsi_cfg_rxqs(vsi))\n+\t\taq_ret = 0;\n+\telse\n+\t\taq_ret = ICE_ERR_PARAM;\n+\n+error_param:\n+\t/* send the response to the VF */\n+\treturn ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_VSI_QUEUES, aq_ret,\n+\t\t\t\t NULL, 0);\n+}\n+\n+/**\n+ * ice_is_vf_trusted\n+ * @vf: pointer to the VF info\n+ */\n+static bool ice_is_vf_trusted(struct ice_vf *vf)\n+{\n+\treturn test_bit(ICE_VIRTCHNL_VF_CAP_PRIVILEGE, &vf->vf_caps);\n+}\n+\n+/**\n+ * ice_can_vf_change_mac\n+ * @vf: pointer to the VF info\n+ *\n+ * Return true if the VF is allowed to change its MAC filters, false otherwise\n+ */\n+static bool ice_can_vf_change_mac(struct ice_vf *vf)\n+{\n+\t/* If the VF MAC address has been set administratively (via the\n+\t * ndo_set_vf_mac command), then deny permission to the VF to\n+\t * add/delete unicast MAC addresses, unless the VF is trusted\n+\t */\n+\tif (vf->pf_set_mac && !ice_is_vf_trusted(vf))\n+\t\treturn false;\n+\n+\treturn true;\n+}\n+\n+/**\n+ * ice_vc_handle_mac_addr_msg\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ * @set: true if mac filters are being set, false otherwise\n+ *\n+ * add guest mac address filter\n+ */\n+static int\n+ice_vc_handle_mac_addr_msg(struct ice_vf *vf, u8 *msg, bool set)\n+{\n+\tstruct virtchnl_ether_addr_list *al =\n+\t (struct virtchnl_ether_addr_list *)msg;\n+\tstruct ice_pf *pf = vf->pf;\n+\tenum virtchnl_ops vc_op;\n+\tenum ice_status ret;\n+\tLIST_HEAD(mac_list);\n+\tstruct ice_vsi *vsi;\n+\tint mac_count = 0;\n+\tint i;\n+\n+\tif (set)\n+\t\tvc_op = VIRTCHNL_OP_ADD_ETH_ADDR;\n+\telse\n+\t\tvc_op = VIRTCHNL_OP_DEL_ETH_ADDR;\n+\n+\tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states) ||\n+\t !ice_vc_isvalid_vsi_id(vf, al->vsi_id)) {\n+\t\tret = ICE_ERR_PARAM;\n+\t\tgoto handle_mac_exit;\n+\t}\n+\n+\tif (set && !ice_is_vf_trusted(vf) &&\n+\t (vf->num_mac + al->num_elements) > ICE_MAX_MACADDR_PER_VF) {\n+\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\"Can't add more MAC addresses, because VF is not trusted, switch the VF to trusted mode in order to add more functionalities\\n\");\n+\t\tret = ICE_ERR_PARAM;\n+\t\tgoto handle_mac_exit;\n+\t}\n+\n+\tvsi = pf->vsi[vf->lan_vsi_idx];\n+\n+\tfor (i = 0; i < al->num_elements; i++) {\n+\t\tu8 *maddr = al->list[i].addr;\n+\n+\t\tif (ether_addr_equal(maddr, vf->dflt_lan_addr.addr) ||\n+\t\t is_broadcast_ether_addr(maddr)) {\n+\t\t\tif (set) {\n+\t\t\t\t/* VF is trying to add filters that the PF\n+\t\t\t\t * already added. Just continue.\n+\t\t\t\t */\n+\t\t\t\tdev_info(&pf->pdev->dev,\n+\t\t\t\t\t \"mac %pM already set for VF %d\\n\",\n+\t\t\t\t\t maddr, vf->vf_id);\n+\t\t\t\tcontinue;\n+\t\t\t} else {\n+\t\t\t\t/* VF can't remove dflt_lan_addr/bcast mac */\n+\t\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\t\t\"can't remove mac %pM for VF %d\\n\",\n+\t\t\t\t\tmaddr, vf->vf_id);\n+\t\t\t\tret = ICE_ERR_PARAM;\n+\t\t\t\tgoto handle_mac_exit;\n+\t\t\t}\n+\t\t}\n+\n+\t\t/* check for the invalid cases and bail if necessary */\n+\t\tif (is_zero_ether_addr(maddr)) {\n+\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\t\"invalid mac %pM provided for VF %d\\n\",\n+\t\t\t\tmaddr, vf->vf_id);\n+\t\t\tret = ICE_ERR_PARAM;\n+\t\t\tgoto handle_mac_exit;\n+\t\t}\n+\n+\t\tif (is_unicast_ether_addr(maddr) &&\n+\t\t !ice_can_vf_change_mac(vf)) {\n+\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\t\"can't change unicast mac for untrusted VF %d\\n\",\n+\t\t\t\tvf->vf_id);\n+\t\t\tret = ICE_ERR_PARAM;\n+\t\t\tgoto handle_mac_exit;\n+\t\t}\n+\n+\t\t/* get here if maddr is multicast or if VF can change mac */\n+\t\tif (ice_add_mac_to_list(vsi, &mac_list, al->list[i].addr)) {\n+\t\t\tret = ICE_ERR_NO_MEMORY;\n+\t\t\tgoto handle_mac_exit;\n+\t\t}\n+\t\tmac_count++;\n+\t}\n+\n+\t/* program the updated filter list */\n+\tif (set)\n+\t\tret = ice_add_mac(&pf->hw, &mac_list);\n+\telse\n+\t\tret = ice_remove_mac(&pf->hw, &mac_list);\n+\n+\tif (ret) {\n+\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\"can't update mac filters for VF %d, error %d\\n\",\n+\t\t\tvf->vf_id, ret);\n+\t} else {\n+\t\tif (set)\n+\t\t\tvf->num_mac += mac_count;\n+\t\telse\n+\t\t\tvf->num_mac -= mac_count;\n+\t}\n+\n+handle_mac_exit:\n+\tice_free_fltr_list(&pf->pdev->dev, &mac_list);\n+\t/* send the response to the VF */\n+\treturn ice_vc_send_msg_to_vf(vf, vc_op, ret, NULL, 0);\n+}\n+\n+/**\n+ * ice_vc_add_mac_addr_msg\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ *\n+ * add guest mac address filter\n+ */\n+static int ice_vc_add_mac_addr_msg(struct ice_vf *vf, u8 *msg)\n+{\n+\treturn ice_vc_handle_mac_addr_msg(vf, msg, true);\n+}\n+\n+/**\n+ * ice_vc_del_mac_addr_msg\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ *\n+ * remove guest mac address filter\n+ */\n+static int ice_vc_del_mac_addr_msg(struct ice_vf *vf, u8 *msg)\n+{\n+\treturn ice_vc_handle_mac_addr_msg(vf, msg, false);\n+}\n+\n+/**\n+ * ice_vc_request_qs_msg\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ *\n+ * VFs get a default number of queues but can use this message to request a\n+ * different number. If the request is successful, PF will reset the VF and\n+ * return 0. If unsuccessful, PF will send message informing VF of number of\n+ * available queue pairs via virtchnl message response to vf.\n+ */\n+static int ice_vc_request_qs_msg(struct ice_vf *vf, u8 *msg)\n+{\n+\tstruct virtchnl_vf_res_request *vfres =\n+\t\t(struct virtchnl_vf_res_request *)msg;\n+\tint req_queues = vfres->num_queue_pairs;\n+\tenum ice_status aq_ret = 0;\n+\tstruct ice_pf *pf = vf->pf;\n+\tint tx_rx_queue_left;\n+\tint cur_queues;\n+\n+\tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tcur_queues = pf->num_vf_qps;\n+\ttx_rx_queue_left = min_t(int, pf->q_left_tx, pf->q_left_rx);\n+\tif (req_queues <= 0) {\n+\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\"VF %d tried to request %d queues. Ignoring.\\n\",\n+\t\t\tvf->vf_id, req_queues);\n+\t} else if (req_queues > ICE_MAX_QS_PER_VF) {\n+\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\"VF %d tried to request more than %d queues.\\n\",\n+\t\t\tvf->vf_id, ICE_MAX_QS_PER_VF);\n+\t\tvfres->num_queue_pairs = ICE_MAX_QS_PER_VF;\n+\t} else if (req_queues - cur_queues > tx_rx_queue_left) {\n+\t\tdev_warn(&pf->pdev->dev,\n+\t\t\t \"VF %d requested %d more queues, but only %d left.\\n\",\n+\t\t\t vf->vf_id, req_queues - cur_queues, tx_rx_queue_left);\n+\t\tvfres->num_queue_pairs = tx_rx_queue_left + cur_queues;\n+\t} else {\n+\t\t/* request is successful, then reset VF */\n+\t\tvf->num_req_qs = req_queues;\n+\t\tice_vc_dis_vf(vf);\n+\t\tdev_info(&pf->pdev->dev,\n+\t\t\t \"VF %d granted request of %d queues.\\n\",\n+\t\t\t vf->vf_id, req_queues);\n+\t\treturn 0;\n+\t}\n+\n+error_param:\n+\t/* send the response to the VF */\n+\treturn ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_REQUEST_QUEUES,\n+\t\t\t\t aq_ret, (u8 *)vfres, sizeof(*vfres));\n+}\n+\n /**\n * ice_set_vf_port_vlan\n * @netdev: network interface device structure\n@@ -1190,6 +2079,321 @@ ice_set_vf_port_vlan(struct net_device *netdev, int vf_id, u16 vlan_id, u8 qos,\n \treturn ret;\n }\n \n+/**\n+ * ice_vc_process_vlan_msg\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ * @add_v: Add VLAN if true, otherwise delete VLAN\n+ *\n+ * Process virtchnl op to Add or remove programmed guest VLAN id\n+ */\n+static int ice_vc_process_vlan_msg(struct ice_vf *vf, u8 *msg, bool add_v)\n+{\n+\tstruct virtchnl_vlan_filter_list *vfl =\n+\t (struct virtchnl_vlan_filter_list *)msg;\n+\tenum ice_status aq_ret = 0;\n+\tstruct ice_pf *pf = vf->pf;\n+\tstruct ice_vsi *vsi;\n+\tint i;\n+\n+\tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (!ice_vc_isvalid_vsi_id(vf, vfl->vsi_id)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (add_v && !ice_is_vf_trusted(vf) &&\n+\t vf->num_vlan >= ICE_MAX_VLAN_PER_VF) {\n+\t\tdev_info(&pf->pdev->dev,\n+\t\t\t \"VF is not trusted, switch the VF to trusted mode, in order to add more VLAN addresses\\n\");\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tfor (i = 0; i < vfl->num_elements; i++) {\n+\t\tif (vfl->vlan_id[i] > ICE_MAX_VLANID) {\n+\t\t\taq_ret = ICE_ERR_PARAM;\n+\t\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\t\"invalid VF VLAN id %d\\n\", vfl->vlan_id[i]);\n+\t\t\tgoto error_param;\n+\t\t}\n+\t}\n+\n+\tvsi = ice_find_vsi_from_id(vf->pf, vfl->vsi_id);\n+\tif (!vsi) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (vsi->info.pvid) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (ice_vsi_manage_vlan_stripping(vsi, add_v)) {\n+\t\tdev_err(&pf->pdev->dev,\n+\t\t\t\"%sable VLAN stripping failed for VSI %i\\n\",\n+\t\t\t add_v ? \"en\" : \"dis\", vsi->vsi_num);\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tif (add_v) {\n+\t\tfor (i = 0; i < vfl->num_elements; i++) {\n+\t\t\tu16 vid = vfl->vlan_id[i];\n+\n+\t\t\tif (!ice_vsi_add_vlan(vsi, vid)) {\n+\t\t\t\tvf->num_vlan++;\n+\t\t\t\tset_bit(vid, vsi->active_vlans);\n+\n+\t\t\t\t/* Enable VLAN pruning when VLAN 0 is added */\n+\t\t\t\tif (unlikely(!vid))\n+\t\t\t\t\tif (ice_cfg_vlan_pruning(vsi, true))\n+\t\t\t\t\t\taq_ret = ICE_ERR_PARAM;\n+\t\t\t} else {\n+\t\t\t\taq_ret = ICE_ERR_PARAM;\n+\t\t\t}\n+\t\t}\n+\t} else {\n+\t\tfor (i = 0; i < vfl->num_elements; i++) {\n+\t\t\tu16 vid = vfl->vlan_id[i];\n+\n+\t\t\t/* Make sure ice_vsi_kill_vlan is successful before\n+\t\t\t * updating VLAN information\n+\t\t\t */\n+\t\t\tif (!ice_vsi_kill_vlan(vsi, vid)) {\n+\t\t\t\tvf->num_vlan--;\n+\t\t\t\tclear_bit(vid, vsi->active_vlans);\n+\n+\t\t\t\t/* Disable VLAN pruning when removing VLAN 0 */\n+\t\t\t\tif (unlikely(!vid))\n+\t\t\t\t\tice_cfg_vlan_pruning(vsi, false);\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+error_param:\n+\t/* send the response to the VF */\n+\tif (add_v)\n+\t\treturn ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ADD_VLAN, aq_ret,\n+\t\t\t\t\t NULL, 0);\n+\telse\n+\t\treturn ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_DEL_VLAN, aq_ret,\n+\t\t\t\t\t NULL, 0);\n+}\n+\n+/**\n+ * ice_vc_add_vlan_msg\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ *\n+ * Add and program guest vlan id\n+ */\n+static int ice_vc_add_vlan_msg(struct ice_vf *vf, u8 *msg)\n+{\n+\treturn ice_vc_process_vlan_msg(vf, msg, true);\n+}\n+\n+/**\n+ * ice_vc_remove_vlan_msg\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ *\n+ * remove programmed guest vlan id\n+ */\n+static int ice_vc_remove_vlan_msg(struct ice_vf *vf, u8 *msg)\n+{\n+\treturn ice_vc_process_vlan_msg(vf, msg, false);\n+}\n+\n+/**\n+ * ice_vc_ena_vlan_stripping\n+ * @vf: pointer to the VF info\n+ *\n+ * Enable VLAN header stripping for a given VF\n+ */\n+static int ice_vc_ena_vlan_stripping(struct ice_vf *vf)\n+{\n+\tenum ice_status aq_ret = 0;\n+\tstruct ice_pf *pf = vf->pf;\n+\tstruct ice_vsi *vsi;\n+\n+\tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tvsi = pf->vsi[vf->lan_vsi_idx];\n+\tif (ice_vsi_manage_vlan_stripping(vsi, true))\n+\t\taq_ret = ICE_ERR_AQ_ERROR;\n+\n+error_param:\n+\treturn ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_ENABLE_VLAN_STRIPPING,\n+\t\t\t\t aq_ret, NULL, 0);\n+}\n+\n+/**\n+ * ice_vc_dis_vlan_stripping\n+ * @vf: pointer to the VF info\n+ *\n+ * Disable VLAN header stripping for a given VF\n+ */\n+static int ice_vc_dis_vlan_stripping(struct ice_vf *vf)\n+{\n+\tenum ice_status aq_ret = 0;\n+\tstruct ice_pf *pf = vf->pf;\n+\tstruct ice_vsi *vsi;\n+\n+\tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n+\t\taq_ret = ICE_ERR_PARAM;\n+\t\tgoto error_param;\n+\t}\n+\n+\tvsi = pf->vsi[vf->lan_vsi_idx];\n+\tif (ice_vsi_manage_vlan_stripping(vsi, false))\n+\t\taq_ret = ICE_ERR_AQ_ERROR;\n+\n+error_param:\n+\treturn ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_DISABLE_VLAN_STRIPPING,\n+\t\t\t\t aq_ret, NULL, 0);\n+}\n+\n+/**\n+ * ice_vc_process_vf_msg - Process request from VF\n+ * @pf: pointer to the PF structure\n+ * @event: pointer to the AQ event\n+ *\n+ * called from the common asq/arq handler to\n+ * process request from VF\n+ */\n+void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event)\n+{\n+\tu32 v_opcode = le32_to_cpu(event->desc.cookie_high);\n+\ts16 vf_id = le16_to_cpu(event->desc.retval);\n+\tu16 msglen = event->msg_len;\n+\tu8 *msg = event->msg_buf;\n+\tstruct ice_vf *vf = NULL;\n+\tint err = 0;\n+\n+\tif (vf_id >= pf->num_alloc_vfs) {\n+\t\terr = -EINVAL;\n+\t\tgoto error_handler;\n+\t}\n+\n+\tvf = &pf->vf[vf_id];\n+\n+\t/* Check if VF is disabled. */\n+\tif (test_bit(ICE_VF_STATE_DIS, vf->vf_states)) {\n+\t\terr = -EPERM;\n+\t\tgoto error_handler;\n+\t}\n+\n+\t/* Perform basic checks on the msg */\n+\terr = virtchnl_vc_validate_vf_msg(&vf->vf_ver, v_opcode, msg, msglen);\n+\tif (err) {\n+\t\tif (err == VIRTCHNL_ERR_PARAM)\n+\t\t\terr = -EPERM;\n+\t\telse\n+\t\t\terr = -EINVAL;\n+\t\tgoto error_handler;\n+\t}\n+\n+\t/* Perform additional checks specific to RSS and Virtchnl */\n+\tif (v_opcode == VIRTCHNL_OP_CONFIG_RSS_KEY) {\n+\t\tstruct virtchnl_rss_key *vrk = (struct virtchnl_rss_key *)msg;\n+\n+\t\tif (vrk->key_len != ICE_VSIQF_HKEY_ARRAY_SIZE)\n+\t\t\terr = -EINVAL;\n+\t} else if (v_opcode == VIRTCHNL_OP_CONFIG_RSS_LUT) {\n+\t\tstruct virtchnl_rss_lut *vrl = (struct virtchnl_rss_lut *)msg;\n+\n+\t\tif (vrl->lut_entries != ICE_VSIQF_HLUT_ARRAY_SIZE)\n+\t\t\terr = -EINVAL;\n+\t}\n+\n+error_handler:\n+\tif (err) {\n+\t\tice_vc_send_msg_to_vf(vf, v_opcode, ICE_ERR_PARAM, NULL, 0);\n+\t\tdev_err(&pf->pdev->dev, \"Invalid message from VF %d, opcode %d, len %d, error %d\\n\",\n+\t\t\tvf_id, v_opcode, msglen, err);\n+\t\treturn;\n+\t}\n+\n+\tswitch (v_opcode) {\n+\tcase VIRTCHNL_OP_VERSION:\n+\t\terr = ice_vc_get_ver_msg(vf, msg);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_GET_VF_RESOURCES:\n+\t\terr = ice_vc_get_vf_res_msg(vf, msg);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_RESET_VF:\n+\t\tice_vc_reset_vf_msg(vf);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_ADD_ETH_ADDR:\n+\t\terr = ice_vc_add_mac_addr_msg(vf, msg);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_DEL_ETH_ADDR:\n+\t\terr = ice_vc_del_mac_addr_msg(vf, msg);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_CONFIG_VSI_QUEUES:\n+\t\terr = ice_vc_cfg_qs_msg(vf, msg);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_ENABLE_QUEUES:\n+\t\terr = ice_vc_ena_qs_msg(vf, msg);\n+\t\tice_vc_notify_vf_link_state(vf);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_DISABLE_QUEUES:\n+\t\terr = ice_vc_dis_qs_msg(vf, msg);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_REQUEST_QUEUES:\n+\t\terr = ice_vc_request_qs_msg(vf, msg);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_CONFIG_IRQ_MAP:\n+\t\terr = ice_vc_cfg_irq_map_msg(vf, msg);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_CONFIG_RSS_KEY:\n+\t\terr = ice_vc_config_rss_key(vf, msg);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_CONFIG_RSS_LUT:\n+\t\terr = ice_vc_config_rss_lut(vf, msg);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_GET_STATS:\n+\t\terr = ice_vc_get_stats_msg(vf, msg);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_ADD_VLAN:\n+\t\terr = ice_vc_add_vlan_msg(vf, msg);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_DEL_VLAN:\n+\t\terr = ice_vc_remove_vlan_msg(vf, msg);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_ENABLE_VLAN_STRIPPING:\n+\t\terr = ice_vc_ena_vlan_stripping(vf);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_DISABLE_VLAN_STRIPPING:\n+\t\terr = ice_vc_dis_vlan_stripping(vf);\n+\t\tbreak;\n+\tcase VIRTCHNL_OP_UNKNOWN:\n+\tdefault:\n+\t\tdev_err(&pf->pdev->dev, \"Unsupported opcode %d from VF %d\\n\",\n+\t\t\tv_opcode, vf_id);\n+\t\terr = ice_vc_send_msg_to_vf(vf, v_opcode, ICE_ERR_NOT_IMPL,\n+\t\t\t\t\t NULL, 0);\n+\t\tbreak;\n+\t}\n+\tif (err) {\n+\t\t/* Helper function cares less about error return values here\n+\t\t * as it is busy with pending work.\n+\t\t */\n+\t\tdev_info(&pf->pdev->dev,\n+\t\t\t \"PF failed to honor VF %d, opcode %d\\n, error %d\\n\",\n+\t\t\t vf_id, v_opcode, err);\n+\t}\n+}\n+\n /**\n * ice_get_vf_cfg\n * @netdev: network interface device structure\ndiff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h\nindex 4f9e5bc5851a..72e85ab3e85d 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.h\n@@ -9,6 +9,11 @@\n #define ICE_VLAN_PRIORITY_S\t\t12\n #define ICE_VLAN_M\t\t\t0xFFF\n #define ICE_PRIORITY_M\t\t\t0x7000\n+#define ICE_MAX_VLAN_PER_VF\t\t8 /* restriction for non-trusted VF */\n+\n+/* Restrict number of MACs a non-trusted VF can program */\n+#define ICE_MAX_MACADDR_PER_VF\t\t12\n+#define ICE_DFLT_NUM_INVAL_MSGS_ALLOWED\t\t10\n \n /* Static VF transaction/status register def */\n #define VF_DEVICE_STATUS\t\t0xAA\n@@ -44,12 +49,15 @@ struct ice_vf {\n \tu32 driver_caps;\t\t/* reported by VF driver */\n \tint first_vector_idx;\t\t/* first vector index of this VF */\n \tstruct ice_sw *vf_sw_id;\t/* switch id the VF VSIs connect to */\n+\tstruct virtchnl_version_info vf_ver;\n \tstruct virtchnl_ether_addr dflt_lan_addr;\n \tu16 port_vlan_id;\n \tu8 pf_set_mac;\t\t\t/* VF MAC address set by VMM admin */\n \tu8 trusted;\n \tu16 lan_vsi_idx;\t\t/* index into PF struct */\n \tu16 lan_vsi_num;\t\t/* ID as used by firmware */\n+\tu64 num_inval_msgs;\t\t/* number of continuous invalid msgs */\n+\tu64 num_valid_msgs;\t\t/* number of valid msgs detected */\n \tunsigned long vf_caps;\t\t/* vf's adv. capabilities */\n \tDECLARE_BITMAP(vf_states, ICE_VF_STATES_NBITS);\t/* vf runtime states */\n \tunsigned int tx_rate;\t\t/* Tx bandwidth limit in Mbps */\n@@ -58,6 +66,7 @@ struct ice_vf {\n \tu8 spoofchk;\n \tu16 num_mac;\n \tu16 num_vlan;\n+\tu8 num_req_qs;\t\t/* num of queue pairs requested by VF */\n };\n \n #ifdef CONFIG_PCI_IOV\n@@ -68,6 +77,7 @@ int ice_get_vf_cfg(struct net_device *netdev, int vf_id,\n \t\t struct ifla_vf_info *ivi);\n \n void ice_free_vfs(struct ice_pf *pf);\n+void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event);\n void ice_vc_notify_reset(struct ice_pf *pf);\n bool ice_reset_all_vfs(struct ice_pf *pf, bool is_vflr);\n \n@@ -85,6 +95,7 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena);\n #else /* CONFIG_PCI_IOV */\n #define ice_process_vflr_event(pf) do {} while (0)\n #define ice_free_vfs(pf) do {} while (0)\n+#define ice_vc_process_vf_msg(pf, event) do {} while (0)\n #define ice_vc_notify_reset(pf) do {} while (0)\n static inline bool\n ice_reset_all_vfs(struct ice_pf __always_unused *pf,\n", "prefixes": [ "v2", "07/16" ] }