From nobody Fri Dec 02 22:11:05 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NP6bF5K9Rz4jTCH; Fri, 2 Dec 2022 22:11:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NP6bF4thCz4R0h; Fri, 2 Dec 2022 22:11:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670019065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eoqvidGAMO3ISk4Lqk/GwYoZ4du40aX5ib9UkKoIN4o=; b=Q/DBb8ZxofIZNpCUCmflt+GGOgHer46bQ0jOzGlUbwtm7q5B3YPd98Rh15hageG2gd43z1 8dnSvZDaBtOu1synrWkc8A4i74gjURH/WeubKpWlBK7bSwAmcNuj5/BvnbrecaaLz2XQRi tclgrTZsR5a+b0TIaqGwkvW9ouEZ9b9Ad1A3WkYm18UQTnS5cbviP2t3PWM5TrcVE7dJem MFda1Sb+O86ZmhazH2JcsMGtTlLeiikONVeCRhMw1D1vxMKQUzF8IeUqHp+webXsQ0Mfqq ehUYSXWhw/yqPdWx758MhizMUzk3ALXjgkF2rAjkCJP+Z0XefQ+NgnBuGvzMLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670019065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eoqvidGAMO3ISk4Lqk/GwYoZ4du40aX5ib9UkKoIN4o=; b=k9dc59FFbjXLQYXP0Gb17kpJsMpq0Ps5u0taYKZfcjPhciFACevr3bnmc+GQbHVjeXbYJi D9LNmIKZWTJB6iOjiwQM0Bj//iMXV8C8OMZX3h9dRdvHDTd9aD/A8r6EWhgAfkMGBgvnBZ 5Z8vRwNrgqZxItt2VKWTQGM25F0AuuKlj0Yqp/7SgN5jcDmVKqOP6vzXwajLmT1QU+tDWU EUycDDjEVDa68IbAFORdkp/E3EBfDAWn6XoCZfzSkmVeYC6PMAKWiMqfNt5LQ2Q2Q4AYuI zWZ/Lx98RUjRpWKahP6uLnanRXmLSMVvv/R6uBq8ajurxk/2ELhN2y+NZeAbUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670019065; a=rsa-sha256; cv=none; b=JH09iGtkTrre8CuCMBHvoysAhapWg49PBLanad97D5r09A1rNTsv86zPbHwBEa6ECp1IUc fh4cA6NlxT2nCR3Xjp03n0ttk7Zr9pjNruMW4tsOWpZXCwmkkyWvKVJpW1m4oHak3g656x zn4e6IxJqu2JVmGIKVUFYLaFpz4XxBUWR+az2bf5z0nXTAGO78QzxkOunL4Klfn6no/XKy yIFFcz902zKaORAMnE9QaFImqWrKyvGcWWLM5gQxDNX+t0do4L/tFdDbogrd9pYCIYc1XX ME6swYX+1ws5DJqkR3/5WmL7jCK37KNG8iZA/AmpeOU2zUX8qU/CHcai5DTErQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NP6bF3dBfzWTj; Fri, 2 Dec 2022 22:11:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2B2MB5lF087456; Fri, 2 Dec 2022 22:11:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B2MB5pq087455; Fri, 2 Dec 2022 22:11:05 GMT (envelope-from git) Date: Fri, 2 Dec 2022 22:11:05 GMT Message-Id: <202212022211.2B2MB5pq087455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 0aa120d52f3c - main - inpcb: allow to provide protocol specific pcb size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0aa120d52f3cec0bdc42441e3d3866b47a97a095 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=0aa120d52f3cec0bdc42441e3d3866b47a97a095 commit 0aa120d52f3cec0bdc42441e3d3866b47a97a095 Author: Gleb Smirnoff AuthorDate: 2022-12-02 22:10:55 +0000 Commit: Gleb Smirnoff CommitDate: 2022-12-02 22:10:55 +0000 inpcb: allow to provide protocol specific pcb size The protocol specific structure shall start with inpcb. Differential revision: https://reviews.freebsd.org/D37126 --- sys/netinet/in_pcb.c | 2 +- sys/netinet/in_pcb.h | 4 +++- sys/netinet/raw_ip.c | 2 +- sys/netinet/tcp_subr.c | 2 +- sys/netinet/udp_usrreq.c | 6 +++--- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index c33d06566b44..3a83682b711f 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -551,7 +551,7 @@ in_pcbstorage_init(void *arg) struct inpcbstorage *pcbstor = arg; pcbstor->ips_zone = uma_zcreate(pcbstor->ips_zone_name, - sizeof(struct inpcb), NULL, inpcb_dtor, pcbstor->ips_pcbinit, + pcbstor->ips_size, NULL, inpcb_dtor, pcbstor->ips_pcbinit, inpcb_fini, UMA_ALIGN_PTR, UMA_ZONE_SMR); pcbstor->ips_portzone = uma_zcreate(pcbstor->ips_portzone_name, sizeof(struct inpcbport), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index e8e6fbd86708..2f9cebb5ef15 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -464,13 +464,14 @@ struct inpcbstorage { uma_zone_t ips_zone; uma_zone_t ips_portzone; uma_init ips_pcbinit; + size_t ips_size; const char * ips_zone_name; const char * ips_portzone_name; const char * ips_infolock_name; const char * ips_hashlock_name; }; -#define INPCBSTORAGE_DEFINE(prot, lname, zname, iname, hname) \ +#define INPCBSTORAGE_DEFINE(prot, ppcb, lname, zname, iname, hname) \ static int \ prot##_inpcb_init(void *mem, int size __unused, int flags __unused) \ { \ @@ -480,6 +481,7 @@ prot##_inpcb_init(void *mem, int size __unused, int flags __unused) \ return (0); \ } \ static struct inpcbstorage prot = { \ + .ips_size = sizeof(struct ppcb), \ .ips_pcbinit = prot##_inpcb_init, \ .ips_zone_name = zname, \ .ips_portzone_name = zname " ports", \ diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 2065b47883bb..7278f9711cec 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -182,7 +182,7 @@ rip_delhash(struct inpcb *inp) } #endif /* INET */ -INPCBSTORAGE_DEFINE(ripcbstor, "rawinp", "ripcb", "rip", "riphash"); +INPCBSTORAGE_DEFINE(ripcbstor, inpcb, "rawinp", "ripcb", "rip", "riphash"); static void rip_init(void *arg __unused) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 58e410edf0bb..6e85d5a77340 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1148,7 +1148,7 @@ static struct mtx isn_mtx; #define ISN_LOCK() mtx_lock(&isn_mtx) #define ISN_UNLOCK() mtx_unlock(&isn_mtx) -INPCBSTORAGE_DEFINE(tcpcbstor, "tcpinp", "tcp_inpcb", "tcp", "tcphash"); +INPCBSTORAGE_DEFINE(tcpcbstor, inpcb, "tcpinp", "tcp_inpcb", "tcp", "tcphash"); /* * Take a value and get the next power of 2 that doesn't overflow. diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 719b39985a0f..5110d63e1092 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -170,9 +170,9 @@ static int udp_output(struct inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct thread *, int); #endif -INPCBSTORAGE_DEFINE(udpcbstor, "udpinp", "udp_inpcb", "udp", "udphash"); -INPCBSTORAGE_DEFINE(udplitecbstor, "udpliteinp", "udplite_inpcb", "udplite", - "udplitehash"); +INPCBSTORAGE_DEFINE(udpcbstor, inpcb, "udpinp", "udp_inpcb", "udp", "udphash"); +INPCBSTORAGE_DEFINE(udplitecbstor, inpcb, "udpliteinp", "udplite_inpcb", + "udplite", "udplitehash"); static void udp_vnet_init(void *arg __unused)