get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1192290/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1192290,
    "url": "http://patchwork.ozlabs.org/api/patches/1192290/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20191108142331.10221-11-anthony.l.nguyen@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": "<20191108142331.10221-11-anthony.l.nguyen@intel.com>",
    "list_archive_url": null,
    "date": "2019-11-08T14:23:27",
    "name": "[S33,11/15] ice: add helpers for virtchnl",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "a19e95e5dbd17a12845d2399b5a2f7c9ea94becb",
    "submitter": {
        "id": 68875,
        "url": "http://patchwork.ozlabs.org/api/people/68875/?format=api",
        "name": "Tony Nguyen",
        "email": "anthony.l.nguyen@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/20191108142331.10221-11-anthony.l.nguyen@intel.com/mbox/",
    "series": [
        {
            "id": 141799,
            "url": "http://patchwork.ozlabs.org/api/series/141799/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=141799",
            "date": "2019-11-08T14:23:27",
            "name": null,
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/141799/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1192290/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1192290/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; spf=pass (sender SPF authorized)\n\tsmtp.mailfrom=osuosl.org (client-ip=140.211.166.137;\n\thelo=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 478wZ73R7sz9sPT\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  9 Nov 2019 09:54:23 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id F3E9C864DA;\n\tFri,  8 Nov 2019 22:54:21 +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 T-GneaRJXkHB; Fri,  8 Nov 2019 22:54:20 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id E0C51864EA;\n\tFri,  8 Nov 2019 22:54:20 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 2A0FB1BF5DB\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 Nov 2019 22:54:19 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 2644B864EC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 Nov 2019 22:54:19 +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 65q-HvGDAlZj for <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 Nov 2019 22:54:18 +0000 (UTC)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 1C876864EA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 Nov 2019 22:54:18 +0000 (UTC)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t08 Nov 2019 14:54:17 -0800",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.244.174])\n\tby fmsmga008.fm.intel.com with ESMTP; 08 Nov 2019 14:54:17 -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-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.68,283,1569308400\"; d=\"scan'208\";a=\"201478836\"",
        "From": "Tony Nguyen <anthony.l.nguyen@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Fri,  8 Nov 2019 06:23:27 -0800",
        "Message-Id": "<20191108142331.10221-11-anthony.l.nguyen@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20191108142331.10221-1-anthony.l.nguyen@intel.com>",
        "References": "<20191108142331.10221-1-anthony.l.nguyen@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH S33 11/15] ice: add helpers for virtchnl",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "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>",
        "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": "From: Jesse Brandeburg <jesse.brandeburg@intel.com>\n\nThe virtchannel interface was repeating a lot of strings\nand wasting storage space in the kernel.  There was also\ninconsistent messages for the same thing.  Consolidate all\nthose messages and bit checks into a couple of helper functions.\n\nAlso, reduce stack space usage by simplifying getting the pointer\nto the pf using a helper.\n\nSigned-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>\nCo-developed-by: Brett Creeley <brett.creeley@intel.com>\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\nSigned-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>\n---\n .../net/ethernet/intel/ice/ice_virtchnl_pf.c  | 134 ++++++++----------\n 1 file changed, 63 insertions(+), 71 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\nindex 269204ca0b1d..aa99d7cb7d8e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n@@ -5,6 +5,35 @@\n #include \"ice_base.h\"\n #include \"ice_lib.h\"\n \n+/**\n+ * ice_validate_vf_id - helper to check if VF ID is valid\n+ * @pf: pointer to the PF structure\n+ * @vf_id: the ID of the VF to check\n+ */\n+static int ice_validate_vf_id(struct ice_pf *pf, int vf_id)\n+{\n+\tif (vf_id >= pf->num_alloc_vfs) {\n+\t\tdev_err(ice_pf_to_dev(pf), \"Invalid VF ID: %d\\n\", vf_id);\n+\t\treturn -EINVAL;\n+\t}\n+\treturn 0;\n+}\n+\n+/**\n+ * ice_check_vf_init - helper to check if VF init complete\n+ * @pf: pointer to the PF structure\n+ * @vf: the pointer to the VF to check\n+ */\n+static int ice_check_vf_init(struct ice_pf *pf, struct ice_vf *vf)\n+{\n+\tif (!test_bit(ICE_VF_STATE_INIT, vf->vf_states)) {\n+\t\tdev_err(ice_pf_to_dev(pf), \"VF ID: %d in reset. Try again.\\n\",\n+\t\t\tvf->vf_id);\n+\t\treturn -EBUSY;\n+\t}\n+\treturn 0;\n+}\n+\n /**\n  * ice_err_to_virt err - translate errors for VF return code\n  * @ice_err: error return code\n@@ -1302,9 +1331,13 @@ void ice_vc_notify_reset(struct ice_pf *pf)\n static void ice_vc_notify_vf_reset(struct ice_vf *vf)\n {\n \tstruct virtchnl_pf_event pfe;\n+\tstruct ice_pf *pf;\n \n-\t/* validate the request */\n-\tif (!vf || vf->vf_id >= vf->pf->num_alloc_vfs)\n+\tif (!vf)\n+\t\treturn;\n+\n+\tpf = vf->pf;\n+\tif (ice_validate_vf_id(pf, vf->vf_id))\n \t\treturn;\n \n \t/* Bail out if VF is in disabled state, neither initialized, nor active\n@@ -1317,7 +1350,7 @@ static void ice_vc_notify_vf_reset(struct ice_vf *vf)\n \n \tpfe.event = VIRTCHNL_EVENT_RESET_IMPENDING;\n \tpfe.severity = PF_EVENT_SEVERITY_CERTAIN_DOOM;\n-\tice_aq_send_msg_to_vf(&vf->pf->hw, vf->vf_id, VIRTCHNL_OP_EVENT,\n+\tice_aq_send_msg_to_vf(&pf->hw, vf->vf_id, VIRTCHNL_OP_EVENT,\n \t\t\t      VIRTCHNL_STATUS_SUCCESS, (u8 *)&pfe, sizeof(pfe),\n \t\t\t      NULL);\n }\n@@ -1544,11 +1577,12 @@ ice_vc_send_msg_to_vf(struct ice_vf *vf, u32 v_opcode,\n \tstruct device *dev;\n \tstruct ice_pf *pf;\n \n-\t/* validate the request */\n-\tif (!vf || vf->vf_id >= vf->pf->num_alloc_vfs)\n+\tif (!vf)\n \t\treturn -EINVAL;\n \n \tpf = vf->pf;\n+\tif (ice_validate_vf_id(pf, vf->vf_id))\n+\t\treturn -EINVAL;\n \n \tdev = ice_pf_to_dev(pf);\n \n@@ -1622,7 +1656,7 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg)\n \tint len = 0;\n \tint ret;\n \n-\tif (!test_bit(ICE_VF_STATE_INIT, vf->vf_states)) {\n+\tif (ice_check_vf_init(pf, vf)) {\n \t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n \t\tgoto err;\n \t}\n@@ -1801,7 +1835,7 @@ static int ice_vc_config_rss_key(struct ice_vf *vf, u8 *msg)\n \tstruct virtchnl_rss_key *vrk =\n \t\t(struct virtchnl_rss_key *)msg;\n \tstruct ice_pf *pf = vf->pf;\n-\tstruct ice_vsi *vsi = NULL;\n+\tstruct ice_vsi *vsi;\n \n \tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n \t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n@@ -1848,7 +1882,7 @@ static int ice_vc_config_rss_lut(struct ice_vf *vf, u8 *msg)\n \tstruct virtchnl_rss_lut *vrl = (struct virtchnl_rss_lut *)msg;\n \tenum virtchnl_status_code v_ret = VIRTCHNL_STATUS_SUCCESS;\n \tstruct ice_pf *pf = vf->pf;\n-\tstruct ice_vsi *vsi = NULL;\n+\tstruct ice_vsi *vsi;\n \n \tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n \t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n@@ -2597,19 +2631,15 @@ ice_set_vf_port_vlan(struct net_device *netdev, int vf_id, u16 vlan_id, u8 qos,\n \t\t     __be16 vlan_proto)\n {\n \tu16 vlanprio = vlan_id | (qos << ICE_VLAN_PRIORITY_S);\n-\tstruct ice_netdev_priv *np = netdev_priv(netdev);\n-\tstruct ice_pf *pf = np->vsi->back;\n+\tstruct ice_pf *pf = ice_netdev_to_pf(netdev);\n \tstruct ice_vsi *vsi;\n \tstruct device *dev;\n \tstruct ice_vf *vf;\n \tint ret = 0;\n \n \tdev = ice_pf_to_dev(pf);\n-\t/* validate the request */\n-\tif (vf_id >= pf->num_alloc_vfs) {\n-\t\tdev_err(dev, \"invalid VF id: %d\\n\", vf_id);\n+\tif (ice_validate_vf_id(pf, vf_id))\n \t\treturn -EINVAL;\n-\t}\n \n \tif (vlan_id > ICE_MAX_VLANID || qos > 7) {\n \t\tdev_err(dev, \"Invalid VF Parameters\\n\");\n@@ -2623,10 +2653,8 @@ ice_set_vf_port_vlan(struct net_device *netdev, int vf_id, u16 vlan_id, u8 qos,\n \n \tvf = &pf->vf[vf_id];\n \tvsi = pf->vsi[vf->lan_vsi_idx];\n-\tif (!test_bit(ICE_VF_STATE_INIT, vf->vf_states)) {\n-\t\tdev_err(dev, \"VF %d in reset. Try again.\\n\", vf_id);\n+\tif (ice_check_vf_init(pf, vf))\n \t\treturn -EBUSY;\n-\t}\n \n \tif (le16_to_cpu(vsi->info.pvid) == vlanprio) {\n \t\t/* duplicate request, so just return success */\n@@ -2984,7 +3012,7 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event)\n \tint err = 0;\n \n \tdev = ice_pf_to_dev(pf);\n-\tif (vf_id >= pf->num_alloc_vfs) {\n+\tif (ice_validate_vf_id(pf, vf_id)) {\n \t\terr = -EINVAL;\n \t\tgoto error_handler;\n \t}\n@@ -3102,24 +3130,18 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event)\n int\n ice_get_vf_cfg(struct net_device *netdev, int vf_id, struct ifla_vf_info *ivi)\n {\n-\tstruct ice_netdev_priv *np = netdev_priv(netdev);\n-\tstruct ice_vsi *vsi = np->vsi;\n-\tstruct ice_pf *pf = vsi->back;\n+\tstruct ice_pf *pf = ice_netdev_to_pf(netdev);\n+\tstruct ice_vsi *vsi;\n \tstruct ice_vf *vf;\n \n-\t/* validate the request */\n-\tif (vf_id >= pf->num_alloc_vfs) {\n-\t\tnetdev_err(netdev, \"invalid VF id: %d\\n\", vf_id);\n+\tif (ice_validate_vf_id(pf, vf_id))\n \t\treturn -EINVAL;\n-\t}\n \n \tvf = &pf->vf[vf_id];\n \tvsi = pf->vsi[vf->lan_vsi_idx];\n \n-\tif (!test_bit(ICE_VF_STATE_INIT, vf->vf_states)) {\n-\t\tnetdev_err(netdev, \"VF %d in reset. Try again.\\n\", vf_id);\n+\tif (ice_check_vf_init(pf, vf))\n \t\treturn -EBUSY;\n-\t}\n \n \tivi->vf = vf_id;\n \tether_addr_copy(ivi->mac, vf->dflt_lan_addr.addr);\n@@ -3152,9 +3174,8 @@ ice_get_vf_cfg(struct net_device *netdev, int vf_id, struct ifla_vf_info *ivi)\n  */\n int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena)\n {\n-\tstruct ice_netdev_priv *np = netdev_priv(netdev);\n-\tstruct ice_vsi *vsi = np->vsi;\n-\tstruct ice_pf *pf = vsi->back;\n+\tstruct ice_pf *pf = ice_netdev_to_pf(netdev);\n+\tstruct ice_vsi *vsi = pf->vsi[0];\n \tstruct ice_vsi_ctx *ctx;\n \tenum ice_status status;\n \tstruct device *dev;\n@@ -3162,18 +3183,12 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena)\n \tint ret = 0;\n \n \tdev = ice_pf_to_dev(pf);\n-\n-\t/* validate the request */\n-\tif (vf_id >= pf->num_alloc_vfs) {\n-\t\tnetdev_err(netdev, \"invalid VF id: %d\\n\", vf_id);\n+\tif (ice_validate_vf_id(pf, vf_id))\n \t\treturn -EINVAL;\n-\t}\n \n \tvf = &pf->vf[vf_id];\n-\tif (!test_bit(ICE_VF_STATE_INIT, vf->vf_states)) {\n-\t\tnetdev_err(netdev, \"VF %d in reset. Try again.\\n\", vf_id);\n+\tif (ice_check_vf_init(pf, vf))\n \t\treturn -EBUSY;\n-\t}\n \n \tif (ena == vf->spoofchk) {\n \t\tdev_dbg(dev, \"VF spoofchk already %s\\n\",\n@@ -3235,17 +3250,12 @@ static void ice_wait_on_vf_reset(struct ice_vf *vf)\n  */\n int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)\n {\n-\tstruct ice_netdev_priv *np = netdev_priv(netdev);\n-\tstruct ice_vsi *vsi = np->vsi;\n-\tstruct ice_pf *pf = vsi->back;\n+\tstruct ice_pf *pf = ice_netdev_to_pf(netdev);\n \tstruct ice_vf *vf;\n \tint ret = 0;\n \n-\t/* validate the request */\n-\tif (vf_id >= pf->num_alloc_vfs) {\n-\t\tnetdev_err(netdev, \"invalid VF id: %d\\n\", vf_id);\n+\tif (ice_validate_vf_id(pf, vf_id))\n \t\treturn -EINVAL;\n-\t}\n \n \tvf = &pf->vf[vf_id];\n \t/* Don't set MAC on disabled VF */\n@@ -3257,10 +3267,8 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)\n \t */\n \tice_wait_on_vf_reset(vf);\n \n-\tif (!test_bit(ICE_VF_STATE_INIT, vf->vf_states)) {\n-\t\tnetdev_err(netdev, \"VF %d in reset. Try again.\\n\", vf_id);\n+\tif (ice_check_vf_init(pf, vf))\n \t\treturn -EBUSY;\n-\t}\n \n \tif (is_zero_ether_addr(mac) || is_multicast_ether_addr(mac)) {\n \t\tnetdev_err(netdev, \"%pM not a valid unicast address\\n\", mac);\n@@ -3292,19 +3300,13 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)\n  */\n int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)\n {\n-\tstruct ice_netdev_priv *np = netdev_priv(netdev);\n-\tstruct ice_vsi *vsi = np->vsi;\n-\tstruct ice_pf *pf = vsi->back;\n+\tstruct ice_pf *pf = ice_netdev_to_pf(netdev);\n \tstruct device *dev;\n \tstruct ice_vf *vf;\n \n \tdev = ice_pf_to_dev(pf);\n-\n-\t/* validate the request */\n-\tif (vf_id >= pf->num_alloc_vfs) {\n-\t\tdev_err(dev, \"invalid VF id: %d\\n\", vf_id);\n+\tif (ice_validate_vf_id(pf, vf_id))\n \t\treturn -EINVAL;\n-\t}\n \n \tvf = &pf->vf[vf_id];\n \t/* Don't set Trusted Mode on disabled VF */\n@@ -3316,10 +3318,8 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)\n \t */\n \tice_wait_on_vf_reset(vf);\n \n-\tif (!test_bit(ICE_VF_STATE_INIT, vf->vf_states)) {\n-\t\tdev_err(dev, \"VF %d in reset. Try again.\\n\", vf_id);\n+\tif (ice_check_vf_init(pf, vf))\n \t\treturn -EBUSY;\n-\t}\n \n \t/* Check if already trusted */\n \tif (trusted == vf->trusted)\n@@ -3343,29 +3343,21 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)\n  */\n int ice_set_vf_link_state(struct net_device *netdev, int vf_id, int link_state)\n {\n-\tstruct ice_netdev_priv *np = netdev_priv(netdev);\n-\tstruct ice_pf *pf = np->vsi->back;\n+\tstruct ice_pf *pf = ice_netdev_to_pf(netdev);\n \tstruct virtchnl_pf_event pfe = { 0 };\n \tstruct ice_link_status *ls;\n-\tstruct device *dev;\n \tstruct ice_vf *vf;\n \tstruct ice_hw *hw;\n \n-\tdev = ice_pf_to_dev(pf);\n-\n-\tif (vf_id >= pf->num_alloc_vfs) {\n-\t\tdev_err(dev, \"Invalid VF Identifier %d\\n\", vf_id);\n+\tif (ice_validate_vf_id(pf, vf_id))\n \t\treturn -EINVAL;\n-\t}\n \n \tvf = &pf->vf[vf_id];\n \thw = &pf->hw;\n \tls = &pf->hw.port_info->phy.link_info;\n \n-\tif (!test_bit(ICE_VF_STATE_INIT, vf->vf_states)) {\n-\t\tdev_err(dev, \"vf %d in reset. Try again.\\n\", vf_id);\n+\tif (ice_check_vf_init(pf, vf))\n \t\treturn -EBUSY;\n-\t}\n \n \tpfe.event = VIRTCHNL_EVENT_LINK_CHANGE;\n \tpfe.severity = PF_EVENT_SEVERITY_INFO;\n",
    "prefixes": [
        "S33",
        "11/15"
    ]
}