From owner-svn-src-head@freebsd.org Sun May 3 00:27:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C47D2CA1BF; Sun, 3 May 2020 00:27:44 +0000 (UTC) (envelope-from glebius@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49F6Jb6cKJz3Pvd; Sun, 3 May 2020 00:27:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9C952282; Sun, 3 May 2020 00:27:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0430RhOu004409; Sun, 3 May 2020 00:27:43 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0430RgIW004401; Sun, 3 May 2020 00:27:42 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202005030027.0430RgIW004401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 3 May 2020 00:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360582 - in head/sys: dev/cxgbe dev/cxgbe/crypto dev/cxgbe/tom kern sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: dev/cxgbe dev/cxgbe/crypto dev/cxgbe/tom kern sys X-SVN-Commit-Revision: 360582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 May 2020 00:27:44 -0000 Author: glebius Date: Sun May 3 00:27:41 2020 New Revision: 360582 URL: https://svnweb.freebsd.org/changeset/base/360582 Log: Mechanically rename MBUF_EXT_PGS_ASSERT() to M_ASSERTEXTPG() to match classical M_ASSERTPKTHDR. Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D24598 Modified: head/sys/dev/cxgbe/crypto/t4_kern_tls.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/kern/kern_mbuf.c head/sys/kern/subr_bus_dma.c head/sys/kern/subr_sglist.c head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/dev/cxgbe/crypto/t4_kern_tls.c ============================================================================== --- head/sys/dev/cxgbe/crypto/t4_kern_tls.c Sun May 3 00:21:11 2020 (r360581) +++ head/sys/dev/cxgbe/crypto/t4_kern_tls.c Sun May 3 00:27:41 2020 (r360582) @@ -903,7 +903,7 @@ ktls_tcp_payload_length(struct tlspcb *tlsp, struct mb struct tls_record_layer *hdr; u_int plen, mlen; - MBUF_EXT_PGS_ASSERT(m_tls); + M_ASSERTEXTPG(m_tls); hdr = (void *)m_tls->m_epg_hdr; plen = ntohs(hdr->tls_length); @@ -957,7 +957,7 @@ ktls_payload_offset(struct tlspcb *tlsp, struct mbuf * u_int mlen; #endif - MBUF_EXT_PGS_ASSERT(m_tls); + M_ASSERTEXTPG(m_tls); hdr = (void *)m_tls->m_epg_hdr; plen = ntohs(hdr->tls_length); #ifdef INVARIANTS @@ -1002,7 +1002,7 @@ ktls_wr_len(struct tlspcb *tlsp, struct mbuf *m, struc struct tls_record_layer *hdr; u_int imm_len, offset, plen, wr_len, tlen; - MBUF_EXT_PGS_ASSERT(m_tls); + M_ASSERTEXTPG(m_tls); /* * Determine the size of the TLS record payload to send @@ -1466,7 +1466,7 @@ ktls_write_tunnel_packet(struct sge_txq *txq, void *ds M_ASSERTPKTHDR(m); /* Locate the template TLS header. */ - MBUF_EXT_PGS_ASSERT(m_tls); + M_ASSERTEXTPG(m_tls); /* This should always be the last TLS record in a chain. */ MPASS(m_tls->m_next == NULL); @@ -1593,7 +1593,7 @@ ktls_write_tls_wr(struct tlspcb *tlsp, struct sge_txq using_scratch = (eq->sidx - pidx < SGE_MAX_WR_LEN / EQ_ESIZE); /* Locate the TLS header. */ - MBUF_EXT_PGS_ASSERT(m_tls); + M_ASSERTEXTPG(m_tls); hdr = (void *)m_tls->m_epg_hdr; plen = TLS_HEADER_LENGTH + ntohs(hdr->tls_length) - m_tls->m_epg_trllen; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sun May 3 00:21:11 2020 (r360581) +++ head/sys/dev/cxgbe/t4_sge.c Sun May 3 00:27:41 2020 (r360582) @@ -2417,7 +2417,7 @@ count_mbuf_ext_pgs(struct mbuf *m, int skip, vm_paddr_ int i, len, off, pglen, pgoff, seglen, segoff; int nsegs = 0; - MBUF_EXT_PGS_ASSERT(m); + M_ASSERTEXTPG(m); off = mtod(m, vm_offset_t); len = m->m_len; off += skip; Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Sun May 3 00:21:11 2020 (r360581) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Sun May 3 00:27:41 2020 (r360582) @@ -1927,7 +1927,7 @@ aiotx_free_pgs(struct mbuf *m) struct kaiocb *job; vm_page_t pg; - MBUF_EXT_PGS_ASSERT(m); + M_ASSERTEXTPG(m); job = m->m_ext.ext_arg1; #ifdef VERBOSE_TRACES CTR3(KTR_CXGBE, "%s: completed %d bytes for tid %d", __func__, Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Sun May 3 00:21:11 2020 (r360581) +++ head/sys/kern/kern_mbuf.c Sun May 3 00:27:41 2020 (r360582) @@ -941,7 +941,7 @@ _mb_unmapped_to_ext(struct mbuf *m) volatile u_int *refcnt; u_int ref_inc = 0; - MBUF_EXT_PGS_ASSERT(m); + M_ASSERTEXTPG(m); len = m->m_len; KASSERT(m->m_epg_tls == NULL, ("%s: can't convert TLS mbuf %p", __func__, m)); Modified: head/sys/kern/subr_bus_dma.c ============================================================================== --- head/sys/kern/subr_bus_dma.c Sun May 3 00:21:11 2020 (r360581) +++ head/sys/kern/subr_bus_dma.c Sun May 3 00:27:41 2020 (r360582) @@ -121,7 +121,7 @@ _bus_dmamap_load_mbuf_epg(bus_dma_tag_t dmat, bus_dmam { int error, i, off, len, pglen, pgoff, seglen, segoff; - MBUF_EXT_PGS_ASSERT(m); + M_ASSERTEXTPG(m); len = m->m_len; error = 0; Modified: head/sys/kern/subr_sglist.c ============================================================================== --- head/sys/kern/subr_sglist.c Sun May 3 00:21:11 2020 (r360581) +++ head/sys/kern/subr_sglist.c Sun May 3 00:27:41 2020 (r360582) @@ -388,7 +388,7 @@ sglist_append_mbuf_epg(struct sglist *sg, struct mbuf vm_paddr_t paddr; int error, i, pglen, pgoff; - MBUF_EXT_PGS_ASSERT(m); + M_ASSERTEXTPG(m); error = 0; if (m->m_epg_hdrlen != 0) { Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sun May 3 00:21:11 2020 (r360581) +++ head/sys/kern/uipc_mbuf.c Sun May 3 00:27:41 2020 (r360582) @@ -1628,7 +1628,7 @@ mb_free_mext_pgs(struct mbuf *m) { vm_page_t pg; - MBUF_EXT_PGS_ASSERT(m); + M_ASSERTEXTPG(m); for (int i = 0; i < m->m_epg_npgs; i++) { pg = PHYS_TO_VM_PAGE(m->m_epg_pa[i]); vm_page_unwire_noq(pg); @@ -1775,7 +1775,7 @@ m_unmappedtouio(const struct mbuf *m, int m_off, struc vm_page_t pg; int error, i, off, pglen, pgoff, seglen, segoff; - MBUF_EXT_PGS_ASSERT(m); + M_ASSERTEXTPG(m); error = 0; /* Skip over any data removed from the front. */ Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sun May 3 00:21:11 2020 (r360581) +++ head/sys/sys/mbuf.h Sun May 3 00:27:41 2020 (r360582) @@ -608,11 +608,6 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgof "\24EXT_FLAG_VENDOR4\25EXT_FLAG_EXP1\26EXT_FLAG_EXP2\27EXT_FLAG_EXP3" \ "\30EXT_FLAG_EXP4" -#define MBUF_EXT_PGS_ASSERT(m) \ - KASSERT((((m)->m_flags & M_EXT) != 0) && \ - ((m)->m_ext.ext_type == EXT_PGS), \ - ("%s: m %p !M_EXT or !EXT_PGS", __func__, m)) - /* * Flags indicating checksum, segmentation and other offload work to be * done, or already done, by hardware or lower layers. It is split into @@ -1047,6 +1042,11 @@ m_extrefcnt(struct mbuf *m) KASSERT((m) != NULL && (m)->m_flags & M_PKTHDR, \ ("%s: no mbuf packet header!", __func__)) +/* Check if mbuf is multipage. */ +#define M_ASSERTEXTPG(m) \ + KASSERT(((m)->m_flags & (M_EXT|M_EXTPG)) == (M_EXT|M_EXTPG), \ + ("%s: m %p is not multipage!", __func__, m)) + /* * Ensure that the supplied mbuf is a valid, non-free mbuf. * @@ -1560,7 +1560,6 @@ mbuf_has_tls_session(struct mbuf *m) { if (m->m_flags & M_EXTPG) { - MBUF_EXT_PGS_ASSERT(m); if (m->m_epg_tls != NULL) { return (true); }