get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 95219,
    "url": "https://patches.dpdk.org/api/patches/95219/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210702150027.26294-1-ting.xu@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20210702150027.26294-1-ting.xu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210702150027.26294-1-ting.xu@intel.com",
    "date": "2021-07-02T15:00:27",
    "name": "[v1] net/ice: support QoS BW config after VF reset in DCF",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e5714bee5a3b20a4f46f179f35b32df88ecdeee4",
    "submitter": {
        "id": 1363,
        "url": "https://patches.dpdk.org/api/people/1363/?format=api",
        "name": "Xu, Ting",
        "email": "ting.xu@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "https://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210702150027.26294-1-ting.xu@intel.com/mbox/",
    "series": [
        {
            "id": 17600,
            "url": "https://patches.dpdk.org/api/series/17600/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=17600",
            "date": "2021-07-02T15:00:27",
            "name": "[v1] net/ice: support QoS BW config after VF reset in DCF",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/17600/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/95219/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/95219/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id B852FA0A0C;\n\tFri,  2 Jul 2021 16:57:39 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A3DDB413DB;\n\tFri,  2 Jul 2021 16:57:39 +0200 (CEST)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n by mails.dpdk.org (Postfix) with ESMTP id 5C4F741353\n for <dev@dpdk.org>; Fri,  2 Jul 2021 16:57:37 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 02 Jul 2021 07:57:25 -0700",
            "from dpdk-xuting-second.sh.intel.com ([10.67.116.193])\n by fmsmga002.fm.intel.com with ESMTP; 02 Jul 2021 07:57:23 -0700"
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10033\"; a=\"272596150\"",
            "E=Sophos;i=\"5.83,317,1616482800\"; d=\"scan'208\";a=\"272596150\"",
            "E=Sophos;i=\"5.83,317,1616482800\"; d=\"scan'208\";a=\"494158149\""
        ],
        "X-ExtLoop1": "1",
        "From": "Ting Xu <ting.xu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com,\n Ting Xu <ting.xu@intel.com>",
        "Date": "Fri,  2 Jul 2021 23:00:27 +0800",
        "Message-Id": "<20210702150027.26294-1-ting.xu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "Subject": "[dpdk-dev] [PATCH v1] net/ice: support QoS BW config after VF reset\n in DCF",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "When VF reset happens, the QoS bandwidth configuration will be lost. If\nthe reset is not caused by DCB change, it is supposed to replay the\nbandwidth configuration to VF by DCF. In this patch, when a vsi update\nPF event is received from PF after VF reset, and it is confirmed that\nDCB is not changed, bandwidth configuration will be replayed.\n\nSigned-off-by: Ting Xu <ting.xu@intel.com>\n---\n drivers/net/ice/ice_dcf.c        | 11 +++++--\n drivers/net/ice/ice_dcf.h        |  2 ++\n drivers/net/ice/ice_dcf_ethdev.c |  1 -\n drivers/net/ice/ice_dcf_parent.c |  3 ++\n drivers/net/ice/ice_dcf_sched.c  | 53 +++++++++++++++++++++++++++++++-\n 5 files changed, 66 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c\nindex 349d23ee4f..045800a2d9 100644\n--- a/drivers/net/ice/ice_dcf.c\n+++ b/drivers/net/ice/ice_dcf.c\n@@ -577,7 +577,7 @@ int\n ice_dcf_init_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)\n {\n \tstruct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);\n-\tint ret;\n+\tint ret, size;\n \n \thw->avf.hw_addr = pci_dev->mem_resource[0].addr;\n \thw->avf.back = hw;\n@@ -669,8 +669,15 @@ ice_dcf_init_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)\n \t\t}\n \t}\n \n-\tif (hw->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_QOS)\n+\tif (hw->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_QOS) {\n \t\tice_dcf_tm_conf_init(eth_dev);\n+\t\tsize = sizeof(struct virtchnl_dcf_bw_cfg_list *) * hw->num_vfs;\n+\t\thw->qos_bw_cfg = rte_zmalloc(\"qos_bw_cfg\", size, 0);\n+\t\tif (!hw->qos_bw_cfg) {\n+\t\t\tPMD_INIT_LOG(ERR, \"no memory for qos_bw_cfg\");\n+\t\t\tgoto err_rss;\n+\t\t}\n+\t}\n \n \thw->eth_dev = eth_dev;\n \trte_intr_callback_register(&pci_dev->intr_handle,\ndiff --git a/drivers/net/ice/ice_dcf.h b/drivers/net/ice/ice_dcf.h\nindex 1c7653de3d..711c0cf3ad 100644\n--- a/drivers/net/ice/ice_dcf.h\n+++ b/drivers/net/ice/ice_dcf.h\n@@ -90,6 +90,7 @@ struct ice_dcf_hw {\n \tuint16_t pf_vsi_id;\n \n \tstruct ice_dcf_tm_conf tm_conf;\n+\tstruct virtchnl_dcf_bw_cfg_list **qos_bw_cfg;\n \tstruct ice_aqc_port_ets_elem *ets_config;\n \tstruct virtchnl_version_info virtchnl_version;\n \tstruct virtchnl_vf_resource *vf_res; /* VF resource */\n@@ -131,5 +132,6 @@ int ice_dcf_link_update(struct rte_eth_dev *dev,\n \t\t    __rte_unused int wait_to_complete);\n void ice_dcf_tm_conf_init(struct rte_eth_dev *dev);\n void ice_dcf_tm_conf_uninit(struct rte_eth_dev *dev);\n+int ice_dcf_replay_vf_bw(struct ice_dcf_hw *hw, uint16_t vf_id);\n \n #endif /* _ICE_DCF_H_ */\ndiff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c\nindex 69fe6e63d1..cab7c4da87 100644\n--- a/drivers/net/ice/ice_dcf_ethdev.c\n+++ b/drivers/net/ice/ice_dcf_ethdev.c\n@@ -622,7 +622,6 @@ ice_dcf_dev_stop(struct rte_eth_dev *dev)\n \tice_dcf_add_del_all_mac_addr(&dcf_ad->real_hw, false);\n \tdev->data->dev_link.link_status = ETH_LINK_DOWN;\n \tad->pf.adapter_stopped = 1;\n-\tdcf_ad->real_hw.tm_conf.committed = false;\n \n \treturn 0;\n }\ndiff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c\nindex c59cd0bef9..03155c9df0 100644\n--- a/drivers/net/ice/ice_dcf_parent.c\n+++ b/drivers/net/ice/ice_dcf_parent.c\n@@ -143,6 +143,9 @@ ice_dcf_vsi_update_service_handler(void *param)\n \t\t}\n \t}\n \n+\tif (hw->tm_conf.committed)\n+\t\tice_dcf_replay_vf_bw(hw, reset_param->vf_id);\n+\n \trte_spinlock_unlock(&vsi_update_lock);\n \n \tfree(param);\ndiff --git a/drivers/net/ice/ice_dcf_sched.c b/drivers/net/ice/ice_dcf_sched.c\nindex 4371bbc820..c688564ca6 100644\n--- a/drivers/net/ice/ice_dcf_sched.c\n+++ b/drivers/net/ice/ice_dcf_sched.c\n@@ -631,6 +631,48 @@ ice_dcf_validate_tc_bw(struct virtchnl_dcf_bw_cfg_list *tc_bw,\n \n \treturn 0;\n }\n+\n+int\n+ice_dcf_replay_vf_bw(struct ice_dcf_hw *hw, uint16_t vf_id)\n+{\n+\tstruct ice_aqc_port_ets_elem old_ets_config;\n+\tstruct ice_dcf_adapter *adapter;\n+\tstruct ice_hw *parent_hw;\n+\tint ret, size;\n+\n+\tadapter = hw->eth_dev->data->dev_private;\n+\tparent_hw = &adapter->parent.hw;\n+\n+\t/* store the old ets config */\n+\told_ets_config = *hw->ets_config;\n+\n+\tice_memset(hw->ets_config, 0, sizeof(*hw->ets_config), ICE_NONDMA_MEM);\n+\tret = ice_aq_query_port_ets(parent_hw->port_info,\n+\t\t\thw->ets_config, sizeof(*hw->ets_config),\n+\t\t\tNULL);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR, \"DCF Query Port ETS failed\");\n+\t\treturn ret;\n+\t}\n+\n+\tif (memcmp(&old_ets_config, hw->ets_config, sizeof(old_ets_config))) {\n+\t\tPMD_DRV_LOG(DEBUG, \"ETS config changes, do not replay BW\");\n+\t\treturn ICE_SUCCESS;\n+\t}\n+\n+\tsize = sizeof(struct virtchnl_dcf_bw_cfg_list) +\n+\t\tsizeof(struct virtchnl_dcf_bw_cfg) *\n+\t\t(hw->tm_conf.nb_tc_node - 1);\n+\n+\tret = ice_dcf_set_vf_bw(hw, hw->qos_bw_cfg[vf_id], size);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(DEBUG, \"VF %u BW replay failed\", vf_id);\n+\t\treturn ICE_ERR_CFG;\n+\t}\n+\n+\treturn ICE_SUCCESS;\n+}\n+\n static int ice_dcf_hierarchy_commit(struct rte_eth_dev *dev,\n \t\t\t\t int clear_on_fail,\n \t\t\t\t __rte_unused struct rte_tm_error *error)\n@@ -734,7 +776,16 @@ static int ice_dcf_hierarchy_commit(struct rte_eth_dev *dev,\n \t\tret_val = ice_dcf_set_vf_bw(hw, vf_bw, size);\n \t\tif (ret_val)\n \t\t\tgoto fail_clear;\n-\t\tmemset(vf_bw, 0, size);\n+\n+\t\thw->qos_bw_cfg[vf_id] = rte_zmalloc(\"vf_bw_cfg\", size, 0);\n+\t\tif (!hw->qos_bw_cfg[vf_id]) {\n+\t\t\tret_val = ICE_ERR_NO_MEMORY;\n+\t\t\tgoto fail_clear;\n+\t\t}\n+\t\t/* store the bandwidth information for replay */\n+\t\tice_memcpy(hw->qos_bw_cfg[vf_id], vf_bw, sizeof(*vf_bw),\n+\t\t\t   ICE_NONDMA_TO_NONDMA);\n+\t\tice_memset(vf_bw, 0, size, ICE_NONDMA_MEM);\n \t}\n \n \t/* check if total CIR is larger than port bandwidth */\n",
    "prefixes": [
        "v1"
    ]
}