get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 111370,
    "url": "http://patches.dpdk.org/api/patches/111370/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220519073604.254482-1-ke1x.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": "<20220519073604.254482-1-ke1x.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220519073604.254482-1-ke1x.zhang@intel.com",
    "date": "2022-05-19T07:36:04",
    "name": "[v7] net/iavf: fix mbuf release function point corrupt in multi-process",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "9e847449d43115e43fa3c351766a2f7401652da7",
    "submitter": {
        "id": 2503,
        "url": "http://patches.dpdk.org/api/people/2503/?format=api",
        "name": "Zhang, Ke1X",
        "email": "ke1x.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/20220519073604.254482-1-ke1x.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 23023,
            "url": "http://patches.dpdk.org/api/series/23023/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=23023",
            "date": "2022-05-19T07:36:04",
            "name": "[v7] net/iavf: fix mbuf release function point corrupt in multi-process",
            "version": 7,
            "mbox": "http://patches.dpdk.org/series/23023/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/111370/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/111370/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 E1AA7A0503;\n\tThu, 19 May 2022 09:43:22 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7C62D40150;\n\tThu, 19 May 2022 09:43:22 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id B903B40140;\n Thu, 19 May 2022 09:43:19 +0200 (CEST)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 19 May 2022 00:43:18 -0700",
            "from unknown (HELO localhost.localdomain) ([10.239.251.104])\n by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 19 May 2022 00:43:16 -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=1652946200; x=1684482200;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=DuXAaPlZaM0ffA36FAy4IyCL3xyAajAemkTWTXkY9Q8=;\n b=n1doYpuVGpFzn/iQtXSBCaR5HkRRjVIYDs1CFzYMJzkLptE9BkixF6bT\n zbYVWBzkbkUxuCd4dX9vy6osWqNjlNs4psSl9+wCyBcWCdv+8BWRirL+U\n lUk/cz4grgXwQKxCNuvr+1p7qwzKpr6vFg0enFXo+WeiKXQwv1fIQxpEH\n 6T9tByY8vKzorU9l0my3nz8B/0V9iBJxD0tJxA+eKOg/SwYpxQe4dO4qN\n 3ajEBPnWPgY9QqzX2Z/YnFwvPdKhJm17VW1hfv0QXtNS0vrRq3FWclkoS\n +pzLGXjRzQi9q08h+yNvfq1mp+bKVwEZM24ySs12Gnw/F8ZdjHYWiDb0Q g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6400,9594,10351\"; a=\"269660790\"",
            "E=Sophos;i=\"5.91,237,1647327600\"; d=\"scan'208\";a=\"269660790\"",
            "E=Sophos;i=\"5.91,237,1647327600\"; d=\"scan'208\";a=\"598409689\""
        ],
        "From": "Ke Zhang <ke1x.zhang@intel.com>",
        "To": "xiaoyun.li@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com,\n dev@dpdk.org",
        "Cc": "Ke Zhang <ke1x.zhang@intel.com>,\n\tstable@dpdk.org",
        "Subject": "[PATCH v7] net/iavf: fix mbuf release function point corrupt in\n multi-process",
        "Date": "Thu, 19 May 2022 07:36:04 +0000",
        "Message-Id": "<20220519073604.254482-1-ke1x.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220516065529.232946-1-ke1x.zhang@intel.com>",
        "References": "<20220516065529.232946-1-ke1x.zhang@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": "In the multiple process environment, the subprocess operates on the\nshared memory and changes the function pointer of the main process,\nresulting in the failure to find the address of the function when main\nprocess releasing, resulting in crash.\n\nFixes: 319c421f3890 (\"net/avf: enable SSE Rx Tx\")\nCc: stable@dpdk.org\n\nSigned-off-by: Ke Zhang <ke1x.zhang@intel.com>\n---\n drivers/net/iavf/iavf_rxtx.c            | 36 ++++++++++++++++---------\n drivers/net/iavf/iavf_rxtx.h            | 11 ++++++++\n drivers/net/iavf/iavf_rxtx_vec_avx512.c |  8 ++----\n drivers/net/iavf/iavf_rxtx_vec_sse.c    | 16 +++--------\n 4 files changed, 41 insertions(+), 30 deletions(-)",
    "diff": "diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c\nindex 345f6aeebc..bf1adfccef 100644\n--- a/drivers/net/iavf/iavf_rxtx.c\n+++ b/drivers/net/iavf/iavf_rxtx.c\n@@ -362,12 +362,24 @@ release_txq_mbufs(struct iavf_tx_queue *txq)\n \t}\n }\n \n-static const struct iavf_rxq_ops def_rxq_ops = {\n-\t.release_mbufs = release_rxq_mbufs,\n+static const\n+struct iavf_rxq_ops iavf_rxq_release_mbufs_ops[] = {\n+\t[IAVF_REL_MBUFS_DEFAULT].release_mbufs = release_rxq_mbufs,\n+#ifdef RTE_ARCH_X86\n+\t[IAVF_REL_MBUFS_SSE_VEC].release_mbufs = iavf_rx_queue_release_mbufs_sse,\n+#endif\n };\n \n-static const struct iavf_txq_ops def_txq_ops = {\n-\t.release_mbufs = release_txq_mbufs,\n+static const\n+struct iavf_txq_ops iavf_txq_release_mbufs_ops[] = {\n+\t[IAVF_REL_MBUFS_DEFAULT].release_mbufs = release_txq_mbufs,\n+#ifdef RTE_ARCH_X86\n+\t[IAVF_REL_MBUFS_SSE_VEC].release_mbufs = iavf_tx_queue_release_mbufs_sse,\n+#ifdef CC_AVX512_SUPPORT\n+\t[IAVF_REL_MBUFS_AVX512_VEC].release_mbufs = iavf_tx_queue_release_mbufs_avx512,\n+#endif\n+#endif\n+\n };\n \n static inline void\n@@ -678,7 +690,7 @@ iavf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,\n \trxq->q_set = true;\n \tdev->data->rx_queues[queue_idx] = rxq;\n \trxq->qrx_tail = hw->hw_addr + IAVF_QRX_TAIL1(rxq->queue_id);\n-\trxq->ops = &def_rxq_ops;\n+\trxq->rel_mbufs_type = IAVF_REL_MBUFS_DEFAULT;\n \n \tif (check_rx_bulk_allow(rxq) == true) {\n \t\tPMD_INIT_LOG(DEBUG, \"Rx Burst Bulk Alloc Preconditions are \"\n@@ -815,7 +827,7 @@ iavf_dev_tx_queue_setup(struct rte_eth_dev *dev,\n \ttxq->q_set = true;\n \tdev->data->tx_queues[queue_idx] = txq;\n \ttxq->qtx_tail = hw->hw_addr + IAVF_QTX_TAIL1(queue_idx);\n-\ttxq->ops = &def_txq_ops;\n+\ttxq->rel_mbufs_type = IAVF_REL_MBUFS_DEFAULT;\n \n \tif (check_tx_vec_allow(txq) == false) {\n \t\tstruct iavf_adapter *ad =\n@@ -947,7 +959,7 @@ iavf_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n \t}\n \n \trxq = dev->data->rx_queues[rx_queue_id];\n-\trxq->ops->release_mbufs(rxq);\n+\tiavf_rxq_release_mbufs_ops[rxq->rel_mbufs_type].release_mbufs(rxq);\n \treset_rx_queue(rxq);\n \tdev->data->rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED;\n \n@@ -975,7 +987,7 @@ iavf_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)\n \t}\n \n \ttxq = dev->data->tx_queues[tx_queue_id];\n-\ttxq->ops->release_mbufs(txq);\n+\tiavf_txq_release_mbufs_ops[txq->rel_mbufs_type].release_mbufs(txq);\n \treset_tx_queue(txq);\n \tdev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED;\n \n@@ -990,7 +1002,7 @@ iavf_dev_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)\n \tif (!q)\n \t\treturn;\n \n-\tq->ops->release_mbufs(q);\n+\tiavf_rxq_release_mbufs_ops[q->rel_mbufs_type].release_mbufs(q);\n \trte_free(q->sw_ring);\n \trte_memzone_free(q->mz);\n \trte_free(q);\n@@ -1004,7 +1016,7 @@ iavf_dev_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)\n \tif (!q)\n \t\treturn;\n \n-\tq->ops->release_mbufs(q);\n+\tiavf_txq_release_mbufs_ops[q->rel_mbufs_type].release_mbufs(q);\n \trte_free(q->sw_ring);\n \trte_memzone_free(q->mz);\n \trte_free(q);\n@@ -1038,7 +1050,7 @@ iavf_stop_queues(struct rte_eth_dev *dev)\n \t\ttxq = dev->data->tx_queues[i];\n \t\tif (!txq)\n \t\t\tcontinue;\n-\t\ttxq->ops->release_mbufs(txq);\n+\t\tiavf_txq_release_mbufs_ops[txq->rel_mbufs_type].release_mbufs(txq);\n \t\treset_tx_queue(txq);\n \t\tdev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;\n \t}\n@@ -1046,7 +1058,7 @@ iavf_stop_queues(struct rte_eth_dev *dev)\n \t\trxq = dev->data->rx_queues[i];\n \t\tif (!rxq)\n \t\t\tcontinue;\n-\t\trxq->ops->release_mbufs(rxq);\n+\t\tiavf_rxq_release_mbufs_ops[rxq->rel_mbufs_type].release_mbufs(rxq);\n \t\treset_rx_queue(rxq);\n \t\tdev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;\n \t}\ndiff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h\nindex 642b9a700a..e8362bbd1d 100644\n--- a/drivers/net/iavf/iavf_rxtx.h\n+++ b/drivers/net/iavf/iavf_rxtx.h\n@@ -190,6 +190,7 @@ struct iavf_rx_queue {\n \tstruct rte_mbuf *pkt_last_seg;  /* last segment of current packet */\n \tstruct rte_mbuf fake_mbuf;      /* dummy mbuf */\n \tuint8_t rxdid;\n+\tuint8_t rel_mbufs_type;\n \n \t/* used for VPMD */\n \tuint16_t rxrearm_nb;       /* number of remaining to be re-armed */\n@@ -249,6 +250,7 @@ struct iavf_tx_queue {\n \tuint16_t last_desc_cleaned;    /* last desc have been cleaned*/\n \tuint16_t free_thresh;\n \tuint16_t rs_thresh;\n+\tuint8_t rel_mbufs_type;\n \n \tuint16_t port_id;\n \tuint16_t queue_id;\n@@ -392,6 +394,12 @@ struct iavf_32b_rx_flex_desc_comms_ipsec {\n \t__le32 ipsec_said;\n };\n \n+enum iavf_rxtx_rel_mbufs_type {\n+\tIAVF_REL_MBUFS_DEFAULT\t\t= 0,\n+\tIAVF_REL_MBUFS_SSE_VEC\t\t= 1,\n+\tIAVF_REL_MBUFS_AVX512_VEC\t= 2,\n+};\n+\n /* Receive Flex Descriptor profile IDs: There are a total\n  * of 64 profiles where profile IDs 0/1 are for legacy; and\n  * profiles 2-63 are flex profiles that can be programmed\n@@ -695,6 +703,9 @@ int iavf_txq_vec_setup_avx512(struct iavf_tx_queue *txq);\n uint8_t iavf_proto_xtr_type_to_rxdid(uint8_t xtr_type);\n \n void iavf_set_default_ptype_table(struct rte_eth_dev *dev);\n+void iavf_tx_queue_release_mbufs_avx512(struct iavf_tx_queue *txq);\n+void iavf_rx_queue_release_mbufs_sse(struct iavf_rx_queue *rxq);\n+void iavf_tx_queue_release_mbufs_sse(struct iavf_tx_queue *txq);\n \n static inline\n void iavf_dump_rx_descriptor(struct iavf_rx_queue *rxq,\ndiff --git a/drivers/net/iavf/iavf_rxtx_vec_avx512.c b/drivers/net/iavf/iavf_rxtx_vec_avx512.c\nindex 7319d4cb65..3bfec63851 100644\n--- a/drivers/net/iavf/iavf_rxtx_vec_avx512.c\n+++ b/drivers/net/iavf/iavf_rxtx_vec_avx512.c\n@@ -1992,7 +1992,7 @@ iavf_xmit_pkts_vec_avx512(void *tx_queue, struct rte_mbuf **tx_pkts,\n \treturn iavf_xmit_pkts_vec_avx512_cmn(tx_queue, tx_pkts, nb_pkts, false);\n }\n \n-static inline void\n+void __rte_cold\n iavf_tx_queue_release_mbufs_avx512(struct iavf_tx_queue *txq)\n {\n \tunsigned int i;\n@@ -2012,14 +2012,10 @@ iavf_tx_queue_release_mbufs_avx512(struct iavf_tx_queue *txq)\n \t}\n }\n \n-static const struct iavf_txq_ops avx512_vec_txq_ops = {\n-\t.release_mbufs = iavf_tx_queue_release_mbufs_avx512,\n-};\n-\n int __rte_cold\n iavf_txq_vec_setup_avx512(struct iavf_tx_queue *txq)\n {\n-\ttxq->ops = &avx512_vec_txq_ops;\n+\ttxq->rel_mbufs_type = IAVF_REL_MBUFS_AVX512_VEC;\n \treturn 0;\n }\n \ndiff --git a/drivers/net/iavf/iavf_rxtx_vec_sse.c b/drivers/net/iavf/iavf_rxtx_vec_sse.c\nindex 717a227b2c..4a5232c1d2 100644\n--- a/drivers/net/iavf/iavf_rxtx_vec_sse.c\n+++ b/drivers/net/iavf/iavf_rxtx_vec_sse.c\n@@ -1198,37 +1198,29 @@ iavf_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,\n \treturn nb_tx;\n }\n \n-static void __rte_cold\n+void __rte_cold\n iavf_rx_queue_release_mbufs_sse(struct iavf_rx_queue *rxq)\n {\n \t_iavf_rx_queue_release_mbufs_vec(rxq);\n }\n \n-static void __rte_cold\n+void __rte_cold\n iavf_tx_queue_release_mbufs_sse(struct iavf_tx_queue *txq)\n {\n \t_iavf_tx_queue_release_mbufs_vec(txq);\n }\n \n-static const struct iavf_rxq_ops sse_vec_rxq_ops = {\n-\t.release_mbufs = iavf_rx_queue_release_mbufs_sse,\n-};\n-\n-static const struct iavf_txq_ops sse_vec_txq_ops = {\n-\t.release_mbufs = iavf_tx_queue_release_mbufs_sse,\n-};\n-\n int __rte_cold\n iavf_txq_vec_setup(struct iavf_tx_queue *txq)\n {\n-\ttxq->ops = &sse_vec_txq_ops;\n+\ttxq->rel_mbufs_type = IAVF_REL_MBUFS_SSE_VEC;\n \treturn 0;\n }\n \n int __rte_cold\n iavf_rxq_vec_setup(struct iavf_rx_queue *rxq)\n {\n-\trxq->ops = &sse_vec_rxq_ops;\n+\trxq->rel_mbufs_type = IAVF_REL_MBUFS_SSE_VEC;\n \treturn iavf_rxq_vec_setup_default(rxq);\n }\n \n",
    "prefixes": [
        "v7"
    ]
}