get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 109369,
    "url": "https://patches.dpdk.org/api/patches/109369/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220407105706.18889-18-kevinx.liu@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": "<20220407105706.18889-18-kevinx.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220407105706.18889-18-kevinx.liu@intel.com",
    "date": "2022-04-07T10:56:44",
    "name": "[17/39] net/ice/base: support custom DDP buildin recipe",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0ff228364a7c27a701eb4e296e0f996cbfdd59d8",
    "submitter": {
        "id": 2440,
        "url": "https://patches.dpdk.org/api/people/2440/?format=api",
        "name": "Kevin Liu",
        "email": "kevinx.liu@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/20220407105706.18889-18-kevinx.liu@intel.com/mbox/",
    "series": [
        {
            "id": 22387,
            "url": "https://patches.dpdk.org/api/series/22387/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=22387",
            "date": "2022-04-07T10:56:27",
            "name": "support full function of DCF",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/22387/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/109369/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/109369/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 14D5EA0508;\n\tThu,  7 Apr 2022 04:59:49 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 229C94289A;\n\tThu,  7 Apr 2022 04:59:06 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by mails.dpdk.org (Postfix) with ESMTP id AB1F44288C\n for <dev@dpdk.org>; Thu,  7 Apr 2022 04:59:03 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 06 Apr 2022 19:59:03 -0700",
            "from intel-cd-odc-kevin.cd.intel.com ([10.240.178.195])\n by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 06 Apr 2022 19:59:00 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1649300343; x=1680836343;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=+eAhVcRSNZ3sMRA9fMgoQLkjhcReYedZEaj1wpLS28w=;\n b=iHc5sP8QYCA34l3gQglEnMnYevITnn71nVVSnFhufNd4btp5jyOdxipn\n dXagiv8FRTjLDtoJncL8thcLA2qMlLM8B5yDFkfFVvlihQGDgD99cQRo+\n DR04BEsQ3mwVzEVknFsbfloMM83JoAAmqSuitqCT6/yWYSPN/aF5KH+Yw\n zDGR5UvL16l1kwerpFCIKpNUwRjri3YEGjuyDCJupYbhcW4HrZiAKyjZI\n myK2p5qLbXdhcAW2+WVuEufd7EWeW+n0NkyYdlGdzq3vVy7ZtUcsy9LpQ\n /CVnQ0gycKNFBZ9RdG3yT0/PeIcHPgS1kGPbA+V1yL6kWY5vw6z9r6a3u Q==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10309\"; a=\"248738385\"",
            "E=Sophos;i=\"5.90,241,1643702400\"; d=\"scan'208\";a=\"248738385\"",
            "E=Sophos;i=\"5.90,241,1643702400\"; d=\"scan'208\";a=\"570850623\""
        ],
        "From": "Kevin Liu <kevinx.liu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qiming.yang@intel.com, qi.z.zhang@intel.com, stevex.yang@intel.com,\n Alvin Zhang <alvinx.zhang@intel.com>, Steven Zou <steven.zou@intel.com>,\n Kevin Liu <kevinx.liu@intel.com>",
        "Subject": "[PATCH 17/39] net/ice/base: support custom DDP buildin recipe",
        "Date": "Thu,  7 Apr 2022 10:56:44 +0000",
        "Message-Id": "<20220407105706.18889-18-kevinx.liu@intel.com>",
        "X-Mailer": "git-send-email 2.33.1",
        "In-Reply-To": "<20220407105706.18889-1-kevinx.liu@intel.com>",
        "References": "<20220407105706.18889-1-kevinx.liu@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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"
    },
    "content": "From: Alvin Zhang <alvinx.zhang@intel.com>\n\nAdd control flag and data pointer for custom DDP package buildin recipe.\nInit the data pointer of buildin recipe.\nSupport dumping buildin recipe lookup info.\n\nSigned-off-by: Steven Zou <steven.zou@intel.com>\nSigned-off-by: Alvin Zhang <alvinx.zhang@intel.com>\nSigned-off-by: Kevin Liu <kevinx.liu@intel.com>\n---\n drivers/net/ice/base/ice_common.c | 25 +++++++++++++++\n drivers/net/ice/base/ice_switch.c | 52 ++++++++++++++++++++++++++++++-\n drivers/net/ice/base/ice_type.h   |  2 ++\n 3 files changed, 78 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c\nindex db87bacd97..5d5ce894ff 100644\n--- a/drivers/net/ice/base/ice_common.c\n+++ b/drivers/net/ice/base/ice_common.c\n@@ -732,6 +732,28 @@ ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_size, struct ice_sq_cd *cd)\n \treturn ice_aq_send_cmd(hw, &desc, NULL, 0, cd);\n }\n \n+static int ice_buildin_recipe_init(struct ice_hw *hw)\n+{\n+\tstruct ice_switch_info *sw = hw->switch_info;\n+\tstruct ice_sw_recipe *recipe;\n+\n+\tsw->buildin_recipes = ice_malloc(hw,\n+\t\t\tsizeof(sw->buildin_recipes[0]) * ICE_MAX_NUM_RECIPES);\n+\n+\tif (!sw->buildin_recipes)\n+\t\treturn ICE_ERR_NO_MEMORY;\n+\n+\trecipe = &sw->buildin_recipes[10];\n+\trecipe->is_root = 1;\n+\n+\trecipe->lkup_exts.n_val_words = 1;\n+\trecipe->lkup_exts.field_mask[0] = 0x00ff;\n+\trecipe->lkup_exts.fv_words[0].off = 8;\n+\trecipe->lkup_exts.fv_words[0].prot_id = 32;\n+\n+\treturn ICE_SUCCESS;\n+}\n+\n /**\n  * ice_init_fltr_mgmt_struct - initializes filter management list and locks\n  * @hw: pointer to the HW struct\n@@ -752,6 +774,8 @@ enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw)\n \tINIT_LIST_HEAD(&sw->vsi_list_map_head);\n \tsw->prof_res_bm_init = 0;\n \n+\tice_buildin_recipe_init(hw);\n+\n \tstatus = ice_init_def_sw_recp(hw, &hw->switch_info->recp_list);\n \tif (status) {\n \t\tice_free(hw, hw->switch_info);\n@@ -822,6 +846,7 @@ ice_cleanup_fltr_mgmt_single(struct ice_hw *hw, struct ice_switch_info *sw)\n \t\t\tice_free(hw, recps[i].root_buf);\n \t}\n \tice_rm_sw_replay_rule_info(hw, sw);\n+\tice_free(hw, sw->buildin_recipes);\n \tice_free(hw, sw->recp_list);\n \tice_free(hw, sw);\n }\ndiff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c\nindex b0c50c8f40..d9bb1e7c31 100644\n--- a/drivers/net/ice/base/ice_switch.c\n+++ b/drivers/net/ice/base/ice_switch.c\n@@ -6910,6 +6910,47 @@ static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = {\n \t{ ICE_VLAN_IN,\t\tICE_VLAN_OL_HW },\n };\n \n+static u16 buildin_recipe_get(struct ice_switch_info *sw,\n+\t\t\t      struct ice_prot_lkup_ext *lkup_exts)\n+{\n+\tint i;\n+\n+\tif (!sw->buildin_recipes)\n+\t\treturn ICE_MAX_NUM_RECIPES;\n+\n+\tfor (i = 10; i < ICE_MAX_NUM_RECIPES; i++) {\n+\t\tstruct ice_sw_recipe *recp = &sw->buildin_recipes[i];\n+\t\tstruct ice_fv_word *a = lkup_exts->fv_words;\n+\t\tstruct ice_fv_word *b = recp->lkup_exts.fv_words;\n+\t\tu16 *c = recp->lkup_exts.field_mask;\n+\t\tu16 *d = lkup_exts->field_mask;\n+\t\tbool found = true;\n+\t\tu8 p, q;\n+\n+\t\tif (!recp->is_root)\n+\t\t\tcontinue;\n+\n+\t\tif (recp->lkup_exts.n_val_words != lkup_exts->n_val_words)\n+\t\t\tcontinue;\n+\n+\t\tfor (p = 0; p < lkup_exts->n_val_words; p++) {\n+\t\t\tfor (q = 0; q < recp->lkup_exts.n_val_words; q++) {\n+\t\t\t\tif (a[p].off == b[q].off &&\n+\t\t\t\t    a[p].prot_id == b[q].prot_id &&\n+\t\t\t\t    d[p] == c[q])\n+\t\t\t\t\tbreak;\n+\t\t\t}\n+\t\t\tif (q >= recp->lkup_exts.n_val_words) {\n+\t\t\t\tfound = false;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\t\tif (found)\n+\t\t\treturn i;\n+\t}\n+\treturn ICE_MAX_NUM_RECIPES;\n+}\n+\n /**\n  * ice_find_recp - find a recipe\n  * @hw: pointer to the hardware structure\n@@ -6922,8 +6963,15 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts,\n {\n \tbool refresh_required = true;\n \tstruct ice_sw_recipe *recp;\n+\tu16 buildin_rid;\n \tu8 i;\n \n+\tif (hw->use_buildin_recipe) {\n+\t\tbuildin_rid = buildin_recipe_get(hw->switch_info, lkup_exts);\n+\t\tif (buildin_rid < ICE_MAX_NUM_RECIPES)\n+\t\t\treturn buildin_rid;\n+\t}\n+\n \t/* Walk through existing recipes to find a match */\n \trecp = hw->switch_info->recp_list;\n \tfor (i = 0; i < ICE_MAX_NUM_RECIPES; i++) {\n@@ -9457,8 +9505,10 @@ ice_rem_adv_rule_by_id(struct ice_hw *hw,\n \tstruct ice_switch_info *sw;\n \n \tsw = hw->switch_info;\n-\tif (!sw->recp_list[remove_entry->rid].recp_created)\n+\tif (!sw->buildin_recipes[remove_entry->rid].is_root &&\n+\t    !sw->recp_list[remove_entry->rid].recp_created)\n \t\treturn ICE_ERR_PARAM;\n+\n \tlist_head = &sw->recp_list[remove_entry->rid].filt_rules;\n \tLIST_FOR_EACH_ENTRY(list_itr, list_head, ice_adv_fltr_mgmt_list_entry,\n \t\t\t    list_entry) {\ndiff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h\nindex d81984633a..48144ea065 100644\n--- a/drivers/net/ice/base/ice_type.h\n+++ b/drivers/net/ice/base/ice_type.h\n@@ -1107,6 +1107,7 @@ struct ice_switch_info {\n \tu16 max_used_prof_index;\n \n \tice_declare_bitmap(prof_res_bm[ICE_MAX_NUM_PROFILES], ICE_MAX_FV_WORDS);\n+\tstruct ice_sw_recipe *buildin_recipes;\n };\n \n /* Port hardware description */\n@@ -1263,6 +1264,7 @@ struct ice_hw {\n \tice_declare_bitmap(hw_ptype, ICE_FLOW_PTYPE_MAX);\n \tu8 dvm_ena;\n \t__le16 io_expander_handle;\n+\tu8 use_buildin_recipe;\n };\n \n /* Statistics collected by each port, VSI, VEB, and S-channel */\n",
    "prefixes": [
        "17/39"
    ]
}