Mechanically rename MBUF_EXT_PGS_ASSERT() to M_ASSERTEXTPG() to match

classical M_ASSERTPKTHDR.

Reviewed by:	gallatin
Differential Revision:	https://reviews.freebsd.org/D24598
This commit is contained in:
Gleb Smirnoff 2020-05-03 00:27:41 +00:00
parent 6edfd179c8
commit 365e8da44a
8 changed files with 17 additions and 18 deletions

View File

@ -903,7 +903,7 @@ ktls_tcp_payload_length(struct tlspcb *tlsp, struct mbuf *m_tls)
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 *m_tls)
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, struct mbuf *m_tls,
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 *dst, struct mbuf *m,
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 *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;

View File

@ -2417,7 +2417,7 @@ count_mbuf_ext_pgs(struct mbuf *m, int skip, vm_paddr_t *nextaddr)
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;

View File

@ -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__,

View File

@ -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));

View File

@ -121,7 +121,7 @@ _bus_dmamap_load_mbuf_epg(bus_dma_tag_t dmat, bus_dmamap_t map,
{
int error, i, off, len, pglen, pgoff, seglen, segoff;
MBUF_EXT_PGS_ASSERT(m);
M_ASSERTEXTPG(m);
len = m->m_len;
error = 0;

View File

@ -388,7 +388,7 @@ sglist_append_mbuf_epg(struct sglist *sg, struct mbuf *m, size_t off,
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) {

View File

@ -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, struct uio *uio, int len)
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. */

View File

@ -608,11 +608,6 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgoff)
"\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);
}