git: 808b7d80e060 - main - mbuf: remove PH_vt alias for mbuf packet header persistent shared data
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 13 May 2022 20:33:10 UTC
The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=808b7d80e06034b1423c786948670600bc54726f commit 808b7d80e06034b1423c786948670600bc54726f Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2022-05-13 20:32:43 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2022-05-13 20:32:43 +0000 mbuf: remove PH_vt alias for mbuf packet header persistent shared data Mechanical sed change s/PH_vt\.vt_nrecs/vt_nrecs/g --- sys/netinet/igmp.c | 26 +++++++++++++------------- sys/netinet6/mld6.c | 26 +++++++++++++------------- sys/sys/mbuf.h | 3 +-- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index 61a83356a01c..25e2cac621a3 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -2801,7 +2801,7 @@ igmp_v3_enqueue_group_record(struct mbufq *mq, struct in_multi *inm, m0 = mbufq_last(mq); if (!is_group_query && m0 != NULL && - (m0->m_pkthdr.PH_vt.vt_nrecs + 1 <= IGMP_V3_REPORT_MAXRECS) && + (m0->m_pkthdr.vt_nrecs + 1 <= IGMP_V3_REPORT_MAXRECS) && (m0->m_pkthdr.len + minrec0len) < (ifp->if_mtu - IGMP_LEADINGSPACE)) { m0srcs = (ifp->if_mtu - m0->m_pkthdr.len - @@ -2921,10 +2921,10 @@ igmp_v3_enqueue_group_record(struct mbufq *mq, struct in_multi *inm, */ if (m != m0) { CTR1(KTR_IGMPV3, "%s: enqueueing first packet", __func__); - m->m_pkthdr.PH_vt.vt_nrecs = 1; + m->m_pkthdr.vt_nrecs = 1; mbufq_enqueue(mq, m); } else - m->m_pkthdr.PH_vt.vt_nrecs++; + m->m_pkthdr.vt_nrecs++; /* * No further work needed if no source list in packet(s). @@ -2963,7 +2963,7 @@ igmp_v3_enqueue_group_record(struct mbufq *mq, struct in_multi *inm, CTR1(KTR_IGMPV3, "%s: m_append() failed.", __func__); return (-ENOMEM); } - m->m_pkthdr.PH_vt.vt_nrecs = 1; + m->m_pkthdr.vt_nrecs = 1; nbytes += sizeof(struct igmp_grouprec); m0srcs = (ifp->if_mtu - IGMP_LEADINGSPACE - @@ -3091,7 +3091,7 @@ igmp_v3_enqueue_filter_change(struct mbufq *mq, struct in_multi *inm) do { m0 = mbufq_last(mq); if (m0 != NULL && - (m0->m_pkthdr.PH_vt.vt_nrecs + 1 <= + (m0->m_pkthdr.vt_nrecs + 1 <= IGMP_V3_REPORT_MAXRECS) && (m0->m_pkthdr.len + MINRECLEN) < (ifp->if_mtu - IGMP_LEADINGSPACE)) { @@ -3115,7 +3115,7 @@ igmp_v3_enqueue_filter_change(struct mbufq *mq, struct in_multi *inm) "%s: m_get*() failed", __func__); return (-ENOMEM); } - m->m_pkthdr.PH_vt.vt_nrecs = 0; + m->m_pkthdr.vt_nrecs = 0; igmp_save_context(m, ifp); m0srcs = (ifp->if_mtu - IGMP_LEADINGSPACE - sizeof(struct igmp_grouprec)) / @@ -3236,7 +3236,7 @@ igmp_v3_enqueue_filter_change(struct mbufq *mq, struct in_multi *inm) * Count the new group record, and enqueue this * packet if it wasn't already queued. */ - m->m_pkthdr.PH_vt.vt_nrecs++; + m->m_pkthdr.vt_nrecs++; if (m != m0) mbufq_enqueue(mq, m); nbytes += npbytes; @@ -3298,8 +3298,8 @@ igmp_v3_merge_state_changes(struct in_multi *inm, struct mbufq *scq) if (mt != NULL) { recslen = m_length(m, NULL); - if ((mt->m_pkthdr.PH_vt.vt_nrecs + - m->m_pkthdr.PH_vt.vt_nrecs <= + if ((mt->m_pkthdr.vt_nrecs + + m->m_pkthdr.vt_nrecs <= IGMP_V3_REPORT_MAXRECS) && (mt->m_pkthdr.len + recslen <= (inm->inm_ifp->if_mtu - IGMP_LEADINGSPACE))) @@ -3343,8 +3343,8 @@ igmp_v3_merge_state_changes(struct in_multi *inm, struct mbufq *scq) mtl = m_last(mt); m0->m_flags &= ~M_PKTHDR; mt->m_pkthdr.len += recslen; - mt->m_pkthdr.PH_vt.vt_nrecs += - m0->m_pkthdr.PH_vt.vt_nrecs; + mt->m_pkthdr.vt_nrecs += + m0->m_pkthdr.vt_nrecs; mtl->m_next = m0; } @@ -3564,10 +3564,10 @@ igmp_v3_encap_report(struct ifnet *ifp, struct mbuf *m) igmp->ir_type = IGMP_v3_HOST_MEMBERSHIP_REPORT; igmp->ir_rsv1 = 0; igmp->ir_rsv2 = 0; - igmp->ir_numgrps = htons(m->m_pkthdr.PH_vt.vt_nrecs); + igmp->ir_numgrps = htons(m->m_pkthdr.vt_nrecs); igmp->ir_cksum = 0; igmp->ir_cksum = in_cksum(m, sizeof(struct igmp_report) + igmpreclen); - m->m_pkthdr.PH_vt.vt_nrecs = 0; + m->m_pkthdr.vt_nrecs = 0; m->m_data -= sizeof(struct ip); m->m_len += sizeof(struct ip); diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index 1230599ea0d8..548ea55ef715 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -2427,7 +2427,7 @@ mld_v2_enqueue_group_record(struct mbufq *mq, struct in6_multi *inm, m0 = mbufq_last(mq); if (!is_group_query && m0 != NULL && - (m0->m_pkthdr.PH_vt.vt_nrecs + 1 <= MLD_V2_REPORT_MAXRECS) && + (m0->m_pkthdr.vt_nrecs + 1 <= MLD_V2_REPORT_MAXRECS) && (m0->m_pkthdr.len + minrec0len) < (ifp->if_mtu - MLD_MTUSPACE)) { m0srcs = (ifp->if_mtu - m0->m_pkthdr.len - @@ -2548,10 +2548,10 @@ mld_v2_enqueue_group_record(struct mbufq *mq, struct in6_multi *inm, */ if (m != m0) { CTR1(KTR_MLD, "%s: enqueueing first packet", __func__); - m->m_pkthdr.PH_vt.vt_nrecs = 1; + m->m_pkthdr.vt_nrecs = 1; mbufq_enqueue(mq, m); } else - m->m_pkthdr.PH_vt.vt_nrecs++; + m->m_pkthdr.vt_nrecs++; /* * No further work needed if no source list in packet(s). @@ -2585,7 +2585,7 @@ mld_v2_enqueue_group_record(struct mbufq *mq, struct in6_multi *inm, CTR1(KTR_MLD, "%s: m_append() failed.", __func__); return (-ENOMEM); } - m->m_pkthdr.PH_vt.vt_nrecs = 1; + m->m_pkthdr.vt_nrecs = 1; nbytes += sizeof(struct mldv2_record); m0srcs = (ifp->if_mtu - MLD_MTUSPACE - @@ -2714,7 +2714,7 @@ mld_v2_enqueue_filter_change(struct mbufq *mq, struct in6_multi *inm) do { m0 = mbufq_last(mq); if (m0 != NULL && - (m0->m_pkthdr.PH_vt.vt_nrecs + 1 <= + (m0->m_pkthdr.vt_nrecs + 1 <= MLD_V2_REPORT_MAXRECS) && (m0->m_pkthdr.len + MINRECLEN) < (ifp->if_mtu - MLD_MTUSPACE)) { @@ -2733,7 +2733,7 @@ mld_v2_enqueue_filter_change(struct mbufq *mq, struct in6_multi *inm) "%s: m_get*() failed", __func__); return (-ENOMEM); } - m->m_pkthdr.PH_vt.vt_nrecs = 0; + m->m_pkthdr.vt_nrecs = 0; mld_save_context(m, ifp); m0srcs = (ifp->if_mtu - MLD_MTUSPACE - sizeof(struct mldv2_record)) / @@ -2856,7 +2856,7 @@ mld_v2_enqueue_filter_change(struct mbufq *mq, struct in6_multi *inm) * Count the new group record, and enqueue this * packet if it wasn't already queued. */ - m->m_pkthdr.PH_vt.vt_nrecs++; + m->m_pkthdr.vt_nrecs++; if (m != m0) mbufq_enqueue(mq, m); nbytes += npbytes; @@ -2918,8 +2918,8 @@ mld_v2_merge_state_changes(struct in6_multi *inm, struct mbufq *scq) if (mt != NULL) { recslen = m_length(m, NULL); - if ((mt->m_pkthdr.PH_vt.vt_nrecs + - m->m_pkthdr.PH_vt.vt_nrecs <= + if ((mt->m_pkthdr.vt_nrecs + + m->m_pkthdr.vt_nrecs <= MLD_V2_REPORT_MAXRECS) && (mt->m_pkthdr.len + recslen <= (inm->in6m_ifp->if_mtu - MLD_MTUSPACE))) @@ -2963,8 +2963,8 @@ mld_v2_merge_state_changes(struct in6_multi *inm, struct mbufq *scq) mtl = m_last(mt); m0->m_flags &= ~M_PKTHDR; mt->m_pkthdr.len += recslen; - mt->m_pkthdr.PH_vt.vt_nrecs += - m0->m_pkthdr.PH_vt.vt_nrecs; + mt->m_pkthdr.vt_nrecs += + m0->m_pkthdr.vt_nrecs; mtl->m_next = m0; } @@ -3216,8 +3216,8 @@ mld_v2_encap_report(struct ifnet *ifp, struct mbuf *m) mld->mld_code = 0; mld->mld_cksum = 0; mld->mld_v2_reserved = 0; - mld->mld_v2_numrecs = htons(m->m_pkthdr.PH_vt.vt_nrecs); - m->m_pkthdr.PH_vt.vt_nrecs = 0; + mld->mld_v2_numrecs = htons(m->m_pkthdr.vt_nrecs); + m->m_pkthdr.vt_nrecs = 0; mh->m_next = m; mld->mld_cksum = in6_cksum(mh, IPPROTO_ICMPV6, diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 78b175ebe2c0..61da52c6e67c 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -207,8 +207,7 @@ struct pkthdr { }; #define ether_vtag PH_per.sixteen[0] #define tcp_tun_port PH_per.sixteen[0] /* outbound */ -#define PH_vt PH_per -#define vt_nrecs sixteen[0] /* mld and v6-ND */ +#define vt_nrecs PH_per.sixteen[0] /* mld and v6-ND */ #define tso_segsz PH_per.sixteen[1] /* inbound after LRO */ #define lro_nsegs tso_segsz /* inbound after LRO */ #define csum_data PH_per.thirtytwo[1] /* inbound from hardware up */