From nobody Fri Nov 12 14:36:58 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 6845C1842F90; Fri, 12 Nov 2021 14:36:59 +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 4HrLkz0nfJz4QyZ; Fri, 12 Nov 2021 14:36:59 +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 E7ABA21302; Fri, 12 Nov 2021 14:36:58 +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 1ACEawCK081052; Fri, 12 Nov 2021 14:36:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ACEawxX081051; Fri, 12 Nov 2021 14:36:58 GMT (envelope-from git) Date: Fri, 12 Nov 2021 14:36:58 GMT Message-Id: <202111121436.1ACEawxX081051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 4a36455c4179 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 4a36455c417978a3f7cc62c0e8e05935ab503373 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=4a36455c417978a3f7cc62c0e8e05935ab503373 commit 4a36455c417978a3f7cc62c0e8e05935ab503373 Author: Hans Petter Selasky AuthorDate: 2021-11-04 17:48:23 +0000 Commit: Hans Petter Selasky CommitDate: 2021-11-12 14:33:54 +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@ Sponsored by: NVIDIA Networking (cherry picked from commit dd31400c3c2aa941d057e78296c193959a6d9ed3) --- 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 5588da2dcd20..4fa94fb3019e 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -268,13 +268,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 640856016e0e..9f84d0758bc6 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -494,6 +494,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. */