get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 81650,
    "url": "http://patches.dpdk.org/api/patches/81650/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201020224846.1592682-21-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": "<20201020224846.1592682-21-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201020224846.1592682-21-qi.z.zhang@intel.com",
    "date": "2020-10-20T22:48:45",
    "name": "[20/21] net/ice/base: add support for get/set RSS LUT to specify global LUT",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d39a32a3946b6b25b42c9bf56f5ea9fc07d2df7d",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20201020224846.1592682-21-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 13156,
            "url": "http://patches.dpdk.org/api/series/13156/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13156",
            "date": "2020-10-20T22:48:25",
            "name": "ice: update base code",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/13156/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/81650/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/81650/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 9EF9AA04DD;\n\tWed, 21 Oct 2020 00:50:59 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 99881AD28;\n\tWed, 21 Oct 2020 00:45:39 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by dpdk.org (Postfix) with ESMTP id EC1A9ACF0\n for <dev@dpdk.org>; Wed, 21 Oct 2020 00:45:20 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 20 Oct 2020 15:45:20 -0700",
            "from dpdk51.sh.intel.com ([10.67.111.142])\n by orsmga005.jf.intel.com with ESMTP; 20 Oct 2020 15:45:19 -0700"
        ],
        "IronPort-SDR": [
            "\n mgtAXzhpcEpl0iMGmFP3L3auoeLe0aXa4pZhzOJD/48yAz00Ulso0wTQV9Co2FSqJ3cC7rK5N5\n tHC3q7BGhkqQ==",
            "\n hnhpL0cyLKXDhdfF0O22LMKjpIpNUkd9UxzcTCqxi7NqzFXB0+6+qS518EBVGMkheWt3ynhjHc\n 8cTEl5QnSsDw=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9780\"; a=\"166510643\"",
            "E=Sophos;i=\"5.77,399,1596524400\"; d=\"scan'208\";a=\"166510643\"",
            "E=Sophos;i=\"5.77,399,1596524400\"; d=\"scan'208\";a=\"533254737\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "qiming.yang@intel.com",
        "Cc": "dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>,\n Brett Creeley <brett.creeley@intel.com>",
        "Date": "Wed, 21 Oct 2020 06:48:45 +0800",
        "Message-Id": "<20201020224846.1592682-21-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.25.4",
        "In-Reply-To": "<20201020224846.1592682-1-qi.z.zhang@intel.com>",
        "References": "<20201020224846.1592682-1-qi.z.zhang@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 20/21] net/ice/base: add support for get/set RSS\n\tLUT to specify global LUT",
        "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 <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": "There is no way to specify a global RSS LUT ID with the current API and\n0 is the only global LUT ID that can be supported since it's hard coded.\nUpcoming support to specify a global LUT ID will require this\nflexibility. To fix this, update the API for ice_aq_get_rss_lut() and\nice_aq_set_rss_lut() to take the new structure\nice_aq_get_set_rss_params, which includes a global_lut_id member. A new\nstructure was introduced instead of adding another parameter to the\npreviously mentioned functions for 2 reasons:\n\n1. Reduce the number of parameters passed to the functions.\n2. Reduce the amount of change required if the arguments ever need to be\n   updated in the future.\n\nAlso, reduce duplicate code that was checking for an invalid vsi_handle\nand lut parameter by moving the checks to the lower level\n__ice_aq_get_set_rss_lut().\n\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/net/ice/base/ice_common.c | 54 ++++++++++++++-----------------\n drivers/net/ice/base/ice_common.h |  6 ++--\n drivers/net/ice/base/ice_type.h   |  8 +++++\n drivers/net/ice/ice_ethdev.c      | 28 ++++++++++++----\n 4 files changed, 55 insertions(+), 41 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c\nindex 0c1259b42a..304e55e210 100644\n--- a/drivers/net/ice/base/ice_common.c\n+++ b/drivers/net/ice/base/ice_common.c\n@@ -3218,23 +3218,33 @@ ice_aq_sff_eeprom(struct ice_hw *hw, u16 lport, u8 bus_addr,\n /**\n  * __ice_aq_get_set_rss_lut\n  * @hw: pointer to the hardware structure\n- * @vsi_id: VSI FW index\n- * @lut_type: LUT table type\n- * @lut: pointer to the LUT buffer provided by the caller\n- * @lut_size: size of the LUT buffer\n- * @glob_lut_idx: global LUT index\n+ * @params: RSS LUT parameters\n  * @set: set true to set the table, false to get the table\n  *\n  * Internal function to get (0x0B05) or set (0x0B03) RSS look up table\n  */\n static enum ice_status\n-__ice_aq_get_set_rss_lut(struct ice_hw *hw, u16 vsi_id, u8 lut_type, u8 *lut,\n-\t\t\t u16 lut_size, u8 glob_lut_idx, bool set)\n+__ice_aq_get_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *params, bool set)\n {\n+\tu16 flags = 0, vsi_id, lut_type, lut_size, glob_lut_idx, vsi_handle;\n \tstruct ice_aqc_get_set_rss_lut *cmd_resp;\n \tstruct ice_aq_desc desc;\n \tenum ice_status status;\n-\tu16 flags = 0;\n+\tu8 *lut;\n+\n+\tif (!params)\n+\t\treturn ICE_ERR_PARAM;\n+\n+\tvsi_handle = params->vsi_handle;\n+\tlut = params->lut;\n+\n+\tif (!ice_is_vsi_valid(hw, vsi_handle) || !lut)\n+\t\treturn ICE_ERR_PARAM;\n+\n+\tlut_size = params->lut_size;\n+\tlut_type = params->lut_type;\n+\tglob_lut_idx = params->global_lut_id;\n+\tvsi_id = ice_get_hw_vsi_num(hw, vsi_handle);\n \n \tcmd_resp = &desc.params.get_set_rss_lut;\n \n@@ -3311,43 +3321,27 @@ __ice_aq_get_set_rss_lut(struct ice_hw *hw, u16 vsi_id, u8 lut_type, u8 *lut,\n /**\n  * ice_aq_get_rss_lut\n  * @hw: pointer to the hardware structure\n- * @vsi_handle: software VSI handle\n- * @lut_type: LUT table type\n- * @lut: pointer to the LUT buffer provided by the caller\n- * @lut_size: size of the LUT buffer\n+ * @get_params: RSS LUT parameters used to specify which RSS LUT to get\n  *\n  * get the RSS lookup table, PF or VSI type\n  */\n enum ice_status\n-ice_aq_get_rss_lut(struct ice_hw *hw, u16 vsi_handle, u8 lut_type,\n-\t\t   u8 *lut, u16 lut_size)\n+ice_aq_get_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *get_params)\n {\n-\tif (!ice_is_vsi_valid(hw, vsi_handle) || !lut)\n-\t\treturn ICE_ERR_PARAM;\n-\n-\treturn __ice_aq_get_set_rss_lut(hw, ice_get_hw_vsi_num(hw, vsi_handle),\n-\t\t\t\t\tlut_type, lut, lut_size, 0, false);\n+\treturn __ice_aq_get_set_rss_lut(hw, get_params, false);\n }\n \n /**\n  * ice_aq_set_rss_lut\n  * @hw: pointer to the hardware structure\n- * @vsi_handle: software VSI handle\n- * @lut_type: LUT table type\n- * @lut: pointer to the LUT buffer provided by the caller\n- * @lut_size: size of the LUT buffer\n+ * @set_params: RSS LUT parameters used to specify how to set the RSS LUT\n  *\n  * set the RSS lookup table, PF or VSI type\n  */\n enum ice_status\n-ice_aq_set_rss_lut(struct ice_hw *hw, u16 vsi_handle, u8 lut_type,\n-\t\t   u8 *lut, u16 lut_size)\n+ice_aq_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *set_params)\n {\n-\tif (!ice_is_vsi_valid(hw, vsi_handle) || !lut)\n-\t\treturn ICE_ERR_PARAM;\n-\n-\treturn __ice_aq_get_set_rss_lut(hw, ice_get_hw_vsi_num(hw, vsi_handle),\n-\t\t\t\t\tlut_type, lut, lut_size, 0, true);\n+\treturn __ice_aq_get_set_rss_lut(hw, set_params, true);\n }\n \n /**\ndiff --git a/drivers/net/ice/base/ice_common.h b/drivers/net/ice/base/ice_common.h\nindex 0288fb73e0..8c16c7a024 100644\n--- a/drivers/net/ice/base/ice_common.h\n+++ b/drivers/net/ice/base/ice_common.h\n@@ -86,11 +86,9 @@ ice_write_tx_drbell_q_ctx(struct ice_hw *hw,\n \t\t\t  u32 tx_drbell_q_index);\n \n enum ice_status\n-ice_aq_get_rss_lut(struct ice_hw *hw, u16 vsi_handle, u8 lut_type, u8 *lut,\n-\t\t   u16 lut_size);\n+ice_aq_get_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *get_params);\n enum ice_status\n-ice_aq_set_rss_lut(struct ice_hw *hw, u16 vsi_handle, u8 lut_type, u8 *lut,\n-\t\t   u16 lut_size);\n+ice_aq_set_rss_lut(struct ice_hw *hw, struct ice_aq_get_set_rss_lut_params *set_params);\n enum ice_status\n ice_aq_get_rss_key(struct ice_hw *hw, u16 vsi_handle,\n \t\t   struct ice_aqc_get_set_rss_keys *keys);\ndiff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h\nindex f93baed8d9..6b8d44f0b4 100644\n--- a/drivers/net/ice/base/ice_type.h\n+++ b/drivers/net/ice/base/ice_type.h\n@@ -1069,6 +1069,14 @@ enum ice_sw_fwd_act_type {\n \tICE_INVAL_ACT\n };\n \n+struct ice_aq_get_set_rss_lut_params {\n+\tu16 vsi_handle;\t\t/* software VSI handle */\n+\tu16 lut_size;\t\t/* size of the LUT buffer */\n+\tu8 lut_type;\t\t/* type of the LUT (i.e. VSI, PF, Global) */\n+\tu8 *lut;\t\t/* input RSS LUT for set and output RSS LUT for get */\n+\tu8 global_lut_id;\t/* only valid when lut_type is global */\n+};\n+\n /* Checksum and Shadow RAM pointers */\n #define ICE_SR_NVM_CTRL_WORD\t\t\t0x00\n #define ICE_SR_PHY_ANALOG_PTR\t\t\t0x04\ndiff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c\nindex 6d6c24c5d2..b9cb524f9e 100644\n--- a/drivers/net/ice/ice_ethdev.c\n+++ b/drivers/net/ice/ice_ethdev.c\n@@ -3173,6 +3173,7 @@ static int ice_init_rss(struct ice_pf *pf)\n \tstruct ice_hw *hw = ICE_PF_TO_HW(pf);\n \tstruct ice_vsi *vsi = pf->main_vsi;\n \tstruct rte_eth_dev *dev = pf->adapter->eth_dev;\n+\tstruct ice_aq_get_set_rss_lut_params lut_params;\n \tstruct rte_eth_rss_conf *rss_conf;\n \tstruct ice_aqc_get_set_rss_keys key;\n \tuint16_t i, nb_q;\n@@ -3227,9 +3228,12 @@ static int ice_init_rss(struct ice_pf *pf)\n \tfor (i = 0; i < vsi->rss_lut_size; i++)\n \t\tvsi->rss_lut[i] = i % nb_q;\n \n-\tret = ice_aq_set_rss_lut(hw, vsi->idx,\n-\t\t\t\t ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF,\n-\t\t\t\t vsi->rss_lut, vsi->rss_lut_size);\n+\tlut_params.vsi_handle = vsi->idx;\n+\tlut_params.lut_size = vsi->rss_lut_size;\n+\tlut_params.lut_type = ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF;\n+\tlut_params.lut = vsi->rss_lut;\n+\tlut_params.global_lut_id = 0;\n+\tret = ice_aq_set_rss_lut(hw, &lut_params);\n \tif (ret)\n \t\tgoto out;\n \n@@ -4154,6 +4158,7 @@ ice_vlan_offload_set(struct rte_eth_dev *dev, int mask)\n static int\n ice_get_rss_lut(struct ice_vsi *vsi, uint8_t *lut, uint16_t lut_size)\n {\n+\tstruct ice_aq_get_set_rss_lut_params lut_params;\n \tstruct ice_pf *pf = ICE_VSI_TO_PF(vsi);\n \tstruct ice_hw *hw = ICE_VSI_TO_HW(vsi);\n \tint ret;\n@@ -4162,8 +4167,12 @@ ice_get_rss_lut(struct ice_vsi *vsi, uint8_t *lut, uint16_t lut_size)\n \t\treturn -EINVAL;\n \n \tif (pf->flags & ICE_FLAG_RSS_AQ_CAPABLE) {\n-\t\tret = ice_aq_get_rss_lut(hw, vsi->idx,\n-\t\t\tICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF, lut, lut_size);\n+\t\tlut_params.vsi_handle = vsi->idx;\n+\t\tlut_params.lut_size = lut_size;\n+\t\tlut_params.lut_type = ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF;\n+\t\tlut_params.lut = lut;\n+\t\tlut_params.global_lut_id = 0;\n+\t\tret = ice_aq_get_rss_lut(hw, &lut_params);\n \t\tif (ret) {\n \t\t\tPMD_DRV_LOG(ERR, \"Failed to get RSS lookup table\");\n \t\t\treturn -EINVAL;\n@@ -4182,6 +4191,7 @@ ice_get_rss_lut(struct ice_vsi *vsi, uint8_t *lut, uint16_t lut_size)\n static int\n ice_set_rss_lut(struct ice_vsi *vsi, uint8_t *lut, uint16_t lut_size)\n {\n+\tstruct ice_aq_get_set_rss_lut_params lut_params;\n \tstruct ice_pf *pf;\n \tstruct ice_hw *hw;\n \tint ret;\n@@ -4193,8 +4203,12 @@ ice_set_rss_lut(struct ice_vsi *vsi, uint8_t *lut, uint16_t lut_size)\n \thw = ICE_VSI_TO_HW(vsi);\n \n \tif (pf->flags & ICE_FLAG_RSS_AQ_CAPABLE) {\n-\t\tret = ice_aq_set_rss_lut(hw, vsi->idx,\n-\t\t\tICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF, lut, lut_size);\n+\t\tlut_params.vsi_handle = vsi->idx;\n+\t\tlut_params.lut_size = lut_size;\n+\t\tlut_params.lut_type = ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_PF;\n+\t\tlut_params.lut = lut;\n+\t\tlut_params.global_lut_id = 0;\n+\t\tret = ice_aq_set_rss_lut(hw, &lut_params);\n \t\tif (ret) {\n \t\t\tPMD_DRV_LOG(ERR, \"Failed to set RSS lookup table\");\n \t\t\treturn -EINVAL;\n",
    "prefixes": [
        "20/21"
    ]
}