get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 49291,
    "url": "http://patchwork.dpdk.org/api/patches/49291/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20181227062233.30781-4-hemant.agrawal@nxp.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": "<20181227062233.30781-4-hemant.agrawal@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20181227062233.30781-4-hemant.agrawal@nxp.com",
    "date": "2018-12-27T06:22:55",
    "name": "[03/20] bus/fslmc: fix to use correct physical core for logical core",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "e320988b47f7566e872ecab77f94e1e1073b8a8e",
    "submitter": {
        "id": 477,
        "url": "http://patchwork.dpdk.org/api/people/477/?format=api",
        "name": "Hemant Agrawal",
        "email": "hemant.agrawal@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20181227062233.30781-4-hemant.agrawal@nxp.com/mbox/",
    "series": [
        {
            "id": 2954,
            "url": "http://patchwork.dpdk.org/api/series/2954/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=2954",
            "date": "2018-12-27T06:22:50",
            "name": "NXP DPAA2 fixes and enhancements",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/2954/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/49291/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/49291/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 4ACEE4C99;\n\tThu, 27 Dec 2018 07:23:00 +0100 (CET)",
            "from EUR01-VE1-obe.outbound.protection.outlook.com\n\t(mail-eopbgr140058.outbound.protection.outlook.com [40.107.14.58])\n\tby dpdk.org (Postfix) with ESMTP id 030E54C6C;\n\tThu, 27 Dec 2018 07:22:57 +0100 (CET)",
            "from VI1PR0401MB2541.eurprd04.prod.outlook.com (10.168.65.19) by\n\tVI1PR0401MB2382.eurprd04.prod.outlook.com (10.169.134.11) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\t15.20.1471.20; Thu, 27 Dec 2018 06:22:55 +0000",
            "from VI1PR0401MB2541.eurprd04.prod.outlook.com\n\t([fe80::555e:164:f8f0:dbb4]) by\n\tVI1PR0401MB2541.eurprd04.prod.outlook.com\n\t([fe80::555e:164:f8f0:dbb4%2]) with mapi id 15.20.1471.019;\n\tThu, 27 Dec 2018 06:22:55 +0000"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=KB6Z6l9znzTi2fMkUHnDMQSkuZ0Jvn5aDoH89/6zV4g=;\n\tb=drak5m5YGjd6sRIw9r8kCBtv2f9VSoqO7uV26aksodtf2LIkbL8KpoFOdcc2o0W0+frUyExizpWt0MPG8xmz/1DlynmKMu88//oORFVJbT4dcL9g5QwOsRNEp1p4YAu0KWqYmfhXCmZoJlDtjyZ4tL90Qss6CUV8CWdWZAhINkA=",
        "From": "Hemant Agrawal <hemant.agrawal@nxp.com>",
        "To": "\"dev@dpdk.org\" <dev@dpdk.org>",
        "CC": "\"ferruh.yigit@intel.com\" <ferruh.yigit@intel.com>, Shreyansh Jain\n\t<shreyansh.jain@nxp.com>, \"stable@dpdk.org\" <stable@dpdk.org>",
        "Thread-Topic": "[PATCH 03/20] bus/fslmc: fix to use correct physical core for\n\tlogical core",
        "Thread-Index": "AQHUnaya6tXM27Eib0evvOZM5Aq7IA==",
        "Date": "Thu, 27 Dec 2018 06:22:55 +0000",
        "Message-ID": "<20181227062233.30781-4-hemant.agrawal@nxp.com>",
        "References": "<20181227062233.30781-1-hemant.agrawal@nxp.com>",
        "In-Reply-To": "<20181227062233.30781-1-hemant.agrawal@nxp.com>",
        "Accept-Language": "en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "x-originating-ip": "[14.143.30.134]",
        "x-mailer": "git-send-email 2.17.1",
        "x-clientproxiedby": "BM1PR01CA0120.INDPRD01.PROD.OUTLOOK.COM\n\t(2603:1096:b00:40::14) To VI1PR0401MB2541.eurprd04.prod.outlook.com\n\t(2603:10a6:800:56::19)",
        "authentication-results": "spf=none (sender IP is )\n\tsmtp.mailfrom=hemant.agrawal@nxp.com; ",
        "x-ms-exchange-messagesentrepresentingtype": "1",
        "x-ms-publictraffictype": "Email",
        "x-microsoft-exchange-diagnostics": "1; VI1PR0401MB2382;\n\t6:eSbNQzB8YSPJfVQ1YaMwLK9qu2kf+TUx6ZbJzurfD/N71e/C8eITGL/szMU4ypST67xLC+jvLml8rJlqmvJcFco+DleZz7euxKrZ7ZlnbfVNaPCQJL7F4+TVx6yTA6kjIrFKaO6oJFK76AqONvxaXnMuG9vIkgzFTVP3U6qe2aui2zA/hDONV4xq9gStO07EDec2N2i/z/6GtQScy6yNNAILhF8pcDFckOhZCBQ8Hp6RbweqftcXXBhk9TSysyQv+BMayo3PIlJL8a1eUinzZ0gzllQhHRyXl+wNa5OxWrlW2asztiYdHd9Bk9dunIeH56cDRRHTdQTuEVEZrINnbGW18Kp407JpSoSoRNbS7C4iGIMntHOqncH54Xm79rwNPc7GZtR/pGdzn4khDLwICEMPEbogABY8bZaKtWF3vyM2XGp7ExYFaa2dNVKNZj5YxnR8rGu+ukKDHB3DZMvRXw==;\n\t5:fHIf3GG8mKOdX9MootC3Hx/lDyCOOcMG/sDEAHRhigyYyGvZ3OMmgSgGIZJT9HYRbYVHTKCeTn9KHZnWITwrMKybnNv9A5sW/174mB/OYiF84+2byNVIdNRGQYpKoXt+bzRpsLETMUVy4Zo0dwxwKD4dsHbk62pduo3SUAcRK/g=;\n\t7:IykoCms8KQEltY56zw1JfsI6+ukgoPHK4+0Vfxs8McGxDUDgAZFBcE9yfYgjYz/fXpk9UhSqb6TUlfBxBXyheISv3bJOB3x7Tll+Z0aHvPRH9ib2k1kQH5Hg3ecbTZjxNvEsysh/ByFD/Pdru0Cgzw==",
        "x-ms-office365-filtering-correlation-id": "97a621da-399c-4dad-ac96-08d66bc3bd0b",
        "x-ms-office365-filtering-ht": "Tenant",
        "x-microsoft-antispam": "BCL:0; PCL:0;\n\tRULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);\n\tSRVR:VI1PR0401MB2382; ",
        "x-ms-traffictypediagnostic": "VI1PR0401MB2382:",
        "x-microsoft-antispam-prvs": "<VI1PR0401MB238289FCE69574787590BC2089B60@VI1PR0401MB2382.eurprd04.prod.outlook.com>",
        "x-exchange-antispam-report-cfa-test": "BCL:0; PCL:0;\n\tRULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095);\n\tSRVR:VI1PR0401MB2382; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0401MB2382; ",
        "x-forefront-prvs": "0899B47777",
        "x-forefront-antispam-report": "SFV:NSPM;\n\tSFS:(10009020)(136003)(396003)(366004)(376002)(39860400002)(346002)(199004)(189003)(5660300001)(1076003)(26005)(76176011)(186003)(71200400001)(256004)(25786009)(105586002)(4326008)(6436002)(305945005)(11346002)(106356001)(446003)(44832011)(476003)(7736002)(55236004)(102836004)(78486014)(486006)(386003)(68736007)(52116002)(86362001)(6506007)(2616005)(71190400001)(66066001)(316002)(54906003)(6116002)(3846002)(2906002)(14454004)(36756003)(99286004)(50226002)(8936002)(1730700003)(81156014)(81166006)(8676002)(6512007)(53936002)(478600001)(97736004)(6486002)(6916009)(5640700003)(2351001)(2501003);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0401MB2382;\n\tH:VI1PR0401MB2541.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; \n\tPTR:InfoNoRecords; A:1; MX:1; ",
        "received-spf": "None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)",
        "x-ms-exchange-senderadcheck": "1",
        "x-microsoft-antispam-message-info": "s/H+tZAii537c26GTGS1NbjybhbdulP0TXpQKua/LF6UgkuI7tCARWmcyzjnAEeg7i72f+bJg6SYOBlJOBF/Vzi2X4rUpxgsyHuBJBEbGA3QBeZH4S3eCR8qH5dUvFWeyBgYlYjQArhAj99nPCHemJVQNt2WAdlfcP6mpF8b2bIcRzk+TpjcNqhWcuvpPo+/hWYiqFBUZYZ2qPs+OC0by/5pbPJi3Y1vMD9fjPuPs2LV8QIMXd9S2JkVuw4EbjMAqloRW326Ej9TCJhp2PWNQ6VYtHz1GuOfZFd+dN9tF9ZHTSg8rK/0O+05k5iXAxS/",
        "spamdiagnosticoutput": "1:99",
        "spamdiagnosticmetadata": "NSPM",
        "Content-Type": "text/plain; charset=\"iso-8859-1\"",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "X-OriginatorOrg": "nxp.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "97a621da-399c-4dad-ac96-08d66bc3bd0b",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "27 Dec 2018 06:22:55.8019\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted",
        "X-MS-Exchange-CrossTenant-id": "686ea1d3-bc2b-4c6f-a92c-d99c5c301635",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "VI1PR0401MB2382",
        "Subject": "[dpdk-dev] [PATCH 03/20] bus/fslmc: fix to use correct physical\n\tcore for logical core",
        "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": "Existing code is using the lcore id as the physical core\nid. Add code to get the right physical id.\n\nAlso, dpaa2 can not support one lcore mapping to multiple cpus,\nprint err on such cases.\n\nFixes: ce9efbf5bb09 (\"bus/fslmc: support dynamic logging\")\nCc: stable@dpdk.org\n\nSigned-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 76 ++++++++++++++++++++----\n 1 file changed, 63 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c\nindex 4fc6efec5..ba2e28ce1 100644\n--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c\n+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c\n@@ -53,6 +53,10 @@ static uint32_t io_space_count;\n /* Variable to store DPAA2 platform type */\n uint32_t dpaa2_svr_family;\n \n+/* Physical core id for lcores running on dpaa2. */\n+/* DPAA2 only support 1 lcore to 1 phy cpu mapping */\n+static unsigned int dpaa2_cpu[RTE_MAX_LCORE];\n+\n /* Variable to store DPAA2 DQRR size */\n uint8_t dpaa2_dqrr_size;\n /* Variable to store DPAA2 EQCR size */\n@@ -92,7 +96,8 @@ dpaa2_core_cluster_sdest(int cpu_id)\n }\n \n #ifdef RTE_LIBRTE_PMD_DPAA2_EVENTDEV\n-static void dpaa2_affine_dpio_intr_to_respective_core(int32_t dpio_id)\n+static void\n+dpaa2_affine_dpio_intr_to_respective_core(int32_t dpio_id, int lcoreid)\n {\n #define STRING_LEN\t28\n #define COMMAND_LEN\t50\n@@ -125,7 +130,7 @@ static void dpaa2_affine_dpio_intr_to_respective_core(int32_t dpio_id)\n \t\treturn;\n \t}\n \n-\tcpu_mask = cpu_mask << rte_lcore_id();\n+\tcpu_mask = cpu_mask << dpaa2_cpu[lcoreid];\n \tsnprintf(command, COMMAND_LEN, \"echo %X > /proc/irq/%s/smp_affinity\",\n \t\t cpu_mask, token);\n \tret = system(command);\n@@ -139,7 +144,7 @@ static void dpaa2_affine_dpio_intr_to_respective_core(int32_t dpio_id)\n \tfclose(file);\n }\n \n-static int dpaa2_dpio_intr_init(struct dpaa2_dpio_dev *dpio_dev)\n+static int dpaa2_dpio_intr_init(struct dpaa2_dpio_dev *dpio_dev, int lcoreid)\n {\n \tstruct epoll_event epoll_ev;\n \tint eventfd, dpio_epoll_fd, ret;\n@@ -176,32 +181,36 @@ static int dpaa2_dpio_intr_init(struct dpaa2_dpio_dev *dpio_dev)\n \t}\n \tdpio_dev->epoll_fd = dpio_epoll_fd;\n \n-\tdpaa2_affine_dpio_intr_to_respective_core(dpio_dev->hw_id);\n+\tdpaa2_affine_dpio_intr_to_respective_core(dpio_dev->hw_id, lcoreid);\n \n \treturn 0;\n }\n #endif\n \n static int\n-dpaa2_configure_stashing(struct dpaa2_dpio_dev *dpio_dev, int cpu_id)\n+dpaa2_configure_stashing(struct dpaa2_dpio_dev *dpio_dev, int lcoreid)\n {\n \tint sdest, ret;\n+\tint cpu_id;\n \n \t/* Set the Stashing Destination */\n-\tif (cpu_id < 0) {\n-\t\tcpu_id = rte_get_master_lcore();\n-\t\tif (cpu_id < 0) {\n+\tif (lcoreid < 0) {\n+\t\tlcoreid = rte_get_master_lcore();\n+\t\tif (lcoreid < 0) {\n \t\t\tDPAA2_BUS_ERR(\"Getting CPU Index failed\");\n \t\t\treturn -1;\n \t\t}\n \t}\n+\n+\tcpu_id = dpaa2_cpu[lcoreid];\n+\n \t/* Set the STASH Destination depending on Current CPU ID.\n \t * Valid values of SDEST are 4,5,6,7. Where,\n \t */\n \n \tsdest = dpaa2_core_cluster_sdest(cpu_id);\n-\tDPAA2_BUS_DEBUG(\"Portal= %d  CPU= %u SDEST= %d\",\n-\t\t\tdpio_dev->index, cpu_id, sdest);\n+\tDPAA2_BUS_DEBUG(\"Portal= %d  CPU= %u lcore id =%u SDEST= %d\",\n+\t\t\tdpio_dev->index, cpu_id, lcoreid, sdest);\n \n \tret = dpio_set_stashing_destination(dpio_dev->dpio, CMD_PRI_LOW,\n \t\t\t\t\t    dpio_dev->token, sdest);\n@@ -211,7 +220,7 @@ dpaa2_configure_stashing(struct dpaa2_dpio_dev *dpio_dev, int cpu_id)\n \t}\n \n #ifdef RTE_LIBRTE_PMD_DPAA2_EVENTDEV\n-\tif (dpaa2_dpio_intr_init(dpio_dev)) {\n+\tif (dpaa2_dpio_intr_init(dpio_dev, lcoreid)) {\n \t\tDPAA2_BUS_ERR(\"Interrupt registration failed for dpio\");\n \t\treturn -1;\n \t}\n@@ -220,7 +229,7 @@ dpaa2_configure_stashing(struct dpaa2_dpio_dev *dpio_dev, int cpu_id)\n \treturn 0;\n }\n \n-struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int cpu_id)\n+struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int lcoreid)\n {\n \tstruct dpaa2_dpio_dev *dpio_dev = NULL;\n \tint ret;\n@@ -236,7 +245,7 @@ struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int cpu_id)\n \tDPAA2_BUS_DEBUG(\"New Portal %p (%d) affined thread - %lu\",\n \t\t\tdpio_dev, dpio_dev->index, syscall(SYS_gettid));\n \n-\tret = dpaa2_configure_stashing(dpio_dev, cpu_id);\n+\tret = dpaa2_configure_stashing(dpio_dev, lcoreid);\n \tif (ret)\n \t\tDPAA2_BUS_ERR(\"dpaa2_configure_stashing failed\");\n \n@@ -340,6 +349,39 @@ dpaa2_affine_qbman_ethrx_swp(void)\n \t}\n }\n \n+/*\n+ * This checks for not supported lcore mappings as well as get the physical\n+ * cpuid for the lcore.\n+ * one lcore can only map to 1 cpu i.e. 1@10-14 not supported.\n+ * one cpu can be mapped to more than one lcores.\n+ */\n+static int\n+dpaa2_check_lcore_cpuset(void)\n+{\n+\tunsigned int lcore_id, i;\n+\tint ret = 0;\n+\n+\tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++)\n+\t\tdpaa2_cpu[lcore_id] = 0xffffffff;\n+\n+\tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {\n+\t\tfor (i = 0; i < RTE_MAX_LCORE; i++) {\n+\t\t\tif (CPU_ISSET(i, &lcore_config[lcore_id].cpuset)) {\n+\t\t\t\tRTE_LOG(DEBUG, EAL, \"lcore id = %u cpu=%u\\n\",\n+\t\t\t\t\tlcore_id, i);\n+\t\t\t\tif (dpaa2_cpu[lcore_id] != 0xffffffff) {\n+\t\t\t\t\tDPAA2_BUS_ERR(\n+\t\t\t\t    \"ERR:lcore map to multi-cpu not supported\");\n+\t\t\t\t\tret = -1;\n+\t\t\t\t} else  {\n+\t\t\t\t\tdpaa2_cpu[lcore_id] = i;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t}\n+\treturn ret;\n+}\n+\n static int\n dpaa2_create_dpio_device(int vdev_fd,\n \t\t\t struct vfio_device_info *obj_info,\n@@ -349,6 +391,7 @@ dpaa2_create_dpio_device(int vdev_fd,\n \tstruct vfio_region_info reg_info = { .argsz = sizeof(reg_info)};\n \tstruct qbman_swp_desc p_des;\n \tstruct dpio_attr attr;\n+\tstatic int check_lcore_cpuset;\n \n \tif (obj_info->num_regions < NUM_DPIO_REGIONS) {\n \t\tDPAA2_BUS_ERR(\"Not sufficient number of DPIO regions\");\n@@ -368,6 +411,13 @@ dpaa2_create_dpio_device(int vdev_fd,\n \t/* Using single portal  for all devices */\n \tdpio_dev->mc_portal = rte_mcp_ptr_list[MC_PORTAL_INDEX];\n \n+\tif (!check_lcore_cpuset) {\n+\t\tcheck_lcore_cpuset = 1;\n+\n+\t\tif (dpaa2_check_lcore_cpuset() < 0)\n+\t\t\tgoto err;\n+\t}\n+\n \tdpio_dev->dpio = malloc(sizeof(struct fsl_mc_io));\n \tmemset(dpio_dev->dpio, 0, sizeof(struct fsl_mc_io));\n \n",
    "prefixes": [
        "03/20"
    ]
}