summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/inet/ip/ip_input.c
diff options
context:
space:
mode:
authorRyan Zezeski <rpz@joyent.com>2018-09-21 08:48:14 -0600
committerRyan Zezeski <rpz@joyent.com>2018-10-18 22:58:07 -0600
commit104c53876a87e773ef729efa9419a70fe24933cb (patch)
tree1f86b5c4cb5568dc09331c680935969592c58644 /usr/src/uts/common/inet/ip/ip_input.c
parentc6d34d2b1dfd2a8be003867d868e26d325f8584f (diff)
downloadillumos-joyent-104c53876a87e773ef729efa9419a70fe24933cb.tar.gz
OS-2340 vnics should support LSO
OS-6778 MAC loopback traffic should avoid cksum work OS-6794 want LSO support in viona Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Dan McDonald <danmcd@joyent.com> Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Reviewed by: Hans Rosenfeld <hans.rosenfeld@joyent.com> Reviewed by: Jorge Schrauwen <jorge@blackdot.be> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/uts/common/inet/ip/ip_input.c')
-rw-r--r--usr/src/uts/common/inet/ip/ip_input.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/usr/src/uts/common/inet/ip/ip_input.c b/usr/src/uts/common/inet/ip/ip_input.c
index 88f80a926b..22c1c74391 100644
--- a/usr/src/uts/common/inet/ip/ip_input.c
+++ b/usr/src/uts/common/inet/ip/ip_input.c
@@ -57,6 +57,7 @@
#include <sys/vtrace.h>
#include <sys/isa_defs.h>
#include <sys/mac.h>
+#include <sys/mac_client.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <net/route.h>
@@ -659,11 +660,13 @@ ill_input_short_v4(mblk_t *mp, void *iph_arg, void *nexthop_arg,
}
/*
- * If there is a good HW IP header checksum we clear the need
+ * If the packet originated from a same-machine sender or
+ * there is a good HW IP header checksum, we clear the need
* look at the IP header checksum.
*/
- if ((DB_CKSUMFLAGS(mp) & HCK_IPV4_HDRCKSUM) &&
- ILL_HCKSUM_CAPABLE(ill) && dohwcksum) {
+ if ((DB_CKSUMFLAGS(mp) & HW_LOCAL_MAC) ||
+ ((DB_CKSUMFLAGS(mp) & HCK_IPV4_HDRCKSUM) &&
+ ILL_HCKSUM_CAPABLE(ill) && dohwcksum)) {
/* Header checksum was ok. Clear the flag */
DB_CKSUMFLAGS(mp) &= ~HCK_IPV4_HDRCKSUM;
ira->ira_flags &= ~IRAF_VERIFY_IP_CKSUM;
@@ -2256,12 +2259,13 @@ ip_input_cksum_v4(iaflags_t iraflags, mblk_t *mp, ipha_t *ipha,
* We apply this for all ULP protocols. Does the HW know to
* not set the flags for SCTP and other protocols.
*/
-
hck_flags = DB_CKSUMFLAGS(mp);
- if (hck_flags & HCK_FULLCKSUM_OK) {
+ if ((hck_flags & HCK_FULLCKSUM_OK) || (hck_flags & HW_LOCAL_MAC)) {
/*
- * Hardware has already verified the checksum.
+ * Either the hardware already verified the checksum
+ * or the packet is from a same-machine sender in
+ * which case we assume data integrity.
*/
return (B_TRUE);
}