get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 50579,
    "url": "http://patches.dpdk.org/api/patches/50579/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190228055650.25237-20-qi.z.zhang@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20190228055650.25237-20-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190228055650.25237-20-qi.z.zhang@intel.com",
    "date": "2019-02-28T05:56:32",
    "name": "[19/37] net/ice/base: enable VSI queue context",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "d77d02cd74d7dc553d9ebd881b12f1bb92a1f36e",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190228055650.25237-20-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 3567,
            "url": "http://patches.dpdk.org/api/series/3567/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3567",
            "date": "2019-02-28T05:56:13",
            "name": "share code update.",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/3567/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/50579/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/50579/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4ED8B4CC5;\n\tThu, 28 Feb 2019 06:55:39 +0100 (CET)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id 0F18E5A6A\n\tfor <dev@dpdk.org>; Thu, 28 Feb 2019 06:55:30 +0100 (CET)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t27 Feb 2019 21:55:30 -0800",
            "from dpdk51.sh.intel.com ([10.67.110.190])\n\tby fmsmga006.fm.intel.com with ESMTP; 27 Feb 2019 21:55:29 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.58,422,1544515200\"; d=\"scan'208\";a=\"322784337\"",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "wenzhuo.lu@intel.com,\n\tqiming.yang@intel.com",
        "Cc": "paul.m.stillwell.jr@intel.com, dev@dpdk.org, ferruh.yigit@intel.com,\n\tQi Zhang <qi.z.zhang@intel.com>, Victor Raj <victor.raj@intel.com>",
        "Date": "Thu, 28 Feb 2019 13:56:32 +0800",
        "Message-Id": "<20190228055650.25237-20-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20190228055650.25237-1-qi.z.zhang@intel.com>",
        "References": "<20190228055650.25237-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 19/37] net/ice/base: enable VSI queue context",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The patch added to retrieve the queue context and update the queue\nhandle for lan queues.\n\nSigned-off-by: Victor Raj <victor.raj@intel.com>\nSigned-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/net/ice/base/ice_common.c | 60 ++++++++++++++++++++++++++++++++++++---\n drivers/net/ice/base/ice_common.h | 11 +++----\n drivers/net/ice/ice_rxtx.c        | 11 +++++--\n 3 files changed, 70 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c\nindex e0fe06e9c..f5cbd47c3 100644\n--- a/drivers/net/ice/base/ice_common.c\n+++ b/drivers/net/ice/base/ice_common.c\n@@ -3512,10 +3512,35 @@ ice_get_ctx(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info)\n }\n \n /**\n+ * ice_get_lan_q_ctx - get the LAN queue context for the given VSI and TC\n+ * @hw: pointer to the HW struct\n+ * @vsi_handle: software VSI handle\n+ * @tc: TC number\n+ * @q_handle: software queue handle\n+ */\n+static struct ice_q_ctx *\n+ice_get_lan_q_ctx(struct ice_hw *hw, u16 vsi_handle, u8 tc, u16 q_handle)\n+{\n+\tstruct ice_vsi_ctx *vsi;\n+\tstruct ice_q_ctx *q_ctx;\n+\n+\tvsi = ice_get_vsi_ctx(hw, vsi_handle);\n+\tif (!vsi)\n+\t\treturn NULL;\n+\tif (q_handle >= vsi->num_lan_q_entries[tc])\n+\t\treturn NULL;\n+\tif (!vsi->lan_q_ctx[tc])\n+\t\treturn NULL;\n+\tq_ctx = vsi->lan_q_ctx[tc];\n+\treturn &q_ctx[q_handle];\n+}\n+\n+/**\n  * ice_ena_vsi_txq\n  * @pi: port information structure\n  * @vsi_handle: software VSI handle\n  * @tc: TC number\n+ * @q_handle: software queue handle\n  * @num_qgrps: Number of added queue groups\n  * @buf: list of queue groups to be added\n  * @buf_size: size of buffer for indirect command\n@@ -3524,12 +3549,13 @@ ice_get_ctx(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info)\n  * This function adds one LAN queue\n  */\n enum ice_status\n-ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_qgrps,\n-\t\tstruct ice_aqc_add_tx_qgrp *buf, u16 buf_size,\n+ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 q_handle,\n+\t\tu8 num_qgrps, struct ice_aqc_add_tx_qgrp *buf, u16 buf_size,\n \t\tstruct ice_sq_cd *cd)\n {\n \tstruct ice_aqc_txsched_elem_data node = { 0 };\n \tstruct ice_sched_node *parent;\n+\tstruct ice_q_ctx *q_ctx;\n \tenum ice_status status;\n \tstruct ice_hw *hw;\n \n@@ -3546,6 +3572,14 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_qgrps,\n \n \tice_acquire_lock(&pi->sched_lock);\n \n+\tq_ctx = ice_get_lan_q_ctx(hw, vsi_handle, tc, q_handle);\n+\tif (!q_ctx) {\n+\t\tice_debug(hw, ICE_DBG_SCHED, \"Enaq: invalid queue handle %d\\n\",\n+\t\t\t  q_handle);\n+\t\tstatus = ICE_ERR_PARAM;\n+\t\tgoto ena_txq_exit;\n+\t}\n+\n \t/* find a parent node */\n \tparent = ice_sched_get_free_qparent(pi, vsi_handle, tc,\n \t\t\t\t\t    ICE_SCHED_NODE_OWNER_LAN);\n@@ -3580,6 +3614,7 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_qgrps,\n \n \tnode.node_teid = buf->txqs[0].q_teid;\n \tnode.data.elem_type = ICE_AQC_ELEM_TYPE_LEAF;\n+\tq_ctx->q_handle = q_handle;\n \n \t/* add a leaf node into schduler tree queue layer */\n \tstatus = ice_sched_add_node(pi, hw->num_tx_sched_layers - 1, &node);\n@@ -3592,7 +3627,10 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_qgrps,\n /**\n  * ice_dis_vsi_txq\n  * @pi: port information structure\n+ * @vsi_handle: software VSI handle\n+ * @tc: TC number\n  * @num_queues: number of queues\n+ * @q_handles: pointer to software queue handle array\n  * @q_ids: pointer to the q_id array\n  * @q_teids: pointer to queue node teids\n  * @rst_src: if called due to reset, specifies the reset source\n@@ -3602,12 +3640,14 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_qgrps,\n  * This function removes queues and their corresponding nodes in SW DB\n  */\n enum ice_status\n-ice_dis_vsi_txq(struct ice_port_info *pi, u8 num_queues, u16 *q_ids,\n-\t\tu32 *q_teids, enum ice_disq_rst_src rst_src, u16 vmvf_num,\n+ice_dis_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_queues,\n+\t\tu16 *q_handles, u16 *q_ids, u32 *q_teids,\n+\t\tenum ice_disq_rst_src rst_src, u16 vmvf_num,\n \t\tstruct ice_sq_cd *cd)\n {\n \tenum ice_status status = ICE_ERR_DOES_NOT_EXIST;\n \tstruct ice_aqc_dis_txq_item qg_list;\n+\tstruct ice_q_ctx *q_ctx;\n \tu16 i;\n \n \tif (!pi || pi->port_state != ICE_SCHED_PORT_STATE_READY)\n@@ -3630,6 +3670,17 @@ ice_dis_vsi_txq(struct ice_port_info *pi, u8 num_queues, u16 *q_ids,\n \t\tnode = ice_sched_find_node_by_teid(pi->root, q_teids[i]);\n \t\tif (!node)\n \t\t\tcontinue;\n+\t\tq_ctx = ice_get_lan_q_ctx(pi->hw, vsi_handle, tc, q_handles[i]);\n+\t\tif (!q_ctx) {\n+\t\t\tice_debug(pi->hw, ICE_DBG_SCHED, \"invalid queue handle%d\\n\",\n+\t\t\t\t  q_handles[i]);\n+\t\t\tcontinue;\n+\t\t}\n+\t\tif (q_ctx->q_handle != q_handles[i]) {\n+\t\t\tice_debug(pi->hw, ICE_DBG_SCHED, \"Err:handles %d %d\\n\",\n+\t\t\t\t  q_ctx->q_handle, q_handles[i]);\n+\t\t\tcontinue;\n+\t\t}\n \t\tqg_list.parent_teid = node->info.parent_teid;\n \t\tqg_list.num_qs = 1;\n \t\tqg_list.q_id[0] = CPU_TO_LE16(q_ids[i]);\n@@ -3640,6 +3691,7 @@ ice_dis_vsi_txq(struct ice_port_info *pi, u8 num_queues, u16 *q_ids,\n \t\tif (status != ICE_SUCCESS)\n \t\t\tbreak;\n \t\tice_free_sched_node(pi, node);\n+\t\tq_ctx->q_handle = ICE_INVAL_Q_HANDLE;\n \t}\n \tice_release_lock(&pi->sched_lock);\n \treturn status;\ndiff --git a/drivers/net/ice/base/ice_common.h b/drivers/net/ice/base/ice_common.h\nindex 63f4a5ebe..72560fbbf 100644\n--- a/drivers/net/ice/base/ice_common.h\n+++ b/drivers/net/ice/base/ice_common.h\n@@ -157,15 +157,16 @@ ice_aq_set_port_id_led(struct ice_port_info *pi, bool is_orig_mode,\n enum ice_status\n ice_get_ctx(u8 *src_ctx, u8 *dest_ctx, struct ice_ctx_ele *ce_info);\n enum ice_status\n-ice_dis_vsi_txq(struct ice_port_info *pi, u8 num_queues, u16 *q_ids,\n-\t\tu32 *q_teids, enum ice_disq_rst_src rst_src, u16 vmvf_num,\n-\t\tstruct ice_sq_cd *cmd_details);\n+ice_dis_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_queues,\n+\t\tu16 *q_handle, u16 *q_ids, u32 *q_teids,\n+\t\tenum ice_disq_rst_src rst_src, u16 vmvf_num,\n+\t\tstruct ice_sq_cd *cd);\n enum ice_status\n ice_cfg_vsi_lan(struct ice_port_info *pi, u16 vsi_handle, u8 tc_bitmap,\n \t\tu16 *max_lanqs);\n enum ice_status\n-ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_qgrps,\n-\t\tstruct ice_aqc_add_tx_qgrp *buf, u16 buf_size,\n+ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 q_handle,\n+\t\tu8 num_qgrps, struct ice_aqc_add_tx_qgrp *buf, u16 buf_size,\n \t\tstruct ice_sq_cd *cd);\n enum ice_status ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle);\n void ice_replay_post(struct ice_hw *hw);\ndiff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c\nindex c794ee861..b65bb4a51 100644\n--- a/drivers/net/ice/ice_rxtx.c\n+++ b/drivers/net/ice/ice_rxtx.c\n@@ -453,7 +453,8 @@ ice_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)\n \t/* Init the Tx tail register*/\n \tICE_PCI_REG_WRITE(txq->qtx_tail, 0);\n \n-\terr = ice_ena_vsi_txq(hw->port_info, vsi->idx, 0, 1, &txq_elem,\n+\t/* Fix me, we assume TC always 0 here */\n+\terr = ice_ena_vsi_txq(hw->port_info, vsi->idx, 0, 0, 1, &txq_elem,\n \t\t\t      sizeof(txq_elem), NULL);\n \tif (err) {\n \t\tPMD_DRV_LOG(ERR, \"Failed to add lan txq\");\n@@ -528,9 +529,12 @@ ice_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)\n {\n \tstruct ice_tx_queue *txq;\n \tstruct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n+\tstruct ice_vsi *vsi = pf->main_vsi;\n \tenum ice_status status;\n \tuint16_t q_ids[1];\n \tuint32_t q_teids[1];\n+\tuint16_t q_handle = 0;\n \n \tif (tx_queue_id >= dev->data->nb_tx_queues) {\n \t\tPMD_DRV_LOG(ERR, \"TX queue %u is out of range %u\",\n@@ -548,8 +552,9 @@ ice_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)\n \tq_ids[0] = txq->reg_idx;\n \tq_teids[0] = txq->q_teid;\n \n-\tstatus = ice_dis_vsi_txq(hw->port_info, 1, q_ids, q_teids,\n-\t\t\t\t ICE_NO_RESET, 0, NULL);\n+\t/* Fix me, we assume TC always 0 here */\n+\tstatus = ice_dis_vsi_txq(hw->port_info, vsi->idx, 0, 1, &q_handle,\n+\t\t\t\tq_ids, q_teids, ICE_NO_RESET, 0, NULL);\n \tif (status != ICE_SUCCESS) {\n \t\tPMD_DRV_LOG(DEBUG, \"Failed to disable Lan Tx queue\");\n \t\treturn -EINVAL;\n",
    "prefixes": [
        "19/37"
    ]
}