From patchwork Thu Sep 21 20:53:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cabaj X-Patchwork-Id: 1837834 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Rs70g1XZ9z1ynH for ; Fri, 22 Sep 2023 06:53:38 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1qjQfq-0002xO-1n; Thu, 21 Sep 2023 20:53:22 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1qjQfj-0002xD-HY for kernel-team@lists.ubuntu.com; Thu, 21 Sep 2023 20:53:15 +0000 Received: from mail-yw1-f198.google.com (mail-yw1-f198.google.com [209.85.128.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 6CCD63F665 for ; Thu, 21 Sep 2023 20:53:14 +0000 (UTC) Received: by mail-yw1-f198.google.com with SMTP id 00721157ae682-59e78032ef9so20398757b3.2 for ; Thu, 21 Sep 2023 13:53:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695329593; x=1695934393; h=content-transfer-encoding:subject:from:content-language:to :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=UZc8lVWzcnyWGDWGAgnzoiDpbE5g5rnChmvemOFP2K0=; b=U07jY5iWJ/mGWCyM1+kja6ZWw0kSbMyjzoL4bO8Ezd4wBRVvY2P+XDapK2oa0DFkid T6bw6AlLfO/p+bQb0vt3GWBBjKda+QbXYuIvrGc4GuZhJaYX3dqoinuifb2Jcmh7lEvE cmrfegcEfMYSbXyi5vMJJQTkJTkNN6OUGmPhEYQr5X80a9mgJCwZElxT6PGB6Hrd8rvk k7Om9TJCLHbH1jZoR/18U0WojHcRMXzgfoz2A1pLBs9x8fI9sf63KHwcsoX4sHqNFFa1 QvQvU4Tjcd1Pw2cPL6UEY74BkoeKL8VbS/x5xz85Uur+6+77fKcVO3yQUyIf34fp08vR rxUA== X-Gm-Message-State: AOJu0YywmjdJqLZLkeGerAeA8TuzmKNzRezT+oMDeI3l5zyX9ZWzvlqb tbV0qk4qE79jiAs8uu0gA1QlNrYlXpLFLnBx9KVkbxivZwEIcHRALdg2FZiezPDHhxKyNGXickF saqDALPUjYzVhrlnj3dwzFN7tMjbGo7eNpLJxa/ZuxDECiobQRQ== X-Received: by 2002:a25:73cb:0:b0:d81:57db:7589 with SMTP id o194-20020a2573cb000000b00d8157db7589mr6194404ybc.48.1695329593517; Thu, 21 Sep 2023 13:53:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEiUApqnSUQwa7I7I6l9+47ksZBbgEoaIO+xpsgDVGCE/WErvaSEMNDSeGDO6VPHbqG4KbkAA== X-Received: by 2002:a25:73cb:0:b0:d81:57db:7589 with SMTP id o194-20020a2573cb000000b00d8157db7589mr6194396ybc.48.1695329593161; Thu, 21 Sep 2023 13:53:13 -0700 (PDT) Received: from [192.168.159.111] (h69-130-246-116.mdtnwi.broadband.dynamic.tds.net. [69.130.246.116]) by smtp.gmail.com with ESMTPSA id n62-20020a252741000000b00d7360e0b240sm527487ybn.31.2023.09.21.13.53.12 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Sep 2023 13:53:12 -0700 (PDT) Message-ID: Date: Thu, 21 Sep 2023 15:53:11 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.15.1 To: kernel-team@lists.ubuntu.com Content-Language: en-US From: John Cabaj Subject: [SRU][PULL][focal:linux-gcp-5.15] TCPDirect patches X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://canonical.lightning.force.com/lightning/r/Case/5008e00000Cj1c9AAB/view (TCPDirect patches) [Impact] * Include patches to enable TCPDirect. This is considered a v1 implementation while Google works to upsteam a v2 implementation, hence the "UBUNTU: SAUCE: (no-up)" classification. [Fix] d1016eee0b1a ("UBUNTU: SAUCE: (no-up) UPSTREAM: tcp: derive delack_max from rto_min") 10364f0d83ee ("UBUNTU: SAUCE: (no-up) gve: Add retry logic for recoverable adminq errors") 403fb6f43a7c ("UBUNTU: SAUCE: (no-up) tcp: defer regular ACK while processing socket backlog") be97d51d24da ("UBUNTU: SAUCE: (no-up) gve: Enable header-split without gve_close/gve_open") 499a0ec31c74 ("UBUNTU: SAUCE: (no-up) gve: fix rx issues for skb free and append frags") 89b4d1e69fac ("UBUNTU: SAUCE: (no-up) net: fix silent put_cmsg() failures") d025ece61dab ("UBUNTU: SAUCE: (no-up) tcp: get rid of sysctl_tcp_adv_win_scale") d1380ff2f4e3 ("UBUNTU: SAUCE: (no-up) gve: Add tx watchdog to avoid race condition on miss path") a4bc2e0cd1a3 ("UBUNTU: SAUCE: (no-up) net-tcp_5k_mtu: force wscale >= 12 for active flows") bbe85e8e856c ("UBUNTU: SAUCE: (no-up) net-tcp_5k_mtu: force wscale >= 12 for 4K MTU TCP flows") 7d5f15f733e8 ("UBUNTU: SAUCE: (no-up) dma-buf: fix int overflow") 22668842a913 ("UBUNTU: SAUCE: (no-up) gve: add flow steering and rss reset when teardown device resources") 18e66e5d9ac4 ("UBUNTU: SAUCE: (no-up) net: create skb_frags_not_readable() helper") 5d81162de488 ("UBUNTU: SAUCE: (no-up) net: add missing skb->devmem checks") cf0bcfdf9f87 ("UBUNTU: SAUCE: (no-up) net: remove devmem check from __pskb_copy_fclone()") 9ca03b5c36c7 ("UBUNTU: SAUCE: (no-up) net: allow tcp coallapsing and coallescing for devmem skbs") 030aef8b0fd2 ("UBUNTU: SAUCE: (no-up) net: skb_store_bits() should succeed on devmem header") 6aaf939fb49e ("UBUNTU: SAUCE: (no-up) net: fix skb_split unnecessarily setting skb->devmem") 51e12a8201a1 ("UBUNTU: SAUCE: (no-up) net: skb_copy_bits() should be able to copy devmem header") ea8a78e040f5 ("UBUNTU: SAUCE: (no-up) net: fix memory leaks due to skb->devmem checks") 1fcd891606c0 ("UBUNTU: SAUCE: (no-up) net: fix snaplen for devmem packets") e4a4e05f4831 ("UBUNTU: SAUCE: (no-up) net: keep track and avoid access of skb containing dma-buf pages.") 424871c3c564 ("UBUNTU: SAUCE: (no-up) gve: implement device memory socket data path") 4f8668ee4cdb ("UBUNTU: SAUCE: (no-up) gve: implement devmem socket stats") abe1772b0e39 ("UBUNTU: SAUCE: (no-up) gve: add rss support") c08a1adb6130 ("UBUNTU: SAUCE: (no-up) gve: add flow steering support") ffa842923ad6 ("UBUNTU: SAUCE: (no-up) gve: Add header split support") 940527385c4c ("UBUNTU: SAUCE: (no-up) lakitu config: enable TCP Direct configs") ebfa162318f8 ("UBUNTU: SAUCE: (no-up) tcp, cos-only: revert changes to skb_zerocopy_iter_stream") b87d0b0e659a ("UBUNTU: SAUCE: (no-up) tcp: let sendmsg() take file descriptors via cmsg to enable devmem Tx") 1d523c425a8c ("UBUNTU: SAUCE: (no-up) net: add SO_DEVMEM_DONTNEED setsockopt to release pages") 3e34b0936884 ("UBUNTU: SAUCE: (no-up) net: backport fixes to devmem TCP rx") 446d7a742177 ("UBUNTU: SAUCE: (no-up) tcp: implement RX path for devmem sockets") 109f2e3feb98 ("UBUNTU: SAUCE: (no-up) net: use get_file_rcu() instead of get_file for __netdev_rxq_alloc_page_from_dmabuf_pool") 0d5117d4ea53 ("UBUNTU: SAUCE: (no-up) net: add netdev_rxq_alloc_page and skb->devmem") d0d273544148 ("UBUNTU: SAUCE: (no-up) dmabuf: add ioctl that binds dmabuf pagepool to a netdevice") 05c81288f77b ("UBUNTU: SAUCE: (no-up) dma-buf: fix int overflow in addr calculation") 46366a3326d9 ("UBUNTU: SAUCE: (no-up) dma-buf: create struct pages backing a dma-bu") [Test Cases] * Compile tested * Boot tested * Ran ubuntu_kernel_selftests and ubuntu_performance_stress_ng test suites * Tested by Google [Other Info] * Bulk of patchset came from https://cos.googlesource.com/third_party/kernel/+log/refs/heads/tcpd/R105, but some backports were given in SalesForce case below. * SF: #00359122 [Where things could go wrong] * Most changes target Google gve driver specifically. * Some required updates to dma and network implementation to enable new API. * Could lead to DMA or network instabilities ----- The following changes since commit ff1e5d1fb15ae4317e2649fd369483a9e70898d7: UBUNTU: Ubuntu-gcp-5.15-5.15.0-1043.51~20.04.1 (2023-09-14 15:19:39 -0300) are available in the git repository at: git+ssh://user@kathleen/home/john-cabaj/for-review/focal_linux-gcp-5.15/.git tcpdirect for you to fetch changes up to 7b11967a25461f569a72e64911bb98f50600a324: UBUNTU: SAUCE: (no-up) UPSTREAM: tcp: derive delack_max from rto_min (2023-09-20 13:56:20 -0500) ---------------------------------------------------------------- Eric Dumazet (5): UBUNTU: SAUCE: (no-up) net-tcp_5k_mtu: force wscale >= 12 for 4K MTU TCP flows UBUNTU: SAUCE: (no-up) net-tcp_5k_mtu: force wscale >= 12 for active flows UBUNTU: SAUCE: (no-up) tcp: get rid of sysctl_tcp_adv_win_scale UBUNTU: SAUCE: (no-up) tcp: defer regular ACK while processing socket backlog UBUNTU: SAUCE: (no-up) UPSTREAM: tcp: derive delack_max from rto_min Jeroen de Borst (1): UBUNTU: SAUCE: (no-up) gve: Add retry logic for recoverable adminq errors Mina Almasry (25): UBUNTU: SAUCE: (no-up) dma-buf: create struct pages backing a dma-buf UBUNTU: SAUCE: (no-up) dma-buf: fix int overflow in addr calculation UBUNTU: SAUCE: (no-up) dmabuf: add ioctl that binds dmabuf pagepool to a netdevice UBUNTU: SAUCE: (no-up) net: add netdev_rxq_alloc_page and skb->devmem UBUNTU: SAUCE: (no-up) net: use get_file_rcu() instead of get_file for __netdev_rxq_alloc_page_from_dmabuf_pool UBUNTU: SAUCE: (no-up) tcp: implement RX path for devmem sockets UBUNTU: SAUCE: (no-up) net: backport fixes to devmem TCP rx UBUNTU: SAUCE: (no-up) net: add SO_DEVMEM_DONTNEED setsockopt to release pages UBUNTU: SAUCE: (no-up) tcp: let sendmsg() take file descriptors via cmsg to enable devmem Tx UBUNTU: SAUCE: (no-up) tcp, cos-only: revert changes to skb_zerocopy_iter_stream UBUNTU: SAUCE: (no-up) lakitu config: enable TCP Direct configs UBUNTU: SAUCE: (no-up) gve: implement devmem socket stats UBUNTU: SAUCE: (no-up) gve: implement device memory socket data path UBUNTU: SAUCE: (no-up) net: keep track and avoid access of skb containing dma-buf pages. UBUNTU: SAUCE: (no-up) net: fix snaplen for devmem packets UBUNTU: SAUCE: (no-up) net: fix memory leaks due to skb->devmem checks UBUNTU: SAUCE: (no-up) net: skb_copy_bits() should be able to copy devmem header UBUNTU: SAUCE: (no-up) net: fix skb_split unnecessarily setting skb->devmem UBUNTU: SAUCE: (no-up) net: skb_store_bits() should succeed on devmem header UBUNTU: SAUCE: (no-up) net: allow tcp coallapsing and coallescing for devmem skbs UBUNTU: SAUCE: (no-up) net: remove devmem check from __pskb_copy_fclone() UBUNTU: SAUCE: (no-up) net: add missing skb->devmem checks UBUNTU: SAUCE: (no-up) net: create skb_frags_not_readable() helper UBUNTU: SAUCE: (no-up) dma-buf: fix int overflow UBUNTU: SAUCE: (no-up) net: fix silent put_cmsg() failures Ziwei Xiao (7): UBUNTU: SAUCE: (no-up) gve: Add header split support UBUNTU: SAUCE: (no-up) gve: add flow steering support UBUNTU: SAUCE: (no-up) gve: add rss support UBUNTU: SAUCE: (no-up) gve: add flow steering and rss reset when teardown device resources UBUNTU: SAUCE: (no-up) gve: Add tx watchdog to avoid race condition on miss path UBUNTU: SAUCE: (no-up) gve: fix rx issues for skb free and append frags UBUNTU: SAUCE: (no-up) gve: Enable header-split without gve_close/gve_open Documentation/networking/ip-sysctl.rst | 8 + arch/x86/configs/lakitu_defconfig | 4239 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/dma-buf/dma-buf.c | 378 ++++++++++++ drivers/net/ethernet/google/gve/gve.h | 134 +++++ drivers/net/ethernet/google/gve/gve_adminq.c | 348 +++++++++++- drivers/net/ethernet/google/gve/gve_adminq.h | 130 ++++- drivers/net/ethernet/google/gve/gve_dqo.h | 3 + drivers/net/ethernet/google/gve/gve_ethtool.c | 748 +++++++++++++++++++++++- drivers/net/ethernet/google/gve/gve_main.c | 348 ++++++++++-- drivers/net/ethernet/google/gve/gve_rx_dqo.c | 377 ++++++++++-- drivers/net/ethernet/google/gve/gve_tx_dqo.c | 12 +- drivers/net/ethernet/google/gve/gve_utils.c | 16 +- drivers/net/ethernet/google/gve/gve_utils.h | 3 + include/linux/dma-buf.h | 70 +++ include/linux/netdevice.h | 34 ++ include/linux/skbuff.h | 31 +- include/linux/socket.h | 2 + include/linux/tcp.h | 18 +- include/net/netns/ipv4.h | 3 +- include/net/sock.h | 12 +- include/net/tcp.h | 32 +- include/uapi/asm-generic/socket.h | 7 + include/uapi/linux/dma-buf.h | 14 + include/uapi/linux/uio.h | 11 + mm/swap.c | 10 + net/core/datagram.c | 3 + net/core/dev.c | 50 ++ net/core/skbuff.c | 104 +++- net/core/sock.c | 75 ++- net/ipv4/sysctl_net_ipv4.c | 9 + net/ipv4/tcp.c | 273 ++++++++- net/ipv4/tcp_input.c | 40 +- net/ipv4/tcp_ipv4.c | 9 + net/ipv4/tcp_output.c | 53 +- net/packet/af_packet.c | 4 +- 35 files changed, 7404 insertions(+), 204 deletions(-) create mode 100644 arch/x86/configs/lakitu_defconfig