get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 130986,
    "url": "http://patchwork.dpdk.org/api/patches/130986/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230831123337.871496-3-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20230831123337.871496-3-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230831123337.871496-3-bruce.richardson@intel.com",
    "date": "2023-08-31T12:33:35",
    "name": "[v2,2/4] net/iavf: fix buffer leak on Tx queue stop",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "e468333e88fb2c8d596cfab0372b8e38818c9f7b",
    "submitter": {
        "id": 20,
        "url": "http://patchwork.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patchwork.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230831123337.871496-3-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 29391,
            "url": "http://patchwork.dpdk.org/api/series/29391/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29391",
            "date": "2023-08-31T12:33:33",
            "name": "Fix i40e/iavf queue reconfig and restarting",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/29391/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/130986/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/130986/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 EA2F141FDD;\n\tThu, 31 Aug 2023 14:34:00 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6E85F402A0;\n\tThu, 31 Aug 2023 14:33:58 +0200 (CEST)",
            "from mgamail.intel.com (mgamail.intel.com [134.134.136.31])\n by mails.dpdk.org (Postfix) with ESMTP id 56AB540294;\n Thu, 31 Aug 2023 14:33:56 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 31 Aug 2023 05:33:56 -0700",
            "from silpixa00401385.ir.intel.com ([10.237.214.14])\n by orsmga005.jf.intel.com with ESMTP; 31 Aug 2023 05:33:54 -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=1693485236; x=1725021236;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=dNHN+xna00zMIdi2cuOsslBvvYiBON4ybUk45AVelSs=;\n b=M4TGAFcxahYizmAKue1X0cyTvtbNVoY+5Vq/1K3wRRkEOh8KAuv2eOLW\n SsMU3hfJHbtXjmAXKQ0qonjs2YMIkdTIAqg0hFdEEOV890cPAh4DmJOEv\n yG1zuBnUUpnnsyfpi79BdAmLTFZFLfPAo0H3BKMmRuwIjeGbgfZzhJnNg\n 93YOYndRdzfu9eqIpOHyPVbD9LGU8t/lYZJZdSf8H3c3qFi2LmJZl3T7z\n 6wLwdToKBjD5ENMBvaezLN4j1GEQ+lZ1JgPW9cy+mwI319Qin7CGrR/g2\n JTMfF2bYbB7btT5D+l0tLfyIvcVgv1WT3bI+jdVnuCCLT91a5+k/4K4Qc w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10818\"; a=\"439873991\"",
            "E=Sophos;i=\"6.02,216,1688454000\"; d=\"scan'208\";a=\"439873991\"",
            "E=McAfee;i=\"6600,9927,10818\"; a=\"913230934\"",
            "E=Sophos;i=\"6.02,216,1688454000\"; d=\"scan'208\";a=\"913230934\""
        ],
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Bruce Richardson <bruce.richardson@intel.com>, wenzhuo.lu@intel.com,\n jingjing.wu@intel.com, stable@dpdk.org",
        "Subject": "[PATCH v2 2/4] net/iavf: fix buffer leak on Tx queue stop",
        "Date": "Thu, 31 Aug 2023 13:33:35 +0100",
        "Message-Id": "<20230831123337.871496-3-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.39.2",
        "In-Reply-To": "<20230831123337.871496-1-bruce.richardson@intel.com>",
        "References": "<20230830155919.592390-1-bruce.richardson@intel.com>\n <20230831123337.871496-1-bruce.richardson@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": "When a queue is stopped all buffers are meant to released from it, and\nthen a new set of buffers reallocated on start. For the iavf code when\nusing vector Tx, some buffers were left in the ring, and so those\nbuffers were leaked. The buffers were missed as the release code only\nhandled one side of a wrap-around case in the ring.\n\nFix the issue by doing a single iteration of the ring freeing all\nbuffers in it, handling wraparound through a simple post-increment\ncheck.\n\nFixes: 319c421f3890 (\"net/avf: enable SSE Rx Tx\")\nFixes: 9ab9514c150e (\"net/iavf: enable AVX512 for Tx\")\nCc: wenzhuo.lu@intel.com\nCc: jingjing.wu@intel.com\nCc: stable@dpdk.org\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n drivers/net/iavf/iavf_rxtx_vec_avx512.c | 17 ++++++++---------\n drivers/net/iavf/iavf_rxtx_vec_common.h | 11 +++++------\n 2 files changed, 13 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx512.c b/drivers/net/iavf/iavf_rxtx_vec_avx512.c\nindex 3e66df5341..48337d5e03 100644\n--- a/drivers/net/iavf/iavf_rxtx_vec_avx512.c\n+++ b/drivers/net/iavf/iavf_rxtx_vec_avx512.c\n@@ -2460,20 +2460,19 @@ iavf_tx_queue_release_mbufs_avx512(struct iavf_tx_queue *txq)\n {\n \tunsigned int i;\n \tconst uint16_t max_desc = (uint16_t)(txq->nb_tx_desc - 1);\n+\tconst uint16_t end_desc = txq->tx_tail >> txq->use_ctx; /* next empty slot */\n+\tconst uint16_t wrap_point = txq->nb_tx_desc >> txq->use_ctx;  /* end of SW ring */\n \tstruct iavf_tx_vec_entry *swr = (void *)txq->sw_ring;\n \n \tif (!txq->sw_ring || txq->nb_free == max_desc)\n \t\treturn;\n \n-\ti = (txq->next_dd >> txq->use_ctx) + 1 -\n-\t\t\t(txq->rs_thresh >> txq->use_ctx);\n-\n-\tif (txq->tx_tail < i) {\n-\t\tfor (; i < (unsigned int)(txq->nb_tx_desc >> txq->use_ctx); i++) {\n-\t\t\trte_pktmbuf_free_seg(swr[i].mbuf);\n-\t\t\tswr[i].mbuf = NULL;\n-\t\t}\n-\t\ti = 0;\n+\ti = (txq->next_dd - txq->rs_thresh + 1) >> txq->use_ctx;\n+\twhile (i != end_desc) {\n+\t\trte_pktmbuf_free_seg(swr[i].mbuf);\n+\t\tswr[i].mbuf = NULL;\n+\t\tif (++i == wrap_point)\n+\t\t\ti = 0;\n \t}\n }\n \ndiff --git a/drivers/net/iavf/iavf_rxtx_vec_common.h b/drivers/net/iavf/iavf_rxtx_vec_common.h\nindex ddb13ce8c3..1fac957fe1 100644\n--- a/drivers/net/iavf/iavf_rxtx_vec_common.h\n+++ b/drivers/net/iavf/iavf_rxtx_vec_common.h\n@@ -186,12 +186,11 @@ _iavf_tx_queue_release_mbufs_vec(struct iavf_tx_queue *txq)\n \t\treturn;\n \n \ti = txq->next_dd - txq->rs_thresh + 1;\n-\tif (txq->tx_tail < i) {\n-\t\tfor (; i < txq->nb_tx_desc; i++) {\n-\t\t\trte_pktmbuf_free_seg(txq->sw_ring[i].mbuf);\n-\t\t\ttxq->sw_ring[i].mbuf = NULL;\n-\t\t}\n-\t\ti = 0;\n+\twhile (i != txq->tx_tail) {\n+\t\trte_pktmbuf_free_seg(txq->sw_ring[i].mbuf);\n+\t\ttxq->sw_ring[i].mbuf = NULL;\n+\t\tif (++i == txq->nb_tx_desc)\n+\t\t\ti = 0;\n \t}\n }\n \n",
    "prefixes": [
        "v2",
        "2/4"
    ]
}