get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 125357,
    "url": "http://patches.dpdk.org/api/patches/125357/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230321070039.80399-1-beilei.xing@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": "<20230321070039.80399-1-beilei.xing@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230321070039.80399-1-beilei.xing@intel.com",
    "date": "2023-03-21T07:00:39",
    "name": "From: Beilei Xing <beilei.xing@intel.com>",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b524ad0e0dd9c2f66ec043620bbca4cce1da59f8",
    "submitter": {
        "id": 410,
        "url": "http://patches.dpdk.org/api/people/410/?format=api",
        "name": "Xing, Beilei",
        "email": "beilei.xing@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230321070039.80399-1-beilei.xing@intel.com/mbox/",
    "series": [
        {
            "id": 27480,
            "url": "http://patches.dpdk.org/api/series/27480/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27480",
            "date": "2023-03-21T07:00:39",
            "name": "From: Beilei Xing <beilei.xing@intel.com>",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/27480/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/125357/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/125357/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 92AF0427F3;\n\tTue, 21 Mar 2023 08:33:08 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 243C340A7F;\n\tTue, 21 Mar 2023 08:33:08 +0100 (CET)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by mails.dpdk.org (Postfix) with ESMTP id 349DD40A7A\n for <dev@dpdk.org>; Tue, 21 Mar 2023 08:33:06 +0100 (CET)",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Mar 2023 00:32:57 -0700",
            "from dpdk-beileix-3.sh.intel.com ([10.67.110.253])\n by orsmga008.jf.intel.com with ESMTP; 21 Mar 2023 00:32: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=1679383986; x=1710919986;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=jEc2IfI16bkOWR2Ap5W6mDW3Zbjddk8pUh9p/krqwfU=;\n b=c3Ljr+tT9jIcZgljp4Pxd2iheJVdS3sG8iHJ+E4KzWBnMUAVFHlHtn1O\n 0VUnc+hk4f50DhUXDGSYp6yv653oibmOEAZZVMt1+AZ+xxlT3Z8kU5r9S\n k5Mi0y/fzkrcYG33SsTWPmGJ5WnVzy1TWDGS3wYW/k2OKTlaly8g7Z5zG\n E4E4ZPelA0L4MYgJGxKenYzD9oPL7fHE4n/8azCPZzhDrUhAUEa/Z9Bqj\n CaTTbLZiI/QpkC5lws+x1z6LMcO9bgEb3SjG+8cTuQKtUMPekw4q2X7wN\n a0yYS1+HgqFZ9cmjNRYyzS7/D6GYpPkvHBYEcaBFxUJHliyowdlCGfaZ6 w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10655\"; a=\"322713615\"",
            "E=Sophos;i=\"5.98,278,1673942400\"; d=\"scan'208\";a=\"322713615\"",
            "E=McAfee;i=\"6600,9927,10655\"; a=\"711698745\"",
            "E=Sophos;i=\"5.98,278,1673942400\"; d=\"scan'208\";a=\"711698745\""
        ],
        "X-ExtLoop1": "1",
        "From": "beilei.xing@intel.com",
        "To": "jingjing.wu@intel.com",
        "Cc": "dev@dpdk.org, aFrom@dpdk.org,\n\ta5103b9659af1a22b0c1f9951c6ac273c325e68f@dpdk.org, Mon@dpdk.org,\n\tSep@dpdk.org, 17@dpdk.org, \"00:00:00\"@dpdk.org, 2001@dpdk.org,\n\tBeilei Xing <beilei.xing@intel.com>",
        "Subject": "From: Beilei Xing <beilei.xing@intel.com>",
        "Date": "Tue, 21 Mar 2023 07:00:39 +0000",
        "Message-Id": "<20230321070039.80399-1-beilei.xing@intel.com>",
        "X-Mailer": "git-send-email 2.26.2",
        "In-Reply-To": "\n <https://patches.dpdk.org/project/dpdk/patch/20230321065316.79549-1-beilei.xing@intel.com/>",
        "References": "\n <https://patches.dpdk.org/project/dpdk/patch/20230321065316.79549-1-beilei.xing@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": "Move PF reset and PF mailbox initialization functions from\nidpf_adapter_init function to xxxx_adapter_ext_init function,\nsince they're different between PF and VF support.\n\nSigned-off-by: Beilei Xing <beilei.xing@intel.com>\n---\n\nv2 change:\n - Fix typo.\n\n drivers/common/idpf/idpf_common_device.c | 72 +++++-------------------\n drivers/common/idpf/idpf_common_device.h | 13 +++++\n drivers/common/idpf/version.map          |  5 ++\n drivers/net/cpfl/cpfl_ethdev.c           | 18 ++++++\n drivers/net/idpf/idpf_ethdev.c           | 51 +++++++++++++++++\n 5 files changed, 100 insertions(+), 59 deletions(-)",
    "diff": "diff --git a/drivers/common/idpf/idpf_common_device.c b/drivers/common/idpf/idpf_common_device.c\nindex c5e7bbf66c..3b58bdd41e 100644\n--- a/drivers/common/idpf/idpf_common_device.c\n+++ b/drivers/common/idpf/idpf_common_device.c\n@@ -6,8 +6,8 @@\n #include <idpf_common_device.h>\n #include <idpf_common_virtchnl.h>\n \n-static void\n-idpf_reset_pf(struct idpf_hw *hw)\n+void\n+idpf_hw_pf_reset(struct idpf_hw *hw)\n {\n \tuint32_t reg;\n \n@@ -15,9 +15,8 @@ idpf_reset_pf(struct idpf_hw *hw)\n \tIDPF_WRITE_REG(hw, PFGEN_CTRL, (reg | PFGEN_CTRL_PFSWR));\n }\n \n-#define IDPF_RESET_WAIT_CNT 100\n-static int\n-idpf_check_pf_reset_done(struct idpf_hw *hw)\n+int\n+idpf_hw_pf_reset_check(struct idpf_hw *hw)\n {\n \tuint32_t reg;\n \tint i;\n@@ -33,48 +32,13 @@ idpf_check_pf_reset_done(struct idpf_hw *hw)\n \treturn -EBUSY;\n }\n \n-#define CTLQ_NUM 2\n-static int\n-idpf_init_mbx(struct idpf_hw *hw)\n+int\n+idpf_hw_mbx_init(struct idpf_hw *hw, struct idpf_ctlq_create_info *ctlq_info)\n {\n-\tstruct idpf_ctlq_create_info ctlq_info[CTLQ_NUM] = {\n-\t\t{\n-\t\t\t.type = IDPF_CTLQ_TYPE_MAILBOX_TX,\n-\t\t\t.id = IDPF_CTLQ_ID,\n-\t\t\t.len = IDPF_CTLQ_LEN,\n-\t\t\t.buf_size = IDPF_DFLT_MBX_BUF_SIZE,\n-\t\t\t.reg = {\n-\t\t\t\t.head = PF_FW_ATQH,\n-\t\t\t\t.tail = PF_FW_ATQT,\n-\t\t\t\t.len = PF_FW_ATQLEN,\n-\t\t\t\t.bah = PF_FW_ATQBAH,\n-\t\t\t\t.bal = PF_FW_ATQBAL,\n-\t\t\t\t.len_mask = PF_FW_ATQLEN_ATQLEN_M,\n-\t\t\t\t.len_ena_mask = PF_FW_ATQLEN_ATQENABLE_M,\n-\t\t\t\t.head_mask = PF_FW_ATQH_ATQH_M,\n-\t\t\t}\n-\t\t},\n-\t\t{\n-\t\t\t.type = IDPF_CTLQ_TYPE_MAILBOX_RX,\n-\t\t\t.id = IDPF_CTLQ_ID,\n-\t\t\t.len = IDPF_CTLQ_LEN,\n-\t\t\t.buf_size = IDPF_DFLT_MBX_BUF_SIZE,\n-\t\t\t.reg = {\n-\t\t\t\t.head = PF_FW_ARQH,\n-\t\t\t\t.tail = PF_FW_ARQT,\n-\t\t\t\t.len = PF_FW_ARQLEN,\n-\t\t\t\t.bah = PF_FW_ARQBAH,\n-\t\t\t\t.bal = PF_FW_ARQBAL,\n-\t\t\t\t.len_mask = PF_FW_ARQLEN_ARQLEN_M,\n-\t\t\t\t.len_ena_mask = PF_FW_ARQLEN_ARQENABLE_M,\n-\t\t\t\t.head_mask = PF_FW_ARQH_ARQH_M,\n-\t\t\t}\n-\t\t}\n-\t};\n \tstruct idpf_ctlq_info *ctlq;\n \tint ret;\n \n-\tret = idpf_ctlq_init(hw, CTLQ_NUM, ctlq_info);\n+\tret = idpf_ctlq_init(hw, IDPF_CTLQ_NUM, ctlq_info);\n \tif (ret != 0)\n \t\treturn ret;\n \n@@ -96,6 +60,12 @@ idpf_init_mbx(struct idpf_hw *hw)\n \treturn ret;\n }\n \n+void\n+idpf_hw_mbx_deinit(struct idpf_hw *hw)\n+{\n+\tidpf_ctlq_deinit(hw);\n+}\n+\n static int\n idpf_get_pkt_type(struct idpf_adapter *adapter)\n {\n@@ -312,19 +282,6 @@ idpf_adapter_init(struct idpf_adapter *adapter)\n \tstruct idpf_hw *hw = &adapter->hw;\n \tint ret;\n \n-\tidpf_reset_pf(hw);\n-\tret = idpf_check_pf_reset_done(hw);\n-\tif (ret != 0) {\n-\t\tDRV_LOG(ERR, \"IDPF is still resetting\");\n-\t\tgoto err_check_reset;\n-\t}\n-\n-\tret = idpf_init_mbx(hw);\n-\tif (ret != 0) {\n-\t\tDRV_LOG(ERR, \"Failed to init mailbox\");\n-\t\tgoto err_check_reset;\n-\t}\n-\n \tadapter->mbx_resp = rte_zmalloc(\"idpf_adapter_mbx_resp\",\n \t\t\t\t\tIDPF_DFLT_MBX_BUF_SIZE, 0);\n \tif (adapter->mbx_resp == NULL) {\n@@ -357,8 +314,6 @@ idpf_adapter_init(struct idpf_adapter *adapter)\n \trte_free(adapter->mbx_resp);\n \tadapter->mbx_resp = NULL;\n err_mbx_resp:\n-\tidpf_ctlq_deinit(hw);\n-err_check_reset:\n \treturn ret;\n }\n \n@@ -367,7 +322,6 @@ idpf_adapter_deinit(struct idpf_adapter *adapter)\n {\n \tstruct idpf_hw *hw = &adapter->hw;\n \n-\tidpf_ctlq_deinit(hw);\n \trte_free(adapter->mbx_resp);\n \tadapter->mbx_resp = NULL;\n \ndiff --git a/drivers/common/idpf/idpf_common_device.h b/drivers/common/idpf/idpf_common_device.h\nindex c2dc2f16b9..ac4afd5ab9 100644\n--- a/drivers/common/idpf/idpf_common_device.h\n+++ b/drivers/common/idpf/idpf_common_device.h\n@@ -10,8 +10,11 @@\n #include <base/virtchnl2.h>\n #include <idpf_common_logs.h>\n \n+#define IDPF_RESET_WAIT_CNT\t100\n+\n #define IDPF_RSS_KEY_LEN\t52\n \n+#define IDPF_CTLQ_NUM\t\t2\n #define IDPF_CTLQ_ID\t\t-1\n #define IDPF_CTLQ_LEN\t\t64\n #define IDPF_DFLT_MBX_BUF_SIZE\t4096\n@@ -142,6 +145,8 @@ struct idpf_cmd_info {\n \tuint32_t out_size;      /* buffer size for response */\n };\n \n+struct idpf_ctlq_create_info ctlq_info[IDPF_CTLQ_NUM];\n+\n /* notify current command done. Only call in case execute\n  * _atomic_set_cmd successfully.\n  */\n@@ -180,6 +185,14 @@ atomic_set_cmd(struct idpf_adapter *adapter, uint32_t ops)\n \treturn !ret;\n }\n \n+__rte_internal\n+void idpf_hw_pf_reset(struct idpf_hw *hw);\n+__rte_internal\n+int idpf_hw_pf_reset_check(struct idpf_hw *hw);\n+__rte_internal\n+int idpf_hw_mbx_init(struct idpf_hw *hw, struct idpf_ctlq_create_info *ctlq_info);\n+__rte_internal\n+void idpf_hw_mbx_deinit(struct idpf_hw *hw);\n __rte_internal\n int idpf_adapter_init(struct idpf_adapter *adapter);\n __rte_internal\ndiff --git a/drivers/common/idpf/version.map b/drivers/common/idpf/version.map\nindex 70334a1b03..7076759024 100644\n--- a/drivers/common/idpf/version.map\n+++ b/drivers/common/idpf/version.map\n@@ -15,6 +15,11 @@ INTERNAL {\n \tidpf_dp_splitq_xmit_pkts;\n \tidpf_dp_splitq_xmit_pkts_avx512;\n \n+\tidpf_hw_mbx_deinit;\n+\tidpf_hw_mbx_init;\n+\tidpf_hw_pf_reset;\n+\tidpf_hw_pf_reset_check;\n+\n \tidpf_qc_rx_thresh_check;\n \tidpf_qc_rx_queue_release;\n \tidpf_qc_rxq_mbufs_release;\ndiff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c\nindex ede730fd50..21505b86f2 100644\n--- a/drivers/net/cpfl/cpfl_ethdev.c\n+++ b/drivers/net/cpfl/cpfl_ethdev.c\n@@ -1165,6 +1165,8 @@ cpfl_dev_alarm_handler(void *param)\n \trte_eal_alarm_set(CPFL_ALARM_INTERVAL, cpfl_dev_alarm_handler, adapter);\n }\n \n+extern struct idpf_ctlq_create_info ctlq_info[IDPF_CTLQ_NUM];\n+\n static int\n cpfl_adapter_ext_init(struct rte_pci_device *pci_dev, struct cpfl_adapter_ext *adapter)\n {\n@@ -1181,6 +1183,19 @@ cpfl_adapter_ext_init(struct rte_pci_device *pci_dev, struct cpfl_adapter_ext *a\n \n \tstrncpy(adapter->name, pci_dev->device.name, PCI_PRI_STR_SIZE);\n \n+\tidpf_hw_pf_reset(hw);\n+\tret = idpf_hw_pf_reset_check(hw);\n+\tif (ret != 0) {\n+\t\tPMD_INIT_LOG(ERR, \"PF is still resetting\");\n+\t\tgoto err_reset_check;\n+\t}\n+\n+\tret = idpf_hw_mbx_init(hw, ctlq_info);\n+\tif (ret != 0) {\n+\t\tPMD_INIT_LOG(ERR, \"Failed to init mailbox\");\n+\t\tgoto err_reset_check;\n+\t}\n+\n \tret = idpf_adapter_init(base);\n \tif (ret != 0) {\n \t\tPMD_INIT_LOG(ERR, \"Failed to init adapter\");\n@@ -1213,6 +1228,8 @@ cpfl_adapter_ext_init(struct rte_pci_device *pci_dev, struct cpfl_adapter_ext *a\n \trte_eal_alarm_cancel(cpfl_dev_alarm_handler, adapter);\n \tidpf_adapter_deinit(base);\n err_adapter_init:\n+\tidpf_hw_mbx_deinit(hw);\n+err_reset_check:\n \treturn ret;\n }\n \n@@ -1323,6 +1340,7 @@ cpfl_adapter_ext_deinit(struct cpfl_adapter_ext *adapter)\n {\n \trte_eal_alarm_cancel(cpfl_dev_alarm_handler, adapter);\n \tidpf_adapter_deinit(&adapter->base);\n+\tidpf_hw_mbx_deinit(&adapter->base.hw);\n \n \trte_free(adapter->vports);\n \tadapter->vports = NULL;\ndiff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c\nindex e02ec2ec5a..c23623c5fc 100644\n--- a/drivers/net/idpf/idpf_ethdev.c\n+++ b/drivers/net/idpf/idpf_ethdev.c\n@@ -1128,6 +1128,41 @@ idpf_dev_alarm_handler(void *param)\n \trte_eal_alarm_set(IDPF_ALARM_INTERVAL, idpf_dev_alarm_handler, adapter);\n }\n \n+struct idpf_ctlq_create_info ctlq_info[IDPF_CTLQ_NUM] = {\n+\t{\n+\t\t.type = IDPF_CTLQ_TYPE_MAILBOX_TX,\n+\t\t.id = IDPF_CTLQ_ID,\n+\t\t.len = IDPF_CTLQ_LEN,\n+\t\t.buf_size = IDPF_DFLT_MBX_BUF_SIZE,\n+\t\t.reg = {\n+\t\t\t.head = PF_FW_ATQH,\n+\t\t\t.tail = PF_FW_ATQT,\n+\t\t\t.len = PF_FW_ATQLEN,\n+\t\t\t.bah = PF_FW_ATQBAH,\n+\t\t\t.bal = PF_FW_ATQBAL,\n+\t\t\t.len_mask = PF_FW_ATQLEN_ATQLEN_M,\n+\t\t\t.len_ena_mask = PF_FW_ATQLEN_ATQENABLE_M,\n+\t\t\t.head_mask = PF_FW_ATQH_ATQH_M,\n+\t\t}\n+\t},\n+\t{\n+\t\t.type = IDPF_CTLQ_TYPE_MAILBOX_RX,\n+\t\t.id = IDPF_CTLQ_ID,\n+\t\t.len = IDPF_CTLQ_LEN,\n+\t\t.buf_size = IDPF_DFLT_MBX_BUF_SIZE,\n+\t\t.reg = {\n+\t\t\t.head = PF_FW_ARQH,\n+\t\t\t.tail = PF_FW_ARQT,\n+\t\t\t.len = PF_FW_ARQLEN,\n+\t\t\t.bah = PF_FW_ARQBAH,\n+\t\t\t.bal = PF_FW_ARQBAL,\n+\t\t\t.len_mask = PF_FW_ARQLEN_ARQLEN_M,\n+\t\t\t.len_ena_mask = PF_FW_ARQLEN_ARQENABLE_M,\n+\t\t\t.head_mask = PF_FW_ARQH_ARQH_M,\n+\t\t}\n+\t}\n+};\n+\n static int\n idpf_adapter_ext_init(struct rte_pci_device *pci_dev, struct idpf_adapter_ext *adapter)\n {\n@@ -1144,6 +1179,19 @@ idpf_adapter_ext_init(struct rte_pci_device *pci_dev, struct idpf_adapter_ext *a\n \n \tstrncpy(adapter->name, pci_dev->device.name, PCI_PRI_STR_SIZE);\n \n+\tidpf_hw_pf_reset(hw);\n+\tret = idpf_hw_pf_reset_check(hw);\n+\tif (ret != 0) {\n+\t\tPMD_INIT_LOG(ERR, \"PF is still resetting\");\n+\t\tgoto err_reset_check;\n+\t}\n+\n+\tret = idpf_hw_mbx_init(hw, ctlq_info);\n+\tif (ret != 0) {\n+\t\tPMD_INIT_LOG(ERR, \"Failed to init mailbox\");\n+\t\tgoto err_reset_check;\n+\t}\n+\n \tret = idpf_adapter_init(base);\n \tif (ret != 0) {\n \t\tPMD_INIT_LOG(ERR, \"Failed to init adapter\");\n@@ -1175,6 +1223,8 @@ idpf_adapter_ext_init(struct rte_pci_device *pci_dev, struct idpf_adapter_ext *a\n \trte_eal_alarm_cancel(idpf_dev_alarm_handler, adapter);\n \tidpf_adapter_deinit(base);\n err_adapter_init:\n+\tidpf_hw_mbx_deinit(hw);\n+err_reset_check:\n \treturn ret;\n }\n \n@@ -1311,6 +1361,7 @@ idpf_adapter_ext_deinit(struct idpf_adapter_ext *adapter)\n {\n \trte_eal_alarm_cancel(idpf_dev_alarm_handler, adapter);\n \tidpf_adapter_deinit(&adapter->base);\n+\tidpf_hw_mbx_deinit(&adapter->base.hw);\n \n \trte_free(adapter->vports);\n \tadapter->vports = NULL;\n",
    "prefixes": []
}