Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/75901/?format=api
http://patches.dpdk.org/api/patches/75901/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200825093116.26538-2-ophirmu@nvidia.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": "<20200825093116.26538-2-ophirmu@nvidia.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200825093116.26538-2-ophirmu@nvidia.com", "date": "2020-08-25T09:31:04", "name": "[v2,01/13] common/mlx5: replace strsep with strtok_r", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "c09d4db77dc6296ba0170540d862c82076f57e51", "submitter": { "id": 1908, "url": "http://patches.dpdk.org/api/people/1908/?format=api", "name": "Ophir Munk", "email": "ophirmu@nvidia.com" }, "delegate": { "id": 3268, "url": "http://patches.dpdk.org/api/users/3268/?format=api", "username": "rasland", "first_name": "Raslan", "last_name": "Darawsheh", "email": "rasland@nvidia.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200825093116.26538-2-ophirmu@nvidia.com/mbox/", "series": [ { "id": 11773, "url": "http://patches.dpdk.org/api/series/11773/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11773", "date": "2020-08-25T09:31:06", "name": "mlx5 PMD multi OS support - part #4", "version": 2, "mbox": "http://patches.dpdk.org/series/11773/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/75901/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/75901/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C8879A04B1;\n\tTue, 25 Aug 2020 11:31:56 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3D2AD1C1C2;\n\tTue, 25 Aug 2020 11:31:35 +0200 (CEST)", "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 94D18255\n for <dev@dpdk.org>; Tue, 25 Aug 2020 11:31:29 +0200 (CEST)", "from Internal Mail-Server by MTLPINE1 (envelope-from\n ophirmu@nvidia.com) with SMTP; 25 Aug 2020 12:31:25 +0300", "from nvidia.com (pegasus05.mtr.labs.mlnx [10.210.16.100])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 07P9VPMp030009;\n Tue, 25 Aug 2020 12:31:25 +0300" ], "From": "Ophir Munk <ophirmu@nvidia.com>", "To": "dev@dpdk.org", "Cc": "Ophir Munk <ophirmu@mellanox.com>", "Date": "Tue, 25 Aug 2020 09:31:04 +0000", "Message-Id": "<20200825093116.26538-2-ophirmu@nvidia.com>", "X-Mailer": "git-send-email 2.8.4", "In-Reply-To": "<20200825093116.26538-1-ophirmu@nvidia.com>", "References": "<20200820145028.4090-1-ophirmu@nvidia.com>\n <20200825093116.26538-1-ophirmu@nvidia.com>", "Subject": "[dpdk-dev] [PATCH v2 01/13] common/mlx5: replace strsep with\n\tstrtok_r", "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 <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", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "From: Ophir Munk <ophirmu@mellanox.com>\n\nstrsep() is a non-standardized API (by C or POSIX) and thus it is\nnon-portable between different operating systems. Replace it with\nstrtok_r() which is standardized by the C standard, and hence also by\nPOSIX.\nThe replacement occurs in the code that extracts individual PCI class\nnames (e.g. class=net:vdpa:foo:bar).\n\nSigned-off-by: Ophir Munk <ophirmu@mellanox.com>\nAcked-by: Matan Azrad <matan@mellanox.com>\n---\n drivers/common/mlx5/mlx5_common_pci.c | 14 ++++++++------\n 1 file changed, 8 insertions(+), 6 deletions(-)", "diff": "diff --git a/drivers/common/mlx5/mlx5_common_pci.c b/drivers/common/mlx5/mlx5_common_pci.c\nindex d4ff039..02417c6 100644\n--- a/drivers/common/mlx5/mlx5_common_pci.c\n+++ b/drivers/common/mlx5/mlx5_common_pci.c\n@@ -72,6 +72,7 @@ bus_cmdline_options_handler(__rte_unused const char *key,\n \tint class_val;\n \tchar *found;\n \tchar *nstr;\n+\tchar *refstr = NULL;\n \n \t*ret = 0;\n \tnstr = strdup(class_names);\n@@ -80,21 +81,22 @@ bus_cmdline_options_handler(__rte_unused const char *key,\n \t\treturn *ret;\n \t}\n \tnstr_org = nstr;\n-\twhile (nstr) {\n+\tfound = strtok_r(nstr, \":\", &refstr);\n+\tif (!found)\n+\t\tgoto err;\n+\tdo {\n \t\t/* Extract each individual class name. Multiple\n \t\t * class key,value is supplied as class=net:vdpa:foo:bar.\n \t\t */\n-\t\tfound = strsep(&nstr, \":\");\n-\t\tif (!found)\n-\t\t\tcontinue;\n-\t\t/* Check if its a valid class. */\n \t\tclass_val = class_name_to_value(found);\n+\t\t/* Check if its a valid class. */\n \t\tif (class_val < 0) {\n \t\t\t*ret = -EINVAL;\n \t\t\tgoto err;\n \t\t}\n \t\t*ret |= class_val;\n-\t}\n+\t\tfound = strtok_r(NULL, \":\", &refstr);\n+\t} while (found);\n err:\n \tfree(nstr_org);\n \tif (*ret < 0)\n", "prefixes": [ "v2", "01/13" ] }{ "id": 75901, "url": "