get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 60315,
    "url": "http://patches.dpdk.org/api/patches/60315/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191001110209.6047-5-g.singh@nxp.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": "<20191001110209.6047-5-g.singh@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191001110209.6047-5-g.singh@nxp.com",
    "date": "2019-10-01T11:01:59",
    "name": "[v3,04/14] net/ppfe: support dynamic logging",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "6f2f0d75b2fdb61fe2badde40797fc514cd37e4e",
    "submitter": {
        "id": 1068,
        "url": "http://patches.dpdk.org/api/people/1068/?format=api",
        "name": "Gagandeep Singh",
        "email": "g.singh@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20191001110209.6047-5-g.singh@nxp.com/mbox/",
    "series": [
        {
            "id": 6647,
            "url": "http://patches.dpdk.org/api/series/6647/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6647",
            "date": "2019-10-01T11:01:55",
            "name": "introduces ppfe network PMD",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/6647/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/60315/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/60315/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 40B9A1BE3D;\n\tTue,  1 Oct 2019 13:17:35 +0200 (CEST)",
            "from inva020.nxp.com (inva020.nxp.com [92.121.34.13])\n\tby dpdk.org (Postfix) with ESMTP id 86C625B3A\n\tfor <dev@dpdk.org>; Tue,  1 Oct 2019 13:17:29 +0200 (CEST)",
            "from inva020.nxp.com (localhost [127.0.0.1])\n\tby inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 43F621A053F;\n\tTue,  1 Oct 2019 13:17:29 +0200 (CEST)",
            "from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com\n\t[165.114.16.14])\n\tby inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id DC2A81A0548;\n\tTue,  1 Oct 2019 13:17:26 +0200 (CEST)",
            "from GDB1.ap.freescale.net (GDB1.ap.freescale.net [10.232.132.179])\n\tby invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id EA16C40313;\n\tTue,  1 Oct 2019 19:17:22 +0800 (SGT)"
        ],
        "From": "Gagandeep Singh <g.singh@nxp.com>",
        "To": "dev@dpdk.org,\n\tferruh.yigit@intel.com",
        "Cc": "thomas@monjalon.net,\n\tGagandeep Singh <g.singh@nxp.com>",
        "Date": "Tue,  1 Oct 2019 16:31:59 +0530",
        "Message-Id": "<20191001110209.6047-5-g.singh@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20191001110209.6047-1-g.singh@nxp.com>",
        "References": "<20190826130246.30485-1-g.singh@nxp.com>\n\t<20191001110209.6047-1-g.singh@nxp.com>",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "Subject": "[dpdk-dev] [PATCH v3 04/14] net/ppfe: support dynamic logging",
        "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": "This patch introduces logging for the ppfe PMD.\n\nSigned-off-by: Gagandeep Singh <g.singh@nxp.com>\nAcked-by: Nipun Gupta <nipun.gupta@nxp.com>\nAcked-by: Akhil Goyal <akhil.goyal@nxp.com>\n---\n drivers/net/ppfe/pfe_logs.h    | 31 +++++++++++++++\n drivers/net/ppfe/ppfe_ethdev.c | 69 ++++++++++++++++++++++++++++------\n 2 files changed, 88 insertions(+), 12 deletions(-)\n create mode 100644 drivers/net/ppfe/pfe_logs.h",
    "diff": "diff --git a/drivers/net/ppfe/pfe_logs.h b/drivers/net/ppfe/pfe_logs.h\nnew file mode 100644\nindex 000000000..8c6499bb8\n--- /dev/null\n+++ b/drivers/net/ppfe/pfe_logs.h\n@@ -0,0 +1,31 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2019 NXP\n+ */\n+\n+#ifndef _PFE_LOGS_H_\n+#define _PFE_LOGS_H_\n+\n+extern int ppfe_logtype_pmd;\n+\n+/* PMD related logs */\n+#define PFE_PMD_LOG(level, fmt, args...) \\\n+\t rte_log(RTE_LOG_ ## level, ppfe_logtype_pmd, \"ppfe_net: %s()\" \\\n+\t\t fmt \"\\n\", __func__, ##args)\n+\n+#define PMD_INIT_FUNC_TRACE() PFE_PMD_LOG(DEBUG, \" >>\")\n+\n+#define PFE_PMD_DEBUG(fmt, args...) \\\n+\tPFE_PMD_LOG(DEBUG, fmt, ## args)\n+#define PFE_PMD_ERR(fmt, args...) \\\n+\tPFE_PMD_LOG(ERR, fmt, ## args)\n+#define PFE_PMD_INFO(fmt, args...) \\\n+\tPFE_PMD_LOG(INFO, fmt, ## args)\n+\n+#define PFE_PMD_WARN(fmt, args...) \\\n+\tPFE_PMD_LOG(WARNING, fmt, ## args)\n+\n+/* DP Logs, toggled out at compile time if level lower than current level */\n+#define PFE_DP_LOG(level, fmt, args...) \\\n+\tRTE_LOG_DP(level, PMD, fmt, ## args)\n+\n+#endif /* _PFE_LOGS_H_ */\ndiff --git a/drivers/net/ppfe/ppfe_ethdev.c b/drivers/net/ppfe/ppfe_ethdev.c\nindex 1b409a134..77e3e5c30 100644\n--- a/drivers/net/ppfe/ppfe_ethdev.c\n+++ b/drivers/net/ppfe/ppfe_ethdev.c\n@@ -7,6 +7,7 @@\n #include <rte_bus_vdev.h>\n #include <dpaa_of.h>\n \n+#include \"pfe_logs.h\"\n #include \"pfe_mod.h\"\n \n #define PPFE_MAX_MACS 1 /*we can support upto 4 MACs per IF*/\n@@ -23,20 +24,26 @@ static struct pfe *g_pfe;\n  */\n unsigned int pfe_svr = SVR_LS1012A_REV1;\n \n+int ppfe_logtype_pmd;\n+\n static void\n pfe_soc_version_get(void)\n {\n \tFILE *svr_file = NULL;\n \tunsigned int svr_ver = 0;\n \n+\tPMD_INIT_FUNC_TRACE();\n+\n \tsvr_file = fopen(PFE_SOC_ID_FILE, \"r\");\n-\tif (!svr_file)\n+\tif (!svr_file) {\n+\t\tPFE_PMD_ERR(\"Unable to open SoC device\");\n \t\treturn; /* Not supported on this infra */\n+\t}\n \n \tif (fscanf(svr_file, \"svr:%x\", &svr_ver) > 0)\n \t\tpfe_svr = svr_ver;\n \telse\n-\t\tprintf(\"Unable to read SoC device\");\n+\t\tPFE_PMD_ERR(\"Unable to read SoC device\");\n \n \tfclose(svr_file);\n }\n@@ -51,6 +58,9 @@ pfe_eth_open_cdev(struct pfe_eth_priv_s *priv)\n \n \tpfe_cdev_fd = open(PFE_CDEV_PATH, O_RDONLY);\n \tif (pfe_cdev_fd < 0) {\n+\t\tPFE_PMD_WARN(\"Unable to open PFE device file (%s).\\n\",\n+\t\t\t     PFE_CDEV_PATH);\n+\t\tPFE_PMD_WARN(\"Link status update will not be available.\\n\");\n \t\tpriv->link_fd = PFE_CDEV_INVALID_FD;\n \t\treturn -1;\n \t}\n@@ -75,6 +85,8 @@ pfe_eth_close_cdev(struct pfe_eth_priv_s *priv)\n static void\n pfe_eth_exit(struct rte_eth_dev *dev, struct pfe *pfe)\n {\n+\tPMD_INIT_FUNC_TRACE();\n+\n \t/* Close the device file for link status */\n \tpfe_eth_close_cdev(dev->data->dev_private);\n \n@@ -110,6 +122,8 @@ pfe_eth_init(struct rte_vdev_device *vdev, struct pfe *pfe, int id)\n \teth_dev->data->mac_addrs = rte_zmalloc(\"mac_addr\",\n \t\t\tETHER_ADDR_LEN * PPFE_MAX_MACS, 0);\n \tif (eth_dev->data->mac_addrs == NULL) {\n+\t\tPFE_PMD_ERR(\"Failed to allocate mem %d to store MAC addresses\",\n+\t\t\tETHER_ADDR_LEN * PPFE_MAX_MACS);\n \t\terr = -ENOMEM;\n \t\tgoto err0;\n \t}\n@@ -142,8 +156,10 @@ parse_integer_arg(const char *key __rte_unused,\n \terrno = 0;\n \n \ti = strtol(value, &end, 10);\n-\tif (*end != 0 || errno != 0 || i < 0 || i > 1)\n+\tif (*end != 0 || errno != 0 || i < 0 || i > 1) {\n+\t\tPFE_PMD_ERR(\"Supported Port IDS are 0 and 1\");\n \t\treturn -EINVAL;\n+\t}\n \n \t*((uint32_t *)extra_args) = i;\n \n@@ -199,10 +215,15 @@ pmd_pfe_probe(struct rte_vdev_device *vdev)\n \tif (rc < 0)\n \t\treturn -EINVAL;\n \n+\tRTE_LOG(INFO, PMD, \"Initializing pmd_pfe for %s Given gem-id %d\\n\",\n+\t\tname, init_params.gem_id);\n+\n \tif (g_pfe) {\n-\t\tif (g_pfe->nb_devs >= g_pfe->max_intf)\n+\t\tif (g_pfe->nb_devs >= g_pfe->max_intf) {\n+\t\t\tPFE_PMD_ERR(\"PPFE %d dev already created Max is %d\",\n+\t\t\t\tg_pfe->nb_devs, g_pfe->max_intf);\n \t\t\treturn -EINVAL;\n-\n+\t\t}\n \t\tgoto eth_init;\n \t}\n \n@@ -212,31 +233,40 @@ pmd_pfe_probe(struct rte_vdev_device *vdev)\n \n \t/* Load the device-tree driver */\n \trc = of_init();\n-\tif (rc)\n+\tif (rc) {\n+\t\tPFE_PMD_ERR(\"of_init failed with ret: %d\", rc);\n \t\tgoto err;\n+\t}\n \n \tnp = of_find_compatible_node(NULL, NULL, \"fsl,pfe\");\n \tif (!np) {\n+\t\tPFE_PMD_ERR(\"Invalid device node\");\n \t\trc = -EINVAL;\n \t\tgoto err;\n \t}\n \n \taddr = of_get_address(np, 0, &cbus_size, NULL);\n-\tif (!addr)\n+\tif (!addr) {\n+\t\tPFE_PMD_ERR(\"of_get_address cannot return qman address\\n\");\n \t\tgoto err;\n-\n+\t}\n \tcbus_addr = of_translate_address(np, addr);\n-\tif (!cbus_addr)\n+\tif (!cbus_addr) {\n+\t\tPFE_PMD_ERR(\"of_translate_address failed\\n\");\n \t\tgoto err;\n-\n+\t}\n \n \taddr = of_get_address(np, 1, &ddr_size, NULL);\n-\tif (!addr)\n+\tif (!addr) {\n+\t\tPFE_PMD_ERR(\"of_get_address cannot return qman address\\n\");\n \t\tgoto err;\n+\t}\n \n \tg_pfe->ddr_phys_baseaddr = of_translate_address(np, addr);\n-\tif (!g_pfe->ddr_phys_baseaddr)\n+\tif (!g_pfe->ddr_phys_baseaddr) {\n+\t\tPFE_PMD_ERR(\"of_translate_address failed\\n\");\n \t\tgoto err;\n+\t}\n \n \tg_pfe->ddr_size = ddr_size;\n \tg_pfe->cbus_size = cbus_size;\n@@ -246,6 +276,7 @@ pmd_pfe_probe(struct rte_vdev_device *vdev)\n \t\t\t\t\tMAP_SHARED, fd, cbus_addr);\n \tclose(fd);\n \tif (g_pfe->cbus_baseaddr == MAP_FAILED) {\n+\t\tPFE_PMD_ERR(\"Can not map cbus base\");\n \t\trc = -EINVAL;\n \t\tgoto err;\n \t}\n@@ -253,15 +284,20 @@ pmd_pfe_probe(struct rte_vdev_device *vdev)\n \t/* Read interface count */\n \tprop = of_get_property(np, \"fsl,pfe-num-interfaces\", &size);\n \tif (!prop) {\n+\t\tPFE_PMD_ERR(\"Failed to read number of interfaces\");\n \t\trc = -ENXIO;\n \t\tgoto err_prop;\n \t}\n \n \tinterface_count = rte_be_to_cpu_32((unsigned int)*prop);\n \tif (interface_count <= 0) {\n+\t\tPFE_PMD_ERR(\"No ethernet interface count : %d\",\n+\t\t\t\tinterface_count);\n \t\trc = -ENXIO;\n \t\tgoto err_prop;\n \t}\n+\tPFE_PMD_INFO(\"num interfaces = %d \", interface_count);\n+\n \tg_pfe->max_intf  = interface_count;\n \tpfe_soc_version_get();\n eth_init:\n@@ -299,6 +335,8 @@ pmd_pfe_remove(struct rte_vdev_device *vdev)\n \tif (name == NULL)\n \t\treturn -EINVAL;\n \n+\tPFE_PMD_INFO(\"Closing eventdev sw device %s\", name);\n+\n \tif (!g_pfe)\n \t\treturn 0;\n \n@@ -320,3 +358,10 @@ struct rte_vdev_driver pmd_pfe_drv = {\n \n RTE_PMD_REGISTER_VDEV(PFE_NAME_PMD, pmd_pfe_drv);\n RTE_PMD_REGISTER_PARAM_STRING(PFE_NAME_PMD, PPFE_VDEV_GEM_ID_ARG \"=<int> \");\n+\n+RTE_INIT(ppfe_pmd_init_log)\n+{\n+\tppfe_logtype_pmd = rte_log_register(\"pmd.net.ppfe\");\n+\tif (ppfe_logtype_pmd >= 0)\n+\t\trte_log_set_level(ppfe_logtype_pmd, RTE_LOG_NOTICE);\n+}\n",
    "prefixes": [
        "v3",
        "04/14"
    ]
}