summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Mooney <pmooney@pfmooney.com>2018-03-14 23:26:36 +0000
committerPatrick Mooney <pmooney@pfmooney.com>2018-03-16 22:48:28 +0000
commit3c32c786cc014ec9aab1c7cb8f001b57359d506a (patch)
treef1680f8e2f4b68e502f511b4668795726bcf12a6
parent1a34bceaa14b4cf3a9cf90aa9c4dae5eb003d9d7 (diff)
downloadillumos-joyent-3c32c786cc014ec9aab1c7cb8f001b57359d506a.tar.gz
OS-6761 hcksum routines are too verbose
OS-6762 want mac_hcksum_clone function Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Ryan Zezeski <rpz@joyent.com> Approved by: Ryan Zezeski <rpz@joyent.com>
-rw-r--r--usr/src/man/man9f/mac_hcksum_get.9f6
-rw-r--r--usr/src/uts/common/inet/ipf/ip_fil_solaris.c9
-rw-r--r--usr/src/uts/common/io/chxge/ch.c8
-rw-r--r--usr/src/uts/common/io/dld/dld_proto.c5
-rw-r--r--usr/src/uts/common/io/elxl/elxl.c6
-rw-r--r--usr/src/uts/common/io/gld.c7
-rw-r--r--usr/src/uts/common/io/ib/clients/ibd/ibd_cm.c7
-rw-r--r--usr/src/uts/common/io/mac/mac_provider.c26
-rw-r--r--usr/src/uts/common/io/mac/mac_util.c17
-rw-r--r--usr/src/uts/common/os/strsubr.c7
-rw-r--r--usr/src/uts/common/sys/mac_provider.h3
-rw-r--r--usr/src/uts/common/sys/strsubr.h8
-rw-r--r--usr/src/uts/intel/chxge/Makefile5
-rw-r--r--usr/src/uts/intel/io/vmxnet3s/vmxnet3_rx.c3
-rw-r--r--usr/src/uts/intel/io/vmxnet3s/vmxnet3_tx.c3
-rw-r--r--usr/src/uts/intel/ipf/Makefile2
-rw-r--r--usr/src/uts/sparc/chxge/Makefile5
-rw-r--r--usr/src/uts/sparc/ipf/Makefile2
18 files changed, 80 insertions, 49 deletions
diff --git a/usr/src/man/man9f/mac_hcksum_get.9f b/usr/src/man/man9f/mac_hcksum_get.9f
index b96f501f91..eb854a1928 100644
--- a/usr/src/man/man9f/mac_hcksum_get.9f
+++ b/usr/src/man/man9f/mac_hcksum_get.9f
@@ -9,9 +9,9 @@
.\" http://www.illumos.org/license/CDDL.
.\"
.\"
-.\" Copyright 2016 Joyent, Inc.
+.\" Copyright 2018 Joyent, Inc.
.\"
-.Dd June 01, 2016
+.Dd March 15, 2018
.Dt MAC_HCKSUM_GET 9F
.Os
.Sh NAME
@@ -22,7 +22,7 @@
.In sys/mac_provider.h
.Ft void
.Fo mac_hcksum_get
-.Fa "mblk_t *mp"
+.Fa "const mblk_t *mp"
.Fa "uint32_t *start"
.Fa "uint32_t *stuff"
.Fa "uint32_t *end"
diff --git a/usr/src/uts/common/inet/ipf/ip_fil_solaris.c b/usr/src/uts/common/inet/ipf/ip_fil_solaris.c
index 2a32ccc940..1d8247e52a 100644
--- a/usr/src/uts/common/inet/ipf/ip_fil_solaris.c
+++ b/usr/src/uts/common/inet/ipf/ip_fil_solaris.c
@@ -5,7 +5,7 @@
*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
*
- * Copyright 2016, Joyent, Inc.
+ * Copyright 2018 Joyent, Inc.
*/
#if !defined(lint)
@@ -27,6 +27,7 @@ static const char rcsid[] = "@(#)$Id: ip_fil_solaris.c,v 2.62.2.19 2005/07/13 21
#include <sys/sunddi.h>
#include <sys/ksynch.h>
#include <sys/kmem.h>
+#include <sys/mac_provider.h>
#include <sys/mkdev.h>
#include <sys/protosw.h>
#include <sys/socket.h>
@@ -1799,8 +1800,7 @@ int len;
* Need to preserve checksum information by copying them
* to newmp which heads the pulluped message.
*/
- hcksum_retrieve(m, NULL, NULL, &start, &stuff, &end,
- &value, &flags);
+ mac_hcksum_get(m, &start, &stuff, &end, &value, &flags);
if (pullupmsg(m, len + ipoff + inc) == 0) {
ATOMIC_INCL(ifs->ifs_frstats[out].fr_pull[1]);
@@ -1813,8 +1813,7 @@ int len;
return NULL;
}
- (void) hcksum_assoc(m, NULL, NULL, start, stuff, end,
- value, flags, 0);
+ mac_hcksum_set(m, start, stuff, end, value, flags);
m->b_prev = m2;
m->b_rptr += inc;
diff --git a/usr/src/uts/common/io/chxge/ch.c b/usr/src/uts/common/io/chxge/ch.c
index 9f1f7f87de..80400061af 100644
--- a/usr/src/uts/common/io/chxge/ch.c
+++ b/usr/src/uts/common/io/chxge/ch.c
@@ -22,6 +22,7 @@
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2018 Joyent, Inc.
*/
/*
@@ -59,6 +60,7 @@
#include <sys/sunddi.h>
#include <sys/dlpi.h>
#include <sys/ethernet.h>
+#include <sys/mac_provider.h>
#include <sys/strsun.h>
#include <sys/strsubr.h>
#include <inet/common.h>
@@ -1377,8 +1379,7 @@ ch_send_up(ch_t *chp, mblk_t *mp, uint32_t cksum, int flg)
* set in /etc/system (see sge.c).
*/
if (flg)
- (void) hcksum_assoc(mp, NULL, NULL, 0, 0, 0, cksum,
- HCK_FULLCKSUM, 0);
+ mac_hcksum_set(mp, 0, 0, 0, cksum, HCK_FULLCKSUM);
gld_recv(chp->ch_macp, mp);
} else {
freemsg(mp);
@@ -1693,8 +1694,7 @@ ch_send(gld_mac_info_t *macinfo, mblk_t *mp)
msg_flg = 0;
if (chp->ch_config.cksum_enabled) {
if (is_T2(chp)) {
- hcksum_retrieve(mp, NULL, NULL, NULL, NULL, NULL,
- NULL, &msg_flg);
+ mac_hcksum_get(mp, NULL, NULL, NULL, NULL, &msg_flg);
flg = (msg_flg & HCK_FULLCKSUM)?
CH_NO_CPL: CH_NO_HWCKSUM|CH_NO_CPL;
} else
diff --git a/usr/src/uts/common/io/dld/dld_proto.c b/usr/src/uts/common/io/dld/dld_proto.c
index 681afab8df..1ee00681fc 100644
--- a/usr/src/uts/common/io/dld/dld_proto.c
+++ b/usr/src/uts/common/io/dld/dld_proto.c
@@ -1211,7 +1211,6 @@ proto_unitdata_req(dld_str_t *dsp, mblk_t *mp)
uint16_t sap;
uint_t addr_length;
mblk_t *bp, *payload;
- uint32_t start, stuff, end, value, flags;
t_uscalar_t dl_err;
uint_t max_sdu;
@@ -1280,9 +1279,7 @@ proto_unitdata_req(dld_str_t *dsp, mblk_t *mp)
/*
* Transfer the checksum offload information if it is present.
*/
- hcksum_retrieve(payload, NULL, NULL, &start, &stuff, &end, &value,
- &flags);
- (void) hcksum_assoc(bp, NULL, NULL, start, stuff, end, value, flags, 0);
+ mac_hcksum_clone(payload, bp);
/*
* Link the payload onto the new header.
diff --git a/usr/src/uts/common/io/elxl/elxl.c b/usr/src/uts/common/io/elxl/elxl.c
index 2ffe96aff3..42552225f8 100644
--- a/usr/src/uts/common/io/elxl/elxl.c
+++ b/usr/src/uts/common/io/elxl/elxl.c
@@ -1,6 +1,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2018 Joyent, Inc.
*/
/*
@@ -1163,8 +1164,7 @@ elxl_m_tx(void *arg, mblk_t *mp)
cflags = 0;
if ((sc->ex_conf & CONF_90XB) != 0) {
uint32_t pflags;
- hcksum_retrieve(mp, NULL, NULL, NULL, NULL, NULL, NULL,
- &pflags);
+ mac_hcksum_get(mp, NULL, NULL, NULL, NULL, &pflags);
if (pflags & HCK_IPV4_HDRCKSUM) {
cflags |= EX_DPD_IPCKSUM;
}
@@ -1327,7 +1327,7 @@ elxl_recv(elxl_t *sc, ex_desc_t *rxd, uint32_t stat)
if (stat & (EX_UPD_TCPCHECKED | EX_UPD_UDPCHECKED)) {
pflags |= (HCK_FULLCKSUM | HCK_FULLCKSUM_OK);
}
- (void) hcksum_assoc(mp, NULL, NULL, 0, 0, 0, 0, pflags, 0);
+ mac_hcksum_set(mp, 0, 0, 0, 0, pflags);
}
return (mp);
diff --git a/usr/src/uts/common/io/gld.c b/usr/src/uts/common/io/gld.c
index ac0abe3263..f08f448329 100644
--- a/usr/src/uts/common/io/gld.c
+++ b/usr/src/uts/common/io/gld.c
@@ -22,6 +22,7 @@
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright (c) 2016 by Delphix. All rights reserved.
+ * Copyright 2018 Joyent, Inc.
*/
/*
@@ -4550,8 +4551,7 @@ gld_unitdata(queue_t *q, mblk_t *mp)
ifp = ((gld_mac_pvt_t *)macinfo->gldm_mac_pvt)->interfacep;
/* grab any checksum information that may be present */
- hcksum_retrieve(mp->b_cont, NULL, NULL, &start, &stuff, &end,
- &value, &flags);
+ mac_hcksum_get(mp->b_cont, &start, &stuff, &end, &value, &flags);
/*
* Prepend a valid header for transmission
@@ -4567,8 +4567,7 @@ gld_unitdata(queue_t *q, mblk_t *mp)
}
/* apply any checksum information to the first block in the chain */
- (void) hcksum_assoc(nmp, NULL, NULL, start, stuff, end, value,
- flags, 0);
+ mac_hcksum_set(nmp, start, stuff, end, value, flags);
GLD_CLEAR_MBLK_VTAG(nmp);
if (gld_start(q, nmp, GLD_WSRV, upri) == GLD_NORESOURCES) {
diff --git a/usr/src/uts/common/io/ib/clients/ibd/ibd_cm.c b/usr/src/uts/common/io/ib/clients/ibd/ibd_cm.c
index 1c8318b191..55c4159bc4 100644
--- a/usr/src/uts/common/io/ib/clients/ibd/ibd_cm.c
+++ b/usr/src/uts/common/io/ib/clients/ibd/ibd_cm.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2018 Joyent, Inc.
*/
/* Copyright (c) 1990 Mentat Inc. */
@@ -272,8 +273,7 @@ ibd_async_rc_process_too_big(ibd_state_t *state, ibd_req_t *req)
icmph->icmph_checksum = IP_CSUM(pmtu_mp,
(int32_t)sizeof (ib_header_info_t) + (int32_t)sizeof (ipha_t), 0);
- (void) hcksum_assoc(pmtu_mp, NULL, NULL, 0, 0, 0, 0,
- HCK_FULLCKSUM | HCK_FULLCKSUM_OK, 0);
+ mac_hcksum_set(pmtu_mp, 0, 0, 0, 0, HCK_FULLCKSUM | HCK_FULLCKSUM_OK);
DPRINT(30, "ibd_async_rc_process_too_big: sap=0x%x, ip_src=0x%x, "
"ip_dst=0x%x, ttl=%d, len_needed=%d, msg_len=%d",
@@ -1560,8 +1560,7 @@ ibd_rc_process_rx(ibd_rc_chan_t *chan, ibd_rwqe_t *rwqe, ibt_wc_t *wc)
/*
* Can RC mode in IB guarantee its checksum correctness?
*
- * (void) hcksum_assoc(mp, NULL, NULL, 0, 0, 0, 0,
- * HCK_FULLCKSUM | HCK_FULLCKSUM_OK, 0);
+ * mac_hcksum_set(mp, 0, 0, 0, 0, HCK_FULLCKSUM | HCK_FULLCKSUM_OK);
*/
/*
diff --git a/usr/src/uts/common/io/mac/mac_provider.c b/usr/src/uts/common/io/mac/mac_provider.c
index 4e564b0735..73e7daac5f 100644
--- a/usr/src/uts/common/io/mac/mac_provider.c
+++ b/usr/src/uts/common/io/mac/mac_provider.c
@@ -1477,7 +1477,8 @@ mac_prop_info_set_perm(mac_prop_info_handle_t ph, uint8_t perm)
pr->pr_flags |= MAC_PROP_INFO_PERM;
}
-void mac_hcksum_get(mblk_t *mp, uint32_t *start, uint32_t *stuff,
+void
+mac_hcksum_get(const mblk_t *mp, uint32_t *start, uint32_t *stuff,
uint32_t *end, uint32_t *value, uint32_t *flags_ptr)
{
uint32_t flags;
@@ -1502,8 +1503,9 @@ void mac_hcksum_get(mblk_t *mp, uint32_t *start, uint32_t *stuff,
*flags_ptr = flags;
}
-void mac_hcksum_set(mblk_t *mp, uint32_t start, uint32_t stuff,
- uint32_t end, uint32_t value, uint32_t flags)
+void
+mac_hcksum_set(mblk_t *mp, uint32_t start, uint32_t stuff, uint32_t end,
+ uint32_t value, uint32_t flags)
{
ASSERT(DB_TYPE(mp) == M_DATA);
@@ -1515,6 +1517,24 @@ void mac_hcksum_set(mblk_t *mp, uint32_t start, uint32_t stuff,
}
void
+mac_hcksum_clone(const mblk_t *src, mblk_t *dst)
+{
+ ASSERT3U(DB_TYPE(src), ==, M_DATA);
+ ASSERT3U(DB_TYPE(dst), ==, M_DATA);
+
+ /*
+ * Do these assignments unconditionally, rather than only when flags is
+ * non-zero. This protects a situation where zeroed hcksum data does
+ * not make the jump onto an mblk_t with stale data in those fields.
+ */
+ DB_CKSUMFLAGS(dst) = (DB_CKSUMFLAGS(src) & HCK_FLAGS);
+ DB_CKSUMSTART(dst) = DB_CKSUMSTART(src);
+ DB_CKSUMSTUFF(dst) = DB_CKSUMSTUFF(src);
+ DB_CKSUMEND(dst) = DB_CKSUMEND(src);
+ DB_CKSUM16(dst) = DB_CKSUM16(src);
+}
+
+void
mac_lso_get(mblk_t *mp, uint32_t *mss, uint32_t *flags)
{
ASSERT(DB_TYPE(mp) == M_DATA);
diff --git a/usr/src/uts/common/io/mac/mac_util.c b/usr/src/uts/common/io/mac/mac_util.c
index e83af37f16..924d018ad0 100644
--- a/usr/src/uts/common/io/mac/mac_util.c
+++ b/usr/src/uts/common/io/mac/mac_util.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2018 Joyent, Inc.
*/
/*
@@ -55,15 +56,12 @@ static mblk_t *
mac_copymsg_cksum(mblk_t *mp)
{
mblk_t *mp1;
- uint32_t start, stuff, end, value, flags;
mp1 = copymsg(mp);
if (mp1 == NULL)
return (NULL);
- hcksum_retrieve(mp, NULL, NULL, &start, &stuff, &end, &value, &flags);
- (void) hcksum_assoc(mp1, NULL, NULL, start, stuff, end, value,
- flags, KM_NOSLEEP);
+ mac_hcksum_clone(mp, mp1);
return (mp1);
}
@@ -108,8 +106,7 @@ mac_fix_cksum(mblk_t *mp_chain)
struct ether_header *ehp;
uint16_t sap;
- hcksum_retrieve(mp, NULL, NULL, &start, &stuff, &end, &value,
- &flags);
+ mac_hcksum_get(mp, &start, &stuff, &end, &value, &flags);
if (flags == 0)
continue;
@@ -304,8 +301,7 @@ mac_fix_cksum(mblk_t *mp_chain)
value = 0;
}
- (void) hcksum_assoc(mp, NULL, NULL, start, stuff, end,
- value, flags, KM_NOSLEEP);
+ mac_hcksum_set(mp, start, stuff, end, value, flags);
}
return (new_chain);
@@ -320,7 +316,6 @@ mac_add_vlan_tag(mblk_t *mp, uint_t pri, uint16_t vid)
mblk_t *hmp;
struct ether_vlan_header *evhp;
struct ether_header *ehp;
- uint32_t start, stuff, end, value, flags;
ASSERT(pri != 0 || vid != 0);
@@ -350,9 +345,7 @@ mac_add_vlan_tag(mblk_t *mp, uint_t pri, uint16_t vid)
* Free the original message if it's now empty. Link the
* rest of messages to the header message.
*/
- hcksum_retrieve(mp, NULL, NULL, &start, &stuff, &end, &value, &flags);
- (void) hcksum_assoc(hmp, NULL, NULL, start, stuff, end, value, flags,
- KM_NOSLEEP);
+ mac_hcksum_clone(mp, hmp);
if (MBLKL(mp) == 0) {
hmp->b_cont = mp->b_cont;
freeb(mp);
diff --git a/usr/src/uts/common/os/strsubr.c b/usr/src/uts/common/os/strsubr.c
index 87e0c5511d..0d0d290fcc 100644
--- a/usr/src/uts/common/os/strsubr.c
+++ b/usr/src/uts/common/os/strsubr.c
@@ -26,6 +26,7 @@
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
* Copyright (c) 2016 by Delphix. All rights reserved.
+ * Copyright 2018 Joyent, Inc.
*/
#include <sys/types.h>
@@ -8449,6 +8450,12 @@ mblk_copycred(mblk_t *mp, const mblk_t *src)
dbp->db_cpid = cpid;
}
+
+/*
+ * Now that NIC drivers are expected to deal only with M_DATA mblks, the
+ * hcksum_assoc and hcksum_retrieve functions are deprecated in favor of their
+ * respective mac_hcksum_set and mac_hcksum_get counterparts.
+ */
int
hcksum_assoc(mblk_t *mp, multidata_t *mmd, pdesc_t *pd,
uint32_t start, uint32_t stuff, uint32_t end, uint32_t value,
diff --git a/usr/src/uts/common/sys/mac_provider.h b/usr/src/uts/common/sys/mac_provider.h
index a4bd931afe..f5c91e7933 100644
--- a/usr/src/uts/common/sys/mac_provider.h
+++ b/usr/src/uts/common/sys/mac_provider.h
@@ -587,11 +587,12 @@ extern void mac_prop_info_set_range_uint32(
extern void mac_prop_info_set_perm(mac_prop_info_handle_t,
uint8_t);
-extern void mac_hcksum_get(mblk_t *, uint32_t *,
+extern void mac_hcksum_get(const mblk_t *, uint32_t *,
uint32_t *, uint32_t *, uint32_t *,
uint32_t *);
extern void mac_hcksum_set(mblk_t *, uint32_t, uint32_t,
uint32_t, uint32_t, uint32_t);
+extern void mac_hcksum_clone(const mblk_t *, mblk_t *);
extern void mac_lso_get(mblk_t *, uint32_t *, uint32_t *);
diff --git a/usr/src/uts/common/sys/strsubr.h b/usr/src/uts/common/sys/strsubr.h
index 064fdf5b09..0f29dd3675 100644
--- a/usr/src/uts/common/sys/strsubr.h
+++ b/usr/src/uts/common/sys/strsubr.h
@@ -25,6 +25,7 @@
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2018 Joyent, Inc.
*/
#ifndef _SYS_STRSUBR_H
@@ -1238,10 +1239,17 @@ extern void strsignal_nolock(stdata_t *, int, uchar_t);
struct multidata_s;
struct pdesc_s;
+
+/*
+ * Now that NIC drivers are expected to deal only with M_DATA mblks, the
+ * hcksum_assoc and hcksum_retrieve functions are deprecated in favor of their
+ * respective mac_hcksum_set and mac_hcksum_get counterparts.
+ */
extern int hcksum_assoc(mblk_t *, struct multidata_s *, struct pdesc_s *,
uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, int);
extern void hcksum_retrieve(mblk_t *, struct multidata_s *, struct pdesc_s *,
uint32_t *, uint32_t *, uint32_t *, uint32_t *, uint32_t *);
+
extern void lso_info_set(mblk_t *, uint32_t, uint32_t);
extern void lso_info_cleanup(mblk_t *);
extern unsigned int bcksum(uchar_t *, int, unsigned int);
diff --git a/usr/src/uts/intel/chxge/Makefile b/usr/src/uts/intel/chxge/Makefile
index 052bd467d2..dd835a13d2 100644
--- a/usr/src/uts/intel/chxge/Makefile
+++ b/usr/src/uts/intel/chxge/Makefile
@@ -21,6 +21,7 @@
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
+# Copyright 2018 Joyent, Inc.
#
#
@@ -69,9 +70,9 @@ CFLAGS += -DSUN_KSTATS -DHOST_PAUSE -DTX_CKSUM_FIX -DTX_THREAD_RECLAIM
# CFLAGS += -DCH_DEBUG=1 -DPE_DBGOUT_ENABLED=1
#
-# Driver depends on GLD & IP
+# Driver depends on GLD, IP, and MAC
#
-LDFLAGS += -dy -N misc/gld -N drv/ip
+LDFLAGS += -dy -N misc/gld -N drv/ip -N misc/mac
# Lint flag
#
diff --git a/usr/src/uts/intel/io/vmxnet3s/vmxnet3_rx.c b/usr/src/uts/intel/io/vmxnet3s/vmxnet3_rx.c
index 8004a3eb3e..8dd039e8cc 100644
--- a/usr/src/uts/intel/io/vmxnet3s/vmxnet3_rx.c
+++ b/usr/src/uts/intel/io/vmxnet3s/vmxnet3_rx.c
@@ -14,6 +14,7 @@
*/
/*
* Copyright (c) 2013, 2016 by Delphix. All rights reserved.
+ * Copyright 2018 Joyent, Inc.
*/
#include <vmxnet3.h>
@@ -322,7 +323,7 @@ vmxnet3_rx_hwcksum(vmxnet3_softc_t *dp, mblk_t *mp,
VMXNET3_DEBUG(dp, 3, "rx cksum flags = 0x%x\n", flags);
- (void) hcksum_assoc(mp, NULL, NULL, 0, 0, 0, 0, flags, 0);
+ mac_hcksum_set(mp, 0, 0, 0, 0, flags);
}
}
diff --git a/usr/src/uts/intel/io/vmxnet3s/vmxnet3_tx.c b/usr/src/uts/intel/io/vmxnet3s/vmxnet3_tx.c
index 8a9f05e690..8769d938ab 100644
--- a/usr/src/uts/intel/io/vmxnet3s/vmxnet3_tx.c
+++ b/usr/src/uts/intel/io/vmxnet3s/vmxnet3_tx.c
@@ -15,6 +15,7 @@
/*
* Copyright (c) 2012, 2016 by Delphix. All rights reserved.
+ * Copyright 2018 Joyent, Inc.
*/
#include <vmxnet3.h>
@@ -79,7 +80,7 @@ vmxnet3_tx_prepare_offload(vmxnet3_softc_t *dp, vmxnet3_offload_t *ol,
ol->hlen = 0;
ol->msscof = 0;
- hcksum_retrieve(mp, NULL, NULL, &start, &stuff, NULL, &value, &flags);
+ mac_hcksum_get(mp, &start, &stuff, NULL, &value, &flags);
mac_lso_get(mp, &mss, &lso_flag);
diff --git a/usr/src/uts/intel/ipf/Makefile b/usr/src/uts/intel/ipf/Makefile
index e18158a43d..f033f016c4 100644
--- a/usr/src/uts/intel/ipf/Makefile
+++ b/usr/src/uts/intel/ipf/Makefile
@@ -21,6 +21,7 @@
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
+# Copyright 2018 Joyent, Inc.
#
# uts/intel/ipf/Makefile
#
@@ -59,6 +60,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE)
CPPFLAGS += -DIPFILTER_LKM -DIPFILTER_LOG -DIPFILTER_LOOKUP -DUSE_INET6
CPPFLAGS += -DSUNDDI -DSOLARIS2=$(RELEASE_MINOR) -DIRE_ILL_CN
LDFLAGS += -dy -Ndrv/ip -Nmisc/md5 -Nmisc/neti -Nmisc/hook -Nmisc/kcf -Ndrv/vnd
+LDFLAGS += -Nmisc/mac
INC_PATH += -I$(UTSBASE)/common/inet/ipf
diff --git a/usr/src/uts/sparc/chxge/Makefile b/usr/src/uts/sparc/chxge/Makefile
index 2a19c82e25..da43a14bee 100644
--- a/usr/src/uts/sparc/chxge/Makefile
+++ b/usr/src/uts/sparc/chxge/Makefile
@@ -21,6 +21,7 @@
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
+# Copyright 2018 Joyent, Inc.
#
#
@@ -69,9 +70,9 @@ CFLAGS += -DSUN_KSTATS -DHOST_PAUSE -DTX_CKSUM_FIX -DTX_THREAD_RECLAIM
# CFLAGS += -DCH_DEBUG=1 -DPE_DBGOUT_ENABLED=1
#
-# Driver depends on GLD & IP
+# Driver depends on GLD, IP, and MAC
#
-LDFLAGS += -dy -N misc/gld -N drv/ip
+LDFLAGS += -dy -N misc/gld -N drv/ip -N misc/mac
# Lint flag
#
diff --git a/usr/src/uts/sparc/ipf/Makefile b/usr/src/uts/sparc/ipf/Makefile
index 5ed794ece5..a8bfc7171a 100644
--- a/usr/src/uts/sparc/ipf/Makefile
+++ b/usr/src/uts/sparc/ipf/Makefile
@@ -21,6 +21,7 @@
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
+# Copyright 2018 Joyent, Inc.
#
# uts/sparc/ipf/Makefile
#
@@ -64,6 +65,7 @@ CFLAGS += $(CCVERBOSE)
CPPFLAGS += -DIPFILTER_LKM -DIPFILTER_LOG -DIPFILTER_LOOKUP
CPPFLAGS += -DSUNDDI -DSOLARIS2=$(RELEASE_MINOR) -DIRE_ILL_CN -DUSE_INET6
LDFLAGS += -dy -Ndrv/ip -Nmisc/md5 -Nmisc/neti -Nmisc/hook -Nmisc/kcf
+LDFLAGS += -Nmisc/mac
INC_PATH += -I$(UTSBASE)/common/inet/ipf