get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 57929,
    "url": "http://patches.dpdk.org/api/patches/57929/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190826105105.19121-27-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": "<20190826105105.19121-27-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190826105105.19121-27-qi.z.zhang@intel.com",
    "date": "2019-08-26T10:50:28",
    "name": "[26/63] net/ice/base: add locks for flow functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "013df0187622741c67af81ad5116d14ebfefee19",
    "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/20190826105105.19121-27-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 6119,
            "url": "http://patches.dpdk.org/api/series/6119/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6119",
            "date": "2019-08-26T10:50:02",
            "name": "net/ice/base: update base code",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/6119/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/57929/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/57929/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 DF30F1C195;\n\tMon, 26 Aug 2019 12:50:04 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 740EC1C06C\n\tfor <dev@dpdk.org>; Mon, 26 Aug 2019 12:49:13 +0200 (CEST)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t26 Aug 2019 03:49:13 -0700",
            "from dpdk51.sh.intel.com ([10.67.110.245])\n\tby orsmga003.jf.intel.com with ESMTP; 26 Aug 2019 03:49:11 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.64,431,1559545200\"; d=\"scan'208\";a=\"182402270\"",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "wenzhuo.lu@intel.com,\n\tqiming.yang@intel.com",
        "Cc": "dev@dpdk.org, xiaolong.ye@intel.com, Qi Zhang <qi.z.zhang@intel.com>,\n\tVignesh Sridhar <vignesh.sridhar@intel.com>,\n\tPaul M Stillwell Jr <paul.m.stillwell.jr@intel.com>",
        "Date": "Mon, 26 Aug 2019 18:50:28 +0800",
        "Message-Id": "<20190826105105.19121-27-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20190826105105.19121-1-qi.z.zhang@intel.com>",
        "References": "<20190826105105.19121-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 26/63] net/ice/base: add locks for flow functions",
        "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": "Wrap functions to search for flow profiles, add and remove RSS\nconfigurations with flow profile locks. This is to ensure that if\nseveral VFs and PFs are disabled at the same time functions that access\nthe flow profile lists are thread safe.\n\nSigned-off-by: Vignesh Sridhar <vignesh.sridhar@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_flow.c | 29 +++++++++++++++++------------\n 1 file changed, 17 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c\nindex 0f52b3379..9e93a1078 100644\n--- a/drivers/net/ice/base/ice_flow.c\n+++ b/drivers/net/ice/base/ice_flow.c\n@@ -949,8 +949,9 @@ ice_flow_find_prof_conds(struct ice_hw *hw, enum ice_block blk,\n \t\t\t enum ice_flow_dir dir, struct ice_flow_seg_info *segs,\n \t\t\t u8 segs_cnt, u16 vsi_handle, u32 conds)\n {\n-\tstruct ice_flow_prof *p;\n+\tstruct ice_flow_prof *p, *prof = NULL;\n \n+\tice_acquire_lock(&hw->fl_profs_locks[blk]);\n \tLIST_FOR_EACH_ENTRY(p, &hw->fl_profs[blk], ice_flow_prof, l_entry) {\n \t\tif ((p->dir == dir || conds & ICE_FLOW_FIND_PROF_NOT_CHK_DIR) &&\n \t\t    segs_cnt && segs_cnt == p->segs_cnt) {\n@@ -972,12 +973,15 @@ ice_flow_find_prof_conds(struct ice_hw *hw, enum ice_block blk,\n \t\t\t\t\tbreak;\n \n \t\t\t/* A match is found if all segments are matched */\n-\t\t\tif (i == segs_cnt)\n-\t\t\t\treturn p;\n+\t\t\tif (i == segs_cnt) {\n+\t\t\t\tprof = p;\n+\t\t\t\tbreak;\n+\t\t\t}\n \t\t}\n \t}\n+\tice_release_lock(&hw->fl_profs_locks[blk]);\n \n-\treturn NULL;\n+\treturn prof;\n }\n \n /**\n@@ -994,10 +998,8 @@ ice_flow_find_prof(struct ice_hw *hw, enum ice_block blk, enum ice_flow_dir dir,\n {\n \tstruct ice_flow_prof *p;\n \n-\tice_acquire_lock(&hw->fl_profs_locks[blk]);\n \tp = ice_flow_find_prof_conds(hw, blk, dir, segs, segs_cnt,\n \t\t\t\t     ICE_MAX_VSI, ICE_FLOW_FIND_PROF_CHK_FLDS);\n-\tice_release_lock(&hw->fl_profs_locks[blk]);\n \n \treturn p ? p->id : ICE_FLOW_PROF_ID_INVAL;\n }\n@@ -1497,9 +1499,12 @@ ice_flow_add_entry(struct ice_hw *hw, enum ice_block blk, u64 prof_id,\n \t\tgoto out;\n \t}\n \n-\tice_acquire_lock(&prof->entries_lock);\n-\tLIST_ADD(&e->l_entry, &prof->entries);\n-\tice_release_lock(&prof->entries_lock);\n+\tif (blk != ICE_BLK_ACL) {\n+\t\t/* ACL will handle the entry management */\n+\t\tice_acquire_lock(&prof->entries_lock);\n+\t\tLIST_ADD(&e->l_entry, &prof->entries);\n+\t\tice_release_lock(&prof->entries_lock);\n+\t}\n \n \t*entry_h = ICE_FLOW_ENTRY_HNDL(e);\n \n@@ -1930,7 +1935,7 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,\n \n \t\t/* Remove profile if it has no VSIs associated */\n \t\tif (!ice_is_any_bit_set(prof->vsis, ICE_MAX_VSI)) {\n-\t\t\tstatus = ice_flow_rem_prof_sync(hw, blk, prof);\n+\t\t\tstatus = ice_flow_rem_prof(hw, blk, prof->id);\n \t\t\tif (status)\n \t\t\t\tgoto exit;\n \t\t}\n@@ -1963,7 +1968,7 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,\n \t * be removed.\n \t */\n \tif (status) {\n-\t\tice_flow_rem_prof_sync(hw, blk, prof);\n+\t\tice_flow_rem_prof(hw, blk, prof->id);\n \t\tgoto exit;\n \t}\n \n@@ -2047,7 +2052,7 @@ ice_rem_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,\n \tice_rem_rss_list(hw, vsi_handle, prof);\n \n \tif (!ice_is_any_bit_set(prof->vsis, ICE_MAX_VSI))\n-\t\tstatus = ice_flow_rem_prof_sync(hw, blk, prof);\n+\t\tstatus = ice_flow_rem_prof(hw, blk, prof->id);\n \n out:\n \tice_free(hw, segs);\n",
    "prefixes": [
        "26/63"
    ]
}