get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1315897,
    "url": "http://patchwork.ozlabs.org/api/patches/1315897/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200624072939.9363-3-haiyue.wang@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": "<20200624072939.9363-3-haiyue.wang@intel.com>",
    "list_archive_url": null,
    "date": "2020-06-24T07:29:36",
    "name": "[v4,2/5] ice: add DCF cap negotiation and state machine",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "75eba32bdffc1e70744234a3b1237d03f5593020",
    "submitter": {
        "id": 79056,
        "url": "http://patchwork.ozlabs.org/api/people/79056/?format=api",
        "name": "Haiyue Wang",
        "email": "haiyue.wang@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/20200624072939.9363-3-haiyue.wang@intel.com/mbox/",
    "series": [
        {
            "id": 185450,
            "url": "http://patchwork.ozlabs.org/api/series/185450/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=185450",
            "date": "2020-06-24T07:29:34",
            "name": "ice: add Intel DCF mode support",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/185450/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1315897/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1315897/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 spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.136; helo=silver.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=<UNKNOWN>)",
            "ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 49sFQf1h1dz9sQt\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 24 Jun 2020 17:39:22 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 8924F204A8;\n\tWed, 24 Jun 2020 07:39:20 +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 IJauAjHFjLGf; Wed, 24 Jun 2020 07:39:16 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 4561B204DB;\n\tWed, 24 Jun 2020 07:39:16 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n by ash.osuosl.org (Postfix) with ESMTP id 6485B1BF861\n for <intel-wired-lan@lists.osuosl.org>; Wed, 24 Jun 2020 07:39:14 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by silver.osuosl.org (Postfix) with ESMTP id 589FE204DB\n for <intel-wired-lan@lists.osuosl.org>; Wed, 24 Jun 2020 07:39:14 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id 2quyx5wb7eRz for <intel-wired-lan@lists.osuosl.org>;\n Wed, 24 Jun 2020 07:39:12 +0000 (UTC)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by silver.osuosl.org (Postfix) with ESMTPS id 6EA2A204A8\n for <intel-wired-lan@lists.osuosl.org>; Wed, 24 Jun 2020 07:39:12 +0000 (UTC)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 24 Jun 2020 00:39:12 -0700",
            "from npg-dpdk-haiyue-1.sh.intel.com ([10.67.119.213])\n by fmsmga005.fm.intel.com with ESMTP; 24 Jun 2020 00:39:10 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "IronPort-SDR": [
            "\n FYbNCOBVP1k+hMEs+mcjq8LDP0J3ibPhVs4ebAnbYaxt7we0tG0tbW7Heq2kOFG2bJxyUdCXFF\n G1PjQjhrGlFg==",
            "\n c6Me/DNlylLwWrXgVS9+50cAMGPVO1NyqQvPoHKmZCxpOpFbe1ObrK/KXOMZKsM170QK+LyEfk\n 0dyJlBpQ7x5w=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9661\"; a=\"142584341\"",
            "E=Sophos;i=\"5.75,274,1589266800\"; d=\"scan'208\";a=\"142584341\"",
            "E=Sophos;i=\"5.75,274,1589266800\"; d=\"scan'208\";a=\"479170396\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Haiyue Wang <haiyue.wang@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 24 Jun 2020 15:29:36 +0800",
        "Message-Id": "<20200624072939.9363-3-haiyue.wang@intel.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20200624072939.9363-1-haiyue.wang@intel.com>",
        "References": "<20200619045711.16055-1-haiyue.wang@intel.com>\n <20200624072939.9363-1-haiyue.wang@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH v4 2/5] ice: add DCF cap negotiation and\n state machine",
        "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 <intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <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 <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Cc": "Xiaoyun Li <xiaoyun.li@intel.com>",
        "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": "The trust VF0 needs to negotiate the DCF capability firstly. Then the PF\ndriver may allow this VF to enter into DCF \"ON\" state if various checks\nare passed. In DCF \"ON\" state, the VF0 can send the AdminQ command to do\nadvanced switch rules creation for other VFs.\n\nIf one of the VFs resets, its hardware VSI number may be changed, so the\nVF0 will enter into the DCF \"BUSY\" state immediately to avoid adding the\nwrong rule. After the reset is done, the DCF state is changed to \"PAUSE\"\nmode, and a DCF_VSI_MAP_UPDATE event will be sent to the VF0. This event\nnotifies the VF0 to restart negotiating the DCF capability again.\n\nAlso the VF0 can exits the DCF service gracefully by issuing the virtual\nchannel command OP_DCF_DISABLE.\n\nThe system administrator can disable the DCF service by changing the\ntrust mode to untrusted.\n\nSigned-off-by: Xiaoyun Li <xiaoyun.li@intel.com>\nSigned-off-by: Haiyue Wang <haiyue.wang@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_dcf.c      | 77 +++++++++++++++++\n drivers/net/ethernet/intel/ice/ice_dcf.h      | 24 ++++++\n .../net/ethernet/intel/ice/ice_virtchnl_pf.c  | 85 ++++++++++++++++++-\n include/linux/avf/virtchnl.h                  |  9 ++\n 4 files changed, 194 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_dcf.c b/drivers/net/ethernet/intel/ice/ice_dcf.c\nindex cbe60a0cb2d2..e7d37735aaa5 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_dcf.c\n@@ -47,3 +47,80 @@ bool ice_dcf_aq_cmd_permitted(struct ice_aq_desc *desc)\n \n \treturn false;\n }\n+\n+/**\n+ * ice_check_dcf_allowed - check if DCF is allowed based on various checks\n+ * @vf: pointer to the VF to check\n+ */\n+bool ice_check_dcf_allowed(struct ice_vf *vf)\n+{\n+\tstruct ice_pf *pf = vf->pf;\n+\tstruct device *dev;\n+\n+\tdev = ice_pf_to_dev(pf);\n+\n+\tif (vf->vf_id != ICE_DCF_VFID) {\n+\t\tdev_err(dev, \"VF %d requested DCF capability, but only VF %d is allowed to request DCF capability\\n\",\n+\t\t\tvf->vf_id, ICE_DCF_VFID);\n+\t\treturn false;\n+\t}\n+\n+\tif (!vf->trusted) {\n+\t\tdev_err(dev, \"VF needs to be trusted to configure DCF capability\\n\");\n+\t\treturn false;\n+\t}\n+\n+\treturn true;\n+}\n+\n+/**\n+ * ice_vf_is_dcf - helper to check if the assigned VF is a DCF\n+ * @vf: the assigned VF to be checked\n+ */\n+bool ice_is_vf_dcf(struct ice_vf *vf)\n+{\n+\treturn vf == vf->pf->dcf.vf;\n+}\n+\n+/**\n+ * ice_dcf_get_state - Get DCF state of the associated PF\n+ * @pf: PF instance\n+ */\n+enum ice_dcf_state ice_dcf_get_state(struct ice_pf *pf)\n+{\n+\treturn pf->dcf.vf ? pf->dcf.state : ICE_DCF_STATE_OFF;\n+}\n+\n+/**\n+ * ice_dcf_state_str - convert DCF state code to a string\n+ * @state: the DCF state code to convert\n+ */\n+static const char *ice_dcf_state_str(enum ice_dcf_state state)\n+{\n+\tswitch (state) {\n+\tcase ICE_DCF_STATE_OFF:\n+\t\treturn \"ICE_DCF_STATE_OFF\";\n+\tcase ICE_DCF_STATE_ON:\n+\t\treturn \"ICE_DCF_STATE_ON\";\n+\tcase ICE_DCF_STATE_BUSY:\n+\t\treturn \"ICE_DCF_STATE_BUSY\";\n+\tcase ICE_DCF_STATE_PAUSE:\n+\t\treturn \"ICE_DCF_STATE_PAUSE\";\n+\t}\n+\n+\treturn \"ICE_DCF_STATE_UNKNOWN\";\n+}\n+\n+/**\n+ * ice_dcf_set_state - Set DCF state for the associated PF\n+ * @pf: PF instance\n+ * @state: new DCF state\n+ */\n+void ice_dcf_set_state(struct ice_pf *pf, enum ice_dcf_state state)\n+{\n+\tdev_dbg(ice_pf_to_dev(pf), \"DCF state is changing from %s to %s\\n\",\n+\t\tice_dcf_state_str(pf->dcf.state),\n+\t\tice_dcf_state_str(state));\n+\n+\tpf->dcf.state = state;\n+}\ndiff --git a/drivers/net/ethernet/intel/ice/ice_dcf.h b/drivers/net/ethernet/intel/ice/ice_dcf.h\nindex 9edb2d5d9d8f..1dabcca6f753 100644\n--- a/drivers/net/ethernet/intel/ice/ice_dcf.h\n+++ b/drivers/net/ethernet/intel/ice/ice_dcf.h\n@@ -4,7 +4,27 @@\n #ifndef _ICE_DCF_H_\n #define _ICE_DCF_H_\n \n+struct ice_vf;\n+struct ice_pf;\n+\n+#define ICE_DCF_VFID\t0\n+\n+/* DCF mode states */\n+enum ice_dcf_state {\n+\t/* DCF mode is fully off */\n+\tICE_DCF_STATE_OFF = 0,\n+\t/* Process is live, acquired capability to send DCF CMD */\n+\tICE_DCF_STATE_ON,\n+\t/* Kernel is busy, deny DCF CMD */\n+\tICE_DCF_STATE_BUSY,\n+\t/* Kernel is ready for Process to Re-establish, deny DCF CMD */\n+\tICE_DCF_STATE_PAUSE,\n+};\n+\n struct ice_dcf {\n+\tstruct ice_vf *vf;\n+\tenum ice_dcf_state state;\n+\n \t/* Handle the AdminQ command between the DCF (Device Config Function)\n \t * and the firmware.\n \t */\n@@ -16,5 +36,9 @@ struct ice_dcf {\n \n #ifdef CONFIG_PCI_IOV\n bool ice_dcf_aq_cmd_permitted(struct ice_aq_desc *desc);\n+bool ice_check_dcf_allowed(struct ice_vf *vf);\n+bool ice_is_vf_dcf(struct ice_vf *vf);\n+enum ice_dcf_state ice_dcf_get_state(struct ice_pf *pf);\n+void ice_dcf_set_state(struct ice_pf *pf, enum ice_dcf_state state);\n #endif /* CONFIG_PCI_IOV */\n #endif /* _ICE_DCF_H_ */\ndiff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\nindex ca0d4dd5953c..622b16efae0b 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n@@ -360,6 +360,11 @@ void ice_free_vfs(struct ice_pf *pf)\n \telse\n \t\tdev_warn(dev, \"VFs are assigned - not disabling SR-IOV\\n\");\n \n+\tif (ice_dcf_get_state(pf) != ICE_DCF_STATE_OFF) {\n+\t\tice_dcf_set_state(pf, ICE_DCF_STATE_OFF);\n+\t\tpf->dcf.vf = NULL;\n+\t}\n+\n \t/* Avoid wait time by stopping all VFs at the same time */\n \tice_for_each_vf(pf, i)\n \t\tif (test_bit(ICE_VF_STATE_QS_ENA, pf->vf[i].vf_states))\n@@ -1285,6 +1290,9 @@ bool ice_reset_vf(struct ice_vf *vf, bool is_vflr)\n \tset_bit(ICE_VF_STATE_DIS, vf->vf_states);\n \tice_trigger_vf_reset(vf, is_vflr, false);\n \n+\tif (ice_dcf_get_state(pf) == ICE_DCF_STATE_ON)\n+\t\tice_dcf_set_state(pf, ICE_DCF_STATE_BUSY);\n+\n \tvsi = pf->vsi[vf->lan_vsi_idx];\n \n \tif (test_bit(ICE_VF_STATE_QS_ENA, vf->vf_states))\n@@ -1340,6 +1348,21 @@ bool ice_reset_vf(struct ice_vf *vf, bool is_vflr)\n \tice_vf_rebuild_vsi_with_release(vf);\n \tice_vf_post_vsi_rebuild(vf);\n \n+\tif (ice_dcf_get_state(pf) == ICE_DCF_STATE_BUSY) {\n+\t\tstruct virtchnl_pf_event pfe = { 0 };\n+\n+\t\tice_dcf_set_state(pf, ICE_DCF_STATE_PAUSE);\n+\n+\t\tpfe.event = VIRTCHNL_EVENT_DCF_VSI_MAP_UPDATE;\n+\t\tpfe.event_data.vf_vsi_map.vf_id = vf->vf_id;\n+\t\tpfe.event_data.vf_vsi_map.vsi_id = vf->lan_vsi_num;\n+\n+\t\tice_aq_send_msg_to_vf(&pf->hw, ICE_DCF_VFID,\n+\t\t\t\t      VIRTCHNL_OP_EVENT,\n+\t\t\t\t      VIRTCHNL_STATUS_SUCCESS,\n+\t\t\t\t      (u8 *)&pfe, sizeof(pfe), NULL);\n+\t}\n+\n \treturn true;\n }\n \n@@ -1977,6 +2000,24 @@ static int ice_vc_get_vf_res_msg(struct ice_vf *vf, u8 *msg)\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+\t/* Negotiate DCF capability. */\n+\tif (vf->driver_caps & VIRTCHNL_VF_CAP_DCF) {\n+\t\tif (!ice_check_dcf_allowed(vf)) {\n+\t\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n+\t\t\tgoto err;\n+\t\t}\n+\t\tvfres->vf_cap_flags |= VIRTCHNL_VF_CAP_DCF;\n+\t\tpf->dcf.vf = vf;\n+\t\tice_dcf_set_state(pf, ICE_DCF_STATE_ON);\n+\t\tdev_info(ice_pf_to_dev(pf), \"Grant request for DCF functionality to VF%d\\n\",\n+\t\t\t ICE_DCF_VFID);\n+\t} else if (ice_is_vf_dcf(vf) &&\n+\t\t   ice_dcf_get_state(pf) != ICE_DCF_STATE_OFF) {\n+\t\tice_dcf_set_state(pf, ICE_DCF_STATE_OFF);\n+\t\tpf->dcf.vf = NULL;\n+\t\tice_reset_vf(vf, false);\n+\t}\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@@ -3726,6 +3767,9 @@ static int ice_vc_dcf_cmd_desc_msg(struct ice_vf *vf, u8 *msg, u16 len)\n \tstruct ice_aq_desc *aq_desc = (struct ice_aq_desc *)msg;\n \tstruct ice_pf *pf = vf->pf;\n \n+\tif (!ice_is_vf_dcf(vf) || ice_dcf_get_state(pf) != ICE_DCF_STATE_ON)\n+\t\tgoto err;\n+\n \tif (len != sizeof(*aq_desc) || !ice_dcf_aq_cmd_permitted(aq_desc)) {\n \t\t/* In case to avoid the VIRTCHNL_OP_DCF_CMD_DESC message with\n \t\t * the ICE_AQ_FLAG_BUF set followed by another bad message\n@@ -3763,7 +3807,8 @@ static int ice_vc_dcf_cmd_buff_msg(struct ice_vf *vf, u8 *msg, u16 len)\n {\n \tstruct ice_pf *pf = vf->pf;\n \n-\tif (!len || !pf->dcf.aq_desc_received ||\n+\tif (!ice_is_vf_dcf(vf) || ice_dcf_get_state(pf) != ICE_DCF_STATE_ON ||\n+\t    !len || !pf->dcf.aq_desc_received ||\n \t    time_is_before_jiffies(pf->dcf.aq_desc_expires))\n \t\tgoto err;\n \n@@ -3775,6 +3820,34 @@ static int ice_vc_dcf_cmd_buff_msg(struct ice_vf *vf, u8 *msg, u16 len)\n \t\t\t\t     VIRTCHNL_STATUS_ERR_PARAM, NULL, 0);\n }\n \n+/**\n+ * ice_vc_dis_dcf_cap - disable DCF capability for the VF\n+ * @vf: pointer to the VF\n+ */\n+static int ice_vc_dis_dcf_cap(struct ice_vf *vf)\n+{\n+\tenum virtchnl_status_code v_ret = VIRTCHNL_STATUS_SUCCESS;\n+\n+\tif (!test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) {\n+\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n+\t\tgoto err;\n+\t}\n+\n+\tif (!ice_is_vf_dcf(vf)) {\n+\t\tv_ret = VIRTCHNL_STATUS_ERR_PARAM;\n+\t\tgoto err;\n+\t}\n+\n+\tif (vf->driver_caps & VIRTCHNL_VF_CAP_DCF) {\n+\t\tvf->driver_caps &= ~VIRTCHNL_VF_CAP_DCF;\n+\t\tice_dcf_set_state(vf->pf, ICE_DCF_STATE_OFF);\n+\t\tvf->pf->dcf.vf = NULL;\n+\t}\n+err:\n+\treturn ice_vc_send_msg_to_vf(vf, VIRTCHNL_OP_DCF_DISABLE,\n+\t\t\t\t     v_ret, NULL, 0);\n+}\n+\n /**\n  * ice_vc_process_vf_msg - Process request from VF\n  * @pf: pointer to the PF structure\n@@ -3891,6 +3964,9 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event)\n \tcase VIRTCHNL_OP_DCF_CMD_BUFF:\n \t\terr = ice_vc_dcf_cmd_buff_msg(vf, msg, msglen);\n \t\tbreak;\n+\tcase VIRTCHNL_OP_DCF_DISABLE:\n+\t\terr = ice_vc_dis_dcf_cap(vf);\n+\t\tbreak;\n \tcase VIRTCHNL_OP_UNKNOWN:\n \tdefault:\n \t\tdev_err(dev, \"Unsupported opcode %d from VF %d\\n\", v_opcode,\n@@ -4067,6 +4143,13 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)\n \tif (trusted == vf->trusted)\n \t\treturn 0;\n \n+\tif (ice_is_vf_dcf(vf) && !trusted &&\n+\t    ice_dcf_get_state(pf) != ICE_DCF_STATE_OFF) {\n+\t\tice_dcf_set_state(pf, ICE_DCF_STATE_OFF);\n+\t\tpf->dcf.vf = NULL;\n+\t\tvf->driver_caps &= ~VIRTCHNL_VF_CAP_DCF;\n+\t}\n+\n \tvf->trusted = trusted;\n \tice_vc_reset_vf(vf);\n \tdev_info(ice_pf_to_dev(pf), \"VF %u is now %strusted\\n\",\ndiff --git a/include/linux/avf/virtchnl.h b/include/linux/avf/virtchnl.h\nindex fa9a3a047dd4..e219cafabccd 100644\n--- a/include/linux/avf/virtchnl.h\n+++ b/include/linux/avf/virtchnl.h\n@@ -139,6 +139,7 @@ enum virtchnl_ops {\n \t/* opcode 34, 35, 36, 37 and 38 are reserved */\n \tVIRTCHNL_OP_DCF_CMD_DESC = 39,\n \tVIRTCHNL_OP_DCF_CMD_BUFF = 40,\n+\tVIRTCHNL_OP_DCF_DISABLE = 41,\n \t/* New major set of opcodes introduced and so leaving room for\n \t * old misc opcodes to be added in future. Also these opcodes may only\n \t * be used if both the PF and VF have successfully negotiated the\n@@ -278,6 +279,7 @@ VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_vsi_resource);\n #define VIRTCHNL_VF_OFFLOAD_ENCAP_CSUM\t\t0X00200000\n #define VIRTCHNL_VF_OFFLOAD_RX_ENCAP_CSUM\t0X00400000\n #define VIRTCHNL_VF_OFFLOAD_ADQ\t\t\t0X00800000\n+#define VIRTCHNL_VF_CAP_DCF\t\t\t0X40000000\n \n /* Define below the capability flags that are not offloads */\n #define VIRTCHNL_VF_CAP_ADV_LINK_SPEED\t\t0x00000080\n@@ -635,6 +637,7 @@ enum virtchnl_event_codes {\n \tVIRTCHNL_EVENT_LINK_CHANGE,\n \tVIRTCHNL_EVENT_RESET_IMPENDING,\n \tVIRTCHNL_EVENT_PF_DRIVER_CLOSE,\n+\tVIRTCHNL_EVENT_DCF_VSI_MAP_UPDATE,\n };\n \n #define PF_EVENT_SEVERITY_INFO\t\t0\n@@ -661,6 +664,10 @@ struct virtchnl_pf_event {\n \t\t\tu8 link_status;\n \t\t\tu8 pad[3];\n \t\t} link_event_adv;\n+\t\tstruct {\n+\t\t\tu16 vf_id;\n+\t\t\tu16 vsi_id;\n+\t\t} vf_vsi_map;\n \t} event_data;\n \n \tint severity;\n@@ -1272,6 +1279,8 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,\n \t\t */\n \t\tvalid_len = msglen;\n \t\tbreak;\n+\tcase VIRTCHNL_OP_DCF_DISABLE:\n+\t\tbreak;\n \tcase VIRTCHNL_OP_GET_CAPS:\n \t\tvalid_len = sizeof(struct virtchnl_get_capabilities);\n \t\tbreak;\n",
    "prefixes": [
        "v4",
        "2/5"
    ]
}