From nobody Thu Nov 04 17:54:32 2021 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 2BE61183BF9D; Thu, 4 Nov 2021 17:54:34 +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 4HlWVd1ZcQz4nbK; Thu, 4 Nov 2021 17:54:33 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 B7FE391C; Thu, 4 Nov 2021 17:54:32 +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 1A4HsWUj050146; Thu, 4 Nov 2021 17:54:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1A4HsW5c050145; Thu, 4 Nov 2021 17:54:32 GMT (envelope-from git) Date: Thu, 4 Nov 2021 17:54:32 GMT Message-Id: <202111041754.1A4HsW5c050145@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: dd31400c3c2a - main - Factor out flags preserved during mbuf demote into a separate define. 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: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dd31400c3c2aa941d057e78296c193959a6d9ed3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=dd31400c3c2aa941d057e78296c193959a6d9ed3 commit dd31400c3c2aa941d057e78296c193959a6d9ed3 Author: Hans Petter Selasky AuthorDate: 2021-11-04 17:48:23 +0000 Commit: Hans Petter Selasky CommitDate: 2021-11-04 17:53:49 +0000 Factor out flags preserved during mbuf demote into a separate define. This define will later on be used by coming TLS RX hardware offload patches. No functional change intended. Reviewed by: jhb@ MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/kern/uipc_mbuf.c | 5 +++-- sys/sys/mbuf.h | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index e0793a16d76f..0196023bc601 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -278,13 +278,14 @@ m_demote(struct mbuf *m0, int all, int flags) { struct mbuf *m; + flags |= M_DEMOTEFLAGS; + for (m = all ? m0 : m0->m_next; m != NULL; m = m->m_next) { KASSERT(m->m_nextpkt == NULL, ("%s: m_nextpkt in m %p, m0 %p", __func__, m, m0)); if (m->m_flags & M_PKTHDR) m_demote_pkthdr(m); - m->m_flags = m->m_flags & (M_EXT | M_RDONLY | M_NOFREE | - M_EXTPG | flags); + m->m_flags &= flags; } } diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index d0f90805fa78..07a75bd5b47b 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -496,6 +496,12 @@ m_epg_pagelen(const struct mbuf *m, int pidx, int pgoff) (M_PKTHDR|M_EOR|M_RDONLY|M_BCAST|M_MCAST|M_PROMISC|M_VLANTAG|M_TSTMP| \ M_TSTMP_HPREC|M_TSTMP_LRO|M_PROTOFLAGS) +/* + * Flags preserved during demote. + */ +#define M_DEMOTEFLAGS \ + (M_EXT | M_RDONLY | M_NOFREE | M_EXTPG) + /* * Mbuf flag description for use with printf(9) %b identifier. */