Skip to content

Commit

Permalink
Catch up with 6edfd17: mechanically rename IFCAP_NOMAP to IFCAP_MEXTPG.
Browse files Browse the repository at this point in the history
Originally IFCAP_NOMAP meant that the mbuf has external storage pointer
that points to unmapped address.  Then, this was extended to array of
such pointers.  Then, such mbufs were augmented with header/trailer.
Basically, extended mbufs are extended, and set of features is subject
to change.  The new name should be generic enough to avoid further
renaming.

(cherry-picked from commit 3f43ada)
  • Loading branch information
glebius committed Feb 8, 2021
1 parent 0ace2cc commit 97ded49
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 25 deletions.
16 changes: 9 additions & 7 deletions sbin/ifconfig/ifconfig.8
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
.\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94
.\" $FreeBSD$
.\"
.Dd November 1, 2020
.Dd January 28, 2021
.Dt IFCONFIG 8
.Os
.Sh NAME
Expand Down Expand Up @@ -554,12 +554,14 @@ and
Enable use of rate limiting (packet pacing) for TLS offload.
.It Fl txtlsrtlmt
Disable use of rate limiting for TLS offload.
.It Cm nomap
If the driver supports unmapped network buffers,
enable them on the interface.
.It Fl nomap
If the driver supports unmapped network buffers,
disable them on the interface.
.It Cm mextpg
If the driver supports extended multi-page
.Xr mbuf 9
buffers, enable them on the interface.
.It Fl mextpg
If the driver supports extended multi-page
.Xr mbuf 9
biffers, disable them on the interface.
.It Cm wol , wol_ucast , wol_mcast , wol_magic
Enable Wake On Lan (WOL) support, if available.
WOL is a facility whereby a machine in a low power state may be woken
Expand Down
4 changes: 2 additions & 2 deletions sbin/ifconfig/ifconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -1658,8 +1658,8 @@ static struct cmd basic_cmds[] = {
DEF_CMD("-link2", -IFF_LINK2, setifflags),
DEF_CMD("monitor", IFF_MONITOR, setifflags),
DEF_CMD("-monitor", -IFF_MONITOR, setifflags),
DEF_CMD("nomap", IFCAP_NOMAP, setifcap),
DEF_CMD("-nomap", -IFCAP_NOMAP, setifcap),
DEF_CMD("mextpg", IFCAP_MEXTPG, setifcap),
DEF_CMD("-mextpg", -IFCAP_MEXTPG, setifcap),
DEF_CMD("staticarp", IFF_STATICARP, setifflags),
DEF_CMD("-staticarp", -IFF_STATICARP, setifflags),
DEF_CMD("rxcsum6", IFCAP_RXCSUM_IPV6, setifcap),
Expand Down
6 changes: 3 additions & 3 deletions sys/dev/cxgbe/t4_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,7 @@ cxgbe_probe(device_t dev)
#define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \
IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \
IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6 | IFCAP_HWSTATS | \
IFCAP_HWRXTSTMP | IFCAP_NOMAP)
IFCAP_HWRXTSTMP | IFCAP_MEXTPG)
#define T4_CAP_ENABLE (T4_CAP)

static int
Expand Down Expand Up @@ -2182,8 +2182,8 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data)
rxq->iq.flags &= ~IQ_RX_TIMESTAMP;
}
}
if (mask & IFCAP_NOMAP)
ifp->if_capenable ^= IFCAP_NOMAP;
if (mask & IFCAP_MEXTPG)
ifp->if_capenable ^= IFCAP_MEXTPG;

#ifdef KERN_TLS
if (mask & IFCAP_TXTLS)
Expand Down
6 changes: 3 additions & 3 deletions sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3379,8 +3379,8 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
"tso6 disabled due to -txcsum6.\n");
}
}
if (mask & IFCAP_NOMAP)
ifp->if_capenable ^= IFCAP_NOMAP;
if (mask & IFCAP_MEXTPG)
ifp->if_capenable ^= IFCAP_MEXTPG;
if (mask & IFCAP_TXTLS4)
ifp->if_capenable ^= IFCAP_TXTLS4;
if (mask & IFCAP_TXTLS6)
Expand Down Expand Up @@ -4397,7 +4397,7 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev)
ifp->if_capabilities |= IFCAP_LRO;
ifp->if_capabilities |= IFCAP_TSO | IFCAP_VLAN_HWTSO;
ifp->if_capabilities |= IFCAP_HWSTATS | IFCAP_HWRXTSTMP;
ifp->if_capabilities |= IFCAP_NOMAP;
ifp->if_capabilities |= IFCAP_MEXTPG;
ifp->if_capabilities |= IFCAP_TXTLS4 | IFCAP_TXTLS6;
#ifdef RATELIMIT
ifp->if_capabilities |= IFCAP_TXRTLMT | IFCAP_TXTLS_RTLMT;
Expand Down
2 changes: 1 addition & 1 deletion sys/kern/uipc_ktls.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ ktls_alloc_snd_tag(struct inpcb *inp, struct ktls_session *tls, bool force,
params.hdr.numa_domain = inp->inp_numa_domain;
INP_RUNLOCK(inp);

if ((ifp->if_capenable & IFCAP_NOMAP) == 0) {
if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) {
error = EOPNOTSUPP;
goto out;
}
Expand Down
2 changes: 1 addition & 1 deletion sys/net/if.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ struct if_data {
#define IFCAP_HWSTATS 0x800000 /* manages counters internally */
#define IFCAP_TXRTLMT 0x1000000 /* hardware supports TX rate limiting */
#define IFCAP_HWRXTSTMP 0x2000000 /* hardware rx timestamping */
#define IFCAP_NOMAP 0x4000000 /* can TX unmapped mbufs */
#define IFCAP_MEXTPG 0x4000000 /* understands M_EXTPG mbufs */
#define IFCAP_TXTLS4 0x8000000 /* can do TLS encryption and segmentation for TCP */
#define IFCAP_TXTLS6 0x10000000 /* can do TLS encryption and segmentation for TCP6 */
#define IFCAP_VXLAN_HWCSUM 0x20000000 /* can do IFCAN_HWCSUM on VXLANs */
Expand Down
4 changes: 2 additions & 2 deletions sys/net/if_vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1797,8 +1797,8 @@ vlan_capabilities(struct ifvlan *ifv)
* are prepended in normal mbufs to unmapped mbufs holding
* payload data.
*/
cap |= (p->if_capabilities & IFCAP_NOMAP);
ena |= (mena & IFCAP_NOMAP);
cap |= (p->if_capabilities & IFCAP_MEXTPG);
ena |= (mena & IFCAP_MEXTPG);

/*
* If the parent interface can offload encryption and segmentation
Expand Down
8 changes: 4 additions & 4 deletions sys/net/iflib.c
Original file line number Diff line number Diff line change
Expand Up @@ -4231,7 +4231,7 @@ iflib_if_qflush(if_t ifp)
#define IFCAP_FLAGS (IFCAP_HWCSUM_IPV6 | IFCAP_HWCSUM | IFCAP_LRO | \
IFCAP_TSO | IFCAP_VLAN_HWTAGGING | IFCAP_HWSTATS | \
IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | \
IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM | IFCAP_NOMAP)
IFCAP_VLAN_HWTSO | IFCAP_VLAN_HWCSUM | IFCAP_MEXTPG)

static int
iflib_if_ioctl(if_t ifp, u_long command, caddr_t data)
Expand Down Expand Up @@ -4358,7 +4358,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data)

oldmask = if_getcapenable(ifp);
mask = ifr->ifr_reqcap ^ oldmask;
mask &= ctx->ifc_softc_ctx.isc_capabilities | IFCAP_NOMAP;
mask &= ctx->ifc_softc_ctx.isc_capabilities | IFCAP_MEXTPG;
setmask = 0;
#ifdef TCP_OFFLOAD
setmask |= mask & (IFCAP_TOE4|IFCAP_TOE6);
Expand Down Expand Up @@ -4759,9 +4759,9 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct
#endif

if_setcapabilities(ifp,
scctx->isc_capabilities | IFCAP_HWSTATS | IFCAP_NOMAP);
scctx->isc_capabilities | IFCAP_HWSTATS | IFCAP_MEXTPG);
if_setcapenable(ifp,
scctx->isc_capenable | IFCAP_HWSTATS | IFCAP_NOMAP);
scctx->isc_capenable | IFCAP_HWSTATS | IFCAP_MEXTPG);

if (scctx->isc_ntxqsets == 0 || (scctx->isc_ntxqsets_max && scctx->isc_ntxqsets_max < scctx->isc_ntxqsets))
scctx->isc_ntxqsets = scctx->isc_ntxqsets_max;
Expand Down
2 changes: 1 addition & 1 deletion sys/netinet/ip_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags,
}
in_delayed_cksum(m);
m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
} else if ((ifp->if_capenable & IFCAP_NOMAP) == 0) {
} else if ((ifp->if_capenable & IFCAP_MEXTPG) == 0) {
m = mb_unmapped_to_ext(m);
if (m == NULL) {
IPSTAT_INC(ips_odropped);
Expand Down
2 changes: 1 addition & 1 deletion sys/netinet6/ip6_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ ip6_output_delayed_csum(struct mbuf *m, struct ifnet *ifp, int csum_flags,
#if defined(SCTP) || defined(SCTP_SUPPORT)
(csum_flags & CSUM_SCTP_IPV6) ||
#endif
(!frag && (ifp->if_capenable & IFCAP_NOMAP) == 0)) {
(!frag && (ifp->if_capenable & IFCAP_MEXTPG) == 0)) {
m = mb_unmapped_to_ext(m);
if (m == NULL) {
if (frag)
Expand Down

0 comments on commit 97ded49

Please sign in to comment.