Date: Sun, 3 May 2020 00:27:42 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> 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 Message-ID: <202005030027.0430RgIW004401@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005030027.0430RgIW004401>