get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 50469,
    "url": "http://patches.dpdk.org/api/patches/50469/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/07f664c33ddedaa5dcfe82ecb97d931e68b7e33a.1550855529.git.anatoly.burakov@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": "<07f664c33ddedaa5dcfe82ecb97d931e68b7e33a.1550855529.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/07f664c33ddedaa5dcfe82ecb97d931e68b7e33a.1550855529.git.anatoly.burakov@intel.com",
    "date": "2019-02-22T17:12:41",
    "name": "eal: add option to not store segment fd's",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "32801add0b5864bc0706d03eeac46abe2ab7f4d4",
    "submitter": {
        "id": 4,
        "url": "http://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/07f664c33ddedaa5dcfe82ecb97d931e68b7e33a.1550855529.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 3522,
            "url": "http://patches.dpdk.org/api/series/3522/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3522",
            "date": "2019-02-22T17:12:41",
            "name": "eal: add option to not store segment fd's",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/3522/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/50469/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/50469/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 418022BE9;\n\tFri, 22 Feb 2019 18:12:47 +0100 (CET)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id E01D42BE5\n\tfor <dev@dpdk.org>; Fri, 22 Feb 2019 18:12:44 +0100 (CET)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t22 Feb 2019 09:12:43 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga001.jf.intel.com with ESMTP; 22 Feb 2019 09:12:42 -0800",
            "from sivswdev05.ir.intel.com (sivswdev05.ir.intel.com\n\t[10.243.17.64])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tx1MHCfql015820; Fri, 22 Feb 2019 17:12:41 GMT",
            "from sivswdev05.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev05.ir.intel.com with ESMTP id x1MHCf6U006396;\n\tFri, 22 Feb 2019 17:12:41 GMT",
            "(from aburakov@localhost)\n\tby sivswdev05.ir.intel.com with LOCAL id x1MHCfPU006223;\n\tFri, 22 Feb 2019 17:12:41 GMT"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.58,400,1544515200\"; d=\"scan'208\";a=\"140822149\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "John McNamara <john.mcnamara@intel.com>,\n\tMarko Kovacevic <marko.kovacevic@intel.com>, iain.barker@oracle.com, \n\tedwin.leung@oracle.com",
        "Date": "Fri, 22 Feb 2019 17:12:41 +0000",
        "Message-Id": "<07f664c33ddedaa5dcfe82ecb97d931e68b7e33a.1550855529.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Subject": "[dpdk-dev] [PATCH] eal: add option to not store segment fd's",
        "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": "Due to internal glibc limitations [1], DPDK may exhaust internal\nfile descriptor limits when using smaller page sizes, which results\nin inability to use system calls such as select() by user\napplications.\n\nWhile the problem can be worked around using --single-file-segments\noption, it does not work if --legacy-mem mode is also used. Add a\n(yet another) EAL flag to disable storing fd's internally. This\nwill sacrifice compability with Virtio with vhost-backend, but\nat least select() and friends will work.\n\n[1] https://mails.dpdk.org/archives/dev/2019-February/124386.html\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n doc/guides/linux_gsg/linux_eal_parameters.rst |  4 ++++\n .../prog_guide/env_abstraction_layer.rst      | 19 +++++++++++++++++++\n lib/librte_eal/common/eal_internal_cfg.h      |  4 ++++\n lib/librte_eal/common/eal_options.h           |  2 ++\n lib/librte_eal/linuxapp/eal/eal.c             |  4 ++++\n lib/librte_eal/linuxapp/eal/eal_memalloc.c    | 19 ++++++++++++++++++-\n 6 files changed, 51 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/doc/guides/linux_gsg/linux_eal_parameters.rst b/doc/guides/linux_gsg/linux_eal_parameters.rst\nindex c63f0f49a..d50a7067e 100644\n--- a/doc/guides/linux_gsg/linux_eal_parameters.rst\n+++ b/doc/guides/linux_gsg/linux_eal_parameters.rst\n@@ -94,6 +94,10 @@ Memory-related options\n \n     Free hugepages back to system exactly as they were originally allocated.\n \n+*   ``--no-seg-fds``\n+\n+    Do not store segment file descriptors in EAL.\n+\n Other options\n ~~~~~~~~~~~~~\n \ndiff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst\nindex 929d76dba..ad540f158 100644\n--- a/doc/guides/prog_guide/env_abstraction_layer.rst\n+++ b/doc/guides/prog_guide/env_abstraction_layer.rst\n@@ -214,6 +214,25 @@ Normally, these options do not need to be changed.\n     can later be mapped into that preallocated VA space (if dynamic memory mode\n     is enabled), and can optionally be mapped into it at startup.\n \n++ Segment file descriptors\n+\n+On Linux, in most cases, EAL will store segment file descriptors in EAL. This\n+can become a problem when using smaller page sizes due to underlying limitations\n+of ``glibc`` library. For example, Linux API calls such as ``select()`` may not\n+work correctly because ``glibc`` does not support more than certain number of\n+file descriptors.\n+\n+There are several possible workarounds for this issue. One is to use\n+``--single-file-segments`` mode, as that mode will not use a file descriptor per\n+each page. This is the recommended way of solving this issue, as it keeps\n+compatibility with Virtio with vhost-user backend. This option is not available\n+when using ``--legacy-mem`` mode.\n+\n+The other option is to use ``--no-seg-fds`` command-line parameter,\n+to prevent EAL from storing any page file descriptors. This will break\n+compatibility with Virtio with vhost-user backend, but this option will work\n+with ``--legacy-mem`` mode.\n+\n Support for Externally Allocated Memory\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n \ndiff --git a/lib/librte_eal/common/eal_internal_cfg.h b/lib/librte_eal/common/eal_internal_cfg.h\nindex 60eaead8f..96596c6b6 100644\n--- a/lib/librte_eal/common/eal_internal_cfg.h\n+++ b/lib/librte_eal/common/eal_internal_cfg.h\n@@ -63,6 +63,10 @@ struct internal_config {\n \t/**< true if storing all pages within single files (per-page-size,\n \t * per-node) non-legacy mode only.\n \t */\n+\tvolatile unsigned no_seg_fds;\n+\t/**< true if no segment file descriptors are to be stored internally\n+\t * by EAL.\n+\t */\n \tvolatile int syslog_facility;\t  /**< facility passed to openlog() */\n \t/** default interrupt mode for VFIO */\n \tvolatile enum rte_intr_mode vfio_intr_mode;\ndiff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h\nindex 58ee9ae33..94e39aed8 100644\n--- a/lib/librte_eal/common/eal_options.h\n+++ b/lib/librte_eal/common/eal_options.h\n@@ -67,6 +67,8 @@ enum {\n \tOPT_IOVA_MODE_NUM,\n #define OPT_MATCH_ALLOCATIONS  \"match-allocations\"\n \tOPT_MATCH_ALLOCATIONS_NUM,\n+#define OPT_NO_SEG_FDS         \"no-seg-fds\"\n+\tOPT_NO_SEG_FDS_NUM,\n \tOPT_LONG_MAX_NUM\n };\n \ndiff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c\nindex 13f401684..e8a98c505 100644\n--- a/lib/librte_eal/linuxapp/eal/eal.c\n+++ b/lib/librte_eal/linuxapp/eal/eal.c\n@@ -519,6 +519,7 @@ eal_usage(const char *prgname)\n \t       \"  --\"OPT_LEGACY_MEM\"        Legacy memory mode (no dynamic allocation, contiguous segments)\\n\"\n \t       \"  --\"OPT_SINGLE_FILE_SEGMENTS\" Put all hugepage memory in single files\\n\"\n \t       \"  --\"OPT_MATCH_ALLOCATIONS\" Free hugepages exactly as allocated\\n\"\n+\t       \"  --\"OPT_NO_SEG_FDS\"        Do not store segment file descriptors in EAL\\n\"\n \t       \"\\n\");\n \t/* Allow the application to print its usage message too if hook is set */\n \tif ( rte_application_usage_hook ) {\n@@ -815,6 +816,9 @@ eal_parse_args(int argc, char **argv)\n \t\tcase OPT_MATCH_ALLOCATIONS_NUM:\n \t\t\tinternal_config.match_allocations = 1;\n \t\t\tbreak;\n+\t\tcase OPT_NO_SEG_FDS_NUM:\n+\t\t\tinternal_config.no_seg_fds = 1;\n+\t\t\tbreak;\n \n \t\tdefault:\n \t\t\tif (opt < OPT_LONG_MIN_NUM && isprint(opt)) {\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_memalloc.c b/lib/librte_eal/linuxapp/eal/eal_memalloc.c\nindex b6fb183db..420f82a54 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_memalloc.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_memalloc.c\n@@ -1518,6 +1518,10 @@ eal_memalloc_set_seg_fd(int list_idx, int seg_idx, int fd)\n \tif (internal_config.single_file_segments)\n \t\treturn -ENOTSUP;\n \n+\t/* no seg fds mode doesn't support segment fd's */\n+\tif (internal_config.no_seg_fds)\n+\t\treturn -ENOTSUP;\n+\n \t/* if list is not allocated, allocate it */\n \tif (fd_list[list_idx].len == 0) {\n \t\tint len = mcfg->memsegs[list_idx].memseg_arr.len;\n@@ -1539,6 +1543,10 @@ eal_memalloc_set_seg_list_fd(int list_idx, int fd)\n \tif (!internal_config.single_file_segments)\n \t\treturn -ENOTSUP;\n \n+\t/* no seg fds mode doesn't support segment fd's */\n+\tif (internal_config.no_seg_fds)\n+\t\treturn -ENOTSUP;\n+\n \t/* if list is not allocated, allocate it */\n \tif (fd_list[list_idx].len == 0) {\n \t\tint len = mcfg->memsegs[list_idx].memseg_arr.len;\n@@ -1557,6 +1565,10 @@ eal_memalloc_get_seg_fd(int list_idx, int seg_idx)\n {\n \tint fd;\n \n+\t/* no seg fds mode doesn't support segment fd's */\n+\tif (internal_config.no_seg_fds)\n+\t\treturn -ENOTSUP;\n+\n \tif (internal_config.in_memory || internal_config.no_hugetlbfs) {\n #ifndef MEMFD_SUPPORTED\n \t\t/* in in-memory or no-huge mode, we rely on memfd support */\n@@ -1614,6 +1626,10 @@ eal_memalloc_get_seg_fd_offset(int list_idx, int seg_idx, size_t *offset)\n {\n \tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n \n+\t/* no seg fds mode doesn't support segment fd's */\n+\tif (internal_config.no_seg_fds)\n+\t\treturn -ENOTSUP;\n+\n \tif (internal_config.in_memory || internal_config.no_hugetlbfs) {\n #ifndef MEMFD_SUPPORTED\n \t\t/* in in-memory or no-huge mode, we rely on memfd support */\n@@ -1679,7 +1695,8 @@ eal_memalloc_init(void)\n \t}\n \n \t/* initialize all of the fd lists */\n-\tif (rte_memseg_list_walk(fd_list_create_walk, NULL))\n+\tif (!internal_config.no_seg_fds &&\n+\t\t\trte_memseg_list_walk(fd_list_create_walk, NULL))\n \t\treturn -1;\n \treturn 0;\n }\n",
    "prefixes": []
}