6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved
24 *
25 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
26 */
27 /* Copyright (c) 1990 Mentat Inc. */
28
29 #include <sys/types.h>
30 #include <sys/stream.h>
31 #include <sys/dlpi.h>
32 #include <sys/stropts.h>
33 #include <sys/sysmacros.h>
34 #include <sys/strsubr.h>
35 #include <sys/strlog.h>
36 #include <sys/strsun.h>
37 #include <sys/zone.h>
38 #define _SUN_TPI_VERSION 2
39 #include <sys/tihdr.h>
40 #include <sys/xti_inet.h>
41 #include <sys/ddi.h>
42 #include <sys/sunddi.h>
43 #include <sys/cmn_err.h>
44 #include <sys/debug.h>
45 #include <sys/kobj.h>
126 #ifdef DEBUG
127 extern boolean_t skip_sctp_cksum;
128 #endif
129
130 static void ip_input_local_v6(ire_t *, mblk_t *, ip6_t *, ip_recv_attr_t *);
131
132 static void ip_input_multicast_v6(ire_t *, mblk_t *, ip6_t *,
133 ip_recv_attr_t *);
134
135 #pragma inline(ip_input_common_v6, ip_input_local_v6, ip_forward_xmit_v6)
136
137 /*
138 * Direct read side procedure capable of dealing with chains. GLDv3 based
139 * drivers call this function directly with mblk chains while STREAMS
140 * read side procedure ip_rput() calls this for single packet with ip_ring
141 * set to NULL to process one packet at a time.
142 *
143 * The ill will always be valid if this function is called directly from
144 * the driver.
145 *
146 * If ip_input_v6() is called from GLDv3:
147 *
148 * - This must be a non-VLAN IP stream.
149 * - 'mp' is either an untagged or a special priority-tagged packet.
150 * - Any VLAN tag that was in the MAC header has been stripped.
151 *
152 * If the IP header in packet is not 32-bit aligned, every message in the
153 * chain will be aligned before further operations. This is required on SPARC
154 * platform.
155 */
156 void
157 ip_input_v6(ill_t *ill, ill_rx_ring_t *ip_ring, mblk_t *mp_chain,
158 struct mac_header_info_s *mhip)
159 {
160 (void) ip_input_common_v6(ill, ip_ring, mp_chain, mhip, NULL, NULL,
161 NULL);
162 }
163
164 /*
165 * ip_accept_tcp_v6() - This function is called by the squeue when it retrieves
166 * a chain of packets in the poll mode. The packets have gone through the
167 * data link processing but not IP processing. For performance and latency
168 * reasons, the squeue wants to process the chain in line instead of feeding
169 * it back via ip_input path.
170 *
171 * We set up the ip_recv_attr_t with IRAF_TARGET_SQP to that ip_fanout_v6
|
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved
24 *
25 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
26 * Copyright 2018 Joyent, Inc.
27 */
28 /* Copyright (c) 1990 Mentat Inc. */
29
30 #include <sys/types.h>
31 #include <sys/stream.h>
32 #include <sys/dlpi.h>
33 #include <sys/stropts.h>
34 #include <sys/sysmacros.h>
35 #include <sys/strsubr.h>
36 #include <sys/strlog.h>
37 #include <sys/strsun.h>
38 #include <sys/zone.h>
39 #define _SUN_TPI_VERSION 2
40 #include <sys/tihdr.h>
41 #include <sys/xti_inet.h>
42 #include <sys/ddi.h>
43 #include <sys/sunddi.h>
44 #include <sys/cmn_err.h>
45 #include <sys/debug.h>
46 #include <sys/kobj.h>
127 #ifdef DEBUG
128 extern boolean_t skip_sctp_cksum;
129 #endif
130
131 static void ip_input_local_v6(ire_t *, mblk_t *, ip6_t *, ip_recv_attr_t *);
132
133 static void ip_input_multicast_v6(ire_t *, mblk_t *, ip6_t *,
134 ip_recv_attr_t *);
135
136 #pragma inline(ip_input_common_v6, ip_input_local_v6, ip_forward_xmit_v6)
137
138 /*
139 * Direct read side procedure capable of dealing with chains. GLDv3 based
140 * drivers call this function directly with mblk chains while STREAMS
141 * read side procedure ip_rput() calls this for single packet with ip_ring
142 * set to NULL to process one packet at a time.
143 *
144 * The ill will always be valid if this function is called directly from
145 * the driver.
146 *
147 * If this chain is part of a VLAN stream, then the VLAN tag is
148 * stripped from the MAC header before being delivered to this
149 * function.
150 *
151 * If the IP header in packet is not 32-bit aligned, every message in the
152 * chain will be aligned before further operations. This is required on SPARC
153 * platform.
154 */
155 void
156 ip_input_v6(ill_t *ill, ill_rx_ring_t *ip_ring, mblk_t *mp_chain,
157 struct mac_header_info_s *mhip)
158 {
159 (void) ip_input_common_v6(ill, ip_ring, mp_chain, mhip, NULL, NULL,
160 NULL);
161 }
162
163 /*
164 * ip_accept_tcp_v6() - This function is called by the squeue when it retrieves
165 * a chain of packets in the poll mode. The packets have gone through the
166 * data link processing but not IP processing. For performance and latency
167 * reasons, the squeue wants to process the chain in line instead of feeding
168 * it back via ip_input path.
169 *
170 * We set up the ip_recv_attr_t with IRAF_TARGET_SQP to that ip_fanout_v6
|