Show a cover letter.

GET /api/covers/96460/?format=api
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 96460,
    "url": "http://patchwork.dpdk.org/api/covers/96460/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/cover/20210730135533.417611-1-thomas@monjalon.net/",
    "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": "<20210730135533.417611-1-thomas@monjalon.net>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210730135533.417611-1-thomas@monjalon.net",
    "date": "2021-07-30T13:55:26",
    "name": "[RFC,v2,0/7] heterogeneous computing library",
    "submitter": {
        "id": 685,
        "url": "http://patchwork.dpdk.org/api/people/685/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/cover/20210730135533.417611-1-thomas@monjalon.net/mbox/",
    "series": [
        {
            "id": 18101,
            "url": "http://patchwork.dpdk.org/api/series/18101/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=18101",
            "date": "2021-07-30T13:55:26",
            "name": "heterogeneous computing library",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/18101/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/covers/96460/comments/",
    "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 74634A0C40;\n\tFri, 30 Jul 2021 15:55:51 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E895640040;\n\tFri, 30 Jul 2021 15:55:50 +0200 (CEST)",
            "from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com\n [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 92C674003F\n for <dev@dpdk.org>; Fri, 30 Jul 2021 15:55:49 +0200 (CEST)",
            "from compute3.internal (compute3.nyi.internal [10.202.2.43])\n by mailout.nyi.internal (Postfix) with ESMTP id DDE8C5C00CA;\n Fri, 30 Jul 2021 09:55:48 -0400 (EDT)",
            "from mailfrontend1 ([10.202.2.162])\n by compute3.internal (MEProxy); Fri, 30 Jul 2021 09:55:48 -0400",
            "by mail.messagingengine.com (Postfix) with ESMTPA; Fri,\n 30 Jul 2021 09:55:46 -0400 (EDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=\n from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding; s=fm1; bh=r/T/nCFpb8TZi\n BePv39i71sPuWkcM9X6inAKJ961mig=; b=SjfMW0e/D5IMuAxLTDYgrDbqUpPCJ\n hVPBJz+UeFPyWMTcRnrN2Z+NHB+/SK5L2up/W3AqaaEH3svCthB2/BUQd2HSbKEs\n qJCt0PEgsF4iDixDS20r0eGHY0aWfVKTCAzGsmceKMjCX/pFgaIdpPLliiA652O+\n nc4r4OhLDBlVqWcBrALOrX4TWtCMt/ebjNJ15yZ7Wc1mw2ZwEZ7jx3q4O/8HtdGs\n 0N/W0Idui+yFesYzMgcSaqLZo2BpY7MH6r+SbJEyw4FeP4/NNQnouaKZ1cURVM4q\n o98+mIoG3M0UzcEIVrjnQXjGB/2hNV7ghqDzjtsVd0YkHo/eXq4SU2ocg==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n messagingengine.com; h=cc:content-transfer-encoding:date:from\n :in-reply-to:message-id:mime-version:references:subject:to\n :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=\n fm3; bh=r/T/nCFpb8TZiBePv39i71sPuWkcM9X6inAKJ961mig=; b=VkTpj1LB\n cCujUV8vFrZdgFveMbSoszEVS4zD4JCn0hseMpIuEPe21DS2wlyCRANF+3xLKZna\n GthaIVOYq53Uj6/QpdQp2Ti8oZGm8kFSsw07QGzX+QlSmrNo2paxTSA3DjFP2zNN\n omLOIScjjIp+/8kEKPApmm57XmA/aqgWTjlHviVaWZKSmVM6uDivknfkjJMxccb6\n 7g5ZZ3LVc8m5zEvxUlDBg7h1rxBoy68TfbElTrVGgH81T2cHUDN4yns7JgP53MJG\n 5WObrCZn41SeVWstzHgnLJYcaJsnIbrOH6m0ltJ9m6NPtfCJO31wRq5h4whRgEiO\n 6Mhl2r1tvRfCBw=="
        ],
        "X-ME-Sender": "<xms:4wQEYQK43S8YAaGHV1khd3HA_x51AzaThApWdGREFXVN9NGuS6FJSw>\n <xme:4wQEYQJBhzrEKuAeukIZTAPJWl760cWa21slyzXBw38oeZ4gHD8I2xwtZkl73DN6W\n wWHEFqVXuH_nKBT-g>",
        "X-ME-Received": "\n <xmr:4wQEYQvSNhFzx00ThD7l35DwUwSUbCNkDTV0FjqVxa62yPR_LTZVuVNum47DpgDGFhc1d4NHu-C1U83sjLbdPGmb6JsTsJ0>",
        "X-ME-Proxy-Cause": "\n gggruggvucftvghtrhhoucdtuddrgedvtddrheehgdeiiecutefuodetggdotefrodftvf\n curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu\n uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc\n fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs\n ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf\n frrghtthgvrhhnpeegiefftefhleffgfdtkefhhfffgeeviedtfedtiedtieefueetgeel\n uedukeekveenucffohhmrghinheptghonhhfrdhinhdpvhgvrhhsihhonhdrmhgrphenuc\n evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgr\n shesmhhonhhjrghlohhnrdhnvght",
        "X-ME-Proxy": "<xmx:4wQEYda8FAY-t_NokcRHsqUdklXhHv0VcMYQnStFqBiJkHXHYwn2WQ>\n <xmx:4wQEYXZvCB7_EmvX4NDCJ2GdTjl8OgspElCP6XgIPLdfIsmaGplplQ>\n <xmx:4wQEYZAVavOeblwNO0Y_izo9tjO6TCNPtfqc7a1hHjuoQgl2DdlgjQ>\n <xmx:5AQEYcMhEa-sMIJmI_UlM6d5btcALhkUydYyzDYy9eHzL7XD_KGlXg>",
        "From": "Thomas Monjalon <thomas@monjalon.net>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n David Marchand <david.marchand@redhat.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Haiyue Wang <haiyue.wang@intel.com>,\n Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>,\n Jerin Jacob <jerinj@marvell.com>, Ferruh Yigit <ferruh.yigit@intel.com>",
        "Date": "Fri, 30 Jul 2021 15:55:26 +0200",
        "Message-Id": "<20210730135533.417611-1-thomas@monjalon.net>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20210602203531.2288645-1-thomas@monjalon.net>",
        "References": "<20210602203531.2288645-1-thomas@monjalon.net>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [RFC PATCH v2 0/7] heterogeneous computing library",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Elena Agostini <eagostini@nvidia.com>\n\nIn heterogeneous computing system, processing is not only in the CPU.\nSome tasks can be delegated to devices working in parallel.\n\nThe goal of this new library is to enhance the collaboration between\nDPDK, that's primarily a CPU framework, and other type of devices like GPUs.\n\nWhen mixing network activity with task processing on a non-CPU device,\nthere may be the need to put in communication the CPU with the device\nin order to manage the memory, synchronize operations, exchange info, etc..\n\nThis library provides a number of new features:\n- Interoperability with device specific library with generic handlers\n- Possibility to allocate and free memory on the device\n- Possibility to allocate and free memory on the CPU but visible from the device\n- Communication functions to enhance the dialog between the CPU and the device\n\nThe infrastructure is prepared to welcome drivers in drivers/hc/\nas the upcoming NVIDIA one, implementing the hcdev API.\n\nSome parts are not complete:\n  - locks\n  - memory allocation table\n  - memory freeing\n  - guide documentation\n  - integration in devtools/check-doc-vs-code.sh\n  - unit tests\n  - integration in testpmd to enable Rx/Tx to/from GPU memory.\n\nBelow is a pseudo-code to give an example about how to use functions\nin this library in case of a CUDA application.\n\n\nElena Agostini (4):\n  hcdev: introduce heterogeneous computing device library\n  hcdev: add memory API\n  hcdev: add communication flag\n  hcdev: add communication list\n\nThomas Monjalon (3):\n  hcdev: add event notification\n  hcdev: add child device representing a device context\n  hcdev: support multi-process\n\n .gitignore                             |   1 +\n MAINTAINERS                            |   6 +\n doc/api/doxy-api-index.md              |   1 +\n doc/api/doxy-api.conf.in               |   1 +\n doc/guides/conf.py                     |   8 +\n doc/guides/hcdevs/features/default.ini |  13 +\n doc/guides/hcdevs/index.rst            |  11 +\n doc/guides/hcdevs/overview.rst         |  11 +\n doc/guides/index.rst                   |   1 +\n doc/guides/prog_guide/hcdev.rst        |   5 +\n doc/guides/prog_guide/index.rst        |   1 +\n doc/guides/rel_notes/release_21_08.rst |   5 +\n drivers/hc/meson.build                 |   4 +\n drivers/meson.build                    |   1 +\n lib/hcdev/hcdev.c                      | 789 +++++++++++++++++++++++++\n lib/hcdev/hcdev_driver.h               |  96 +++\n lib/hcdev/meson.build                  |  12 +\n lib/hcdev/rte_hcdev.h                  | 592 +++++++++++++++++++\n lib/hcdev/version.map                  |  35 ++\n lib/meson.build                        |   1 +\n 20 files changed, 1594 insertions(+)\n create mode 100644 doc/guides/hcdevs/features/default.ini\n create mode 100644 doc/guides/hcdevs/index.rst\n create mode 100644 doc/guides/hcdevs/overview.rst\n create mode 100644 doc/guides/prog_guide/hcdev.rst\n create mode 100644 drivers/hc/meson.build\n create mode 100644 lib/hcdev/hcdev.c\n create mode 100644 lib/hcdev/hcdev_driver.h\n create mode 100644 lib/hcdev/meson.build\n create mode 100644 lib/hcdev/rte_hcdev.h\n create mode 100644 lib/hcdev/version.map\n\n\n\n////////////////////////////////////////////////////////////////////////\n///// HCDEV library + CUDA functions\n////////////////////////////////////////////////////////////////////////\n#define GPU_PAGE_SHIFT 16\n#define GPU_PAGE_SIZE (1UL << GPU_PAGE_SHIFT)\n\nint main() {\n    struct rte_hcdev_flag quit_flag;\n    struct rte_hcdev_comm_list *comm_list;\n    int nb_rx = 0;\n    int comm_list_entry = 0;\n    struct rte_mbuf * rx_mbufs[max_rx_mbufs];\n    cudaStream_t cstream;\n    struct rte_mempool *mpool_payload, *mpool_header;\n    struct rte_pktmbuf_extmem ext_mem;\n    int16_t dev_id;\n\n    /* Initialize CUDA objects (cstream, context, etc..). */\n    /* Use hcdev library to register a new CUDA context if any */\n    /* Let's assume the application wants to use the default context of the GPU device 0 */\n    dev_id = 0;\n\n    /* Create an external memory mempool using memory allocated on the GPU. */\n    ext_mem.elt_size = mbufs_headroom_size;\n                ext_mem.buf_len = RTE_ALIGN_CEIL(mbufs_num * ext_mem.elt_size, GPU_PAGE_SIZE);\n    ext_mem.buf_iova = RTE_BAD_IOVA;\n    ext_mem.buf_ptr = rte_hcdev_malloc(dev_id, ext_mem.buf_len, 0);\n    rte_extmem_register(ext_mem.buf_ptr, ext_mem.buf_len, NULL, ext_mem.buf_iova, GPU_PAGE_SIZE);\n    rte_dev_dma_map(rte_eth_devices[l2fwd_port_id].device, ext_mem.buf_ptr, ext_mem.buf_iova, ext_mem.buf_len);\n    mpool_payload = rte_pktmbuf_pool_create_extbuf(\"gpu_mempool\", mbufs_num,\n                                                    0, 0, ext_mem.elt_size,\n                                                    rte_socket_id(), &ext_mem, 1);\n\n    /*\n     * Create CPU - device communication flag. With this flag, the CPU can tell to the CUDA kernel\n     * to exit from the main loop.\n     */\n    rte_hcdev_comm_create_flag(dev_id, &quit_flag, RTE_HCDEV_COMM_FLAG_CPU);\n    rte_hcdev_comm_set_flag(&quit_flag, 0);\n\n    /*\n     * Create CPU - device communication list. Each entry of this list will be populated by the CPU\n     * with a new set of received mbufs that the CUDA kernel has to process.\n     */\n    comm_list = rte_hcdev_comm_create_list(dev_id, num_entries);\n\n    /* A very simple CUDA kernel with just 1 CUDA block and RTE_HCDEV_COMM_LIST_PKTS_MAX CUDA threads. */\n    cuda_kernel_packet_processing<<<1, RTE_HCDEV_COMM_LIST_PKTS_MAX, 0, cstream>>>(quit_flag->ptr, comm_list, num_entries, ...);\n\n    /*\n     * For simplicity, the CPU here receives only 2 bursts of mbufs.\n     * In a real application, network activity and device processing should overlap.\n     */\n    nb_rx = rte_eth_rx_burst(port_id, queue_id, &(rx_mbufs[0]), max_rx_mbufs);\n    rte_hcdev_comm_populate_list_pkts(comm_list[0], rx_mbufs, nb_rx);\n    nb_rx = rte_eth_rx_burst(port_id, queue_id, &(rx_mbufs[0]), max_rx_mbufs);\n    rte_hcdev_comm_populate_list_pkts(comm_list[1], rx_mbufs, nb_rx);\n\n    /*\n     * CPU waits for the completion of the packets' processing on the CUDA kernel\n     * and then it does a cleanup of the received mbufs.\n     */\n    while (rte_hcdev_comm_cleanup_list(comm_list[0]));\n    while (rte_hcdev_comm_cleanup_list(comm_list[1]));\n\n    /* CPU notifies the CUDA kernel that it has to terminate */\n    rte_hcdev_comm_set_flag(&quit_flag, 1);\n\n    /* hcdev objects cleanup/destruction */\n    /* CUDA cleanup */\n    /* DPDK cleanup */\n\n    return 0;\n}\n\n////////////////////////////////////////////////////////////////////////\n///// CUDA kernel\n////////////////////////////////////////////////////////////////////////\n\nvoid cuda_kernel(uint32_t * quit_flag_ptr, struct rte_hcdev_comm_list *comm_list, int comm_list_entries) {\n    int comm_list_index = 0;\n    struct rte_hcdev_comm_pkt *pkt_list = NULL;\n\n    /* Do some pre-processing operations. */\n\n    /* GPU kernel keeps checking this flag to know if it has to quit or wait for more packets. */\n    while (*quit_flag_ptr == 0)\n    {\n        if (comm_list[comm_list_index]->status != RTE_HCDEV_COMM_LIST_READY)\n            continue;\n\n        if (threadIdx.x < comm_list[comm_list_index]->num_pkts)\n        {\n            /* Each CUDA thread processes a different packet. */\n            packet_processing(comm_list[comm_list_index]->addr, comm_list[comm_list_index]->size, ..);\n        }\n        __threadfence();\n        __syncthreads();\n\n        /* Wait for new packets on the next communication list entry. */\n        comm_list_index = (comm_list_index+1) % comm_list_entries;\n    }\n\n    /* Do some post-processing operations. */\n}"
}