summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Mooney <pmooney@pfmooney.com>2018-03-14 23:26:36 +0000
committerPatrick Mooney <pmooney@pfmooney.com>2020-05-11 02:35:52 +0000
commitec71f88e58593e3077f03588d3c38e6cbd4e8c1a (patch)
tree1c2efc1f91bdd867ecc4949e0b2bb55eb4d5158a
parentbf21cd9318e0a3a51b7f02c14a7c1b1aef2dc861 (diff)
downloadillumos-joyent-ec71f88e58593e3077f03588d3c38e6cbd4e8c1a.tar.gz
12671 hcksum routines are too verbose
12672 want mac_hcksum_clone function Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Ryan Zezeski <rpz@joyent.com> Approved by: Robert Mustacchi <rm@fingolfin.org>
-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/bnx/bnx.h6
-rw-r--r--usr/src/uts/common/io/bnx/bnxsnd.c2
-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/Makefile1
-rw-r--r--usr/src/uts/sparc/chxge/Makefile5
-rw-r--r--usr/src/uts/sparc/ipf/Makefile2
20 files changed, 80 insertions, 56 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 f958ca2261..b80cf53882 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 (c) 2015, Joyent, Inc. All rights reserved.
+ * 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>
@@ -1715,8 +1716,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]);
@@ -1729,8 +1729,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/bnx/bnx.h b/usr/src/uts/common/io/bnx/bnx.h
index e1d53fa9d7..9ef282678e 100644
--- a/usr/src/uts/common/io/bnx/bnx.h
+++ b/usr/src/uts/common/io/bnx/bnx.h
@@ -55,12 +55,6 @@ extern "C" {
-/*
- */
-#pragma weak hcksum_retrieve
-#pragma weak hcksum_assoc
-
-
#include "listq.h"
#include "lm5706.h"
#include "54xx_reg.h"
diff --git a/usr/src/uts/common/io/bnx/bnxsnd.c b/usr/src/uts/common/io/bnx/bnxsnd.c
index 16f1b03c10..f6e154c056 100644
--- a/usr/src/uts/common/io/bnx/bnxsnd.c
+++ b/usr/src/uts/common/io/bnx/bnxsnd.c
@@ -611,7 +611,7 @@ bnx_xmit_ring_xmit_mblk(um_device_t * const umdevice,
umpacket->frag_list.cnt = 0;
umpacket->mp = mp;
- hcksum_retrieve(mp, NULL, NULL, NULL, NULL, NULL, NULL, &pflags);
+ mac_hcksum_get(mp, NULL, NULL, NULL, NULL, &pflags);
bnx_xmit_pkt_cpy(umdevice, umpacket);
diff --git a/usr/src/uts/common/io/chxge/ch.c b/usr/src/uts/common/io/chxge/ch.c
index e7ea942405..46920a1ea2 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 1e99114b1c..1171804c28 100644
--- a/usr/src/uts/common/io/dld/dld_proto.c
+++ b/usr/src/uts/common/io/dld/dld_proto.c
@@ -1184,7 +1184,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;
@@ -1253,9 +1252,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 f9e8fdd19f..d29bb816b7 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 36359bb0a9..fbeef1fd2f 100644
--- a/usr/src/uts/common/io/mac/mac_provider.c
+++ b/usr/src/uts/common/io/mac/mac_provider.c
@@ -1496,7 +1496,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;
@@ -1521,8 +1522,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);
@@ -1534,6 +1536,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 1ffb561428..5fe5ea81fc 100644
--- a/usr/src/uts/common/os/strsubr.c
+++ b/usr/src/uts/common/os/strsubr.c
@@ -27,6 +27,7 @@
* Use is subject to license terms.
* Copyright (c) 2016 by Delphix. All rights reserved.
* Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
+ * Copyright 2018 Joyent, Inc.
*/
#include <sys/types.h>
@@ -8470,6 +8471,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 8e47f99296..9cc5c1ad5c 100644
--- a/usr/src/uts/common/sys/mac_provider.h
+++ b/usr/src/uts/common/sys/mac_provider.h
@@ -636,11 +636,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 43477446c2..14e17c1c0c 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.
*/
/*
@@ -1254,10 +1255,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 fd082067f7..1e2c3636d4 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.
#
# Copyright (c) 2018, Joyent, Inc.
@@ -70,9 +71,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 fc47a8db23..0cc8d365f0 100644
--- a/usr/src/uts/intel/ipf/Makefile
+++ b/usr/src/uts/intel/ipf/Makefile
@@ -53,6 +53,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
+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 5c9861ee7f..3250d51003 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