Show a cover letter.

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

{
    "id": 1115485,
    "url": "http://patchwork.ozlabs.org/api/covers/1115485/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/cover/1560411450-29121-1-git-send-email-magnus.karlsson@intel.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1560411450-29121-1-git-send-email-magnus.karlsson@intel.com>",
    "list_archive_url": null,
    "date": "2019-06-13T07:37:24",
    "name": "[bpf-next,0/6] add need_wakeup flag to the AF_XDP rings",
    "submitter": {
        "id": 72726,
        "url": "http://patchwork.ozlabs.org/api/people/72726/?format=api",
        "name": "Magnus Karlsson",
        "email": "magnus.karlsson@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/cover/1560411450-29121-1-git-send-email-magnus.karlsson@intel.com/mbox/",
    "series": [
        {
            "id": 113704,
            "url": "http://patchwork.ozlabs.org/api/series/113704/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=113704",
            "date": "2019-06-13T07:37:25",
            "name": "add need_wakeup flag to the AF_XDP rings",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/113704/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/covers/1115485/comments/",
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.133; helo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 45PrF03Ps1z9sBp\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 14 Jun 2019 03:23:48 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id DE73C88299;\n\tThu, 13 Jun 2019 17:23:45 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id cQ146CtDZ0hL; Thu, 13 Jun 2019 17:23:43 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id C9ED788256;\n\tThu, 13 Jun 2019 17:23:43 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 71BF31BF363\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 13 Jun 2019 07:37:41 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 6919B2107D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 13 Jun 2019 07:37:41 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id KQMU03b3ExWT for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 13 Jun 2019 07:37:40 +0000 (UTC)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 1D1C120345\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 13 Jun 2019 07:37:40 +0000 (UTC)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Jun 2019 00:37:39 -0700",
            "from mkarlsso-mobl.ger.corp.intel.com (HELO VM.ger.corp.intel.com)\n\t([10.103.211.41])\n\tby orsmga004.jf.intel.com with ESMTP; 13 Jun 2019 00:37:34 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Magnus Karlsson <magnus.karlsson@intel.com>",
        "To": "magnus.karlsson@intel.com, bjorn.topel@intel.com, ast@kernel.org,\n\tdaniel@iogearbox.net, netdev@vger.kernel.org, brouer@redhat.com",
        "Date": "Thu, 13 Jun 2019 09:37:24 +0200",
        "Message-Id": "<1560411450-29121-1-git-send-email-magnus.karlsson@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "MIME-Version": "1.0",
        "X-Mailman-Approved-At": "Thu, 13 Jun 2019 17:23:42 +0000",
        "Subject": "[Intel-wired-lan] [PATCH bpf-next 0/6] add need_wakeup flag to the\n\tAF_XDP rings",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Cc": "axboe@kernel.dk, maximmi@mellanox.com, kevin.laatz@intel.com,\n\tjakub.kicinski@netronome.com, maciejromanfijalkowski@gmail.com,\n\tbruce.richardson@intel.com, ciara.loftus@intel.com,\n\tilias.apalodimas@linaro.org, xiaolong.ye@intel.com,\n\tintel-wired-lan@lists.osuosl.org, qi.z.zhang@intel.com,\n\tmaciej.fijalkowski@intel.com, bpf@vger.kernel.org",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "This patch set adds support for a new flag called need_wakeup in the\nAF_XDP Tx and fill rings. When this flag is set by the driver, it\nmeans that the application has to explicitly wake up the kernel Rx\n(for the bit in the fill ring) or kernel Tx (for bit in the Tx ring)\nprocessing by issuing a syscall. Poll() can wake up both and sendto()\nwill wake up Tx processing only.\n\nThe main reason for introducing this new flag is to be able to\nefficiently support the case when application and driver is executing\non the same core. Previously, the driver was just busy-spinning on the\nfill ring if it ran out of buffers in the HW and there were none to\nget from the fill ring. This approach works when the application and\ndriver is running on different cores as the application can replenish\nthe fill ring while the driver is busy-spinning. Though, this is a\nlousy approach if both of them are running on the same core as the\nprobability of the fill ring getting more entries when the driver is\nbusy-spinning is zero. With this new feature the driver now sets the\nneed_wakeup flag and returns to the application. The application can\nthen replenish the fill queue and then explicitly wake up the Rx\nprocessing in the kernel using the syscall poll(). For Tx, the flag is\nonly set to one if the driver has no outstanding Tx completion\ninterrupts. If it has some, the flag is zero as it will be woken up by\na completion interrupt anyway. This flag can also be used in other\nsituations where the driver needs to be woken up explicitly.\n\nAs a nice side effect, this new flag also improves the Tx performance\nof the case where application and driver are running on two different\ncores as it reduces the number of syscalls to the kernel. The kernel\ntells user space if it needs to be woken up by a syscall, and this\neliminates many of the syscalls. The Rx performance of the 2-core case\nis on the other hand slightly worse, since there is a need to use a\nsyscall now to wake up the driver, instead of the driver\nbusy-spinning. It does waste less CPU cycles though, which might lead\nto better overall system performance.\n\nThis new flag needs some simple driver support. If the driver does not\nsupport it, the Rx flag is always zero and the Tx flag is always\none. This makes any application relying on this feature default to the\nold behavior of not requiring any syscalls in the Rx path and always\nhaving to call sendto() in the Tx path.\n\nFor backwards compatibility reasons, this feature has to be explicitly\nturned on using a new bind flag (XDP_USE_NEED_WAKEUP). I recommend\nthat you always turn it on as it has a large positive performance\nimpact for the one core case and does not degrade 2 core performance\nand actually improves it for Tx heavy workloads.\n\nHere are some performance numbers measured on my local,\nnon-performance optimized development system. That is why you are\nseeing numbers lower than the ones from Björn and Jesper. 64 byte\npackets at 40Gbit/s line rate. All results in Mpps. Cores == 1 means\nthat both application and driver is executing on the same core. Cores\n== 2 that they are on different cores.\n\n                              Applications\nneed_wakeup  cores    txpush    rxdrop      l2fwd\n---------------------------------------------------------------\n     n         1       0.07      0.06        0.03\n     y         1       21.6      8.2         6.5\n     n         2       32.3      11.7        8.7\n     y         2       33.1      11.7        8.7\n\nOverall, the need_wakeup flag provides the same or better performance\nin all the micro-benchmarks. The reduction of sendto() calls in txpush\nis large. Only a few per second is needed. For l2fwd, the drop is 50%\nfor the 1 core case and more than 99.9% for the 2 core case. Do not\nknow why I am not seeing the same drop for the 1 core case yet.\n\nThe name and inspiration of the flag has been taken from io_uring by\nJens Axboe. Details about this feature in io_uring can be found in\nhttp://kernel.dk/io_uring.pdf, section 8.3. It also addresses most of\nthe denial of service and sendto() concerns raised by Maxim\nMikityanskiy in https://www.spinics.net/lists/netdev/msg554657.html.\n\nThe typical Tx part of an application will have to change from:\n\nret = sendto(fd,....)\n\nto:\n\nif (xsk_ring_prod__needs_wakeup(&xsk->tx))\n       ret = sendto(fd,....)\n\nand th Rx part from:\n\nrcvd = xsk_ring_cons__peek(&xsk->rx, BATCH_SIZE, &idx_rx);\nif (!rcvd)\n       return;\n\nto:\n\nrcvd = xsk_ring_cons__peek(&xsk->rx, BATCH_SIZE, &idx_rx);\nif (!rcvd) {\n       if (xsk_ring_prod__needs_wakeup(&xsk->umem->fq))\n              ret = poll(fd,.....);\n       return;\n}\n\nThis patch has been applied against commit aee450cbe482 (\"bpf: silence warning messages in core\")\n\nStructure of the patch set:\n\nPatch 1: Replaces the ndo_xsk_async_xmit with ndo_xsk_wakeup to\n         support waking up both Rx and Tx processing\nPatch 2: Implements the need_wakeup functionality in common code\nPatch 3-4: Add need_wakeup support to the i40e and ixgbe drivers\nPatch 5: Add need_wakeup support to libbpf\nPatch 6: Add need_wakeup support to the xdpsock sample application\n\nThanks: Magnus\n\nMagnus Karlsson (6):\n  xsk: replace ndo_xsk_async_xmit with ndo_xsk_wakeup\n  xsk: add support for need_wakeup flag in AF_XDP rings\n  i40e: add support for AF_XDP need_wakup feature\n  ixgbe: add support for AF_XDP need_wakup feature\n  libbpf: add support for need_wakeup flag in AF_XDP part\n  samples/bpf: add use of need_sleep flag in xdpsock\n\n drivers/net/ethernet/intel/i40e/i40e_main.c        |   5 +-\n drivers/net/ethernet/intel/i40e/i40e_xsk.c         |  23 ++-\n drivers/net/ethernet/intel/i40e/i40e_xsk.h         |   2 +-\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c      |   5 +-\n .../net/ethernet/intel/ixgbe/ixgbe_txrx_common.h   |   2 +-\n drivers/net/ethernet/intel/ixgbe/ixgbe_xsk.c       |  20 ++-\n include/linux/netdevice.h                          |  18 +-\n include/net/xdp_sock.h                             |  33 +++-\n include/uapi/linux/if_xdp.h                        |  13 ++\n net/xdp/xdp_umem.c                                 |   6 +-\n net/xdp/xsk.c                                      |  93 +++++++++-\n net/xdp/xsk_queue.h                                |   1 +\n samples/bpf/xdpsock_user.c                         | 191 +++++++++++++--------\n tools/include/uapi/linux/if_xdp.h                  |  13 ++\n tools/lib/bpf/xsk.c                                |   4 +\n tools/lib/bpf/xsk.h                                |   6 +\n 16 files changed, 343 insertions(+), 92 deletions(-)\n\n--\n2.7.4"
}