get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2215687,
    "url": "http://patchwork.ozlabs.org/api/patches/2215687/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/cae762719982e0700f5302c01a6b3b6fc16c3c73.1774410440.git.lucien.xin@gmail.com/",
    "project": {
        "id": 12,
        "url": "http://patchwork.ozlabs.org/api/projects/12/?format=api",
        "name": "Linux CIFS Client",
        "link_name": "linux-cifs-client",
        "list_id": "linux-cifs.vger.kernel.org",
        "list_email": "linux-cifs@vger.kernel.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<cae762719982e0700f5302c01a6b3b6fc16c3c73.1774410440.git.lucien.xin@gmail.com>",
    "list_archive_url": null,
    "date": "2026-03-25T03:47:07",
    "name": "[net-next,v11,02/15] net: build socket infrastructure for QUIC protocol",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "8309c13e27642228f324410001f3aeec91e487dc",
    "submitter": {
        "id": 61073,
        "url": "http://patchwork.ozlabs.org/api/people/61073/?format=api",
        "name": "Xin Long",
        "email": "lucien.xin@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-cifs-client/patch/cae762719982e0700f5302c01a6b3b6fc16c3c73.1774410440.git.lucien.xin@gmail.com/mbox/",
    "series": [
        {
            "id": 497380,
            "url": "http://patchwork.ozlabs.org/api/series/497380/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=497380",
            "date": "2026-03-25T03:47:06",
            "name": "net: introduce QUIC infrastructure and core subcomponents",
            "version": 11,
            "mbox": "http://patchwork.ozlabs.org/series/497380/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2215687/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2215687/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-cifs+bounces-10504-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-cifs@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=Fb9yRuiN;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10504-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"Fb9yRuiN\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.160.182",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com"
        ],
        "Received": [
            "from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgXyq5FN5z1y1G\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 14:51:47 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id D995330A0C8C\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 03:49:36 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 47C642DFA46;\n\tWed, 25 Mar 2026 03:49:32 +0000 (UTC)",
            "from mail-qt1-f182.google.com (mail-qt1-f182.google.com\n [209.85.160.182])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id E4D6F2DF3EA\n\tfor <linux-cifs@vger.kernel.org>; Wed, 25 Mar 2026 03:49:27 +0000 (UTC)",
            "by mail-qt1-f182.google.com with SMTP id\n d75a77b69052e-506aa68065eso16310881cf.1\n        for <linux-cifs@vger.kernel.org>;\n Tue, 24 Mar 2026 20:49:27 -0700 (PDT)",
            "from wsfd-netdev58.anl.eng.rdu2.dc.redhat.com ([66.187.232.140])\n        by smtp.gmail.com with ESMTPSA id\n d75a77b69052e-50b36cb2e29sm150093001cf.1.2026.03.24.20.49.23\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Tue, 24 Mar 2026 20:49:25 -0700 (PDT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774410572; cv=none;\n b=lPNnuIT8nL8093mEFnfAuTFdEPcAWqB5KHtpTVQuPQC3mYwV6DpKvQW/Ry5vyIZZzrFt1L8BZlxbndG2Mz8TMuUZbcDxDDuZXDRvth7t6bTYQRorhMejx1h7ZBP5pHywaXlnru+KvQwUmbN+lVg+sJmQwwNH5BwMZ4LNVa5FDg8=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774410572; c=relaxed/simple;\n\tbh=ZPw8PNCf8kVvZG5ERze4P/B9wIV7n/qx7y2gUDpGR9U=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=lthRtGP/Ut0qEkA9itqtqlbMnO1DkH0gVMIRRMIDVPZGxsjWzatQa1a3gHeLzDbi1tXOxbBJQTFDQxN2uco15X1of00a9SSRBak6LOWblE7yHkGsP7owcbVvwtsCRfYMMmK9r0XmTbsBcszFiwdDD+7a8IOTJj2PHfp5rEoCSEI=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=Fb9yRuiN; arc=none smtp.client-ip=209.85.160.182",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1774410567; x=1775015367;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=kNwjo5K8PPVa+ptrJ9SEZH8KZqtvi/FX28vYT6/Syxo=;\n        b=Fb9yRuiNrb9AcJDUsBCtfKylNK3avNZRuK2x7qkrKZKk3hwugyjMvaZIDVXA5ugqcJ\n         IgD7Kb7X7PvZAJKwE6uMf9+QERVWR/LZDV/gxJpiVdpZimgnRSspkYgOkJY7FugLj3DX\n         htCgeUZaNz5D6jtINFjcV55dpNva6/LVy8Z7jZ0ouWLbwnHSgmRQbFwPRls/XYAgOtmm\n         sBfY0kJWkeilINoSr7zon/Rn/f612HkeFT8xJayPs1pZURn2QH8AlRrcr8RDdJIxAHng\n         mx6bKW7i1l3oYjBhpcuAfV2112mN7zwVHPQIuuBGiG6p8wYUSCRCkNuuuWoWlhz7oPwa\n         EaKw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1774410567; x=1775015367;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=kNwjo5K8PPVa+ptrJ9SEZH8KZqtvi/FX28vYT6/Syxo=;\n        b=TX2tXISfTVY9XN2R1F76rEp/TWS3dTpTtpQLrzImHoymUoG2TnImW8c8tDka5S7bB5\n         4cMaw5kjGe9IBu4vgIAvrWNM3pkNsYYvO54RnKIZxNf6JLE639/Gld/f5a5HyyOUSEYl\n         Rbm1MT773+AP+C/eo55u7t+HTDgj1WOIDB+auYYfcaHhbSfaAo90inCm00uUzeKbmGkL\n         IJioefmd1xl6cQ8BaB67a5ClobEUyV8bbj7fK+Cz7nJvmV+VI1Vrx04JQRRZ4f8O/yjp\n         +w1pnXJzTisTPE3GAKPPFlsD3+Ahfv2B9SJaaz6qza7wBwg9GFPkiTpuz3FFRgKvAIhK\n         z5hQ==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCX/YwDS77txodHjZEmzzANMUl+KG0BrVOYyfN31UM4hBLu9yaXi9WrBW0cmaJdAdthtFkVFksWD6Cbm@vger.kernel.org",
        "X-Gm-Message-State": "AOJu0YzxWQmBrtZZa8MJqalKvFsPaW7EFu7dC4XwvfMc9mzJ6Frm+fUp\n\tn0dyBeS6LKOqhNpyXzgR/3dA1MSblKsCXCR+tDsnVbE3Uaqrs7HP0cI+",
        "X-Gm-Gg": "ATEYQzxfJhqD2A12RbgHR9QKnrYAYXtxRIS4yeKzwPjaDrskFA80HwNpw29DMT5iHpl\n\tVRzn9R4aRbTzBIM7aXJXBifK7J0KmFYdDj1rH6u47ZNteN8PAVUKPcYkwXrn2IyekhKGyjnLxid\n\t/XW+Wex7pNrF3Ooz1RCIKjh6u+rgscWccA/5n1oH/gt6qFs8Fq2q7yvR6ZP4p8OW1FMjFCNAque\n\tZuHjPHQF64NVFbQooyLXnmr8WuyS4cR9ycgzNwC96iQ1CD2HAAjtWs9hCeJ/G0YDSeRWRBxiQOe\n\tpaPuTCbjE8m4teYK8E0I7LhHL3M2Uwk8PI5lK/PKgo6yc6q2+irp4j9U6KRcav1fedYG/nrzrIL\n\t65WnEVfXhVYX38Wl/3G8dcencJRXgiIMeeAedGcRExHSI5iZpZ0C15UONZN5sVXjqHF7EI3p6y4\n\tqZf2uNgzWNmfwqUsB5pP+2nIf4w2qPp/6EuA3j7HNL7mnDEelDxUXBF5b2v0qAE6RSfsalIfRaf\n\tydoxeyFtUFrdk6wrHUs+3oSjrxwti8bhmQcWV/0GEelw/dcjW4Poq3qveSVDCYPqQ==",
        "X-Received": "by 2002:a05:622a:4aca:b0:509:2618:cefb with SMTP id\n d75a77b69052e-50b80e31f79mr30250911cf.38.1774410566686;\n        Tue, 24 Mar 2026 20:49:26 -0700 (PDT)",
        "From": "Xin Long <lucien.xin@gmail.com>",
        "To": "network dev <netdev@vger.kernel.org>,\n\tquic@lists.linux.dev",
        "Cc": "davem@davemloft.net,\n\tkuba@kernel.org,\n\tEric Dumazet <edumazet@google.com>,\n\tPaolo Abeni <pabeni@redhat.com>,\n\tSimon Horman <horms@kernel.org>,\n\tStefan Metzmacher <metze@samba.org>,\n\tMoritz Buhl <mbuhl@openbsd.org>,\n\tTyler Fanelli <tfanelli@redhat.com>,\n\tPengtao He <hepengtao@xiaomi.com>,\n\tThomas Dreibholz <dreibh@simula.no>,\n\tlinux-cifs@vger.kernel.org,\n\tSteve French <smfrench@gmail.com>,\n\tNamjae Jeon <linkinjeon@kernel.org>,\n\tPaulo Alcantara <pc@manguebit.com>,\n\tTom Talpey <tom@talpey.com>,\n\tkernel-tls-handshake@lists.linux.dev,\n\tChuck Lever <chuck.lever@oracle.com>,\n\tJeff Layton <jlayton@kernel.org>,\n\tSteve Dickson <steved@redhat.com>,\n\tHannes Reinecke <hare@suse.de>,\n\tAlexander Aring <aahringo@redhat.com>,\n\tDavid Howells <dhowells@redhat.com>,\n\tMatthieu Baerts <matttbe@kernel.org>,\n\tJohn Ericson <mail@johnericson.me>,\n\tCong Wang <xiyou.wangcong@gmail.com>,\n\t\"D . Wythe\" <alibuda@linux.alibaba.com>,\n\tJason Baron <jbaron@akamai.com>,\n\tilliliti <illiliti@protonmail.com>,\n\tSabrina Dubroca <sd@queasysnail.net>,\n\tMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>,\n\tDaniel Stenberg <daniel@haxx.se>,\n\tAndy Gospodarek <andrew.gospodarek@broadcom.com>,\n\t\"Marc E . Fiuczynski\" <marc@fiuczynski.com>",
        "Subject": "[PATCH net-next v11 02/15] net: build socket infrastructure for QUIC\n protocol",
        "Date": "Tue, 24 Mar 2026 23:47:07 -0400",
        "Message-ID": "\n <cae762719982e0700f5302c01a6b3b6fc16c3c73.1774410440.git.lucien.xin@gmail.com>",
        "X-Mailer": "git-send-email 2.47.1",
        "In-Reply-To": "<cover.1774410440.git.lucien.xin@gmail.com>",
        "References": "<cover.1774410440.git.lucien.xin@gmail.com>",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-cifs@vger.kernel.org",
        "List-Id": "<linux-cifs.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-cifs+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-cifs+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit"
    },
    "content": "This patch lays the groundwork for QUIC socket support in the kernel.\nIt defines the core structures and protocol hooks needed to create\nQUIC sockets, without implementing any protocol behavior at this stage.\n\nBasic integration is included to allow building the module via\nCONFIG_IP_QUIC=m.\n\nThis provides the scaffolding necessary for adding actual QUIC socket\nbehavior in follow-up patches.\n\nSigned-off-by: Pengtao He <hepengtao@xiaomi.com>\nSigned-off-by: Xin Long <lucien.xin@gmail.com>\nAcked-by: Paolo Abeni <pabeni@redhat.com>\n---\nv3:\n  - Kconfig: add 'default n' for IP_QUIC (reported by Paolo).\n  - quic_disconnect(): return -EOPNOTSUPP (suggested by Paolo).\n  - quic_init/destroy_sock(): drop local_bh_disable/enable() calls (noted\n    by Paolo).\n  - sysctl: add alpn_demux option to en/disable ALPN-based demux.\n  - SNMP: remove SNMP_MIB_SENTINEL, switch to\n    snmp_get_cpu_field_batch_cnt() to align with latest net-next changes.\nv4:\n  - Remove unnecessary READ_ONCE() in quic_inet_connect() (reported by\n    Paolo).\nv5:\n  - Update the type of the parameter 'addr' in quic_inet_connect(),\n    quic_connect(), and quic_bind() to match the latest net-next changes.\n  - Define quic_is_serv() to reuse sk->sk_max_ack_backlog for server-side\n    detection; path->serv will be deleted in a later patch.\n  - Use MODULE_ALIAS_NET_PF_PROTO instead of MODULE_ALIAS (suggested by\n    Stefan).\n  - Add the missing Documentation entry for the new sysctl options (noted\n    by Paolo).\n  - Add the missing MAINTAINERS entry for the QUIC PROTOCOL (noted by\n    Jakub).\nv6:\n  - Relocate the QUIC PROTOCOL MAINTAINERS entry to its proper section\n    (noted by Jakub).\nv7:\n  - Replace #ifdef CONFIG_XXX with #if IS_ENABLED(CONFIG_XXX) (noted by\n    Paolo).\nv8:\n  - Fix an issue where an uninitialized value could be returned from\n    quic_net_init() by initializing err to 0 (reported by AI review).\n  - Replace the global ALPN demultiplexing sysctl with a static key that\n    will be enabled only when ALPN is configured on a listening socket\n    (noted by Stefan).\nv10:\n  - Note for AI reviews: inet6_register_protosw() never fails for QUIC,\n    so checking its return value is unnecessary.\n  - Remove sk_sndbuf/sk_rcvbuf initialization in quic_init_sock(), as it's\n    already done in sock_init_data_uid() with sysctl_w/rmem_default.\nv11:\n  - Note for AI review: quic_sk(sk)->reqs is used only for listen sockets\n    and will be initialized in quic_inet_listen() in a later patch, so\n    there is no need to initialize it in quic_init_sock().\n  - Set maximum line length to 80 characters.\n  - Drop addr_len from quic_recvmsg() to match the latest\n    proto_ops.recvmsg() update.\n  - Use %lu for SNMP counters in quic_snmp_seq_show().\n---\n Documentation/networking/ip-sysctl.rst |  39 +++\n MAINTAINERS                            |   7 +\n net/Kconfig                            |   1 +\n net/Makefile                           |   1 +\n net/quic/Kconfig                       |  36 +++\n net/quic/Makefile                      |   8 +\n net/quic/protocol.c                    | 376 +++++++++++++++++++++++++\n net/quic/protocol.h                    |  57 ++++\n net/quic/socket.c                      | 210 ++++++++++++++\n net/quic/socket.h                      |  89 ++++++\n 10 files changed, 824 insertions(+)\n create mode 100644 net/quic/Kconfig\n create mode 100644 net/quic/Makefile\n create mode 100644 net/quic/protocol.c\n create mode 100644 net/quic/protocol.h\n create mode 100644 net/quic/socket.c\n create mode 100644 net/quic/socket.h",
    "diff": "diff --git a/Documentation/networking/ip-sysctl.rst b/Documentation/networking/ip-sysctl.rst\nindex 2e3a746fcc6d..5e3aafe9e236 100644\n--- a/Documentation/networking/ip-sysctl.rst\n+++ b/Documentation/networking/ip-sysctl.rst\n@@ -3805,6 +3805,45 @@ l3mdev_accept - BOOLEAN\n \tDefault: 1 (enabled)\n \n \n+``/proc/sys/net/quic/*`` Variables\n+===================================\n+\n+quic_mem - vector of 3 LONGs: min, pressure, max\n+\tNumber of pages allowed for queueing by all QUIC sockets.\n+\n+\tmin: below this number of pages QUIC is not bothered about its\n+\tmemory appetite.\n+\n+\tpressure: when amount of memory allocated by QUIC exceeds this number\n+\tof pages, QUIC moderates its memory consumption and enters memory\n+\tpressure mode, which is exited when memory consumption falls\n+\tunder \"min\".\n+\n+\tmax: number of pages allowed for queueing by all QUIC sockets.\n+\n+\tDefaults are calculated at boot time from amount of available\n+\tmemory.\n+\n+quic_rmem - vector of 3 INTEGERs: min, default, max\n+\tOnly the first value (\"min\") is used, \"default\" and \"max\" are\n+\tignored.\n+\n+\tmin: Minimal size of receive buffer used by QUIC sockets.\n+\tIt is guaranteed to each QUIC socket, even under moderate memory\n+\tpressure.\n+\n+\tDefault: 4K\n+\n+quic_wmem - vector of 3 INTEGERs: min, default, max\n+\tOnly the first value (\"min\") is used, \"default\" and \"max\" are\n+\tignored.\n+\n+\tmin: Amount of memory reserved for send buffers for QUIC sockets.\n+\tEach QUIC socket has rights to use it due to fact of its birth.\n+\n+\tDefault: 4K\n+\n+\n ``/proc/sys/net/core/*``\n ========================\n \ndiff --git a/MAINTAINERS b/MAINTAINERS\nindex 7d65f9435950..532030036a8c 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -21896,6 +21896,13 @@ L:\tlinux-wireless@vger.kernel.org\n S:\tMaintained\n F:\tdrivers/net/wireless/quantenna/\n \n+QUIC PROTOCOL\n+M:\tXin Long <lucien.xin@gmail.com>\n+L:\tquic@lists.linux.dev\n+S:\tMaintained\n+W:\thttps://github.com/lxin/quic\n+F:\tnet/quic/\n+\n RADEON and AMDGPU DRM DRIVERS\n M:\tAlex Deucher <alexander.deucher@amd.com>\n M:\tChristian König <christian.koenig@amd.com>\ndiff --git a/net/Kconfig b/net/Kconfig\nindex 62266eaf0e95..dd2ed8420102 100644\n--- a/net/Kconfig\n+++ b/net/Kconfig\n@@ -251,6 +251,7 @@ source \"net/bridge/netfilter/Kconfig\"\n \n endif # if NETFILTER\n \n+source \"net/quic/Kconfig\"\n source \"net/sctp/Kconfig\"\n source \"net/rds/Kconfig\"\n source \"net/tipc/Kconfig\"\ndiff --git a/net/Makefile b/net/Makefile\nindex 90e3d72bf58b..cd43d03907cd 100644\n--- a/net/Makefile\n+++ b/net/Makefile\n@@ -43,6 +43,7 @@ obj-$(CONFIG_PHONET)\t\t+= phonet/\n ifneq ($(CONFIG_VLAN_8021Q),)\n obj-y\t\t\t\t+= 8021q/\n endif\n+obj-$(CONFIG_IP_QUIC)\t\t+= quic/\n obj-$(CONFIG_IP_SCTP)\t\t+= sctp/\n obj-$(CONFIG_RDS)\t\t+= rds/\n obj-$(CONFIG_WIRELESS)\t\t+= wireless/\ndiff --git a/net/quic/Kconfig b/net/quic/Kconfig\nnew file mode 100644\nindex 000000000000..bbd174c02c1f\n--- /dev/null\n+++ b/net/quic/Kconfig\n@@ -0,0 +1,36 @@\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+#\n+# QUIC configuration\n+#\n+\n+menuconfig IP_QUIC\n+\ttristate \"QUIC: A UDP-Based Multiplexed Secure Transport (Experimental)\"\n+\tdepends on INET\n+\tdepends on IPV6\n+\tselect CRYPTO\n+\tselect CRYPTO_HMAC\n+\tselect CRYPTO_HKDF\n+\tselect CRYPTO_AES\n+\tselect CRYPTO_GCM\n+\tselect CRYPTO_CCM\n+\tselect CRYPTO_CHACHA20POLY1305\n+\tselect NET_UDP_TUNNEL\n+\tdefault n\n+\thelp\n+\t  QUIC: A UDP-Based Multiplexed and Secure Transport\n+\n+\t  From rfc9000 <https://www.rfc-editor.org/rfc/rfc9000.html>.\n+\n+\t  QUIC provides applications with flow-controlled streams for structured\n+\t  communication, low-latency connection establishment, and network path\n+\t  migration.  QUIC includes security measures that ensure\n+\t  confidentiality, integrity, and availability in a range of deployment\n+\t  circumstances.  Accompanying documents describe the integration of\n+\t  TLS for key negotiation, loss detection, and an exemplary congestion\n+\t  control algorithm.\n+\n+\t  To compile this protocol support as a module, choose M here: the\n+\t  module will be called quic. Debug messages are handled by the\n+\t  kernel's dynamic debugging framework.\n+\n+\t  If in doubt, say N.\ndiff --git a/net/quic/Makefile b/net/quic/Makefile\nnew file mode 100644\nindex 000000000000..020e4dd133d8\n--- /dev/null\n+++ b/net/quic/Makefile\n@@ -0,0 +1,8 @@\n+# SPDX-License-Identifier: GPL-2.0-or-later\n+#\n+# Makefile for QUIC support code.\n+#\n+\n+obj-$(CONFIG_IP_QUIC) += quic.o\n+\n+quic-y := protocol.o socket.o\ndiff --git a/net/quic/protocol.c b/net/quic/protocol.c\nnew file mode 100644\nindex 000000000000..73ccbddeff79\n--- /dev/null\n+++ b/net/quic/protocol.c\n@@ -0,0 +1,376 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/* QUIC kernel implementation\n+ * (C) Copyright Red Hat Corp. 2023\n+ *\n+ * This file is part of the QUIC kernel implementation\n+ *\n+ * Initialization/cleanup for QUIC protocol support.\n+ *\n+ * Written or modified by:\n+ *    Xin Long <lucien.xin@gmail.com>\n+ */\n+\n+#include <net/inet_common.h>\n+#include <linux/proc_fs.h>\n+#include <net/protocol.h>\n+#include <net/rps.h>\n+#include <net/tls.h>\n+\n+#include \"socket.h\"\n+\n+static unsigned int quic_net_id __read_mostly;\n+\n+struct percpu_counter quic_sockets_allocated;\n+\n+DEFINE_STATIC_KEY_FALSE(quic_alpn_demux_key);\n+\n+long sysctl_quic_mem[3];\n+int sysctl_quic_rmem[3];\n+int sysctl_quic_wmem[3];\n+\n+static int quic_inet_connect(struct socket *sock, struct sockaddr_unsized *addr,\n+\t\t\t     int addr_len, int flags)\n+{\n+\tstruct sock *sk = sock->sk;\n+\n+\tif (addr_len < (int)sizeof(addr->sa_family))\n+\t\treturn -EINVAL;\n+\n+\treturn sk->sk_prot->connect(sk, addr, addr_len);\n+}\n+\n+static int quic_inet_listen(struct socket *sock, int backlog)\n+{\n+\treturn -EOPNOTSUPP;\n+}\n+\n+static int quic_inet_getname(struct socket *sock, struct sockaddr *uaddr,\n+\t\t\t     int peer)\n+{\n+\treturn -EOPNOTSUPP;\n+}\n+\n+static __poll_t quic_inet_poll(struct file *file, struct socket *sock,\n+\t\t\t       poll_table *wait)\n+{\n+\treturn 0;\n+}\n+\n+static struct ctl_table quic_table[] = {\n+\t{\n+\t\t.procname\t= \"quic_mem\",\n+\t\t.data\t\t= &sysctl_quic_mem,\n+\t\t.maxlen\t\t= sizeof(sysctl_quic_mem),\n+\t\t.mode\t\t= 0644,\n+\t\t.proc_handler\t= proc_doulongvec_minmax\n+\t},\n+\t{\n+\t\t.procname\t= \"quic_rmem\",\n+\t\t.data\t\t= &sysctl_quic_rmem,\n+\t\t.maxlen\t\t= sizeof(sysctl_quic_rmem),\n+\t\t.mode\t\t= 0644,\n+\t\t.proc_handler\t= proc_dointvec,\n+\t},\n+\t{\n+\t\t.procname\t= \"quic_wmem\",\n+\t\t.data\t\t= &sysctl_quic_wmem,\n+\t\t.maxlen\t\t= sizeof(sysctl_quic_wmem),\n+\t\t.mode\t\t= 0644,\n+\t\t.proc_handler\t= proc_dointvec,\n+\t},\n+};\n+\n+struct quic_net *quic_net(struct net *net)\n+{\n+\treturn net_generic(net, quic_net_id);\n+}\n+\n+#if IS_ENABLED(CONFIG_PROC_FS)\n+static const struct snmp_mib quic_snmp_list[] = {\n+\tSNMP_MIB_ITEM(\"QuicConnCurrentEstabs\", QUIC_MIB_CONN_CURRENTESTABS),\n+\tSNMP_MIB_ITEM(\"QuicConnPassiveEstabs\", QUIC_MIB_CONN_PASSIVEESTABS),\n+\tSNMP_MIB_ITEM(\"QuicConnActiveEstabs\", QUIC_MIB_CONN_ACTIVEESTABS),\n+\tSNMP_MIB_ITEM(\"QuicPktRcvFastpaths\", QUIC_MIB_PKT_RCVFASTPATHS),\n+\tSNMP_MIB_ITEM(\"QuicPktDecFastpaths\", QUIC_MIB_PKT_DECFASTPATHS),\n+\tSNMP_MIB_ITEM(\"QuicPktEncFastpaths\", QUIC_MIB_PKT_ENCFASTPATHS),\n+\tSNMP_MIB_ITEM(\"QuicPktRcvBacklogs\", QUIC_MIB_PKT_RCVBACKLOGS),\n+\tSNMP_MIB_ITEM(\"QuicPktDecBacklogs\", QUIC_MIB_PKT_DECBACKLOGS),\n+\tSNMP_MIB_ITEM(\"QuicPktEncBacklogs\", QUIC_MIB_PKT_ENCBACKLOGS),\n+\tSNMP_MIB_ITEM(\"QuicPktInvHdrDrop\", QUIC_MIB_PKT_INVHDRDROP),\n+\tSNMP_MIB_ITEM(\"QuicPktInvNumDrop\", QUIC_MIB_PKT_INVNUMDROP),\n+\tSNMP_MIB_ITEM(\"QuicPktInvFrmDrop\", QUIC_MIB_PKT_INVFRMDROP),\n+\tSNMP_MIB_ITEM(\"QuicPktRcvDrop\", QUIC_MIB_PKT_RCVDROP),\n+\tSNMP_MIB_ITEM(\"QuicPktDecDrop\", QUIC_MIB_PKT_DECDROP),\n+\tSNMP_MIB_ITEM(\"QuicPktEncDrop\", QUIC_MIB_PKT_ENCDROP),\n+\tSNMP_MIB_ITEM(\"QuicFrmRcvBufDrop\", QUIC_MIB_FRM_RCVBUFDROP),\n+\tSNMP_MIB_ITEM(\"QuicFrmRetrans\", QUIC_MIB_FRM_RETRANS),\n+\tSNMP_MIB_ITEM(\"QuicFrmOutCloses\", QUIC_MIB_FRM_OUTCLOSES),\n+\tSNMP_MIB_ITEM(\"QuicFrmInCloses\", QUIC_MIB_FRM_INCLOSES),\n+};\n+\n+static int quic_snmp_seq_show(struct seq_file *seq, void *v)\n+{\n+\tunsigned long buff[ARRAY_SIZE(quic_snmp_list)];\n+\tconst int cnt = ARRAY_SIZE(quic_snmp_list);\n+\tstruct net *net = seq->private;\n+\tu32 idx;\n+\n+\tmemset(buff, 0, sizeof(buff));\n+\n+\tsnmp_get_cpu_field_batch_cnt(buff, quic_snmp_list, cnt,\n+\t\t\t\t     quic_net(net)->stat);\n+\tfor (idx = 0; idx < cnt; idx++)\n+\t\tseq_printf(seq, \"%-32s\\t%lu\\n\", quic_snmp_list[idx].name,\n+\t\t\t   buff[idx]);\n+\n+\treturn 0;\n+}\n+\n+static int quic_net_proc_init(struct net *net)\n+{\n+\tquic_net(net)->proc_net = proc_net_mkdir(net, \"quic\", net->proc_net);\n+\tif (!quic_net(net)->proc_net)\n+\t\treturn -ENOMEM;\n+\n+\tif (!proc_create_net_single(\"snmp\", 0444, quic_net(net)->proc_net,\n+\t\t\t\t    quic_snmp_seq_show, NULL))\n+\t\tgoto free;\n+\treturn 0;\n+free:\n+\tremove_proc_subtree(\"quic\", net->proc_net);\n+\tquic_net(net)->proc_net = NULL;\n+\treturn -ENOMEM;\n+}\n+\n+static void quic_net_proc_exit(struct net *net)\n+{\n+\tremove_proc_subtree(\"quic\", net->proc_net);\n+\tquic_net(net)->proc_net = NULL;\n+}\n+#endif\n+\n+static const struct proto_ops quic_proto_ops = {\n+\t.family\t\t   = PF_INET,\n+\t.owner\t\t   = THIS_MODULE,\n+\t.release\t   = inet_release,\n+\t.bind\t\t   = inet_bind,\n+\t.connect\t   = quic_inet_connect,\n+\t.socketpair\t   = sock_no_socketpair,\n+\t.accept\t\t   = inet_accept,\n+\t.getname\t   = quic_inet_getname,\n+\t.poll\t\t   = quic_inet_poll,\n+\t.ioctl\t\t   = inet_ioctl,\n+\t.gettstamp\t   = sock_gettstamp,\n+\t.listen\t\t   = quic_inet_listen,\n+\t.shutdown\t   = inet_shutdown,\n+\t.setsockopt\t   = sock_common_setsockopt,\n+\t.getsockopt\t   = sock_common_getsockopt,\n+\t.sendmsg\t   = inet_sendmsg,\n+\t.recvmsg\t   = inet_recvmsg,\n+\t.mmap\t\t   = sock_no_mmap,\n+};\n+\n+static struct inet_protosw quic_stream_protosw = {\n+\t.type       = SOCK_STREAM,\n+\t.protocol   = IPPROTO_QUIC,\n+\t.prot       = &quic_prot,\n+\t.ops        = &quic_proto_ops,\n+};\n+\n+static struct inet_protosw quic_dgram_protosw = {\n+\t.type       = SOCK_DGRAM,\n+\t.protocol   = IPPROTO_QUIC,\n+\t.prot       = &quic_prot,\n+\t.ops        = &quic_proto_ops,\n+};\n+\n+static const struct proto_ops quicv6_proto_ops = {\n+\t.family\t\t   = PF_INET6,\n+\t.owner\t\t   = THIS_MODULE,\n+\t.release\t   = inet6_release,\n+\t.bind\t\t   = inet6_bind,\n+\t.connect\t   = quic_inet_connect,\n+\t.socketpair\t   = sock_no_socketpair,\n+\t.accept\t\t   = inet_accept,\n+\t.getname\t   = quic_inet_getname,\n+\t.poll\t\t   = quic_inet_poll,\n+\t.ioctl\t\t   = inet6_ioctl,\n+\t.gettstamp\t   = sock_gettstamp,\n+\t.listen\t\t   = quic_inet_listen,\n+\t.shutdown\t   = inet_shutdown,\n+\t.setsockopt\t   = sock_common_setsockopt,\n+\t.getsockopt\t   = sock_common_getsockopt,\n+\t.sendmsg\t   = inet_sendmsg,\n+\t.recvmsg\t   = inet_recvmsg,\n+\t.mmap\t\t   = sock_no_mmap,\n+};\n+\n+static struct inet_protosw quicv6_stream_protosw = {\n+\t.type       = SOCK_STREAM,\n+\t.protocol   = IPPROTO_QUIC,\n+\t.prot       = &quicv6_prot,\n+\t.ops        = &quicv6_proto_ops,\n+};\n+\n+static struct inet_protosw quicv6_dgram_protosw = {\n+\t.type       = SOCK_DGRAM,\n+\t.protocol   = IPPROTO_QUIC,\n+\t.prot       = &quicv6_prot,\n+\t.ops        = &quicv6_proto_ops,\n+};\n+\n+static int quic_protosw_init(void)\n+{\n+\tint err;\n+\n+\terr = proto_register(&quic_prot, 1);\n+\tif (err)\n+\t\treturn err;\n+\n+\terr = proto_register(&quicv6_prot, 1);\n+\tif (err) {\n+\t\tproto_unregister(&quic_prot);\n+\t\treturn err;\n+\t}\n+\n+\tinet_register_protosw(&quic_stream_protosw);\n+\tinet_register_protosw(&quic_dgram_protosw);\n+\tinet6_register_protosw(&quicv6_stream_protosw);\n+\tinet6_register_protosw(&quicv6_dgram_protosw);\n+\n+\treturn 0;\n+}\n+\n+static void quic_protosw_exit(void)\n+{\n+\tinet_unregister_protosw(&quic_dgram_protosw);\n+\tinet_unregister_protosw(&quic_stream_protosw);\n+\tproto_unregister(&quic_prot);\n+\n+\tinet6_unregister_protosw(&quicv6_dgram_protosw);\n+\tinet6_unregister_protosw(&quicv6_stream_protosw);\n+\tproto_unregister(&quicv6_prot);\n+}\n+\n+static int __net_init quic_net_init(struct net *net)\n+{\n+\tstruct quic_net *qn = quic_net(net);\n+\tint err = 0;\n+\n+\tqn->stat = alloc_percpu(struct quic_mib);\n+\tif (!qn->stat)\n+\t\treturn -ENOMEM;\n+\n+#if IS_ENABLED(CONFIG_PROC_FS)\n+\terr = quic_net_proc_init(net);\n+\tif (err) {\n+\t\tfree_percpu(qn->stat);\n+\t\tqn->stat = NULL;\n+\t}\n+#endif\n+\treturn err;\n+}\n+\n+static void __net_exit quic_net_exit(struct net *net)\n+{\n+\tstruct quic_net *qn = quic_net(net);\n+\n+#if IS_ENABLED(CONFIG_PROC_FS)\n+\tquic_net_proc_exit(net);\n+#endif\n+\tfree_percpu(qn->stat);\n+\tqn->stat = NULL;\n+}\n+\n+static struct pernet_operations quic_net_ops = {\n+\t.init = quic_net_init,\n+\t.exit = quic_net_exit,\n+\t.id   = &quic_net_id,\n+\t.size = sizeof(struct quic_net),\n+};\n+\n+#if IS_ENABLED(CONFIG_SYSCTL)\n+static struct ctl_table_header *quic_sysctl_header;\n+\n+static void quic_sysctl_register(void)\n+{\n+\tquic_sysctl_header = register_net_sysctl(&init_net, \"net/quic\",\n+\t\t\t\t\t\t quic_table);\n+}\n+\n+static void quic_sysctl_unregister(void)\n+{\n+\tunregister_net_sysctl_table(quic_sysctl_header);\n+}\n+#endif\n+\n+static __init int quic_init(void)\n+{\n+\tint max_share, err = -ENOMEM;\n+\tunsigned long limit;\n+\n+\t/* Set QUIC memory limits based on available system memory, similar to\n+\t * sctp_init().\n+\t */\n+\tlimit = nr_free_buffer_pages() / 8;\n+\tlimit = max(limit, 128UL);\n+\tsysctl_quic_mem[0] = (long)limit / 4 * 3;\n+\tsysctl_quic_mem[1] = (long)limit;\n+\tsysctl_quic_mem[2] = sysctl_quic_mem[0] * 2;\n+\n+\tlimit = (sysctl_quic_mem[1]) << (PAGE_SHIFT - 7);\n+\tmax_share = min(4UL * 1024 * 1024, limit);\n+\n+\tsysctl_quic_rmem[0] = PAGE_SIZE;\n+\tsysctl_quic_rmem[1] = 1024 * 1024;\n+\tsysctl_quic_rmem[2] = max(sysctl_quic_rmem[1], max_share);\n+\n+\tsysctl_quic_wmem[0] = PAGE_SIZE;\n+\tsysctl_quic_wmem[1] = 16 * 1024;\n+\tsysctl_quic_wmem[2] = max(64 * 1024, max_share);\n+\n+\terr = percpu_counter_init(&quic_sockets_allocated, 0, GFP_KERNEL);\n+\tif (err)\n+\t\tgoto err_percpu_counter;\n+\n+\terr = register_pernet_subsys(&quic_net_ops);\n+\tif (err)\n+\t\tgoto err_def_ops;\n+\n+\terr = quic_protosw_init();\n+\tif (err)\n+\t\tgoto err_protosw;\n+\n+#if IS_ENABLED(CONFIG_SYSCTL)\n+\tquic_sysctl_register();\n+#endif\n+\tpr_info(\"quic: init\\n\");\n+\treturn 0;\n+\n+err_protosw:\n+\tunregister_pernet_subsys(&quic_net_ops);\n+err_def_ops:\n+\tpercpu_counter_destroy(&quic_sockets_allocated);\n+err_percpu_counter:\n+\treturn err;\n+}\n+\n+static __exit void quic_exit(void)\n+{\n+#if IS_ENABLED(CONFIG_SYSCTL)\n+\tquic_sysctl_unregister();\n+#endif\n+\tquic_protosw_exit();\n+\tunregister_pernet_subsys(&quic_net_ops);\n+\tpercpu_counter_destroy(&quic_sockets_allocated);\n+\tpr_info(\"quic: exit\\n\");\n+}\n+\n+module_init(quic_init);\n+module_exit(quic_exit);\n+\n+MODULE_ALIAS_NET_PF_PROTO(PF_INET, 261); /* IPPROTO_QUIC == 261 */\n+MODULE_ALIAS_NET_PF_PROTO(PF_INET6, 261);\n+MODULE_AUTHOR(\"Xin Long <lucien.xin@gmail.com>\");\n+MODULE_DESCRIPTION(\"Support for the QUIC protocol (RFC9000)\");\n+MODULE_LICENSE(\"GPL\");\ndiff --git a/net/quic/protocol.h b/net/quic/protocol.h\nnew file mode 100644\nindex 000000000000..fbd0fe39eccc\n--- /dev/null\n+++ b/net/quic/protocol.h\n@@ -0,0 +1,57 @@\n+/* SPDX-License-Identifier: GPL-2.0-or-later */\n+/* QUIC kernel implementation\n+ * (C) Copyright Red Hat Corp. 2023\n+ *\n+ * This file is part of the QUIC kernel implementation\n+ *\n+ * Written or modified by:\n+ *    Xin Long <lucien.xin@gmail.com>\n+ */\n+\n+extern struct percpu_counter quic_sockets_allocated;\n+\n+DECLARE_STATIC_KEY_FALSE(quic_alpn_demux_key);\n+\n+extern long sysctl_quic_mem[3];\n+extern int sysctl_quic_rmem[3];\n+extern int sysctl_quic_wmem[3];\n+\n+enum {\n+\tQUIC_MIB_NUM = 0,\n+\tQUIC_MIB_CONN_CURRENTESTABS, /* Current established connections */\n+\tQUIC_MIB_CONN_PASSIVEESTABS, /* Passively established connections */\n+\tQUIC_MIB_CONN_ACTIVEESTABS,  /* Actively established connections */\n+\tQUIC_MIB_PKT_RCVFASTPATHS,   /* Packets received on fast path */\n+\tQUIC_MIB_PKT_DECFASTPATHS,   /* Packets decrypted on fast path */\n+\tQUIC_MIB_PKT_ENCFASTPATHS,   /* Packets encrypted on fast path */\n+\tQUIC_MIB_PKT_RCVBACKLOGS,    /* Packets processed via backlog */\n+\tQUIC_MIB_PKT_DECBACKLOGS,    /* Packets decrypted in backlog */\n+\tQUIC_MIB_PKT_ENCBACKLOGS,    /* Packets encrypted in backlog */\n+\tQUIC_MIB_PKT_INVHDRDROP,     /* Dropped: invalid packet header */\n+\tQUIC_MIB_PKT_INVNUMDROP,     /* Dropped: invalid packet number */\n+\tQUIC_MIB_PKT_INVFRMDROP,     /* Dropped: invalid frame */\n+\tQUIC_MIB_PKT_RCVDROP,        /* Dropped on receive (general) */\n+\tQUIC_MIB_PKT_DECDROP,        /* Dropped: decryption failure */\n+\tQUIC_MIB_PKT_ENCDROP,        /* Dropped: encryption failure */\n+\tQUIC_MIB_FRM_RCVBUFDROP,     /* Frames dropped: recv buf limit */\n+\tQUIC_MIB_FRM_RETRANS,        /* Frames retransmitted */\n+\tQUIC_MIB_FRM_OUTCLOSES,      /* CONNECTION_CLOSE frames sent */\n+\tQUIC_MIB_FRM_INCLOSES,       /* CONNECTION_CLOSE frames rcvd */\n+\tQUIC_MIB_MAX\n+};\n+\n+struct quic_mib {\n+\tunsigned long mibs[QUIC_MIB_MAX]; /* Counters indexed by QUIC_MIB_* */\n+};\n+\n+struct quic_net {\n+\tDEFINE_SNMP_STAT(struct quic_mib, stat); /* Per-net QUIC MIB stats */\n+#if IS_ENABLED(CONFIG_PROC_FS)\n+\tstruct proc_dir_entry *proc_net; /* procfs entry for QUIC stats */\n+#endif\n+};\n+\n+struct quic_net *quic_net(struct net *net);\n+\n+#define QUIC_INC_STATS(net, field) SNMP_INC_STATS(quic_net(net)->stat, field)\n+#define QUIC_DEC_STATS(net, field) SNMP_DEC_STATS(quic_net(net)->stat, field)\ndiff --git a/net/quic/socket.c b/net/quic/socket.c\nnew file mode 100644\nindex 000000000000..6605266eaa59\n--- /dev/null\n+++ b/net/quic/socket.c\n@@ -0,0 +1,210 @@\n+// SPDX-License-Identifier: GPL-2.0-or-later\n+/* QUIC kernel implementation\n+ * (C) Copyright Red Hat Corp. 2023\n+ *\n+ * This file is part of the QUIC kernel implementation\n+ *\n+ * Initialization/cleanup for QUIC protocol support.\n+ *\n+ * Written or modified by:\n+ *    Xin Long <lucien.xin@gmail.com>\n+ */\n+\n+#include <net/inet_common.h>\n+#include <net/tls.h>\n+\n+#include \"socket.h\"\n+\n+static DEFINE_PER_CPU(int, quic_memory_per_cpu_fw_alloc);\n+static unsigned long quic_memory_pressure;\n+static atomic_long_t quic_memory_allocated;\n+\n+static void quic_enter_memory_pressure(struct sock *sk)\n+{\n+\tWRITE_ONCE(quic_memory_pressure, 1);\n+}\n+\n+static void quic_write_space(struct sock *sk)\n+{\n+\t__poll_t mask = EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;\n+\tstruct socket_wq *wq;\n+\n+\trcu_read_lock();\n+\twq = rcu_dereference(sk->sk_wq);\n+\tif (skwq_has_sleeper(wq))\n+\t\twake_up_interruptible_sync_poll(&wq->wait, mask);\n+\trcu_read_unlock();\n+}\n+\n+static int quic_init_sock(struct sock *sk)\n+{\n+\tsk->sk_destruct = inet_sock_destruct;\n+\tsk->sk_write_space = quic_write_space;\n+\tsock_set_flag(sk, SOCK_USE_WRITE_QUEUE);\n+\n+\tsk_sockets_allocated_inc(sk);\n+\tsock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);\n+\n+\treturn 0;\n+}\n+\n+static void quic_destroy_sock(struct sock *sk)\n+{\n+\tsk_sockets_allocated_dec(sk);\n+\tsock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);\n+}\n+\n+static int quic_bind(struct sock *sk, struct sockaddr_unsized *addr,\n+\t\t     int addr_len)\n+{\n+\treturn -EOPNOTSUPP;\n+}\n+\n+static int quic_connect(struct sock *sk, struct sockaddr_unsized *addr,\n+\t\t\tint addr_len)\n+{\n+\treturn -EOPNOTSUPP;\n+}\n+\n+static int quic_hash(struct sock *sk)\n+{\n+\treturn 0;\n+}\n+\n+static void quic_unhash(struct sock *sk)\n+{\n+}\n+\n+static int quic_sendmsg(struct sock *sk, struct msghdr *msg, size_t msg_len)\n+{\n+\treturn -EOPNOTSUPP;\n+}\n+\n+static int quic_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,\n+\t\t\tint flags)\n+{\n+\treturn -EOPNOTSUPP;\n+}\n+\n+static struct sock *quic_accept(struct sock *sk, struct proto_accept_arg *arg)\n+{\n+\targ->err = -EOPNOTSUPP;\n+\treturn NULL;\n+}\n+\n+static void quic_close(struct sock *sk, long timeout)\n+{\n+\tlock_sock(sk);\n+\n+\tquic_set_state(sk, QUIC_SS_CLOSED);\n+\n+\trelease_sock(sk);\n+\n+\tsk_common_release(sk);\n+}\n+\n+static int quic_do_setsockopt(struct sock *sk, int optname, sockptr_t optval,\n+\t\t\t      unsigned int optlen)\n+{\n+\treturn -EOPNOTSUPP;\n+}\n+\n+static int quic_setsockopt(struct sock *sk, int level, int optname,\n+\t\t\t   sockptr_t optval, unsigned int optlen)\n+{\n+\tif (level != SOL_QUIC)\n+\t\treturn -EOPNOTSUPP;\n+\n+\treturn quic_do_setsockopt(sk, optname, optval, optlen);\n+}\n+\n+static int quic_do_getsockopt(struct sock *sk, int optname, sockptr_t optval,\n+\t\t\t      sockptr_t optlen)\n+{\n+\treturn -EOPNOTSUPP;\n+}\n+\n+static int quic_getsockopt(struct sock *sk, int level, int optname,\n+\t\t\t   char __user *optval, int __user *optlen)\n+{\n+\tif (level != SOL_QUIC)\n+\t\treturn -EOPNOTSUPP;\n+\n+\treturn quic_do_getsockopt(sk, optname, USER_SOCKPTR(optval),\n+\t\t\t\t  USER_SOCKPTR(optlen));\n+}\n+\n+static void quic_release_cb(struct sock *sk)\n+{\n+}\n+\n+static int quic_disconnect(struct sock *sk, int flags)\n+{\n+\treturn -EOPNOTSUPP;\n+}\n+\n+static void quic_shutdown(struct sock *sk, int how)\n+{\n+\tquic_set_state(sk, QUIC_SS_CLOSED);\n+}\n+\n+struct proto quic_prot = {\n+\t.name\t\t=  \"QUIC\",\n+\t.owner\t\t=  THIS_MODULE,\n+\t.init\t\t=  quic_init_sock,\n+\t.destroy\t=  quic_destroy_sock,\n+\t.shutdown\t=  quic_shutdown,\n+\t.setsockopt\t=  quic_setsockopt,\n+\t.getsockopt\t=  quic_getsockopt,\n+\t.connect\t=  quic_connect,\n+\t.bind\t\t=  quic_bind,\n+\t.close\t\t=  quic_close,\n+\t.disconnect\t=  quic_disconnect,\n+\t.sendmsg\t=  quic_sendmsg,\n+\t.recvmsg\t=  quic_recvmsg,\n+\t.accept\t\t=  quic_accept,\n+\t.hash\t\t=  quic_hash,\n+\t.unhash\t\t=  quic_unhash,\n+\t.release_cb\t=  quic_release_cb,\n+\t.no_autobind\t=  true,\n+\t.obj_size\t=  sizeof(struct quic_sock),\n+\t.sysctl_mem\t\t=  sysctl_quic_mem,\n+\t.sysctl_rmem\t\t=  sysctl_quic_rmem,\n+\t.sysctl_wmem\t\t=  sysctl_quic_wmem,\n+\t.memory_pressure\t=  &quic_memory_pressure,\n+\t.enter_memory_pressure\t=  quic_enter_memory_pressure,\n+\t.memory_allocated\t=  &quic_memory_allocated,\n+\t.per_cpu_fw_alloc\t=  &quic_memory_per_cpu_fw_alloc,\n+\t.sockets_allocated\t=  &quic_sockets_allocated,\n+};\n+\n+struct proto quicv6_prot = {\n+\t.name\t\t=  \"QUICv6\",\n+\t.owner\t\t=  THIS_MODULE,\n+\t.init\t\t=  quic_init_sock,\n+\t.destroy\t=  quic_destroy_sock,\n+\t.shutdown\t=  quic_shutdown,\n+\t.setsockopt\t=  quic_setsockopt,\n+\t.getsockopt\t=  quic_getsockopt,\n+\t.connect\t=  quic_connect,\n+\t.bind\t\t=  quic_bind,\n+\t.close\t\t=  quic_close,\n+\t.disconnect\t=  quic_disconnect,\n+\t.sendmsg\t=  quic_sendmsg,\n+\t.recvmsg\t=  quic_recvmsg,\n+\t.accept\t\t=  quic_accept,\n+\t.hash\t\t=  quic_hash,\n+\t.unhash\t\t=  quic_unhash,\n+\t.release_cb\t=  quic_release_cb,\n+\t.no_autobind\t=  true,\n+\t.obj_size\t= sizeof(struct quic6_sock),\n+\t.ipv6_pinfo_offset\t=  offsetof(struct quic6_sock, inet6),\n+\t.sysctl_mem\t\t=  sysctl_quic_mem,\n+\t.sysctl_rmem\t\t=  sysctl_quic_rmem,\n+\t.sysctl_wmem\t\t=  sysctl_quic_wmem,\n+\t.memory_pressure\t=  &quic_memory_pressure,\n+\t.enter_memory_pressure\t=  quic_enter_memory_pressure,\n+\t.memory_allocated\t=  &quic_memory_allocated,\n+\t.per_cpu_fw_alloc\t=  &quic_memory_per_cpu_fw_alloc,\n+\t.sockets_allocated\t=  &quic_sockets_allocated,\n+};\ndiff --git a/net/quic/socket.h b/net/quic/socket.h\nnew file mode 100644\nindex 000000000000..98d3f738e909\n--- /dev/null\n+++ b/net/quic/socket.h\n@@ -0,0 +1,89 @@\n+/* SPDX-License-Identifier: GPL-2.0-or-later */\n+/* QUIC kernel implementation\n+ * (C) Copyright Red Hat Corp. 2023\n+ *\n+ * This file is part of the QUIC kernel implementation\n+ *\n+ * Written or modified by:\n+ *    Xin Long <lucien.xin@gmail.com>\n+ */\n+\n+#include <net/udp_tunnel.h>\n+\n+#include \"protocol.h\"\n+\n+extern struct proto quic_prot;\n+extern struct proto quicv6_prot;\n+\n+enum quic_state {\n+\tQUIC_SS_CLOSED\t\t= TCP_CLOSE,\n+\tQUIC_SS_LISTENING\t= TCP_LISTEN,\n+\tQUIC_SS_ESTABLISHING\t= TCP_SYN_RECV,\n+\tQUIC_SS_ESTABLISHED\t= TCP_ESTABLISHED,\n+};\n+\n+struct quic_sock {\n+\tstruct inet_sock\t\tinet;\n+\tstruct list_head\t\treqs;\n+};\n+\n+struct quic6_sock {\n+\tstruct quic_sock\tquic;\n+\tstruct ipv6_pinfo\tinet6;\n+};\n+\n+static inline struct quic_sock *quic_sk(const struct sock *sk)\n+{\n+\treturn (struct quic_sock *)sk;\n+}\n+\n+static inline struct list_head *quic_reqs(const struct sock *sk)\n+{\n+\treturn &quic_sk(sk)->reqs;\n+}\n+\n+static inline bool quic_is_serv(const struct sock *sk)\n+{\n+\treturn !!sk->sk_max_ack_backlog;\n+}\n+\n+static inline bool quic_is_establishing(struct sock *sk)\n+{\n+\treturn sk->sk_state == QUIC_SS_ESTABLISHING;\n+}\n+\n+static inline bool quic_is_established(struct sock *sk)\n+{\n+\treturn sk->sk_state == QUIC_SS_ESTABLISHED;\n+}\n+\n+static inline bool quic_is_listen(struct sock *sk)\n+{\n+\treturn sk->sk_state == QUIC_SS_LISTENING;\n+}\n+\n+static inline bool quic_is_closed(struct sock *sk)\n+{\n+\treturn sk->sk_state == QUIC_SS_CLOSED;\n+}\n+\n+static inline void quic_set_state(struct sock *sk, int state)\n+{\n+\tstruct net *net = sock_net(sk);\n+\tint mib;\n+\n+\tif (sk->sk_state == state)\n+\t\treturn;\n+\n+\tif (state == QUIC_SS_ESTABLISHED) {\n+\t\tmib = quic_is_serv(sk) ? QUIC_MIB_CONN_PASSIVEESTABS :\n+\t\t\t\t\t QUIC_MIB_CONN_ACTIVEESTABS;\n+\t\tQUIC_INC_STATS(net, mib);\n+\t\tQUIC_INC_STATS(net, QUIC_MIB_CONN_CURRENTESTABS);\n+\t} else if (quic_is_established(sk)) {\n+\t\tQUIC_DEC_STATS(net, QUIC_MIB_CONN_CURRENTESTABS);\n+\t}\n+\n+\tinet_sk_set_state(sk, state);\n+\tsk->sk_state_change(sk);\n+}\n",
    "prefixes": [
        "net-next",
        "v11",
        "02/15"
    ]
}