get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 111410,
    "url": "http://patches.dpdk.org/api/patches/111410/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220519092921.256908-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": "<20220519092921.256908-1-ke1x.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220519092921.256908-1-ke1x.zhang@intel.com",
    "date": "2022-05-19T09:29:21",
    "name": "net/iavf: fix iavf crashed on dev_stop when running in multi-process mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "68ba8a23c4b7aec7f3397fb5bb6d53952bd5ed56",
    "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/20220519092921.256908-1-ke1x.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 23034,
            "url": "http://patches.dpdk.org/api/series/23034/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=23034",
            "date": "2022-05-19T09:29:21",
            "name": "net/iavf: fix iavf crashed on dev_stop when running in multi-process mode",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/23034/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/111410/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/111410/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 4A08EA0505;\n\tThu, 19 May 2022 11:36:35 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0C93F42684;\n\tThu, 19 May 2022 11:36:35 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id 9637C40150\n for <dev@dpdk.org>; Thu, 19 May 2022 11:36:33 +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 02:36:32 -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 02:36:30 -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=1652952993; x=1684488993;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=uxdBCvyyLidsGZi7dbH1/4YkLpwX1mTnrIlOQH6/tD4=;\n b=IiroGtoT/swPATEiDDTQLY50k1bRr/c7YOAHYHJzgK0QZ2aTDy02Us39\n uNZaCrZaxzc3YJztBMjkWxm898LFI0BZvsLQUVNjO2BXPdJUX2MW0lJbu\n dcB8mn7D8tFWcildV1AekYvIJpZFtBF+R8+AM+MM4qju60aqkAD6PGFCc\n U4WbEHPxtR6gbg57k6tS+joMnSvg/8vl01cEQNm+tuFEKLIOjY/6Kitja\n rHpE5hultTNgQ4ChEvtwXCEzTNK5zC/pA7oLZ/zz7R1xFgldTlVGZ2EmH\n FMjVGnl3UF+noBKX6BEACLJaFVkVn8H3X3DwuwaFSXUbc5PZtlGpKwJn/ g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6400,9594,10351\"; a=\"269703911\"",
            "E=Sophos;i=\"5.91,237,1647327600\"; d=\"scan'208\";a=\"269703911\"",
            "E=Sophos;i=\"5.91,237,1647327600\"; d=\"scan'208\";a=\"598464039\""
        ],
        "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>",
        "Subject": "[PATCH] net/iavf: fix iavf crashed on dev_stop when running in\n multi-process mode",
        "Date": "Thu, 19 May 2022 09:29:21 +0000",
        "Message-Id": "<20220519092921.256908-1-ke1x.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220425083628.81133-1-ke1x.zhang@intel.com>",
        "References": "<20220425083628.81133-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 multi process environment, the sub process\noperates on the shared memory and changes the\nfunction pointer of the main process, resulting in\nthe failure to find the address of the function when\nmain process releasing, resulting in crash.\n\nsimilar with commit<20b631efe785819eb77aabbf500b3352e5731bdb>\n\nSigned-off-by: Ke Zhang <ke1x.zhang@intel.com>\n---\n drivers/net/iavf/iavf_rxtx.c            | 27 ++++++++++++++-----------\n drivers/net/iavf/iavf_rxtx.h            |  6 +++---\n drivers/net/iavf/iavf_rxtx_vec_avx512.c |  4 ++--\n drivers/net/iavf/iavf_rxtx_vec_sse.c    |  8 ++++----\n 4 files changed, 24 insertions(+), 21 deletions(-)",
    "diff": "diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c\nindex 16e8d021f9..197c03cd31 100644\n--- a/drivers/net/iavf/iavf_rxtx.c\n+++ b/drivers/net/iavf/iavf_rxtx.c\n@@ -362,6 +362,9 @@ release_txq_mbufs(struct iavf_tx_queue *txq)\n \t}\n }\n \n+const struct iavf_rxq_ops *iavf_rxq_release_mbufs_ops;\n+const struct iavf_txq_ops *iavf_txq_release_mbufs_ops;\n+\n static const struct iavf_rxq_ops def_rxq_ops = {\n \t.release_mbufs = release_rxq_mbufs,\n };\n@@ -674,7 +677,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+\tiavf_rxq_release_mbufs_ops = &def_rxq_ops;\n \n \tif (check_rx_bulk_allow(rxq) == true) {\n \t\tPMD_INIT_LOG(DEBUG, \"Rx Burst Bulk Alloc Preconditions are \"\n@@ -811,7 +814,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+\tiavf_txq_release_mbufs_ops = &def_txq_ops;\n \n \tif (check_tx_vec_allow(txq) == false) {\n \t\tstruct iavf_adapter *ad =\n@@ -943,7 +946,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->release_mbufs(rxq);\n \treset_rx_queue(rxq);\n \tdev->data->rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED;\n \n@@ -971,7 +974,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->release_mbufs(txq);\n \treset_tx_queue(txq);\n \tdev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED;\n \n@@ -986,7 +989,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->release_mbufs(q);\n \trte_free(q->sw_ring);\n \trte_memzone_free(q->mz);\n \trte_free(q);\n@@ -1000,7 +1003,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->release_mbufs(q);\n \trte_free(q->sw_ring);\n \trte_memzone_free(q->mz);\n \trte_free(q);\n@@ -1034,7 +1037,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->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@@ -1042,7 +1045,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->release_mbufs(rxq);\n \t\treset_rx_queue(rxq);\n \t\tdev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;\n \t}\n@@ -2825,7 +2828,7 @@ iavf_set_rx_function(struct rte_eth_dev *dev)\n \n \t\tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n \t\t\trxq = dev->data->rx_queues[i];\n-\t\t\t(void)iavf_rxq_vec_setup(rxq);\n+\t\t\t(void)iavf_rxq_vec_setup(rxq, &iavf_rxq_release_mbufs_ops);\n \t\t}\n \n \t\tif (dev->data->scattered_rx) {\n@@ -3008,11 +3011,11 @@ iavf_set_tx_function(struct rte_eth_dev *dev)\n \t\t\t\tcontinue;\n #ifdef CC_AVX512_SUPPORT\n \t\t\tif (use_avx512)\n-\t\t\t\tiavf_txq_vec_setup_avx512(txq);\n+\t\t\t\tiavf_txq_vec_setup_avx512(&iavf_txq_release_mbufs_ops);\n \t\t\telse\n-\t\t\t\tiavf_txq_vec_setup(txq);\n+\t\t\t\tiavf_txq_vec_setup(&iavf_txq_release_mbufs_ops);\n #else\n-\t\t\tiavf_txq_vec_setup(txq);\n+\t\t\tiavf_txq_vec_setup(&iavf_txq_release_mbufs_ops);\n #endif\n \t\t}\n \ndiff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h\nindex bf8aebbce8..7df501d784 100644\n--- a/drivers/net/iavf/iavf_rxtx.h\n+++ b/drivers/net/iavf/iavf_rxtx.h\n@@ -657,8 +657,8 @@ uint16_t iavf_xmit_pkts_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts,\n int iavf_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc);\n int iavf_rx_vec_dev_check(struct rte_eth_dev *dev);\n int iavf_tx_vec_dev_check(struct rte_eth_dev *dev);\n-int iavf_rxq_vec_setup(struct iavf_rx_queue *rxq);\n-int iavf_txq_vec_setup(struct iavf_tx_queue *txq);\n+int iavf_rxq_vec_setup(struct iavf_rx_queue *rxq, const struct iavf_rxq_ops **rxq_ops);\n+int iavf_txq_vec_setup(const struct iavf_txq_ops **txq_ops);\n uint16_t iavf_recv_pkts_vec_avx512(void *rx_queue, struct rte_mbuf **rx_pkts,\n \t\t\t\t   uint16_t nb_pkts);\n uint16_t iavf_recv_pkts_vec_avx512_offload(void *rx_queue,\n@@ -687,7 +687,7 @@ uint16_t iavf_xmit_pkts_vec_avx512(void *tx_queue, struct rte_mbuf **tx_pkts,\n uint16_t iavf_xmit_pkts_vec_avx512_offload(void *tx_queue,\n \t\t\t\t\t   struct rte_mbuf **tx_pkts,\n \t\t\t\t\t   uint16_t nb_pkts);\n-int iavf_txq_vec_setup_avx512(struct iavf_tx_queue *txq);\n+int iavf_txq_vec_setup_avx512(const struct iavf_txq_ops **txq_ops);\n \n uint8_t iavf_proto_xtr_type_to_rxdid(uint8_t xtr_type);\n \ndiff --git a/drivers/net/iavf/iavf_rxtx_vec_avx512.c b/drivers/net/iavf/iavf_rxtx_vec_avx512.c\nindex 7319d4cb65..08de34c87c 100644\n--- a/drivers/net/iavf/iavf_rxtx_vec_avx512.c\n+++ b/drivers/net/iavf/iavf_rxtx_vec_avx512.c\n@@ -2017,9 +2017,9 @@ static const struct iavf_txq_ops avx512_vec_txq_ops = {\n };\n \n int __rte_cold\n-iavf_txq_vec_setup_avx512(struct iavf_tx_queue *txq)\n+iavf_txq_vec_setup_avx512(const struct iavf_txq_ops **txq_ops)\n {\n-\ttxq->ops = &avx512_vec_txq_ops;\n+\t*txq_ops = &avx512_vec_txq_ops;\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..a782bed2e0 100644\n--- a/drivers/net/iavf/iavf_rxtx_vec_sse.c\n+++ b/drivers/net/iavf/iavf_rxtx_vec_sse.c\n@@ -1219,16 +1219,16 @@ static const struct iavf_txq_ops sse_vec_txq_ops = {\n };\n \n int __rte_cold\n-iavf_txq_vec_setup(struct iavf_tx_queue *txq)\n+iavf_txq_vec_setup(const struct iavf_txq_ops **txq_ops)\n {\n-\ttxq->ops = &sse_vec_txq_ops;\n+\t*txq_ops = &sse_vec_txq_ops;\n \treturn 0;\n }\n \n int __rte_cold\n-iavf_rxq_vec_setup(struct iavf_rx_queue *rxq)\n+iavf_rxq_vec_setup(struct iavf_rx_queue *rxq, const struct iavf_rxq_ops **rxq_ops)\n {\n-\trxq->ops = &sse_vec_rxq_ops;\n+\t*rxq_ops = &sse_vec_rxq_ops;\n \treturn iavf_rxq_vec_setup_default(rxq);\n }\n \n",
    "prefixes": []
}