\hypertarget{t4__sge_8c_source}{}\doxysection{t4\+\_\+sge.\+c}
\label{t4__sge_8c_source}\index{dev/cxgbe/t4\_sge.c@{dev/cxgbe/t4\_sge.c}}
\mbox{\hyperlink{t4__sge_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2011 Chelsio Communications, Inc.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00006}00006 \textcolor{comment}{ * Written by: Navdeep Parhar <np@FreeBSD.org>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00008}00008 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00009}00009 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00010}00010 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00011}00011 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00012}00012 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00013}00013 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00014}00014 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00015}00015 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00016}00016 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00017}00017 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00018}00018 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00019}00019 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00020}00020 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00021}00021 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00022}00022 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00023}00023 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00024}00024 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00025}00025 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00026}00026 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00027}00027 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00028}00028 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00029}00029 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00030}00030 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00031}\mbox{\hyperlink{t4__sge_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00031}} \mbox{\hyperlink{t4__sge_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00032}00032 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00033}00033 \textcolor{preprocessor}{\#include "{}opt\_inet.h"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00034}00034 \textcolor{preprocessor}{\#include "{}opt\_inet6.h"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00035}00035 \textcolor{preprocessor}{\#include "{}opt\_kern\_tls.h"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00036}00036 \textcolor{preprocessor}{\#include "{}opt\_ratelimit.h"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/eventhandler.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/mbuf.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/ktls.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/msan.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <sys/sbuf.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/taskqueue.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <sys/time.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <sys/sglist.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <sys/smp.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <sys/socketvar.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <sys/counter.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <net/bpf.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <net/ethernet.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <net/if.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <net/if\_vlan\_var.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <net/if\_vxlan.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <netinet/in.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <netinet/ip.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00062}00062 \textcolor{preprocessor}{\#include <netinet/ip6.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00063}00063 \textcolor{preprocessor}{\#include <netinet/tcp.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00064}00064 \textcolor{preprocessor}{\#include <netinet/udp.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00065}00065 \textcolor{preprocessor}{\#include <machine/in\_cksum.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00066}00066 \textcolor{preprocessor}{\#include <machine/md\_var.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00067}00067 \textcolor{preprocessor}{\#include <vm/vm.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00068}00068 \textcolor{preprocessor}{\#include <vm/pmap.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00069}00069 \textcolor{preprocessor}{\#ifdef DEV\_NETMAP}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00070}00070 \textcolor{preprocessor}{\#include <machine/bus.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00071}00071 \textcolor{preprocessor}{\#include <sys/selinfo.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00072}00072 \textcolor{preprocessor}{\#include <net/if\_var.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00073}00073 \textcolor{preprocessor}{\#include <net/netmap.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00074}00074 \textcolor{preprocessor}{\#include <dev/netmap/netmap\_kern.h>}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00075}00075 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00076}00076 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00077}00077 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{common_8h}{common/common.h}}"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00078}00078 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{t4__regs_8h}{common/t4\_regs.h}}"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00079}00079 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{t4__regs__values_8h}{common/t4\_regs\_values.h}}"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00080}00080 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{t4__msg_8h}{common/t4\_msg.h}}"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00081}00081 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{t4__l2t_8h}{t4\_l2t.h}}"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00082}00082 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{t4__mp__ring_8h}{t4\_mp\_ring.h}}"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00084}00084 \textcolor{preprocessor}{\#ifdef T4\_PKT\_TIMESTAMP}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00085}00085 \textcolor{preprocessor}{\#define RX\_COPY\_THRESHOLD (MINCLSIZE -\/ 8)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00086}00086 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00087}\mbox{\hyperlink{t4__sge_8c_ab343f68afb69400300058b3a24de6de2}{00087}} \textcolor{preprocessor}{\#define RX\_COPY\_THRESHOLD MINCLSIZE}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00088}00088 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00090}00090 \textcolor{comment}{/* Internal mbuf flags stored in PH\_loc.eight[1]. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00091}\mbox{\hyperlink{t4__sge_8c_a4353f1e1a017e811c6a8f5b0627da2fb}{00091}} \textcolor{preprocessor}{\#define MC\_NOMAP                0x01}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00092}\mbox{\hyperlink{t4__sge_8c_a2ac69895d2a4a0ccd1c370d74f924300}{00092}} \textcolor{preprocessor}{\#define MC\_RAW\_WR               0x02}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00093}\mbox{\hyperlink{t4__sge_8c_a0b8f49eb708f2da4e7d728702835c8c5}{00093}} \textcolor{preprocessor}{\#define MC\_TLS                  0x04}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00094}00094 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00095}00095 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00096}00096 \textcolor{comment}{ * Ethernet frames are DMA'd at this byte offset into the freelist buffer.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00097}00097 \textcolor{comment}{ * 0-\/7 are valid values.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00098}00098 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00099}\mbox{\hyperlink{t4__sge_8c_aa6956f99e1e867c8f75587f440b91cc4}{00099}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_aa6956f99e1e867c8f75587f440b91cc4}{fl\_pktshift}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00100}\mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{00100}} \mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{SYSCTL\_INT}}(\_hw\_cxgbe, OID\_AUTO, \mbox{\hyperlink{t4__sge_8c_aa6956f99e1e867c8f75587f440b91cc4}{fl\_pktshift}}, CTLFLAG\_RDTUN, \&\mbox{\hyperlink{t4__sge_8c_aa6956f99e1e867c8f75587f440b91cc4}{fl\_pktshift}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00101}00101     \textcolor{stringliteral}{"{}payload DMA offset in rx buffer (bytes)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00103}00103 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00104}00104 \textcolor{comment}{ * Pad ethernet payload up to this boundary.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00105}00105 \textcolor{comment}{ * -\/1: driver should figure out a good value.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00106}00106 \textcolor{comment}{ *  0: disable padding.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00107}00107 \textcolor{comment}{ *  Any power of 2 from 32 to 4096 (both inclusive) is also a valid value.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00108}00108 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00109}\mbox{\hyperlink{t4__sge_8c_ab4e2791bbea61f64ac9d9d20708712fd}{00109}} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_ab4e2791bbea61f64ac9d9d20708712fd}{fl\_pad}} = -\/1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00110}\mbox{\hyperlink{t4__sge_8c_ac7cf4d50e6b650e3f86f01f2b3caf14b}{00110}} \mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{SYSCTL\_INT}}(\_hw\_cxgbe, OID\_AUTO, \mbox{\hyperlink{t4__sge_8c_ab4e2791bbea61f64ac9d9d20708712fd}{fl\_pad}}, CTLFLAG\_RDTUN, \&\mbox{\hyperlink{t4__sge_8c_ab4e2791bbea61f64ac9d9d20708712fd}{fl\_pad}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00111}00111     \textcolor{stringliteral}{"{}payload pad boundary (bytes)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00112}00112 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00113}00113 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00114}00114 \textcolor{comment}{ * Status page length.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00115}00115 \textcolor{comment}{ * -\/1: driver should figure out a good value.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00116}00116 \textcolor{comment}{ *  64 or 128 are the only other valid values.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00117}00117 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00118}\mbox{\hyperlink{t4__sge_8c_a4d13a14959e500ba1a81436734306011}{00118}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a4d13a14959e500ba1a81436734306011}{spg\_len}} = -\/1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00119}\mbox{\hyperlink{t4__sge_8c_acb9150c5f538d0cb08df99ea69d7ba8f}{00119}} \mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{SYSCTL\_INT}}(\_hw\_cxgbe, OID\_AUTO, \mbox{\hyperlink{t4__sge_8c_a4d13a14959e500ba1a81436734306011}{spg\_len}}, CTLFLAG\_RDTUN, \&\mbox{\hyperlink{t4__sge_8c_a4d13a14959e500ba1a81436734306011}{spg\_len}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00120}00120     \textcolor{stringliteral}{"{}status page size (bytes)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00121}00121 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00122}00122 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00123}00123 \textcolor{comment}{ * Congestion drops.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00124}00124 \textcolor{comment}{ * -\/1: no congestion feedback (not recommended).}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00125}00125 \textcolor{comment}{ *  0: backpressure the channel instead of dropping packets right away.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00126}00126 \textcolor{comment}{ *  1: no backpressure, drop packets for the congested queue immediately.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00127}00127 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00128}\mbox{\hyperlink{t4__sge_8c_a16e95a619bd0b203622b81e9984bde07}{00128}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a16e95a619bd0b203622b81e9984bde07}{cong\_drop}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00129}\mbox{\hyperlink{t4__sge_8c_ad498096e548c3f4059219ab6089529de}{00129}} \mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{SYSCTL\_INT}}(\_hw\_cxgbe, OID\_AUTO, \mbox{\hyperlink{t4__sge_8c_a16e95a619bd0b203622b81e9984bde07}{cong\_drop}}, CTLFLAG\_RDTUN, \&\mbox{\hyperlink{t4__sge_8c_a16e95a619bd0b203622b81e9984bde07}{cong\_drop}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00130}00130     \textcolor{stringliteral}{"{}Congestion control for RX queues (0 = backpressure, 1 = drop"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00132}00132 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00133}00133 \textcolor{comment}{ * Deliver multiple frames in the same free list buffer if they fit.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00134}00134 \textcolor{comment}{ * -\/1: let the driver decide whether to enable buffer packing or not.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00135}00135 \textcolor{comment}{ *  0: disable buffer packing.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00136}00136 \textcolor{comment}{ *  1: enable buffer packing.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00137}00137 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00138}\mbox{\hyperlink{t4__sge_8c_a4c90bb713d4d2847ce444a3c08edfc82}{00138}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a4c90bb713d4d2847ce444a3c08edfc82}{buffer\_packing}} = -\/1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00139}\mbox{\hyperlink{t4__sge_8c_a0f1f04805cb5f34e55d0de49f20654be}{00139}} \mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{SYSCTL\_INT}}(\_hw\_cxgbe, OID\_AUTO, \mbox{\hyperlink{t4__sge_8c_a4c90bb713d4d2847ce444a3c08edfc82}{buffer\_packing}}, CTLFLAG\_RDTUN, \&\mbox{\hyperlink{t4__sge_8c_a4c90bb713d4d2847ce444a3c08edfc82}{buffer\_packing}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00140}00140     0, \textcolor{stringliteral}{"{}Enable buffer packing"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00141}00141 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00142}00142 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00143}00143 \textcolor{comment}{ * Start next frame in a packed buffer at this boundary.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00144}00144 \textcolor{comment}{ * -\/1: driver should figure out a good value.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00145}00145 \textcolor{comment}{ * T4: driver will ignore this and use the same value as fl\_pad above.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00146}00146 \textcolor{comment}{ * T5: 16, or a power of 2 from 64 to 4096 (both inclusive) is a valid value.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00147}00147 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00148}\mbox{\hyperlink{t4__sge_8c_ad40108c5109461bd99b910fddbee5af3}{00148}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_ad40108c5109461bd99b910fddbee5af3}{fl\_pack}} = -\/1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00149}\mbox{\hyperlink{t4__sge_8c_aa00c29e7ffa990fffdfe4f8c3cb695da}{00149}} \mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{SYSCTL\_INT}}(\_hw\_cxgbe, OID\_AUTO, \mbox{\hyperlink{t4__sge_8c_ad40108c5109461bd99b910fddbee5af3}{fl\_pack}}, CTLFLAG\_RDTUN, \&\mbox{\hyperlink{t4__sge_8c_ad40108c5109461bd99b910fddbee5af3}{fl\_pack}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00150}00150     \textcolor{stringliteral}{"{}payload pack boundary (bytes)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00151}00151 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00152}00152 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00153}00153 \textcolor{comment}{ * Largest rx cluster size that the driver is allowed to allocate.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00154}00154 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00155}\mbox{\hyperlink{t4__sge_8c_afc662bb0583ce4a9ef1867e1e9502fed}{00155}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_afc662bb0583ce4a9ef1867e1e9502fed}{largest\_rx\_cluster}} = MJUM16BYTES;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00156}\mbox{\hyperlink{t4__sge_8c_af187e903da0e5ef06196a216ad9a1be3}{00156}} \mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{SYSCTL\_INT}}(\_hw\_cxgbe, OID\_AUTO, \mbox{\hyperlink{t4__sge_8c_afc662bb0583ce4a9ef1867e1e9502fed}{largest\_rx\_cluster}}, CTLFLAG\_RDTUN,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00157}00157     \&\mbox{\hyperlink{t4__sge_8c_afc662bb0583ce4a9ef1867e1e9502fed}{largest\_rx\_cluster}}, 0, \textcolor{stringliteral}{"{}Largest rx cluster (bytes)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00158}00158 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00159}00159 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00160}00160 \textcolor{comment}{ * Size of cluster allocation that's most likely to succeed.  The driver will}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00161}00161 \textcolor{comment}{ * fall back to this size if it fails to allocate clusters larger than this.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00162}00162 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00163}\mbox{\hyperlink{t4__sge_8c_aab6212f98bd81400ad4a1e34acdf632b}{00163}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_aab6212f98bd81400ad4a1e34acdf632b}{safest\_rx\_cluster}} = PAGE\_SIZE;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00164}\mbox{\hyperlink{t4__sge_8c_ace34356ef4e7340b75bf20ae05f44583}{00164}} \mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{SYSCTL\_INT}}(\_hw\_cxgbe, OID\_AUTO, \mbox{\hyperlink{t4__sge_8c_aab6212f98bd81400ad4a1e34acdf632b}{safest\_rx\_cluster}}, CTLFLAG\_RDTUN,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00165}00165     \&\mbox{\hyperlink{t4__sge_8c_aab6212f98bd81400ad4a1e34acdf632b}{safest\_rx\_cluster}}, 0, \textcolor{stringliteral}{"{}Safe rx cluster (bytes)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00166}00166 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00167}00167 \textcolor{preprocessor}{\#ifdef RATELIMIT}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00168}00168 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00169}00169 \textcolor{comment}{ * Knob to control TCP timestamp rewriting, and the granularity of the tick used}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00170}00170 \textcolor{comment}{ * for rewriting.  -\/1 and 0-\/3 are all valid values.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00171}00171 \textcolor{comment}{ * -\/1: hardware should leave the TCP timestamps alone.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00172}00172 \textcolor{comment}{ * 0: 1ms}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00173}00173 \textcolor{comment}{ * 1: 100us}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00174}00174 \textcolor{comment}{ * 2: 10us}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00175}00175 \textcolor{comment}{ * 3: 1us}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00176}00176 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00177}00177 \textcolor{keyword}{static} \textcolor{keywordtype}{int} tsclk = -\/1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00178}00178 \mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{SYSCTL\_INT}}(\_hw\_cxgbe, OID\_AUTO, tsclk, CTLFLAG\_RDTUN, \&tsclk, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00179}00179     \textcolor{stringliteral}{"{}Control TCP timestamp rewriting when using pacing"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00180}00180 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00181}00181 \textcolor{keyword}{static} \textcolor{keywordtype}{int} eo\_max\_backlog = 1024 * 1024;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00182}00182 \mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{SYSCTL\_INT}}(\_hw\_cxgbe, OID\_AUTO, eo\_max\_backlog, CTLFLAG\_RDTUN, \&eo\_max\_backlog,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00183}00183     0, \textcolor{stringliteral}{"{}Maximum backlog of ratelimited data per flow"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00184}00184 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00185}00185 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00186}00186 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00187}00187 \textcolor{comment}{ * The interrupt holdoff timers are multiplied by this value on T6+.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00188}00188 \textcolor{comment}{ * 1 and 3-\/17 (both inclusive) are legal values.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00189}00189 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00190}\mbox{\hyperlink{t4__sge_8c_a00444d0d2b96d25bc135956feea74288}{00190}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a00444d0d2b96d25bc135956feea74288}{tscale}} = 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00191}\mbox{\hyperlink{t4__sge_8c_a1431a047fee8e650047fdae977143dec}{00191}} \mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{SYSCTL\_INT}}(\_hw\_cxgbe, OID\_AUTO, \mbox{\hyperlink{t4__sge_8c_a00444d0d2b96d25bc135956feea74288}{tscale}}, CTLFLAG\_RDTUN, \&\mbox{\hyperlink{t4__sge_8c_a00444d0d2b96d25bc135956feea74288}{tscale}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00192}00192     \textcolor{stringliteral}{"{}Interrupt holdoff timer scale on T6+"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00193}00193 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00194}00194 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00195}00195 \textcolor{comment}{ * Number of LRO entries in the lro\_ctrl structure per rx queue.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00196}00196 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00197}\mbox{\hyperlink{t4__sge_8c_a4410a6b7d948c22483e1fec53c89749f}{00197}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a4410a6b7d948c22483e1fec53c89749f}{lro\_entries}} = TCP\_LRO\_ENTRIES;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00198}\mbox{\hyperlink{t4__sge_8c_ad102906c47aa0b55dc3311a060dae87d}{00198}} \mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{SYSCTL\_INT}}(\_hw\_cxgbe, OID\_AUTO, \mbox{\hyperlink{t4__sge_8c_a4410a6b7d948c22483e1fec53c89749f}{lro\_entries}}, CTLFLAG\_RDTUN, \&\mbox{\hyperlink{t4__sge_8c_a4410a6b7d948c22483e1fec53c89749f}{lro\_entries}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00199}00199     \textcolor{stringliteral}{"{}Number of LRO entries per RX queue"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00200}00200 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00201}00201 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00202}00202 \textcolor{comment}{ * This enables presorting of frames before they're fed into tcp\_lro\_rx.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00203}00203 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00204}\mbox{\hyperlink{t4__sge_8c_a04383ab04ebedc7c0a53b4571e3930d3}{00204}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a04383ab04ebedc7c0a53b4571e3930d3}{lro\_mbufs}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00205}\mbox{\hyperlink{t4__sge_8c_adeb0d9849adc35ee785ec69201eba5e6}{00205}} \mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{SYSCTL\_INT}}(\_hw\_cxgbe, OID\_AUTO, \mbox{\hyperlink{t4__sge_8c_a04383ab04ebedc7c0a53b4571e3930d3}{lro\_mbufs}}, CTLFLAG\_RDTUN, \&\mbox{\hyperlink{t4__sge_8c_a04383ab04ebedc7c0a53b4571e3930d3}{lro\_mbufs}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00206}00206     \textcolor{stringliteral}{"{}Enable presorting of LRO frames"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00207}00207 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00208}\mbox{\hyperlink{t4__sge_8c_a09a7a7db03ceddf0aec5404858b5274d}{00208}} \textcolor{keyword}{static} counter\_u64\_t \mbox{\hyperlink{t4__sge_8c_a09a7a7db03ceddf0aec5404858b5274d}{pullups}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00209}\mbox{\hyperlink{t4__sge_8c_ac24710f1937feb9a3a9431200a2de86b}{00209}} \mbox{\hyperlink{t4__sge_8c_ac24710f1937feb9a3a9431200a2de86b}{SYSCTL\_COUNTER\_U64}}(\_hw\_cxgbe, OID\_AUTO, \mbox{\hyperlink{t4__sge_8c_a09a7a7db03ceddf0aec5404858b5274d}{pullups}}, CTLFLAG\_RD, \&\mbox{\hyperlink{t4__sge_8c_a09a7a7db03ceddf0aec5404858b5274d}{pullups}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00210}00210     \textcolor{stringliteral}{"{}Number of mbuf pullups performed"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00211}00211 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00212}\mbox{\hyperlink{t4__sge_8c_abc3e9b6ba5b5e166a75ad1078bda20c5}{00212}} \textcolor{keyword}{static} counter\_u64\_t \mbox{\hyperlink{t4__sge_8c_abc3e9b6ba5b5e166a75ad1078bda20c5}{defrags}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00213}\mbox{\hyperlink{t4__sge_8c_abdff95901b9e409792f5b332dd62196f}{00213}} \mbox{\hyperlink{t4__sge_8c_ac24710f1937feb9a3a9431200a2de86b}{SYSCTL\_COUNTER\_U64}}(\_hw\_cxgbe, OID\_AUTO, \mbox{\hyperlink{t4__sge_8c_abc3e9b6ba5b5e166a75ad1078bda20c5}{defrags}}, CTLFLAG\_RD, \&\mbox{\hyperlink{t4__sge_8c_abc3e9b6ba5b5e166a75ad1078bda20c5}{defrags}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00214}00214     \textcolor{stringliteral}{"{}Number of mbuf defrags performed"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00215}00215 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00216}\mbox{\hyperlink{t4__sge_8c_a2f2fc8e1a9564325472a25b8b2ed1393}{00216}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a2f2fc8e1a9564325472a25b8b2ed1393}{t4\_tx\_coalesce}} = 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00217}\mbox{\hyperlink{t4__sge_8c_a2303d377c05eb62b70b72a614b667d25}{00217}} \mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{SYSCTL\_INT}}(\_hw\_cxgbe, OID\_AUTO, tx\_coalesce, CTLFLAG\_RWTUN, \&\mbox{\hyperlink{t4__sge_8c_a2f2fc8e1a9564325472a25b8b2ed1393}{t4\_tx\_coalesce}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00218}00218     \textcolor{stringliteral}{"{}tx coalescing allowed"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00219}00219 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00220}00220 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00221}00221 \textcolor{comment}{ * The driver will make aggressive attempts at tx coalescing if it sees these}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00222}00222 \textcolor{comment}{ * many packets eligible for coalescing in quick succession, with no more than}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00223}00223 \textcolor{comment}{ * the specified gap in between the eth\_tx calls that delivered the packets.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00224}00224 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00225}\mbox{\hyperlink{t4__sge_8c_ac7836d09583964bcaef7e6ac56e9eb6a}{00225}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_ac7836d09583964bcaef7e6ac56e9eb6a}{t4\_tx\_coalesce\_pkts}} = 32;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00226}\mbox{\hyperlink{t4__sge_8c_a4c86c3e462e4ca49f7f566fa36ce88ab}{00226}} \mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{SYSCTL\_INT}}(\_hw\_cxgbe, OID\_AUTO, tx\_coalesce\_pkts, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00227}00227     \&\mbox{\hyperlink{t4__sge_8c_ac7836d09583964bcaef7e6ac56e9eb6a}{t4\_tx\_coalesce\_pkts}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00228}00228     \textcolor{stringliteral}{"{}\# of consecutive packets (1 -\/ 255) that will trigger tx coalescing"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00229}\mbox{\hyperlink{t4__sge_8c_a896a8afef9676ef123fb9263ba67b58a}{00229}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a896a8afef9676ef123fb9263ba67b58a}{t4\_tx\_coalesce\_gap}} = 5;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00230}\mbox{\hyperlink{t4__sge_8c_afec70752af48db55f46c1d9d392ace07}{00230}} \mbox{\hyperlink{t4__sge_8c_a151698af24093d4ab82f113a4f03c5f1}{SYSCTL\_INT}}(\_hw\_cxgbe, OID\_AUTO, tx\_coalesce\_gap, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00231}00231     \&\mbox{\hyperlink{t4__sge_8c_a896a8afef9676ef123fb9263ba67b58a}{t4\_tx\_coalesce\_gap}}, 0, \textcolor{stringliteral}{"{}tx gap (in microseconds)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00232}00232 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00233}00233 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a7f4da6ef4228dc3219cb5ddcebad7e0b}{service\_iq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00234}00234 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a5eac4770aab679112771b8565f9ae4d6}{service\_iq\_fl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00235}\mbox{\hyperlink{t4__sge_8c_aaa31acd67a226af581c0792affdde64f}{00235}} \textcolor{keyword}{static} \textcolor{keyword}{struct }mbuf *\mbox{\hyperlink{t4__sge_8c_aaa31acd67a226af581c0792affdde64f}{get\_fl\_payload}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *, uint32\_t);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00236}00236 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a6fc82bd622ab303ae0087d23b2c6776e}{eth\_rx}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__rxq}{sge\_rxq}} *, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structiq__desc}{iq\_desc}} *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00237}00237     u\_int);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00238}00238 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a0383a9d8cf7c3411e3ce5988ef8f775d}{init\_iq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00239}00239     \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00240}00240 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a3289b3d275f3e30cae9dd2c0e65121ff}{init\_fl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{char} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00241}00241 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a7c78925258e7e3b91aaec525467ef32b}{init\_eq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int}, uint8\_t,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00242}00242     \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *, \textcolor{keywordtype}{char} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00243}00243 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a43b589cf2cd0d6c9bf52efef32c00028}{alloc\_iq\_fl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00244}00244     \textcolor{keyword}{struct} sysctl\_ctx\_list *, \textcolor{keyword}{struct} sysctl\_oid *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00245}00245 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a776148d20afbfccd8846649528c046a4}{free\_iq\_fl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00246}00246 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_afc7094a28bd87d0c9c337929074311a6}{add\_iq\_sysctls}}(\textcolor{keyword}{struct} sysctl\_ctx\_list *, \textcolor{keyword}{struct} sysctl\_oid *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00247}00247     \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00248}00248 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a5297883d6f50f02efdf48eb35dd4e774}{add\_fl\_sysctls}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} sysctl\_ctx\_list *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00249}00249     \textcolor{keyword}{struct} sysctl\_oid *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00250}00250 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_ad1c3f730aeb7b6b529e1969f23c5c7c2}{alloc\_iq\_fl\_hwq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00251}00251 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a39da7ed8d40c7254a8756c4ef0ce1713}{free\_iq\_fl\_hwq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00252}00252 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_acb170e5c90249a8491cb90efe7e5059d}{alloc\_fwq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00253}00253 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_ad69e4ac1131709f75ac5b57335a2d5f8}{free\_fwq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00254}00254 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a9ab19f6b7bd869f6e116b5b2589023f6}{alloc\_ctrlq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00255}00255 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a9cf43bfa4e52a90a90b726540134239f}{free\_ctrlq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00256}00256 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a280f219d1e6636734df6b7b9800339af}{alloc\_rxq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__rxq}{sge\_rxq}} *, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00257}00257 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a8313c565677706e732edaf02c788815c}{free\_rxq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__rxq}{sge\_rxq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00258}00258 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a17ca2509cb02bb0544e35cb1c09166cf}{add\_rxq\_sysctls}}(\textcolor{keyword}{struct} sysctl\_ctx\_list *, \textcolor{keyword}{struct} sysctl\_oid *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00259}00259     \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__rxq}{sge\_rxq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00260}00260 \textcolor{preprocessor}{\#ifdef TCP\_OFFLOAD}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00261}00261 \textcolor{keyword}{static} \textcolor{keywordtype}{int} alloc\_ofld\_rxq(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__ofld__rxq}{sge\_ofld\_rxq}} *, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00262}00262     \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00263}00263 \textcolor{keyword}{static} \textcolor{keywordtype}{void} free\_ofld\_rxq(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__ofld__rxq}{sge\_ofld\_rxq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00264}00264 \textcolor{keyword}{static} \textcolor{keywordtype}{void} add\_ofld\_rxq\_sysctls(\textcolor{keyword}{struct} sysctl\_ctx\_list *, \textcolor{keyword}{struct} sysctl\_oid *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00265}00265     \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__ofld__rxq}{sge\_ofld\_rxq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00266}00266 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00267}00267 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_ac47f777ad76b27ca26696842076fde68}{ctrl\_eq\_alloc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00268}00268 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_aaef0e4b0b96d38d557241a5b3c098455}{eth\_eq\_alloc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00269}00269 \textcolor{preprocessor}{\#if defined(TCP\_OFFLOAD) || defined(RATELIMIT)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00270}00270 \textcolor{keyword}{static} \textcolor{keywordtype}{int} ofld\_eq\_alloc(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00271}00271 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00272}00272 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_aa66692aa7349d86ff110928283c281ca}{alloc\_eq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *, \textcolor{keyword}{struct} sysctl\_ctx\_list *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00273}00273     \textcolor{keyword}{struct} sysctl\_oid *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00274}00274 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a5cffbcbe968a0aba74e5989647420178}{free\_eq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00275}00275 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a0f6314ef6c97086aa440f72841c6b5f9}{add\_eq\_sysctls}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} sysctl\_ctx\_list *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00276}00276     \textcolor{keyword}{struct} sysctl\_oid *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00277}00277 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_af71a8049264ddc95eac76d1f5b081fea}{alloc\_eq\_hwq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00278}\mbox{\hyperlink{t4__sge_8c_a789211e590312421a461f63e96a64079}{00278}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a789211e590312421a461f63e96a64079}{free\_eq\_hwq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00279}00279 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_ad454dd350a42f4f11557e41ba26b0e29}{alloc\_wrq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__wrq}{sge\_wrq}} *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00280}00280     \textcolor{keyword}{struct} sysctl\_ctx\_list *, \textcolor{keyword}{struct} sysctl\_oid *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00281}00281 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a50b9795eebe8d82881a973316b4af3ca}{free\_wrq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__wrq}{sge\_wrq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00282}00282 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_ab9a9e03db43c2aae1075dbfe44866092}{add\_wrq\_sysctls}}(\textcolor{keyword}{struct} sysctl\_ctx\_list *, \textcolor{keyword}{struct} sysctl\_oid *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00283}00283     \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__wrq}{sge\_wrq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00284}00284 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a0d41f700a943c229254d4bef06326eb7}{alloc\_txq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00285}00285 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_aaa69bf67b08bd89ddff7470f2dbc85eb}{free\_txq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00286}00286 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_aa5f8f5c1e0ff31da13d85dc7cbc7b1f4}{add\_txq\_sysctls}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *, \textcolor{keyword}{struct} sysctl\_ctx\_list *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00287}00287     \textcolor{keyword}{struct} sysctl\_oid *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00288}00288 \textcolor{preprocessor}{\#if defined(TCP\_OFFLOAD) || defined(RATELIMIT)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00289}00289 \textcolor{keyword}{static} \textcolor{keywordtype}{int} alloc\_ofld\_txq(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__ofld__txq}{sge\_ofld\_txq}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00290}00290 \textcolor{keyword}{static} \textcolor{keywordtype}{void} free\_ofld\_txq(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__ofld__txq}{sge\_ofld\_txq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00291}00291 \textcolor{keyword}{static} \textcolor{keywordtype}{void} add\_ofld\_txq\_sysctls(\textcolor{keyword}{struct} sysctl\_ctx\_list *, \textcolor{keyword}{struct} sysctl\_oid *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00292}00292     \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__ofld__txq}{sge\_ofld\_txq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00293}00293 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00294}00294 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_af40ba290a67743180a6848b100bca7d0}{oneseg\_dma\_callback}}(\textcolor{keywordtype}{void} *, bus\_dma\_segment\_t *, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00295}00295 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a3a91bd0ddac7f0c46d2e99c2307e59da}{ring\_fl\_db}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00296}00296 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_ac105ed5d85881e9f6b48414965986423}{refill\_fl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00297}00297 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a8173780e40a7fbd712d976102611cf11}{refill\_sfl}}(\textcolor{keywordtype}{void} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00298}00298 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_ad6dd0b621aa9adaa3937ac3a13d030b5}{find\_refill\_source}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{bool});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00299}00299 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a0280e71f22d29f8ea1ee29159418d3d9}{add\_fl\_to\_sfl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00300}00300 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00301}00301 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a9b33f2920382e5c3c1308a4e26203b04}{get\_pkt\_gl}}(\textcolor{keyword}{struct} mbuf *, \textcolor{keyword}{struct} sglist *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00302}00302 \textcolor{keyword}{static} \textcolor{keyword}{inline} u\_int \mbox{\hyperlink{t4__sge_8c_a9ec405955d7d34f2d0b4e7d163cd309f}{txpkt\_len16}}(u\_int, \textcolor{keyword}{const} u\_int);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00303}00303 \textcolor{keyword}{static} \textcolor{keyword}{inline} u\_int \mbox{\hyperlink{t4__sge_8c_af059001e4d8493a578bff4ec86a48790}{txpkt\_vm\_len16}}(u\_int, \textcolor{keyword}{const} u\_int);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00304}00304 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a5d566c57475924b2da78ff5946c44365}{calculate\_mbuf\_len16}}(\textcolor{keyword}{struct} mbuf *, \textcolor{keywordtype}{bool});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00305}00305 \textcolor{keyword}{static} \textcolor{keyword}{inline} u\_int \mbox{\hyperlink{t4__sge_8c_ab1998119238c6c4c5053563d5daf7b69}{txpkts0\_len16}}(u\_int);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00306}00306 \textcolor{keyword}{static} \textcolor{keyword}{inline} u\_int \mbox{\hyperlink{t4__sge_8c_a1bf2a7023f5b2f577c53324bfc94ddcf}{txpkts1\_len16}}(\textcolor{keywordtype}{void});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00307}00307 \textcolor{keyword}{static} u\_int \mbox{\hyperlink{t4__sge_8c_a9f013983c6707d2baafc3280297519e5}{write\_raw\_wr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *, \textcolor{keywordtype}{void} *, \textcolor{keyword}{struct} mbuf *, u\_int);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00308}00308 \textcolor{keyword}{static} u\_int \mbox{\hyperlink{t4__sge_8c_a89d48e1713a55754ddfab7e701fd1717}{write\_txpkt\_wr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *, \textcolor{keyword}{struct} mbuf *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00309}00309     u\_int);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00310}00310 \textcolor{keyword}{static} u\_int \mbox{\hyperlink{t4__sge_8c_abf1d1d93efad4d497cfff16e239ca77b}{write\_txpkt\_vm\_wr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00311}00311     \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00312}00312 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a667f1ae91cbd2e9fc6a2952f1bb2b8e4}{add\_to\_txpkts\_vf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *, \textcolor{keyword}{struct} mbuf *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00313}00313     \textcolor{keywordtype}{int}, \textcolor{keywordtype}{bool} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00314}00314 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a464192533ba3c953e74222fe109d8ccd}{add\_to\_txpkts\_pf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *, \textcolor{keyword}{struct} mbuf *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00315}00315     \textcolor{keywordtype}{int}, \textcolor{keywordtype}{bool} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00316}00316 \textcolor{keyword}{static} u\_int \mbox{\hyperlink{t4__sge_8c_ac3906e06a046bcfaaf4f686ec070d07e}{write\_txpkts\_wr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00317}00317 \textcolor{keyword}{static} u\_int \mbox{\hyperlink{t4__sge_8c_a13ef435aefdbba7f9966dcb626d73e62}{write\_txpkts\_vm\_wr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00318}00318 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_ab66dd27e913633697554914689038fb4}{write\_gl\_to\_txd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *, \textcolor{keyword}{struct} mbuf *, caddr\_t *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00319}00319 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_aca5145708355fa01ae8c8eba424a8460}{copy\_to\_txd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *, caddr\_t, caddr\_t *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00320}00320 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a891527ea34b168d58d83f44f750ecc92}{ring\_eq\_db}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *, u\_int);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00321}00321 \textcolor{keyword}{static} \textcolor{keyword}{inline} uint16\_t \mbox{\hyperlink{t4__sge_8c_a573829292f5c253acee129251749445e}{read\_hw\_cidx}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00322}00322 \textcolor{keyword}{static} \textcolor{keyword}{inline} u\_int \mbox{\hyperlink{t4__sge_8c_a8343b84048ada723d32e1b732c03bd7f}{reclaimable\_tx\_desc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00323}00323 \textcolor{keyword}{static} \textcolor{keyword}{inline} u\_int \mbox{\hyperlink{t4__sge_8c_a93ac7052a1ab492658aa3144aa388a7d}{total\_available\_tx\_desc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00324}00324 \textcolor{keyword}{static} u\_int \mbox{\hyperlink{t4__sge_8c_a1986cd7e43663cda49915b423e8465b9}{reclaim\_tx\_descs}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *, u\_int);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00325}00325 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_a68f484f6b46eb063ab438fb0dca3a957}{tx\_reclaim}}(\textcolor{keywordtype}{void} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00326}00326 \textcolor{keyword}{static} \mbox{\hyperlink{osdep_8h_a575a6be7a3f079739f00e4ac7d75c785}{\_\_be64}} \mbox{\hyperlink{t4__sge_8c_ae2d2a717842a015c9ce4fe843ec3d02d}{get\_flit}}(\textcolor{keyword}{struct} sglist\_seg *, \textcolor{keywordtype}{int}, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00327}00327 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a1e6d94bd37b22818990e88e272280854}{handle\_sge\_egr\_update}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structrss__header}{rss\_header}} *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00328}00328     \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00329}00329 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_a4fa5fa565b4134cca45dc8d9efaccaa8}{handle\_fw\_msg}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structrss__header}{rss\_header}} *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00330}00330     \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00331}00331 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_aa4064d841308edcdf269547cc64342b4}{t4\_handle\_wrerr\_rpl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{const} \mbox{\hyperlink{osdep_8h_a575a6be7a3f079739f00e4ac7d75c785}{\_\_be64}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00332}00332 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_aacf36f8fa6191a39d3aef1d95a48faf9}{wrq\_tx\_drain}}(\textcolor{keywordtype}{void} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00333}00333 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{t4__sge_8c_af4d3457cf55d271db1060586cf481bc0}{drain\_wrq\_wr\_list}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__wrq}{sge\_wrq}} *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00334}00334 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00335}00335 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{t4__sge_8c_aa53499331be83ff7e7c29175d535a7be}{sysctl\_bufsizes}}(SYSCTL\_HANDLER\_ARGS);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00336}00336 \textcolor{preprocessor}{\#ifdef RATELIMIT}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00337}00337 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00338}00338 \textcolor{keyword}{static} \textcolor{keyword}{inline} u\_int txpkt\_eo\_len16(u\_int, u\_int, u\_int);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00339}00339 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00340}00340 \textcolor{keyword}{static} \textcolor{keywordtype}{int} ethofld\_fw4\_ack(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structrss__header}{rss\_header}} *,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00341}00341     \textcolor{keyword}{struct} mbuf *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00342}00342 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00343}00343 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00344}\mbox{\hyperlink{t4__sge_8c_ad4b3b38251e147b30d181582db846844}{00344}} \textcolor{keyword}{static} counter\_u64\_t \mbox{\hyperlink{t4__sge_8c_ad4b3b38251e147b30d181582db846844}{extfree\_refs}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00345}\mbox{\hyperlink{t4__sge_8c_ae618d620a0161831f318bf78a9d94edb}{00345}} \textcolor{keyword}{static} counter\_u64\_t \mbox{\hyperlink{t4__sge_8c_ae618d620a0161831f318bf78a9d94edb}{extfree\_rels}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00346}00346 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00347}\mbox{\hyperlink{t4__sge_8c_a1a0b19582a9d7ae1e31e91d8926bb7c3}{00347}} \mbox{\hyperlink{adapter_8h_a14cf871b516d77b7b449633d8659eb74}{an\_handler\_t}} \mbox{\hyperlink{t4__sge_8c_a1a0b19582a9d7ae1e31e91d8926bb7c3}{t4\_an\_handler}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00348}\mbox{\hyperlink{t4__sge_8c_abfacfa449879900077ea9b8c839bc3a6}{00348}} \mbox{\hyperlink{adapter_8h_a5338524ff3f32ed5f16317314826fa75}{fw\_msg\_handler\_t}} \mbox{\hyperlink{t4__sge_8c_abfacfa449879900077ea9b8c839bc3a6}{t4\_fw\_msg\_handler}}[\mbox{\hyperlink{t4__msg_8h_a1fb9092bcdeada2d206bdc74afbbe122ac1095535c7fe6c47e2105d7a230be3b5}{NUM\_FW6\_TYPES}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00349}\mbox{\hyperlink{t4__sge_8c_a7f46019356e6a0919425bc5ac2b32926}{00349}} \mbox{\hyperlink{adapter_8h_ae04643e7d67e87ca004e4bd02d8cc21c}{cpl\_handler\_t}} \mbox{\hyperlink{t4__sge_8c_a7f46019356e6a0919425bc5ac2b32926}{t4\_cpl\_handler}}[\mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebba3f92168ea27c9b80bc5db7c90e4e429b}{NUM\_CPL\_CMDS}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00350}\mbox{\hyperlink{t4__sge_8c_ae15f3d09960e724555e9ae63cfdf59a1}{00350}} \mbox{\hyperlink{adapter_8h_ae04643e7d67e87ca004e4bd02d8cc21c}{cpl\_handler\_t}} \mbox{\hyperlink{t4__sge_8c_ae15f3d09960e724555e9ae63cfdf59a1}{set\_tcb\_rpl\_handlers}}[\mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da9ca38145880c3607b46e399d41f89247}{NUM\_CPL\_COOKIES}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00351}\mbox{\hyperlink{t4__sge_8c_a786f07a61a219e6ad8ef47767512c8eb}{00351}} \mbox{\hyperlink{adapter_8h_ae04643e7d67e87ca004e4bd02d8cc21c}{cpl\_handler\_t}} \mbox{\hyperlink{t4__sge_8c_a786f07a61a219e6ad8ef47767512c8eb}{l2t\_write\_rpl\_handlers}}[\mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da9ca38145880c3607b46e399d41f89247}{NUM\_CPL\_COOKIES}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00352}\mbox{\hyperlink{t4__sge_8c_a360359b0d8a2d766a02cf58368d4b5f2}{00352}} \mbox{\hyperlink{adapter_8h_ae04643e7d67e87ca004e4bd02d8cc21c}{cpl\_handler\_t}} \mbox{\hyperlink{t4__sge_8c_a360359b0d8a2d766a02cf58368d4b5f2}{act\_open\_rpl\_handlers}}[\mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da9ca38145880c3607b46e399d41f89247}{NUM\_CPL\_COOKIES}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00353}\mbox{\hyperlink{t4__sge_8c_a114d2c9dcfce97ac43b8aa3eaf310dd3}{00353}} \mbox{\hyperlink{adapter_8h_ae04643e7d67e87ca004e4bd02d8cc21c}{cpl\_handler\_t}} \mbox{\hyperlink{t4__sge_8c_a114d2c9dcfce97ac43b8aa3eaf310dd3}{abort\_rpl\_rss\_handlers}}[\mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da9ca38145880c3607b46e399d41f89247}{NUM\_CPL\_COOKIES}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00354}\mbox{\hyperlink{t4__sge_8c_ac66be523bab437d71fc9c2fc54aa61d5}{00354}} \mbox{\hyperlink{adapter_8h_ae04643e7d67e87ca004e4bd02d8cc21c}{cpl\_handler\_t}} \mbox{\hyperlink{t4__sge_8c_ac66be523bab437d71fc9c2fc54aa61d5}{fw4\_ack\_handlers}}[\mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da9ca38145880c3607b46e399d41f89247}{NUM\_CPL\_COOKIES}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00355}00355 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00356}00356 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00357}\mbox{\hyperlink{adapter_8h_a2b86cd6db52e7fad3e99131ec6c684d7}{00357}} \mbox{\hyperlink{t4__sge_8c_a02e94ea9e1473ecfb91bbc287fc001ee}{t4\_register\_an\_handler}}(\mbox{\hyperlink{adapter_8h_a14cf871b516d77b7b449633d8659eb74}{an\_handler\_t}} h)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00358}00358 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00359}00359         uintptr\_t *loc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00360}00360 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00361}00361         MPASS(h == NULL || \mbox{\hyperlink{t4__sge_8c_a1a0b19582a9d7ae1e31e91d8926bb7c3}{t4\_an\_handler}} == NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00362}00362 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00363}00363         loc = (uintptr\_t *)\&\mbox{\hyperlink{t4__sge_8c_a1a0b19582a9d7ae1e31e91d8926bb7c3}{t4\_an\_handler}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00364}00364         atomic\_store\_rel\_ptr(loc, (uintptr\_t)h);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00365}00365 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00366}00366 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00367}00367 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00368}\mbox{\hyperlink{adapter_8h_af7390b805c1352b5b49df067b84c1370}{00368}} \mbox{\hyperlink{t4__sge_8c_a7cdda9768fc43525dba20977454cc5d4}{t4\_register\_fw\_msg\_handler}}(\textcolor{keywordtype}{int} type, \mbox{\hyperlink{adapter_8h_a5338524ff3f32ed5f16317314826fa75}{fw\_msg\_handler\_t}} h)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00369}00369 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00370}00370         uintptr\_t *loc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00371}00371 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00372}00372         MPASS(type < nitems(\mbox{\hyperlink{t4__sge_8c_abfacfa449879900077ea9b8c839bc3a6}{t4\_fw\_msg\_handler}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00373}00373         MPASS(h == NULL || \mbox{\hyperlink{t4__sge_8c_abfacfa449879900077ea9b8c839bc3a6}{t4\_fw\_msg\_handler}}[type] == NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00374}00374         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00375}00375 \textcolor{comment}{         * These are dispatched by the handler for FW\{4|6\}\_CPL\_MSG using the CPL}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00376}00376 \textcolor{comment}{         * handler dispatch table.  Reject any attempt to install a handler for}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00377}00377 \textcolor{comment}{         * this subtype.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00378}00378 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00379}00379         MPASS(type != \mbox{\hyperlink{t4__msg_8h_ac205be2172292384dd687b5471a87edda5179858e792eac7068fe2172d3b881c7}{FW\_TYPE\_RSSCPL}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00380}00380         MPASS(type != \mbox{\hyperlink{t4__msg_8h_a1fb9092bcdeada2d206bdc74afbbe122ab5e3ee5463eb1f6cd469f53a8b24968e}{FW6\_TYPE\_RSSCPL}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00381}00381 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00382}00382         loc = (uintptr\_t *)\&\mbox{\hyperlink{t4__sge_8c_abfacfa449879900077ea9b8c839bc3a6}{t4\_fw\_msg\_handler}}[type];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00383}00383         atomic\_store\_rel\_ptr(loc, (uintptr\_t)h);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00384}00384 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00385}00385 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00386}00386 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00387}\mbox{\hyperlink{adapter_8h_a541e6d2ac5f9df5061bc2b9d3cb171dd}{00387}} \mbox{\hyperlink{t4__sge_8c_af0402a05efbfabe9161d5a6ef7694fe7}{t4\_register\_cpl\_handler}}(\textcolor{keywordtype}{int} opcode, \mbox{\hyperlink{adapter_8h_ae04643e7d67e87ca004e4bd02d8cc21c}{cpl\_handler\_t}} h)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00388}00388 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00389}00389         uintptr\_t *loc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00390}00390 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00391}00391         MPASS(opcode < nitems(\mbox{\hyperlink{t4__sge_8c_a7f46019356e6a0919425bc5ac2b32926}{t4\_cpl\_handler}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00392}00392         MPASS(h == NULL || \mbox{\hyperlink{t4__sge_8c_a7f46019356e6a0919425bc5ac2b32926}{t4\_cpl\_handler}}[opcode] == NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00393}00393 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00394}00394         loc = (uintptr\_t *)\&\mbox{\hyperlink{t4__sge_8c_a7f46019356e6a0919425bc5ac2b32926}{t4\_cpl\_handler}}[opcode];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00395}00395         atomic\_store\_rel\_ptr(loc, (uintptr\_t)h);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00396}00396 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00397}00397 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00398}00398 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00399}\mbox{\hyperlink{t4__sge_8c_a0ab6bcbf8e3d548e8a6f22b7d0173959}{00399}} \mbox{\hyperlink{t4__sge_8c_a0ab6bcbf8e3d548e8a6f22b7d0173959}{set\_tcb\_rpl\_handler}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structrss__header}{rss\_header}} *rss,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00400}00400     \textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00401}00401 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00402}00402         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__set__tcb__rpl}{cpl\_set\_tcb\_rpl}} *cpl = (\textcolor{keyword}{const} \textcolor{keywordtype}{void} *)(rss + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00403}00403         u\_int tid;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00404}00404         \textcolor{keywordtype}{int} \mbox{\hyperlink{structcpl__set__tcb__rpl_af0da92f74643a9261cde04c30c941baf}{cookie}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00405}00405 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00406}00406         MPASS(m == NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00407}00407 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00408}00408         tid = \mbox{\hyperlink{t4__msg_8h_afa9d71c7ffccf100cc7b6696bbac5aa3}{GET\_TID}}(cpl);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00409}00409         \textcolor{keywordflow}{if} (\mbox{\hyperlink{common_8h_aba01cf8727dbc45628668b5748ef9275}{is\_hpftid}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a62e77da9c2ffc57fc1cc462a785f6fce}{adapter}}, tid) || \mbox{\hyperlink{common_8h_a2a9e1ed52a72927f9ab7a605f7bd52f6}{is\_ftid}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a62e77da9c2ffc57fc1cc462a785f6fce}{adapter}}, tid)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00410}00410                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00411}00411 \textcolor{comment}{                 * The return code for filter-\/write is put in the CPL cookie so}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00412}00412 \textcolor{comment}{                 * we have to rely on the hardware tid (is\_ftid) to determine}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00413}00413 \textcolor{comment}{                 * that this is a response to a filter.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00414}00414 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00415}00415                 \mbox{\hyperlink{structcpl__set__tcb__rpl_af0da92f74643a9261cde04c30c941baf}{cookie}} = \mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da2a2ac4ab2e043c06dad8540132750319}{CPL\_COOKIE\_FILTER}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00416}00416         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00417}00417                 \mbox{\hyperlink{structcpl__set__tcb__rpl_af0da92f74643a9261cde04c30c941baf}{cookie}} = \mbox{\hyperlink{t4__msg_8h_a54f879d67381660fd97796e84bd2bfab}{G\_COOKIE}}(cpl-\/>\mbox{\hyperlink{structcpl__set__tcb__rpl_af0da92f74643a9261cde04c30c941baf}{cookie}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00418}00418         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00419}00419         MPASS(\mbox{\hyperlink{structcpl__set__tcb__rpl_af0da92f74643a9261cde04c30c941baf}{cookie}} > \mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da5c1dff7fbc87de5170dd6b999faeb685}{CPL\_COOKIE\_RESERVED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00420}00420         MPASS(\mbox{\hyperlink{structcpl__set__tcb__rpl_af0da92f74643a9261cde04c30c941baf}{cookie}} < nitems(\mbox{\hyperlink{t4__sge_8c_ae15f3d09960e724555e9ae63cfdf59a1}{set\_tcb\_rpl\_handlers}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00421}00421 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00422}00422         \textcolor{keywordflow}{return} (\mbox{\hyperlink{t4__sge_8c_ae15f3d09960e724555e9ae63cfdf59a1}{set\_tcb\_rpl\_handlers}}[\mbox{\hyperlink{structcpl__set__tcb__rpl_af0da92f74643a9261cde04c30c941baf}{cookie}}](\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, rss, m));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00423}00423 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00424}00424 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00425}00425 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00426}\mbox{\hyperlink{t4__sge_8c_ae18d41943f99732a8afd332542293c34}{00426}} \mbox{\hyperlink{t4__sge_8c_ae18d41943f99732a8afd332542293c34}{l2t\_write\_rpl\_handler}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structrss__header}{rss\_header}} *rss,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00427}00427     \textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00428}00428 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00429}00429         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__l2t__write__rpl}{cpl\_l2t\_write\_rpl}} *rpl = (\textcolor{keyword}{const} \textcolor{keywordtype}{void} *)(rss + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00430}00430         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} cookie;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00431}00431 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00432}00432         MPASS(m == NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00433}00433 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00434}00434         cookie = \mbox{\hyperlink{t4__msg_8h_afa9d71c7ffccf100cc7b6696bbac5aa3}{GET\_TID}}(rpl) \& \mbox{\hyperlink{t4__l2t_8h_a12502ebc85db1430348fd9fc38646b03}{F\_SYNC\_WR}} ? \mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da6867dd99d7073973146baead7fa3997c}{CPL\_COOKIE\_TOM}} : \mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da2a2ac4ab2e043c06dad8540132750319}{CPL\_COOKIE\_FILTER}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00435}00435         \textcolor{keywordflow}{return} (\mbox{\hyperlink{t4__sge_8c_a786f07a61a219e6ad8ef47767512c8eb}{l2t\_write\_rpl\_handlers}}[cookie](\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, rss, m));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00436}00436 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00437}00437 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00438}00438 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00439}\mbox{\hyperlink{t4__sge_8c_af43389099fcdd8b2d767eaee96af6ae2}{00439}} \mbox{\hyperlink{t4__sge_8c_af43389099fcdd8b2d767eaee96af6ae2}{act\_open\_rpl\_handler}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structrss__header}{rss\_header}} *rss,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00440}00440     \textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00441}00441 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00442}00442         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__act__open__rpl}{cpl\_act\_open\_rpl}} *cpl = (\textcolor{keyword}{const} \textcolor{keywordtype}{void} *)(rss + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00443}00443         u\_int cookie = \mbox{\hyperlink{t4__msg_8h_a96e852c5bf5b5a5f00d7957dd204b77f}{G\_TID\_COOKIE}}(\mbox{\hyperlink{t4__msg_8h_af3bf4f17c0f84e744cceb027e0b39734}{G\_AOPEN\_ATID}}(be32toh(cpl-\/>\mbox{\hyperlink{structcpl__act__open__rpl_a0a7c96e432d64abc618348729d969a3a}{atid\_status}})));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00444}00444 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00445}00445         MPASS(m == NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00446}00446         MPASS(cookie != \mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da5c1dff7fbc87de5170dd6b999faeb685}{CPL\_COOKIE\_RESERVED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00447}00447 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00448}00448         \textcolor{keywordflow}{return} (\mbox{\hyperlink{t4__sge_8c_a360359b0d8a2d766a02cf58368d4b5f2}{act\_open\_rpl\_handlers}}[cookie](\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, rss, m));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00449}00449 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00450}00450 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00451}00451 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00452}\mbox{\hyperlink{t4__sge_8c_abcbc0d2f1fc1d2a498a4ce93dd0fce5a}{00452}} \mbox{\hyperlink{t4__sge_8c_abcbc0d2f1fc1d2a498a4ce93dd0fce5a}{abort\_rpl\_rss\_handler}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structrss__header}{rss\_header}} *rss,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00453}00453     \textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00454}00454 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00455}00455         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a62e77da9c2ffc57fc1cc462a785f6fce}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00456}00456         u\_int cookie;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00457}00457 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00458}00458         MPASS(m == NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00459}00459         \textcolor{keywordflow}{if} (\mbox{\hyperlink{common_8h_a499234c8e0edb2b078a9c0b8c6d9eae1}{is\_hashfilter}}(sc))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00460}00460                 cookie = \mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da207d93a645ec68836589eab4900fc32a}{CPL\_COOKIE\_HASHFILTER}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00461}00461         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00462}00462                 cookie = \mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da6867dd99d7073973146baead7fa3997c}{CPL\_COOKIE\_TOM}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00463}00463 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00464}00464         \textcolor{keywordflow}{return} (\mbox{\hyperlink{t4__sge_8c_a114d2c9dcfce97ac43b8aa3eaf310dd3}{abort\_rpl\_rss\_handlers}}[cookie](\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, rss, m));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00465}00465 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00466}00466 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00467}00467 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00468}\mbox{\hyperlink{t4__sge_8c_aa8ead79d6397e39da910d63449aa970b}{00468}} \mbox{\hyperlink{t4__sge_8c_aa8ead79d6397e39da910d63449aa970b}{fw4\_ack\_handler}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structrss__header}{rss\_header}} *rss, \textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00469}00469 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00470}00470         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a62e77da9c2ffc57fc1cc462a785f6fce}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00471}00471         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__fw4__ack}{cpl\_fw4\_ack}} *cpl = (\textcolor{keyword}{const} \textcolor{keywordtype}{void} *)(rss + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00472}00472         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} tid = \mbox{\hyperlink{t4__msg_8h_aa99487b2f861287f902036872616679e}{G\_CPL\_FW4\_ACK\_FLOWID}}(be32toh(\mbox{\hyperlink{t4__msg_8h_a81700cbe96e8b2bb960f800be2958ed1}{OPCODE\_TID}}(cpl)));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00473}00473         u\_int cookie;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00474}00474 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00475}00475         MPASS(m == NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00476}00476         \textcolor{keywordflow}{if} (\mbox{\hyperlink{common_8h_a7a8977845bbdb4cb7fb2bf76946789c5}{is\_etid}}(sc, tid))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00477}00477                 cookie = \mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da3d23749723448e317a7836a1ee278a17}{CPL\_COOKIE\_ETHOFLD}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00478}00478         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00479}00479                 cookie = \mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da6867dd99d7073973146baead7fa3997c}{CPL\_COOKIE\_TOM}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00480}00480 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00481}00481         \textcolor{keywordflow}{return} (\mbox{\hyperlink{t4__sge_8c_ac66be523bab437d71fc9c2fc54aa61d5}{fw4\_ack\_handlers}}[cookie](\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, rss, m));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00482}00482 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00483}00483 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00484}00484 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00485}\mbox{\hyperlink{t4__sge_8c_a82c3eb6cbd8276c698ffb50711e5c210}{00485}} \mbox{\hyperlink{t4__sge_8c_a82c3eb6cbd8276c698ffb50711e5c210}{t4\_init\_shared\_cpl\_handlers}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00486}00486 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00487}00487 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00488}00488         \mbox{\hyperlink{t4__sge_8c_af0402a05efbfabe9161d5a6ef7694fe7}{t4\_register\_cpl\_handler}}(\mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebbad8188a40633f01f00041aaee9ca7d889}{CPL\_SET\_TCB\_RPL}}, \mbox{\hyperlink{t4__sge_8c_a0ab6bcbf8e3d548e8a6f22b7d0173959}{set\_tcb\_rpl\_handler}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00489}00489         \mbox{\hyperlink{t4__sge_8c_af0402a05efbfabe9161d5a6ef7694fe7}{t4\_register\_cpl\_handler}}(\mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebba18eb2e188b1272221f9a93fbc993866e}{CPL\_L2T\_WRITE\_RPL}}, \mbox{\hyperlink{t4__sge_8c_ae18d41943f99732a8afd332542293c34}{l2t\_write\_rpl\_handler}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00490}00490         \mbox{\hyperlink{t4__sge_8c_af0402a05efbfabe9161d5a6ef7694fe7}{t4\_register\_cpl\_handler}}(\mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebba9e2b3178b13f2b8e35f1f5d93fc81bc4}{CPL\_ACT\_OPEN\_RPL}}, \mbox{\hyperlink{t4__sge_8c_af43389099fcdd8b2d767eaee96af6ae2}{act\_open\_rpl\_handler}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00491}00491         \mbox{\hyperlink{t4__sge_8c_af0402a05efbfabe9161d5a6ef7694fe7}{t4\_register\_cpl\_handler}}(\mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebbac72b8b1d52d4102c3dd86b927fde9955}{CPL\_ABORT\_RPL\_RSS}}, \mbox{\hyperlink{t4__sge_8c_abcbc0d2f1fc1d2a498a4ce93dd0fce5a}{abort\_rpl\_rss\_handler}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00492}00492         \mbox{\hyperlink{t4__sge_8c_af0402a05efbfabe9161d5a6ef7694fe7}{t4\_register\_cpl\_handler}}(\mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebba80b218929587e7f32b62739cf4307d7d}{CPL\_FW4\_ACK}}, \mbox{\hyperlink{t4__sge_8c_aa8ead79d6397e39da910d63449aa970b}{fw4\_ack\_handler}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00493}00493 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00494}00494 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00495}00495 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00496}\mbox{\hyperlink{adapter_8h_a772734f30a5e8705c29a92cb7c60b4a8}{00496}} \mbox{\hyperlink{t4__sge_8c_a0f4fcda23ce8ccf9fd7a1b9d4c221989}{t4\_register\_shared\_cpl\_handler}}(\textcolor{keywordtype}{int} opcode, \mbox{\hyperlink{adapter_8h_ae04643e7d67e87ca004e4bd02d8cc21c}{cpl\_handler\_t}} h, \textcolor{keywordtype}{int} cookie)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00497}00497 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00498}00498         uintptr\_t *loc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00499}00499 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00500}00500         MPASS(opcode < nitems(\mbox{\hyperlink{t4__sge_8c_a7f46019356e6a0919425bc5ac2b32926}{t4\_cpl\_handler}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00501}00501         MPASS(cookie > \mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da5c1dff7fbc87de5170dd6b999faeb685}{CPL\_COOKIE\_RESERVED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00502}00502         MPASS(cookie < \mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da9ca38145880c3607b46e399d41f89247}{NUM\_CPL\_COOKIES}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00503}00503         MPASS(\mbox{\hyperlink{t4__sge_8c_a7f46019356e6a0919425bc5ac2b32926}{t4\_cpl\_handler}}[opcode] != NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00504}00504 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00505}00505         \textcolor{keywordflow}{switch} (opcode) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00506}00506         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebbad8188a40633f01f00041aaee9ca7d889}{CPL\_SET\_TCB\_RPL}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00507}00507                 loc = (uintptr\_t *)\&\mbox{\hyperlink{t4__sge_8c_ae15f3d09960e724555e9ae63cfdf59a1}{set\_tcb\_rpl\_handlers}}[cookie];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00508}00508                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00509}00509         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebba18eb2e188b1272221f9a93fbc993866e}{CPL\_L2T\_WRITE\_RPL}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00510}00510                 loc = (uintptr\_t *)\&\mbox{\hyperlink{t4__sge_8c_a786f07a61a219e6ad8ef47767512c8eb}{l2t\_write\_rpl\_handlers}}[cookie];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00511}00511                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00512}00512         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebba9e2b3178b13f2b8e35f1f5d93fc81bc4}{CPL\_ACT\_OPEN\_RPL}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00513}00513                 loc = (uintptr\_t *)\&\mbox{\hyperlink{t4__sge_8c_a360359b0d8a2d766a02cf58368d4b5f2}{act\_open\_rpl\_handlers}}[cookie];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00514}00514                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00515}00515         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebbac72b8b1d52d4102c3dd86b927fde9955}{CPL\_ABORT\_RPL\_RSS}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00516}00516                 loc = (uintptr\_t *)\&\mbox{\hyperlink{t4__sge_8c_a114d2c9dcfce97ac43b8aa3eaf310dd3}{abort\_rpl\_rss\_handlers}}[cookie];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00517}00517                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00518}00518         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebba80b218929587e7f32b62739cf4307d7d}{CPL\_FW4\_ACK}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00519}00519                 loc = (uintptr\_t *)\&\mbox{\hyperlink{t4__sge_8c_ac66be523bab437d71fc9c2fc54aa61d5}{fw4\_ack\_handlers}}[cookie];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00520}00520                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00521}00521         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00522}00522                 MPASS(0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00523}00523                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00524}00524         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00525}00525         MPASS(h == NULL || *loc == (uintptr\_t)NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00526}00526         atomic\_store\_rel\_ptr(loc, (uintptr\_t)h);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00527}00527 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00528}00528 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00529}00529 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00530}00530 \textcolor{comment}{ * Called on MOD\_LOAD.  Validates and calculates the SGE tunables.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00531}00531 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00532}00532 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00533}\mbox{\hyperlink{adapter_8h_a23911092d8b3c1b9dd08756e508dd799}{00533}} \mbox{\hyperlink{t4__sge_8c_a23911092d8b3c1b9dd08756e508dd799}{t4\_sge\_modload}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00534}00534 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00535}00535 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00536}00536         \textcolor{keywordflow}{if} (fl\_pktshift < 0 || fl\_pktshift > 7) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00537}00537                 printf(\textcolor{stringliteral}{"{}Invalid hw.cxgbe.fl\_pktshift value (\%d),"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00538}00538                     \textcolor{stringliteral}{"{} using 0 instead.\(\backslash\)n"{}}, \mbox{\hyperlink{t4__sge_8c_aa6956f99e1e867c8f75587f440b91cc4}{fl\_pktshift}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00539}00539                 \mbox{\hyperlink{t4__sge_8c_aa6956f99e1e867c8f75587f440b91cc4}{fl\_pktshift}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00540}00540         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00541}00541 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00542}00542         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a4d13a14959e500ba1a81436734306011}{spg\_len}} != 64 \&\& \mbox{\hyperlink{t4__sge_8c_a4d13a14959e500ba1a81436734306011}{spg\_len}} != 128) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00543}00543                 \textcolor{keywordtype}{int} len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00544}00544 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00545}00545 \textcolor{preprocessor}{\#if defined(\_\_i386\_\_) || defined(\_\_amd64\_\_)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00546}00546                 len = cpu\_clflush\_line\_size > 64 ? 128 : 64;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00547}00547 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00548}00548                 len = 64;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00549}00549 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00550}00550                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a4d13a14959e500ba1a81436734306011}{spg\_len}} != -\/1) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00551}00551                         printf(\textcolor{stringliteral}{"{}Invalid hw.cxgbe.spg\_len value (\%d),"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00552}00552                             \textcolor{stringliteral}{"{} using \%d instead.\(\backslash\)n"{}}, \mbox{\hyperlink{t4__sge_8c_a4d13a14959e500ba1a81436734306011}{spg\_len}}, len);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00553}00553                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00554}00554                 \mbox{\hyperlink{t4__sge_8c_a4d13a14959e500ba1a81436734306011}{spg\_len}} = len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00555}00555         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00556}00556 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00557}00557         \textcolor{keywordflow}{if} (cong\_drop < -\/1 || cong\_drop > 1) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00558}00558                 printf(\textcolor{stringliteral}{"{}Invalid hw.cxgbe.cong\_drop value (\%d),"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00559}00559                     \textcolor{stringliteral}{"{} using 0 instead.\(\backslash\)n"{}}, \mbox{\hyperlink{t4__sge_8c_a16e95a619bd0b203622b81e9984bde07}{cong\_drop}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00560}00560                 \mbox{\hyperlink{t4__sge_8c_a16e95a619bd0b203622b81e9984bde07}{cong\_drop}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00561}00561         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00562}00562 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00563}00563         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a00444d0d2b96d25bc135956feea74288}{tscale}} != 1 \&\& (tscale < 3 || tscale > 17)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00564}00564                 printf(\textcolor{stringliteral}{"{}Invalid hw.cxgbe.tscale value (\%d),"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00565}00565                     \textcolor{stringliteral}{"{} using 1 instead.\(\backslash\)n"{}}, \mbox{\hyperlink{t4__sge_8c_a00444d0d2b96d25bc135956feea74288}{tscale}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00566}00566                 \mbox{\hyperlink{t4__sge_8c_a00444d0d2b96d25bc135956feea74288}{tscale}} = 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00567}00567         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00568}00568 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00569}00569         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_afc662bb0583ce4a9ef1867e1e9502fed}{largest\_rx\_cluster}} != MCLBYTES \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00570}00570 \#\textcolor{keywordflow}{if} MJUMPAGESIZE != MCLBYTES}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00571}00571             \mbox{\hyperlink{t4__sge_8c_afc662bb0583ce4a9ef1867e1e9502fed}{largest\_rx\_cluster}} != MJUMPAGESIZE \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00572}00572 \#endif}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00573}00573             \mbox{\hyperlink{t4__sge_8c_afc662bb0583ce4a9ef1867e1e9502fed}{largest\_rx\_cluster}} != MJUM9BYTES \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00574}00574             \mbox{\hyperlink{t4__sge_8c_afc662bb0583ce4a9ef1867e1e9502fed}{largest\_rx\_cluster}} != MJUM16BYTES) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00575}00575                 printf(\textcolor{stringliteral}{"{}Invalid hw.cxgbe.largest\_rx\_cluster value (\%d),"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00576}00576                     \textcolor{stringliteral}{"{} using \%d instead.\(\backslash\)n"{}}, \mbox{\hyperlink{t4__sge_8c_afc662bb0583ce4a9ef1867e1e9502fed}{largest\_rx\_cluster}}, MJUM16BYTES);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00577}00577                 \mbox{\hyperlink{t4__sge_8c_afc662bb0583ce4a9ef1867e1e9502fed}{largest\_rx\_cluster}} = MJUM16BYTES;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00578}00578         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00579}00579 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00580}00580         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_aab6212f98bd81400ad4a1e34acdf632b}{safest\_rx\_cluster}} != MCLBYTES \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00581}00581 \#\textcolor{keywordflow}{if} MJUMPAGESIZE != MCLBYTES}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00582}00582             \mbox{\hyperlink{t4__sge_8c_aab6212f98bd81400ad4a1e34acdf632b}{safest\_rx\_cluster}} != MJUMPAGESIZE \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00583}00583 \#endif}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00584}00584             \mbox{\hyperlink{t4__sge_8c_aab6212f98bd81400ad4a1e34acdf632b}{safest\_rx\_cluster}} != MJUM9BYTES \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00585}00585             \mbox{\hyperlink{t4__sge_8c_aab6212f98bd81400ad4a1e34acdf632b}{safest\_rx\_cluster}} != MJUM16BYTES) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00586}00586                 printf(\textcolor{stringliteral}{"{}Invalid hw.cxgbe.safest\_rx\_cluster value (\%d),"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00587}00587                     \textcolor{stringliteral}{"{} using \%d instead.\(\backslash\)n"{}}, \mbox{\hyperlink{t4__sge_8c_aab6212f98bd81400ad4a1e34acdf632b}{safest\_rx\_cluster}}, MJUMPAGESIZE);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00588}00588                 \mbox{\hyperlink{t4__sge_8c_aab6212f98bd81400ad4a1e34acdf632b}{safest\_rx\_cluster}} = MJUMPAGESIZE;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00589}00589         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00590}00590 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00591}00591         \mbox{\hyperlink{t4__sge_8c_ad4b3b38251e147b30d181582db846844}{extfree\_refs}} = counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00592}00592         \mbox{\hyperlink{t4__sge_8c_ae618d620a0161831f318bf78a9d94edb}{extfree\_rels}} = counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00593}00593         \mbox{\hyperlink{t4__sge_8c_a09a7a7db03ceddf0aec5404858b5274d}{pullups}} = counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00594}00594         \mbox{\hyperlink{t4__sge_8c_abc3e9b6ba5b5e166a75ad1078bda20c5}{defrags}} = counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00595}00595         counter\_u64\_zero(\mbox{\hyperlink{t4__sge_8c_ad4b3b38251e147b30d181582db846844}{extfree\_refs}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00596}00596         counter\_u64\_zero(\mbox{\hyperlink{t4__sge_8c_ae618d620a0161831f318bf78a9d94edb}{extfree\_rels}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00597}00597         counter\_u64\_zero(\mbox{\hyperlink{t4__sge_8c_a09a7a7db03ceddf0aec5404858b5274d}{pullups}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00598}00598         counter\_u64\_zero(\mbox{\hyperlink{t4__sge_8c_abc3e9b6ba5b5e166a75ad1078bda20c5}{defrags}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00599}00599 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00600}00600         \mbox{\hyperlink{t4__sge_8c_a82c3eb6cbd8276c698ffb50711e5c210}{t4\_init\_shared\_cpl\_handlers}}();}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00601}00601         \mbox{\hyperlink{t4__sge_8c_af0402a05efbfabe9161d5a6ef7694fe7}{t4\_register\_cpl\_handler}}(\mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebba790495d5ebdb3b980030e87e96816b5f}{CPL\_FW4\_MSG}}, \mbox{\hyperlink{t4__sge_8c_a4fa5fa565b4134cca45dc8d9efaccaa8}{handle\_fw\_msg}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00602}00602         \mbox{\hyperlink{t4__sge_8c_af0402a05efbfabe9161d5a6ef7694fe7}{t4\_register\_cpl\_handler}}(\mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebba7aa3b6e57acb11ef569e7b8559d8677f}{CPL\_FW6\_MSG}}, \mbox{\hyperlink{t4__sge_8c_a4fa5fa565b4134cca45dc8d9efaccaa8}{handle\_fw\_msg}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00603}00603         \mbox{\hyperlink{t4__sge_8c_af0402a05efbfabe9161d5a6ef7694fe7}{t4\_register\_cpl\_handler}}(\mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebbaacb735d66b52a0a40ff7956b1bbcfc6e}{CPL\_SGE\_EGR\_UPDATE}}, \mbox{\hyperlink{t4__sge_8c_a1e6d94bd37b22818990e88e272280854}{handle\_sge\_egr\_update}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00604}00604 \textcolor{preprocessor}{\#ifdef RATELIMIT}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00605}00605         \mbox{\hyperlink{t4__sge_8c_a0f4fcda23ce8ccf9fd7a1b9d4c221989}{t4\_register\_shared\_cpl\_handler}}(\mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebba80b218929587e7f32b62739cf4307d7d}{CPL\_FW4\_ACK}}, ethofld\_fw4\_ack,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00606}00606             \mbox{\hyperlink{adapter_8h_a0411cd49bb5b71852cecd93bcbf0ca2da3d23749723448e317a7836a1ee278a17}{CPL\_COOKIE\_ETHOFLD}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00607}00607 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00608}00608         \mbox{\hyperlink{t4__sge_8c_a7cdda9768fc43525dba20977454cc5d4}{t4\_register\_fw\_msg\_handler}}(\mbox{\hyperlink{t4__msg_8h_a1fb9092bcdeada2d206bdc74afbbe122a68ede510381ee95c966a35bfaaf4f693}{FW6\_TYPE\_CMD\_RPL}}, \mbox{\hyperlink{common_8h_a7cebd31615ea9625dbbbe5c93f580f1a}{t4\_handle\_fw\_rpl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00609}00609         \mbox{\hyperlink{t4__sge_8c_a7cdda9768fc43525dba20977454cc5d4}{t4\_register\_fw\_msg\_handler}}(\mbox{\hyperlink{t4__msg_8h_a1fb9092bcdeada2d206bdc74afbbe122ac3b29de2897eb6d6078ebdb22190f9b2}{FW6\_TYPE\_WRERR\_RPL}}, \mbox{\hyperlink{t4__sge_8c_aa4064d841308edcdf269547cc64342b4}{t4\_handle\_wrerr\_rpl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00610}00610 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00611}00611 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00612}00612 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00613}\mbox{\hyperlink{adapter_8h_a7bc09e5ad35daa245e8a13513ebf2c8f}{00613}} \mbox{\hyperlink{t4__sge_8c_a7bc09e5ad35daa245e8a13513ebf2c8f}{t4\_sge\_modunload}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00614}00614 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00615}00615 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00616}00616         counter\_u64\_free(\mbox{\hyperlink{t4__sge_8c_ad4b3b38251e147b30d181582db846844}{extfree\_refs}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00617}00617         counter\_u64\_free(\mbox{\hyperlink{t4__sge_8c_ae618d620a0161831f318bf78a9d94edb}{extfree\_rels}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00618}00618         counter\_u64\_free(\mbox{\hyperlink{t4__sge_8c_a09a7a7db03ceddf0aec5404858b5274d}{pullups}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00619}00619         counter\_u64\_free(\mbox{\hyperlink{t4__sge_8c_abc3e9b6ba5b5e166a75ad1078bda20c5}{defrags}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00620}00620 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00621}00621 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00622}00622 uint64\_t}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00623}\mbox{\hyperlink{adapter_8h_acfc22c027ca0e7d76fc3049b3d10f305}{00623}} \mbox{\hyperlink{t4__sge_8c_acfc22c027ca0e7d76fc3049b3d10f305}{t4\_sge\_extfree\_refs}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00624}00624 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00625}00625         uint64\_t refs, rels;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00626}00626 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00627}00627         rels = counter\_u64\_fetch(\mbox{\hyperlink{t4__sge_8c_ae618d620a0161831f318bf78a9d94edb}{extfree\_rels}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00628}00628         refs = counter\_u64\_fetch(\mbox{\hyperlink{t4__sge_8c_ad4b3b38251e147b30d181582db846844}{extfree\_refs}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00629}00629 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00630}00630         \textcolor{keywordflow}{return} (refs -\/ rels);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00631}00631 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00632}00632 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00633}00633 \textcolor{comment}{/* max 4096 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00634}\mbox{\hyperlink{t4__sge_8c_aeba81c0d0593091c4179cc8d81f32bb3}{00634}} \textcolor{preprocessor}{\#define MAX\_PACK\_BOUNDARY 512}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00635}00635 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00636}00636 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00637}\mbox{\hyperlink{t4__sge_8c_ae68ecfbaad26cbc609030fc7c58d39f8}{00637}} \mbox{\hyperlink{t4__sge_8c_ae68ecfbaad26cbc609030fc7c58d39f8}{setup\_pad\_and\_pack\_boundaries}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00638}00638 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00639}00639         uint32\_t v, m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00640}00640         \textcolor{keywordtype}{int} pad, pack, pad\_shift;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00641}00641 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00642}00642         pad\_shift = \mbox{\hyperlink{common_8h_a9760c128d8c5191e65faf12d0ceba0a1}{chip\_id}}(sc) > \mbox{\hyperlink{common_8h_a2153d86ca1fc4195c2c7fa4cfaf8a57e}{CHELSIO\_T5}} ? \mbox{\hyperlink{t4__regs__values_8h_afdf3c06c2d3f37b497486fd8495e36f2}{X\_T6\_INGPADBOUNDARY\_SHIFT}} :}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00643}00643             \mbox{\hyperlink{t4__regs__values_8h_a721731c9371b79507345cdd55e1faccb}{X\_INGPADBOUNDARY\_SHIFT}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00644}00644         pad = \mbox{\hyperlink{t4__sge_8c_ab4e2791bbea61f64ac9d9d20708712fd}{fl\_pad}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00645}00645         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ab4e2791bbea61f64ac9d9d20708712fd}{fl\_pad}} < (1 << pad\_shift) ||}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00646}00646             \mbox{\hyperlink{t4__sge_8c_ab4e2791bbea61f64ac9d9d20708712fd}{fl\_pad}} > (1 << (pad\_shift + \mbox{\hyperlink{t4__regs_8h_abaafa33fce2a623dcd59e281db1f4b92}{M\_INGPADBOUNDARY}})) ||}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00647}00647             !powerof2(\mbox{\hyperlink{t4__sge_8c_ab4e2791bbea61f64ac9d9d20708712fd}{fl\_pad}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00648}00648                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00649}00649 \textcolor{comment}{                 * If there is any chance that we might use buffer packing and}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00650}00650 \textcolor{comment}{                 * the chip is a T4, then pick 64 as the pad/pack boundary.  Set}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00651}00651 \textcolor{comment}{                 * it to the minimum allowed in all other cases.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00652}00652 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00653}00653                 pad = \mbox{\hyperlink{common_8h_aa9e773cf60cd663bef321462eba79990}{is\_t4}}(sc) \&\& \mbox{\hyperlink{t4__sge_8c_a4c90bb713d4d2847ce444a3c08edfc82}{buffer\_packing}} ? 64 : 1 << pad\_shift;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00654}00654 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00655}00655                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00656}00656 \textcolor{comment}{                 * For fl\_pad = 0 we'll still write a reasonable value to the}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00657}00657 \textcolor{comment}{                 * register but all the freelists will opt out of padding.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00658}00658 \textcolor{comment}{                 * We'll complain here only if the user tried to set it to a}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00659}00659 \textcolor{comment}{                 * value greater than 0 that was invalid.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00660}00660 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00661}00661                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ab4e2791bbea61f64ac9d9d20708712fd}{fl\_pad}} > 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00662}00662                         device\_printf(sc-\/>\mbox{\hyperlink{structadapter_aea408064601574166a737fafae5cd4a3}{dev}}, \textcolor{stringliteral}{"{}Invalid hw.cxgbe.fl\_pad value"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00663}00663                             \textcolor{stringliteral}{"{} (\%d), using \%d instead.\(\backslash\)n"{}}, \mbox{\hyperlink{t4__sge_8c_ab4e2791bbea61f64ac9d9d20708712fd}{fl\_pad}}, pad);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00664}00664                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00665}00665         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00666}00666         m = \mbox{\hyperlink{t4__regs_8h_a8c678ae181fad5d949b5132a4a096e2e}{V\_INGPADBOUNDARY}}(\mbox{\hyperlink{t4__regs_8h_abaafa33fce2a623dcd59e281db1f4b92}{M\_INGPADBOUNDARY}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00667}00667         v = \mbox{\hyperlink{t4__regs_8h_a8c678ae181fad5d949b5132a4a096e2e}{V\_INGPADBOUNDARY}}(\mbox{\hyperlink{osdep_8h_a4140ded4c4b979177ad04578553a3adf}{ilog2}}(pad) -\/ pad\_shift);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00668}00668         \mbox{\hyperlink{common_8h_a5517fdd598b8f3502bc16f1b9752da83}{t4\_set\_reg\_field}}(sc, \mbox{\hyperlink{t4__regs_8h_ae5a9362252609b590f4c601fd3ff0618}{A\_SGE\_CONTROL}}, m, v);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00669}00669 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00670}00670         \textcolor{keywordflow}{if} (\mbox{\hyperlink{common_8h_aa9e773cf60cd663bef321462eba79990}{is\_t4}}(sc)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00671}00671                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ad40108c5109461bd99b910fddbee5af3}{fl\_pack}} != -\/1 \&\& \mbox{\hyperlink{t4__sge_8c_ad40108c5109461bd99b910fddbee5af3}{fl\_pack}} != pad) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00672}00672                         \textcolor{comment}{/* Complain but carry on. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00673}00673                         device\_printf(sc-\/>\mbox{\hyperlink{structadapter_aea408064601574166a737fafae5cd4a3}{dev}}, \textcolor{stringliteral}{"{}hw.cxgbe.fl\_pack (\%d) ignored,"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00674}00674                             \textcolor{stringliteral}{"{} using \%d instead.\(\backslash\)n"{}}, \mbox{\hyperlink{t4__sge_8c_ad40108c5109461bd99b910fddbee5af3}{fl\_pack}}, pad);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00675}00675                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00676}00676                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00677}00677         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00678}00678 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00679}00679         pack = \mbox{\hyperlink{t4__sge_8c_ad40108c5109461bd99b910fddbee5af3}{fl\_pack}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00680}00680         \textcolor{keywordflow}{if} (fl\_pack < 16 || fl\_pack == 32 || fl\_pack > 4096 ||}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00681}00681             !powerof2(\mbox{\hyperlink{t4__sge_8c_ad40108c5109461bd99b910fddbee5af3}{fl\_pack}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00682}00682                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_a9285ad0586308adeab1fa8f4448c7be0}{pci}}.\mbox{\hyperlink{structpci__params_aa33cb6fb70eda57f14b30bee0d75db34}{mps}} > \mbox{\hyperlink{t4__sge_8c_aeba81c0d0593091c4179cc8d81f32bb3}{MAX\_PACK\_BOUNDARY}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00683}00683                         pack = \mbox{\hyperlink{t4__sge_8c_aeba81c0d0593091c4179cc8d81f32bb3}{MAX\_PACK\_BOUNDARY}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00684}00684                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00685}00685                         pack = max(sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_a9285ad0586308adeab1fa8f4448c7be0}{pci}}.\mbox{\hyperlink{structpci__params_aa33cb6fb70eda57f14b30bee0d75db34}{mps}}, CACHE\_LINE\_SIZE);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00686}00686                 MPASS(powerof2(pack));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00687}00687                 \textcolor{keywordflow}{if} (pack < 16)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00688}00688                         pack = 16;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00689}00689                 \textcolor{keywordflow}{if} (pack == 32)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00690}00690                         pack = 64;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00691}00691                 \textcolor{keywordflow}{if} (pack > 4096)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00692}00692                         pack = 4096;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00693}00693                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ad40108c5109461bd99b910fddbee5af3}{fl\_pack}} != -\/1) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00694}00694                         device\_printf(sc-\/>\mbox{\hyperlink{structadapter_aea408064601574166a737fafae5cd4a3}{dev}}, \textcolor{stringliteral}{"{}Invalid hw.cxgbe.fl\_pack value"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00695}00695                             \textcolor{stringliteral}{"{} (\%d), using \%d instead.\(\backslash\)n"{}}, \mbox{\hyperlink{t4__sge_8c_ad40108c5109461bd99b910fddbee5af3}{fl\_pack}}, pack);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00696}00696                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00697}00697         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00698}00698         m = \mbox{\hyperlink{t4__regs_8h_ae50009392eb3ae9c984556782ccb6cd9}{V\_INGPACKBOUNDARY}}(\mbox{\hyperlink{t4__regs_8h_af75b4b9ebe0919f9282bac773e184df3}{M\_INGPACKBOUNDARY}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00699}00699         \textcolor{keywordflow}{if} (pack == 16)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00700}00700                 v = \mbox{\hyperlink{t4__regs_8h_ae50009392eb3ae9c984556782ccb6cd9}{V\_INGPACKBOUNDARY}}(0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00701}00701         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00702}00702                 v = \mbox{\hyperlink{t4__regs_8h_ae50009392eb3ae9c984556782ccb6cd9}{V\_INGPACKBOUNDARY}}(\mbox{\hyperlink{osdep_8h_a4140ded4c4b979177ad04578553a3adf}{ilog2}}(pack) -\/ 5);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00703}00703 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00704}00704         MPASS(!\mbox{\hyperlink{common_8h_aa9e773cf60cd663bef321462eba79990}{is\_t4}}(sc)); \textcolor{comment}{/* T4 doesn't have SGE\_CONTROL2 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00705}00705         \mbox{\hyperlink{common_8h_a5517fdd598b8f3502bc16f1b9752da83}{t4\_set\_reg\_field}}(sc, \mbox{\hyperlink{t4__regs_8h_a36a0593e14c399a03f461b242611ffd8}{A\_SGE\_CONTROL2}}, m, v);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00706}00706 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00707}00707 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00708}00708 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00709}00709 \textcolor{comment}{ * adap-\/>params.vpd.cclk must be set up before this is called.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00710}00710 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00711}00711 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00712}\mbox{\hyperlink{adapter_8h_a35727fd5bd4c6d2b9ca0bec78e4d4441}{00712}} \mbox{\hyperlink{t4__sge_8c_a50b5700a01a44a04b0c1cf690b8a8891}{t4\_tweak\_chip\_settings}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00713}00713 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00714}00714         \textcolor{keywordtype}{int} i, reg;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00715}00715         uint32\_t v, m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00716}00716         \textcolor{keywordtype}{int} intr\_timer[\mbox{\hyperlink{t4__hw_8h_aabfcbcb5ac86a1edac4035264bc7d2b8ad38a10e8b80d5571059850cc194ac9f6}{SGE\_NTIMERS}}] = \{1, 5, 10, 50, 100, 200\};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00717}00717         \textcolor{keywordtype}{int} timer\_max = \mbox{\hyperlink{t4__regs_8h_a50a244421c0bef6eab4ec3f7c5ef1f19}{M\_TIMERVALUE0}} * 1000 / sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ad9fd0e8ef3f3cf16aca12b9f3c6e85d8}{vpd}}.\mbox{\hyperlink{structvpd__params_af43c0be8f444795f7911374044c5f34d}{cclk}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00718}00718         \textcolor{keywordtype}{int} intr\_pktcount[\mbox{\hyperlink{t4__hw_8h_aabfcbcb5ac86a1edac4035264bc7d2b8a602104f3c5daeb800c681cd58fced203}{SGE\_NCOUNTERS}}] = \{1, 8, 16, 32\}; \textcolor{comment}{/* 63 max */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00719}00719         uint16\_t indsz = min(\mbox{\hyperlink{t4__sge_8c_ab343f68afb69400300058b3a24de6de2}{RX\_COPY\_THRESHOLD}} -\/ 1, \mbox{\hyperlink{t4__regs_8h_ac186e70039502c0de28b7957f752f300}{M\_INDICATESIZE}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00720}00720         \textcolor{keyword}{static} \textcolor{keywordtype}{int} sw\_buf\_sizes[] = \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00721}00721                 MCLBYTES,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00722}00722 \textcolor{preprocessor}{\#if MJUMPAGESIZE != MCLBYTES}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00723}00723                 MJUMPAGESIZE,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00724}00724 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00725}00725                 MJUM9BYTES,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00726}00726                 MJUM16BYTES}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00727}00727         \};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00728}00728 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00729}00729         KASSERT(sc-\/>\mbox{\hyperlink{structadapter_a5b04a9c8ac519064f43255df133cfe84}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06ca964b26d6af6ab5617d325eb5066d04d0}{MASTER\_PF}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00730}00730             (\textcolor{stringliteral}{"{}\%s: trying to change chip settings when not master."{}}, \_\_func\_\_));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00731}00731 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00732}00732         m = \mbox{\hyperlink{t4__regs_8h_ae56b6b7978393c7080411389580d9b06}{V\_PKTSHIFT}}(\mbox{\hyperlink{t4__regs_8h_a3e04a60475c4230ef1cda9e71f3c0ed2}{M\_PKTSHIFT}}) | \mbox{\hyperlink{t4__regs_8h_afcf005a9112d7fd7d9b2cd1c78955c09}{F\_RXPKTCPLMODE}} | \mbox{\hyperlink{t4__regs_8h_ab9340f3f25c94cffe6e27207c3a705bc}{F\_EGRSTATUSPAGESIZE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00733}00733         v = \mbox{\hyperlink{t4__regs_8h_ae56b6b7978393c7080411389580d9b06}{V\_PKTSHIFT}}(\mbox{\hyperlink{t4__sge_8c_aa6956f99e1e867c8f75587f440b91cc4}{fl\_pktshift}}) | \mbox{\hyperlink{t4__regs_8h_afcf005a9112d7fd7d9b2cd1c78955c09}{F\_RXPKTCPLMODE}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00734}00734             \mbox{\hyperlink{t4__regs_8h_a4f19db3a1601c4bf97c3d6b1c6bb06b9}{V\_EGRSTATUSPAGESIZE}}(\mbox{\hyperlink{t4__sge_8c_a4d13a14959e500ba1a81436734306011}{spg\_len}} == 128);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00735}00735         \mbox{\hyperlink{common_8h_a5517fdd598b8f3502bc16f1b9752da83}{t4\_set\_reg\_field}}(sc, \mbox{\hyperlink{t4__regs_8h_ae5a9362252609b590f4c601fd3ff0618}{A\_SGE\_CONTROL}}, m, v);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00736}00736 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00737}00737         \mbox{\hyperlink{t4__sge_8c_ae68ecfbaad26cbc609030fc7c58d39f8}{setup\_pad\_and\_pack\_boundaries}}(sc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00738}00738 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00739}00739         v = \mbox{\hyperlink{t4__regs_8h_aad3c9da1101d4f8d764792a20c8ae09e}{V\_HOSTPAGESIZEPF0}}(PAGE\_SHIFT -\/ 10) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00740}00740             \mbox{\hyperlink{t4__regs_8h_a44d192c189d87bf86a95b144afbb641f}{V\_HOSTPAGESIZEPF1}}(PAGE\_SHIFT -\/ 10) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00741}00741             \mbox{\hyperlink{t4__regs_8h_af004d9bc3c9f02dbd69d2ca319365abc}{V\_HOSTPAGESIZEPF2}}(PAGE\_SHIFT -\/ 10) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00742}00742             \mbox{\hyperlink{t4__regs_8h_a27bdfc6a88011acf18a6a3eeae336574}{V\_HOSTPAGESIZEPF3}}(PAGE\_SHIFT -\/ 10) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00743}00743             \mbox{\hyperlink{t4__regs_8h_adaa3e8b033d2e9934b5148735b3fca2e}{V\_HOSTPAGESIZEPF4}}(PAGE\_SHIFT -\/ 10) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00744}00744             \mbox{\hyperlink{t4__regs_8h_a39ca53c62d569427e71c706f8487d1e7}{V\_HOSTPAGESIZEPF5}}(PAGE\_SHIFT -\/ 10) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00745}00745             \mbox{\hyperlink{t4__regs_8h_adaeddd16bd2cacbd2aa826563ae5aaa1}{V\_HOSTPAGESIZEPF6}}(PAGE\_SHIFT -\/ 10) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00746}00746             \mbox{\hyperlink{t4__regs_8h_ad520e6595a67658e391cbae2e208c5a2}{V\_HOSTPAGESIZEPF7}}(PAGE\_SHIFT -\/ 10);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00747}00747         \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, \mbox{\hyperlink{t4__regs_8h_aaa966a8f86ef7a2f38da721ba316f765}{A\_SGE\_HOST\_PAGE\_SIZE}}, v);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00748}00748 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00749}00749         \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, \mbox{\hyperlink{t4__regs_8h_a85076ab583f78f96b72ccc42fd72f725}{A\_SGE\_FL\_BUFFER\_SIZE0}}, 4096);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00750}00750         \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, \mbox{\hyperlink{t4__regs_8h_aeca867a7c2773530be908356a89526db}{A\_SGE\_FL\_BUFFER\_SIZE1}}, 65536);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00751}00751         reg = \mbox{\hyperlink{t4__regs_8h_a5fdb43ee3ab6fea7d63dd2e94bfb2b3c}{A\_SGE\_FL\_BUFFER\_SIZE2}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00752}00752         \textcolor{keywordflow}{for} (i = 0; i < nitems(sw\_buf\_sizes); i++) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00753}00753                 MPASS(reg <= \mbox{\hyperlink{t4__regs_8h_ad63eb04bb803dd5a5012c17c3061f95b}{A\_SGE\_FL\_BUFFER\_SIZE15}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00754}00754                 \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, reg, sw\_buf\_sizes[i]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00755}00755                 reg += 4;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00756}00756                 MPASS(reg <= \mbox{\hyperlink{t4__regs_8h_ad63eb04bb803dd5a5012c17c3061f95b}{A\_SGE\_FL\_BUFFER\_SIZE15}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00757}00757                 \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, reg, sw\_buf\_sizes[i] -\/ \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba29701844ec9189e5881c254e6ee546ce}{CL\_METADATA\_SIZE}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00758}00758                 reg += 4;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00759}00759         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00760}00760 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00761}00761         v = \mbox{\hyperlink{t4__regs_8h_a3169b4d4188db802c8c32becd3780003}{V\_THRESHOLD\_0}}(intr\_pktcount[0]) | \mbox{\hyperlink{t4__regs_8h_a4f08473998ca7247a0fe44e700bdd1da}{V\_THRESHOLD\_1}}(intr\_pktcount[1]) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00762}00762             \mbox{\hyperlink{t4__regs_8h_aa7d931c0e5f490642e0ddacd0a447f93}{V\_THRESHOLD\_2}}(intr\_pktcount[2]) | \mbox{\hyperlink{t4__regs_8h_a4d2b236c5068e670b22ed0e9ccf997ec}{V\_THRESHOLD\_3}}(intr\_pktcount[3]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00763}00763         \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, \mbox{\hyperlink{t4__regs_8h_a7057441afb6210a555a3b8b2973c9e86}{A\_SGE\_INGRESS\_RX\_THRESHOLD}}, v);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00764}00764 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00765}00765         KASSERT(intr\_timer[0] <= timer\_max,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00766}00766             (\textcolor{stringliteral}{"{}\%s: not a single usable timer (\%d, \%d)"{}}, \_\_func\_\_, intr\_timer[0],}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00767}00767             timer\_max));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00768}00768         \textcolor{keywordflow}{for} (i = 1; i < nitems(intr\_timer); i++) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00769}00769                 KASSERT(intr\_timer[i] >= intr\_timer[i -\/ 1],}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00770}00770                     (\textcolor{stringliteral}{"{}\%s: timers not listed in increasing order (\%d)"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00771}00771                     \_\_func\_\_, i));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00772}00772 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00773}00773                 \textcolor{keywordflow}{while} (intr\_timer[i] > timer\_max) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00774}00774                         \textcolor{keywordflow}{if} (i == nitems(intr\_timer) -\/ 1) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00775}00775                                 intr\_timer[i] = timer\_max;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00776}00776                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00777}00777                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00778}00778                         intr\_timer[i] += intr\_timer[i -\/ 1];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00779}00779                         intr\_timer[i] /= 2;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00780}00780                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00781}00781         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00782}00782 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00783}00783         v = \mbox{\hyperlink{t4__regs_8h_a087cd4faee80ae89e250d711cedfe07a}{V\_TIMERVALUE0}}(\mbox{\hyperlink{common_8h_ae1eb22709ba1f15c5b8795a824159f1a}{us\_to\_core\_ticks}}(sc, intr\_timer[0])) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00784}00784             \mbox{\hyperlink{t4__regs_8h_acf5923c43cbfd047b6c3d1ec01ef3b70}{V\_TIMERVALUE1}}(\mbox{\hyperlink{common_8h_ae1eb22709ba1f15c5b8795a824159f1a}{us\_to\_core\_ticks}}(sc, intr\_timer[1]));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00785}00785         \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, \mbox{\hyperlink{t4__regs_8h_a96d009bb3fd604f706b57669dd8f3af0}{A\_SGE\_TIMER\_VALUE\_0\_AND\_1}}, v);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00786}00786         v = \mbox{\hyperlink{t4__regs_8h_a15e5fc2d6f740e116b0f4bc55d49f529}{V\_TIMERVALUE2}}(\mbox{\hyperlink{common_8h_ae1eb22709ba1f15c5b8795a824159f1a}{us\_to\_core\_ticks}}(sc, intr\_timer[2])) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00787}00787             \mbox{\hyperlink{t4__regs_8h_a149d898648873259009c570e95353c31}{V\_TIMERVALUE3}}(\mbox{\hyperlink{common_8h_ae1eb22709ba1f15c5b8795a824159f1a}{us\_to\_core\_ticks}}(sc, intr\_timer[3]));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00788}00788         \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, \mbox{\hyperlink{t4__regs_8h_af90dea847b045a5a5ad333cbbeddfd55}{A\_SGE\_TIMER\_VALUE\_2\_AND\_3}}, v);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00789}00789         v = \mbox{\hyperlink{t4__regs_8h_a11866187f8c7b4de978c28a9860a3a41}{V\_TIMERVALUE4}}(\mbox{\hyperlink{common_8h_ae1eb22709ba1f15c5b8795a824159f1a}{us\_to\_core\_ticks}}(sc, intr\_timer[4])) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00790}00790             \mbox{\hyperlink{t4__regs_8h_a60ca6172a700530b3df2fa07b6365f16}{V\_TIMERVALUE5}}(\mbox{\hyperlink{common_8h_ae1eb22709ba1f15c5b8795a824159f1a}{us\_to\_core\_ticks}}(sc, intr\_timer[5]));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00791}00791         \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, \mbox{\hyperlink{t4__regs_8h_a7b8cbba3fa16b44a3d5cc6f6e41d18be}{A\_SGE\_TIMER\_VALUE\_4\_AND\_5}}, v);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00792}00792 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00793}00793         \textcolor{keywordflow}{if} (\mbox{\hyperlink{common_8h_a9760c128d8c5191e65faf12d0ceba0a1}{chip\_id}}(sc) >= \mbox{\hyperlink{common_8h_a9449117beafbf9a91e5b810920d48411}{CHELSIO\_T6}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00794}00794                 m = \mbox{\hyperlink{t4__regs_8h_a1eb4c150fa0f92dea5ace9e2bb1ad750}{V\_TSCALE}}(\mbox{\hyperlink{t4__regs_8h_a24f45e4ba189053641a9b64fe82778ff}{M\_TSCALE}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00795}00795                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a00444d0d2b96d25bc135956feea74288}{tscale}} == 1)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00796}00796                         v = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00797}00797                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00798}00798                         v = \mbox{\hyperlink{t4__regs_8h_a1eb4c150fa0f92dea5ace9e2bb1ad750}{V\_TSCALE}}(\mbox{\hyperlink{t4__sge_8c_a00444d0d2b96d25bc135956feea74288}{tscale}} -\/ 2);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00799}00799                 \mbox{\hyperlink{common_8h_a5517fdd598b8f3502bc16f1b9752da83}{t4\_set\_reg\_field}}(sc, \mbox{\hyperlink{t4__regs_8h_a1870e8dfdcb41c683d5b30e0fc857639}{A\_SGE\_ITP\_CONTROL}}, m, v);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00800}00800 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00801}00801                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structadapter_a79b754cee04ec5ad37013e45327fdb18}{debug\_flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06ca2dbcc90981fd059face2a95476eb0078}{DF\_DISABLE\_TCB\_CACHE}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00802}00802                         m = \mbox{\hyperlink{t4__regs_8h_a477e151a1d65ffdfef16226c1d8340fa}{V\_RDTHRESHOLD}}(\mbox{\hyperlink{t4__regs_8h_a1d08cd99378362260fb84393ef5f5b08}{M\_RDTHRESHOLD}}) | \mbox{\hyperlink{t4__regs_8h_af2139249f43f7e110e7935bea4feb3c0}{F\_WRTHRTHRESHEN}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00803}00803                             \mbox{\hyperlink{t4__regs_8h_a5bec6672abd28748c3e09371f1d0548e}{V\_WRTHRTHRESH}}(\mbox{\hyperlink{t4__regs_8h_a09cafa53ee3fa2ed5bac081ba8ed8b97}{M\_WRTHRTHRESH}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00804}00804                         \mbox{\hyperlink{common_8h_ad3dc49bbbedbe15ab037b2f90bcfc2f5}{t4\_tp\_pio\_read}}(sc, \&v, 1, \mbox{\hyperlink{t4__regs_8h_aa088ac3638df4aff81660e87eb4088fa}{A\_TP\_CMM\_CONFIG}}, 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00805}00805                         v \&= \string~m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00806}00806                         v |= \mbox{\hyperlink{t4__regs_8h_a477e151a1d65ffdfef16226c1d8340fa}{V\_RDTHRESHOLD}}(1) | \mbox{\hyperlink{t4__regs_8h_af2139249f43f7e110e7935bea4feb3c0}{F\_WRTHRTHRESHEN}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00807}00807                             \mbox{\hyperlink{t4__regs_8h_a5bec6672abd28748c3e09371f1d0548e}{V\_WRTHRTHRESH}}(16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00808}00808                         \mbox{\hyperlink{common_8h_aa8e10dd79b124ff8743e7540986d8def}{t4\_tp\_pio\_write}}(sc, \&v, 1, \mbox{\hyperlink{t4__regs_8h_aa088ac3638df4aff81660e87eb4088fa}{A\_TP\_CMM\_CONFIG}}, 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00809}00809                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00810}00810         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00811}00811 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00812}00812         \textcolor{comment}{/* 4K, 16K, 64K, 256K DDP "{}page sizes"{} for TDDP */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00813}00813         v = \mbox{\hyperlink{t4__regs_8h_a48fc222219f94cfeb8fa6261fffb289b}{V\_HPZ0}}(0) | \mbox{\hyperlink{t4__regs_8h_a40ab38b293f171104e30d51b1a281254}{V\_HPZ1}}(2) | \mbox{\hyperlink{t4__regs_8h_a0085dad67bee3d9201eebd2e274547cb}{V\_HPZ2}}(4) | \mbox{\hyperlink{t4__regs_8h_a4ee5f999695615313282162e131aacd1}{V\_HPZ3}}(6);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00814}00814         \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, \mbox{\hyperlink{t4__regs_8h_ac609872db07ad94cc330968bc6b88e82}{A\_ULP\_RX\_TDDP\_PSZ}}, v);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00815}00815 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00816}00816         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00817}00817 \textcolor{comment}{         * 4K, 8K, 16K, 64K DDP "{}page sizes"{} for iSCSI DDP.  These have been}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00818}00818 \textcolor{comment}{         * chosen with MAXPHYS = 128K in mind.  The largest DDP buffer that we}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00819}00819 \textcolor{comment}{         * may have to deal with is MAXPHYS + 1 page.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00820}00820 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00821}00821         v = \mbox{\hyperlink{t4__regs_8h_a48fc222219f94cfeb8fa6261fffb289b}{V\_HPZ0}}(0) | \mbox{\hyperlink{t4__regs_8h_a40ab38b293f171104e30d51b1a281254}{V\_HPZ1}}(1) | \mbox{\hyperlink{t4__regs_8h_a0085dad67bee3d9201eebd2e274547cb}{V\_HPZ2}}(2) | \mbox{\hyperlink{t4__regs_8h_a4ee5f999695615313282162e131aacd1}{V\_HPZ3}}(4);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00822}00822         \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, \mbox{\hyperlink{t4__regs_8h_aa1bae17e936da970cc148117cb81d7b5}{A\_ULP\_RX\_ISCSI\_PSZ}}, v);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00823}00823 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00824}00824         \textcolor{comment}{/* We use multiple DDP page sizes both in plain-\/TOE and ISCSI modes. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00825}00825         m = v = \mbox{\hyperlink{t4__regs_8h_a3b0d7f96b424e3c3694a9bf6cbe6e2b9}{F\_TDDPTAGTCB}} | \mbox{\hyperlink{t4__regs_8h_a935c7c5e7441201b3fad4f25859f654f}{F\_ISCSITAGTCB}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00826}00826         \mbox{\hyperlink{common_8h_a5517fdd598b8f3502bc16f1b9752da83}{t4\_set\_reg\_field}}(sc, \mbox{\hyperlink{t4__regs_8h_af3f64b775bc57d3d49a28444bcc63106}{A\_ULP\_RX\_CTL}}, m, v);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00827}00827 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00828}00828         m = \mbox{\hyperlink{t4__regs_8h_ab376301deabef7fc9845092ddfe65da3}{V\_INDICATESIZE}}(\mbox{\hyperlink{t4__regs_8h_ac186e70039502c0de28b7957f752f300}{M\_INDICATESIZE}}) | \mbox{\hyperlink{t4__regs_8h_afa5ee5a80cb409fa228b2fc4cd06c96c}{F\_REARMDDPOFFSET}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00829}00829             \mbox{\hyperlink{t4__regs_8h_a9885c6af547391d2a36644d33ed4f334}{F\_RESETDDPOFFSET}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00830}00830         v = \mbox{\hyperlink{t4__regs_8h_ab376301deabef7fc9845092ddfe65da3}{V\_INDICATESIZE}}(indsz) | \mbox{\hyperlink{t4__regs_8h_afa5ee5a80cb409fa228b2fc4cd06c96c}{F\_REARMDDPOFFSET}} | \mbox{\hyperlink{t4__regs_8h_a9885c6af547391d2a36644d33ed4f334}{F\_RESETDDPOFFSET}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00831}00831         \mbox{\hyperlink{common_8h_a5517fdd598b8f3502bc16f1b9752da83}{t4\_set\_reg\_field}}(sc, \mbox{\hyperlink{t4__regs_8h_a67f4ffaeb09c372a8e6b25e3a55960c6}{A\_TP\_PARA\_REG5}}, m, v);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00832}00832 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00833}00833 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00834}00834 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00835}00835 \textcolor{comment}{ * SGE wants the buffer to be at least 64B and then a multiple of 16.  Its}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00836}00836 \textcolor{comment}{ * address mut be 16B aligned.  If padding is in use the buffer's start and end}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00837}00837 \textcolor{comment}{ * need to be aligned to the pad boundary as well.  We'll just make sure that}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00838}00838 \textcolor{comment}{ * the size is a multiple of the pad boundary here, it is up to the buffer}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00839}00839 \textcolor{comment}{ * allocation code to make sure the start of the buffer is aligned.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00840}00840 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00841}00841 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00842}\mbox{\hyperlink{t4__sge_8c_ac42de204631fc4063089f65fb401e33b}{00842}} \mbox{\hyperlink{t4__sge_8c_ac42de204631fc4063089f65fb401e33b}{hwsz\_ok}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keywordtype}{int} hwsz)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00843}00843 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00844}00844         \textcolor{keywordtype}{int} mask = \mbox{\hyperlink{t4__sge_8c_ab4e2791bbea61f64ac9d9d20708712fd}{fl\_pad}} ? sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_a248cf3a2767e7a70707c9bdc65107c40}{pad\_boundary}} -\/ 1 : 16 -\/ 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00845}00845 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00846}00846         \textcolor{keywordflow}{return} (hwsz >= 64 \&\& (hwsz \& mask) == 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00847}00847 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00848}00848 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00849}00849 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00850}00850 \textcolor{comment}{ * Initialize the rx buffer sizes and figure out which zones the buffers will}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00851}00851 \textcolor{comment}{ * be allocated from.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00852}00852 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00853}00853 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00854}\mbox{\hyperlink{adapter_8h_aec5660ca9c0142d6f9b4e4ae29ecd987}{00854}} \mbox{\hyperlink{t4__sge_8c_ace7a6242af8cfe4890e4a0abaaae4ec1}{t4\_init\_rx\_buf\_info}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00855}00855 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00856}00856         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge}{sge}} *s = \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00857}00857         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__params}{sge\_params}} *sp = \&sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00858}00858         \textcolor{keywordtype}{int} i, j, n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00859}00859         \textcolor{keyword}{static} \textcolor{keywordtype}{int} sw\_buf\_sizes[] = \{   \textcolor{comment}{/* Sorted by size */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00860}00860                 MCLBYTES,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00861}00861 \textcolor{preprocessor}{\#if MJUMPAGESIZE != MCLBYTES}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00862}00862                 MJUMPAGESIZE,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00863}00863 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00864}00864                 MJUM9BYTES,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00865}00865                 MJUM16BYTES}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00866}00866         \};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00867}00867         \textcolor{keyword}{struct }\mbox{\hyperlink{structrx__buf__info}{rx\_buf\_info}} *rxb;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00868}00868 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00869}00869         s-\/>\mbox{\hyperlink{structsge_abc39b973ba8895d2876a8d3d20912e85}{safe\_zidx}} = -\/1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00870}00870         rxb = \&s-\/>\mbox{\hyperlink{structsge_a1d0a3ea264db143053eab8e647b3d3fc}{rx\_buf\_info}}[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00871}00871         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba3c96c0b2a920c024f7910a76f485ab99}{SW\_ZONE\_SIZES}}; i++, rxb++) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00872}00872                 rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}} = sw\_buf\_sizes[i];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00873}00873                 rxb-\/>\mbox{\hyperlink{structrx__buf__info_a1b42a285c183e57dcd2f589d5de929ae}{zone}} = m\_getzone(rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00874}00874                 rxb-\/>\mbox{\hyperlink{structrx__buf__info_aeb418917b76775d0ac0a2cfde8cb64da}{type}} = m\_gettype(rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00875}00875                 rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00876}00876                 rxb-\/>\mbox{\hyperlink{structrx__buf__info_aba1b3a28021975079ea300ef9a65f4fd}{hwidx1}} = -\/1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00877}00877                 rxb-\/>\mbox{\hyperlink{structrx__buf__info_a3ea12113c04fb9272c95dd0c9459f1a7}{hwidx2}} = -\/1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00878}00878                 \textcolor{keywordflow}{for} (j = 0; j < \mbox{\hyperlink{t4__hw_8h_aabfcbcb5ac86a1edac4035264bc7d2b8aa975d3f7f7f19811a68e7f504c3d2e29}{SGE\_FLBUF\_SIZES}}; j++) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00879}00879                         \textcolor{keywordtype}{int} hwsize = sp-\/>\mbox{\hyperlink{structsge__params_afb512a619d5cf5508f036dee75a815d5}{sge\_fl\_buffer\_size}}[j];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00880}00880 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00881}00881                         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{t4__sge_8c_ac42de204631fc4063089f65fb401e33b}{hwsz\_ok}}(sc, hwsize))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00882}00882                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00883}00883 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00884}00884                         \textcolor{comment}{/* hwidx for size1 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00885}00885                         \textcolor{keywordflow}{if} (rxb-\/>\mbox{\hyperlink{structrx__buf__info_aba1b3a28021975079ea300ef9a65f4fd}{hwidx1}} == -\/1 \&\& rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}} == hwsize)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00886}00886                                 rxb-\/>\mbox{\hyperlink{structrx__buf__info_aba1b3a28021975079ea300ef9a65f4fd}{hwidx1}} = j;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00887}00887 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00888}00888                         \textcolor{comment}{/* hwidx for size2 (buffer packing) */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00889}00889                         \textcolor{keywordflow}{if} (rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}} -\/ \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba29701844ec9189e5881c254e6ee546ce}{CL\_METADATA\_SIZE}} < hwsize)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00890}00890                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00891}00891                         n = rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}} -\/ hwsize -\/ \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba29701844ec9189e5881c254e6ee546ce}{CL\_METADATA\_SIZE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00892}00892                         \textcolor{keywordflow}{if} (n == 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00893}00893                                 rxb-\/>\mbox{\hyperlink{structrx__buf__info_a3ea12113c04fb9272c95dd0c9459f1a7}{hwidx2}} = j;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00894}00894                                 rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}} = hwsize;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00895}00895                                 \textcolor{keywordflow}{break};  \textcolor{comment}{/* stop looking */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00896}00896                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00897}00897                         \textcolor{keywordflow}{if} (rxb-\/>\mbox{\hyperlink{structrx__buf__info_a3ea12113c04fb9272c95dd0c9459f1a7}{hwidx2}} != -\/1) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00898}00898                                 \textcolor{keywordflow}{if} (n < sp-\/>sge\_fl\_buffer\_size[rxb-\/>\mbox{\hyperlink{structrx__buf__info_a3ea12113c04fb9272c95dd0c9459f1a7}{hwidx2}}] -\/}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00899}00899                                     hwsize -\/ \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba29701844ec9189e5881c254e6ee546ce}{CL\_METADATA\_SIZE}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00900}00900                                         rxb-\/>\mbox{\hyperlink{structrx__buf__info_a3ea12113c04fb9272c95dd0c9459f1a7}{hwidx2}} = j;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00901}00901                                         rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}} = hwsize;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00902}00902                                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00903}00903                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (n <= 2 * \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba29701844ec9189e5881c254e6ee546ce}{CL\_METADATA\_SIZE}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00904}00904                                 rxb-\/>\mbox{\hyperlink{structrx__buf__info_a3ea12113c04fb9272c95dd0c9459f1a7}{hwidx2}} = j;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00905}00905                                 rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}} = hwsize;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00906}00906                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00907}00907                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00908}00908                 \textcolor{keywordflow}{if} (rxb-\/>\mbox{\hyperlink{structrx__buf__info_a3ea12113c04fb9272c95dd0c9459f1a7}{hwidx2}} != -\/1)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00909}00909                         sc-\/>\mbox{\hyperlink{structadapter_a5b04a9c8ac519064f43255df133cfe84}{flags}} |= \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06cac2766ba7089a9a0722982c3ccc4a867f}{BUF\_PACKING\_OK}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00910}00910                 \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structsge_abc39b973ba8895d2876a8d3d20912e85}{safe\_zidx}} == -\/1 \&\& rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}} == \mbox{\hyperlink{t4__sge_8c_aab6212f98bd81400ad4a1e34acdf632b}{safest\_rx\_cluster}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00911}00911                         s-\/>\mbox{\hyperlink{structsge_abc39b973ba8895d2876a8d3d20912e85}{safe\_zidx}} = i;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00912}00912         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00913}00913 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00914}00914 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00915}00915 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00916}00916 \textcolor{comment}{ * Verify some basic SGE settings for the PF and VF driver, and other}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00917}00917 \textcolor{comment}{ * miscellaneous settings for the PF driver.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00918}00918 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00919}00919 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00920}\mbox{\hyperlink{adapter_8h_aecf13b3ade4c9dc2f9f15257fb7065a8}{00920}} \mbox{\hyperlink{t4__sge_8c_a7b83582697d14ca586093116ba70b1fb}{t4\_verify\_chip\_settings}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00921}00921 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00922}00922         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__params}{sge\_params}} *sp = \&sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00923}00923         uint32\_t m, v, \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00924}00924         \textcolor{keywordtype}{int} rc = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00925}00925         \textcolor{keyword}{const} uint16\_t indsz = min(\mbox{\hyperlink{t4__sge_8c_ab343f68afb69400300058b3a24de6de2}{RX\_COPY\_THRESHOLD}} -\/ 1, \mbox{\hyperlink{t4__regs_8h_ac186e70039502c0de28b7957f752f300}{M\_INDICATESIZE}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00926}00926 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00927}00927         m = \mbox{\hyperlink{t4__regs_8h_afcf005a9112d7fd7d9b2cd1c78955c09}{F\_RXPKTCPLMODE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00928}00928         v = \mbox{\hyperlink{t4__regs_8h_afcf005a9112d7fd7d9b2cd1c78955c09}{F\_RXPKTCPLMODE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00929}00929         \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}} = sp-\/>\mbox{\hyperlink{structsge__params_a6222dd1f3a9c9ac263a3c55d8641b248}{sge\_control}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00930}00930         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}} \& m) != v) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00931}00931                 device\_printf(sc-\/>\mbox{\hyperlink{structadapter_aea408064601574166a737fafae5cd4a3}{dev}}, \textcolor{stringliteral}{"{}invalid SGE\_CONTROL(0x\%x)\(\backslash\)n"{}}, \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00932}00932                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00933}00933         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00934}00934 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00935}00935         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00936}00936 \textcolor{comment}{         * If this changes then every single use of PAGE\_SHIFT in the driver}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00937}00937 \textcolor{comment}{         * needs to be carefully reviewed for PAGE\_SHIFT vs sp-\/>page\_shift.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00938}00938 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00939}00939         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structsge__params_a87e3fc7a5c226065d900c590f8fd28c7}{page\_shift}} != PAGE\_SHIFT) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00940}00940                 device\_printf(sc-\/>\mbox{\hyperlink{structadapter_aea408064601574166a737fafae5cd4a3}{dev}}, \textcolor{stringliteral}{"{}invalid SGE\_HOST\_PAGE\_SIZE(0x\%x)\(\backslash\)n"{}}, \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00941}00941                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00942}00942         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00943}00943 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00944}00944         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structadapter_a5b04a9c8ac519064f43255df133cfe84}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06cab2621d2fb00629ea783dc0442df2356d}{IS\_VF}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00945}00945                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00946}00946 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00947}00947         v = \mbox{\hyperlink{t4__regs_8h_a48fc222219f94cfeb8fa6261fffb289b}{V\_HPZ0}}(0) | \mbox{\hyperlink{t4__regs_8h_a40ab38b293f171104e30d51b1a281254}{V\_HPZ1}}(2) | \mbox{\hyperlink{t4__regs_8h_a0085dad67bee3d9201eebd2e274547cb}{V\_HPZ2}}(4) | \mbox{\hyperlink{t4__regs_8h_a4ee5f999695615313282162e131aacd1}{V\_HPZ3}}(6);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00948}00948         \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}} = \mbox{\hyperlink{adapter_8h_a22b5aec3a080e392e33e5f64f215e55d}{t4\_read\_reg}}(sc, \mbox{\hyperlink{t4__regs_8h_ac609872db07ad94cc330968bc6b88e82}{A\_ULP\_RX\_TDDP\_PSZ}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00949}00949         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}} != v) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00950}00950                 device\_printf(sc-\/>\mbox{\hyperlink{structadapter_aea408064601574166a737fafae5cd4a3}{dev}}, \textcolor{stringliteral}{"{}invalid ULP\_RX\_TDDP\_PSZ(0x\%x)\(\backslash\)n"{}}, \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00951}00951                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structadapter_aac2486574b6a560af2680ce113d241d6}{vres}}.\mbox{\hyperlink{structt4__virt__res_aed82f33e87526e3e86e54404ce999f61}{ddp}}.\mbox{\hyperlink{structt4__range_aae884a8c54e8813e8724761c575b150b}{size}} != 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00952}00952                         rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00953}00953         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00954}00954 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00955}00955         m = v = \mbox{\hyperlink{t4__regs_8h_a3b0d7f96b424e3c3694a9bf6cbe6e2b9}{F\_TDDPTAGTCB}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00956}00956         \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}} = \mbox{\hyperlink{adapter_8h_a22b5aec3a080e392e33e5f64f215e55d}{t4\_read\_reg}}(sc, \mbox{\hyperlink{t4__regs_8h_af3f64b775bc57d3d49a28444bcc63106}{A\_ULP\_RX\_CTL}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00957}00957         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}} \& m) != v) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00958}00958                 device\_printf(sc-\/>\mbox{\hyperlink{structadapter_aea408064601574166a737fafae5cd4a3}{dev}}, \textcolor{stringliteral}{"{}invalid ULP\_RX\_CTL(0x\%x)\(\backslash\)n"{}}, \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00959}00959                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structadapter_aac2486574b6a560af2680ce113d241d6}{vres}}.\mbox{\hyperlink{structt4__virt__res_aed82f33e87526e3e86e54404ce999f61}{ddp}}.\mbox{\hyperlink{structt4__range_aae884a8c54e8813e8724761c575b150b}{size}} != 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00960}00960                         rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00961}00961         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00962}00962 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00963}00963         m = \mbox{\hyperlink{t4__regs_8h_ab376301deabef7fc9845092ddfe65da3}{V\_INDICATESIZE}}(\mbox{\hyperlink{t4__regs_8h_ac186e70039502c0de28b7957f752f300}{M\_INDICATESIZE}}) | \mbox{\hyperlink{t4__regs_8h_afa5ee5a80cb409fa228b2fc4cd06c96c}{F\_REARMDDPOFFSET}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00964}00964             \mbox{\hyperlink{t4__regs_8h_a9885c6af547391d2a36644d33ed4f334}{F\_RESETDDPOFFSET}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00965}00965         v = \mbox{\hyperlink{t4__regs_8h_ab376301deabef7fc9845092ddfe65da3}{V\_INDICATESIZE}}(indsz) | \mbox{\hyperlink{t4__regs_8h_afa5ee5a80cb409fa228b2fc4cd06c96c}{F\_REARMDDPOFFSET}} | \mbox{\hyperlink{t4__regs_8h_a9885c6af547391d2a36644d33ed4f334}{F\_RESETDDPOFFSET}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00966}00966         \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}} = \mbox{\hyperlink{adapter_8h_a22b5aec3a080e392e33e5f64f215e55d}{t4\_read\_reg}}(sc, \mbox{\hyperlink{t4__regs_8h_a67f4ffaeb09c372a8e6b25e3a55960c6}{A\_TP\_PARA\_REG5}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00967}00967         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}} \& m) != v) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00968}00968                 device\_printf(sc-\/>\mbox{\hyperlink{structadapter_aea408064601574166a737fafae5cd4a3}{dev}}, \textcolor{stringliteral}{"{}invalid TP\_PARA\_REG5(0x\%x)\(\backslash\)n"{}}, \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00969}00969                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structadapter_aac2486574b6a560af2680ce113d241d6}{vres}}.\mbox{\hyperlink{structt4__virt__res_aed82f33e87526e3e86e54404ce999f61}{ddp}}.\mbox{\hyperlink{structt4__range_aae884a8c54e8813e8724761c575b150b}{size}} != 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00970}00970                         rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00971}00971         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00972}00972 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00973}00973         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00974}00974 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00975}00975 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00976}00976 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00977}\mbox{\hyperlink{adapter_8h_a653bbbf5040c98f4cc4a69eae3fed00c}{00977}} \mbox{\hyperlink{t4__sge_8c_a4b11634c7373b44b66b87e8d6e1fefcd}{t4\_create\_dma\_tag}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00978}00978 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00979}00979         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00980}00980 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00981}00981         rc = bus\_dma\_tag\_create(bus\_get\_dma\_tag(sc-\/>\mbox{\hyperlink{structadapter_aea408064601574166a737fafae5cd4a3}{dev}}), 1, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00982}00982             BUS\_SPACE\_MAXADDR, BUS\_SPACE\_MAXADDR, NULL, NULL, BUS\_SPACE\_MAXSIZE,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00983}00983             BUS\_SPACE\_UNRESTRICTED, BUS\_SPACE\_MAXSIZE, BUS\_DMA\_ALLOCNOW, NULL,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00984}00984             NULL, \&sc-\/>\mbox{\hyperlink{structadapter_a4e292a5076bc33db414d753ca30c8c05}{dmat}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00985}00985         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00986}00986                 device\_printf(sc-\/>\mbox{\hyperlink{structadapter_aea408064601574166a737fafae5cd4a3}{dev}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00987}00987                     \textcolor{stringliteral}{"{}failed to create main DMA tag: \%d\(\backslash\)n"{}}, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00988}00988         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00989}00989 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00990}00990         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00991}00991 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00992}00992 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00993}00993 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00994}\mbox{\hyperlink{adapter_8h_a15d8b99db0a21b9a727d2fdd212ec90e}{00994}} \mbox{\hyperlink{t4__sge_8c_a7d542929d4365efdf953e9e46e8058d6}{t4\_sge\_sysctls}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} sysctl\_ctx\_list *ctx,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00995}00995     \textcolor{keyword}{struct} sysctl\_oid\_list *children)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00996}00996 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00997}00997         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__params}{sge\_params}} *sp = \&sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00998}00998 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l00999}00999         SYSCTL\_ADD\_PROC(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}buffer\_sizes"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01000}01000             CTLTYPE\_STRING | CTLFLAG\_RD | CTLFLAG\_MPSAFE, sc, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01001}01001             \mbox{\hyperlink{t4__sge_8c_aa53499331be83ff7e7c29175d535a7be}{sysctl\_bufsizes}}, \textcolor{stringliteral}{"{}A"{}}, \textcolor{stringliteral}{"{}freelist buffer sizes"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01002}01002 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01003}01003         SYSCTL\_ADD\_INT(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}fl\_pktshift"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01004}01004             NULL, sp-\/>\mbox{\hyperlink{structsge__params_adea24551a1974e6786f29fa3cdc3dd9a}{fl\_pktshift}}, \textcolor{stringliteral}{"{}payload DMA offset in rx buffer (bytes)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01005}01005 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01006}01006         SYSCTL\_ADD\_INT(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}fl\_pad"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01007}01007             NULL, sp-\/>\mbox{\hyperlink{structsge__params_a248cf3a2767e7a70707c9bdc65107c40}{pad\_boundary}}, \textcolor{stringliteral}{"{}payload pad boundary (bytes)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01008}01008 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01009}01009         SYSCTL\_ADD\_INT(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}spg\_len"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01010}01010             NULL, sp-\/>\mbox{\hyperlink{structsge__params_ad88b567efaf5d38f538214804cc4dd35}{spg\_len}}, \textcolor{stringliteral}{"{}status page size (bytes)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01011}01011 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01012}01012         SYSCTL\_ADD\_INT(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}cong\_drop"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01013}01013             NULL, \mbox{\hyperlink{t4__sge_8c_a16e95a619bd0b203622b81e9984bde07}{cong\_drop}}, \textcolor{stringliteral}{"{}congestion drop setting"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01014}01014 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01015}01015         SYSCTL\_ADD\_INT(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}fl\_pack"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01016}01016             NULL, sp-\/>\mbox{\hyperlink{structsge__params_ac0bc396aa7308abe4ca88a596be0e862}{pack\_boundary}}, \textcolor{stringliteral}{"{}payload pack boundary (bytes)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01017}01017 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01018}01018 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01019}01019 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01020}\mbox{\hyperlink{adapter_8h_a974a68a2f0efadd7b2a8e6f5c4b4ecb5}{01020}} \mbox{\hyperlink{t4__sge_8c_ab9ab2a6eb94580923b01da0d99e245d4}{t4\_destroy\_dma\_tag}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01021}01021 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01022}01022         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structadapter_a4e292a5076bc33db414d753ca30c8c05}{dmat}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01023}01023                 bus\_dma\_tag\_destroy(sc-\/>\mbox{\hyperlink{structadapter_a4e292a5076bc33db414d753ca30c8c05}{dmat}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01024}01024 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01025}01025         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01026}01026 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01027}01027 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01028}01028 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01029}01029 \textcolor{comment}{ * Allocate and initialize the firmware event queue, control queues, and special}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01030}01030 \textcolor{comment}{ * purpose rx queues owned by the adapter.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01031}01031 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01032}01032 \textcolor{comment}{ * Returns errno on failure.  Resources allocated up to that point may still be}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01033}01033 \textcolor{comment}{ * allocated.  Caller is responsible for cleanup in case this function fails.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01034}01034 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01035}01035 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01036}\mbox{\hyperlink{adapter_8h_a406975cbe9cde5f0e080917048a17e80}{01036}} \mbox{\hyperlink{t4__sge_8c_ab05558243e947604e85155503b7b79c4}{t4\_setup\_adapter\_queues}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01037}01037 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01038}01038         \textcolor{keywordtype}{int} rc, i;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01039}01039 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01040}01040         \mbox{\hyperlink{adapter_8h_aedf6f02e8139639e792d47c4e40c57ed}{ADAPTER\_LOCK\_ASSERT\_NOTOWNED}}(sc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01041}01041 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01042}01042         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01043}01043 \textcolor{comment}{         * Firmware event queue}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01044}01044 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01045}01045         rc = \mbox{\hyperlink{t4__sge_8c_acb170e5c90249a8491cb90efe7e5059d}{alloc\_fwq}}(sc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01046}01046         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01047}01047                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01048}01048 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01049}01049         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01050}01050 \textcolor{comment}{         * That's all for the VF driver.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01051}01051 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01052}01052         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structadapter_a5b04a9c8ac519064f43255df133cfe84}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06cab2621d2fb00629ea783dc0442df2356d}{IS\_VF}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01053}01053                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01054}01054 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01055}01055         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01056}01056 \textcolor{comment}{         * XXX: General purpose rx queues, one per port.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01057}01057 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01058}01058 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01059}01059         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01060}01060 \textcolor{comment}{         * Control queues, one per port.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01061}01061 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01062}01062         \mbox{\hyperlink{common_8h_a9e2a6281346f58f4761a1a32b56b0400}{for\_each\_port}}(sc, i) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01063}01063                 rc = \mbox{\hyperlink{t4__sge_8c_a9ab19f6b7bd869f6e116b5b2589023f6}{alloc\_ctrlq}}(sc, i);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01064}01064                 \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01065}01065                         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01066}01066         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01067}01067 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01068}01068         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01069}01069 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01070}01070 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01071}01071 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01072}01072 \textcolor{comment}{ * Idempotent}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01073}01073 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01074}01074 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01075}\mbox{\hyperlink{adapter_8h_a83c32d48c020ba6a6b80e88e0f8880cb}{01075}} \mbox{\hyperlink{t4__sge_8c_af99ede8f6d8acc50de7392dc302c742e}{t4\_teardown\_adapter\_queues}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01076}01076 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01077}01077         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01078}01078 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01079}01079         \mbox{\hyperlink{adapter_8h_aedf6f02e8139639e792d47c4e40c57ed}{ADAPTER\_LOCK\_ASSERT\_NOTOWNED}}(sc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01080}01080 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01081}01081         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a9372a671bd3b97878454cf7489a7c6a6}{ctrlq}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01082}01082                 MPASS(!(sc-\/>\mbox{\hyperlink{structadapter_a5b04a9c8ac519064f43255df133cfe84}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06cab2621d2fb00629ea783dc0442df2356d}{IS\_VF}}));  \textcolor{comment}{/* VFs don't allocate ctrlq. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01083}01083                 \mbox{\hyperlink{common_8h_a9e2a6281346f58f4761a1a32b56b0400}{for\_each\_port}}(sc, i)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01084}01084                         \mbox{\hyperlink{t4__sge_8c_a9cf43bfa4e52a90a90b726540134239f}{free\_ctrlq}}(sc, i);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01085}01085         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01086}01086         \mbox{\hyperlink{t4__sge_8c_ad69e4ac1131709f75ac5b57335a2d5f8}{free\_fwq}}(sc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01087}01087 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01088}01088         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01089}01089 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01090}01090 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01091}01091 \textcolor{comment}{/* Maximum payload that could arrive with a single iq descriptor. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01092}01092 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01093}\mbox{\hyperlink{t4__sge_8c_ade2dd76db539dc08a367507474c40026}{01093}} \mbox{\hyperlink{t4__sge_8c_ade2dd76db539dc08a367507474c40026}{max\_rx\_payload}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} ifnet *\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}, \textcolor{keyword}{const} \textcolor{keywordtype}{bool} ofld)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01094}01094 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01095}01095         \textcolor{keywordtype}{int} maxp;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01096}01096 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01097}01097         \textcolor{comment}{/* large enough even when hw VLAN extraction is disabled */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01098}01098         maxp = sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_adea24551a1974e6786f29fa3cdc3dd9a}{fl\_pktshift}} + ETHER\_HDR\_LEN +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01099}01099             ETHER\_VLAN\_ENCAP\_LEN + \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_mtu;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01100}01100         \textcolor{keywordflow}{if} (ofld \&\& sc-\/>\mbox{\hyperlink{structadapter_a8c63c6a9705b648c27d64e8db9539eb5}{tt}}.\mbox{\hyperlink{structtom__tunables_a823d9ea23ded92676b6e3029c229a896}{tls}} \&\& sc-\/>\mbox{\hyperlink{structadapter_a0ca92eb8373da8f249f6adab0e42d949}{cryptocaps}} \& \mbox{\hyperlink{t4fw__interface_8h_a2c0d56988c2333efc00f93db82c20c40ad1e0526f6818b98b04d8524249cda6d9}{FW\_CAPS\_CONFIG\_TLSKEYS}} \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01101}01101             maxp < sc-\/>params.tp.max\_rx\_pdu)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01102}01102                 maxp = sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_a3f78b013ebbf4cb996fc60dc4723d907}{tp}}.\mbox{\hyperlink{structtp__params_a1d97e9cc798280c6ed62e60e73a11b2d}{max\_rx\_pdu}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01103}01103         \textcolor{keywordflow}{return} (maxp);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01104}01104 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01105}01105 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01106}01106 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01107}\mbox{\hyperlink{adapter_8h_a83ad5d07f91a28b2d9f27ea6de19fe2a}{01107}} \mbox{\hyperlink{t4__sge_8c_a65383eddeacd5f30cf325bee3fefcb2c}{t4\_setup\_vi\_queues}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01108}01108 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01109}01109         \textcolor{keywordtype}{int} rc = 0, i, intr\_idx;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01110}01110         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__rxq}{sge\_rxq}} *\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01111}01111         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01112}01112 \textcolor{preprocessor}{\#ifdef TCP\_OFFLOAD}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01113}01113         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__ofld__rxq}{sge\_ofld\_rxq}} *ofld\_rxq;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01114}01114 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01115}01115 \textcolor{preprocessor}{\#if defined(TCP\_OFFLOAD) || defined(RATELIMIT)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01116}01116         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__ofld__txq}{sge\_ofld\_txq}} *ofld\_txq;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01117}01117 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01118}01118 \textcolor{preprocessor}{\#ifdef DEV\_NETMAP}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01119}01119         \textcolor{keywordtype}{int} saved\_idx, \mbox{\hyperlink{adapter_8h_aeb7bf7c2eaa5139e603e513eaa58939f}{iqidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01120}01120         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__nm__rxq}{sge\_nm\_rxq}} *\mbox{\hyperlink{adapter_8h_a7365a937309e8ced75e9e92677d6eb61}{nm\_rxq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01121}01121         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__nm__txq}{sge\_nm\_txq}} *nm\_txq;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01122}01122 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01123}01123         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = vi-\/>\mbox{\hyperlink{structvi__info_a5ed3e511f61e7116aa53d733d7154130}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01124}01124         \textcolor{keyword}{struct }ifnet *\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}} = vi-\/>\mbox{\hyperlink{structvi__info_aa7924c610f62f17f5e57fdfc83e09ea0}{ifp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01125}01125         \textcolor{keywordtype}{int} maxp;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01126}01126 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01127}01127         \textcolor{comment}{/* Interrupt vector to start from (when using multiple vectors) */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01128}01128         intr\_idx = vi-\/>\mbox{\hyperlink{structvi__info_a906d8f238675c4c0c6bc3cf9acdc1f24}{first\_intr}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01129}01129 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01130}01130 \textcolor{preprocessor}{\#ifdef DEV\_NETMAP}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01131}01131         saved\_idx = intr\_idx;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01132}01132         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_capabilities \& IFCAP\_NETMAP) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01133}01133 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01134}01134                 \textcolor{comment}{/* netmap is supported with direct interrupts only. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01135}01135                 MPASS(!\mbox{\hyperlink{adapter_8h_a8eb8163ed191a6513060ae7a5d3e76ab}{forwarding\_intr\_to\_fwq}}(sc));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01136}01136                 MPASS(vi-\/>\mbox{\hyperlink{structvi__info_a906d8f238675c4c0c6bc3cf9acdc1f24}{first\_intr}} >= 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01137}01137 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01138}01138                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01139}01139 \textcolor{comment}{                 * We don't have buffers to back the netmap rx queues}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01140}01140 \textcolor{comment}{                 * right now so we create the queues in a way that}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01141}01141 \textcolor{comment}{                 * doesn't set off any congestion signal in the chip.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01142}01142 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01143}01143                 \mbox{\hyperlink{adapter_8h_aa8267297c4d2fae88c05bd6ef858b7f8}{for\_each\_nm\_rxq}}(vi, i, \mbox{\hyperlink{adapter_8h_a7365a937309e8ced75e9e92677d6eb61}{nm\_rxq}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01144}01144                         rc = alloc\_nm\_rxq(vi, \mbox{\hyperlink{adapter_8h_a7365a937309e8ced75e9e92677d6eb61}{nm\_rxq}}, intr\_idx, i);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01145}01145                         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01146}01146                                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01147}01147                         intr\_idx++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01148}01148                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01149}01149 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01150}01150                 \mbox{\hyperlink{adapter_8h_adef8015de48e97cb1902bdb011da12ba}{for\_each\_nm\_txq}}(vi, i, nm\_txq) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01151}01151                         \mbox{\hyperlink{adapter_8h_aeb7bf7c2eaa5139e603e513eaa58939f}{iqidx}} = vi-\/>\mbox{\hyperlink{structvi__info_a9a42c5cede58c8af43edfd4c46a8ff25}{first\_nm\_rxq}} + (i \% vi-\/>\mbox{\hyperlink{structvi__info_a646b12422dcf3db880a506221e685fe3}{nnmrxq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01152}01152                         rc = alloc\_nm\_txq(vi, nm\_txq, \mbox{\hyperlink{adapter_8h_aeb7bf7c2eaa5139e603e513eaa58939f}{iqidx}}, i);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01153}01153                         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01154}01154                                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01155}01155                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01156}01156         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01157}01157 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01158}01158         \textcolor{comment}{/* Normal rx queues and netmap rx queues share the same interrupts. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01159}01159         intr\_idx = saved\_idx;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01160}01160 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01161}01161 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01162}01162         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01163}01163 \textcolor{comment}{         * Allocate rx queues first because a default iqid is required when}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01164}01164 \textcolor{comment}{         * creating a tx queue.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01165}01165 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01166}01166         maxp = \mbox{\hyperlink{t4__sge_8c_ade2dd76db539dc08a367507474c40026}{max\_rx\_payload}}(sc, \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}, \textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01167}01167         \mbox{\hyperlink{adapter_8h_a891752fa1cfd4d9d4eb96b73b7f20757}{for\_each\_rxq}}(vi, i, \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01168}01168                 rc = \mbox{\hyperlink{t4__sge_8c_a280f219d1e6636734df6b7b9800339af}{alloc\_rxq}}(vi, \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}, i, intr\_idx, maxp);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01169}01169                 \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01170}01170                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01171}01171                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{adapter_8h_a8eb8163ed191a6513060ae7a5d3e76ab}{forwarding\_intr\_to\_fwq}}(sc))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01172}01172                         intr\_idx++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01173}01173         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01174}01174 \textcolor{preprocessor}{\#ifdef DEV\_NETMAP}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01175}01175         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_capabilities \& IFCAP\_NETMAP)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01176}01176                 intr\_idx = saved\_idx + max(vi-\/>\mbox{\hyperlink{structvi__info_aa155ce6b641082bdcd9d178803e30383}{nrxq}}, vi-\/>\mbox{\hyperlink{structvi__info_a646b12422dcf3db880a506221e685fe3}{nnmrxq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01177}01177 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01178}01178 \textcolor{preprocessor}{\#ifdef TCP\_OFFLOAD}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01179}01179         maxp = \mbox{\hyperlink{t4__sge_8c_ade2dd76db539dc08a367507474c40026}{max\_rx\_payload}}(sc, \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}, \textcolor{keyword}{true});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01180}01180         \mbox{\hyperlink{adapter_8h_aab6359de69631a278afe4fd1ddc9aa3d}{for\_each\_ofld\_rxq}}(vi, i, ofld\_rxq) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01181}01181                 rc = alloc\_ofld\_rxq(vi, ofld\_rxq, i, intr\_idx, maxp);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01182}01182                 \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01183}01183                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01184}01184                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{adapter_8h_a8eb8163ed191a6513060ae7a5d3e76ab}{forwarding\_intr\_to\_fwq}}(sc))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01185}01185                         intr\_idx++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01186}01186         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01187}01187 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01188}01188 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01189}01189         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01190}01190 \textcolor{comment}{         * Now the tx queues.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01191}01191 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01192}01192         \mbox{\hyperlink{adapter_8h_ad7d86505f7e3835d6b366a7eb7e16673}{for\_each\_txq}}(vi, i, txq) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01193}01193                 rc = \mbox{\hyperlink{t4__sge_8c_a0d41f700a943c229254d4bef06326eb7}{alloc\_txq}}(vi, txq, i);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01194}01194                 \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01195}01195                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01196}01196         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01197}01197 \textcolor{preprocessor}{\#if defined(TCP\_OFFLOAD) || defined(RATELIMIT)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01198}01198         \mbox{\hyperlink{adapter_8h_ac101e0f83c4e9792e60ae50cf71f11dc}{for\_each\_ofld\_txq}}(vi, i, ofld\_txq) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01199}01199                 rc = alloc\_ofld\_txq(vi, ofld\_txq, i);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01200}01200                 \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01201}01201                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01202}01202         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01203}01203 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01204}01204 done:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01205}01205         \textcolor{keywordflow}{if} (rc)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01206}01206                 \mbox{\hyperlink{t4__sge_8c_a961111782b9d82f9c1f4c15bed39c20e}{t4\_teardown\_vi\_queues}}(vi);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01207}01207 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01208}01208         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01209}01209 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01210}01210 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01211}01211 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01212}01212 \textcolor{comment}{ * Idempotent}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01213}01213 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01214}01214 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01215}\mbox{\hyperlink{adapter_8h_af9a7c41b146fa7f461cc66f497d4a70a}{01215}} \mbox{\hyperlink{t4__sge_8c_a961111782b9d82f9c1f4c15bed39c20e}{t4\_teardown\_vi\_queues}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01216}01216 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01217}01217         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01218}01218         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__rxq}{sge\_rxq}} *\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01219}01219         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01220}01220 \textcolor{preprocessor}{\#if defined(TCP\_OFFLOAD) || defined(RATELIMIT)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01221}01221         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__ofld__txq}{sge\_ofld\_txq}} *ofld\_txq;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01222}01222 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01223}01223 \textcolor{preprocessor}{\#ifdef TCP\_OFFLOAD}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01224}01224         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__ofld__rxq}{sge\_ofld\_rxq}} *ofld\_rxq;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01225}01225 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01226}01226 \textcolor{preprocessor}{\#ifdef DEV\_NETMAP}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01227}01227         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__nm__rxq}{sge\_nm\_rxq}} *\mbox{\hyperlink{adapter_8h_a7365a937309e8ced75e9e92677d6eb61}{nm\_rxq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01228}01228         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__nm__txq}{sge\_nm\_txq}} *nm\_txq;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01229}01229 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01230}01230 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01231}01231 \textcolor{preprocessor}{\#ifdef DEV\_NETMAP}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01232}01232         \textcolor{keywordflow}{if} (vi-\/>\mbox{\hyperlink{structvi__info_aa7924c610f62f17f5e57fdfc83e09ea0}{ifp}}-\/>if\_capabilities \& IFCAP\_NETMAP) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01233}01233                 \mbox{\hyperlink{adapter_8h_adef8015de48e97cb1902bdb011da12ba}{for\_each\_nm\_txq}}(vi, i, nm\_txq) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01234}01234                         free\_nm\_txq(vi, nm\_txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01235}01235                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01236}01236 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01237}01237                 \mbox{\hyperlink{adapter_8h_aa8267297c4d2fae88c05bd6ef858b7f8}{for\_each\_nm\_rxq}}(vi, i, \mbox{\hyperlink{adapter_8h_a7365a937309e8ced75e9e92677d6eb61}{nm\_rxq}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01238}01238                         free\_nm\_rxq(vi, \mbox{\hyperlink{adapter_8h_a7365a937309e8ced75e9e92677d6eb61}{nm\_rxq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01239}01239                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01240}01240         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01241}01241 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01242}01242 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01243}01243         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01244}01244 \textcolor{comment}{         * Take down all the tx queues first, as they reference the rx queues}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01245}01245 \textcolor{comment}{         * (for egress updates, etc.).}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01246}01246 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01247}01247 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01248}01248         \mbox{\hyperlink{adapter_8h_ad7d86505f7e3835d6b366a7eb7e16673}{for\_each\_txq}}(vi, i, txq) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01249}01249                 \mbox{\hyperlink{t4__sge_8c_aaa69bf67b08bd89ddff7470f2dbc85eb}{free\_txq}}(vi, txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01250}01250         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01251}01251 \textcolor{preprocessor}{\#if defined(TCP\_OFFLOAD) || defined(RATELIMIT)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01252}01252         \mbox{\hyperlink{adapter_8h_ac101e0f83c4e9792e60ae50cf71f11dc}{for\_each\_ofld\_txq}}(vi, i, ofld\_txq) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01253}01253                 free\_ofld\_txq(vi, ofld\_txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01254}01254         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01255}01255 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01256}01256 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01257}01257         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01258}01258 \textcolor{comment}{         * Then take down the rx queues.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01259}01259 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01260}01260 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01261}01261         \mbox{\hyperlink{adapter_8h_a891752fa1cfd4d9d4eb96b73b7f20757}{for\_each\_rxq}}(vi, i, \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01262}01262                 \mbox{\hyperlink{t4__sge_8c_a8313c565677706e732edaf02c788815c}{free\_rxq}}(vi, \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01263}01263         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01264}01264 \textcolor{preprocessor}{\#ifdef TCP\_OFFLOAD}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01265}01265         \mbox{\hyperlink{adapter_8h_aab6359de69631a278afe4fd1ddc9aa3d}{for\_each\_ofld\_rxq}}(vi, i, ofld\_rxq) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01266}01266                 free\_ofld\_rxq(vi, ofld\_rxq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01267}01267         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01268}01268 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01269}01269 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01270}01270         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01271}01271 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01272}01272 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01273}01273 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01274}01274 \textcolor{comment}{ * Interrupt handler when the driver is using only 1 interrupt.  This is a very}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01275}01275 \textcolor{comment}{ * unusual scenario.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01276}01276 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01277}01277 \textcolor{comment}{ * a) Deals with errors, if any.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01278}01278 \textcolor{comment}{ * b) Services firmware event queue, which is taking interrupts for all other}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01279}01279 \textcolor{comment}{ *    queues.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01280}01280 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01281}01281 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01282}\mbox{\hyperlink{adapter_8h_afc3e23e7c51a306d8643ba69919913dd}{01282}} \mbox{\hyperlink{t4__sge_8c_ad7977ad533c362de6a19e4f04953ece2}{t4\_intr\_all}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01283}01283 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01284}01284         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = arg;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01285}01285         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__iq}{sge\_iq}} *fwq = \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a652e3029436aa18d7c3543a986be602b}{fwq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01286}01286 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01287}01287         MPASS(sc-\/>\mbox{\hyperlink{structadapter_aa45b291bebe26a97a1814b9620637c59}{intr\_count}} == 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01288}01288 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01289}01289         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structadapter_a273ad21593d71533d7c2279f43d98ef1}{intr\_type}} == \mbox{\hyperlink{adapter_8h_adf764cbdea00d65edcd07bb9953ad2b7a4066440a6ea675f0adfac98623730679}{INTR\_INTX}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01290}01290                 \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, \mbox{\hyperlink{t4__regs_8h_a8d955e3d7458b98afa26ff67aa6e3f55}{MYPF\_REG}}(\mbox{\hyperlink{t4__regs_8h_a5d0df2b7c90b5b7460a52b81804746bf}{A\_PCIE\_PF\_CLI}}), 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01291}01291 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01292}01292         \mbox{\hyperlink{t4__sge_8c_ad69c13d4fd5e3f0d82beff6587a27672}{t4\_intr\_err}}(arg);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01293}01293         \mbox{\hyperlink{t4__sge_8c_a8437f37172308e12d5dc3ecd0d87dc40}{t4\_intr\_evt}}(fwq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01294}01294 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01295}01295 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01296}01296 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01297}01297 \textcolor{comment}{ * Interrupt handler for errors (installed directly when multiple interrupts are}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01298}01298 \textcolor{comment}{ * being used, or called by t4\_intr\_all).}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01299}01299 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01300}01300 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01301}\mbox{\hyperlink{adapter_8h_a786f8936b15a10d8b6cadad30c2337ad}{01301}} \mbox{\hyperlink{t4__sge_8c_ad69c13d4fd5e3f0d82beff6587a27672}{t4\_intr\_err}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01302}01302 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01303}01303         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = arg;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01304}01304         uint32\_t v;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01305}01305         \textcolor{keyword}{const} \textcolor{keywordtype}{bool} verbose = (sc-\/>\mbox{\hyperlink{structadapter_a79b754cee04ec5ad37013e45327fdb18}{debug\_flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06ca349a394df01ce86392192b0322ea3436}{DF\_VERBOSE\_SLOWINTR}}) != 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01306}01306 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01307}01307         \textcolor{keywordflow}{if} (atomic\_load\_int(\&sc-\/>\mbox{\hyperlink{structadapter_a7b022b18b5646c57ac4504fdde0554d6}{error\_flags}}) \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06ca9b4905ca41b8cb14dc898999aa5dc46a}{ADAP\_FATAL\_ERR}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01308}01308                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01309}01309 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01310}01310         v = \mbox{\hyperlink{adapter_8h_a22b5aec3a080e392e33e5f64f215e55d}{t4\_read\_reg}}(sc, \mbox{\hyperlink{t4__regs_8h_a8d955e3d7458b98afa26ff67aa6e3f55}{MYPF\_REG}}(\mbox{\hyperlink{t4__regs_8h_a372f33839fa64ad911c8855c076d223e}{A\_PL\_PF\_INT\_CAUSE}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01311}01311         \textcolor{keywordflow}{if} (v \& \mbox{\hyperlink{t4__regs_8h_a3cb7fb5f54088ef779af86532725359d}{F\_PFSW}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01312}01312                 sc-\/>\mbox{\hyperlink{structadapter_a5d1e98e3c76c92bdf149ae9e5b68a3ef}{swintr}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01313}01313                 \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, \mbox{\hyperlink{t4__regs_8h_a8d955e3d7458b98afa26ff67aa6e3f55}{MYPF\_REG}}(\mbox{\hyperlink{t4__regs_8h_a372f33839fa64ad911c8855c076d223e}{A\_PL\_PF\_INT\_CAUSE}}), v);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01314}01314         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01315}01315 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01316}01316         \textcolor{keywordflow}{if} (\mbox{\hyperlink{common_8h_a18064bb1ca9314bb2dd27e9fc1d279e7}{t4\_slow\_intr\_handler}}(sc, verbose))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01317}01317                 \mbox{\hyperlink{common_8h_a958aae7930e1f4ce4c507ba1ccaaab37}{t4\_fatal\_err}}(sc, \textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01318}01318 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01319}01319 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01320}01320 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01321}01321 \textcolor{comment}{ * Interrupt handler for iq-\/only queues.  The firmware event queue is the only}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01322}01322 \textcolor{comment}{ * such queue right now.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01323}01323 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01324}01324 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01325}\mbox{\hyperlink{adapter_8h_a0aa2167db68e43149fc4a731f9b0e6e8}{01325}} \mbox{\hyperlink{t4__sge_8c_a8437f37172308e12d5dc3ecd0d87dc40}{t4\_intr\_evt}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01326}01326 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01327}01327         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}} = arg;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01328}01328 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01329}01329         \textcolor{keywordflow}{if} (atomic\_cmpset\_int(\&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aca292788492977fd0c41fb35c3cdaa85}{state}}, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635acc3eda9696c6d327a48e281568e6c3e1}{IQS\_IDLE}}, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a9ddc469a2757152bbbd899aba7d54853}{IQS\_BUSY}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01330}01330                 \mbox{\hyperlink{t4__sge_8c_a7f4da6ef4228dc3219cb5ddcebad7e0b}{service\_iq}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01331}01331                 (void) atomic\_cmpset\_int(\&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aca292788492977fd0c41fb35c3cdaa85}{state}}, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a9ddc469a2757152bbbd899aba7d54853}{IQS\_BUSY}}, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635acc3eda9696c6d327a48e281568e6c3e1}{IQS\_IDLE}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01332}01332         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01333}01333 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01334}01334 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01335}01335 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01336}01336 \textcolor{comment}{ * Interrupt handler for iq+fl queues.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01337}01337 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01338}01338 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01339}\mbox{\hyperlink{adapter_8h_afdf41c24d801462ad4e2f01173422530}{01339}} \mbox{\hyperlink{t4__sge_8c_a4b37aabb568005d8410e9a2a528795cc}{t4\_intr}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01340}01340 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01341}01341         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}} = arg;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01342}01342 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01343}01343         \textcolor{keywordflow}{if} (atomic\_cmpset\_int(\&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aca292788492977fd0c41fb35c3cdaa85}{state}}, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635acc3eda9696c6d327a48e281568e6c3e1}{IQS\_IDLE}}, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a9ddc469a2757152bbbd899aba7d54853}{IQS\_BUSY}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01344}01344                 \mbox{\hyperlink{t4__sge_8c_a5eac4770aab679112771b8565f9ae4d6}{service\_iq\_fl}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01345}01345                 (void) atomic\_cmpset\_int(\&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aca292788492977fd0c41fb35c3cdaa85}{state}}, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a9ddc469a2757152bbbd899aba7d54853}{IQS\_BUSY}}, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635acc3eda9696c6d327a48e281568e6c3e1}{IQS\_IDLE}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01346}01346         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01347}01347 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01348}01348 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01349}01349 \textcolor{preprocessor}{\#ifdef DEV\_NETMAP}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01350}01350 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01351}01351 \textcolor{comment}{ * Interrupt handler for netmap rx queues.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01352}01352 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01353}01353 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01354}01354 t4\_nm\_intr(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01355}01355 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01356}01356         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__nm__rxq}{sge\_nm\_rxq}} *\mbox{\hyperlink{adapter_8h_a7365a937309e8ced75e9e92677d6eb61}{nm\_rxq}} = arg;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01357}01357 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01358}01358         \textcolor{keywordflow}{if} (atomic\_cmpset\_int(\&\mbox{\hyperlink{adapter_8h_a7365a937309e8ced75e9e92677d6eb61}{nm\_rxq}}-\/>nm\_state, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635aec0e185aeb16c67546f8a144094715fc}{NM\_ON}}, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635aac632dc4c473c7f0a3532cfc06d0dcd4}{NM\_BUSY}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01359}01359                 service\_nm\_rxq(\mbox{\hyperlink{adapter_8h_a7365a937309e8ced75e9e92677d6eb61}{nm\_rxq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01360}01360                 (void) atomic\_cmpset\_int(\&\mbox{\hyperlink{adapter_8h_a7365a937309e8ced75e9e92677d6eb61}{nm\_rxq}}-\/>nm\_state, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635aac632dc4c473c7f0a3532cfc06d0dcd4}{NM\_BUSY}}, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635aec0e185aeb16c67546f8a144094715fc}{NM\_ON}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01361}01361         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01362}01362 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01363}01363 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01364}01364 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01365}01365 \textcolor{comment}{ * Interrupt handler for vectors shared between NIC and netmap rx queues.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01366}01366 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01367}01367 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01368}01368 t4\_vi\_intr(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01369}01369 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01370}01370         \textcolor{keyword}{struct }irq *irq = arg;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01371}01371 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01372}01372         MPASS(irq-\/>nm\_rxq != NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01373}01373         t4\_nm\_intr(irq-\/>nm\_rxq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01374}01374 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01375}01375         MPASS(irq-\/>rxq != NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01376}01376         \mbox{\hyperlink{t4__sge_8c_a4b37aabb568005d8410e9a2a528795cc}{t4\_intr}}(irq-\/>rxq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01377}01377 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01378}01378 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01379}01379 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01380}01380 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01381}01381 \textcolor{comment}{ * Deals with interrupts on an iq-\/only (no freelist) queue.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01382}01382 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01383}01383 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01384}\mbox{\hyperlink{t4__sge_8c_a7f4da6ef4228dc3219cb5ddcebad7e0b}{01384}} \mbox{\hyperlink{t4__sge_8c_a7f4da6ef4228dc3219cb5ddcebad7e0b}{service\_iq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keywordtype}{int} budget)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01385}01385 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01386}01386         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__iq}{sge\_iq}} *q;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01387}01387         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a62e77da9c2ffc57fc1cc462a785f6fce}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01388}01388         \textcolor{keyword}{struct }\mbox{\hyperlink{structiq__desc}{iq\_desc}} *d = \&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aa0b80730bff81beab7577cb1d1fe8f3d}{desc}}[\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ade977c1efafcb5bb9a49a218b185e86a}{cidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01389}01389         \textcolor{keywordtype}{int} ndescs = 0, limit;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01390}01390         \textcolor{keywordtype}{int} rsp\_type;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01391}01391         uint32\_t lq;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01392}01392         \mbox{\hyperlink{adapter_8h_a6cd67596e0604ac1ab2b83a61edad73c}{STAILQ\_HEAD}}(, \mbox{\hyperlink{structsge__iq}{sge\_iq}}) iql = STAILQ\_HEAD\_INITIALIZER(iql);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01393}01393 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01394}01394         KASSERT(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aca292788492977fd0c41fb35c3cdaa85}{state}} == \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a9ddc469a2757152bbbd899aba7d54853}{IQS\_BUSY}}, (\textcolor{stringliteral}{"{}\%s: iq \%p not BUSY"{}}, \_\_func\_\_, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01395}01395         KASSERT((\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635af120aa1fd4e8641577c4ab287eec3615}{IQ\_HAS\_FL}}) == 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01396}01396             (\textcolor{stringliteral}{"{}\%s: called for iq \%p with fl (iq-\/>flags 0x\%x)"{}}, \_\_func\_\_, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01397}01397             \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01398}01398         MPASS((\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a8f16f182ffe0cbee4bd1629a78e63cf3}{IQ\_ADJ\_CREDIT}}) == 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01399}01399         MPASS((\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635aa23c24e7874c882f9e05ac0349f3cd14}{IQ\_LRO\_ENABLED}}) == 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01400}01400 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01401}01401         limit = budget ? budget : \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a764bf90982899051d957198d06e2f151}{qsize}} / 16;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01402}01402 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01403}01403         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01404}01404 \textcolor{comment}{         * We always come back and check the descriptor ring for new indirect}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01405}01405 \textcolor{comment}{         * interrupts and other responses after running a single handler.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01406}01406 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01407}01407         \textcolor{keywordflow}{for} (;;) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01408}01408                 \textcolor{keywordflow}{while} ((d-\/>\mbox{\hyperlink{structiq__desc_a8391143d41a654ec2f5d5c9e8f853cde}{rsp}}.\mbox{\hyperlink{structrsp__ctrl_a85d53d00be8fa4ce08238132bd519c34}{u}}.\mbox{\hyperlink{structrsp__ctrl_ad8f7ef22eb39724c407e586f666d2705}{type\_gen}} \& \mbox{\hyperlink{t4__hw_8h_adefd29ae6bd1bea521801e26ebf391ef}{F\_RSPD\_GEN}}) == \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aaaf44d8d3b8d8e9073d7e6ce3af59b6c}{gen}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01409}01409 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01410}01410                         rmb();}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01411}01411 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01412}01412                         rsp\_type = \mbox{\hyperlink{t4__hw_8h_aa83850ea980299936b814a718247304a}{G\_RSPD\_TYPE}}(d-\/>\mbox{\hyperlink{structiq__desc_a8391143d41a654ec2f5d5c9e8f853cde}{rsp}}.\mbox{\hyperlink{structrsp__ctrl_a85d53d00be8fa4ce08238132bd519c34}{u}}.\mbox{\hyperlink{structrsp__ctrl_ad8f7ef22eb39724c407e586f666d2705}{type\_gen}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01413}01413                         lq = be32toh(d-\/>\mbox{\hyperlink{structiq__desc_a8391143d41a654ec2f5d5c9e8f853cde}{rsp}}.\mbox{\hyperlink{structrsp__ctrl_ad5996a19014e090e879c41d588c6e0e2}{pldbuflen\_qid}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01414}01414 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01415}01415                         \textcolor{keywordflow}{switch} (rsp\_type) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01416}01416                         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4__regs__values_8h_a74b5507406a973b66d44646fc3e62c9f}{X\_RSPD\_TYPE\_FLBUF}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01417}01417                                 panic(\textcolor{stringliteral}{"{}\%s: data for an iq (\%p) with no freelist"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01418}01418                                     \_\_func\_\_, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01419}01419 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01420}01420                                 \textcolor{comment}{/* NOTREACHED */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01421}01421 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01422}01422                         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4__regs__values_8h_af938339dc494cd05bb2be36b779cf5d0}{X\_RSPD\_TYPE\_CPL}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01423}01423                                 KASSERT(d-\/>\mbox{\hyperlink{structiq__desc_a6d9d6c973ab2f14ccc1fcf216f2c6c04}{rss}}.\mbox{\hyperlink{structrss__header_ab18a0a11ee567f3fba4674b7d39044fb}{opcode}} < \mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebba3f92168ea27c9b80bc5db7c90e4e429b}{NUM\_CPL\_CMDS}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01424}01424                                     (\textcolor{stringliteral}{"{}\%s: bad opcode \%02x."{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01425}01425                                     d-\/>\mbox{\hyperlink{structiq__desc_a6d9d6c973ab2f14ccc1fcf216f2c6c04}{rss}}.\mbox{\hyperlink{structrss__header_ab18a0a11ee567f3fba4674b7d39044fb}{opcode}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01426}01426                                 \mbox{\hyperlink{t4__sge_8c_a7f46019356e6a0919425bc5ac2b32926}{t4\_cpl\_handler}}[d-\/>\mbox{\hyperlink{structiq__desc_a6d9d6c973ab2f14ccc1fcf216f2c6c04}{rss}}.\mbox{\hyperlink{structrss__header_ab18a0a11ee567f3fba4674b7d39044fb}{opcode}}](\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \&d-\/>\mbox{\hyperlink{structiq__desc_a6d9d6c973ab2f14ccc1fcf216f2c6c04}{rss}}, NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01427}01427                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01428}01428 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01429}01429                         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4__regs__values_8h_a3ceebaf7a7d5fae89b7bac860fce5181}{X\_RSPD\_TYPE\_INTR}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01430}01430                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01431}01431 \textcolor{comment}{                                 * There are 1K interrupt-\/capable queues (qids 0}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01432}01432 \textcolor{comment}{                                 * through 1023).  A response type indicating a}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01433}01433 \textcolor{comment}{                                 * forwarded interrupt with a qid >= 1K is an}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01434}01434 \textcolor{comment}{                                 * iWARP async notification.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01435}01435 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01436}01436                                 \textcolor{keywordflow}{if} (\_\_predict\_true(lq >= 1024)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01437}01437                                         \mbox{\hyperlink{t4__sge_8c_a1a0b19582a9d7ae1e31e91d8926bb7c3}{t4\_an\_handler}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \&d-\/>\mbox{\hyperlink{structiq__desc_a8391143d41a654ec2f5d5c9e8f853cde}{rsp}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01438}01438                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01439}01439                                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01440}01440 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01441}01441                                 q = sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_af2ead80a853bcf04f8a21aa918611b01}{iqmap}}[lq -\/ sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_ae5a74a0b473e29b59fd4c71dc81a9a3f}{iq\_start}} -\/}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01442}01442                                     sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a4d2f1809bd4f7a7d0528e2f23effb227}{iq\_base}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01443}01443                                 \textcolor{keywordflow}{if} (atomic\_cmpset\_int(\&q-\/>\mbox{\hyperlink{structsge__iq_aca292788492977fd0c41fb35c3cdaa85}{state}}, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635acc3eda9696c6d327a48e281568e6c3e1}{IQS\_IDLE}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01444}01444                                     \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a9ddc469a2757152bbbd899aba7d54853}{IQS\_BUSY}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01445}01445                                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a5eac4770aab679112771b8565f9ae4d6}{service\_iq\_fl}}(q, q-\/>\mbox{\hyperlink{structsge__iq_a764bf90982899051d957198d06e2f151}{qsize}} / 16) == 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01446}01446                                                 (void) atomic\_cmpset\_int(\&q-\/>\mbox{\hyperlink{structsge__iq_aca292788492977fd0c41fb35c3cdaa85}{state}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01447}01447                                                     \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a9ddc469a2757152bbbd899aba7d54853}{IQS\_BUSY}}, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635acc3eda9696c6d327a48e281568e6c3e1}{IQS\_IDLE}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01448}01448                                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01449}01449                                                 STAILQ\_INSERT\_TAIL(\&iql, q,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01450}01450                                                     link);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01451}01451                                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01452}01452                                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01453}01453                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01454}01454 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01455}01455                         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01456}01456                                 KASSERT(0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01457}01457                                     (\textcolor{stringliteral}{"{}\%s: illegal response type \%d on iq \%p"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01458}01458                                     \_\_func\_\_, rsp\_type, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01459}01459                                 log(LOG\_ERR,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01460}01460                                     \textcolor{stringliteral}{"{}\%s: illegal response type \%d on iq \%p"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01461}01461                                     device\_get\_nameunit(sc-\/>\mbox{\hyperlink{structadapter_aea408064601574166a737fafae5cd4a3}{dev}}), rsp\_type, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01462}01462                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01463}01463                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01464}01464 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01465}01465                         d++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01466}01466                         \textcolor{keywordflow}{if} (\_\_predict\_false(++\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ade977c1efafcb5bb9a49a218b185e86a}{cidx}} == \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ab9abd6046ab67bce82714431aadaf9e2}{sidx}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01467}01467                                 \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ade977c1efafcb5bb9a49a218b185e86a}{cidx}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01468}01468                                 \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aaaf44d8d3b8d8e9073d7e6ce3af59b6c}{gen}} \string^= \mbox{\hyperlink{t4__hw_8h_adefd29ae6bd1bea521801e26ebf391ef}{F\_RSPD\_GEN}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01469}01469                                 d = \&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aa0b80730bff81beab7577cb1d1fe8f3d}{desc}}[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01470}01470                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01471}01471                         \textcolor{keywordflow}{if} (\_\_predict\_false(++ndescs == limit)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01472}01472                                 \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, sc-\/>\mbox{\hyperlink{structadapter_aabd38017caa2cfc7d05a0ca1ea3088d6}{sge\_gts\_reg}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01473}01473                                     \mbox{\hyperlink{t4__regs_8h_a1df614613a82bd50ac8fd674631142cb}{V\_CIDXINC}}(ndescs) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01474}01474                                     \mbox{\hyperlink{t4__regs_8h_a82092f219f7205c46e71692dd8320f4d}{V\_INGRESSQID}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ad7db32f3e80fe7456ed7d811ee069dee}{cntxt\_id}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01475}01475                                     \mbox{\hyperlink{t4__regs_8h_ac1ca65e58a41f06a0f7204c54b1e7764}{V\_SEINTARM}}(\mbox{\hyperlink{t4__hw_8h_ad0d0106f734aaf74bfcdc39fe0c45209}{V\_QINTR\_TIMER\_IDX}}(\mbox{\hyperlink{t4__regs__values_8h_acc7a220c7c24995f21a090d2a8853792}{X\_TIMERREG\_UPDATE\_CIDX}})));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01476}01476                                 ndescs = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01477}01477 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01478}01478                                 \textcolor{keywordflow}{if} (budget) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01479}01479                                         \textcolor{keywordflow}{return} (EINPROGRESS);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01480}01480                                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01481}01481                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01482}01482                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01483}01483 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01484}01484                 \textcolor{keywordflow}{if} (STAILQ\_EMPTY(\&iql))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01485}01485                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01486}01486 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01487}01487                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01488}01488 \textcolor{comment}{                 * Process the head only, and send it to the back of the list if}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01489}01489 \textcolor{comment}{                 * it's still not done.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01490}01490 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01491}01491                 q = STAILQ\_FIRST(\&iql);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01492}01492                 STAILQ\_REMOVE\_HEAD(\&iql, link);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01493}01493                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a5eac4770aab679112771b8565f9ae4d6}{service\_iq\_fl}}(q, q-\/>\mbox{\hyperlink{structsge__iq_a764bf90982899051d957198d06e2f151}{qsize}} / 8) == 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01494}01494                         (void) atomic\_cmpset\_int(\&q-\/>\mbox{\hyperlink{structsge__iq_aca292788492977fd0c41fb35c3cdaa85}{state}}, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a9ddc469a2757152bbbd899aba7d54853}{IQS\_BUSY}}, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635acc3eda9696c6d327a48e281568e6c3e1}{IQS\_IDLE}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01495}01495                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01496}01496                         STAILQ\_INSERT\_TAIL(\&iql, q, link);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01497}01497         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01498}01498 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01499}01499         \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, sc-\/>\mbox{\hyperlink{structadapter_aabd38017caa2cfc7d05a0ca1ea3088d6}{sge\_gts\_reg}}, \mbox{\hyperlink{t4__regs_8h_a1df614613a82bd50ac8fd674631142cb}{V\_CIDXINC}}(ndescs) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01500}01500             \mbox{\hyperlink{t4__regs_8h_a82092f219f7205c46e71692dd8320f4d}{V\_INGRESSQID}}((\mbox{\hyperlink{osdep_8h_afaa62991928fb9fb18ff0db62a040aba}{u32}})\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ad7db32f3e80fe7456ed7d811ee069dee}{cntxt\_id}}) | \mbox{\hyperlink{t4__regs_8h_ac1ca65e58a41f06a0f7204c54b1e7764}{V\_SEINTARM}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a356b3e09ec2c3964ec6f8122cb42b88a}{intr\_params}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01501}01501 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01502}01502         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01503}01503 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01504}01504 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01505}01505 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01506}01506 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01507}01507 sort\_before\_lro(\textcolor{keyword}{struct} lro\_ctrl *\mbox{\hyperlink{adapter_8h_a42a4d2ca0dfc94f5010fc81500806269}{lro}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01508}01508 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01509}01509 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01510}01510         \textcolor{keywordflow}{return} (\mbox{\hyperlink{adapter_8h_a42a4d2ca0dfc94f5010fc81500806269}{lro}}-\/>lro\_mbuf\_max != 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01511}01511 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01512}01512 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01513}01513 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01514}01514 \textcolor{keyword}{static} \textcolor{keyword}{inline} uint64\_t}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01515}\mbox{\hyperlink{t4__sge_8c_adf4321bbb4cd6ff7a311016b2354c247}{01515}} \mbox{\hyperlink{t4__sge_8c_adf4321bbb4cd6ff7a311016b2354c247}{last\_flit\_to\_ns}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, uint64\_t lf)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01516}01516 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01517}01517         uint64\_t n = be64toh(lf) \& 0xfffffffffffffff;   \textcolor{comment}{/* 60b, not 64b. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01518}01518 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01519}01519         \textcolor{keywordflow}{if} (n > UINT64\_MAX / 1000000)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01520}01520                 \textcolor{keywordflow}{return} (n / sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ad9fd0e8ef3f3cf16aca12b9f3c6e85d8}{vpd}}.\mbox{\hyperlink{structvpd__params_af43c0be8f444795f7911374044c5f34d}{cclk}} * 1000000);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01521}01521         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01522}01522                 \textcolor{keywordflow}{return} (n * 1000000 / sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ad9fd0e8ef3f3cf16aca12b9f3c6e85d8}{vpd}}.\mbox{\hyperlink{structvpd__params_af43c0be8f444795f7911374044c5f34d}{cclk}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01523}01523 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01524}01524 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01525}01525 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01526}\mbox{\hyperlink{t4__sge_8c_a5906a819e0afea60c56fe9f448e740a1}{01526}} \mbox{\hyperlink{t4__sge_8c_a5906a819e0afea60c56fe9f448e740a1}{move\_to\_next\_rxbuf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01527}01527 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01528}01528 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01529}01529         \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01530}01530         \textcolor{keywordflow}{if} (\_\_predict\_false((++\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a141fb92c69ac2f791c7fcc19c28d3d73}{cidx}} \& 7) == 0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01531}01531                 uint16\_t \mbox{\hyperlink{adapter_8h_a3c88dd30dd9b547a4c35f3e1c593f6ec}{cidx}} = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a141fb92c69ac2f791c7fcc19c28d3d73}{cidx}} >> 3;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01532}01532 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01533}01533                 \textcolor{keywordflow}{if} (\_\_predict\_false(\mbox{\hyperlink{adapter_8h_a3c88dd30dd9b547a4c35f3e1c593f6ec}{cidx}} == \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0f572e6a95a867a2c848d725b6e30785}{sidx}}))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01534}01534                         \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a141fb92c69ac2f791c7fcc19c28d3d73}{cidx}} = \mbox{\hyperlink{adapter_8h_a3c88dd30dd9b547a4c35f3e1c593f6ec}{cidx}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01535}01535                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0d4baa235797170a157e790696ac257b}{hw\_cidx}} = \mbox{\hyperlink{adapter_8h_a3c88dd30dd9b547a4c35f3e1c593f6ec}{cidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01536}01536         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01537}01537 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01538}01538 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01539}01539 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01540}01540 \textcolor{comment}{ * Deals with interrupts on an iq+fl queue.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01541}01541 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01542}01542 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01543}\mbox{\hyperlink{t4__sge_8c_a5eac4770aab679112771b8565f9ae4d6}{01543}} \mbox{\hyperlink{t4__sge_8c_a5eac4770aab679112771b8565f9ae4d6}{service\_iq\_fl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keywordtype}{int} budget)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01544}01544 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01545}01545         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__rxq}{sge\_rxq}} *\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}} = \mbox{\hyperlink{adapter_8h_ab8f2919cbe9c04bbd579400fc6115eb9}{iq\_to\_rxq}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01546}01546         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01547}01547         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a62e77da9c2ffc57fc1cc462a785f6fce}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01548}01548         \textcolor{keyword}{struct }\mbox{\hyperlink{structiq__desc}{iq\_desc}} *d = \&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aa0b80730bff81beab7577cb1d1fe8f3d}{desc}}[\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ade977c1efafcb5bb9a49a218b185e86a}{cidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01549}01549         \textcolor{keywordtype}{int} ndescs, limit;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01550}01550         \textcolor{keywordtype}{int} rsp\_type, starved;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01551}01551         uint32\_t lq;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01552}01552         uint16\_t fl\_hw\_cidx;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01553}01553         \textcolor{keyword}{struct }mbuf *m0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01554}01554 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01555}01555         \textcolor{keyword}{const} \textcolor{keyword}{struct }timeval lro\_timeout = \{0, sc-\/>\mbox{\hyperlink{structadapter_a13f19f5f59a1d1b0fde9daf47d3b88eb}{lro\_timeout}}\};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01556}01556         \textcolor{keyword}{struct }lro\_ctrl *\mbox{\hyperlink{adapter_8h_a42a4d2ca0dfc94f5010fc81500806269}{lro}} = \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a5d3c964f9629fc3bd81dd1ff3b5e7332}{lro}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01557}01557 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01558}01558 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01559}01559         KASSERT(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aca292788492977fd0c41fb35c3cdaa85}{state}} == \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a9ddc469a2757152bbbd899aba7d54853}{IQS\_BUSY}}, (\textcolor{stringliteral}{"{}\%s: iq \%p not BUSY"{}}, \_\_func\_\_, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01560}01560         MPASS(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635af120aa1fd4e8641577c4ab287eec3615}{IQ\_HAS\_FL}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01561}01561 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01562}01562         ndescs = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01563}01563 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01564}01564         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a8f16f182ffe0cbee4bd1629a78e63cf3}{IQ\_ADJ\_CREDIT}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01565}01565                 MPASS(sort\_before\_lro(\mbox{\hyperlink{adapter_8h_a42a4d2ca0dfc94f5010fc81500806269}{lro}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01566}01566                 \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \&= \string~IQ\_ADJ\_CREDIT;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01567}01567                 \textcolor{keywordflow}{if} ((d-\/>\mbox{\hyperlink{structiq__desc_a8391143d41a654ec2f5d5c9e8f853cde}{rsp}}.\mbox{\hyperlink{structrsp__ctrl_a85d53d00be8fa4ce08238132bd519c34}{u}}.\mbox{\hyperlink{structrsp__ctrl_ad8f7ef22eb39724c407e586f666d2705}{type\_gen}} \& \mbox{\hyperlink{t4__hw_8h_adefd29ae6bd1bea521801e26ebf391ef}{F\_RSPD\_GEN}}) != \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aaaf44d8d3b8d8e9073d7e6ce3af59b6c}{gen}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01568}01568                         tcp\_lro\_flush\_all(\mbox{\hyperlink{adapter_8h_a42a4d2ca0dfc94f5010fc81500806269}{lro}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01569}01569                         \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, sc-\/>\mbox{\hyperlink{structadapter_aabd38017caa2cfc7d05a0ca1ea3088d6}{sge\_gts\_reg}}, \mbox{\hyperlink{t4__regs_8h_a1df614613a82bd50ac8fd674631142cb}{V\_CIDXINC}}(1) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01570}01570                             \mbox{\hyperlink{t4__regs_8h_a82092f219f7205c46e71692dd8320f4d}{V\_INGRESSQID}}((\mbox{\hyperlink{osdep_8h_afaa62991928fb9fb18ff0db62a040aba}{u32}})\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ad7db32f3e80fe7456ed7d811ee069dee}{cntxt\_id}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01571}01571                             \mbox{\hyperlink{t4__regs_8h_ac1ca65e58a41f06a0f7204c54b1e7764}{V\_SEINTARM}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a356b3e09ec2c3964ec6f8122cb42b88a}{intr\_params}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01572}01572                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01573}01573                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01574}01574                 ndescs = 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01575}01575         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01576}01576 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01577}01577         MPASS((\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a8f16f182ffe0cbee4bd1629a78e63cf3}{IQ\_ADJ\_CREDIT}}) == 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01578}01578 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01579}01579 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01580}01580         limit = budget ? budget : \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a764bf90982899051d957198d06e2f151}{qsize}} / 16;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01581}01581         \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}} = \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_acf98953f87dbe498d53bcf87c91db6a4}{fl}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01582}01582         fl\_hw\_cidx = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0d4baa235797170a157e790696ac257b}{hw\_cidx}};      \textcolor{comment}{/* stable snapshot */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01583}01583         \textcolor{keywordflow}{while} ((d-\/>\mbox{\hyperlink{structiq__desc_a8391143d41a654ec2f5d5c9e8f853cde}{rsp}}.\mbox{\hyperlink{structrsp__ctrl_a85d53d00be8fa4ce08238132bd519c34}{u}}.\mbox{\hyperlink{structrsp__ctrl_ad8f7ef22eb39724c407e586f666d2705}{type\_gen}} \& \mbox{\hyperlink{t4__hw_8h_adefd29ae6bd1bea521801e26ebf391ef}{F\_RSPD\_GEN}}) == \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aaaf44d8d3b8d8e9073d7e6ce3af59b6c}{gen}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01584}01584 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01585}01585                 rmb();}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01586}01586 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01587}01587                 m0 = NULL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01588}01588                 rsp\_type = \mbox{\hyperlink{t4__hw_8h_aa83850ea980299936b814a718247304a}{G\_RSPD\_TYPE}}(d-\/>\mbox{\hyperlink{structiq__desc_a8391143d41a654ec2f5d5c9e8f853cde}{rsp}}.\mbox{\hyperlink{structrsp__ctrl_a85d53d00be8fa4ce08238132bd519c34}{u}}.\mbox{\hyperlink{structrsp__ctrl_ad8f7ef22eb39724c407e586f666d2705}{type\_gen}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01589}01589                 lq = be32toh(d-\/>\mbox{\hyperlink{structiq__desc_a8391143d41a654ec2f5d5c9e8f853cde}{rsp}}.\mbox{\hyperlink{structrsp__ctrl_ad5996a19014e090e879c41d588c6e0e2}{pldbuflen\_qid}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01590}01590 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01591}01591                 \textcolor{keywordflow}{switch} (rsp\_type) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01592}01592                 \textcolor{keywordflow}{case} \mbox{\hyperlink{t4__regs__values_8h_a74b5507406a973b66d44646fc3e62c9f}{X\_RSPD\_TYPE\_FLBUF}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01593}01593                         \textcolor{keywordflow}{if} (lq \& \mbox{\hyperlink{t4__hw_8h_a20a03759d1d1ff08d8d1b7d4236dc436}{F\_RSPD\_NEWBUF}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01594}01594                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} > 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01595}01595                                         \mbox{\hyperlink{t4__sge_8c_a5906a819e0afea60c56fe9f448e740a1}{move\_to\_next\_rxbuf}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01596}01596                                 lq = \mbox{\hyperlink{t4__hw_8h_af0a7d84cbabe0410dd0841397d85a6cb}{G\_RSPD\_LEN}}(lq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01597}01597                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01598}01598                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a5b0f572f7c8db6dac00cfd7f50b8bd43}{IDXDIFF}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0d4baa235797170a157e790696ac257b}{hw\_cidx}}, fl\_hw\_cidx, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0f572e6a95a867a2c848d725b6e30785}{sidx}}) > 4) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01599}01599                                 \mbox{\hyperlink{adapter_8h_a41c2edc639f8438bba380b1698ecb12e}{FL\_LOCK}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01600}01600                                 \mbox{\hyperlink{t4__sge_8c_ac105ed5d85881e9f6b48414965986423}{refill\_fl}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, 64);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01601}01601                                 \mbox{\hyperlink{adapter_8h_a63ce7ce2eb7ddaa4178b03391b6178a5}{FL\_UNLOCK}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01602}01602                                 fl\_hw\_cidx = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0d4baa235797170a157e790696ac257b}{hw\_cidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01603}01603                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01604}01604 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01605}01605                         \textcolor{keywordflow}{if} (d-\/>\mbox{\hyperlink{structiq__desc_a6d9d6c973ab2f14ccc1fcf216f2c6c04}{rss}}.\mbox{\hyperlink{structrss__header_ab18a0a11ee567f3fba4674b7d39044fb}{opcode}} == \mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebbaae09735af844c269003fec3f1ba9a0ad}{CPL\_RX\_PKT}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01606}01606                                 \textcolor{keywordflow}{if} (\_\_predict\_true(\mbox{\hyperlink{t4__sge_8c_a6fc82bd622ab303ae0087d23b2c6776e}{eth\_rx}}(sc, \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}, d, lq) == 0))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01607}01607                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01608}01608                                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01609}01609                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01610}01610                         m0 = \mbox{\hyperlink{t4__sge_8c_aaa31acd67a226af581c0792affdde64f}{get\_fl\_payload}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, lq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01611}01611                         \textcolor{keywordflow}{if} (\_\_predict\_false(m0 == NULL))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01612}01612                                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01613}01613 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01614}01614                         \textcolor{comment}{/* fall through */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01615}01615 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01616}01616                 \textcolor{keywordflow}{case} \mbox{\hyperlink{t4__regs__values_8h_af938339dc494cd05bb2be36b779cf5d0}{X\_RSPD\_TYPE\_CPL}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01617}01617                         KASSERT(d-\/>\mbox{\hyperlink{structiq__desc_a6d9d6c973ab2f14ccc1fcf216f2c6c04}{rss}}.\mbox{\hyperlink{structrss__header_ab18a0a11ee567f3fba4674b7d39044fb}{opcode}} < \mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebba3f92168ea27c9b80bc5db7c90e4e429b}{NUM\_CPL\_CMDS}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01618}01618                             (\textcolor{stringliteral}{"{}\%s: bad opcode \%02x."{}}, \_\_func\_\_, d-\/>\mbox{\hyperlink{structiq__desc_a6d9d6c973ab2f14ccc1fcf216f2c6c04}{rss}}.\mbox{\hyperlink{structrss__header_ab18a0a11ee567f3fba4674b7d39044fb}{opcode}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01619}01619                         \mbox{\hyperlink{t4__sge_8c_a7f46019356e6a0919425bc5ac2b32926}{t4\_cpl\_handler}}[d-\/>\mbox{\hyperlink{structiq__desc_a6d9d6c973ab2f14ccc1fcf216f2c6c04}{rss}}.\mbox{\hyperlink{structrss__header_ab18a0a11ee567f3fba4674b7d39044fb}{opcode}}](\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \&d-\/>\mbox{\hyperlink{structiq__desc_a6d9d6c973ab2f14ccc1fcf216f2c6c04}{rss}}, m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01620}01620                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01621}01621 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01622}01622                 \textcolor{keywordflow}{case} \mbox{\hyperlink{t4__regs__values_8h_a3ceebaf7a7d5fae89b7bac860fce5181}{X\_RSPD\_TYPE\_INTR}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01623}01623 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01624}01624                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01625}01625 \textcolor{comment}{                         * There are 1K interrupt-\/capable queues (qids 0}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01626}01626 \textcolor{comment}{                         * through 1023).  A response type indicating a}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01627}01627 \textcolor{comment}{                         * forwarded interrupt with a qid >= 1K is an}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01628}01628 \textcolor{comment}{                         * iWARP async notification.  That is the only}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01629}01629 \textcolor{comment}{                         * acceptable indirect interrupt on this queue.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01630}01630 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01631}01631                         \textcolor{keywordflow}{if} (\_\_predict\_false(lq < 1024)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01632}01632                                 panic(\textcolor{stringliteral}{"{}\%s: indirect interrupt on iq\_fl \%p "{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01633}01633                                     \textcolor{stringliteral}{"{}with qid \%u"{}}, \_\_func\_\_, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, lq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01634}01634                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01635}01635 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01636}01636                         \mbox{\hyperlink{t4__sge_8c_a1a0b19582a9d7ae1e31e91d8926bb7c3}{t4\_an\_handler}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \&d-\/>\mbox{\hyperlink{structiq__desc_a8391143d41a654ec2f5d5c9e8f853cde}{rsp}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01637}01637                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01638}01638 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01639}01639                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01640}01640                         KASSERT(0, (\textcolor{stringliteral}{"{}\%s: illegal response type \%d on iq \%p"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01641}01641                             \_\_func\_\_, rsp\_type, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01642}01642                         log(LOG\_ERR, \textcolor{stringliteral}{"{}\%s: illegal response type \%d on iq \%p"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01643}01643                             device\_get\_nameunit(sc-\/>\mbox{\hyperlink{structadapter_aea408064601574166a737fafae5cd4a3}{dev}}), rsp\_type, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01644}01644                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01645}01645                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01646}01646 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01647}01647                 d++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01648}01648                 \textcolor{keywordflow}{if} (\_\_predict\_false(++\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ade977c1efafcb5bb9a49a218b185e86a}{cidx}} == \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ab9abd6046ab67bce82714431aadaf9e2}{sidx}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01649}01649                         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ade977c1efafcb5bb9a49a218b185e86a}{cidx}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01650}01650                         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aaaf44d8d3b8d8e9073d7e6ce3af59b6c}{gen}} \string^= \mbox{\hyperlink{t4__hw_8h_adefd29ae6bd1bea521801e26ebf391ef}{F\_RSPD\_GEN}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01651}01651                         d = \&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aa0b80730bff81beab7577cb1d1fe8f3d}{desc}}[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01652}01652                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01653}01653                 \textcolor{keywordflow}{if} (\_\_predict\_false(++ndescs == limit)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01654}01654                         \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, sc-\/>\mbox{\hyperlink{structadapter_aabd38017caa2cfc7d05a0ca1ea3088d6}{sge\_gts\_reg}}, \mbox{\hyperlink{t4__regs_8h_a1df614613a82bd50ac8fd674631142cb}{V\_CIDXINC}}(ndescs) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01655}01655                             \mbox{\hyperlink{t4__regs_8h_a82092f219f7205c46e71692dd8320f4d}{V\_INGRESSQID}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ad7db32f3e80fe7456ed7d811ee069dee}{cntxt\_id}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01656}01656                             \mbox{\hyperlink{t4__regs_8h_ac1ca65e58a41f06a0f7204c54b1e7764}{V\_SEINTARM}}(\mbox{\hyperlink{t4__hw_8h_ad0d0106f734aaf74bfcdc39fe0c45209}{V\_QINTR\_TIMER\_IDX}}(\mbox{\hyperlink{t4__regs__values_8h_acc7a220c7c24995f21a090d2a8853792}{X\_TIMERREG\_UPDATE\_CIDX}})));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01657}01657 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01658}01658 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01659}01659                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635aa23c24e7874c882f9e05ac0349f3cd14}{IQ\_LRO\_ENABLED}} \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01660}01660                             !sort\_before\_lro(\mbox{\hyperlink{adapter_8h_a42a4d2ca0dfc94f5010fc81500806269}{lro}}) \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01661}01661                             sc-\/>\mbox{\hyperlink{structadapter_a13f19f5f59a1d1b0fde9daf47d3b88eb}{lro\_timeout}} != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01662}01662                                 tcp\_lro\_flush\_inactive(\mbox{\hyperlink{adapter_8h_a42a4d2ca0dfc94f5010fc81500806269}{lro}}, \&lro\_timeout);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01663}01663                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01664}01664 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01665}01665                         \textcolor{keywordflow}{if} (budget)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01666}01666                                 \textcolor{keywordflow}{return} (EINPROGRESS);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01667}01667                         ndescs = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01668}01668                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01669}01669         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01670}01670 out:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01671}01671 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01672}01672         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635aa23c24e7874c882f9e05ac0349f3cd14}{IQ\_LRO\_ENABLED}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01673}01673                 \textcolor{keywordflow}{if} (ndescs > 0 \&\& \mbox{\hyperlink{adapter_8h_a42a4d2ca0dfc94f5010fc81500806269}{lro}}-\/>lro\_mbuf\_count > 8) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01674}01674                         MPASS(sort\_before\_lro(\mbox{\hyperlink{adapter_8h_a42a4d2ca0dfc94f5010fc81500806269}{lro}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01675}01675                         \textcolor{comment}{/* hold back one credit and don't flush LRO state */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01676}01676                         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} |= \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a8f16f182ffe0cbee4bd1629a78e63cf3}{IQ\_ADJ\_CREDIT}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01677}01677                         ndescs-\/-\/;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01678}01678                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01679}01679                         tcp\_lro\_flush\_all(\mbox{\hyperlink{adapter_8h_a42a4d2ca0dfc94f5010fc81500806269}{lro}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01680}01680                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01681}01681         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01682}01682 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01683}01683 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01684}01684         \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, sc-\/>\mbox{\hyperlink{structadapter_aabd38017caa2cfc7d05a0ca1ea3088d6}{sge\_gts\_reg}}, \mbox{\hyperlink{t4__regs_8h_a1df614613a82bd50ac8fd674631142cb}{V\_CIDXINC}}(ndescs) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01685}01685             \mbox{\hyperlink{t4__regs_8h_a82092f219f7205c46e71692dd8320f4d}{V\_INGRESSQID}}((\mbox{\hyperlink{osdep_8h_afaa62991928fb9fb18ff0db62a040aba}{u32}})\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ad7db32f3e80fe7456ed7d811ee069dee}{cntxt\_id}}) | \mbox{\hyperlink{t4__regs_8h_ac1ca65e58a41f06a0f7204c54b1e7764}{V\_SEINTARM}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a356b3e09ec2c3964ec6f8122cb42b88a}{intr\_params}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01686}01686 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01687}01687         \mbox{\hyperlink{adapter_8h_a41c2edc639f8438bba380b1698ecb12e}{FL\_LOCK}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01688}01688         starved = \mbox{\hyperlink{t4__sge_8c_ac105ed5d85881e9f6b48414965986423}{refill\_fl}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, 64);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01689}01689         \mbox{\hyperlink{adapter_8h_a63ce7ce2eb7ddaa4178b03391b6178a5}{FL\_UNLOCK}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01690}01690         \textcolor{keywordflow}{if} (\_\_predict\_false(starved != 0))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01691}01691                 \mbox{\hyperlink{t4__sge_8c_a0280e71f22d29f8ea1ee29159418d3d9}{add\_fl\_to\_sfl}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01692}01692 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01693}01693         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01694}01694 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01695}01695 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01696}01696 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{struct }\mbox{\hyperlink{structcluster__metadata}{cluster\_metadata}} *}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01697}\mbox{\hyperlink{t4__sge_8c_a90def5cc3b7c312e4c3a9d01e61ea2fc}{01697}} \mbox{\hyperlink{t4__sge_8c_a90def5cc3b7c312e4c3a9d01e61ea2fc}{cl\_metadata}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structfl__sdesc}{fl\_sdesc}} *sd)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01698}01698 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01699}01699 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01700}01700         \textcolor{keywordflow}{return} ((\textcolor{keywordtype}{void} *)(sd-\/>\mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}} + sd-\/>\mbox{\hyperlink{structfl__sdesc_a089e1695e94803a929c036d6c56d13bf}{moff}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01701}01701 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01702}01702 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01703}01703 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01704}\mbox{\hyperlink{t4__sge_8c_ad56efbf9c84e7886842e4eaaf4136c28}{01704}} \mbox{\hyperlink{t4__sge_8c_ad56efbf9c84e7886842e4eaaf4136c28}{rxb\_free}}(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01705}01705 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01706}01706         \textcolor{keyword}{struct }\mbox{\hyperlink{structcluster__metadata}{cluster\_metadata}} *clm = m-\/>m\_ext.ext\_arg1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01707}01707 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01708}01708         uma\_zfree(clm-\/>\mbox{\hyperlink{structcluster__metadata_a1112b18847cdff7c86fbf1f23962f267}{zone}}, clm-\/>\mbox{\hyperlink{structcluster__metadata_af6d9013fef56a6a258aa7e882ea7e42e}{cl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01709}01709         counter\_u64\_add(\mbox{\hyperlink{t4__sge_8c_ae618d620a0161831f318bf78a9d94edb}{extfree\_rels}}, 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01710}01710 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01711}01711 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01712}01712 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01713}01713 \textcolor{comment}{ * The mbuf returned comes from zone\_muf and carries the payload in one of these}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01714}01714 \textcolor{comment}{ * ways}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01715}01715 \textcolor{comment}{ * a) complete frame inside the mbuf}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01716}01716 \textcolor{comment}{ * b) m\_cljset (for clusters without metadata)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01717}01717 \textcolor{comment}{ * d) m\_extaddref (cluster with metadata)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01718}01718 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01719}01719 \textcolor{keyword}{static} \textcolor{keyword}{struct }mbuf *}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01720}\mbox{\hyperlink{t4__sge_8c_a2c03b688a86fca39cdb062697055994f}{01720}} \mbox{\hyperlink{t4__sge_8c_a2c03b688a86fca39cdb062697055994f}{get\_scatter\_segment}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, \textcolor{keywordtype}{int} fr\_offset,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01721}01721     \textcolor{keywordtype}{int} remaining)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01722}01722 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01723}01723         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01724}01724         \textcolor{keyword}{struct }\mbox{\hyperlink{structfl__sdesc}{fl\_sdesc}} *sd = \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a72d761fa3c245d6de3286e7fc055346f}{sdesc}}[\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a141fb92c69ac2f791c7fcc19c28d3d73}{cidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01725}01725         \textcolor{keyword}{struct }\mbox{\hyperlink{structrx__buf__info}{rx\_buf\_info}} *rxb = \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a1d0a3ea264db143053eab8e647b3d3fc}{rx\_buf\_info}}[sd-\/>\mbox{\hyperlink{structfl__sdesc_a584facf428bd80f31f3d73c489204d73}{zidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01726}01726         \textcolor{keyword}{struct }\mbox{\hyperlink{structcluster__metadata}{cluster\_metadata}} *clm;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01727}01727         \textcolor{keywordtype}{int} len, blen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01728}01728         caddr\_t payload;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01729}01729 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01730}01730         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daa0bc2f5c770b6e332fdc75909ee8bb47}{FL\_BUF\_PACKING}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01731}01731                 u\_int l, pad;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01732}01732 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01733}01733                 blen = rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}} -\/ \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}};      \textcolor{comment}{/* max possible in this buf */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01734}01734                 len = min(remaining, blen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01735}01735                 payload = sd-\/>\mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}} + \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01736}01736 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01737}01737                 l = fr\_offset + len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01738}01738                 pad = roundup2(l, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a80a47dbfa557b1a80b6fa79eac164692}{buf\_boundary}}) -\/ l;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01739}01739                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} + len + pad < rxb-\/>size2)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01740}01740                         blen = len + pad;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01741}01741                 MPASS(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} + blen <= rxb-\/>size2);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01742}01742         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01743}01743                 MPASS(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} == 0);   \textcolor{comment}{/* not packing */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01744}01744                 blen = rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01745}01745                 len = min(remaining, blen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01746}01746                 payload = sd-\/>\mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01747}01747         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01748}01748 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01749}01749         \textcolor{keywordflow}{if} (fr\_offset == 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01750}01750                 m = m\_gethdr(M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01751}01751                 \textcolor{keywordflow}{if} (\_\_predict\_false(m == NULL))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01752}01752                         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01753}01753                 m-\/>m\_pkthdr.len = remaining;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01754}01754         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01755}01755                 m = m\_get(M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01756}01756                 \textcolor{keywordflow}{if} (\_\_predict\_false(m == NULL))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01757}01757                         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01758}01758         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01759}01759         m-\/>m\_len = len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01760}01760         kmsan\_mark(payload, len, KMSAN\_STATE\_INITED);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01761}01761 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01762}01762         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structadapter_a1dbe83966590dc68892051e5193c7782}{sc\_do\_rxcopy}} \&\& len < \mbox{\hyperlink{t4__sge_8c_ab343f68afb69400300058b3a24de6de2}{RX\_COPY\_THRESHOLD}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01763}01763                 \textcolor{comment}{/* copy data to mbuf */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01764}01764                 bcopy(payload, mtod(m, caddr\_t), len);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01765}01765                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daa0bc2f5c770b6e332fdc75909ee8bb47}{FL\_BUF\_PACKING}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01766}01766                         \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} += blen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01767}01767                         MPASS(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} <= rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01768}01768                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} < rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01769}01769                                 \textcolor{keywordflow}{return} (m);     \textcolor{comment}{/* without advancing the cidx */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01770}01770                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01771}01771         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daa0bc2f5c770b6e332fdc75909ee8bb47}{FL\_BUF\_PACKING}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01772}01772                 clm = \mbox{\hyperlink{t4__sge_8c_a90def5cc3b7c312e4c3a9d01e61ea2fc}{cl\_metadata}}(sd);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01773}01773                 \textcolor{keywordflow}{if} (sd-\/>\mbox{\hyperlink{structfl__sdesc_a96da93c917bdc281c3a3ed794c0ce5b4}{nmbuf}}++ == 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01774}01774                         clm-\/>\mbox{\hyperlink{structcluster__metadata_a4fb25e2d233b522705bfc38dc4f37451}{refcount}} = 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01775}01775                         clm-\/>\mbox{\hyperlink{structcluster__metadata_a1112b18847cdff7c86fbf1f23962f267}{zone}} = rxb-\/>\mbox{\hyperlink{structrx__buf__info_a1b42a285c183e57dcd2f589d5de929ae}{zone}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01776}01776                         clm-\/>\mbox{\hyperlink{structcluster__metadata_af6d9013fef56a6a258aa7e882ea7e42e}{cl}} = sd-\/>\mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01777}01777                         counter\_u64\_add(\mbox{\hyperlink{t4__sge_8c_ad4b3b38251e147b30d181582db846844}{extfree\_refs}}, 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01778}01778                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01779}01779                 m\_extaddref(m, payload, blen, \&clm-\/>\mbox{\hyperlink{structcluster__metadata_a4fb25e2d233b522705bfc38dc4f37451}{refcount}}, \mbox{\hyperlink{t4__sge_8c_ad56efbf9c84e7886842e4eaaf4136c28}{rxb\_free}}, clm,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01780}01780                     NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01781}01781 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01782}01782                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} += blen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01783}01783                 MPASS(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} <= rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01784}01784                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} < rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01785}01785                         \textcolor{keywordflow}{return} (m);     \textcolor{comment}{/* without advancing the cidx */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01786}01786         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01787}01787                 m\_cljset(m, sd-\/>\mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}}, rxb-\/>\mbox{\hyperlink{structrx__buf__info_aeb418917b76775d0ac0a2cfde8cb64da}{type}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01788}01788                 sd-\/>\mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}} = NULL;        \textcolor{comment}{/* consumed, not a recycle candidate */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01789}01789         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01790}01790 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01791}01791         \mbox{\hyperlink{t4__sge_8c_a5906a819e0afea60c56fe9f448e740a1}{move\_to\_next\_rxbuf}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01792}01792 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01793}01793         \textcolor{keywordflow}{return} (m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01794}01794 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01795}01795 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01796}01796 \textcolor{keyword}{static} \textcolor{keyword}{struct }mbuf *}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01797}\mbox{\hyperlink{t4__sge_8c_a205c42b259a4f235d7af63b03375b1fa}{01797}} \mbox{\hyperlink{t4__sge_8c_aaa31acd67a226af581c0792affdde64f}{get\_fl\_payload}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, \textcolor{keyword}{const} u\_int plen)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01798}01798 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01799}01799         \textcolor{keyword}{struct }mbuf *m0, *m, **pnext;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01800}01800         u\_int remaining;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01801}01801 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01802}01802         \textcolor{keywordflow}{if} (\_\_predict\_false(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daea6e5181a0f82777f828d3a992d88b55}{FL\_BUF\_RESUME}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01803}01803                 M\_ASSERTPKTHDR(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_af5e12414c693a02b4d8af782a0d1fe2c}{m0}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01804}01804                 MPASS(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_af5e12414c693a02b4d8af782a0d1fe2c}{m0}}-\/>m\_pkthdr.len == plen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01805}01805                 MPASS(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a331a126ee2c18db8a16da0d321ce45d3}{remaining}} < plen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01806}01806 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01807}01807                 m0 = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_af5e12414c693a02b4d8af782a0d1fe2c}{m0}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01808}01808                 pnext = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad39df563c82326de7ecdf2b1e2789b75}{pnext}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01809}01809                 remaining = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a331a126ee2c18db8a16da0d321ce45d3}{remaining}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01810}01810                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \&= \string~FL\_BUF\_RESUME;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01811}01811                 \textcolor{keywordflow}{goto} get\_segment;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01812}01812         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01813}01813 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01814}01814         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01815}01815 \textcolor{comment}{         * Payload starts at rx\_offset in the current hw buffer.  Its length is}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01816}01816 \textcolor{comment}{         * 'len' and it may span multiple hw buffers.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01817}01817 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01818}01818 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01819}01819         m0 = \mbox{\hyperlink{t4__sge_8c_a2c03b688a86fca39cdb062697055994f}{get\_scatter\_segment}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, 0, plen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01820}01820         \textcolor{keywordflow}{if} (m0 == NULL)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01821}01821                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01822}01822         remaining = plen -\/ m0-\/>m\_len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01823}01823         pnext = \&m0-\/>m\_next;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01824}01824         \textcolor{keywordflow}{while} (remaining > 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01825}01825 get\_segment:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01826}01826                 MPASS(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} == 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01827}01827                 m = \mbox{\hyperlink{t4__sge_8c_a2c03b688a86fca39cdb062697055994f}{get\_scatter\_segment}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, plen -\/ remaining, remaining);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01828}01828                 \textcolor{keywordflow}{if} (\_\_predict\_false(m == NULL)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01829}01829                         \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_af5e12414c693a02b4d8af782a0d1fe2c}{m0}} = m0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01830}01830                         \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad39df563c82326de7ecdf2b1e2789b75}{pnext}} = pnext;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01831}01831                         \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a331a126ee2c18db8a16da0d321ce45d3}{remaining}} = remaining;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01832}01832                         \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} |= \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daea6e5181a0f82777f828d3a992d88b55}{FL\_BUF\_RESUME}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01833}01833                         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01834}01834                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01835}01835                 *pnext = m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01836}01836                 pnext = \&m-\/>m\_next;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01837}01837                 remaining -\/= m-\/>m\_len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01838}01838         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01839}01839         *pnext = NULL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01840}01840 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01841}01841         M\_ASSERTPKTHDR(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01842}01842         \textcolor{keywordflow}{return} (m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01843}01843 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01844}01844 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01845}01845 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01846}\mbox{\hyperlink{t4__sge_8c_a0ffe9c6edced82f4dea617559e3fd4a5}{01846}} \mbox{\hyperlink{t4__sge_8c_a0ffe9c6edced82f4dea617559e3fd4a5}{skip\_scatter\_segment}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, \textcolor{keywordtype}{int} fr\_offset,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01847}01847     \textcolor{keywordtype}{int} remaining)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01848}01848 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01849}01849         \textcolor{keyword}{struct }\mbox{\hyperlink{structfl__sdesc}{fl\_sdesc}} *sd = \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a72d761fa3c245d6de3286e7fc055346f}{sdesc}}[\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a141fb92c69ac2f791c7fcc19c28d3d73}{cidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01850}01850         \textcolor{keyword}{struct }\mbox{\hyperlink{structrx__buf__info}{rx\_buf\_info}} *rxb = \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a1d0a3ea264db143053eab8e647b3d3fc}{rx\_buf\_info}}[sd-\/>\mbox{\hyperlink{structfl__sdesc_a584facf428bd80f31f3d73c489204d73}{zidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01851}01851         \textcolor{keywordtype}{int} len, blen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01852}01852 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01853}01853         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daa0bc2f5c770b6e332fdc75909ee8bb47}{FL\_BUF\_PACKING}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01854}01854                 u\_int l, pad;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01855}01855 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01856}01856                 blen = rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}} -\/ \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}};      \textcolor{comment}{/* max possible in this buf */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01857}01857                 len = min(remaining, blen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01858}01858 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01859}01859                 l = fr\_offset + len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01860}01860                 pad = roundup2(l, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a80a47dbfa557b1a80b6fa79eac164692}{buf\_boundary}}) -\/ l;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01861}01861                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} + len + pad < rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01862}01862                         blen = len + pad;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01863}01863                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} += blen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01864}01864                 MPASS(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} <= rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01865}01865                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} < rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01866}01866                         \textcolor{keywordflow}{return} (len);   \textcolor{comment}{/* without advancing the cidx */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01867}01867         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01868}01868                 MPASS(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} == 0);   \textcolor{comment}{/* not packing */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01869}01869                 blen = rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01870}01870                 len = min(remaining, blen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01871}01871         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01872}01872         \mbox{\hyperlink{t4__sge_8c_a5906a819e0afea60c56fe9f448e740a1}{move\_to\_next\_rxbuf}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01873}01873         \textcolor{keywordflow}{return} (len);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01874}01874 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01875}01875 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01876}01876 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01877}\mbox{\hyperlink{t4__sge_8c_ab9048a7351a82605a294a6c6e59d86c2}{01877}} \mbox{\hyperlink{t4__sge_8c_ab9048a7351a82605a294a6c6e59d86c2}{skip\_fl\_payload}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, \textcolor{keywordtype}{int} plen)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01878}01878 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01879}01879         \textcolor{keywordtype}{int} remaining, fr\_offset, len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01880}01880 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01881}01881         fr\_offset = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01882}01882         remaining = plen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01883}01883         \textcolor{keywordflow}{while} (remaining > 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01884}01884                 len = \mbox{\hyperlink{t4__sge_8c_a0ffe9c6edced82f4dea617559e3fd4a5}{skip\_scatter\_segment}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, fr\_offset, remaining);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01885}01885                 fr\_offset += len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01886}01886                 remaining -\/= len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01887}01887         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01888}01888 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01889}01889 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01890}01890 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01891}\mbox{\hyperlink{t4__sge_8c_a7c81221bd914aafbcd32ab65aca6a2f6}{01891}} \mbox{\hyperlink{t4__sge_8c_a7c81221bd914aafbcd32ab65aca6a2f6}{get\_segment\_len}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, \textcolor{keywordtype}{int} plen)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01892}01892 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01893}01893         \textcolor{keywordtype}{int} len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01894}01894         \textcolor{keyword}{struct }\mbox{\hyperlink{structfl__sdesc}{fl\_sdesc}} *sd = \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a72d761fa3c245d6de3286e7fc055346f}{sdesc}}[\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a141fb92c69ac2f791c7fcc19c28d3d73}{cidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01895}01895         \textcolor{keyword}{struct }\mbox{\hyperlink{structrx__buf__info}{rx\_buf\_info}} *rxb = \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a1d0a3ea264db143053eab8e647b3d3fc}{rx\_buf\_info}}[sd-\/>\mbox{\hyperlink{structfl__sdesc_a584facf428bd80f31f3d73c489204d73}{zidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01896}01896 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01897}01897         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daa0bc2f5c770b6e332fdc75909ee8bb47}{FL\_BUF\_PACKING}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01898}01898                 len = rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}} -\/ \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01899}01899         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01900}01900                 len = rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01901}01901 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01902}01902         \textcolor{keywordflow}{return} (min(plen, len));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01903}01903 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01904}01904 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01905}01905 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01906}\mbox{\hyperlink{t4__sge_8c_a6fc82bd622ab303ae0087d23b2c6776e}{01906}} \mbox{\hyperlink{t4__sge_8c_a6fc82bd622ab303ae0087d23b2c6776e}{eth\_rx}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__rxq}{sge\_rxq}} *\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structiq__desc}{iq\_desc}} *d,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01907}01907     u\_int plen)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01908}01908 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01909}01909         \textcolor{keyword}{struct }mbuf *m0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01910}01910         \textcolor{keyword}{struct }ifnet *\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}} = \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_ad2829ade146792cd5e2595bfca452a8a}{ifp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01911}01911         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}} = \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_acf98953f87dbe498d53bcf87c91db6a4}{fl}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01912}01912         \textcolor{keyword}{struct }\mbox{\hyperlink{structvi__info}{vi\_info}} *vi = \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01913}01913         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__rx__pkt}{cpl\_rx\_pkt}} *cpl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01914}01914 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01915}01915         \textcolor{keyword}{struct }lro\_ctrl *\mbox{\hyperlink{adapter_8h_a42a4d2ca0dfc94f5010fc81500806269}{lro}} = \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a5d3c964f9629fc3bd81dd1ff3b5e7332}{lro}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01916}01916 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01917}01917         uint16\_t err\_vec, tnl\_type, tnlhdr\_len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01918}01918         \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{int} sw\_hashtype[4][2] = \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01919}01919                 \{M\_HASHTYPE\_NONE, M\_HASHTYPE\_NONE\},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01920}01920                 \{M\_HASHTYPE\_RSS\_IPV4, M\_HASHTYPE\_RSS\_IPV6\},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01921}01921                 \{M\_HASHTYPE\_RSS\_TCP\_IPV4, M\_HASHTYPE\_RSS\_TCP\_IPV6\},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01922}01922                 \{M\_HASHTYPE\_RSS\_UDP\_IPV4, M\_HASHTYPE\_RSS\_UDP\_IPV6\},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01923}01923         \};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01924}01924         \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{int} sw\_csum\_flags[2][2] = \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01925}01925                 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01926}01926                         \textcolor{comment}{/* IP, inner IP */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01927}01927                         CSUM\_ENCAP\_VXLAN |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01928}01928                             CSUM\_L3\_CALC | CSUM\_L3\_VALID |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01929}01929                             CSUM\_L4\_CALC | CSUM\_L4\_VALID |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01930}01930                             CSUM\_INNER\_L3\_CALC | CSUM\_INNER\_L3\_VALID |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01931}01931                             CSUM\_INNER\_L4\_CALC | CSUM\_INNER\_L4\_VALID,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01932}01932 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01933}01933                         \textcolor{comment}{/* IP, inner IP6 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01934}01934                         CSUM\_ENCAP\_VXLAN |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01935}01935                             CSUM\_L3\_CALC | CSUM\_L3\_VALID |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01936}01936                             CSUM\_L4\_CALC | CSUM\_L4\_VALID |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01937}01937                             CSUM\_INNER\_L4\_CALC | CSUM\_INNER\_L4\_VALID,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01938}01938                 \},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01939}01939                 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01940}01940                         \textcolor{comment}{/* IP6, inner IP */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01941}01941                         CSUM\_ENCAP\_VXLAN |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01942}01942                             CSUM\_L4\_CALC | CSUM\_L4\_VALID |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01943}01943                             CSUM\_INNER\_L3\_CALC | CSUM\_INNER\_L3\_VALID |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01944}01944                             CSUM\_INNER\_L4\_CALC | CSUM\_INNER\_L4\_VALID,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01945}01945 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01946}01946                         \textcolor{comment}{/* IP6, inner IP6 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01947}01947                         CSUM\_ENCAP\_VXLAN |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01948}01948                             CSUM\_L4\_CALC | CSUM\_L4\_VALID |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01949}01949                             CSUM\_INNER\_L4\_CALC | CSUM\_INNER\_L4\_VALID,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01950}01950                 \},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01951}01951         \};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01952}01952 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01953}01953         MPASS(plen > sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_adea24551a1974e6786f29fa3cdc3dd9a}{fl\_pktshift}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01954}01954         \textcolor{keywordflow}{if} (vi-\/>\mbox{\hyperlink{structvi__info_ae67c3188b9990afbac6a41b4b1e08205}{pfil}} != NULL \&\& PFIL\_HOOKED\_IN(vi-\/>\mbox{\hyperlink{structvi__info_ae67c3188b9990afbac6a41b4b1e08205}{pfil}}) \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01955}01955             \_\_predict\_true((\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daea6e5181a0f82777f828d3a992d88b55}{FL\_BUF\_RESUME}}) == 0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01956}01956                 \textcolor{keyword}{struct }\mbox{\hyperlink{structfl__sdesc}{fl\_sdesc}} *sd = \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a72d761fa3c245d6de3286e7fc055346f}{sdesc}}[\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a141fb92c69ac2f791c7fcc19c28d3d73}{cidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01957}01957                 caddr\_t frame;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01958}01958                 \textcolor{keywordtype}{int} rc, slen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01959}01959 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01960}01960                 slen = \mbox{\hyperlink{t4__sge_8c_a7c81221bd914aafbcd32ab65aca6a2f6}{get\_segment\_len}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, plen) -\/}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01961}01961                     sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_adea24551a1974e6786f29fa3cdc3dd9a}{fl\_pktshift}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01962}01962                 frame = sd-\/>\mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}} + \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} + sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_adea24551a1974e6786f29fa3cdc3dd9a}{fl\_pktshift}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01963}01963                 CURVNET\_SET\_QUIET(\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_vnet);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01964}01964                 rc = pfil\_run\_hooks(vi-\/>\mbox{\hyperlink{structvi__info_ae67c3188b9990afbac6a41b4b1e08205}{pfil}}, frame, \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01965}01965                     slen | PFIL\_MEMPTR | PFIL\_IN, NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01966}01966                 CURVNET\_RESTORE();}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01967}01967                 \textcolor{keywordflow}{if} (rc == PFIL\_DROPPED || rc == PFIL\_CONSUMED) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01968}01968                         \mbox{\hyperlink{t4__sge_8c_ab9048a7351a82605a294a6c6e59d86c2}{skip\_fl\_payload}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, plen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01969}01969                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01970}01970                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01971}01971                 \textcolor{keywordflow}{if} (rc == PFIL\_REALLOCED) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01972}01972                         \mbox{\hyperlink{t4__sge_8c_ab9048a7351a82605a294a6c6e59d86c2}{skip\_fl\_payload}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, plen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01973}01973                         m0 = pfil\_mem2mbuf(frame);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01974}01974                         \textcolor{keywordflow}{goto} have\_mbuf;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01975}01975                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01976}01976         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01977}01977 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01978}01978         m0 = \mbox{\hyperlink{t4__sge_8c_aaa31acd67a226af581c0792affdde64f}{get\_fl\_payload}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, plen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01979}01979         \textcolor{keywordflow}{if} (\_\_predict\_false(m0 == NULL))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01980}01980                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01981}01981 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01982}01982         m0-\/>m\_pkthdr.len -\/= sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_adea24551a1974e6786f29fa3cdc3dd9a}{fl\_pktshift}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01983}01983         m0-\/>m\_len -\/= sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_adea24551a1974e6786f29fa3cdc3dd9a}{fl\_pktshift}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01984}01984         m0-\/>m\_data += sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_adea24551a1974e6786f29fa3cdc3dd9a}{fl\_pktshift}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01985}01985 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01986}01986 have\_mbuf:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01987}01987         m0-\/>m\_pkthdr.rcvif = \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01988}01988         M\_HASHTYPE\_SET(m0, sw\_hashtype[d-\/>\mbox{\hyperlink{structiq__desc_a6d9d6c973ab2f14ccc1fcf216f2c6c04}{rss}}.\mbox{\hyperlink{structrss__header_a8fa8f5e07f190fd748b91c94361fd88f}{hash\_type}}][d-\/>\mbox{\hyperlink{structiq__desc_a6d9d6c973ab2f14ccc1fcf216f2c6c04}{rss}}.\mbox{\hyperlink{structrss__header_a22fa19bd968287f72afbdee8feabe26c}{ipv6}}]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01989}01989         m0-\/>m\_pkthdr.flowid = be32toh(d-\/>\mbox{\hyperlink{structiq__desc_a6d9d6c973ab2f14ccc1fcf216f2c6c04}{rss}}.\mbox{\hyperlink{structrss__header_aec8e196ae7abdfd8151b3b899688627f}{hash\_val}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01990}01990 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01991}01991         cpl = (\textcolor{keyword}{const} \textcolor{keywordtype}{void} *)(\&d-\/>\mbox{\hyperlink{structiq__desc_a6d9d6c973ab2f14ccc1fcf216f2c6c04}{rss}} + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01992}01992         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_a3f78b013ebbf4cb996fc60dc4723d907}{tp}}.\mbox{\hyperlink{structtp__params_ad95a068d2ec6b8bafbccefd5d78dbf59}{rx\_pkt\_encap}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01993}01993                 \textcolor{keyword}{const} uint16\_t ev = be16toh(cpl-\/>\mbox{\hyperlink{structcpl__rx__pkt_a62569c2bb3ec08f69cb9dd947a46717a}{err\_vec}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01994}01994 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01995}01995                 err\_vec = \mbox{\hyperlink{t4__msg_8h_aeac5e96f019f1532946cab4353c7047e}{G\_T6\_COMPR\_RXERR\_VEC}}(ev);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01996}01996                 tnl\_type = \mbox{\hyperlink{t4__msg_8h_a363660cfb4d7746cb41d1fbcb31ca75b}{G\_T6\_RX\_TNL\_TYPE}}(ev);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01997}01997                 tnlhdr\_len = \mbox{\hyperlink{t4__msg_8h_a9187304a0c0b29d68d7cf2fbfd58d707}{G\_T6\_RX\_TNLHDR\_LEN}}(ev);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01998}01998         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l01999}01999                 err\_vec = be16toh(cpl-\/>\mbox{\hyperlink{structcpl__rx__pkt_a62569c2bb3ec08f69cb9dd947a46717a}{err\_vec}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02000}02000                 tnl\_type = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02001}02001                 tnlhdr\_len = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02002}02002         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02003}02003         \textcolor{keywordflow}{if} (cpl-\/>\mbox{\hyperlink{structcpl__rx__pkt_ae3ed6a2b75866a3b073eea3afd9a9425}{csum\_calc}} \&\& err\_vec == 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02004}02004                 \textcolor{keywordtype}{int} ipv6 = !!(cpl-\/>\mbox{\hyperlink{structcpl__rx__pkt_a2541723273163cb3957f60d6e9f9429f}{l2info}} \& htobe32(\mbox{\hyperlink{t4__msg_8h_aeddf417860c725ec512e3ab334d8c15c}{F\_RXF\_IP6}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02005}02005 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02006}02006                 \textcolor{comment}{/* checksum(s) calculated and found to be correct. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02007}02007 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02008}02008                 MPASS((cpl-\/>\mbox{\hyperlink{structcpl__rx__pkt_a2541723273163cb3957f60d6e9f9429f}{l2info}} \& htobe32(\mbox{\hyperlink{t4__msg_8h_a5eff6bbfa92753d02fdac759d9ad5d55}{F\_RXF\_IP}})) \string^}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02009}02009                     (cpl-\/>\mbox{\hyperlink{structcpl__rx__pkt_a2541723273163cb3957f60d6e9f9429f}{l2info}} \& htobe32(\mbox{\hyperlink{t4__msg_8h_aeddf417860c725ec512e3ab334d8c15c}{F\_RXF\_IP6}})));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02010}02010                 m0-\/>m\_pkthdr.csum\_data = be16toh(cpl-\/>\mbox{\hyperlink{structcpl__rx__pkt_a27f681b572eb93515131d33fa0fdd52a}{csum}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02011}02011                 \textcolor{keywordflow}{if} (tnl\_type == 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02012}02012                         \textcolor{keywordflow}{if} (!ipv6 \&\& \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_capenable \& IFCAP\_RXCSUM) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02013}02013                                 m0-\/>m\_pkthdr.csum\_flags = CSUM\_L3\_CALC |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02014}02014                                     CSUM\_L3\_VALID | CSUM\_L4\_CALC |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02015}02015                                     CSUM\_L4\_VALID;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02016}02016                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (ipv6 \&\& \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_capenable \& IFCAP\_RXCSUM\_IPV6) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02017}02017                                 m0-\/>m\_pkthdr.csum\_flags = CSUM\_L4\_CALC |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02018}02018                                     CSUM\_L4\_VALID;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02019}02019                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02020}02020                         \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a055450daaaafc7f6fd9b7b513fc6916c}{rxcsum}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02021}02021                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02022}02022                         MPASS(tnl\_type == \mbox{\hyperlink{t4__msg_8h_a74de434c3556cca96323931af2193cca}{RX\_PKT\_TNL\_TYPE\_VXLAN}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02023}02023 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02024}02024                         M\_HASHTYPE\_SETINNER(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02025}02025                         \textcolor{keywordflow}{if} (\_\_predict\_false(cpl-\/>\mbox{\hyperlink{structcpl__rx__pkt_aac5b6c0b06f85f838f736b021a318d2a}{ip\_frag}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02026}02026                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02027}02027 \textcolor{comment}{                                 * csum\_data is for the inner frame (which is an}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02028}02028 \textcolor{comment}{                                 * IP fragment) and is not 0xffff.  There is no}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02029}02029 \textcolor{comment}{                                 * way to pass the inner csum\_data to the stack.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02030}02030 \textcolor{comment}{                                 * We don't want the stack to use the inner}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02031}02031 \textcolor{comment}{                                 * csum\_data to validate the outer frame or it}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02032}02032 \textcolor{comment}{                                 * will get rejected.  So we fix csum\_data here}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02033}02033 \textcolor{comment}{                                 * and let sw do the checksum of inner IP}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02034}02034 \textcolor{comment}{                                 * fragments.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02035}02035 \textcolor{comment}{                                 *}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02036}02036 \textcolor{comment}{                                 * XXX: Need 32b for csum\_data2 in an rx mbuf.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02037}02037 \textcolor{comment}{                                 * Maybe stuff it into rcv\_tstmp?}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02038}02038 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02039}02039                                 m0-\/>m\_pkthdr.csum\_data = 0xffff;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02040}02040                                 \textcolor{keywordflow}{if} (ipv6) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02041}02041                                         m0-\/>m\_pkthdr.csum\_flags = CSUM\_L4\_CALC |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02042}02042                                             CSUM\_L4\_VALID;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02043}02043                                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02044}02044                                         m0-\/>m\_pkthdr.csum\_flags = CSUM\_L3\_CALC |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02045}02045                                             CSUM\_L3\_VALID | CSUM\_L4\_CALC |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02046}02046                                             CSUM\_L4\_VALID;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02047}02047                                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02048}02048                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02049}02049                                 \textcolor{keywordtype}{int} outer\_ipv6;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02050}02050 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02051}02051                                 MPASS(m0-\/>m\_pkthdr.csum\_data == 0xffff);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02052}02052 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02053}02053                                 outer\_ipv6 = tnlhdr\_len >=}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02054}02054                                     \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }ether\_header) +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02055}02055                                     sizeof(struct ip6\_hdr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02056}02056                                 m0-\/>m\_pkthdr.csum\_flags =}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02057}02057                                     sw\_csum\_flags[outer\_ipv6][ipv6];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02058}02058                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02059}02059                         \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a1709008f274b76ccb6fa3aed2468bb3f}{vxlan\_rxcsum}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02060}02060                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02061}02061         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02062}02062 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02063}02063         \textcolor{keywordflow}{if} (cpl-\/>\mbox{\hyperlink{structcpl__rx__pkt_a226adc38a321c62d37e7f1ef151ad0f9}{vlan\_ex}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02064}02064                 m0-\/>m\_pkthdr.ether\_vtag = be16toh(cpl-\/>\mbox{\hyperlink{structcpl__rx__pkt_ac20604f9fbc3eed9d9e478dc9ac821d5}{vlan}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02065}02065                 m0-\/>m\_flags |= M\_VLANTAG;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02066}02066                 \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_af549f76c4f549fb1549acd1889cba67e}{vlan\_extraction}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02067}02067         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02068}02068 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02069}02069         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635abc6c1312d9f7249e5ded2d87540540e7}{IQ\_RX\_TIMESTAMP}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02070}02070                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02071}02071 \textcolor{comment}{                 * Fill up rcv\_tstmp but do not set M\_TSTMP.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02072}02072 \textcolor{comment}{                 * rcv\_tstmp is not in the format that the}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02073}02073 \textcolor{comment}{                 * kernel expects and we don't want to mislead}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02074}02074 \textcolor{comment}{                 * it.  For now this is only for custom code}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02075}02075 \textcolor{comment}{                 * that knows how to interpret cxgbe's stamp.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02076}02076 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02077}02077                 m0-\/>m\_pkthdr.rcv\_tstmp =}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02078}02078                     \mbox{\hyperlink{t4__sge_8c_adf4321bbb4cd6ff7a311016b2354c247}{last\_flit\_to\_ns}}(sc, d-\/>\mbox{\hyperlink{structiq__desc_a8391143d41a654ec2f5d5c9e8f853cde}{rsp}}.\mbox{\hyperlink{structrsp__ctrl_a85d53d00be8fa4ce08238132bd519c34}{u}}.\mbox{\hyperlink{structrsp__ctrl_ac59fa0b881c18f68d06b95f8095cde5d}{last\_flit}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02079}02079 \textcolor{preprocessor}{\#ifdef notyet}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02080}02080                 m0-\/>m\_flags |= M\_TSTMP;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02081}02081 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02082}02082         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02083}02083 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02084}02084 \textcolor{preprocessor}{\#ifdef NUMA}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02085}02085         m0-\/>m\_pkthdr.numa\_domain = \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_numa\_domain;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02086}02086 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02087}02087 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02088}02088         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635aa23c24e7874c882f9e05ac0349f3cd14}{IQ\_LRO\_ENABLED}} \&\& tnl\_type == 0 \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02089}02089             (M\_HASHTYPE\_GET(m0) == M\_HASHTYPE\_RSS\_TCP\_IPV4 ||}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02090}02090             M\_HASHTYPE\_GET(m0) == M\_HASHTYPE\_RSS\_TCP\_IPV6)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02091}02091                 \textcolor{keywordflow}{if} (sort\_before\_lro(\mbox{\hyperlink{adapter_8h_a42a4d2ca0dfc94f5010fc81500806269}{lro}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02092}02092                         tcp\_lro\_queue\_mbuf(\mbox{\hyperlink{adapter_8h_a42a4d2ca0dfc94f5010fc81500806269}{lro}}, m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02093}02093                         \textcolor{keywordflow}{return} (0); \textcolor{comment}{/* queued for sort, then LRO */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02094}02094                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02095}02095                 \textcolor{keywordflow}{if} (tcp\_lro\_rx(\mbox{\hyperlink{adapter_8h_a42a4d2ca0dfc94f5010fc81500806269}{lro}}, m0, 0) == 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02096}02096                         \textcolor{keywordflow}{return} (0); \textcolor{comment}{/* queued for LRO */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02097}02097         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02098}02098 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02099}02099         \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_input(\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}, m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02100}02100 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02101}02101         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02102}02102 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02103}02103 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02104}02104 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02105}02105 \textcolor{comment}{ * Must drain the wrq or make sure that someone else will.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02106}02106 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02107}02107 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02108}\mbox{\hyperlink{t4__sge_8c_aacf36f8fa6191a39d3aef1d95a48faf9}{02108}} \mbox{\hyperlink{t4__sge_8c_aacf36f8fa6191a39d3aef1d95a48faf9}{wrq\_tx\_drain}}(\textcolor{keywordtype}{void} *arg, \textcolor{keywordtype}{int} n)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02109}02109 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02110}02110         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__wrq}{sge\_wrq}} *\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}} = arg;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02111}02111         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02112}02112 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02113}02113         \mbox{\hyperlink{adapter_8h_aa342afce2bb63960ab2e3e1b4e3d45f2}{EQ\_LOCK}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02114}02114         \textcolor{keywordflow}{if} (TAILQ\_EMPTY(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>incomplete\_wrs) \&\& !STAILQ\_EMPTY(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>wr\_list))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02115}02115                 \mbox{\hyperlink{t4__sge_8c_af4d3457cf55d271db1060586cf481bc0}{drain\_wrq\_wr\_list}}(\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a7c38e3751f35cbee8834f2cb3c8e2156}{adapter}}, \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02116}02116         \mbox{\hyperlink{adapter_8h_a91b79109ac65aad761a86bd3bdeaa2b6}{EQ\_UNLOCK}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02117}02117 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02118}02118 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02119}02119 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02120}\mbox{\hyperlink{t4__sge_8c_af4d3457cf55d271db1060586cf481bc0}{02120}} \mbox{\hyperlink{t4__sge_8c_af4d3457cf55d271db1060586cf481bc0}{drain\_wrq\_wr\_list}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__wrq}{sge\_wrq}} *\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02121}02121 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02122}02122         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02123}02123         u\_int available, dbdiff;        \textcolor{comment}{/* \# of hardware descriptors */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02124}02124         u\_int n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02125}02125         \textcolor{keyword}{struct }\mbox{\hyperlink{structwrqe}{wrqe}} *wr;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02126}02126         \textcolor{keyword}{struct }\mbox{\hyperlink{structfw__eth__tx__pkt__wr}{fw\_eth\_tx\_pkt\_wr}} *dst;   \textcolor{comment}{/* any fw WR struct will do */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02127}02127 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02128}02128         \mbox{\hyperlink{adapter_8h_a7d300fab5884e3b6ed0729c089a086af}{EQ\_LOCK\_ASSERT\_OWNED}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02129}02129         MPASS(TAILQ\_EMPTY(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>incomplete\_wrs));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02130}02130         wr = STAILQ\_FIRST(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>wr\_list);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02131}02131         MPASS(wr != NULL);      \textcolor{comment}{/* Must be called with something useful to do */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02132}02132         MPASS(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}} == \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9e8218a79e217563b6ca22792f028b37}{dbidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02133}02133         dbdiff = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02134}02134 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02135}02135         \textcolor{keywordflow}{do} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02136}02136                 \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}} = \mbox{\hyperlink{t4__sge_8c_a573829292f5c253acee129251749445e}{read\_hw\_cidx}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02137}02137                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}} == \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02138}02138                         available = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} -\/ 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02139}02139                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02140}02140                         available = \mbox{\hyperlink{adapter_8h_a5b0f572f7c8db6dac00cfd7f50b8bd43}{IDXDIFF}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}) -\/ 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02141}02141 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02142}02142                 MPASS(wr-\/>\mbox{\hyperlink{structwrqe_a3cfb598f887bf6803b2c87f0b4bf9b70}{wrq}} == \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02143}02143                 n = howmany(wr-\/>\mbox{\hyperlink{structwrqe_ac8eb12326c4600dd05098e83fc42e0a4}{wr\_len}}, \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02144}02144                 \textcolor{keywordflow}{if} (available < n)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02145}02145                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02146}02146 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02147}02147                 dst = (\textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02148}02148                 if (\_\_predict\_true(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} -\/ \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}} > n)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02149}02149                         \textcolor{comment}{/* Won't wrap, won't end exactly at the status page. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02150}02150                         bcopy(\&wr-\/>wr[0], dst, wr-\/>\mbox{\hyperlink{structwrqe_ac8eb12326c4600dd05098e83fc42e0a4}{wr\_len}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02151}02151                         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}} += n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02152}02152                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02153}02153                         \textcolor{keywordtype}{int} first\_portion = (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} -\/ \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}) * \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02154}02154 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02155}02155                         bcopy(\&wr-\/>wr[0], dst, first\_portion);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02156}02156                         \textcolor{keywordflow}{if} (wr-\/>\mbox{\hyperlink{structwrqe_ac8eb12326c4600dd05098e83fc42e0a4}{wr\_len}} > first\_portion) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02157}02157                                 bcopy(\&wr-\/>wr[first\_portion], \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[0],}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02158}02158                                     wr-\/>\mbox{\hyperlink{structwrqe_ac8eb12326c4600dd05098e83fc42e0a4}{wr\_len}} -\/ first\_portion);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02159}02159                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02160}02160                         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}} = n -\/ (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} -\/ \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02161}02161                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02162}02162                 \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_ad62b88613ef7b525e9a9f3104a07bd19}{tx\_wrs\_copied}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02163}02163 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02164}02164                 \textcolor{keywordflow}{if} (available < eq-\/>\mbox{\hyperlink{adapter_8h_ac8cf3df722c7ef870858aa3c1bcfd0c5}{sidx}} / 4 \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02165}02165                     atomic\_cmpset\_int(\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2819002c551a9ffe75310581c86e03f7}{equiq}}, 0, 1)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02166}02166                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02167}02167 \textcolor{comment}{                                 * XXX: This is not 100\% reliable with some}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02168}02168 \textcolor{comment}{                                 * types of WRs.  But this is a very unusual}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02169}02169 \textcolor{comment}{                                 * situation for an ofld/ctrl queue anyway.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02170}02170 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02171}02171                         dst-\/>\mbox{\hyperlink{structfw__eth__tx__pkt__wr_a32064cc75d820febe9458c4ff8c6bd55}{equiq\_to\_len16}} |= htobe32(\mbox{\hyperlink{t4fw__interface_8h_a27558b32efe53f36c94e80c688193b4a}{F\_FW\_WR\_EQUIQ}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02172}02172                             \mbox{\hyperlink{t4fw__interface_8h_a3cfae3ddb468e532b42afef06844a6e9}{F\_FW\_WR\_EQUEQ}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02173}02173                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02174}02174 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02175}02175                 dbdiff += n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02176}02176                 \textcolor{keywordflow}{if} (dbdiff >= 16) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02177}02177                         \mbox{\hyperlink{t4__sge_8c_a891527ea34b168d58d83f44f750ecc92}{ring\_eq\_db}}(sc, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, dbdiff);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02178}02178                         dbdiff = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02179}02179                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02180}02180 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02181}02181                 STAILQ\_REMOVE\_HEAD(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>wr\_list, link);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02182}02182                 \mbox{\hyperlink{adapter_8h_ace17d1b2e15ac91894ca85b098341fe0}{free\_wrqe}}(wr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02183}02183                 MPASS(\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a536349490c06b0ab7b376814550e882e}{nwr\_pending}} > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02184}02184                 \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a536349490c06b0ab7b376814550e882e}{nwr\_pending}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02185}02185                 MPASS(\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a5cecd0aad6989b257a34dcd277c2b83c}{ndesc\_needed}} >= n);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02186}02186                 \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a5cecd0aad6989b257a34dcd277c2b83c}{ndesc\_needed}} -\/= n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02187}02187         \} \textcolor{keywordflow}{while} ((wr = STAILQ\_FIRST(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>wr\_list)) != NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02188}02188 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02189}02189         \textcolor{keywordflow}{if} (dbdiff)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02190}02190                 \mbox{\hyperlink{t4__sge_8c_a891527ea34b168d58d83f44f750ecc92}{ring\_eq\_db}}(sc, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, dbdiff);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02191}02191 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02192}02192 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02193}02193 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02194}02194 \textcolor{comment}{ * Doesn't fail.  Holds on to work requests it can't send right away.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02195}02195 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02196}02196 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02197}\mbox{\hyperlink{adapter_8h_a7353866f04f54348ae377a52cea227db}{02197}} \mbox{\hyperlink{t4__sge_8c_af9aa217f12e8523c1242db50c3a72440}{t4\_wrq\_tx\_locked}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__wrq}{sge\_wrq}} *\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structwrqe}{wrqe}} *wr)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02198}02198 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02199}02199 \textcolor{preprocessor}{\#ifdef INVARIANTS}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02200}02200         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02201}02201 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02202}02202 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02203}02203         \mbox{\hyperlink{adapter_8h_a7d300fab5884e3b6ed0729c089a086af}{EQ\_LOCK\_ASSERT\_OWNED}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02204}02204         MPASS(wr != NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02205}02205         MPASS(wr-\/>\mbox{\hyperlink{structwrqe_ac8eb12326c4600dd05098e83fc42e0a4}{wr\_len}} > 0 \&\& wr-\/>\mbox{\hyperlink{structwrqe_ac8eb12326c4600dd05098e83fc42e0a4}{wr\_len}} <= \mbox{\hyperlink{t4__hw_8h_aabfcbcb5ac86a1edac4035264bc7d2b8a39f5773d0da7e12c9ab3b7eb43307ecd}{SGE\_MAX\_WR\_LEN}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02206}02206         MPASS((wr-\/>\mbox{\hyperlink{structwrqe_ac8eb12326c4600dd05098e83fc42e0a4}{wr\_len}} \& 0x7) == 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02207}02207 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02208}02208         STAILQ\_INSERT\_TAIL(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>wr\_list, wr, link);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02209}02209         \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a536349490c06b0ab7b376814550e882e}{nwr\_pending}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02210}02210         \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a5cecd0aad6989b257a34dcd277c2b83c}{ndesc\_needed}} += howmany(wr-\/>\mbox{\hyperlink{structwrqe_ac8eb12326c4600dd05098e83fc42e0a4}{wr\_len}}, \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02211}02211 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02212}02212         \textcolor{keywordflow}{if} (!TAILQ\_EMPTY(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>incomplete\_wrs))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02213}02213                 \textcolor{keywordflow}{return}; \textcolor{comment}{/* commit\_wrq\_wr will drain wr\_list as well. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02214}02214 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02215}02215         \mbox{\hyperlink{t4__sge_8c_af4d3457cf55d271db1060586cf481bc0}{drain\_wrq\_wr\_list}}(sc, \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02216}02216 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02217}02217         \textcolor{comment}{/* Doorbell must have caught up to the pidx. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02218}02218         MPASS(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}} == \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9e8218a79e217563b6ca22792f028b37}{dbidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02219}02219 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02220}02220 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02221}02221 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02222}\mbox{\hyperlink{adapter_8h_a31005fceb97589dce3db07e8feaf090a}{02222}} \mbox{\hyperlink{t4__sge_8c_aef599aa80fa966efbeafb3edc55a62c6}{t4\_update\_fl\_bufsize}}(\textcolor{keyword}{struct} ifnet *\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02223}02223 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02224}02224         \textcolor{keyword}{struct }\mbox{\hyperlink{structvi__info}{vi\_info}} *vi = \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02225}02225         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = vi-\/>\mbox{\hyperlink{structvi__info_a5ed3e511f61e7116aa53d733d7154130}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02226}02226         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__rxq}{sge\_rxq}} *\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02227}02227 \textcolor{preprocessor}{\#ifdef TCP\_OFFLOAD}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02228}02228         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__ofld__rxq}{sge\_ofld\_rxq}} *ofld\_rxq;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02229}02229 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02230}02230         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02231}02231         \textcolor{keywordtype}{int} i, maxp;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02232}02232 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02233}02233         maxp = \mbox{\hyperlink{t4__sge_8c_ade2dd76db539dc08a367507474c40026}{max\_rx\_payload}}(sc, \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}, \textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02234}02234         \mbox{\hyperlink{adapter_8h_a891752fa1cfd4d9d4eb96b73b7f20757}{for\_each\_rxq}}(vi, i, \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02235}02235                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}} = \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_acf98953f87dbe498d53bcf87c91db6a4}{fl}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02236}02236 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02237}02237                 \mbox{\hyperlink{adapter_8h_a41c2edc639f8438bba380b1698ecb12e}{FL\_LOCK}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02238}02238                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a6c0f6b4778a8154ed2946f64fa6161dd}{zidx}} = \mbox{\hyperlink{t4__sge_8c_ad6dd0b621aa9adaa3937ac3a13d030b5}{find\_refill\_source}}(sc, maxp,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02239}02239                     \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daa0bc2f5c770b6e332fdc75909ee8bb47}{FL\_BUF\_PACKING}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02240}02240                 \mbox{\hyperlink{adapter_8h_a63ce7ce2eb7ddaa4178b03391b6178a5}{FL\_UNLOCK}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02241}02241         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02242}02242 \textcolor{preprocessor}{\#ifdef TCP\_OFFLOAD}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02243}02243         maxp = \mbox{\hyperlink{t4__sge_8c_ade2dd76db539dc08a367507474c40026}{max\_rx\_payload}}(sc, \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}, \textcolor{keyword}{true});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02244}02244         \mbox{\hyperlink{adapter_8h_aab6359de69631a278afe4fd1ddc9aa3d}{for\_each\_ofld\_rxq}}(vi, i, ofld\_rxq) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02245}02245                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}} = \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a5edc83f088fd1080f604605adafd6da0}{fl}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02246}02246 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02247}02247                 \mbox{\hyperlink{adapter_8h_a41c2edc639f8438bba380b1698ecb12e}{FL\_LOCK}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02248}02248                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a6c0f6b4778a8154ed2946f64fa6161dd}{zidx}} = \mbox{\hyperlink{t4__sge_8c_ad6dd0b621aa9adaa3937ac3a13d030b5}{find\_refill\_source}}(sc, maxp,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02249}02249                     \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daa0bc2f5c770b6e332fdc75909ee8bb47}{FL\_BUF\_PACKING}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02250}02250                 \mbox{\hyperlink{adapter_8h_a63ce7ce2eb7ddaa4178b03391b6178a5}{FL\_UNLOCK}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02251}02251         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02252}02252 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02253}02253 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02254}02254 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02255}02255 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02256}\mbox{\hyperlink{t4__sge_8c_a620de1776baac1a496fbfda0f34d8b39}{02256}} \mbox{\hyperlink{t4__sge_8c_a620de1776baac1a496fbfda0f34d8b39}{mbuf\_nsegs}}(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02257}02257 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02258}02258 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02259}02259         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02260}02260         KASSERT(m-\/>m\_pkthdr.inner\_l5hlen > 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02261}02261             (\textcolor{stringliteral}{"{}\%s: mbuf \%p missing information on \# of segments."{}}, \_\_func\_\_, m));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02262}02262 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02263}02263         \textcolor{keywordflow}{return} (m-\/>m\_pkthdr.inner\_l5hlen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02264}02264 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02265}02265 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02266}02266 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02267}\mbox{\hyperlink{t4__sge_8c_aef302e28f4b9174ae2609e389c18ef94}{02267}} \mbox{\hyperlink{t4__sge_8c_aef302e28f4b9174ae2609e389c18ef94}{set\_mbuf\_nsegs}}(\textcolor{keyword}{struct} mbuf *m, uint8\_t nsegs)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02268}02268 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02269}02269 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02270}02270         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02271}02271         m-\/>m\_pkthdr.inner\_l5hlen = nsegs;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02272}02272 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02273}02273 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02274}02274 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02275}\mbox{\hyperlink{t4__sge_8c_ae953eb715e585e362e57c6b64df2fe03}{02275}} \mbox{\hyperlink{t4__sge_8c_ae953eb715e585e362e57c6b64df2fe03}{mbuf\_cflags}}(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02276}02276 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02277}02277 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02278}02278         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02279}02279         \textcolor{keywordflow}{return} (m-\/>m\_pkthdr.PH\_loc.eight[4]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02280}02280 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02281}02281 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02282}02282 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02283}\mbox{\hyperlink{t4__sge_8c_aef0a6ef4e12b2e238fcd93cebd5406bc}{02283}} \mbox{\hyperlink{t4__sge_8c_aef0a6ef4e12b2e238fcd93cebd5406bc}{set\_mbuf\_cflags}}(\textcolor{keyword}{struct} mbuf *m, uint8\_t \mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02284}02284 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02285}02285 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02286}02286         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02287}02287         m-\/>m\_pkthdr.PH\_loc.eight[4] = \mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02288}02288 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02289}02289 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02290}02290 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02291}\mbox{\hyperlink{t4__sge_8c_a62c715deca2b86e88ee28434eebabea4}{02291}} \mbox{\hyperlink{t4__sge_8c_a62c715deca2b86e88ee28434eebabea4}{mbuf\_len16}}(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02292}02292 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02293}02293         \textcolor{keywordtype}{int} n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02294}02294 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02295}02295         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02296}02296         n = m-\/>m\_pkthdr.PH\_loc.eight[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02297}02297         \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{t4__sge_8c_ae953eb715e585e362e57c6b64df2fe03}{mbuf\_cflags}}(m) \& \mbox{\hyperlink{t4__sge_8c_a0b8f49eb708f2da4e7d728702835c8c5}{MC\_TLS}}))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02298}02298                 MPASS(n > 0 \&\& n <= \mbox{\hyperlink{t4__hw_8h_aabfcbcb5ac86a1edac4035264bc7d2b8a39f5773d0da7e12c9ab3b7eb43307ecd}{SGE\_MAX\_WR\_LEN}} / 16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02299}02299 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02300}02300         \textcolor{keywordflow}{return} (n);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02301}02301 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02302}02302 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02303}02303 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02304}\mbox{\hyperlink{t4__sge_8c_aa079f5fcec3d96d99893ba7d946f329a}{02304}} \mbox{\hyperlink{t4__sge_8c_aa079f5fcec3d96d99893ba7d946f329a}{set\_mbuf\_len16}}(\textcolor{keyword}{struct} mbuf *m, uint8\_t len16)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02305}02305 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02306}02306 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02307}02307         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02308}02308         \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{t4__sge_8c_ae953eb715e585e362e57c6b64df2fe03}{mbuf\_cflags}}(m) \& \mbox{\hyperlink{t4__sge_8c_a0b8f49eb708f2da4e7d728702835c8c5}{MC\_TLS}}))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02309}02309                 MPASS(len16 > 0 \&\& len16 <= \mbox{\hyperlink{t4__hw_8h_aabfcbcb5ac86a1edac4035264bc7d2b8a39f5773d0da7e12c9ab3b7eb43307ecd}{SGE\_MAX\_WR\_LEN}} / 16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02310}02310         m-\/>m\_pkthdr.PH\_loc.eight[0] = len16;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02311}02311 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02312}02312 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02313}02313 \textcolor{preprocessor}{\#ifdef RATELIMIT}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02314}02314 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02315}02315 mbuf\_eo\_nsegs(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02316}02316 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02317}02317 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02318}02318         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02319}02319         \textcolor{keywordflow}{return} (m-\/>m\_pkthdr.PH\_loc.eight[1]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02320}02320 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02321}02321 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02322}02322 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02323}02323 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02324}02324 set\_mbuf\_eo\_nsegs(\textcolor{keyword}{struct} mbuf *m, uint8\_t nsegs)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02325}02325 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02326}02326 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02327}02327         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02328}02328         m-\/>m\_pkthdr.PH\_loc.eight[1] = nsegs;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02329}02329 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02330}02330 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02331}02331 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02332}02332 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02333}02333 mbuf\_eo\_len16(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02334}02334 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02335}02335         \textcolor{keywordtype}{int} n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02336}02336 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02337}02337         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02338}02338         n = m-\/>m\_pkthdr.PH\_loc.eight[2];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02339}02339         MPASS(n > 0 \&\& n <= \mbox{\hyperlink{t4__hw_8h_aabfcbcb5ac86a1edac4035264bc7d2b8a39f5773d0da7e12c9ab3b7eb43307ecd}{SGE\_MAX\_WR\_LEN}} / 16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02340}02340 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02341}02341         \textcolor{keywordflow}{return} (n);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02342}02342 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02343}02343 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02344}02344 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02345}02345 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02346}02346 set\_mbuf\_eo\_len16(\textcolor{keyword}{struct} mbuf *m, uint8\_t len16)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02347}02347 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02348}02348 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02349}02349         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02350}02350         m-\/>m\_pkthdr.PH\_loc.eight[2] = len16;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02351}02351 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02352}02352 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02353}02353 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02354}02354 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02355}02355 mbuf\_eo\_tsclk\_tsoff(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02356}02356 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02357}02357 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02358}02358         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02359}02359         \textcolor{keywordflow}{return} (m-\/>m\_pkthdr.PH\_loc.eight[3]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02360}02360 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02361}02361 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02362}02362 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02363}02363 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02364}02364 set\_mbuf\_eo\_tsclk\_tsoff(\textcolor{keyword}{struct} mbuf *m, uint8\_t tsclk\_tsoff)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02365}02365 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02366}02366 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02367}02367         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02368}02368         m-\/>m\_pkthdr.PH\_loc.eight[3] = tsclk\_tsoff;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02369}02369 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02370}02370 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02371}02371 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02372}02372 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02373}02373 needs\_eo(\textcolor{keyword}{struct} m\_snd\_tag *mst)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02374}02374 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02375}02375 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02376}02376         \textcolor{keywordflow}{return} (mst != NULL \&\& mst-\/>sw-\/>type == IF\_SND\_TAG\_TYPE\_RATE\_LIMIT);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02377}02377 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02378}02378 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02379}02379 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02380}02380 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02381}02381 \textcolor{comment}{ * Try to allocate an mbuf to contain a raw work request.  To make it}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02382}02382 \textcolor{comment}{ * easy to construct the work request, don't allocate a chain but a}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02383}02383 \textcolor{comment}{ * single mbuf.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02384}02384 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02385}02385 \textcolor{keyword}{struct }mbuf *}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02386}\mbox{\hyperlink{adapter_8h_a408ba87cbaaef988ca044a5b54039797}{02386}} \mbox{\hyperlink{t4__sge_8c_a4f7963992403dd820fae3260f11596bb}{alloc\_wr\_mbuf}}(\textcolor{keywordtype}{int} len, \textcolor{keywordtype}{int} how)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02387}02387 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02388}02388         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02389}02389 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02390}02390         \textcolor{keywordflow}{if} (len <= MHLEN)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02391}02391                 m = m\_gethdr(how, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02392}02392         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (len <= MCLBYTES)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02393}02393                 m = m\_getcl(how, MT\_DATA, M\_PKTHDR);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02394}02394         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02395}02395                 m = NULL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02396}02396         \textcolor{keywordflow}{if} (m == NULL)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02397}02397                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02398}02398         m-\/>m\_pkthdr.len = len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02399}02399         m-\/>m\_len = len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02400}02400         \mbox{\hyperlink{t4__sge_8c_aef0a6ef4e12b2e238fcd93cebd5406bc}{set\_mbuf\_cflags}}(m, \mbox{\hyperlink{t4__sge_8c_a2ac69895d2a4a0ccd1c370d74f924300}{MC\_RAW\_WR}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02401}02401         \mbox{\hyperlink{t4__sge_8c_aa079f5fcec3d96d99893ba7d946f329a}{set\_mbuf\_len16}}(m, howmany(len, 16));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02402}02402         \textcolor{keywordflow}{return} (m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02403}02403 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02404}02404 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02405}02405 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02406}\mbox{\hyperlink{t4__sge_8c_a76e650c34cc649130b08fa440dc6d90d}{02406}} \mbox{\hyperlink{t4__sge_8c_a76e650c34cc649130b08fa440dc6d90d}{needs\_hwcsum}}(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02407}02407 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02408}02408         \textcolor{keyword}{const} uint32\_t csum\_flags = CSUM\_IP | CSUM\_IP\_UDP | CSUM\_IP\_TCP |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02409}02409             CSUM\_IP\_TSO | CSUM\_INNER\_IP | CSUM\_INNER\_IP\_UDP |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02410}02410             CSUM\_INNER\_IP\_TCP | CSUM\_INNER\_IP\_TSO | CSUM\_IP6\_UDP |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02411}02411             CSUM\_IP6\_TCP | CSUM\_IP6\_TSO | CSUM\_INNER\_IP6\_UDP |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02412}02412             CSUM\_INNER\_IP6\_TCP | CSUM\_INNER\_IP6\_TSO;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02413}02413 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02414}02414         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02415}02415 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02416}02416         \textcolor{keywordflow}{return} (m-\/>m\_pkthdr.csum\_flags \& csum\_flags);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02417}02417 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02418}02418 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02419}02419 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02420}\mbox{\hyperlink{t4__sge_8c_ae6ecacf657295bf32737d5feea989d27}{02420}} \mbox{\hyperlink{t4__sge_8c_ae6ecacf657295bf32737d5feea989d27}{needs\_tso}}(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02421}02421 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02422}02422         \textcolor{keyword}{const} uint32\_t csum\_flags = CSUM\_IP\_TSO | CSUM\_IP6\_TSO |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02423}02423             CSUM\_INNER\_IP\_TSO | CSUM\_INNER\_IP6\_TSO;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02424}02424 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02425}02425         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02426}02426 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02427}02427         \textcolor{keywordflow}{return} (m-\/>m\_pkthdr.csum\_flags \& csum\_flags);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02428}02428 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02429}02429 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02430}02430 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02431}\mbox{\hyperlink{t4__sge_8c_a78d685794cce948b56a160eed329b802}{02431}} \mbox{\hyperlink{t4__sge_8c_a78d685794cce948b56a160eed329b802}{needs\_vxlan\_csum}}(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02432}02432 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02433}02433 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02434}02434         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02435}02435 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02436}02436         \textcolor{keywordflow}{return} (m-\/>m\_pkthdr.csum\_flags \& CSUM\_ENCAP\_VXLAN);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02437}02437 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02438}02438 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02439}02439 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02440}\mbox{\hyperlink{t4__sge_8c_a0f9f4a3fbae2af076602c29fcb5c18ad}{02440}} \mbox{\hyperlink{t4__sge_8c_a0f9f4a3fbae2af076602c29fcb5c18ad}{needs\_vxlan\_tso}}(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02441}02441 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02442}02442         \textcolor{keyword}{const} uint32\_t csum\_flags = CSUM\_ENCAP\_VXLAN | CSUM\_INNER\_IP\_TSO |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02443}02443             CSUM\_INNER\_IP6\_TSO;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02444}02444 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02445}02445         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02446}02446 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02447}02447         \textcolor{keywordflow}{return} ((m-\/>m\_pkthdr.csum\_flags \& csum\_flags) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02448}02448             (m-\/>m\_pkthdr.csum\_flags \& csum\_flags) != CSUM\_ENCAP\_VXLAN);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02449}02449 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02450}02450 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02451}02451 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02452}02452 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02453}02453 needs\_inner\_tcp\_csum(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02454}02454 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02455}02455         \textcolor{keyword}{const} uint32\_t csum\_flags = CSUM\_INNER\_IP\_TSO | CSUM\_INNER\_IP6\_TSO;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02456}02456 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02457}02457         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02458}02458 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02459}02459         \textcolor{keywordflow}{return} (m-\/>m\_pkthdr.csum\_flags \& csum\_flags);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02460}02460 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02461}02461 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02462}02462 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02463}02463 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02464}\mbox{\hyperlink{t4__sge_8c_aaa07d5056bea90cbfdd4861396dcb7c3}{02464}} \mbox{\hyperlink{t4__sge_8c_aaa07d5056bea90cbfdd4861396dcb7c3}{needs\_l3\_csum}}(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02465}02465 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02466}02466         \textcolor{keyword}{const} uint32\_t csum\_flags = CSUM\_IP | CSUM\_IP\_TSO | CSUM\_INNER\_IP |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02467}02467             CSUM\_INNER\_IP\_TSO;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02468}02468 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02469}02469         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02470}02470 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02471}02471         \textcolor{keywordflow}{return} (m-\/>m\_pkthdr.csum\_flags \& csum\_flags);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02472}02472 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02473}02473 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02474}02474 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02475}\mbox{\hyperlink{t4__sge_8c_a86c7655961f22435bf11f5b66a0984bc}{02475}} \mbox{\hyperlink{t4__sge_8c_a86c7655961f22435bf11f5b66a0984bc}{needs\_outer\_tcp\_csum}}(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02476}02476 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02477}02477         \textcolor{keyword}{const} uint32\_t csum\_flags = CSUM\_IP\_TCP | CSUM\_IP\_TSO | CSUM\_IP6\_TCP |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02478}02478             CSUM\_IP6\_TSO;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02479}02479 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02480}02480         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02481}02481 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02482}02482         \textcolor{keywordflow}{return} (m-\/>m\_pkthdr.csum\_flags \& csum\_flags);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02483}02483 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02484}02484 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02485}02485 \textcolor{preprocessor}{\#ifdef RATELIMIT}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02486}02486 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02487}02487 needs\_outer\_l4\_csum(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02488}02488 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02489}02489         \textcolor{keyword}{const} uint32\_t csum\_flags = CSUM\_IP\_UDP | CSUM\_IP\_TCP | CSUM\_IP\_TSO |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02490}02490             CSUM\_IP6\_UDP | CSUM\_IP6\_TCP | CSUM\_IP6\_TSO;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02491}02491 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02492}02492         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02493}02493 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02494}02494         \textcolor{keywordflow}{return} (m-\/>m\_pkthdr.csum\_flags \& csum\_flags);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02495}02495 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02496}02496 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02497}02497 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02498}02498 needs\_outer\_udp\_csum(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02499}02499 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02500}02500         \textcolor{keyword}{const} uint32\_t csum\_flags = CSUM\_IP\_UDP | CSUM\_IP6\_UDP;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02501}02501 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02502}02502         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02503}02503 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02504}02504         \textcolor{keywordflow}{return} (m-\/>m\_pkthdr.csum\_flags \& csum\_flags);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02505}02505 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02506}02506 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02507}02507 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02508}02508 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02509}\mbox{\hyperlink{t4__sge_8c_a94a7316babc844729e5be67779bf1485}{02509}} \mbox{\hyperlink{t4__sge_8c_a94a7316babc844729e5be67779bf1485}{needs\_vlan\_insertion}}(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02510}02510 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02511}02511 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02512}02512         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02513}02513 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02514}02514         \textcolor{keywordflow}{return} (m-\/>m\_flags \& M\_VLANTAG);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02515}02515 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02516}02516 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02517}02517 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02518}02518 \textcolor{keyword}{static} \textcolor{keywordtype}{void} *}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02519}02519 m\_advance(\textcolor{keyword}{struct} mbuf **pm, \textcolor{keywordtype}{int} *poffset, \textcolor{keywordtype}{int} len)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02520}02520 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02521}02521         \textcolor{keyword}{struct }mbuf *m = *pm;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02522}02522         \textcolor{keywordtype}{int} offset = *poffset;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02523}02523         uintptr\_t p = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02524}02524 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02525}02525         MPASS(len > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02526}02526 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02527}02527         \textcolor{keywordflow}{for} (;;) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02528}02528                 \textcolor{keywordflow}{if} (offset + len < m-\/>m\_len) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02529}02529                         offset += len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02530}02530                         p = mtod(m, uintptr\_t) + offset;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02531}02531                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02532}02532                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02533}02533                 len -\/= m-\/>m\_len -\/ offset;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02534}02534                 m = m-\/>m\_next;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02535}02535                 offset = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02536}02536                 MPASS(m != NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02537}02537         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02538}02538         *poffset = offset;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02539}02539         *pm = m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02540}02540         \textcolor{keywordflow}{return} ((\textcolor{keywordtype}{void} *)p);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02541}02541 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02542}02542 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02543}02543 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02544}02544 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02545}\mbox{\hyperlink{t4__sge_8c_a9909f1a86d0938097aa1fc165a6952ed}{02545}} \mbox{\hyperlink{t4__sge_8c_a9909f1a86d0938097aa1fc165a6952ed}{count\_mbuf\_ext\_pgs}}(\textcolor{keyword}{struct} mbuf *m, \textcolor{keywordtype}{int} skip, vm\_paddr\_t *nextaddr)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02546}02546 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02547}02547         vm\_paddr\_t paddr;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02548}02548         \textcolor{keywordtype}{int} i, len, off, pglen, pgoff, seglen, segoff;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02549}02549         \textcolor{keywordtype}{int} nsegs = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02550}02550 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02551}02551         M\_ASSERTEXTPG(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02552}02552         off = mtod(m, vm\_offset\_t);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02553}02553         len = m-\/>m\_len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02554}02554         off += skip;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02555}02555         len -\/= skip;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02556}02556 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02557}02557         \textcolor{keywordflow}{if} (m-\/>m\_epg\_hdrlen != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02558}02558                 \textcolor{keywordflow}{if} (off >= m-\/>m\_epg\_hdrlen) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02559}02559                         off -\/= m-\/>m\_epg\_hdrlen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02560}02560                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02561}02561                         seglen = m-\/>m\_epg\_hdrlen -\/ off;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02562}02562                         segoff = off;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02563}02563                         seglen = min(seglen, len);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02564}02564                         off = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02565}02565                         len -\/= seglen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02566}02566                         paddr = pmap\_kextract(}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02567}02567                             (vm\_offset\_t)\&m-\/>m\_epg\_hdr[segoff]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02568}02568                         \textcolor{keywordflow}{if} (*nextaddr != paddr)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02569}02569                                 nsegs++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02570}02570                         *nextaddr = paddr + seglen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02571}02571                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02572}02572         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02573}02573         pgoff = m-\/>m\_epg\_1st\_off;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02574}02574         \textcolor{keywordflow}{for} (i = 0; i < m-\/>m\_epg\_npgs \&\& len > 0; i++) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02575}02575                 pglen = m\_epg\_pagelen(m, i, pgoff);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02576}02576                 \textcolor{keywordflow}{if} (off >= pglen) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02577}02577                         off -\/= pglen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02578}02578                         pgoff = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02579}02579                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02580}02580                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02581}02581                 seglen = pglen -\/ off;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02582}02582                 segoff = pgoff + off;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02583}02583                 off = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02584}02584                 seglen = min(seglen, len);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02585}02585                 len -\/= seglen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02586}02586                 paddr = m-\/>m\_epg\_pa[i] + segoff;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02587}02587                 \textcolor{keywordflow}{if} (*nextaddr != paddr)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02588}02588                         nsegs++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02589}02589                 *nextaddr = paddr + seglen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02590}02590                 pgoff = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02591}02591         \};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02592}02592         \textcolor{keywordflow}{if} (len != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02593}02593                 seglen = min(len, m-\/>m\_epg\_trllen -\/ off);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02594}02594                 len -\/= seglen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02595}02595                 paddr = pmap\_kextract((vm\_offset\_t)\&m-\/>m\_epg\_trail[off]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02596}02596                 \textcolor{keywordflow}{if} (*nextaddr != paddr)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02597}02597                         nsegs++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02598}02598                 *nextaddr = paddr + seglen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02599}02599         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02600}02600 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02601}02601         \textcolor{keywordflow}{return} (nsegs);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02602}02602 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02603}02603 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02604}02604 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02605}02605 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02606}02606 \textcolor{comment}{ * Can deal with empty mbufs in the chain that have m\_len = 0, but the chain}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02607}02607 \textcolor{comment}{ * must have at least one mbuf that's not empty.  It is possible for this}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02608}02608 \textcolor{comment}{ * routine to return 0 if skip accounts for all the contents of the mbuf chain.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02609}02609 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02610}02610 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02611}\mbox{\hyperlink{t4__sge_8c_a37ddb2848c17eddc5889807252d1cc46}{02611}} \mbox{\hyperlink{t4__sge_8c_a37ddb2848c17eddc5889807252d1cc46}{count\_mbuf\_nsegs}}(\textcolor{keyword}{struct} mbuf *m, \textcolor{keywordtype}{int} skip, uint8\_t *cflags)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02612}02612 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02613}02613         vm\_paddr\_t nextaddr, paddr;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02614}02614         vm\_offset\_t va;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02615}02615         \textcolor{keywordtype}{int} len, nsegs;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02616}02616 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02617}02617         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02618}02618         MPASS(m-\/>m\_pkthdr.len > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02619}02619         MPASS(m-\/>m\_pkthdr.len >= skip);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02620}02620 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02621}02621         nsegs = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02622}02622         nextaddr = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02623}02623         \textcolor{keywordflow}{for} (; m; m = m-\/>m\_next) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02624}02624                 len = m-\/>m\_len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02625}02625                 \textcolor{keywordflow}{if} (\_\_predict\_false(len == 0))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02626}02626                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02627}02627                 \textcolor{keywordflow}{if} (skip >= len) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02628}02628                         skip -\/= len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02629}02629                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02630}02630                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02631}02631                 \textcolor{keywordflow}{if} ((m-\/>m\_flags \& M\_EXTPG) != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02632}02632                         *cflags |= \mbox{\hyperlink{t4__sge_8c_a4353f1e1a017e811c6a8f5b0627da2fb}{MC\_NOMAP}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02633}02633                         nsegs += \mbox{\hyperlink{t4__sge_8c_a9909f1a86d0938097aa1fc165a6952ed}{count\_mbuf\_ext\_pgs}}(m, skip, \&nextaddr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02634}02634                         skip = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02635}02635                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02636}02636                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02637}02637                 va = mtod(m, vm\_offset\_t) + skip;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02638}02638                 len -\/= skip;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02639}02639                 skip = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02640}02640                 paddr = pmap\_kextract(va);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02641}02641                 nsegs += sglist\_count((\textcolor{keywordtype}{void} *)(uintptr\_t)va, len);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02642}02642                 \textcolor{keywordflow}{if} (paddr == nextaddr)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02643}02643                         nsegs-\/-\/;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02644}02644                 nextaddr = pmap\_kextract(va + len -\/ 1) + 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02645}02645         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02646}02646 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02647}02647         \textcolor{keywordflow}{return} (nsegs);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02648}02648 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02649}02649 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02650}02650 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02651}02651 \textcolor{comment}{ * The maximum number of segments that can fit in a WR.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02652}02652 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02653}02653 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02654}\mbox{\hyperlink{t4__sge_8c_a500e95bfc28f66ad001142a0d4d64257}{02654}} \mbox{\hyperlink{t4__sge_8c_a500e95bfc28f66ad001142a0d4d64257}{max\_nsegs\_allowed}}(\textcolor{keyword}{struct} mbuf *m, \textcolor{keywordtype}{bool} vm\_wr)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02655}02655 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02656}02656 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02657}02657         \textcolor{keywordflow}{if} (vm\_wr) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02658}02658                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ae6ecacf657295bf32737d5feea989d27}{needs\_tso}}(m))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02659}02659                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf8481a7442dd5faa25d4e830b42e02f2}{TX\_SGL\_SEGS\_VM\_TSO}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02660}02660                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba2d14146d1f5e1f05ce8df1af6cd2b67f}{TX\_SGL\_SEGS\_VM}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02661}02661         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02662}02662 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02663}02663         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ae6ecacf657295bf32737d5feea989d27}{needs\_tso}}(m)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02664}02664                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a0f9f4a3fbae2af076602c29fcb5c18ad}{needs\_vxlan\_tso}}(m))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02665}02665                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55badc79dee89d1e8ffb6d1d0342635dec4c}{TX\_SGL\_SEGS\_VXLAN\_TSO}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02666}02666                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02667}02667                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba30eff5bac172aab10eaa29a5134b87e2}{TX\_SGL\_SEGS\_TSO}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02668}02668         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02669}02669 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02670}02670         \textcolor{keywordflow}{return} (\mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baebfd86cf2e6a67f67be7e8954ddf5af7}{TX\_SGL\_SEGS}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02671}02671 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02672}02672 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02673}\mbox{\hyperlink{t4__sge_8c_abef3bf8dcf47cdc2d88cd984c5829ef3}{02673}} \textcolor{keyword}{static} \textcolor{keyword}{struct }timeval \mbox{\hyperlink{t4__sge_8c_abef3bf8dcf47cdc2d88cd984c5829ef3}{txerr\_ratecheck}} = \{0\};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02674}\mbox{\hyperlink{t4__sge_8c_ac25fa6d0c585df4009db64790d8eda26}{02674}} \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }timeval \mbox{\hyperlink{t4__sge_8c_ac25fa6d0c585df4009db64790d8eda26}{txerr\_interval}} = \{3, 0\};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02675}02675 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02676}02676 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02677}02677 \textcolor{comment}{ * Analyze the mbuf to determine its tx needs.  The mbuf passed in may change:}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02678}02678 \textcolor{comment}{ * a) caller can assume it's been freed if this function returns with an error.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02679}02679 \textcolor{comment}{ * b) it may get defragged up if the gather list is too long for the hardware.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02680}02680 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02681}02681 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02682}\mbox{\hyperlink{adapter_8h_a2020567dbbc61acb56af220eac804a50}{02682}} \mbox{\hyperlink{t4__sge_8c_a7289eee24858a078b4de959bbc3495e4}{parse\_pkt}}(\textcolor{keyword}{struct} mbuf **mp, \textcolor{keywordtype}{bool} vm\_wr)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02683}02683 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02684}02684         \textcolor{keyword}{struct }mbuf *m0 = *mp, *m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02685}02685         \textcolor{keywordtype}{int} rc, nsegs, defragged = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02686}02686         \textcolor{keyword}{struct }ether\_header *eh;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02687}02687 \textcolor{preprocessor}{\#ifdef INET}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02688}02688         \textcolor{keywordtype}{void} *l3hdr;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02689}02689 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02690}02690 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02691}02691         \textcolor{keywordtype}{int} offset;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02692}02692         \textcolor{keyword}{struct }tcphdr *tcp;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02693}02693 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02694}02694 \textcolor{preprocessor}{\#if defined(KERN\_TLS) || defined(RATELIMIT)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02695}02695         \textcolor{keyword}{struct }m\_snd\_tag *mst;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02696}02696 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02697}02697         uint16\_t eh\_type;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02698}02698         uint8\_t cflags;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02699}02699 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02700}02700         cflags = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02701}02701         M\_ASSERTPKTHDR(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02702}02702         \textcolor{keywordflow}{if} (\_\_predict\_false(m0-\/>m\_pkthdr.len < ETHER\_HDR\_LEN)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02703}02703                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02704}02704 fail:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02705}02705                 m\_freem(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02706}02706                 *mp = NULL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02707}02707                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02708}02708         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02709}02709 restart:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02710}02710         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02711}02711 \textcolor{comment}{         * First count the number of gather list segments in the payload.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02712}02712 \textcolor{comment}{         * Defrag the mbuf if nsegs exceeds the hardware limit.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02713}02713 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02714}02714         M\_ASSERTPKTHDR(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02715}02715         MPASS(m0-\/>m\_pkthdr.len > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02716}02716         nsegs = \mbox{\hyperlink{t4__sge_8c_a37ddb2848c17eddc5889807252d1cc46}{count\_mbuf\_nsegs}}(m0, 0, \&cflags);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02717}02717 \textcolor{preprocessor}{\#if defined(KERN\_TLS) || defined(RATELIMIT)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02718}02718         \textcolor{keywordflow}{if} (m0-\/>m\_pkthdr.csum\_flags \& CSUM\_SND\_TAG)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02719}02719                 mst = m0-\/>m\_pkthdr.snd\_tag;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02720}02720         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02721}02721                 mst = NULL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02722}02722 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02723}02723 \textcolor{preprocessor}{\#ifdef KERN\_TLS}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02724}02724         \textcolor{keywordflow}{if} (mst != NULL \&\& mst-\/>sw-\/>type == IF\_SND\_TAG\_TYPE\_TLS) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02725}02725                 \textcolor{keywordtype}{int} len16;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02726}02726 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02727}02727                 cflags |= \mbox{\hyperlink{t4__sge_8c_a0b8f49eb708f2da4e7d728702835c8c5}{MC\_TLS}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02728}02728                 \mbox{\hyperlink{t4__sge_8c_aef0a6ef4e12b2e238fcd93cebd5406bc}{set\_mbuf\_cflags}}(m0, cflags);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02729}02729                 rc = \mbox{\hyperlink{t4__kern__tls_8c_a836530817f9a909ea61583c1dae59604}{t6\_ktls\_parse\_pkt}}(m0, \&nsegs, \&len16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02730}02730                 \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02731}02731                         \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02732}02732                 \mbox{\hyperlink{t4__sge_8c_aef302e28f4b9174ae2609e389c18ef94}{set\_mbuf\_nsegs}}(m0, nsegs);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02733}02733                 \mbox{\hyperlink{t4__sge_8c_aa079f5fcec3d96d99893ba7d946f329a}{set\_mbuf\_len16}}(m0, len16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02734}02734                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02735}02735         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02736}02736 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02737}02737         \textcolor{keywordflow}{if} (nsegs > \mbox{\hyperlink{t4__sge_8c_a500e95bfc28f66ad001142a0d4d64257}{max\_nsegs\_allowed}}(m0, vm\_wr)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02738}02738                 \textcolor{keywordflow}{if} (defragged++ > 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02739}02739                         rc = EFBIG;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02740}02740                         \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02741}02741                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02742}02742                 counter\_u64\_add(\mbox{\hyperlink{t4__sge_8c_abc3e9b6ba5b5e166a75ad1078bda20c5}{defrags}}, 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02743}02743                 \textcolor{keywordflow}{if} ((m = m\_defrag(m0, M\_NOWAIT)) == NULL) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02744}02744                         rc = ENOMEM;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02745}02745                         \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02746}02746                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02747}02747                 *mp = m0 = m;   \textcolor{comment}{/* update caller's copy after defrag */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02748}02748                 \textcolor{keywordflow}{goto} restart;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02749}02749         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02750}02750 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02751}02751         \textcolor{keywordflow}{if} (\_\_predict\_false(nsegs > 2 \&\& m0-\/>m\_pkthdr.len <= MHLEN \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02752}02752             !(cflags \& \mbox{\hyperlink{t4__sge_8c_a4353f1e1a017e811c6a8f5b0627da2fb}{MC\_NOMAP}}))) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02753}02753                 counter\_u64\_add(\mbox{\hyperlink{t4__sge_8c_a09a7a7db03ceddf0aec5404858b5274d}{pullups}}, 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02754}02754                 m0 = m\_pullup(m0, m0-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02755}02755                 \textcolor{keywordflow}{if} (m0 == NULL) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02756}02756                         \textcolor{comment}{/* Should have left well enough alone. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02757}02757                         rc = EFBIG;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02758}02758                         \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02759}02759                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02760}02760                 *mp = m0;       \textcolor{comment}{/* update caller's copy after pullup */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02761}02761                 \textcolor{keywordflow}{goto} restart;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02762}02762         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02763}02763         \mbox{\hyperlink{t4__sge_8c_aef302e28f4b9174ae2609e389c18ef94}{set\_mbuf\_nsegs}}(m0, nsegs);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02764}02764         \mbox{\hyperlink{t4__sge_8c_aef0a6ef4e12b2e238fcd93cebd5406bc}{set\_mbuf\_cflags}}(m0, cflags);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02765}02765         \mbox{\hyperlink{t4__sge_8c_a5d566c57475924b2da78ff5946c44365}{calculate\_mbuf\_len16}}(m0, vm\_wr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02766}02766 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02767}02767 \textcolor{preprocessor}{\#ifdef RATELIMIT}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02768}02768         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02769}02769 \textcolor{comment}{         * Ethofld is limited to TCP and UDP for now, and only when L4 hw}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02770}02770 \textcolor{comment}{         * checksumming is enabled.  needs\_outer\_l4\_csum happens to check for}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02771}02771 \textcolor{comment}{         * all the right things.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02772}02772 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02773}02773         \textcolor{keywordflow}{if} (\_\_predict\_false(needs\_eo(mst) \&\& !needs\_outer\_l4\_csum(m0))) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02774}02774                 m\_snd\_tag\_rele(m0-\/>m\_pkthdr.snd\_tag);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02775}02775                 m0-\/>m\_pkthdr.snd\_tag = NULL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02776}02776                 m0-\/>m\_pkthdr.csum\_flags \&= \string~CSUM\_SND\_TAG;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02777}02777                 mst = NULL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02778}02778         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02779}02779 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02780}02780 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02781}02781         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{t4__sge_8c_a76e650c34cc649130b08fa440dc6d90d}{needs\_hwcsum}}(m0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02782}02782 \#ifdef RATELIMIT}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02783}02783                  \&\& !needs\_eo(mst)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02784}02784 \#endif}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02785}02785         )}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02786}02786                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02787}02787 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02788}02788         m = m0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02789}02789         eh = mtod(m, \textcolor{keyword}{struct} ether\_header *);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02790}02790         eh\_type = ntohs(eh-\/>ether\_type);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02791}02791         \textcolor{keywordflow}{if} (eh\_type == ETHERTYPE\_VLAN) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02792}02792                 \textcolor{keyword}{struct }ether\_vlan\_header *evh = (\textcolor{keywordtype}{void} *)eh;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02793}02793 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02794}02794                 eh\_type = ntohs(evh-\/>evl\_proto);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02795}02795                 m0-\/>m\_pkthdr.l2hlen = \textcolor{keyword}{sizeof}(*evh);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02796}02796         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02797}02797                 m0-\/>m\_pkthdr.l2hlen = \textcolor{keyword}{sizeof}(*eh);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02798}02798 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02799}02799 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02800}02800         offset = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02801}02801 \textcolor{preprocessor}{\#ifdef INET}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02802}02802         l3hdr = m\_advance(\&m, \&offset, m0-\/>m\_pkthdr.l2hlen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02803}02803 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02804}02804         m\_advance(\&m, \&offset, m0-\/>m\_pkthdr.l2hlen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02805}02805 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02806}02806 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02807}02807 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02808}02808         \textcolor{keywordflow}{switch} (eh\_type) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02809}02809 \textcolor{preprocessor}{\#ifdef INET6}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02810}02810         \textcolor{keywordflow}{case} ETHERTYPE\_IPV6:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02811}02811                 m0-\/>m\_pkthdr.l3hlen = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }ip6\_hdr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02812}02812                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02813}02813 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02814}02814 \textcolor{preprocessor}{\#ifdef INET}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02815}02815         \textcolor{keywordflow}{case} ETHERTYPE\_IP:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02816}02816         \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02817}02817                 \textcolor{keyword}{struct }ip *ip = l3hdr;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02818}02818 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02819}02819                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a78d685794cce948b56a160eed329b802}{needs\_vxlan\_csum}}(m0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02820}02820                         \textcolor{comment}{/* Driver will do the outer IP hdr checksum. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02821}02821                         ip-\/>ip\_sum = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02822}02822                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a0f9f4a3fbae2af076602c29fcb5c18ad}{needs\_vxlan\_tso}}(m0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02823}02823                                 \textcolor{keyword}{const} uint16\_t ipl = ip-\/>ip\_len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02824}02824 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02825}02825                                 ip-\/>ip\_len = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02826}02826                                 ip-\/>ip\_sum = \string~in\_cksum\_hdr(ip);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02827}02827                                 ip-\/>ip\_len = ipl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02828}02828                         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02829}02829                                 ip-\/>ip\_sum = in\_cksum\_hdr(ip);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02830}02830                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02831}02831                 m0-\/>m\_pkthdr.l3hlen = ip-\/>ip\_hl << 2;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02832}02832                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02833}02833         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02834}02834 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02835}02835         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02836}02836                 \textcolor{keywordflow}{if} (ratecheck(\&\mbox{\hyperlink{t4__sge_8c_abef3bf8dcf47cdc2d88cd984c5829ef3}{txerr\_ratecheck}}, \&\mbox{\hyperlink{t4__sge_8c_ac25fa6d0c585df4009db64790d8eda26}{txerr\_interval}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02837}02837                         log(LOG\_ERR, \textcolor{stringliteral}{"{}\%s: ethertype 0x\%04x unknown.  "{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02838}02838                             \textcolor{stringliteral}{"{}if\_cxgbe must be compiled with the same "{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02839}02839                             \textcolor{stringliteral}{"{}INET/INET6 options as the kernel.\(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02840}02840                             eh\_type);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02841}02841                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02842}02842                 rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02843}02843                 \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02844}02844         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02845}02845 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02846}02846 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02847}02847         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a78d685794cce948b56a160eed329b802}{needs\_vxlan\_csum}}(m0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02848}02848                 m0-\/>m\_pkthdr.l4hlen = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }udphdr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02849}02849                 m0-\/>m\_pkthdr.l5hlen = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }vxlan\_header);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02850}02850 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02851}02851                 \textcolor{comment}{/* Inner headers. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02852}02852                 eh = m\_advance(\&m, \&offset, m0-\/>m\_pkthdr.l3hlen +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02853}02853                     \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} udphdr) + \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} vxlan\_header));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02854}02854                 eh\_type = ntohs(eh-\/>ether\_type);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02855}02855                 \textcolor{keywordflow}{if} (eh\_type == ETHERTYPE\_VLAN) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02856}02856                         \textcolor{keyword}{struct }ether\_vlan\_header *evh = (\textcolor{keywordtype}{void} *)eh;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02857}02857 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02858}02858                         eh\_type = ntohs(evh-\/>evl\_proto);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02859}02859                         m0-\/>m\_pkthdr.inner\_l2hlen = \textcolor{keyword}{sizeof}(*evh);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02860}02860                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02861}02861                         m0-\/>m\_pkthdr.inner\_l2hlen = \textcolor{keyword}{sizeof}(*eh);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02862}02862 \textcolor{preprocessor}{\#ifdef INET}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02863}02863                 l3hdr = m\_advance(\&m, \&offset, m0-\/>m\_pkthdr.inner\_l2hlen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02864}02864 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02865}02865                 m\_advance(\&m, \&offset, m0-\/>m\_pkthdr.inner\_l2hlen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02866}02866 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02867}02867 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02868}02868                 \textcolor{keywordflow}{switch} (eh\_type) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02869}02869 \textcolor{preprocessor}{\#ifdef INET6}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02870}02870                 \textcolor{keywordflow}{case} ETHERTYPE\_IPV6:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02871}02871                         m0-\/>m\_pkthdr.inner\_l3hlen = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }ip6\_hdr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02872}02872                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02873}02873 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02874}02874 \textcolor{preprocessor}{\#ifdef INET}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02875}02875                 \textcolor{keywordflow}{case} ETHERTYPE\_IP:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02876}02876                 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02877}02877                         \textcolor{keyword}{struct }ip *ip = l3hdr;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02878}02878 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02879}02879                         m0-\/>m\_pkthdr.inner\_l3hlen = ip-\/>ip\_hl << 2;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02880}02880                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02881}02881                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02882}02882 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02883}02883                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02884}02884                         \textcolor{keywordflow}{if} (ratecheck(\&\mbox{\hyperlink{t4__sge_8c_abef3bf8dcf47cdc2d88cd984c5829ef3}{txerr\_ratecheck}}, \&\mbox{\hyperlink{t4__sge_8c_ac25fa6d0c585df4009db64790d8eda26}{txerr\_interval}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02885}02885                                 log(LOG\_ERR, \textcolor{stringliteral}{"{}\%s: VXLAN hw offload requested"{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02886}02886                                     \textcolor{stringliteral}{"{}with unknown ethertype 0x\%04x.  if\_cxgbe "{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02887}02887                                     \textcolor{stringliteral}{"{}must be compiled with the same INET/INET6 "{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02888}02888                                     \textcolor{stringliteral}{"{}options as the kernel.\(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02889}02889                                     eh\_type);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02890}02890                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02891}02891                         rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02892}02892                         \textcolor{keywordflow}{goto} fail;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02893}02893                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02894}02894                 \textcolor{keywordflow}{if} (needs\_inner\_tcp\_csum(m0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02895}02895                         tcp = m\_advance(\&m, \&offset, m0-\/>m\_pkthdr.inner\_l3hlen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02896}02896                         m0-\/>m\_pkthdr.inner\_l4hlen = tcp-\/>th\_off * 4;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02897}02897                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02898}02898                 MPASS((m0-\/>m\_pkthdr.csum\_flags \& CSUM\_SND\_TAG) == 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02899}02899                 m0-\/>m\_pkthdr.csum\_flags \&= CSUM\_INNER\_IP6\_UDP |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02900}02900                     CSUM\_INNER\_IP6\_TCP | CSUM\_INNER\_IP6\_TSO | CSUM\_INNER\_IP |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02901}02901                     CSUM\_INNER\_IP\_UDP | CSUM\_INNER\_IP\_TCP | CSUM\_INNER\_IP\_TSO |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02902}02902                     CSUM\_ENCAP\_VXLAN;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02903}02903         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02904}02904 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02905}02905         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a86c7655961f22435bf11f5b66a0984bc}{needs\_outer\_tcp\_csum}}(m0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02906}02906                 tcp = m\_advance(\&m, \&offset, m0-\/>m\_pkthdr.l3hlen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02907}02907                 m0-\/>m\_pkthdr.l4hlen = tcp-\/>th\_off * 4;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02908}02908 \textcolor{preprocessor}{\#ifdef RATELIMIT}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02909}02909                 \textcolor{keywordflow}{if} (tsclk >= 0 \&\& *(uint32\_t *)(tcp + 1) == ntohl(0x0101080a)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02910}02910                         set\_mbuf\_eo\_tsclk\_tsoff(m0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02911}02911                             \mbox{\hyperlink{t4fw__interface_8h_abba845df9558d00ee25a6257022461d6}{V\_FW\_ETH\_TX\_EO\_WR\_TSCLK}}(tsclk) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02912}02912                             \mbox{\hyperlink{t4fw__interface_8h_a01cef28831b2f4a7429cc97deab1a1de}{V\_FW\_ETH\_TX\_EO\_WR\_TSOFF}}(\textcolor{keyword}{sizeof}(*tcp) / 2 + 1));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02913}02913                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02914}02914                         set\_mbuf\_eo\_tsclk\_tsoff(m0, 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02915}02915         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (needs\_outer\_udp\_csum(m0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02916}02916                 m0-\/>m\_pkthdr.l4hlen = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }udphdr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02917}02917 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02918}02918         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02919}02919 \textcolor{preprocessor}{\#ifdef RATELIMIT}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02920}02920         \textcolor{keywordflow}{if} (needs\_eo(mst)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02921}02921                 u\_int immhdrs;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02922}02922 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02923}02923                 \textcolor{comment}{/* EO WRs have the headers in the WR and not the GL. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02924}02924                 immhdrs = m0-\/>m\_pkthdr.l2hlen + m0-\/>m\_pkthdr.l3hlen +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02925}02925                     m0-\/>m\_pkthdr.l4hlen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02926}02926                 cflags = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02927}02927                 nsegs = \mbox{\hyperlink{t4__sge_8c_a37ddb2848c17eddc5889807252d1cc46}{count\_mbuf\_nsegs}}(m0, immhdrs, \&cflags);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02928}02928                 MPASS(cflags == \mbox{\hyperlink{t4__sge_8c_ae953eb715e585e362e57c6b64df2fe03}{mbuf\_cflags}}(m0));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02929}02929                 set\_mbuf\_eo\_nsegs(m0, nsegs);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02930}02930                 set\_mbuf\_eo\_len16(m0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02931}02931                     txpkt\_eo\_len16(nsegs, immhdrs, \mbox{\hyperlink{t4__sge_8c_ae6ecacf657295bf32737d5feea989d27}{needs\_tso}}(m0)));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02932}02932         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02933}02933 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02934}02934 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02935}02935         MPASS(m0 == *mp);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02936}02936         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02937}02937 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02938}02938 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02939}02939 \textcolor{keywordtype}{void} *}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02940}\mbox{\hyperlink{adapter_8h_adf4e0c6beb2bcf7a480b68d7a7f7fa84}{02940}} \mbox{\hyperlink{t4__sge_8c_ad86cf314f5368b406537a2ea86922004}{start\_wrq\_wr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__wrq}{sge\_wrq}} *\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}, \textcolor{keywordtype}{int} len16, \textcolor{keyword}{struct} \mbox{\hyperlink{structwrq__cookie}{wrq\_cookie}} *cookie)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02941}02941 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02942}02942         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02943}02943         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a7c38e3751f35cbee8834f2cb3c8e2156}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02944}02944         \textcolor{keywordtype}{int} ndesc, available;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02945}02945         \textcolor{keyword}{struct }\mbox{\hyperlink{structwrqe}{wrqe}} *wr;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02946}02946         \textcolor{keywordtype}{void} *w;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02947}02947 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02948}02948         MPASS(len16 > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02949}02949         ndesc = \mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(len16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02950}02950         MPASS(ndesc > 0 \&\& ndesc <= \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba3aa6bc0c73a01553747a2f051f03aab3}{SGE\_MAX\_WR\_NDESC}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02951}02951 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02952}02952         \mbox{\hyperlink{adapter_8h_aa342afce2bb63960ab2e3e1b4e3d45f2}{EQ\_LOCK}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02953}02953 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02954}02954         \textcolor{keywordflow}{if} (TAILQ\_EMPTY(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>incomplete\_wrs) \&\& !STAILQ\_EMPTY(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>wr\_list))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02955}02955                 \mbox{\hyperlink{t4__sge_8c_af4d3457cf55d271db1060586cf481bc0}{drain\_wrq\_wr\_list}}(sc, \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02956}02956 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02957}02957         \textcolor{keywordflow}{if} (!STAILQ\_EMPTY(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>wr\_list)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02958}02958 slowpath:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02959}02959                 \mbox{\hyperlink{adapter_8h_a91b79109ac65aad761a86bd3bdeaa2b6}{EQ\_UNLOCK}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02960}02960                 wr = \mbox{\hyperlink{adapter_8h_a156965b6cde0ffc7ba0879e596a164bd}{alloc\_wrqe}}(len16 * 16, \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02961}02961                 \textcolor{keywordflow}{if} (\_\_predict\_false(wr == NULL))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02962}02962                         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02963}02963                 cookie-\/>\mbox{\hyperlink{structwrq__cookie_a57f89dcae07456c9bb54195211f4351d}{pidx}} = -\/1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02964}02964                 cookie-\/>\mbox{\hyperlink{structwrq__cookie_a6bb346e336b05a0e1fd4913e0ad01658}{ndesc}} = ndesc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02965}02965                 \textcolor{keywordflow}{return} (\&wr-\/>wr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02966}02966         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02967}02967 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02968}02968         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}} = \mbox{\hyperlink{t4__sge_8c_a573829292f5c253acee129251749445e}{read\_hw\_cidx}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02969}02969         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}} == \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02970}02970                 available = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} -\/ 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02971}02971         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02972}02972                 available = \mbox{\hyperlink{adapter_8h_a5b0f572f7c8db6dac00cfd7f50b8bd43}{IDXDIFF}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}) -\/ 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02973}02973         \textcolor{keywordflow}{if} (available < ndesc)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02974}02974                 \textcolor{keywordflow}{goto} slowpath;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02975}02975 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02976}02976         cookie-\/>\mbox{\hyperlink{structwrq__cookie_a57f89dcae07456c9bb54195211f4351d}{pidx}} = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02977}02977         cookie-\/>\mbox{\hyperlink{structwrq__cookie_a6bb346e336b05a0e1fd4913e0ad01658}{ndesc}} = ndesc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02978}02978         TAILQ\_INSERT\_TAIL(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>incomplete\_wrs, cookie, link);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02979}02979 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02980}02980         w = \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02981}02981         \mbox{\hyperlink{adapter_8h_aae3f128a52e3e78cf595539bb66425c7}{IDXINCR}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}, ndesc, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02982}02982         \textcolor{keywordflow}{if} (\_\_predict\_false(cookie-\/>\mbox{\hyperlink{structwrq__cookie_a57f89dcae07456c9bb54195211f4351d}{pidx}} + ndesc > \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02983}02983                 w = \&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_ac1de799ec333fbdc97355be714c58545}{ss}}[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02984}02984                 \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a99dbba08ee8b7ca51ffb2a0e79586bd8}{ss\_pidx}} = cookie-\/>\mbox{\hyperlink{structwrq__cookie_a57f89dcae07456c9bb54195211f4351d}{pidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02985}02985                 \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a76f4cf75c953a5623982f592eff9f788}{ss\_len}} = len16 * 16;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02986}02986         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02987}02987 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02988}02988         \mbox{\hyperlink{adapter_8h_a91b79109ac65aad761a86bd3bdeaa2b6}{EQ\_UNLOCK}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02989}02989 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02990}02990         \textcolor{keywordflow}{return} (w);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02991}02991 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02992}02992 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02993}02993 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02994}\mbox{\hyperlink{adapter_8h_a5c783c466f6a8685ee823650a6cd03ae}{02994}} \mbox{\hyperlink{t4__sge_8c_a54d3b4bac7a164bc0a0073290549b121}{commit\_wrq\_wr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__wrq}{sge\_wrq}} *\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}, \textcolor{keywordtype}{void} *w, \textcolor{keyword}{struct} \mbox{\hyperlink{structwrq__cookie}{wrq\_cookie}} *cookie)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02995}02995 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02996}02996         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02997}02997         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a7c38e3751f35cbee8834f2cb3c8e2156}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02998}02998         \textcolor{keywordtype}{int} ndesc, \mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l02999}02999         \textcolor{keyword}{struct }\mbox{\hyperlink{structwrq__cookie}{wrq\_cookie}} *prev, *next;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03000}03000 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03001}03001         \textcolor{keywordflow}{if} (cookie-\/>\mbox{\hyperlink{structwrq__cookie_a57f89dcae07456c9bb54195211f4351d}{pidx}} == -\/1) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03002}03002                 \textcolor{keyword}{struct }\mbox{\hyperlink{structwrqe}{wrqe}} *wr = \_\_containerof(w, \textcolor{keyword}{struct} \mbox{\hyperlink{structwrqe}{wrqe}}, wr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03003}03003 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03004}03004                 \mbox{\hyperlink{adapter_8h_a776a2d58d619ba75359c132883fa9d40}{t4\_wrq\_tx}}(sc, wr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03005}03005                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03006}03006         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03007}03007 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03008}03008         \textcolor{keywordflow}{if} (\_\_predict\_false(w == \&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_ac1de799ec333fbdc97355be714c58545}{ss}}[0])) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03009}03009                 \textcolor{keywordtype}{int} n = (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} -\/ \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a99dbba08ee8b7ca51ffb2a0e79586bd8}{ss\_pidx}}) * \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03010}03010 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03011}03011                 MPASS(\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a76f4cf75c953a5623982f592eff9f788}{ss\_len}} > n);        \textcolor{comment}{/* WR had better wrap around. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03012}03012                 bcopy(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_ac1de799ec333fbdc97355be714c58545}{ss}}[0], \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a99dbba08ee8b7ca51ffb2a0e79586bd8}{ss\_pidx}}], n);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03013}03013                 bcopy(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_ac1de799ec333fbdc97355be714c58545}{ss}}[n], \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[0], \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a76f4cf75c953a5623982f592eff9f788}{ss\_len}} -\/ n);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03014}03014                 \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a4f84f292760c384dc0e0d6480280ab1d}{tx\_wrs\_ss}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03015}03015         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03016}03016                 \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_abec284de2e57c369a3f94868c9a72e04}{tx\_wrs\_direct}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03017}03017 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03018}03018         \mbox{\hyperlink{adapter_8h_aa342afce2bb63960ab2e3e1b4e3d45f2}{EQ\_LOCK}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03019}03019         ndesc = cookie-\/>\mbox{\hyperlink{structwrq__cookie_a6bb346e336b05a0e1fd4913e0ad01658}{ndesc}};     \textcolor{comment}{/* Can be more than SGE\_MAX\_WR\_NDESC here. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03020}03020         \mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}} = cookie-\/>\mbox{\hyperlink{structwrq__cookie_a57f89dcae07456c9bb54195211f4351d}{pidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03021}03021         MPASS(\mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}} >= 0 \&\& pidx < eq-\/>\mbox{\hyperlink{adapter_8h_ac8cf3df722c7ef870858aa3c1bcfd0c5}{sidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03022}03022         prev = TAILQ\_PREV(cookie, wrq\_incomplete\_wrs, link);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03023}03023         next = TAILQ\_NEXT(cookie, link);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03024}03024         \textcolor{keywordflow}{if} (prev == NULL) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03025}03025                 MPASS(\mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}} == \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9e8218a79e217563b6ca22792f028b37}{dbidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03026}03026                 \textcolor{keywordflow}{if} (next == NULL || ndesc >= 16) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03027}03027                         \textcolor{keywordtype}{int} available;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03028}03028                         \textcolor{keyword}{struct }\mbox{\hyperlink{structfw__eth__tx__pkt__wr}{fw\_eth\_tx\_pkt\_wr}} *dst;   \textcolor{comment}{/* any fw WR struct will do */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03029}03029 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03030}03030                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03031}03031 \textcolor{comment}{                         * Note that the WR via which we'll request tx updates}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03032}03032 \textcolor{comment}{                         * is at pidx and not eq-\/>pidx, which has moved on}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03033}03033 \textcolor{comment}{                         * already.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03034}03034 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03035}03035                         dst = (\textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03036}03036                         available = \mbox{\hyperlink{adapter_8h_a5b0f572f7c8db6dac00cfd7f50b8bd43}{IDXDIFF}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}) -\/ 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03037}03037                         \textcolor{keywordflow}{if} (available < eq-\/>\mbox{\hyperlink{adapter_8h_ac8cf3df722c7ef870858aa3c1bcfd0c5}{sidx}} / 4 \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03038}03038                             atomic\_cmpset\_int(\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2819002c551a9ffe75310581c86e03f7}{equiq}}, 0, 1)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03039}03039                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03040}03040 \textcolor{comment}{                                 * XXX: This is not 100\% reliable with some}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03041}03041 \textcolor{comment}{                                 * types of WRs.  But this is a very unusual}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03042}03042 \textcolor{comment}{                                 * situation for an ofld/ctrl queue anyway.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03043}03043 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03044}03044                                 dst-\/>\mbox{\hyperlink{structfw__eth__tx__pkt__wr_a32064cc75d820febe9458c4ff8c6bd55}{equiq\_to\_len16}} |= htobe32(\mbox{\hyperlink{t4fw__interface_8h_a27558b32efe53f36c94e80c688193b4a}{F\_FW\_WR\_EQUIQ}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03045}03045                                     \mbox{\hyperlink{t4fw__interface_8h_a3cfae3ddb468e532b42afef06844a6e9}{F\_FW\_WR\_EQUEQ}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03046}03046                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03047}03047 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03048}03048                         \mbox{\hyperlink{t4__sge_8c_a891527ea34b168d58d83f44f750ecc92}{ring\_eq\_db}}(\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a7c38e3751f35cbee8834f2cb3c8e2156}{adapter}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, ndesc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03049}03049                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03050}03050                         MPASS(\mbox{\hyperlink{adapter_8h_a5b0f572f7c8db6dac00cfd7f50b8bd43}{IDXDIFF}}(next-\/>\mbox{\hyperlink{structwrq__cookie_a57f89dcae07456c9bb54195211f4351d}{pidx}}, \mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}) == ndesc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03051}03051                         next-\/>\mbox{\hyperlink{structwrq__cookie_a57f89dcae07456c9bb54195211f4351d}{pidx}} = \mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03052}03052                         next-\/>\mbox{\hyperlink{structwrq__cookie_a6bb346e336b05a0e1fd4913e0ad01658}{ndesc}} += ndesc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03053}03053                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03054}03054         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03055}03055                 MPASS(\mbox{\hyperlink{adapter_8h_a5b0f572f7c8db6dac00cfd7f50b8bd43}{IDXDIFF}}(\mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}}, prev-\/>\mbox{\hyperlink{structwrq__cookie_a57f89dcae07456c9bb54195211f4351d}{pidx}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}) == prev-\/>\mbox{\hyperlink{structwrq__cookie_a6bb346e336b05a0e1fd4913e0ad01658}{ndesc}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03056}03056                 prev-\/>\mbox{\hyperlink{structwrq__cookie_a6bb346e336b05a0e1fd4913e0ad01658}{ndesc}} += ndesc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03057}03057         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03058}03058         TAILQ\_REMOVE(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>incomplete\_wrs, cookie, link);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03059}03059 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03060}03060         \textcolor{keywordflow}{if} (TAILQ\_EMPTY(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>incomplete\_wrs) \&\& !STAILQ\_EMPTY(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>wr\_list))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03061}03061                 \mbox{\hyperlink{t4__sge_8c_af4d3457cf55d271db1060586cf481bc0}{drain\_wrq\_wr\_list}}(sc, \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03062}03062 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03063}03063 \textcolor{preprocessor}{\#ifdef INVARIANTS}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03064}03064         \textcolor{keywordflow}{if} (TAILQ\_EMPTY(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>incomplete\_wrs)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03065}03065                 \textcolor{comment}{/* Doorbell must have caught up to the pidx. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03066}03066                 MPASS(\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}}.\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}} == \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}}.\mbox{\hyperlink{structsge__eq_a9e8218a79e217563b6ca22792f028b37}{dbidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03067}03067         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03068}03068 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03069}03069         \mbox{\hyperlink{adapter_8h_a91b79109ac65aad761a86bd3bdeaa2b6}{EQ\_UNLOCK}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03070}03070 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03071}03071 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03072}03072 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03073}\mbox{\hyperlink{t4__sge_8c_a77415cf9e14d475cf12c3099cad5c7db}{03073}} \mbox{\hyperlink{t4__sge_8c_a77415cf9e14d475cf12c3099cad5c7db}{can\_resume\_eth\_tx}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmp__ring}{mp\_ring}} *\mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03074}03074 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03075}03075         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}}-\/>\mbox{\hyperlink{structmp__ring_ab0338d4339afef7f1a2d2ac8a64c05d7}{cookie}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03076}03076 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03077}03077         \textcolor{keywordflow}{return} (\mbox{\hyperlink{t4__sge_8c_a93ac7052a1ab492658aa3144aa388a7d}{total\_available\_tx\_desc}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}) > \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} / 8);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03078}03078 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03079}03079 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03080}03080 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03081}\mbox{\hyperlink{t4__sge_8c_ad61c411fc0dd2e8cbae606c1d281ea54}{03081}} \mbox{\hyperlink{t4__sge_8c_ad61c411fc0dd2e8cbae606c1d281ea54}{cannot\_use\_txpkts}}(\textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03082}03082 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03083}03083         \textcolor{comment}{/* maybe put a GL limit too, to avoid silliness? */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03084}03084 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03085}03085         \textcolor{keywordflow}{return} (\mbox{\hyperlink{t4__sge_8c_ae6ecacf657295bf32737d5feea989d27}{needs\_tso}}(m) || (\mbox{\hyperlink{t4__sge_8c_ae953eb715e585e362e57c6b64df2fe03}{mbuf\_cflags}}(m) \& (\mbox{\hyperlink{t4__sge_8c_a2ac69895d2a4a0ccd1c370d74f924300}{MC\_RAW\_WR}} | \mbox{\hyperlink{t4__sge_8c_a0b8f49eb708f2da4e7d728702835c8c5}{MC\_TLS}})) != 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03086}03086 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03087}03087 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03088}03088 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03089}\mbox{\hyperlink{t4__sge_8c_a5b1e6330b86d29edc911c96ffdb0fa2a}{03089}} \mbox{\hyperlink{t4__sge_8c_a5b1e6330b86d29edc911c96ffdb0fa2a}{discard\_tx}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03090}03090 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03091}03091 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03092}03092         \textcolor{keywordflow}{return} ((\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& (\mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a9bbe86a51a33d7a88df4af7caba1665b}{EQ\_ENABLED}} | \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ad2a39b8787884737cc1930c7e41168ce}{EQ\_QFLUSH}})) != \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a9bbe86a51a33d7a88df4af7caba1665b}{EQ\_ENABLED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03093}03093 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03094}03094 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03095}03095 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03096}\mbox{\hyperlink{t4__sge_8c_a5e34f1c4d17b32e6f2d9adb71163935c}{03096}} \mbox{\hyperlink{t4__sge_8c_a5e34f1c4d17b32e6f2d9adb71163935c}{wr\_can\_update\_eq}}(\textcolor{keywordtype}{void} *p)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03097}03097 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03098}03098         \textcolor{keyword}{struct }\mbox{\hyperlink{structfw__eth__tx__pkts__wr}{fw\_eth\_tx\_pkts\_wr}} *wr = p;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03099}03099 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03100}03100         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{t4fw__interface_8h_a18fdeba8cdcb5d5870bf9392ef3c087f}{G\_FW\_WR\_OP}}(be32toh(wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkts__wr_af6282970d125f35ccf221a2a4ad8b94d}{op\_pkd}}))) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03101}03101         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4fw__interface_8h_acad922311ad51c6f19f2a62af11cafd7a0aa56d256fc08c6831c5aa62dec17fc9}{FW\_ULPTX\_WR}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03102}03102         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4fw__interface_8h_acad922311ad51c6f19f2a62af11cafd7a76b3b801080e628d9584be302d220259}{FW\_ETH\_TX\_PKT\_WR}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03103}03103         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4fw__interface_8h_acad922311ad51c6f19f2a62af11cafd7a16dac2dda81fd1fb0ede5a6e4e9ee530}{FW\_ETH\_TX\_PKTS\_WR}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03104}03104         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4fw__interface_8h_acad922311ad51c6f19f2a62af11cafd7a325e14a14ba96a10d3f43f31971bb953}{FW\_ETH\_TX\_PKTS2\_WR}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03105}03105         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4fw__interface_8h_acad922311ad51c6f19f2a62af11cafd7a923e3a7cac3df586cc6ebe0e4a15cdfa}{FW\_ETH\_TX\_PKT\_VM\_WR}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03106}03106         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4fw__interface_8h_acad922311ad51c6f19f2a62af11cafd7a52d189ccaa3b440cf0b9b680490d443a}{FW\_ETH\_TX\_PKTS\_VM\_WR}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03107}03107                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03108}03108         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03109}03109                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03110}03110         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03111}03111 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03112}03112 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03113}03113 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03114}\mbox{\hyperlink{t4__sge_8c_a7acc9a9a1b27a7e59bf89fddc10d1c2f}{03114}} \mbox{\hyperlink{t4__sge_8c_a7acc9a9a1b27a7e59bf89fddc10d1c2f}{set\_txupdate\_flags}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq, u\_int avail,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03115}03115     \textcolor{keyword}{struct} \mbox{\hyperlink{structfw__eth__tx__pkt__wr}{fw\_eth\_tx\_pkt\_wr}} *wr)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03116}03116 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03117}03117         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_ae7ae404e7b40fddbb86a486c24227067}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03118}03118         \textcolor{keyword}{struct }\mbox{\hyperlink{structtxpkts}{txpkts}} *\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_a9d9270442d49358fe63c6155f2114968}{txp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03119}03119 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03120}03120         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} > 0 || avail < eq-\/>\mbox{\hyperlink{adapter_8h_ac8cf3df722c7ef870858aa3c1bcfd0c5}{sidx}} / 2) \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03121}03121             atomic\_cmpset\_int(\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2819002c551a9ffe75310581c86e03f7}{equiq}}, 0, 1)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03122}03122                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkt__wr_a32064cc75d820febe9458c4ff8c6bd55}{equiq\_to\_len16}} |= htobe32(\mbox{\hyperlink{t4fw__interface_8h_a3cfae3ddb468e532b42afef06844a6e9}{F\_FW\_WR\_EQUEQ}} | \mbox{\hyperlink{t4fw__interface_8h_a27558b32efe53f36c94e80c688193b4a}{F\_FW\_WR\_EQUIQ}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03123}03123                 \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a7bbfe5916fa5ba0e6fd0dcc0f027846d}{equeqidx}} = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03124}03124         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a5b0f572f7c8db6dac00cfd7f50b8bd43}{IDXDIFF}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a7bbfe5916fa5ba0e6fd0dcc0f027846d}{equeqidx}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}) >= 32) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03125}03125                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkt__wr_a32064cc75d820febe9458c4ff8c6bd55}{equiq\_to\_len16}} |= htobe32(\mbox{\hyperlink{t4fw__interface_8h_a3cfae3ddb468e532b42afef06844a6e9}{F\_FW\_WR\_EQUEQ}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03126}03126                 \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a7bbfe5916fa5ba0e6fd0dcc0f027846d}{equeqidx}} = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03127}03127         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03128}03128 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03129}03129 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03130}03130 \textcolor{preprocessor}{\#if defined(\_\_i386\_\_) || defined(\_\_amd64\_\_)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03131}03131 \textcolor{keyword}{extern} uint64\_t tsc\_freq;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03132}03132 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03133}03133 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03134}03134 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03135}\mbox{\hyperlink{t4__sge_8c_a229c723bb98865e4c1695eb740d940e4}{03135}} \mbox{\hyperlink{t4__sge_8c_a229c723bb98865e4c1695eb740d940e4}{record\_eth\_tx\_time}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03136}03136 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03137}03137         \textcolor{keyword}{const} uint64\_t cycles = get\_cyclecount();}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03138}03138         \textcolor{keyword}{const} uint64\_t \mbox{\hyperlink{adapter_8h_af1f473aab4b65b7dd0878cc198a3c04f}{last\_tx}} = txq-\/>\mbox{\hyperlink{structsge__txq_abd635035dda8dec55c6cb5cd78d1a263}{last\_tx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03139}03139 \textcolor{preprocessor}{\#if defined(\_\_i386\_\_) || defined(\_\_amd64\_\_)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03140}03140         \textcolor{keyword}{const} uint64\_t itg = tsc\_freq * \mbox{\hyperlink{t4__sge_8c_a896a8afef9676ef123fb9263ba67b58a}{t4\_tx\_coalesce\_gap}} / 1000000;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03141}03141 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03142}03142         \textcolor{keyword}{const} uint64\_t itg = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03143}03143 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03144}03144 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03145}03145         MPASS(cycles >= \mbox{\hyperlink{adapter_8h_af1f473aab4b65b7dd0878cc198a3c04f}{last\_tx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03146}03146         txq-\/>\mbox{\hyperlink{structsge__txq_abd635035dda8dec55c6cb5cd78d1a263}{last\_tx}} = cycles;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03147}03147         \textcolor{keywordflow}{return} (cycles -\/ \mbox{\hyperlink{adapter_8h_af1f473aab4b65b7dd0878cc198a3c04f}{last\_tx}} < itg);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03148}03148 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03149}03149 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03150}03150 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03151}03151 \textcolor{comment}{ * r-\/>items[cidx] to r-\/>items[pidx], with a wraparound at r-\/>size, are ready to}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03152}03152 \textcolor{comment}{ * be consumed.  Return the actual number consumed.  0 indicates a stall.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03153}03153 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03154}03154 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03155}\mbox{\hyperlink{t4__sge_8c_a19e880b935db347597598ea8d6364566}{03155}} \mbox{\hyperlink{t4__sge_8c_a19e880b935db347597598ea8d6364566}{eth\_tx}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmp__ring}{mp\_ring}} *\mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}}, u\_int \mbox{\hyperlink{adapter_8h_a3c88dd30dd9b547a4c35f3e1c593f6ec}{cidx}}, u\_int \mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}}, \textcolor{keywordtype}{bool} *coalescing)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03156}03156 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03157}03157         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq = \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}}-\/>\mbox{\hyperlink{structmp__ring_ab0338d4339afef7f1a2d2ac8a64c05d7}{cookie}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03158}03158         \textcolor{keyword}{struct }ifnet *\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}} = txq-\/>\mbox{\hyperlink{structsge__txq_a8d0c2945ca5f278385189001a9654464}{ifp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03159}03159         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_ae7ae404e7b40fddbb86a486c24227067}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03160}03160         \textcolor{keyword}{struct }\mbox{\hyperlink{structtxpkts}{txpkts}} *\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_a9d9270442d49358fe63c6155f2114968}{txp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03161}03161         \textcolor{keyword}{struct }\mbox{\hyperlink{structvi__info}{vi\_info}} *vi = \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03162}03162         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = vi-\/>\mbox{\hyperlink{structvi__info_a5ed3e511f61e7116aa53d733d7154130}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03163}03163         u\_int total, remaining;         \textcolor{comment}{/* \# of packets */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03164}03164         u\_int n, avail, dbdiff;         \textcolor{comment}{/* \# of hardware descriptors */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03165}03165         \textcolor{keywordtype}{int} i, rc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03166}03166         \textcolor{keyword}{struct }mbuf *m0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03167}03167         \textcolor{keywordtype}{bool} snd, recent\_tx;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03168}03168         \textcolor{keywordtype}{void} *wr;       \textcolor{comment}{/* start of the last WR written to the ring */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03169}03169 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03170}03170         \mbox{\hyperlink{adapter_8h_a744901428e6bd5d05414d661903c74b4}{TXQ\_LOCK\_ASSERT\_OWNED}}(txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03171}03171         recent\_tx = \mbox{\hyperlink{t4__sge_8c_a229c723bb98865e4c1695eb740d940e4}{record\_eth\_tx\_time}}(txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03172}03172 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03173}03173         remaining = \mbox{\hyperlink{adapter_8h_a5b0f572f7c8db6dac00cfd7f50b8bd43}{IDXDIFF}}(\mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}}, \mbox{\hyperlink{adapter_8h_a3c88dd30dd9b547a4c35f3e1c593f6ec}{cidx}}, \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}}-\/>size);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03174}03174         \textcolor{keywordflow}{if} (\_\_predict\_false(\mbox{\hyperlink{t4__sge_8c_a5b1e6330b86d29edc911c96ffdb0fa2a}{discard\_tx}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}))) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03175}03175                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}}; i++)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03176}03176                         m\_freem(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[i]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03177}03177                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03178}03178                 \textcolor{keywordflow}{while} (\mbox{\hyperlink{adapter_8h_a3c88dd30dd9b547a4c35f3e1c593f6ec}{cidx}} != \mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03179}03179                         m0 = \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}}-\/>items[\mbox{\hyperlink{adapter_8h_a3c88dd30dd9b547a4c35f3e1c593f6ec}{cidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03180}03180                         m\_freem(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03181}03181                         \textcolor{keywordflow}{if} (++\mbox{\hyperlink{adapter_8h_a3c88dd30dd9b547a4c35f3e1c593f6ec}{cidx}} == \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}}-\/>size)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03182}03182                                 \mbox{\hyperlink{adapter_8h_a3c88dd30dd9b547a4c35f3e1c593f6ec}{cidx}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03183}03183                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03184}03184                 \mbox{\hyperlink{t4__sge_8c_a1986cd7e43663cda49915b423e8465b9}{reclaim\_tx\_descs}}(txq, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03185}03185                 *coalescing = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03186}03186                 \textcolor{keywordflow}{return} (remaining);     \textcolor{comment}{/* emptied */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03187}03187         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03188}03188 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03189}03189         \textcolor{comment}{/* How many hardware descriptors do we have readily available. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03190}03190         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}} == \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03191}03191                 avail = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} -\/ 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03192}03192         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03193}03193                 avail = \mbox{\hyperlink{adapter_8h_a5b0f572f7c8db6dac00cfd7f50b8bd43}{IDXDIFF}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}) -\/ 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03194}03194 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03195}03195         total = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03196}03196         \textcolor{keywordflow}{if} (remaining == 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03197}03197                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a417ad424dd90d5f457fa794fc006866f}{score}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03198}03198                 txq-\/>\mbox{\hyperlink{structsge__txq_ae81e21d35bf445da7677bf3b8fa0a096}{txpkts\_flush}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03199}03199                 \textcolor{keywordflow}{goto} send\_txpkts;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03200}03200         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03201}03201 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03202}03202         dbdiff = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03203}03203         MPASS(remaining > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03204}03204         \textcolor{keywordflow}{while} (remaining > 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03205}03205                 m0 = \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}}-\/>items[\mbox{\hyperlink{adapter_8h_a3c88dd30dd9b547a4c35f3e1c593f6ec}{cidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03206}03206                 M\_ASSERTPKTHDR(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03207}03207                 MPASS(m0-\/>m\_nextpkt == NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03208}03208 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03209}03209                 \textcolor{keywordflow}{if} (avail < 2 * \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba3aa6bc0c73a01553747a2f051f03aab3}{SGE\_MAX\_WR\_NDESC}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03210}03210                         avail += \mbox{\hyperlink{t4__sge_8c_a1986cd7e43663cda49915b423e8465b9}{reclaim\_tx\_descs}}(txq, 64);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03211}03211 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03212}03212                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a2f2fc8e1a9564325472a25b8b2ed1393}{t4\_tx\_coalesce}} == 0 \&\& \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} == 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03213}03213                         \textcolor{keywordflow}{goto} skip\_coalescing;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03214}03214                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ad61c411fc0dd2e8cbae606c1d281ea54}{cannot\_use\_txpkts}}(m0))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03215}03215                         \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a417ad424dd90d5f457fa794fc006866f}{score}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03216}03216                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (recent\_tx) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03217}03217                         \textcolor{keywordflow}{if} (++\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a417ad424dd90d5f457fa794fc006866f}{score}} == 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03218}03218                                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a417ad424dd90d5f457fa794fc006866f}{score}} = UINT8\_MAX;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03219}03219                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03220}03220                         \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a417ad424dd90d5f457fa794fc006866f}{score}} = 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03221}03221                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} > 0 || remaining > 1 ||}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03222}03222                     \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a417ad424dd90d5f457fa794fc006866f}{score}} >= \mbox{\hyperlink{t4__sge_8c_ac7836d09583964bcaef7e6ac56e9eb6a}{t4\_tx\_coalesce\_pkts}} ||}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03223}03223                     atomic\_load\_int(\&txq-\/>\mbox{\hyperlink{structsge__txq_ae7ae404e7b40fddbb86a486c24227067}{eq}}.\mbox{\hyperlink{structsge__eq_a2819002c551a9ffe75310581c86e03f7}{equiq}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03224}03224                         \textcolor{keywordflow}{if} (vi-\/>\mbox{\hyperlink{structvi__info_ae53bfad48994c14a653adc1db0ab0b57}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06ca7ed073f2f00914712f965c4348bfee7e}{TX\_USES\_VM\_WR}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03225}03225                                 rc = \mbox{\hyperlink{t4__sge_8c_a667f1ae91cbd2e9fc6a2952f1bb2b8e4}{add\_to\_txpkts\_vf}}(sc, txq, m0, avail, \&snd);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03226}03226                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03227}03227                                 rc = \mbox{\hyperlink{t4__sge_8c_a464192533ba3c953e74222fe109d8ccd}{add\_to\_txpkts\_pf}}(sc, txq, m0, avail, \&snd);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03228}03228                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03229}03229                         snd = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03230}03230                         rc = EINVAL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03231}03231                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03232}03232                 \textcolor{keywordflow}{if} (snd) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03233}03233                         MPASS(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03234}03234                         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}}; i++)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03235}03235                                 ETHER\_BPF\_MTAP(\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}, \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[i]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03236}03236                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} > 1) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03237}03237                                 MPASS(avail >= \mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03238}03238                                 \textcolor{keywordflow}{if} (vi-\/>\mbox{\hyperlink{structvi__info_ae53bfad48994c14a653adc1db0ab0b57}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06ca7ed073f2f00914712f965c4348bfee7e}{TX\_USES\_VM\_WR}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03239}03239                                         n = \mbox{\hyperlink{t4__sge_8c_a13ef435aefdbba7f9966dcb626d73e62}{write\_txpkts\_vm\_wr}}(sc, txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03240}03240                                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03241}03241                                         n = \mbox{\hyperlink{t4__sge_8c_ac3906e06a046bcfaaf4f686ec070d07e}{write\_txpkts\_wr}}(sc, txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03242}03242                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03243}03243                                 MPASS(avail >=}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03244}03244                                     \mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(\mbox{\hyperlink{t4__sge_8c_a62c715deca2b86e88ee28434eebabea4}{mbuf\_len16}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[0])));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03245}03245                                 \textcolor{keywordflow}{if} (vi-\/>\mbox{\hyperlink{structvi__info_ae53bfad48994c14a653adc1db0ab0b57}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06ca7ed073f2f00914712f965c4348bfee7e}{TX\_USES\_VM\_WR}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03246}03246                                         n = \mbox{\hyperlink{t4__sge_8c_abf1d1d93efad4d497cfff16e239ca77b}{write\_txpkt\_vm\_wr}}(sc, txq,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03247}03247                                             \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[0]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03248}03248                                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03249}03249                                         n = \mbox{\hyperlink{t4__sge_8c_a89d48e1713a55754ddfab7e701fd1717}{write\_txpkt\_wr}}(sc, txq, \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[0],}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03250}03250                                             avail);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03251}03251                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03252}03252                         MPASS(n <= \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba3aa6bc0c73a01553747a2f051f03aab3}{SGE\_MAX\_WR\_NDESC}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03253}03253                         avail -\/= n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03254}03254                         dbdiff += n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03255}03255                         wr = \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03256}03256                         \mbox{\hyperlink{adapter_8h_aae3f128a52e3e78cf595539bb66425c7}{IDXINCR}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}, n, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03257}03257                         \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} = 0;   \textcolor{comment}{/* emptied */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03258}03258                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03259}03259                 \textcolor{keywordflow}{if} (rc == 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03260}03260                         \textcolor{comment}{/* m0 was coalesced into txq-\/>txpkts. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03261}03261                         \textcolor{keywordflow}{goto} next\_mbuf;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03262}03262                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03263}03263                 \textcolor{keywordflow}{if} (rc == EAGAIN) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03264}03264                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03265}03265 \textcolor{comment}{                         * m0 is suitable for tx coalescing but could not be}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03266}03266 \textcolor{comment}{                         * combined with the existing txq-\/>txpkts, which has now}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03267}03267 \textcolor{comment}{                         * been transmitted.  Start a new txpkts with m0.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03268}03268 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03269}03269                         MPASS(snd);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03270}03270                         MPASS(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} == 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03271}03271                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03272}03272                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03273}03273 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03274}03274                 MPASS(rc != 0 \&\& rc != EAGAIN);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03275}03275                 MPASS(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} == 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03276}03276 skip\_coalescing:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03277}03277                 n = \mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(\mbox{\hyperlink{t4__sge_8c_a62c715deca2b86e88ee28434eebabea4}{mbuf\_len16}}(m0));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03278}03278                 \textcolor{keywordflow}{if} (\_\_predict\_false(avail < n)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03279}03279                         avail += \mbox{\hyperlink{t4__sge_8c_a1986cd7e43663cda49915b423e8465b9}{reclaim\_tx\_descs}}(txq, min(n, 32));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03280}03280                         \textcolor{keywordflow}{if} (avail < n)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03281}03281                                 \textcolor{keywordflow}{break};  \textcolor{comment}{/* out of descriptors */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03282}03282                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03283}03283 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03284}03284                 wr = \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03285}03285                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ae953eb715e585e362e57c6b64df2fe03}{mbuf\_cflags}}(m0) \& \mbox{\hyperlink{t4__sge_8c_a2ac69895d2a4a0ccd1c370d74f924300}{MC\_RAW\_WR}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03286}03286                         n = \mbox{\hyperlink{t4__sge_8c_a9f013983c6707d2baafc3280297519e5}{write\_raw\_wr}}(txq, wr, m0, avail);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03287}03287 \textcolor{preprocessor}{\#ifdef KERN\_TLS}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03288}03288                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ae953eb715e585e362e57c6b64df2fe03}{mbuf\_cflags}}(m0) \& \mbox{\hyperlink{t4__sge_8c_a0b8f49eb708f2da4e7d728702835c8c5}{MC\_TLS}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03289}03289                         ETHER\_BPF\_MTAP(\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}, m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03290}03290                         n = \mbox{\hyperlink{t4__kern__tls_8c_a294e30bb6d6a974e5bca3e42bff4c608}{t6\_ktls\_write\_wr}}(txq, wr, m0, \mbox{\hyperlink{t4__sge_8c_a620de1776baac1a496fbfda0f34d8b39}{mbuf\_nsegs}}(m0),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03291}03291                             avail);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03292}03292 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03293}03293                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03294}03294                         ETHER\_BPF\_MTAP(\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}, m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03295}03295                         \textcolor{keywordflow}{if} (vi-\/>\mbox{\hyperlink{structvi__info_ae53bfad48994c14a653adc1db0ab0b57}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06ca7ed073f2f00914712f965c4348bfee7e}{TX\_USES\_VM\_WR}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03296}03296                                 n = \mbox{\hyperlink{t4__sge_8c_abf1d1d93efad4d497cfff16e239ca77b}{write\_txpkt\_vm\_wr}}(sc, txq, m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03297}03297                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03298}03298                                 n = \mbox{\hyperlink{t4__sge_8c_a89d48e1713a55754ddfab7e701fd1717}{write\_txpkt\_wr}}(sc, txq, m0, avail);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03299}03299                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03300}03300                 MPASS(n >= 1 \&\& n <= avail);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03301}03301                 \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{t4__sge_8c_ae953eb715e585e362e57c6b64df2fe03}{mbuf\_cflags}}(m0) \& \mbox{\hyperlink{t4__sge_8c_a0b8f49eb708f2da4e7d728702835c8c5}{MC\_TLS}}))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03302}03302                         MPASS(n <= \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba3aa6bc0c73a01553747a2f051f03aab3}{SGE\_MAX\_WR\_NDESC}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03303}03303 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03304}03304                 avail -\/= n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03305}03305                 dbdiff += n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03306}03306                 \mbox{\hyperlink{adapter_8h_aae3f128a52e3e78cf595539bb66425c7}{IDXINCR}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}, n, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03307}03307 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03308}03308                 \textcolor{keywordflow}{if} (dbdiff >= 512 / \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}}) \{ \textcolor{comment}{/* X\_FETCHBURSTMAX\_512B */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03309}03309                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a5e34f1c4d17b32e6f2d9adb71163935c}{wr\_can\_update\_eq}}(wr))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03310}03310                                 \mbox{\hyperlink{t4__sge_8c_a7acc9a9a1b27a7e59bf89fddc10d1c2f}{set\_txupdate\_flags}}(txq, avail, wr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03311}03311                         \mbox{\hyperlink{t4__sge_8c_a891527ea34b168d58d83f44f750ecc92}{ring\_eq\_db}}(sc, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, dbdiff);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03312}03312                         avail += \mbox{\hyperlink{t4__sge_8c_a1986cd7e43663cda49915b423e8465b9}{reclaim\_tx\_descs}}(txq, 32);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03313}03313                         dbdiff = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03314}03314                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03315}03315 next\_mbuf:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03316}03316                 total++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03317}03317                 remaining-\/-\/;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03318}03318                 \textcolor{keywordflow}{if} (\_\_predict\_false(++\mbox{\hyperlink{adapter_8h_a3c88dd30dd9b547a4c35f3e1c593f6ec}{cidx}} == \mbox{\hyperlink{adapter_8h_a54ea821044f584c84766fec385734bec}{r}}-\/>size))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03319}03319                         \mbox{\hyperlink{adapter_8h_a3c88dd30dd9b547a4c35f3e1c593f6ec}{cidx}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03320}03320         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03321}03321         \textcolor{keywordflow}{if} (dbdiff != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03322}03322                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a5e34f1c4d17b32e6f2d9adb71163935c}{wr\_can\_update\_eq}}(wr))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03323}03323                         \mbox{\hyperlink{t4__sge_8c_a7acc9a9a1b27a7e59bf89fddc10d1c2f}{set\_txupdate\_flags}}(txq, avail, wr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03324}03324                 \mbox{\hyperlink{t4__sge_8c_a891527ea34b168d58d83f44f750ecc92}{ring\_eq\_db}}(sc, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, dbdiff);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03325}03325                 \mbox{\hyperlink{t4__sge_8c_a1986cd7e43663cda49915b423e8465b9}{reclaim\_tx\_descs}}(txq, 32);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03326}03326         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}} == \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}} \&\& \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} > 0 \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03327}03327             atomic\_load\_int(\&txq-\/>\mbox{\hyperlink{structsge__txq_ae7ae404e7b40fddbb86a486c24227067}{eq}}.\mbox{\hyperlink{structsge__eq_a2819002c551a9ffe75310581c86e03f7}{equiq}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03328}03328                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03329}03329 \textcolor{comment}{                 * If nothing was submitted to the chip for tx (it was coalesced}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03330}03330 \textcolor{comment}{                 * into txpkts instead) and there is no tx update outstanding}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03331}03331 \textcolor{comment}{                 * then we need to send txpkts now.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03332}03332 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03333}03333 send\_txpkts:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03334}03334                 MPASS(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03335}03335                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}}; i++)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03336}03336                         ETHER\_BPF\_MTAP(\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}, \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[i]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03337}03337                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} > 1) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03338}03338                         MPASS(avail >= \mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03339}03339                         \textcolor{keywordflow}{if} (vi-\/>\mbox{\hyperlink{structvi__info_ae53bfad48994c14a653adc1db0ab0b57}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06ca7ed073f2f00914712f965c4348bfee7e}{TX\_USES\_VM\_WR}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03340}03340                                 n = \mbox{\hyperlink{t4__sge_8c_a13ef435aefdbba7f9966dcb626d73e62}{write\_txpkts\_vm\_wr}}(sc, txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03341}03341                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03342}03342                                 n = \mbox{\hyperlink{t4__sge_8c_ac3906e06a046bcfaaf4f686ec070d07e}{write\_txpkts\_wr}}(sc, txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03343}03343                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03344}03344                         MPASS(avail >=}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03345}03345                             \mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(\mbox{\hyperlink{t4__sge_8c_a62c715deca2b86e88ee28434eebabea4}{mbuf\_len16}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[0])));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03346}03346                         \textcolor{keywordflow}{if} (vi-\/>\mbox{\hyperlink{structvi__info_ae53bfad48994c14a653adc1db0ab0b57}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06ca7ed073f2f00914712f965c4348bfee7e}{TX\_USES\_VM\_WR}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03347}03347                                 n = \mbox{\hyperlink{t4__sge_8c_abf1d1d93efad4d497cfff16e239ca77b}{write\_txpkt\_vm\_wr}}(sc, txq, \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[0]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03348}03348                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03349}03349                                 n = \mbox{\hyperlink{t4__sge_8c_a89d48e1713a55754ddfab7e701fd1717}{write\_txpkt\_wr}}(sc, txq, \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[0], avail);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03350}03350                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03351}03351                 MPASS(n <= \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba3aa6bc0c73a01553747a2f051f03aab3}{SGE\_MAX\_WR\_NDESC}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03352}03352                 wr = \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03353}03353                 \mbox{\hyperlink{adapter_8h_aae3f128a52e3e78cf595539bb66425c7}{IDXINCR}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}, n, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03354}03354                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} = 0;   \textcolor{comment}{/* emptied */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03355}03355 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03356}03356                 MPASS(\mbox{\hyperlink{t4__sge_8c_a5e34f1c4d17b32e6f2d9adb71163935c}{wr\_can\_update\_eq}}(wr));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03357}03357                 \mbox{\hyperlink{t4__sge_8c_a7acc9a9a1b27a7e59bf89fddc10d1c2f}{set\_txupdate\_flags}}(txq, avail -\/ n, wr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03358}03358                 \mbox{\hyperlink{t4__sge_8c_a891527ea34b168d58d83f44f750ecc92}{ring\_eq\_db}}(sc, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, n);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03359}03359                 \mbox{\hyperlink{t4__sge_8c_a1986cd7e43663cda49915b423e8465b9}{reclaim\_tx\_descs}}(txq, 32);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03360}03360         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03361}03361         *coalescing = \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} > 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03362}03362 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03363}03363         \textcolor{keywordflow}{return} (total);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03364}03364 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03365}03365 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03366}03366 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03367}\mbox{\hyperlink{t4__sge_8c_a0383a9d8cf7c3411e3ce5988ef8f775d}{03367}} \mbox{\hyperlink{t4__sge_8c_a0383a9d8cf7c3411e3ce5988ef8f775d}{init\_iq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keywordtype}{int} tmr\_idx, \textcolor{keywordtype}{int} pktc\_idx,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03368}03368     \textcolor{keywordtype}{int} qsize, \textcolor{keywordtype}{int} intr\_idx, \textcolor{keywordtype}{int} cong)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03369}03369 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03370}03370 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03371}03371         KASSERT(tmr\_idx >= 0 \&\& tmr\_idx < \mbox{\hyperlink{t4__hw_8h_aabfcbcb5ac86a1edac4035264bc7d2b8ad38a10e8b80d5571059850cc194ac9f6}{SGE\_NTIMERS}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03372}03372             (\textcolor{stringliteral}{"{}\%s: bad tmr\_idx \%d"{}}, \_\_func\_\_, tmr\_idx));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03373}03373         KASSERT(pktc\_idx < \mbox{\hyperlink{t4__hw_8h_aabfcbcb5ac86a1edac4035264bc7d2b8a602104f3c5daeb800c681cd58fced203}{SGE\_NCOUNTERS}},  \textcolor{comment}{/* -\/ve is ok, means don't use */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03374}03374             (\textcolor{stringliteral}{"{}\%s: bad pktc\_idx \%d"{}}, \_\_func\_\_, pktc\_idx));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03375}03375         KASSERT(intr\_idx >= -\/1 \&\& intr\_idx < sc-\/>intr\_count,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03376}03376             (\textcolor{stringliteral}{"{}\%s: bad intr\_idx \%d"{}}, \_\_func\_\_, intr\_idx));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03377}03377 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03378}03378         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03379}03379         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aca292788492977fd0c41fb35c3cdaa85}{state}} = \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a8ab388222d7320dca87602b33c5e655a}{IQS\_DISABLED}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03380}03380         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a62e77da9c2ffc57fc1cc462a785f6fce}{adapter}} = sc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03381}03381         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a356b3e09ec2c3964ec6f8122cb42b88a}{intr\_params}} = \mbox{\hyperlink{t4__hw_8h_ad0d0106f734aaf74bfcdc39fe0c45209}{V\_QINTR\_TIMER\_IDX}}(tmr\_idx);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03382}03382         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ad196e0b2beb5785161571cff8f451c2a}{intr\_pktc\_idx}} = \mbox{\hyperlink{t4__hw_8h_aabfcbcb5ac86a1edac4035264bc7d2b8a602104f3c5daeb800c681cd58fced203}{SGE\_NCOUNTERS}} -\/ 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03383}03383         \textcolor{keywordflow}{if} (pktc\_idx >= 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03384}03384                 \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a356b3e09ec2c3964ec6f8122cb42b88a}{intr\_params}} |= \mbox{\hyperlink{t4__hw_8h_a5c2e67f71c0ddba8c4c9ab9af2101ef8}{F\_QINTR\_CNT\_EN}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03385}03385                 \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ad196e0b2beb5785161571cff8f451c2a}{intr\_pktc\_idx}} = pktc\_idx;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03386}03386         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03387}03387         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a764bf90982899051d957198d06e2f151}{qsize}} = roundup2(qsize, 16); \textcolor{comment}{/* See FW\_IQ\_CMD/iqsize */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03388}03388         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ab9abd6046ab67bce82714431aadaf9e2}{sidx}} = \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a764bf90982899051d957198d06e2f151}{qsize}} -\/ sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_ad88b567efaf5d38f538214804cc4dd35}{spg\_len}} / \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba5e4c6f81de3e22bf1f3327aa24d0cbba}{IQ\_ESIZE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03389}03389         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a0897c23816466990323b706f7a6a6886}{intr\_idx}} = intr\_idx;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03390}03390         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_adbcc4d3a20653ec230e6778fe0ecc6d8}{cong}} = cong;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03391}03391 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03392}03392 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03393}03393 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03394}\mbox{\hyperlink{t4__sge_8c_a3289b3d275f3e30cae9dd2c0e65121ff}{03394}} \mbox{\hyperlink{t4__sge_8c_a3289b3d275f3e30cae9dd2c0e65121ff}{init\_fl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, \textcolor{keywordtype}{int} qsize, \textcolor{keywordtype}{int} maxp, \textcolor{keywordtype}{char} *name)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03395}03395 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03396}03396         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__params}{sge\_params}} *sp = \&sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03397}03397 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03398}03398         \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ab034f92049857aee5ef57d555ea1df3b}{qsize}} = qsize;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03399}03399         \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0f572e6a95a867a2c848d725b6e30785}{sidx}} = qsize -\/ sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_ad88b567efaf5d38f538214804cc4dd35}{spg\_len}} / \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03400}03400         strlcpy(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a90e39cb1ad5f764fe6058313783be0b3}{lockname}}, name, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a90e39cb1ad5f764fe6058313783be0b3}{lockname}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03401}03401         mtx\_init(\&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ac77e6b8993b4d627cbc18228856143b1}{fl\_lock}}, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a90e39cb1ad5f764fe6058313783be0b3}{lockname}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03402}03402         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structadapter_a5b04a9c8ac519064f43255df133cfe84}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06cac2766ba7089a9a0722982c3ccc4a867f}{BUF\_PACKING\_OK}} \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03403}03403             ((!\mbox{\hyperlink{common_8h_aa9e773cf60cd663bef321462eba79990}{is\_t4}}(sc) \&\& \mbox{\hyperlink{t4__sge_8c_a4c90bb713d4d2847ce444a3c08edfc82}{buffer\_packing}}) ||       \textcolor{comment}{/* T5+: enabled unless 0 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03404}03404             (\mbox{\hyperlink{common_8h_aa9e773cf60cd663bef321462eba79990}{is\_t4}}(sc) \&\& \mbox{\hyperlink{t4__sge_8c_a4c90bb713d4d2847ce444a3c08edfc82}{buffer\_packing}} == 1)))\textcolor{comment}{/* T4: disabled unless 1 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03405}03405                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} |= \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daa0bc2f5c770b6e332fdc75909ee8bb47}{FL\_BUF\_PACKING}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03406}03406         \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a6c0f6b4778a8154ed2946f64fa6161dd}{zidx}} = \mbox{\hyperlink{t4__sge_8c_ad6dd0b621aa9adaa3937ac3a13d030b5}{find\_refill\_source}}(sc, maxp, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daa0bc2f5c770b6e332fdc75909ee8bb47}{FL\_BUF\_PACKING}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03407}03407         \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_aa6f569547ff74311111cb5848b62a602}{safe\_zidx}} = sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_abc39b973ba8895d2876a8d3d20912e85}{safe\_zidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03408}03408         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daa0bc2f5c770b6e332fdc75909ee8bb47}{FL\_BUF\_PACKING}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03409}03409                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_af13f8e21456a9ea6f5808458368258e6}{lowat}} = roundup2(sp-\/>\mbox{\hyperlink{structsge__params_a4fc51209e0c86c07edd36574878968ca}{fl\_starve\_threshold2}}, 8);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03410}03410                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a80a47dbfa557b1a80b6fa79eac164692}{buf\_boundary}} = sp-\/>\mbox{\hyperlink{structsge__params_ac0bc396aa7308abe4ca88a596be0e862}{pack\_boundary}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03411}03411         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03412}03412                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_af13f8e21456a9ea6f5808458368258e6}{lowat}} = roundup2(sp-\/>\mbox{\hyperlink{structsge__params_a8461b9010905340ed86e65009b707040}{fl\_starve\_threshold}}, 8);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03413}03413                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a80a47dbfa557b1a80b6fa79eac164692}{buf\_boundary}} = 16;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03414}03414         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03415}03415         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ab4e2791bbea61f64ac9d9d20708712fd}{fl\_pad}} \&\& \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a80a47dbfa557b1a80b6fa79eac164692}{buf\_boundary}} < sp-\/>\mbox{\hyperlink{structsge__params_a248cf3a2767e7a70707c9bdc65107c40}{pad\_boundary}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03416}03416                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a80a47dbfa557b1a80b6fa79eac164692}{buf\_boundary}} = sp-\/>\mbox{\hyperlink{structsge__params_a248cf3a2767e7a70707c9bdc65107c40}{pad\_boundary}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03417}03417 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03418}03418 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03419}03419 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03420}\mbox{\hyperlink{t4__sge_8c_a7c78925258e7e3b91aaec525467ef32b}{03420}} \mbox{\hyperlink{t4__sge_8c_a7c78925258e7e3b91aaec525467ef32b}{init\_eq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, \textcolor{keywordtype}{int} eqtype, \textcolor{keywordtype}{int} qsize,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03421}03421     uint8\_t tx\_chan, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keywordtype}{char} *name)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03422}03422 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03423}03423         KASSERT(eqtype >= \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a3bee65b0acce2718193750b345f3ac3e}{EQ\_CTRL}} \&\& eqtype <= \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae4f59379f6b71263323a2bd25c7c5b9a}{EQ\_OFLD}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03424}03424             (\textcolor{stringliteral}{"{}\%s: bad qtype \%d"{}}, \_\_func\_\_, eqtype));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03425}03425 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03426}03426         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_aad96c6b0170c6d4e6bb404ef9c9a490b}{type}} = eqtype;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03427}03427         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a214dbfee0f0274229b4a684e2cce42c6}{tx\_chan}} = tx\_chan;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03428}03428         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a8cd0679679a5c0f115dd005df49f1c2d}{iq}} = \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03429}03429         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} = qsize -\/ sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_ad88b567efaf5d38f538214804cc4dd35}{spg\_len}} / \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03430}03430         strlcpy(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ad8d6ae1b3195347564f753cb00153642}{lockname}}, name, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ad8d6ae1b3195347564f753cb00153642}{lockname}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03431}03431         mtx\_init(\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae8f6d852c2a6a0e32daa4551ebe5000d}{eq\_lock}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ad8d6ae1b3195347564f753cb00153642}{lockname}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03432}03432 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03433}03433 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03434}03434 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03435}\mbox{\hyperlink{adapter_8h_af7017c6a82509135ffc263a05a027d48}{03435}} \mbox{\hyperlink{t4__sge_8c_aea7f973785a256f94ee94e87ce652f63}{alloc\_ring}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keywordtype}{size\_t} len, bus\_dma\_tag\_t *\mbox{\hyperlink{adapter_8h_a3fd9a258481b2a4c0610d35a95c516f6}{tag}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03436}03436     bus\_dmamap\_t *map, bus\_addr\_t *pa, \textcolor{keywordtype}{void} **va)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03437}03437 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03438}03438         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03439}03439 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03440}03440         rc = bus\_dma\_tag\_create(sc-\/>\mbox{\hyperlink{structadapter_a4e292a5076bc33db414d753ca30c8c05}{dmat}}, 512, 0, BUS\_SPACE\_MAXADDR,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03441}03441             BUS\_SPACE\_MAXADDR, NULL, NULL, len, 1, len, 0, NULL, NULL, \mbox{\hyperlink{adapter_8h_a3fd9a258481b2a4c0610d35a95c516f6}{tag}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03442}03442         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03443}03443                 \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(sc, \textcolor{stringliteral}{"{}cannot allocate DMA tag: \%d\(\backslash\)n"{}}, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03444}03444                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03445}03445         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03446}03446 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03447}03447         rc = bus\_dmamem\_alloc(*\mbox{\hyperlink{adapter_8h_a3fd9a258481b2a4c0610d35a95c516f6}{tag}}, va,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03448}03448             BUS\_DMA\_WAITOK | BUS\_DMA\_COHERENT | BUS\_DMA\_ZERO, map);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03449}03449         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03450}03450                 \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(sc, \textcolor{stringliteral}{"{}cannot allocate DMA memory: \%d\(\backslash\)n"{}}, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03451}03451                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03452}03452         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03453}03453 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03454}03454         rc = bus\_dmamap\_load(*\mbox{\hyperlink{adapter_8h_a3fd9a258481b2a4c0610d35a95c516f6}{tag}}, *map, *va, len, \mbox{\hyperlink{t4__sge_8c_af40ba290a67743180a6848b100bca7d0}{oneseg\_dma\_callback}}, pa, 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03455}03455         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03456}03456                 \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(sc, \textcolor{stringliteral}{"{}cannot load DMA map: \%d\(\backslash\)n"{}}, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03457}03457                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03458}03458         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03459}03459 done:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03460}03460         \textcolor{keywordflow}{if} (rc)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03461}03461                 \mbox{\hyperlink{t4__sge_8c_a91a6cad146796f95940e30d5e73f5298}{free\_ring}}(sc, *\mbox{\hyperlink{adapter_8h_a3fd9a258481b2a4c0610d35a95c516f6}{tag}}, *map, *pa, *va);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03462}03462 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03463}03463         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03464}03464 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03465}03465 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03466}03466 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03467}\mbox{\hyperlink{adapter_8h_aeec5b22ffd901ae0f2ba470e6751893e}{03467}} \mbox{\hyperlink{t4__sge_8c_a91a6cad146796f95940e30d5e73f5298}{free\_ring}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, bus\_dma\_tag\_t \mbox{\hyperlink{adapter_8h_a3fd9a258481b2a4c0610d35a95c516f6}{tag}}, bus\_dmamap\_t map,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03468}03468     bus\_addr\_t pa, \textcolor{keywordtype}{void} *va)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03469}03469 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03470}03470         \textcolor{keywordflow}{if} (pa)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03471}03471                 bus\_dmamap\_unload(\mbox{\hyperlink{adapter_8h_a3fd9a258481b2a4c0610d35a95c516f6}{tag}}, map);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03472}03472         \textcolor{keywordflow}{if} (va)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03473}03473                 bus\_dmamem\_free(\mbox{\hyperlink{adapter_8h_a3fd9a258481b2a4c0610d35a95c516f6}{tag}}, va, map);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03474}03474         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a3fd9a258481b2a4c0610d35a95c516f6}{tag}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03475}03475                 bus\_dma\_tag\_destroy(\mbox{\hyperlink{adapter_8h_a3fd9a258481b2a4c0610d35a95c516f6}{tag}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03476}03476 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03477}03477         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03478}03478 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03479}03479 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03480}03480 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03481}03481 \textcolor{comment}{ * Allocates the software resources (mainly memory and sysctl nodes) for an}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03482}03482 \textcolor{comment}{ * ingress queue and an optional freelist.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03483}03483 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03484}03484 \textcolor{comment}{ * Sets IQ\_SW\_ALLOCATED and returns 0 on success.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03485}03485 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03486}03486 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03487}\mbox{\hyperlink{t4__sge_8c_a43b589cf2cd0d6c9bf52efef32c00028}{03487}} \mbox{\hyperlink{t4__sge_8c_a43b589cf2cd0d6c9bf52efef32c00028}{alloc\_iq\_fl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03488}03488     \textcolor{keyword}{struct} sysctl\_ctx\_list *ctx, \textcolor{keyword}{struct} sysctl\_oid *oid)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03489}03489 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03490}03490         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03491}03491         \textcolor{keywordtype}{size\_t} len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03492}03492         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = vi-\/>\mbox{\hyperlink{structvi__info_a5ed3e511f61e7116aa53d733d7154130}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03493}03493 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03494}03494         MPASS(!(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03495}03495 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03496}03496         len = \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a764bf90982899051d957198d06e2f151}{qsize}} * \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba5e4c6f81de3e22bf1f3327aa24d0cbba}{IQ\_ESIZE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03497}03497         rc = \mbox{\hyperlink{t4__sge_8c_aea7f973785a256f94ee94e87ce652f63}{alloc\_ring}}(sc, len, \&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a4494b610d74fbc5812e7964502153d9e}{desc\_tag}}, \&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a642bc3e29da597daf24fd42b4352a652}{desc\_map}}, \&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a20b6b3beac95ff14a098f31634b9c697}{ba}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03498}03498             (\textcolor{keywordtype}{void} **)\&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aa0b80730bff81beab7577cb1d1fe8f3d}{desc}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03499}03499         \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03500}03500                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03501}03501 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03502}03502         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03503}03503                 len = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ab034f92049857aee5ef57d555ea1df3b}{qsize}} * \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03504}03504                 rc = \mbox{\hyperlink{t4__sge_8c_aea7f973785a256f94ee94e87ce652f63}{alloc\_ring}}(sc, len, \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a85b44cc4304e35ecd930d1a9775a46d9}{desc\_tag}}, \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a2dc50e58cc55189d1075bed6efb81996}{desc\_map}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03505}03505                     \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a520948bc5d5605f6dec2417acbca03f3}{ba}}, (\textcolor{keywordtype}{void} **)\&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad641675824ad24b021729a376f166308}{desc}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03506}03506                 \textcolor{keywordflow}{if} (rc) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03507}03507                         \mbox{\hyperlink{t4__sge_8c_a91a6cad146796f95940e30d5e73f5298}{free\_ring}}(sc, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a4494b610d74fbc5812e7964502153d9e}{desc\_tag}}, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a642bc3e29da597daf24fd42b4352a652}{desc\_map}}, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a20b6b3beac95ff14a098f31634b9c697}{ba}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03508}03508                             \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aa0b80730bff81beab7577cb1d1fe8f3d}{desc}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03509}03509                         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03510}03510                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03511}03511 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03512}03512                 \textcolor{comment}{/* Allocate space for one software descriptor per buffer. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03513}03513                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a72d761fa3c245d6de3286e7fc055346f}{sdesc}} = malloc(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0f572e6a95a867a2c848d725b6e30785}{sidx}} * 8 * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structfl__sdesc}{fl\_sdesc}}),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03514}03514                     M\_CXGBE, M\_ZERO | M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03515}03515 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03516}03516                 \mbox{\hyperlink{t4__sge_8c_a5297883d6f50f02efdf48eb35dd4e774}{add\_fl\_sysctls}}(sc, \mbox{\hyperlink{structadapter_a6f977d13071c9120bbcbdf1e108470ed}{ctx}}, oid, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03517}03517                 \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} |= \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635af120aa1fd4e8641577c4ab287eec3615}{IQ\_HAS\_FL}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03518}03518         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03519}03519         \mbox{\hyperlink{t4__sge_8c_afc7094a28bd87d0c9c337929074311a6}{add\_iq\_sysctls}}(\mbox{\hyperlink{structadapter_a6f977d13071c9120bbcbdf1e108470ed}{ctx}}, oid, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03520}03520         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} |= \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03521}03521 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03522}03522         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03523}03523 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03524}03524 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03525}03525 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03526}03526 \textcolor{comment}{ * Frees all software resources (memory and locks) associated with an ingress}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03527}03527 \textcolor{comment}{ * queue and an optional freelist.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03528}03528 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03529}03529 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03530}\mbox{\hyperlink{t4__sge_8c_a776148d20afbfccd8846649528c046a4}{03530}} \mbox{\hyperlink{t4__sge_8c_a776148d20afbfccd8846649528c046a4}{free\_iq\_fl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03531}03531 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03532}03532         MPASS(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03533}03533 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03534}03534         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03535}03535                 MPASS(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635af120aa1fd4e8641577c4ab287eec3615}{IQ\_HAS\_FL}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03536}03536                 \mbox{\hyperlink{t4__sge_8c_a91a6cad146796f95940e30d5e73f5298}{free\_ring}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a85b44cc4304e35ecd930d1a9775a46d9}{desc\_tag}}, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a2dc50e58cc55189d1075bed6efb81996}{desc\_map}}, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a520948bc5d5605f6dec2417acbca03f3}{ba}}, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad641675824ad24b021729a376f166308}{desc}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03537}03537                 \mbox{\hyperlink{t4__sge_8c_a562b5150eb2977c2480be5c11f98c46c}{free\_fl\_buffers}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03538}03538                 free(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a72d761fa3c245d6de3286e7fc055346f}{sdesc}}, M\_CXGBE);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03539}03539                 mtx\_destroy(\&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ac77e6b8993b4d627cbc18228856143b1}{fl\_lock}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03540}03540                 bzero(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, \textcolor{keyword}{sizeof}(*\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03541}03541         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03542}03542         \mbox{\hyperlink{t4__sge_8c_a91a6cad146796f95940e30d5e73f5298}{free\_ring}}(sc, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a4494b610d74fbc5812e7964502153d9e}{desc\_tag}}, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a642bc3e29da597daf24fd42b4352a652}{desc\_map}}, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a20b6b3beac95ff14a098f31634b9c697}{ba}}, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aa0b80730bff81beab7577cb1d1fe8f3d}{desc}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03543}03543         bzero(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keyword}{sizeof}(*\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03544}03544 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03545}03545 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03546}03546 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03547}03547 \textcolor{comment}{ * Allocates a hardware ingress queue and an optional freelist that will be}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03548}03548 \textcolor{comment}{ * associated with it.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03549}03549 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03550}03550 \textcolor{comment}{ * Returns errno on failure.  Resources allocated up to that point may still be}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03551}03551 \textcolor{comment}{ * allocated.  Caller is responsible for cleanup in case this function fails.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03552}03552 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03553}03553 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03554}\mbox{\hyperlink{t4__sge_8c_ad1c3f730aeb7b6b529e1969f23c5c7c2}{03554}} \mbox{\hyperlink{t4__sge_8c_ad1c3f730aeb7b6b529e1969f23c5c7c2}{alloc\_iq\_fl\_hwq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03555}03555 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03556}03556         \textcolor{keywordtype}{int} rc, i, \mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03557}03557         \textcolor{keyword}{struct }\mbox{\hyperlink{structfw__iq__cmd}{fw\_iq\_cmd}} c;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03558}03558         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = vi-\/>\mbox{\hyperlink{structvi__info_a5ed3e511f61e7116aa53d733d7154130}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03559}03559         \mbox{\hyperlink{osdep_8h_a1fcbe0fe57dc78d034b654a327a171df}{\_\_be32}} v = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03560}03560 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03561}03561         MPASS (!(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03562}03562 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03563}03563         bzero(\&c, \textcolor{keyword}{sizeof}(c));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03564}03564         c.\mbox{\hyperlink{structfw__iq__cmd_a34ef766c55b91258efc0f8bebca32d9b}{op\_to\_vfn}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_ac01d05edee6e9096ece06a6a9f53bc18}{V\_FW\_CMD\_OP}}(\mbox{\hyperlink{t4fw__interface_8h_a4f2b99c2e426902c1d83fded4f1ba4a8a491182c18268acd0c2b968a7351f6aab}{FW\_IQ\_CMD}}) | \mbox{\hyperlink{t4fw__interface_8h_ad8d6f4083ad0984c0808657aff3a25e7}{F\_FW\_CMD\_REQUEST}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03565}03565             \mbox{\hyperlink{t4fw__interface_8h_a7f0c4b44453f4318089b42c139f87348}{F\_FW\_CMD\_WRITE}} | \mbox{\hyperlink{t4fw__interface_8h_add1af22fc85285be44adffa2d7f47caf}{F\_FW\_CMD\_EXEC}} | \mbox{\hyperlink{t4fw__interface_8h_a90fa52a56a1a5fc510b3f8d3f02a0141}{V\_FW\_IQ\_CMD\_PFN}}(sc-\/>\mbox{\hyperlink{structadapter_a4bd2e26128e44b99fd08533b5ec2008a}{pf}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03566}03566             \mbox{\hyperlink{t4fw__interface_8h_af250b3b29e3d3b44ffe3f58e12e81441}{V\_FW\_IQ\_CMD\_VFN}}(0));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03567}03567 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03568}03568         c.\mbox{\hyperlink{structfw__iq__cmd_a03176f95a1cd2c4eaee03fee3a98c6f3}{alloc\_to\_len16}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_a5abfed71b4a947f15bcacae806fac0ef}{F\_FW\_IQ\_CMD\_ALLOC}} | \mbox{\hyperlink{t4fw__interface_8h_a170461257cd0599b7e19c4b60ff56b24}{F\_FW\_IQ\_CMD\_IQSTART}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03569}03569             \mbox{\hyperlink{t4fw__interface_8h_afca07ddca8aa3620b089673a07b7d20b}{FW\_LEN16}}(c));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03570}03570 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03571}03571         \textcolor{comment}{/* Special handling for firmware event queue */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03572}03572         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}} == \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a652e3029436aa18d7c3543a986be602b}{fwq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03573}03573                 v |= \mbox{\hyperlink{t4fw__interface_8h_a87ea2963130510d90ee2e87da9601aa1}{F\_FW\_IQ\_CMD\_IQASYNCH}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03574}03574 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03575}03575         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a0897c23816466990323b706f7a6a6886}{intr\_idx}} < 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03576}03576                 \textcolor{comment}{/* Forwarded interrupts, all headed to fwq */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03577}03577                 v |= \mbox{\hyperlink{t4fw__interface_8h_ab60a11cdd45ed2e954c40a4c30dee877}{F\_FW\_IQ\_CMD\_IQANDST}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03578}03578                 v |= \mbox{\hyperlink{t4fw__interface_8h_a8e234831ce02ef093de3ae93dec6873d}{V\_FW\_IQ\_CMD\_IQANDSTINDEX}}(sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a652e3029436aa18d7c3543a986be602b}{fwq}}.\mbox{\hyperlink{structsge__iq_ad7db32f3e80fe7456ed7d811ee069dee}{cntxt\_id}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03579}03579         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03580}03580                 KASSERT(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a0897c23816466990323b706f7a6a6886}{intr\_idx}} < sc-\/>\mbox{\hyperlink{structadapter_aa45b291bebe26a97a1814b9620637c59}{intr\_count}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03581}03581                     (\textcolor{stringliteral}{"{}\%s: invalid direct intr\_idx \%d"{}}, \_\_func\_\_, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a0897c23816466990323b706f7a6a6886}{intr\_idx}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03582}03582                 v |= \mbox{\hyperlink{t4fw__interface_8h_a8e234831ce02ef093de3ae93dec6873d}{V\_FW\_IQ\_CMD\_IQANDSTINDEX}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a0897c23816466990323b706f7a6a6886}{intr\_idx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03583}03583         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03584}03584 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03585}03585         bzero(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aa0b80730bff81beab7577cb1d1fe8f3d}{desc}}, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a764bf90982899051d957198d06e2f151}{qsize}} * \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba5e4c6f81de3e22bf1f3327aa24d0cbba}{IQ\_ESIZE}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03586}03586         c.\mbox{\hyperlink{structfw__iq__cmd_ae0895774f00d363854c09b2447e74a2a}{type\_to\_iqandstindex}} = htobe32(v |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03587}03587             \mbox{\hyperlink{t4fw__interface_8h_aa4385e9cfcbca4ce82eb9a3a2d3e8ee6}{V\_FW\_IQ\_CMD\_TYPE}}(\mbox{\hyperlink{t4fw__interface_8h_a072801eb4e4588e32d2a8185e8dfc6cea435e89e1513523f4272759ac4d40f5c7}{FW\_IQ\_TYPE\_FL\_INT\_CAP}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03588}03588             \mbox{\hyperlink{t4fw__interface_8h_a6544d2f9cc965e7c72a66e01901f11ab}{V\_FW\_IQ\_CMD\_VIID}}(vi-\/>\mbox{\hyperlink{structvi__info_a0fa979bb2987678e60f1837902da1399}{viid}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03589}03589             \mbox{\hyperlink{t4fw__interface_8h_afb6a8977d7d0149434e6942fc5e81631}{V\_FW\_IQ\_CMD\_IQANUD}}(\mbox{\hyperlink{t4__regs__values_8h_ab0e35cf33872e6d18491a520d28ec078}{X\_UPDATEDELIVERY\_INTERRUPT}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03590}03590         c.\mbox{\hyperlink{structfw__iq__cmd_a9da711d594e9050662740ca1803ed81b}{iqdroprss\_to\_iqesize}} = htobe16(\mbox{\hyperlink{t4fw__interface_8h_a298c942839b7cfa563ac217f2e1bd0f7}{V\_FW\_IQ\_CMD\_IQPCIECH}}(vi-\/>\mbox{\hyperlink{structvi__info_ae67f2a0e25008a327df0e02be08b5906}{pi}}-\/>\mbox{\hyperlink{structport__info_a8f6b327a3aebe073516c98344ab196b4}{tx\_chan}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03591}03591             \mbox{\hyperlink{t4fw__interface_8h_acb9e38c759b4735032e5fb426cdc0b14}{F\_FW\_IQ\_CMD\_IQGTSMODE}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03592}03592             \mbox{\hyperlink{t4fw__interface_8h_a5a2f6ba7386ccb0fa16c2974416df406}{V\_FW\_IQ\_CMD\_IQINTCNTTHRESH}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ad196e0b2beb5785161571cff8f451c2a}{intr\_pktc\_idx}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03593}03593             \mbox{\hyperlink{t4fw__interface_8h_ac2e6b284230e2da1c9528c0ce7720a50}{V\_FW\_IQ\_CMD\_IQESIZE}}(\mbox{\hyperlink{osdep_8h_a4140ded4c4b979177ad04578553a3adf}{ilog2}}(\mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba5e4c6f81de3e22bf1f3327aa24d0cbba}{IQ\_ESIZE}}) -\/ 4));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03594}03594         c.\mbox{\hyperlink{structfw__iq__cmd_a3e1b1684e4338ada94004b260a12b3f1}{iqsize}} = htobe16(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a764bf90982899051d957198d06e2f151}{qsize}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03595}03595         c.\mbox{\hyperlink{structfw__iq__cmd_a61ebecbc09154c597e2cf0bd4b9ca068}{iqaddr}} = htobe64(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a20b6b3beac95ff14a098f31634b9c697}{ba}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03596}03596         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_adbcc4d3a20653ec230e6778fe0ecc6d8}{cong}} >= 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03597}03597                 c.\mbox{\hyperlink{structfw__iq__cmd_a37924fc69367b608c6ecbb0d6df9689c}{iqns\_to\_fl0congen}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_acbdeb4c215c9aa87f03d4a2d0e7fc7dd}{F\_FW\_IQ\_CMD\_IQFLINTCONGEN}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03598}03598 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03599}03599         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03600}03600                 bzero(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad641675824ad24b021729a376f166308}{desc}}, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0f572e6a95a867a2c848d725b6e30785}{sidx}} * \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}} + sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_ad88b567efaf5d38f538214804cc4dd35}{spg\_len}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03601}03601                 c.\mbox{\hyperlink{structfw__iq__cmd_a37924fc69367b608c6ecbb0d6df9689c}{iqns\_to\_fl0congen}} |=}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03602}03602                     htobe32(\mbox{\hyperlink{t4fw__interface_8h_a69effc58f88b1155453cdec42ece35f1}{V\_FW\_IQ\_CMD\_FL0HOSTFCMODE}}(\mbox{\hyperlink{t4__regs__values_8h_a7b7f90c9cb3e43342f6425219d2d5e94}{X\_HOSTFCMODE\_NONE}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03603}03603                         \mbox{\hyperlink{t4fw__interface_8h_a1cf3319d15f3db61fbec3d26b7e1c4e1}{F\_FW\_IQ\_CMD\_FL0FETCHRO}} | \mbox{\hyperlink{t4fw__interface_8h_a2075e23bccc2130b6f88fa5f7e82a4ba}{F\_FW\_IQ\_CMD\_FL0DATARO}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03604}03604                         (\mbox{\hyperlink{t4__sge_8c_ab4e2791bbea61f64ac9d9d20708712fd}{fl\_pad}} ? \mbox{\hyperlink{t4fw__interface_8h_a8667a7ef22ed64aae797e7466af13b5a}{F\_FW\_IQ\_CMD\_FL0PADEN}} : 0) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03605}03605                         (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daa0bc2f5c770b6e332fdc75909ee8bb47}{FL\_BUF\_PACKING}} ? \mbox{\hyperlink{t4fw__interface_8h_a9c855cf57deddb51da7fe6ebe08d45ae}{F\_FW\_IQ\_CMD\_FL0PACKEN}} :}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03606}03606                             0));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03607}03607                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_adbcc4d3a20653ec230e6778fe0ecc6d8}{cong}} >= 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03608}03608                         c.\mbox{\hyperlink{structfw__iq__cmd_a37924fc69367b608c6ecbb0d6df9689c}{iqns\_to\_fl0congen}} |=}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03609}03609                                 htobe32(\mbox{\hyperlink{t4fw__interface_8h_a7ccfcff3bf60234afda7f820b4aba00f}{V\_FW\_IQ\_CMD\_FL0CNGCHMAP}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_adbcc4d3a20653ec230e6778fe0ecc6d8}{cong}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03610}03610                                     \mbox{\hyperlink{t4fw__interface_8h_a84823ac08de0a9d3baeea8a891df3d82}{F\_FW\_IQ\_CMD\_FL0CONGCIF}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03611}03611                                     \mbox{\hyperlink{t4fw__interface_8h_a3e0e46b4269bd177ee5e4e49daf10034}{F\_FW\_IQ\_CMD\_FL0CONGEN}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03612}03612                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03613}03613                 c.\mbox{\hyperlink{structfw__iq__cmd_acbe129c137d6dafbb1930e634a4e613b}{fl0dcaen\_to\_fl0cidxfthresh}} =}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03614}03614                     htobe16(\mbox{\hyperlink{t4fw__interface_8h_af912f04798f39d227f16c10d7f479354}{V\_FW\_IQ\_CMD\_FL0FBMIN}}(\mbox{\hyperlink{common_8h_a9760c128d8c5191e65faf12d0ceba0a1}{chip\_id}}(sc) <= \mbox{\hyperlink{common_8h_a2153d86ca1fc4195c2c7fa4cfaf8a57e}{CHELSIO\_T5}} ?}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03615}03615                         \mbox{\hyperlink{t4__regs__values_8h_a9fb957c0e080cc0e7396bd25b5bc7775}{X\_FETCHBURSTMIN\_128B}} : \mbox{\hyperlink{t4__regs__values_8h_a2fa4e64b2793b17d1809f6c05e774009}{X\_FETCHBURSTMIN\_64B\_T6}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03616}03616                         \mbox{\hyperlink{t4fw__interface_8h_af7127fcd0aa658c49270eb724a00e5f5}{V\_FW\_IQ\_CMD\_FL0FBMAX}}(\mbox{\hyperlink{common_8h_a9760c128d8c5191e65faf12d0ceba0a1}{chip\_id}}(sc) <= \mbox{\hyperlink{common_8h_a2153d86ca1fc4195c2c7fa4cfaf8a57e}{CHELSIO\_T5}} ?}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03617}03617                         \mbox{\hyperlink{t4__regs__values_8h_af060fab81a43e3aaa0b97b592e96d6f6}{X\_FETCHBURSTMAX\_512B}} : \mbox{\hyperlink{t4__regs__values_8h_aa075da6c413fe46de4edc8296f839c6d}{X\_FETCHBURSTMAX\_256B}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03618}03618                 c.\mbox{\hyperlink{structfw__iq__cmd_a79c3ff88bff5c023af22df6a0be97a9d}{fl0size}} = htobe16(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ab034f92049857aee5ef57d555ea1df3b}{qsize}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03619}03619                 c.\mbox{\hyperlink{structfw__iq__cmd_a0a0fe81817d6487ad06d0b83cf15ec0d}{fl0addr}} = htobe64(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a520948bc5d5605f6dec2417acbca03f3}{ba}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03620}03620         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03621}03621 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03622}03622         rc = -\/\mbox{\hyperlink{common_8h_a51ef13f7ae089117ec092cf89f8e1247}{t4\_wr\_mbox}}(sc, sc-\/>\mbox{\hyperlink{structadapter_a02cb41b39f831b9529991c57c1725aa9}{mbox}}, \&c, \textcolor{keyword}{sizeof}(c), \&c);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03623}03623         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03624}03624                 \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(sc, \textcolor{stringliteral}{"{}failed to create hw ingress queue: \%d\(\backslash\)n"{}}, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03625}03625                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03626}03626         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03627}03627 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03628}03628         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ade977c1efafcb5bb9a49a218b185e86a}{cidx}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03629}03629         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aaaf44d8d3b8d8e9073d7e6ce3af59b6c}{gen}} = \mbox{\hyperlink{t4__hw_8h_adefd29ae6bd1bea521801e26ebf391ef}{F\_RSPD\_GEN}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03630}03630         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ad7db32f3e80fe7456ed7d811ee069dee}{cntxt\_id}} = be16toh(c.\mbox{\hyperlink{structfw__iq__cmd_a3319691eb3b23be5140f349ddf9f67c7}{iqid}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03631}03631         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_acd6016cc2ef577f960207b9fa7da6b55}{abs\_id}} = be16toh(c.\mbox{\hyperlink{structfw__iq__cmd_ad3eae55d0008d3e745d93bcac1a44bbd}{physiqid}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03632}03632 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03633}03633         \mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}} = \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ad7db32f3e80fe7456ed7d811ee069dee}{cntxt\_id}} -\/ sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_ae5a74a0b473e29b59fd4c71dc81a9a3f}{iq\_start}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03634}03634         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}} >= sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_aa649e435acc4b3b08d04346863a7937c}{iqmap\_sz}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03635}03635                 panic (\textcolor{stringliteral}{"{}\%s: iq-\/>cntxt\_id (\%d) more than the max (\%d)"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03636}03636                     \mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}}, sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_aa649e435acc4b3b08d04346863a7937c}{iqmap\_sz}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03637}03637         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03638}03638         sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_af2ead80a853bcf04f8a21aa918611b01}{iqmap}}[\mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}}] = \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03639}03639 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03640}03640         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03641}03641                 u\_int qid;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03642}03642 \textcolor{preprocessor}{\#ifdef INVARIANTS}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03643}03643                 MPASS(!(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daea6e5181a0f82777f828d3a992d88b55}{FL\_BUF\_RESUME}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03644}03644                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0f572e6a95a867a2c848d725b6e30785}{sidx}} * 8; i++)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03645}03645                         MPASS(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a72d761fa3c245d6de3286e7fc055346f}{sdesc}}[i].\mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}} == NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03646}03646 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03647}03647                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_aa6b1022d80312dcf9ef34bd6900cd35b}{cntxt\_id}} = be16toh(c.\mbox{\hyperlink{structfw__iq__cmd_a2301c4295541c2ee82feb44c37c5b14b}{fl0id}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03648}03648                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad9cbe038cc934c889c10bf7c6ed3adca}{pidx}} = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a141fb92c69ac2f791c7fcc19c28d3d73}{cidx}} = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0d4baa235797170a157e790696ac257b}{hw\_cidx}} = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a37f76efd2ceb3bd65623f87d3038464f}{dbidx}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03649}03649                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03650}03650                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \&= \string~(\mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035da7823ff29cad0529311de1036bf98e6d7}{FL\_STARVING}} | \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035da13829ebcbbac07550c2f742de05a3b3d}{FL\_DOOMED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03651}03651 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03652}03652                 \mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}} = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_aa6b1022d80312dcf9ef34bd6900cd35b}{cntxt\_id}} -\/ sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a94c8ca3b0e31f396ecef496df682f245}{eq\_start}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03653}03653                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}} >= sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_aa733d2dbe299343d8d25e6dd315b61e4}{eqmap\_sz}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03654}03654                         panic(\textcolor{stringliteral}{"{}\%s: fl-\/>cntxt\_id (\%d) more than the max (\%d)"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03655}03655                             \_\_func\_\_, \mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}}, sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_aa733d2dbe299343d8d25e6dd315b61e4}{eqmap\_sz}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03656}03656                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03657}03657                 sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_ad70dbaca4e6a555317d186f7db9692ee}{eqmap}}[\mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}}] = (\textcolor{keywordtype}{void} *)\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03658}03658 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03659}03659                 qid = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_aa6b1022d80312dcf9ef34bd6900cd35b}{cntxt\_id}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03660}03660                 \textcolor{keywordflow}{if} (isset(\&sc-\/>\mbox{\hyperlink{structadapter_ae4a21f41f78cf16e0728237581092270}{doorbells}}, \mbox{\hyperlink{adapter_8h_ab04a0655cd1e3bcac5e8f48c18df1a57a7309f8ad518570ec666a104df10f9880}{DOORBELL\_UDB}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03661}03661                         uint32\_t s\_qpp = sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_aad09b64dd9cccdcddf4b6551b26939d6}{eq\_s\_qpp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03662}03662                         uint32\_t mask = (1 << s\_qpp) -\/ 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03663}03663                         \textcolor{keyword}{volatile} uint8\_t *\mbox{\hyperlink{adapter_8h_abbeda82717a25578c0c08d013e026731}{udb}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03664}03664 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03665}03665                         \mbox{\hyperlink{adapter_8h_abbeda82717a25578c0c08d013e026731}{udb}} = sc-\/>\mbox{\hyperlink{structadapter_a697d9290a0e010736410840ea37a0a8b}{udbs\_base}} + \mbox{\hyperlink{t4__hw_8h_a39fca1837c5ce7715cbf571669660c13a8ccfd743bab492083a93da4d65c6babb}{UDBS\_DB\_OFFSET}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03666}03666                         \mbox{\hyperlink{adapter_8h_abbeda82717a25578c0c08d013e026731}{udb}} += (qid >> s\_qpp) << PAGE\_SHIFT;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03667}03667                         qid \&= mask;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03668}03668                         \textcolor{keywordflow}{if} (qid < PAGE\_SIZE / \mbox{\hyperlink{t4__hw_8h_a39fca1837c5ce7715cbf571669660c13aec472c4694957cb438c9379fef82c2af}{UDBS\_SEG\_SIZE}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03669}03669                                 \mbox{\hyperlink{adapter_8h_abbeda82717a25578c0c08d013e026731}{udb}} += qid << \mbox{\hyperlink{t4__hw_8h_a39fca1837c5ce7715cbf571669660c13af17746d62e8049e458f4817f233f119e}{UDBS\_SEG\_SHIFT}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03670}03670                                 qid = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03671}03671                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03672}03672                         \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_af33dfd6a54abf7d57f9d4398047a98ab}{udb}} = (\textcolor{keyword}{volatile} \textcolor{keywordtype}{void} *)\mbox{\hyperlink{adapter_8h_abbeda82717a25578c0c08d013e026731}{udb}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03673}03673                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03674}03674                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad3651b0a48e845a4256488e35c85500d}{dbval}} = \mbox{\hyperlink{t4__regs_8h_ac26a15f515f89befafcb4e2afa88cee8}{V\_QID}}(qid) | sc-\/>\mbox{\hyperlink{structadapter_a6cdf17ab0044fc578cde6020c053be9d}{chip\_params}}-\/>\mbox{\hyperlink{structchip__params_a448707d1f3ead4143a9b1f15ae55877f}{sge\_fl\_db}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03675}03675 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03676}03676                 \mbox{\hyperlink{adapter_8h_a41c2edc639f8438bba380b1698ecb12e}{FL\_LOCK}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03677}03677                 \textcolor{comment}{/* Enough to make sure the SGE doesn't think it's starved */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03678}03678                 \mbox{\hyperlink{t4__sge_8c_ac105ed5d85881e9f6b48414965986423}{refill\_fl}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_af13f8e21456a9ea6f5808458368258e6}{lowat}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03679}03679                 \mbox{\hyperlink{adapter_8h_a63ce7ce2eb7ddaa4178b03391b6178a5}{FL\_UNLOCK}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03680}03680         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03681}03681 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03682}03682         \textcolor{keywordflow}{if} (\mbox{\hyperlink{common_8h_a9760c128d8c5191e65faf12d0ceba0a1}{chip\_id}}(sc) >= \mbox{\hyperlink{common_8h_a2153d86ca1fc4195c2c7fa4cfaf8a57e}{CHELSIO\_T5}} \&\& !(sc-\/>\mbox{\hyperlink{structadapter_a5b04a9c8ac519064f43255df133cfe84}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06cab2621d2fb00629ea783dc0442df2356d}{IS\_VF}}) \&\& \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_adbcc4d3a20653ec230e6778fe0ecc6d8}{cong}} >= 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03683}03683                 uint32\_t param, val;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03684}03684 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03685}03685                 param = \mbox{\hyperlink{t4fw__interface_8h_ab35a92be81c169ba6419133b11bf7ad8}{V\_FW\_PARAMS\_MNEM}}(\mbox{\hyperlink{t4fw__interface_8h_adea2b24889c199cb09592f0d7a7c8ab0a43a306559cdd06b741a2a4957be1b2ee}{FW\_PARAMS\_MNEM\_DMAQ}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03686}03686                     \mbox{\hyperlink{t4fw__interface_8h_ae704f385d7048b0d5b470989a5d36476}{V\_FW\_PARAMS\_PARAM\_X}}(\mbox{\hyperlink{t4fw__interface_8h_ae71bbd002cc3485ed705b4476a0af844a1eed85774a7a74a60a333fbab5c3318a}{FW\_PARAMS\_PARAM\_DMAQ\_CONM\_CTXT}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03687}03687                     \mbox{\hyperlink{t4fw__interface_8h_a6bf757777686630b745c3c6b7920a6b5}{V\_FW\_PARAMS\_PARAM\_YZ}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ad7db32f3e80fe7456ed7d811ee069dee}{cntxt\_id}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03688}03688                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_adbcc4d3a20653ec230e6778fe0ecc6d8}{cong}} == 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03689}03689                         val = 1 << 19;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03690}03690                 \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03691}03691                         val = 2 << 19;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03692}03692                         \textcolor{keywordflow}{for} (i = 0; i < 4; i++) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03693}03693                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_adbcc4d3a20653ec230e6778fe0ecc6d8}{cong}} \& (1 << i))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03694}03694                                         val |= 1 << (i << 2);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03695}03695                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03696}03696                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03697}03697 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03698}03698                 rc = -\/\mbox{\hyperlink{common_8h_a9f4f27cb2162130f369bc370c4114572}{t4\_set\_params}}(sc, sc-\/>\mbox{\hyperlink{structadapter_a02cb41b39f831b9529991c57c1725aa9}{mbox}}, sc-\/>\mbox{\hyperlink{structadapter_a4bd2e26128e44b99fd08533b5ec2008a}{pf}}, 0, 1, \&param, \&val);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03699}03699                 \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03700}03700                         \textcolor{comment}{/* report error but carry on */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03701}03701                         \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(sc, \textcolor{stringliteral}{"{}failed to set congestion manager context "{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03702}03702                             \textcolor{stringliteral}{"{}for ingress queue \%d: \%d\(\backslash\)n"{}}, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ad7db32f3e80fe7456ed7d811ee069dee}{cntxt\_id}}, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03703}03703                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03704}03704         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03705}03705 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03706}03706         \textcolor{comment}{/* Enable IQ interrupts */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03707}03707         atomic\_store\_rel\_int(\&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_aca292788492977fd0c41fb35c3cdaa85}{state}}, \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635acc3eda9696c6d327a48e281568e6c3e1}{IQS\_IDLE}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03708}03708         \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, sc-\/>\mbox{\hyperlink{structadapter_aabd38017caa2cfc7d05a0ca1ea3088d6}{sge\_gts\_reg}}, \mbox{\hyperlink{t4__regs_8h_ac1ca65e58a41f06a0f7204c54b1e7764}{V\_SEINTARM}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a356b3e09ec2c3964ec6f8122cb42b88a}{intr\_params}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03709}03709             \mbox{\hyperlink{t4__regs_8h_a82092f219f7205c46e71692dd8320f4d}{V\_INGRESSQID}}(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ad7db32f3e80fe7456ed7d811ee069dee}{cntxt\_id}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03710}03710 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03711}03711         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} |= \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03712}03712 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03713}03713         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03714}03714 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03715}03715 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03716}03716 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03717}\mbox{\hyperlink{t4__sge_8c_a39da7ed8d40c7254a8756c4ef0ce1713}{03717}} \mbox{\hyperlink{t4__sge_8c_a39da7ed8d40c7254a8756c4ef0ce1713}{free\_iq\_fl\_hwq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03718}03718 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03719}03719         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03720}03720 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03721}03721         MPASS(\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03722}03722         rc = -\/\mbox{\hyperlink{common_8h_a3368ad7f77be54f8f9c65fb2448b71db}{t4\_iq\_free}}(sc, sc-\/>\mbox{\hyperlink{structadapter_a02cb41b39f831b9529991c57c1725aa9}{mbox}}, sc-\/>\mbox{\hyperlink{structadapter_a4bd2e26128e44b99fd08533b5ec2008a}{pf}}, 0, \mbox{\hyperlink{t4fw__interface_8h_a072801eb4e4588e32d2a8185e8dfc6cea435e89e1513523f4272759ac4d40f5c7}{FW\_IQ\_TYPE\_FL\_INT\_CAP}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03723}03723             \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ad7db32f3e80fe7456ed7d811ee069dee}{cntxt\_id}}, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}} ? \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_aa6b1022d80312dcf9ef34bd6900cd35b}{cntxt\_id}} : 0xffff, 0xffff);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03724}03724         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03725}03725                 \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(sc, \textcolor{stringliteral}{"{}failed to free iq \%p: \%d\(\backslash\)n"{}}, \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03726}03726                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03727}03727         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03728}03728         \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \&= \string~IQ\_HW\_ALLOCATED;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03729}03729 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03730}03730         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03731}03731 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03732}03732 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03733}03733 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03734}\mbox{\hyperlink{t4__sge_8c_afc7094a28bd87d0c9c337929074311a6}{03734}} \mbox{\hyperlink{t4__sge_8c_afc7094a28bd87d0c9c337929074311a6}{add\_iq\_sysctls}}(\textcolor{keyword}{struct} sysctl\_ctx\_list *\mbox{\hyperlink{structadapter_a6f977d13071c9120bbcbdf1e108470ed}{ctx}}, \textcolor{keyword}{struct} sysctl\_oid *oid,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03735}03735     \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03736}03736 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03737}03737         \textcolor{keyword}{struct }sysctl\_oid\_list *children;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03738}03738 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03739}03739         \textcolor{keywordflow}{if} (ctx == NULL || oid == NULL)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03740}03740                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03741}03741 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03742}03742         children = SYSCTL\_CHILDREN(oid);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03743}03743         SYSCTL\_ADD\_UAUTO(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}ba"{}}, CTLFLAG\_RD, \&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a20b6b3beac95ff14a098f31634b9c697}{ba}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03744}03744             \textcolor{stringliteral}{"{}bus address of descriptor ring"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03745}03745         SYSCTL\_ADD\_INT(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}dmalen"{}}, CTLFLAG\_RD, NULL,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03746}03746             \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a764bf90982899051d957198d06e2f151}{qsize}} * \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba5e4c6f81de3e22bf1f3327aa24d0cbba}{IQ\_ESIZE}}, \textcolor{stringliteral}{"{}descriptor ring size in bytes"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03747}03747         SYSCTL\_ADD\_U16(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}abs\_id"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03748}03748             \&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_acd6016cc2ef577f960207b9fa7da6b55}{abs\_id}}, 0, \textcolor{stringliteral}{"{}absolute id of the queue"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03749}03749         SYSCTL\_ADD\_U16(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}cntxt\_id"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03750}03750             \&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ad7db32f3e80fe7456ed7d811ee069dee}{cntxt\_id}}, 0, \textcolor{stringliteral}{"{}SGE context id of the queue"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03751}03751         SYSCTL\_ADD\_U16(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}cidx"{}}, CTLFLAG\_RD, \&\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ade977c1efafcb5bb9a49a218b185e86a}{cidx}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03752}03752             0, \textcolor{stringliteral}{"{}consumer index"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03753}03753 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03754}03754 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03755}03755 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03756}\mbox{\hyperlink{t4__sge_8c_a5297883d6f50f02efdf48eb35dd4e774}{03756}} \mbox{\hyperlink{t4__sge_8c_a5297883d6f50f02efdf48eb35dd4e774}{add\_fl\_sysctls}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} sysctl\_ctx\_list *ctx,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03757}03757     \textcolor{keyword}{struct} sysctl\_oid *oid, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03758}03758 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03759}03759         \textcolor{keyword}{struct }sysctl\_oid\_list *children;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03760}03760 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03761}03761         \textcolor{keywordflow}{if} (ctx == NULL || oid == NULL)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03762}03762                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03763}03763 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03764}03764         children = SYSCTL\_CHILDREN(oid);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03765}03765         oid = SYSCTL\_ADD\_NODE(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}fl"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03766}03766             CTLFLAG\_RD | CTLFLAG\_MPSAFE, NULL, \textcolor{stringliteral}{"{}freelist"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03767}03767         children = SYSCTL\_CHILDREN(oid);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03768}03768 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03769}03769         SYSCTL\_ADD\_UAUTO(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}ba"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03770}03770             \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a520948bc5d5605f6dec2417acbca03f3}{ba}}, \textcolor{stringliteral}{"{}bus address of descriptor ring"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03771}03771         SYSCTL\_ADD\_INT(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}dmalen"{}}, CTLFLAG\_RD, NULL,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03772}03772             \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0f572e6a95a867a2c848d725b6e30785}{sidx}} * \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}} + sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_ad88b567efaf5d38f538214804cc4dd35}{spg\_len}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03773}03773             \textcolor{stringliteral}{"{}desc ring size in bytes"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03774}03774         SYSCTL\_ADD\_U16(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}cntxt\_id"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03775}03775             \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_aa6b1022d80312dcf9ef34bd6900cd35b}{cntxt\_id}}, 0, \textcolor{stringliteral}{"{}SGE context id of the freelist"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03776}03776         SYSCTL\_ADD\_UINT(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}padding"{}}, CTLFLAG\_RD, NULL,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03777}03777             \mbox{\hyperlink{t4__sge_8c_ab4e2791bbea61f64ac9d9d20708712fd}{fl\_pad}} ? 1 : 0, \textcolor{stringliteral}{"{}padding enabled"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03778}03778         SYSCTL\_ADD\_UINT(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}packing"{}}, CTLFLAG\_RD, NULL,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03779}03779             \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daa0bc2f5c770b6e332fdc75909ee8bb47}{FL\_BUF\_PACKING}} ? 1 : 0, \textcolor{stringliteral}{"{}packing enabled"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03780}03780         SYSCTL\_ADD\_UINT(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}cidx"{}}, CTLFLAG\_RD, \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a141fb92c69ac2f791c7fcc19c28d3d73}{cidx}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03781}03781             0, \textcolor{stringliteral}{"{}consumer index"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03782}03782         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daa0bc2f5c770b6e332fdc75909ee8bb47}{FL\_BUF\_PACKING}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03783}03783                 SYSCTL\_ADD\_UINT(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}rx\_offset"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03784}03784                     CTLFLAG\_RD, \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a51d5c4660a31cc80052693fe95dc811f}{rx\_offset}}, 0, \textcolor{stringliteral}{"{}packing rx offset"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03785}03785         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03786}03786         SYSCTL\_ADD\_UINT(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}pidx"{}}, CTLFLAG\_RD, \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad9cbe038cc934c889c10bf7c6ed3adca}{pidx}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03787}03787             0, \textcolor{stringliteral}{"{}producer index"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03788}03788         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}cluster\_allocated"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03789}03789             CTLFLAG\_RD, \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_adb30868b906ee09448bdb03dc6665a55}{cl\_allocated}}, \textcolor{stringliteral}{"{}\# of clusters allocated"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03790}03790         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}cluster\_recycled"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03791}03791             CTLFLAG\_RD, \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a89c1125ae24d5f05668ec1087d110d8f}{cl\_recycled}}, \textcolor{stringliteral}{"{}\# of clusters recycled"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03792}03792         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}cluster\_fast\_recycled"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03793}03793             CTLFLAG\_RD, \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a2cfb85e321b0f9d55ff7a282298dc0d7}{cl\_fast\_recycled}}, \textcolor{stringliteral}{"{}\# of clusters recycled (fast)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03794}03794 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03795}03795 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03796}03796 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03797}03797 \textcolor{comment}{ * Idempotent.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03798}03798 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03799}03799 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03800}\mbox{\hyperlink{t4__sge_8c_acb170e5c90249a8491cb90efe7e5059d}{03800}} \mbox{\hyperlink{t4__sge_8c_acb170e5c90249a8491cb90efe7e5059d}{alloc\_fwq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03801}03801 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03802}03802         \textcolor{keywordtype}{int} rc, intr\_idx;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03803}03803         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__iq}{sge\_iq}} *fwq = \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a652e3029436aa18d7c3543a986be602b}{fwq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03804}03804         \textcolor{keyword}{struct }\mbox{\hyperlink{structvi__info}{vi\_info}} *vi = \&sc-\/>\mbox{\hyperlink{structadapter_aafb7d49243f2cdf4baa539897fbdec0d}{port}}[0]-\/>\mbox{\hyperlink{structport__info_ad2b72407fdf992f1a96ddb0086b77760}{vi}}[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03805}03805 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03806}03806         \textcolor{keywordflow}{if} (!(fwq-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03807}03807                 MPASS(!(fwq-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03808}03808 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03809}03809                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structadapter_a5b04a9c8ac519064f43255df133cfe84}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06cab2621d2fb00629ea783dc0442df2356d}{IS\_VF}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03810}03810                         intr\_idx = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03811}03811                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03812}03812                         intr\_idx = sc-\/>\mbox{\hyperlink{structadapter_aa45b291bebe26a97a1814b9620637c59}{intr\_count}} > 1 ? 1 : 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03813}03813                 \mbox{\hyperlink{t4__sge_8c_a0383a9d8cf7c3411e3ce5988ef8f775d}{init\_iq}}(fwq, sc, 0, 0, \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55bafe7c29198116a9a3313d63c29034b3d4}{FW\_IQ\_QSIZE}}, intr\_idx, -\/1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03814}03814                 rc = \mbox{\hyperlink{t4__sge_8c_a43b589cf2cd0d6c9bf52efef32c00028}{alloc\_iq\_fl}}(vi, fwq, NULL, \&sc-\/>\mbox{\hyperlink{structadapter_a6f977d13071c9120bbcbdf1e108470ed}{ctx}}, sc-\/>\mbox{\hyperlink{structadapter_a01426d44ce420c7e82f8b5df8ae1caec}{fwq\_oid}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03815}03815                 \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03816}03816                         \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(sc, \textcolor{stringliteral}{"{}failed to allocate fwq: \%d\(\backslash\)n"{}}, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03817}03817                         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03818}03818                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03819}03819                 MPASS(fwq-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03820}03820         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03821}03821 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03822}03822         \textcolor{keywordflow}{if} (!(fwq-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03823}03823                 MPASS(fwq-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03824}03824 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03825}03825                 rc = \mbox{\hyperlink{t4__sge_8c_ad1c3f730aeb7b6b529e1969f23c5c7c2}{alloc\_iq\_fl\_hwq}}(vi, fwq, NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03826}03826                 \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03827}03827                         \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(sc, \textcolor{stringliteral}{"{}failed to create hw fwq: \%d\(\backslash\)n"{}}, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03828}03828                         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03829}03829                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03830}03830                 MPASS(fwq-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03831}03831         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03832}03832 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03833}03833         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03834}03834 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03835}03835 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03836}03836 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03837}03837 \textcolor{comment}{ * Idempotent.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03838}03838 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03839}03839 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03840}\mbox{\hyperlink{t4__sge_8c_ad69e4ac1131709f75ac5b57335a2d5f8}{03840}} \mbox{\hyperlink{t4__sge_8c_ad69e4ac1131709f75ac5b57335a2d5f8}{free\_fwq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03841}03841 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03842}03842         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__iq}{sge\_iq}} *fwq = \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a652e3029436aa18d7c3543a986be602b}{fwq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03843}03843 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03844}03844         \textcolor{keywordflow}{if} (fwq-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03845}03845                 MPASS(fwq-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03846}03846                 \mbox{\hyperlink{t4__sge_8c_a39da7ed8d40c7254a8756c4ef0ce1713}{free\_iq\_fl\_hwq}}(sc, fwq, NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03847}03847                 MPASS(!(fwq-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03848}03848         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03849}03849 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03850}03850         \textcolor{keywordflow}{if} (fwq-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03851}03851                 MPASS(!(fwq-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03852}03852                 \mbox{\hyperlink{t4__sge_8c_a776148d20afbfccd8846649528c046a4}{free\_iq\_fl}}(sc, fwq, NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03853}03853                 MPASS(!(fwq-\/>\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03854}03854         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03855}03855 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03856}03856 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03857}03857 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03858}03858 \textcolor{comment}{ * Idempotent.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03859}03859 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03860}03860 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03861}\mbox{\hyperlink{t4__sge_8c_a9ab19f6b7bd869f6e116b5b2589023f6}{03861}} \mbox{\hyperlink{t4__sge_8c_a9ab19f6b7bd869f6e116b5b2589023f6}{alloc\_ctrlq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keywordtype}{int} idx)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03862}03862 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03863}03863         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03864}03864         \textcolor{keywordtype}{char} name[16];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03865}03865         \textcolor{keyword}{struct }sysctl\_oid *oid;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03866}03866         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__wrq}{sge\_wrq}} *ctrlq = \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a9372a671bd3b97878454cf7489a7c6a6}{ctrlq}}[idx];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03867}03867 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03868}03868         MPASS(idx < sc-\/>params.nports);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03869}03869 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03870}03870         \textcolor{keywordflow}{if} (!(ctrlq-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}}.\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03871}03871                 MPASS(!(ctrlq-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}}.\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03872}03872 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03873}03873                 snprintf(name, \textcolor{keyword}{sizeof}(name), \textcolor{stringliteral}{"{}\%d"{}}, idx);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03874}03874                 oid = SYSCTL\_ADD\_NODE(\&sc-\/>\mbox{\hyperlink{structadapter_a6f977d13071c9120bbcbdf1e108470ed}{ctx}}, SYSCTL\_CHILDREN(sc-\/>\mbox{\hyperlink{structadapter_ab92c4f1b4be88c45ee3649c9b29bd967}{ctrlq\_oid}}),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03875}03875                     OID\_AUTO, name, CTLFLAG\_RD | CTLFLAG\_MPSAFE, NULL,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03876}03876                     \textcolor{stringliteral}{"{}ctrl queue"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03877}03877 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03878}03878                 snprintf(name, \textcolor{keyword}{sizeof}(name), \textcolor{stringliteral}{"{}\%s ctrlq\%d"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03879}03879                     device\_get\_nameunit(sc-\/>\mbox{\hyperlink{structadapter_aea408064601574166a737fafae5cd4a3}{dev}}), idx);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03880}03880                 \mbox{\hyperlink{t4__sge_8c_a7c78925258e7e3b91aaec525467ef32b}{init\_eq}}(sc, \&ctrlq-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}}, \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a3bee65b0acce2718193750b345f3ac3e}{EQ\_CTRL}}, \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba748ed23d79646ee020e2d6ad841a8a46}{CTRL\_EQ\_QSIZE}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03881}03881                     sc-\/>\mbox{\hyperlink{structadapter_aafb7d49243f2cdf4baa539897fbdec0d}{port}}[idx]-\/>\mbox{\hyperlink{structport__info_a8f6b327a3aebe073516c98344ab196b4}{tx\_chan}}, \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a652e3029436aa18d7c3543a986be602b}{fwq}}, name);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03882}03882                 rc = \mbox{\hyperlink{t4__sge_8c_ad454dd350a42f4f11557e41ba26b0e29}{alloc\_wrq}}(sc, NULL, ctrlq, \&sc-\/>\mbox{\hyperlink{structadapter_a6f977d13071c9120bbcbdf1e108470ed}{ctx}}, oid);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03883}03883                 \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03884}03884                         \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(sc, \textcolor{stringliteral}{"{}failed to allocate ctrlq\%d: \%d\(\backslash\)n"{}}, idx, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03885}03885                         sysctl\_remove\_oid(oid, 1, 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03886}03886                         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03887}03887                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03888}03888                 MPASS(ctrlq-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}}.\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03889}03889         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03890}03890 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03891}03891         \textcolor{keywordflow}{if} (!(ctrlq-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}}.\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03892}03892                 MPASS(ctrlq-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}}.\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03893}03893 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03894}03894                 rc = \mbox{\hyperlink{t4__sge_8c_af71a8049264ddc95eac76d1f5b081fea}{alloc\_eq\_hwq}}(sc, NULL, \&ctrlq-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03895}03895                 \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03896}03896                         \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(sc, \textcolor{stringliteral}{"{}failed to create hw ctrlq\%d: \%d\(\backslash\)n"{}}, idx, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03897}03897                         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03898}03898                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03899}03899                 MPASS(ctrlq-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}}.\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03900}03900         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03901}03901 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03902}03902         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03903}03903 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03904}03904 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03905}03905 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03906}03906 \textcolor{comment}{ * Idempotent.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03907}03907 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03908}03908 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03909}\mbox{\hyperlink{t4__sge_8c_a9cf43bfa4e52a90a90b726540134239f}{03909}} \mbox{\hyperlink{t4__sge_8c_a9cf43bfa4e52a90a90b726540134239f}{free\_ctrlq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keywordtype}{int} idx)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03910}03910 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03911}03911         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__wrq}{sge\_wrq}} *ctrlq = \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a9372a671bd3b97878454cf7489a7c6a6}{ctrlq}}[idx];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03912}03912 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03913}03913         \textcolor{keywordflow}{if} (ctrlq-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}}.\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03914}03914                 MPASS(ctrlq-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}}.\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03915}03915                 \mbox{\hyperlink{t4__sge_8c_a789211e590312421a461f63e96a64079}{free\_eq\_hwq}}(sc, NULL, \&ctrlq-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03916}03916                 MPASS(!(ctrlq-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}}.\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03917}03917         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03918}03918 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03919}03919         \textcolor{keywordflow}{if} (ctrlq-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}}.\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03920}03920                 MPASS(!(ctrlq-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}}.\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03921}03921                 \mbox{\hyperlink{t4__sge_8c_a50b9795eebe8d82881a973316b4af3ca}{free\_wrq}}(sc, ctrlq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03922}03922                 MPASS(!(ctrlq-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}}.\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03923}03923         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03924}03924 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03925}03925 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03926}03926 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03927}\mbox{\hyperlink{adapter_8h_a0f90cd85be38cdda39abfb1432bcc068}{03927}} \mbox{\hyperlink{t4__sge_8c_ab99d2f56531684431d872ce44a85eace}{tnl\_cong}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structport__info}{port\_info}} *pi, \textcolor{keywordtype}{int} drop)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03928}03928 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03929}03929 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03930}03930         \textcolor{keywordflow}{if} (drop == -\/1)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03931}03931                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03932}03932         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (drop == 1)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03933}03933                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03934}03934         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03935}03935                 \textcolor{keywordflow}{return} (pi-\/>\mbox{\hyperlink{structport__info_ade81f82a25e2615a71967d73ffe9f6f5}{rx\_e\_chan\_map}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03936}03936 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03937}03937 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03938}03938 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03939}03939 \textcolor{comment}{ * Idempotent.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03940}03940 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03941}03941 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03942}\mbox{\hyperlink{t4__sge_8c_a280f219d1e6636734df6b7b9800339af}{03942}} \mbox{\hyperlink{t4__sge_8c_a280f219d1e6636734df6b7b9800339af}{alloc\_rxq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__rxq}{sge\_rxq}} *\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}, \textcolor{keywordtype}{int} idx, \textcolor{keywordtype}{int} intr\_idx,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03943}03943     \textcolor{keywordtype}{int} maxp)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03944}03944 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03945}03945         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03946}03946         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = vi-\/>\mbox{\hyperlink{structvi__info_a5ed3e511f61e7116aa53d733d7154130}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03947}03947         \textcolor{keyword}{struct }ifnet *\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}} = vi-\/>\mbox{\hyperlink{structvi__info_aa7924c610f62f17f5e57fdfc83e09ea0}{ifp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03948}03948         \textcolor{keyword}{struct }sysctl\_oid *oid;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03949}03949         \textcolor{keywordtype}{char} name[16];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03950}03950 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03951}03951         \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03952}03952                 MPASS(!(\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03953}03953 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03954}03954                 rc = tcp\_lro\_init\_args(\&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a5d3c964f9629fc3bd81dd1ff3b5e7332}{lro}}, \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}, \mbox{\hyperlink{t4__sge_8c_a4410a6b7d948c22483e1fec53c89749f}{lro\_entries}}, \mbox{\hyperlink{t4__sge_8c_a04383ab04ebedc7c0a53b4571e3930d3}{lro\_mbufs}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03955}03955                 \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03956}03956                         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03957}03957                 MPASS(\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a5d3c964f9629fc3bd81dd1ff3b5e7332}{lro}}.ifp == \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}});    \textcolor{comment}{/* also indicates LRO init'ed */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03958}03958 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03959}03959                 \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_ad2829ade146792cd5e2595bfca452a8a}{ifp}} = \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03960}03960 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03961}03961                 snprintf(name, \textcolor{keyword}{sizeof}(name), \textcolor{stringliteral}{"{}\%d"{}}, idx);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03962}03962                 oid = SYSCTL\_ADD\_NODE(\&vi-\/>\mbox{\hyperlink{structvi__info_a70c4ab3863c437b93f8dd41fb47548af}{ctx}}, SYSCTL\_CHILDREN(vi-\/>\mbox{\hyperlink{structvi__info_a7fc0d6d39e42f778c08410f236b21646}{rxq\_oid}}),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03963}03963                     OID\_AUTO, name, CTLFLAG\_RD | CTLFLAG\_MPSAFE, NULL,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03964}03964                     \textcolor{stringliteral}{"{}rx queue"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03965}03965 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03966}03966                 \mbox{\hyperlink{t4__sge_8c_a0383a9d8cf7c3411e3ce5988ef8f775d}{init\_iq}}(\&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}, sc, vi-\/>\mbox{\hyperlink{structvi__info_a3242f0893b83d919020facaec11cd660}{tmr\_idx}}, vi-\/>\mbox{\hyperlink{structvi__info_af142658e2ca8ebb37bcd6d36b73cd053}{pktc\_idx}}, vi-\/>\mbox{\hyperlink{structvi__info_a84ef8545794729a9c93c5e482ccac0ad}{qsize\_rxq}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03967}03967                     intr\_idx, \mbox{\hyperlink{t4__sge_8c_ab99d2f56531684431d872ce44a85eace}{tnl\_cong}}(vi-\/>\mbox{\hyperlink{structvi__info_ae67f2a0e25008a327df0e02be08b5906}{pi}}, \mbox{\hyperlink{t4__sge_8c_a16e95a619bd0b203622b81e9984bde07}{cong\_drop}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03968}03968 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03969}03969                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_capenable \& IFCAP\_LRO)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03970}03970                         \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} |= \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635aa23c24e7874c882f9e05ac0349f3cd14}{IQ\_LRO\_ENABLED}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03971}03971 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03972}03972                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_capenable \& IFCAP\_HWRXTSTMP)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03973}03973                         \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} |= \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635abc6c1312d9f7249e5ded2d87540540e7}{IQ\_RX\_TIMESTAMP}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03974}03974                 snprintf(name, \textcolor{keyword}{sizeof}(name), \textcolor{stringliteral}{"{}\%s rxq\%d-\/fl"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03975}03975                     device\_get\_nameunit(vi-\/>\mbox{\hyperlink{structvi__info_a231acb6eb384d964991a1e42e24f4c55}{dev}}), idx);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03976}03976                 \mbox{\hyperlink{t4__sge_8c_a3289b3d275f3e30cae9dd2c0e65121ff}{init\_fl}}(sc, \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_acf98953f87dbe498d53bcf87c91db6a4}{fl}}, vi-\/>\mbox{\hyperlink{structvi__info_a84ef8545794729a9c93c5e482ccac0ad}{qsize\_rxq}} / 8, maxp, name);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03977}03977                 rc = \mbox{\hyperlink{t4__sge_8c_a43b589cf2cd0d6c9bf52efef32c00028}{alloc\_iq\_fl}}(vi, \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}, \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_acf98953f87dbe498d53bcf87c91db6a4}{fl}}, \&vi-\/>\mbox{\hyperlink{structvi__info_a70c4ab3863c437b93f8dd41fb47548af}{ctx}}, oid);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03978}03978                 \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03979}03979                         \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(vi, \textcolor{stringliteral}{"{}failed to allocate rxq\%d: \%d\(\backslash\)n"{}}, idx, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03980}03980                         sysctl\_remove\_oid(oid, 1, 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03981}03981 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03982}03982                         tcp\_lro\_free(\&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a5d3c964f9629fc3bd81dd1ff3b5e7332}{lro}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03983}03983                         \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a5d3c964f9629fc3bd81dd1ff3b5e7332}{lro}}.ifp = NULL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03984}03984 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03985}03985                         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03986}03986                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03987}03987                 MPASS(\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03988}03988                 \mbox{\hyperlink{t4__sge_8c_a17ca2509cb02bb0544e35cb1c09166cf}{add\_rxq\_sysctls}}(\&vi-\/>\mbox{\hyperlink{structvi__info_a70c4ab3863c437b93f8dd41fb47548af}{ctx}}, oid, \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03989}03989         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03990}03990 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03991}03991         \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03992}03992                 MPASS(\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03993}03993                 rc = \mbox{\hyperlink{t4__sge_8c_ad1c3f730aeb7b6b529e1969f23c5c7c2}{alloc\_iq\_fl\_hwq}}(vi, \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}, \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_acf98953f87dbe498d53bcf87c91db6a4}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03994}03994                 \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03995}03995                         \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(vi, \textcolor{stringliteral}{"{}failed to create hw rxq\%d: \%d\(\backslash\)n"{}}, idx, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03996}03996                         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03997}03997                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03998}03998                 MPASS(\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l03999}03999 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04000}04000                 \textcolor{keywordflow}{if} (idx == 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04001}04001                         sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a4d2f1809bd4f7a7d0528e2f23effb227}{iq\_base}} = \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_acd6016cc2ef577f960207b9fa7da6b55}{abs\_id}} -\/ \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_ad7db32f3e80fe7456ed7d811ee069dee}{cntxt\_id}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04002}04002                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04003}04003                         KASSERT(\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_ad7db32f3e80fe7456ed7d811ee069dee}{cntxt\_id}} + sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a4d2f1809bd4f7a7d0528e2f23effb227}{iq\_base}} == \mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_acd6016cc2ef577f960207b9fa7da6b55}{abs\_id}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04004}04004                             (\textcolor{stringliteral}{"{}iq\_base mismatch"{}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04005}04005                 KASSERT(sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a4d2f1809bd4f7a7d0528e2f23effb227}{iq\_base}} == 0 || sc-\/>\mbox{\hyperlink{structadapter_a5b04a9c8ac519064f43255df133cfe84}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06cab2621d2fb00629ea783dc0442df2356d}{IS\_VF}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04006}04006                     (\textcolor{stringliteral}{"{}PF with non-\/zero iq\_base"{}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04007}04007 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04008}04008                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04009}04009 \textcolor{comment}{                 * The freelist is just barely above the starvation threshold}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04010}04010 \textcolor{comment}{                 * right now, fill it up a bit more.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04011}04011 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04012}04012                 \mbox{\hyperlink{adapter_8h_a41c2edc639f8438bba380b1698ecb12e}{FL\_LOCK}}(\&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_acf98953f87dbe498d53bcf87c91db6a4}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04013}04013                 \mbox{\hyperlink{t4__sge_8c_ac105ed5d85881e9f6b48414965986423}{refill\_fl}}(sc, \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_acf98953f87dbe498d53bcf87c91db6a4}{fl}}, 128);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04014}04014                 \mbox{\hyperlink{adapter_8h_a63ce7ce2eb7ddaa4178b03391b6178a5}{FL\_UNLOCK}}(\&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_acf98953f87dbe498d53bcf87c91db6a4}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04015}04015         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04016}04016 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04017}04017         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04018}04018 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04019}04019 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04020}04020 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04021}04021 \textcolor{comment}{ * Idempotent.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04022}04022 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04023}04023 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04024}\mbox{\hyperlink{t4__sge_8c_a8313c565677706e732edaf02c788815c}{04024}} \mbox{\hyperlink{t4__sge_8c_a8313c565677706e732edaf02c788815c}{free\_rxq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__rxq}{sge\_rxq}} *\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04025}04025 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04026}04026         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04027}04027                 MPASS(\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04028}04028                 \mbox{\hyperlink{t4__sge_8c_a39da7ed8d40c7254a8756c4ef0ce1713}{free\_iq\_fl\_hwq}}(vi-\/>\mbox{\hyperlink{structvi__info_a5ed3e511f61e7116aa53d733d7154130}{adapter}}, \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}, \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_acf98953f87dbe498d53bcf87c91db6a4}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04029}04029                 MPASS(!(\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04030}04030         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04031}04031 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04032}04032         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04033}04033                 MPASS(!(\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04034}04034 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04035}04035                 tcp\_lro\_free(\&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a5d3c964f9629fc3bd81dd1ff3b5e7332}{lro}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04036}04036 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04037}04037                 \mbox{\hyperlink{t4__sge_8c_a776148d20afbfccd8846649528c046a4}{free\_iq\_fl}}(vi-\/>\mbox{\hyperlink{structvi__info_a5ed3e511f61e7116aa53d733d7154130}{adapter}}, \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}, \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_acf98953f87dbe498d53bcf87c91db6a4}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04038}04038                 MPASS(!(\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04039}04039                 bzero(\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}, \textcolor{keyword}{sizeof}(*\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04040}04040         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04041}04041 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04042}04042 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04043}04043 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04044}\mbox{\hyperlink{t4__sge_8c_a17ca2509cb02bb0544e35cb1c09166cf}{04044}} \mbox{\hyperlink{t4__sge_8c_a17ca2509cb02bb0544e35cb1c09166cf}{add\_rxq\_sysctls}}(\textcolor{keyword}{struct} sysctl\_ctx\_list *ctx, \textcolor{keyword}{struct} sysctl\_oid *oid,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04045}04045     \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__rxq}{sge\_rxq}} *\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04046}04046 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04047}04047         \textcolor{keyword}{struct }sysctl\_oid\_list *children;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04048}04048 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04049}04049         \textcolor{keywordflow}{if} (ctx == NULL || oid == NULL)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04050}04050                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04051}04051 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04052}04052         children = SYSCTL\_CHILDREN(oid);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04053}04053 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04054}04054         SYSCTL\_ADD\_U64(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}lro\_queued"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04055}04055             \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a5d3c964f9629fc3bd81dd1ff3b5e7332}{lro}}.lro\_queued, 0, NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04056}04056         SYSCTL\_ADD\_U64(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}lro\_flushed"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04057}04057             \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a5d3c964f9629fc3bd81dd1ff3b5e7332}{lro}}.lro\_flushed, 0, NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04058}04058 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04059}04059         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}rxcsum"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04060}04060             \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a055450daaaafc7f6fd9b7b513fc6916c}{rxcsum}}, \textcolor{stringliteral}{"{}\# of times hardware assisted with checksum"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04061}04061         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}vlan\_extraction"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04062}04062             \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_af549f76c4f549fb1549acd1889cba67e}{vlan\_extraction}}, \textcolor{stringliteral}{"{}\# of times hardware extracted 802.1Q tag"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04063}04063         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}vxlan\_rxcsum"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04064}04064             \&\mbox{\hyperlink{adapter_8h_a4851d72f41e3aefc5232396335af0496}{rxq}}-\/>\mbox{\hyperlink{structsge__rxq_a1709008f274b76ccb6fa3aed2468bb3f}{vxlan\_rxcsum}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04065}04065             \textcolor{stringliteral}{"{}\# of times hardware assisted with inner checksum (VXLAN)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04066}04066 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04067}04067 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04068}04068 \textcolor{preprocessor}{\#ifdef TCP\_OFFLOAD}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04069}04069 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04070}04070 \textcolor{comment}{ * Idempotent.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04071}04071 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04072}04072 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04073}04073 alloc\_ofld\_rxq(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__ofld__rxq}{sge\_ofld\_rxq}} *ofld\_rxq, \textcolor{keywordtype}{int} idx,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04074}04074     \textcolor{keywordtype}{int} intr\_idx, \textcolor{keywordtype}{int} maxp)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04075}04075 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04076}04076         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04077}04077         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = vi-\/>\mbox{\hyperlink{structvi__info_a5ed3e511f61e7116aa53d733d7154130}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04078}04078         \textcolor{keyword}{struct }sysctl\_oid *oid;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04079}04079         \textcolor{keywordtype}{char} name[16];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04080}04080 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04081}04081         \textcolor{keywordflow}{if} (!(ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04082}04082                 MPASS(!(ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04083}04083 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04084}04084                 snprintf(name, \textcolor{keyword}{sizeof}(name), \textcolor{stringliteral}{"{}\%d"{}}, idx);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04085}04085                 oid = SYSCTL\_ADD\_NODE(\&vi-\/>\mbox{\hyperlink{structvi__info_a70c4ab3863c437b93f8dd41fb47548af}{ctx}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04086}04086                     SYSCTL\_CHILDREN(vi-\/>\mbox{\hyperlink{structvi__info_a752828bce84c179cdfda8ae8c0984ff3}{ofld\_rxq\_oid}}), OID\_AUTO, name,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04087}04087                     CTLFLAG\_RD | CTLFLAG\_MPSAFE, NULL, \textcolor{stringliteral}{"{}offload rx queue"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04088}04088 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04089}04089                 \mbox{\hyperlink{t4__sge_8c_a0383a9d8cf7c3411e3ce5988ef8f775d}{init\_iq}}(\&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}, sc, vi-\/>\mbox{\hyperlink{structvi__info_a928c913c51f2fee3c1f5b39659a744b2}{ofld\_tmr\_idx}}, vi-\/>\mbox{\hyperlink{structvi__info_a99e0205646ca4f235e5c19525adfeb07}{ofld\_pktc\_idx}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04090}04090                     vi-\/>\mbox{\hyperlink{structvi__info_a84ef8545794729a9c93c5e482ccac0ad}{qsize\_rxq}}, intr\_idx, 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04091}04091                 snprintf(name, \textcolor{keyword}{sizeof}(name), \textcolor{stringliteral}{"{}\%s ofld\_rxq\%d-\/fl"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04092}04092                     device\_get\_nameunit(vi-\/>\mbox{\hyperlink{structvi__info_a231acb6eb384d964991a1e42e24f4c55}{dev}}), idx);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04093}04093                 \mbox{\hyperlink{t4__sge_8c_a3289b3d275f3e30cae9dd2c0e65121ff}{init\_fl}}(sc, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a5edc83f088fd1080f604605adafd6da0}{fl}}, vi-\/>\mbox{\hyperlink{structvi__info_a84ef8545794729a9c93c5e482ccac0ad}{qsize\_rxq}} / 8, maxp, name);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04094}04094                 rc = \mbox{\hyperlink{t4__sge_8c_a43b589cf2cd0d6c9bf52efef32c00028}{alloc\_iq\_fl}}(vi, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a5edc83f088fd1080f604605adafd6da0}{fl}}, \&vi-\/>\mbox{\hyperlink{structvi__info_a70c4ab3863c437b93f8dd41fb47548af}{ctx}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04095}04095                     oid);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04096}04096                 \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04097}04097                         \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(vi, \textcolor{stringliteral}{"{}failed to allocate ofld\_rxq\%d: \%d\(\backslash\)n"{}}, idx,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04098}04098                             rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04099}04099                         sysctl\_remove\_oid(oid, 1, 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04100}04100                         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04101}04101                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04102}04102                 MPASS(ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04103}04103                 ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_af7521114dc796902cfbce447aa0ab32b}{rx\_iscsi\_ddp\_setup\_ok}} = counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04104}04104                 ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a00e505e1446271d3d44be1996c0dc8a4}{rx\_iscsi\_ddp\_setup\_error}} =}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04105}04105                     counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04106}04106                 add\_ofld\_rxq\_sysctls(\&vi-\/>\mbox{\hyperlink{structvi__info_a70c4ab3863c437b93f8dd41fb47548af}{ctx}}, oid, ofld\_rxq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04107}04107         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04108}04108 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04109}04109         \textcolor{keywordflow}{if} (!(ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04110}04110                 MPASS(ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04111}04111                 rc = \mbox{\hyperlink{t4__sge_8c_ad1c3f730aeb7b6b529e1969f23c5c7c2}{alloc\_iq\_fl\_hwq}}(vi, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a5edc83f088fd1080f604605adafd6da0}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04112}04112                 \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04113}04113                         \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(vi, \textcolor{stringliteral}{"{}failed to create hw ofld\_rxq\%d: \%d\(\backslash\)n"{}}, idx,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04114}04114                             rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04115}04115                         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04116}04116                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04117}04117                 MPASS(ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04118}04118         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04119}04119         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04120}04120 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04121}04121 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04122}04122 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04123}04123 \textcolor{comment}{ * Idempotent.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04124}04124 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04125}04125 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04126}04126 free\_ofld\_rxq(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__ofld__rxq}{sge\_ofld\_rxq}} *ofld\_rxq)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04127}04127 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04128}04128         \textcolor{keywordflow}{if} (ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04129}04129                 MPASS(ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04130}04130                 \mbox{\hyperlink{t4__sge_8c_a39da7ed8d40c7254a8756c4ef0ce1713}{free\_iq\_fl\_hwq}}(vi-\/>\mbox{\hyperlink{structvi__info_a5ed3e511f61e7116aa53d733d7154130}{adapter}}, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a5edc83f088fd1080f604605adafd6da0}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04131}04131                 MPASS(!(ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04132}04132         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04133}04133 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04134}04134         \textcolor{keywordflow}{if} (ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04135}04135                 MPASS(!(ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635a3d6ac66bc6ff6318ed6ac773f3b57b9e}{IQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04136}04136                 \mbox{\hyperlink{t4__sge_8c_a776148d20afbfccd8846649528c046a4}{free\_iq\_fl}}(vi-\/>\mbox{\hyperlink{structvi__info_a5ed3e511f61e7116aa53d733d7154130}{adapter}}, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a5edc83f088fd1080f604605adafd6da0}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04137}04137                 MPASS(!(ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}.\mbox{\hyperlink{structsge__iq_a552bdbc0c03798b163c9c1793c7a2498}{flags}} \& \mbox{\hyperlink{adapter_8h_a726ca809ffd3d67ab4b8476646f26635ab41578b6ca12dce780b75a5adc199958}{IQ\_SW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04138}04138                 counter\_u64\_free(ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_af7521114dc796902cfbce447aa0ab32b}{rx\_iscsi\_ddp\_setup\_ok}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04139}04139                 counter\_u64\_free(ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a00e505e1446271d3d44be1996c0dc8a4}{rx\_iscsi\_ddp\_setup\_error}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04140}04140                 bzero(ofld\_rxq, \textcolor{keyword}{sizeof}(*ofld\_rxq));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04141}04141         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04142}04142 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04143}04143 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04144}04144 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04145}04145 add\_ofld\_rxq\_sysctls(\textcolor{keyword}{struct} sysctl\_ctx\_list *ctx, \textcolor{keyword}{struct} sysctl\_oid *oid,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04146}04146     \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__ofld__rxq}{sge\_ofld\_rxq}} *ofld\_rxq)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04147}04147 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04148}04148         \textcolor{keyword}{struct }sysctl\_oid\_list *children;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04149}04149 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04150}04150         \textcolor{keywordflow}{if} (ctx == NULL || oid == NULL)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04151}04151                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04152}04152 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04153}04153         children = SYSCTL\_CHILDREN(oid);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04154}04154         SYSCTL\_ADD\_ULONG(ctx, children, OID\_AUTO,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04155}04155             \textcolor{stringliteral}{"{}rx\_toe\_tls\_records"{}}, CTLFLAG\_RD, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a37e5c8588c864fba78fd9366978680c1}{rx\_toe\_tls\_records}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04156}04156             \textcolor{stringliteral}{"{}\# of TOE TLS records received"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04157}04157         SYSCTL\_ADD\_ULONG(ctx, children, OID\_AUTO,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04158}04158             \textcolor{stringliteral}{"{}rx\_toe\_tls\_octets"{}}, CTLFLAG\_RD, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a9a0df0cb7a26f0dde2e17d1215013602}{rx\_toe\_tls\_octets}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04159}04159             \textcolor{stringliteral}{"{}\# of payload octets in received TOE TLS records"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04160}04160 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04161}04161         oid = SYSCTL\_ADD\_NODE(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}iscsi"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04162}04162             CTLFLAG\_RD | CTLFLAG\_MPSAFE, NULL, \textcolor{stringliteral}{"{}TOE iSCSI statistics"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04163}04163         children = SYSCTL\_CHILDREN(oid);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04164}04164 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04165}04165         SYSCTL\_ADD\_COUNTER\_U64(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}ddp\_setup\_ok"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04166}04166             CTLFLAG\_RD, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_af7521114dc796902cfbce447aa0ab32b}{rx\_iscsi\_ddp\_setup\_ok}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04167}04167             \textcolor{stringliteral}{"{}\# of times DDP buffer was setup successfully."{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04168}04168         SYSCTL\_ADD\_COUNTER\_U64(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}ddp\_setup\_error"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04169}04169             CTLFLAG\_RD, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a00e505e1446271d3d44be1996c0dc8a4}{rx\_iscsi\_ddp\_setup\_error}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04170}04170             \textcolor{stringliteral}{"{}\# of times DDP buffer setup failed."{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04171}04171         SYSCTL\_ADD\_U64(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}ddp\_octets"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04172}04172             CTLFLAG\_RD, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a6bf8032ee46707a6ee064e4768e8f8d2}{rx\_iscsi\_ddp\_octets}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04173}04173             \textcolor{stringliteral}{"{}\# of octets placed directly"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04174}04174         SYSCTL\_ADD\_U64(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}ddp\_pdus"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04175}04175             CTLFLAG\_RD, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a2283cd087ac96537faaf48f8d334db38}{rx\_iscsi\_ddp\_pdus}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04176}04176             \textcolor{stringliteral}{"{}\# of PDUs with data placed directly."{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04177}04177         SYSCTL\_ADD\_U64(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}fl\_octets"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04178}04178             CTLFLAG\_RD, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a4dd606b4d94f88191918072d74dd643a}{rx\_iscsi\_fl\_octets}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04179}04179             \textcolor{stringliteral}{"{}\# of data octets delivered in freelist"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04180}04180         SYSCTL\_ADD\_U64(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}fl\_pdus"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04181}04181             CTLFLAG\_RD, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a1200b61c287e9161d1249e5d6104856f}{rx\_iscsi\_fl\_pdus}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04182}04182             \textcolor{stringliteral}{"{}\# of PDUs with data delivered in freelist"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04183}04183         SYSCTL\_ADD\_U64(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}padding\_errors"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04184}04184             CTLFLAG\_RD, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_ae32fca9c6e16955d1c543308663a759b}{rx\_iscsi\_padding\_errors}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04185}04185             \textcolor{stringliteral}{"{}\# of PDUs with invalid padding"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04186}04186         SYSCTL\_ADD\_U64(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}header\_digest\_errors"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04187}04187             CTLFLAG\_RD, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a96d8308be5dfbf13a097e80ffb822985}{rx\_iscsi\_header\_digest\_errors}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04188}04188             \textcolor{stringliteral}{"{}\# of PDUs with invalid header digests"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04189}04189         SYSCTL\_ADD\_U64(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}data\_digest\_errors"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04190}04190             CTLFLAG\_RD, \&ofld\_rxq-\/>\mbox{\hyperlink{structsge__ofld__rxq_a6872f780d8637924d6789e017bf0e57c}{rx\_iscsi\_data\_digest\_errors}}, 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04191}04191             \textcolor{stringliteral}{"{}\# of PDUs with invalid data digests"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04192}04192 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04193}04193 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04194}04194 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04195}04195 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04196}04196 \textcolor{comment}{ * Returns a reasonable automatic cidx flush threshold for a given queue size.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04197}04197 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04198}04198 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04199}\mbox{\hyperlink{t4__sge_8c_a2c8672d27c1176c6b37f17c388f0911e}{04199}} \mbox{\hyperlink{t4__sge_8c_a2c8672d27c1176c6b37f17c388f0911e}{qsize\_to\_fthresh}}(\textcolor{keywordtype}{int} qsize)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04200}04200 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04201}04201         u\_int fthresh;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04202}04202 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04203}04203         \textcolor{keywordflow}{while} (!powerof2(qsize))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04204}04204                 qsize++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04205}04205         fthresh = \mbox{\hyperlink{osdep_8h_a4140ded4c4b979177ad04578553a3adf}{ilog2}}(qsize);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04206}04206         \textcolor{keywordflow}{if} (fthresh > \mbox{\hyperlink{t4__regs__values_8h_a8efb937aaaa842a6523bcc7a6b753f1b}{X\_CIDXFLUSHTHRESH\_128}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04207}04207                 fthresh = \mbox{\hyperlink{t4__regs__values_8h_a8efb937aaaa842a6523bcc7a6b753f1b}{X\_CIDXFLUSHTHRESH\_128}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04208}04208 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04209}04209         \textcolor{keywordflow}{return} (fthresh);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04210}04210 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04211}04211 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04212}04212 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04213}\mbox{\hyperlink{t4__sge_8c_ac47f777ad76b27ca26696842076fde68}{04213}} \mbox{\hyperlink{t4__sge_8c_ac47f777ad76b27ca26696842076fde68}{ctrl\_eq\_alloc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04214}04214 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04215}04215         \textcolor{keywordtype}{int} rc, \mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04216}04216         \textcolor{keyword}{struct }\mbox{\hyperlink{structfw__eq__ctrl__cmd}{fw\_eq\_ctrl\_cmd}} c;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04217}04217         \textcolor{keywordtype}{int} qsize = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} + sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_ad88b567efaf5d38f538214804cc4dd35}{spg\_len}} / \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04218}04218 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04219}04219         bzero(\&c, \textcolor{keyword}{sizeof}(c));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04220}04220 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04221}04221         c.\mbox{\hyperlink{structfw__eq__ctrl__cmd_aaf48ff2041687de18ee69058cd28f75b}{op\_to\_vfn}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_ac01d05edee6e9096ece06a6a9f53bc18}{V\_FW\_CMD\_OP}}(\mbox{\hyperlink{t4fw__interface_8h_a4f2b99c2e426902c1d83fded4f1ba4a8aaf1666c18d529759dd4913f6cbf395ba}{FW\_EQ\_CTRL\_CMD}}) | \mbox{\hyperlink{t4fw__interface_8h_ad8d6f4083ad0984c0808657aff3a25e7}{F\_FW\_CMD\_REQUEST}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04222}04222             \mbox{\hyperlink{t4fw__interface_8h_a7f0c4b44453f4318089b42c139f87348}{F\_FW\_CMD\_WRITE}} | \mbox{\hyperlink{t4fw__interface_8h_add1af22fc85285be44adffa2d7f47caf}{F\_FW\_CMD\_EXEC}} | \mbox{\hyperlink{t4fw__interface_8h_af6863be28d46adf70ec9ecf4c0f4c495}{V\_FW\_EQ\_CTRL\_CMD\_PFN}}(sc-\/>\mbox{\hyperlink{structadapter_a4bd2e26128e44b99fd08533b5ec2008a}{pf}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04223}04223             \mbox{\hyperlink{t4fw__interface_8h_adce4312fb29f390a7f53c4621a8b8b69}{V\_FW\_EQ\_CTRL\_CMD\_VFN}}(0));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04224}04224         c.\mbox{\hyperlink{structfw__eq__ctrl__cmd_aac4584d4854bb41843bad025e4cea028}{alloc\_to\_len16}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_a591dab32f6ef713732e6d877352c5f6b}{F\_FW\_EQ\_CTRL\_CMD\_ALLOC}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04225}04225             \mbox{\hyperlink{t4fw__interface_8h_a59d1ce4236ce9a6b0bf3bbfa1ebab8b5}{F\_FW\_EQ\_CTRL\_CMD\_EQSTART}} | \mbox{\hyperlink{t4fw__interface_8h_afca07ddca8aa3620b089673a07b7d20b}{FW\_LEN16}}(c));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04226}04226         c.\mbox{\hyperlink{structfw__eq__ctrl__cmd_a7d2aa269067c23736b7ead40487907b1}{cmpliqid\_eqid}} = htonl(\mbox{\hyperlink{t4fw__interface_8h_a014e0f126ff4eed68b6c9a3a0fa2c5e3}{V\_FW\_EQ\_CTRL\_CMD\_CMPLIQID}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ac787bb5caab17934ff10c967ffa55ddb}{iqid}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04227}04227         c.\mbox{\hyperlink{structfw__eq__ctrl__cmd_a9dc42432acb0588ab30c2c798d0bc127}{physeqid\_pkd}} = htobe32(0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04228}04228         c.\mbox{\hyperlink{structfw__eq__ctrl__cmd_a6f7cc2e24371730e0819a2d9ec7b2c4c}{fetchszm\_to\_iqid}} =}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04229}04229             htobe32(\mbox{\hyperlink{t4fw__interface_8h_a3926be2b13c11db44486f82194b18983}{V\_FW\_EQ\_CTRL\_CMD\_HOSTFCMODE}}(\mbox{\hyperlink{t4__regs__values_8h_a81bd2dd393934de0d1d2feb0184713ad}{X\_HOSTFCMODE\_STATUS\_PAGE}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04230}04230                 \mbox{\hyperlink{t4fw__interface_8h_a1bbf3f6d7a3f4a424be29d31303b8d57}{V\_FW\_EQ\_CTRL\_CMD\_PCIECHN}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a214dbfee0f0274229b4a684e2cce42c6}{tx\_chan}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04231}04231                 \mbox{\hyperlink{t4fw__interface_8h_aa6bf5f1c32192c9b54f6fa58bd39fc9c}{F\_FW\_EQ\_CTRL\_CMD\_FETCHRO}} | \mbox{\hyperlink{t4fw__interface_8h_aba3ab95f9a45ec29af8921aa59938979}{V\_FW\_EQ\_CTRL\_CMD\_IQID}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ac787bb5caab17934ff10c967ffa55ddb}{iqid}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04232}04232         c.\mbox{\hyperlink{structfw__eq__ctrl__cmd_a0328a4221fff26d2e8873d86468a230f}{dcaen\_to\_eqsize}} =}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04233}04233             htobe32(\mbox{\hyperlink{t4fw__interface_8h_a024cc5a66897de71c12e3f4f42014ec3}{V\_FW\_EQ\_CTRL\_CMD\_FBMIN}}(\mbox{\hyperlink{common_8h_a9760c128d8c5191e65faf12d0ceba0a1}{chip\_id}}(sc) <= \mbox{\hyperlink{common_8h_a2153d86ca1fc4195c2c7fa4cfaf8a57e}{CHELSIO\_T5}} ?}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04234}04234                 \mbox{\hyperlink{t4__regs__values_8h_a38480ce9a21f3ab513027667cc6360c3}{X\_FETCHBURSTMIN\_64B}} : \mbox{\hyperlink{t4__regs__values_8h_a2fa4e64b2793b17d1809f6c05e774009}{X\_FETCHBURSTMIN\_64B\_T6}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04235}04235                 \mbox{\hyperlink{t4fw__interface_8h_a7d8093fb0fef33fb56cd4baa3c85d8fa}{V\_FW\_EQ\_CTRL\_CMD\_FBMAX}}(\mbox{\hyperlink{t4__regs__values_8h_af060fab81a43e3aaa0b97b592e96d6f6}{X\_FETCHBURSTMAX\_512B}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04236}04236                 \mbox{\hyperlink{t4fw__interface_8h_ae3f6f2ddb1f72950bbf603af5550c0af}{V\_FW\_EQ\_CTRL\_CMD\_CIDXFTHRESH}}(\mbox{\hyperlink{t4__sge_8c_a2c8672d27c1176c6b37f17c388f0911e}{qsize\_to\_fthresh}}(qsize)) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04237}04237                 \mbox{\hyperlink{t4fw__interface_8h_a9c037609a3eb6839dc56d0077bdb9847}{V\_FW\_EQ\_CTRL\_CMD\_EQSIZE}}(qsize));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04238}04238         c.\mbox{\hyperlink{structfw__eq__ctrl__cmd_a030e6f719164a31c383f01e6b9ef1856}{eqaddr}} = htobe64(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_afb31b1b8daa367e09eaf0782f989cc2a}{ba}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04239}04239 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04240}04240         rc = -\/\mbox{\hyperlink{common_8h_a51ef13f7ae089117ec092cf89f8e1247}{t4\_wr\_mbox}}(sc, sc-\/>\mbox{\hyperlink{structadapter_a02cb41b39f831b9529991c57c1725aa9}{mbox}}, \&c, \textcolor{keyword}{sizeof}(c), \&c);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04241}04241         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04242}04242                 \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(sc, \textcolor{stringliteral}{"{}failed to create hw ctrlq for tx\_chan \%d: \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04243}04243                     \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a214dbfee0f0274229b4a684e2cce42c6}{tx\_chan}}, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04244}04244                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04245}04245         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04246}04246 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04247}04247         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a5603f20241fd4fdfa43daafdcab72e9c}{cntxt\_id}} = \mbox{\hyperlink{t4fw__interface_8h_ab9c6e9025170eaf3a890fd766b18402c}{G\_FW\_EQ\_CTRL\_CMD\_EQID}}(be32toh(c.\mbox{\hyperlink{structfw__eq__ctrl__cmd_a7d2aa269067c23736b7ead40487907b1}{cmpliqid\_eqid}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04248}04248         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ac2dfe23b9f5193c5899f52d18ee4e368}{abs\_id}} = \mbox{\hyperlink{t4fw__interface_8h_afa6350687fff5608b80b67c080450e00}{G\_FW\_EQ\_CTRL\_CMD\_PHYSEQID}}(be32toh(c.\mbox{\hyperlink{structfw__eq__ctrl__cmd_a9dc42432acb0588ab30c2c798d0bc127}{physeqid\_pkd}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04249}04249         \mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}} = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a5603f20241fd4fdfa43daafdcab72e9c}{cntxt\_id}} -\/ sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a94c8ca3b0e31f396ecef496df682f245}{eq\_start}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04250}04250         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}} >= sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_aa733d2dbe299343d8d25e6dd315b61e4}{eqmap\_sz}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04251}04251             panic(\textcolor{stringliteral}{"{}\%s: eq-\/>cntxt\_id (\%d) more than the max (\%d)"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04252}04252                 \mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}}, sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_aa733d2dbe299343d8d25e6dd315b61e4}{eqmap\_sz}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04253}04253         sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_ad70dbaca4e6a555317d186f7db9692ee}{eqmap}}[\mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}}] = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04254}04254 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04255}04255         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04256}04256 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04257}04257 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04258}04258 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04259}\mbox{\hyperlink{t4__sge_8c_aaef0e4b0b96d38d557241a5b3c098455}{04259}} \mbox{\hyperlink{t4__sge_8c_aaef0e4b0b96d38d557241a5b3c098455}{eth\_eq\_alloc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04260}04260 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04261}04261         \textcolor{keywordtype}{int} rc, \mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04262}04262         \textcolor{keyword}{struct }\mbox{\hyperlink{structfw__eq__eth__cmd}{fw\_eq\_eth\_cmd}} c;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04263}04263         \textcolor{keywordtype}{int} qsize = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} + sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_ad88b567efaf5d38f538214804cc4dd35}{spg\_len}} / \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04264}04264 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04265}04265         bzero(\&c, \textcolor{keyword}{sizeof}(c));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04266}04266 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04267}04267         c.\mbox{\hyperlink{structfw__eq__eth__cmd_a21401651a0a064003a9bd3f32bf362ae}{op\_to\_vfn}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_ac01d05edee6e9096ece06a6a9f53bc18}{V\_FW\_CMD\_OP}}(\mbox{\hyperlink{t4fw__interface_8h_a4f2b99c2e426902c1d83fded4f1ba4a8af9804388a83126d3a129581691ef0831}{FW\_EQ\_ETH\_CMD}}) | \mbox{\hyperlink{t4fw__interface_8h_ad8d6f4083ad0984c0808657aff3a25e7}{F\_FW\_CMD\_REQUEST}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04268}04268             \mbox{\hyperlink{t4fw__interface_8h_a7f0c4b44453f4318089b42c139f87348}{F\_FW\_CMD\_WRITE}} | \mbox{\hyperlink{t4fw__interface_8h_add1af22fc85285be44adffa2d7f47caf}{F\_FW\_CMD\_EXEC}} | \mbox{\hyperlink{t4fw__interface_8h_a07fce3eebe5a074019e67f6e970becb6}{V\_FW\_EQ\_ETH\_CMD\_PFN}}(sc-\/>\mbox{\hyperlink{structadapter_a4bd2e26128e44b99fd08533b5ec2008a}{pf}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04269}04269             \mbox{\hyperlink{t4fw__interface_8h_a259adc9fc774e390ae786ecfacaa2690}{V\_FW\_EQ\_ETH\_CMD\_VFN}}(0));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04270}04270         c.\mbox{\hyperlink{structfw__eq__eth__cmd_a9f44f7c9306f0556ee23bef5292a06c5}{alloc\_to\_len16}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_ae8c707e62c39209afb34a5f0275ea4c2}{F\_FW\_EQ\_ETH\_CMD\_ALLOC}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04271}04271             \mbox{\hyperlink{t4fw__interface_8h_a8aaa161dce602b6d6407703808eb7d70}{F\_FW\_EQ\_ETH\_CMD\_EQSTART}} | \mbox{\hyperlink{t4fw__interface_8h_afca07ddca8aa3620b089673a07b7d20b}{FW\_LEN16}}(c));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04272}04272         c.\mbox{\hyperlink{structfw__eq__eth__cmd_a765eb6435d4d2ca45421e7654e095146}{autoequiqe\_to\_viid}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_a202f054621a6cfc4a49ce600e88c08cb}{F\_FW\_EQ\_ETH\_CMD\_AUTOEQUIQE}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04273}04273             \mbox{\hyperlink{t4fw__interface_8h_a732c0f05d2a83deccc439fd43e7db7b9}{F\_FW\_EQ\_ETH\_CMD\_AUTOEQUEQE}} | \mbox{\hyperlink{t4fw__interface_8h_acb312ef8662e152412640f46a2963ba2}{V\_FW\_EQ\_ETH\_CMD\_VIID}}(vi-\/>\mbox{\hyperlink{structvi__info_a0fa979bb2987678e60f1837902da1399}{viid}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04274}04274         c.\mbox{\hyperlink{structfw__eq__eth__cmd_a7d5739c28036682b7ad85dec51527579}{fetchszm\_to\_iqid}} =}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04275}04275             htobe32(\mbox{\hyperlink{t4fw__interface_8h_a8d3184277b931155e56da3b6327af200}{V\_FW\_EQ\_ETH\_CMD\_HOSTFCMODE}}(\mbox{\hyperlink{t4__regs__values_8h_a7b7f90c9cb3e43342f6425219d2d5e94}{X\_HOSTFCMODE\_NONE}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04276}04276                 \mbox{\hyperlink{t4fw__interface_8h_a1ba5549c037e69845224a4be7f4cee8f}{V\_FW\_EQ\_ETH\_CMD\_PCIECHN}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a214dbfee0f0274229b4a684e2cce42c6}{tx\_chan}}) | \mbox{\hyperlink{t4fw__interface_8h_ad5f31bc5b9c097237c696ea466d00738}{F\_FW\_EQ\_ETH\_CMD\_FETCHRO}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04277}04277                 \mbox{\hyperlink{t4fw__interface_8h_af1e81dd31e02b584c8ea9ab0ef079363}{V\_FW\_EQ\_ETH\_CMD\_IQID}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ac787bb5caab17934ff10c967ffa55ddb}{iqid}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04278}04278         c.\mbox{\hyperlink{structfw__eq__eth__cmd_a0cf410923b8c393d088d0fa01bc38b68}{dcaen\_to\_eqsize}} =}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04279}04279             htobe32(\mbox{\hyperlink{t4fw__interface_8h_a0ca9a4d62259c917278164f424c41b22}{V\_FW\_EQ\_ETH\_CMD\_FBMIN}}(\mbox{\hyperlink{common_8h_a9760c128d8c5191e65faf12d0ceba0a1}{chip\_id}}(sc) <= \mbox{\hyperlink{common_8h_a2153d86ca1fc4195c2c7fa4cfaf8a57e}{CHELSIO\_T5}} ?}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04280}04280                 \mbox{\hyperlink{t4__regs__values_8h_a38480ce9a21f3ab513027667cc6360c3}{X\_FETCHBURSTMIN\_64B}} : \mbox{\hyperlink{t4__regs__values_8h_a2fa4e64b2793b17d1809f6c05e774009}{X\_FETCHBURSTMIN\_64B\_T6}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04281}04281                 \mbox{\hyperlink{t4fw__interface_8h_ac1085000e6eddb51c75d5d5a527ca0ef}{V\_FW\_EQ\_ETH\_CMD\_FBMAX}}(\mbox{\hyperlink{t4__regs__values_8h_af060fab81a43e3aaa0b97b592e96d6f6}{X\_FETCHBURSTMAX\_512B}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04282}04282                 \mbox{\hyperlink{t4fw__interface_8h_a976b7a05686339e868ce0f13589c0c87}{V\_FW\_EQ\_ETH\_CMD\_EQSIZE}}(qsize));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04283}04283         c.\mbox{\hyperlink{structfw__eq__eth__cmd_aff1bf619552a595eaa1d88f5529ddc6c}{eqaddr}} = htobe64(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_afb31b1b8daa367e09eaf0782f989cc2a}{ba}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04284}04284 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04285}04285         rc = -\/\mbox{\hyperlink{common_8h_a51ef13f7ae089117ec092cf89f8e1247}{t4\_wr\_mbox}}(sc, sc-\/>\mbox{\hyperlink{structadapter_a02cb41b39f831b9529991c57c1725aa9}{mbox}}, \&c, \textcolor{keyword}{sizeof}(c), \&c);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04286}04286         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04287}04287                 device\_printf(vi-\/>\mbox{\hyperlink{structvi__info_a231acb6eb384d964991a1e42e24f4c55}{dev}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04288}04288                     \textcolor{stringliteral}{"{}failed to create Ethernet egress queue: \%d\(\backslash\)n"{}}, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04289}04289                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04290}04290         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04291}04291 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04292}04292         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a5603f20241fd4fdfa43daafdcab72e9c}{cntxt\_id}} = \mbox{\hyperlink{t4fw__interface_8h_aea69376be2923a340cd83ccd3fe9613c}{G\_FW\_EQ\_ETH\_CMD\_EQID}}(be32toh(c.\mbox{\hyperlink{structfw__eq__eth__cmd_ad6ac03bb7731124588f014df59adce74}{eqid\_pkd}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04293}04293         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ac2dfe23b9f5193c5899f52d18ee4e368}{abs\_id}} = \mbox{\hyperlink{t4fw__interface_8h_aedc04a3863b9150fa669e74a4dc29f33}{G\_FW\_EQ\_ETH\_CMD\_PHYSEQID}}(be32toh(c.\mbox{\hyperlink{structfw__eq__eth__cmd_a4bb57361ba85020728267ec3259cf70f}{physeqid\_pkd}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04294}04294         \mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}} = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a5603f20241fd4fdfa43daafdcab72e9c}{cntxt\_id}} -\/ sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a94c8ca3b0e31f396ecef496df682f245}{eq\_start}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04295}04295         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}} >= sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_aa733d2dbe299343d8d25e6dd315b61e4}{eqmap\_sz}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04296}04296             panic(\textcolor{stringliteral}{"{}\%s: eq-\/>cntxt\_id (\%d) more than the max (\%d)"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04297}04297                 \mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}}, sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_aa733d2dbe299343d8d25e6dd315b61e4}{eqmap\_sz}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04298}04298         sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_ad70dbaca4e6a555317d186f7db9692ee}{eqmap}}[\mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}}] = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04299}04299 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04300}04300         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04301}04301 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04302}04302 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04303}04303 \textcolor{preprocessor}{\#if defined(TCP\_OFFLOAD) || defined(RATELIMIT)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04304}04304 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04305}04305 ofld\_eq\_alloc(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04306}04306 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04307}04307         \textcolor{keywordtype}{int} rc, \mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04308}04308         \textcolor{keyword}{struct }\mbox{\hyperlink{structfw__eq__ofld__cmd}{fw\_eq\_ofld\_cmd}} c;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04309}04309         \textcolor{keywordtype}{int} qsize = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} + sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_ad88b567efaf5d38f538214804cc4dd35}{spg\_len}} / \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04310}04310 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04311}04311         bzero(\&c, \textcolor{keyword}{sizeof}(c));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04312}04312 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04313}04313         c.op\_to\_vfn = htonl(\mbox{\hyperlink{t4fw__interface_8h_ac01d05edee6e9096ece06a6a9f53bc18}{V\_FW\_CMD\_OP}}(\mbox{\hyperlink{t4fw__interface_8h_a4f2b99c2e426902c1d83fded4f1ba4a8a6dad584304ceb0a683b8f89b530db5b2}{FW\_EQ\_OFLD\_CMD}}) | \mbox{\hyperlink{t4fw__interface_8h_ad8d6f4083ad0984c0808657aff3a25e7}{F\_FW\_CMD\_REQUEST}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04314}04314             \mbox{\hyperlink{t4fw__interface_8h_a7f0c4b44453f4318089b42c139f87348}{F\_FW\_CMD\_WRITE}} | \mbox{\hyperlink{t4fw__interface_8h_add1af22fc85285be44adffa2d7f47caf}{F\_FW\_CMD\_EXEC}} | \mbox{\hyperlink{t4fw__interface_8h_afce8f065ec2c0146b97e55341e0f336e}{V\_FW\_EQ\_OFLD\_CMD\_PFN}}(sc-\/>\mbox{\hyperlink{structadapter_a4bd2e26128e44b99fd08533b5ec2008a}{pf}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04315}04315             \mbox{\hyperlink{t4fw__interface_8h_a402f440626a712108535f568750d0b3b}{V\_FW\_EQ\_OFLD\_CMD\_VFN}}(0));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04316}04316         c.alloc\_to\_len16 = htonl(\mbox{\hyperlink{t4fw__interface_8h_a268f094ff016246a9b587d218a40d752}{F\_FW\_EQ\_OFLD\_CMD\_ALLOC}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04317}04317             \mbox{\hyperlink{t4fw__interface_8h_acedbb75af19687a24e653a4a1e3fdaea}{F\_FW\_EQ\_OFLD\_CMD\_EQSTART}} | \mbox{\hyperlink{t4fw__interface_8h_afca07ddca8aa3620b089673a07b7d20b}{FW\_LEN16}}(c));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04318}04318         c.fetchszm\_to\_iqid =}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04319}04319                 htonl(\mbox{\hyperlink{t4fw__interface_8h_a13b25ca4d13f2ce70dc392a6e63011d8}{V\_FW\_EQ\_OFLD\_CMD\_HOSTFCMODE}}(\mbox{\hyperlink{t4__regs__values_8h_a81bd2dd393934de0d1d2feb0184713ad}{X\_HOSTFCMODE\_STATUS\_PAGE}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04320}04320                     \mbox{\hyperlink{t4fw__interface_8h_a6b8ab4ad791fd3c980d382a95c9bcfe7}{V\_FW\_EQ\_OFLD\_CMD\_PCIECHN}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a214dbfee0f0274229b4a684e2cce42c6}{tx\_chan}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04321}04321                     \mbox{\hyperlink{t4fw__interface_8h_ae8c4a028ea9214721c1502000413433e}{F\_FW\_EQ\_OFLD\_CMD\_FETCHRO}} | \mbox{\hyperlink{t4fw__interface_8h_af0ac70ae2b1c4cfb8854bc5d80a39028}{V\_FW\_EQ\_OFLD\_CMD\_IQID}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ac787bb5caab17934ff10c967ffa55ddb}{iqid}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04322}04322         c.dcaen\_to\_eqsize =}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04323}04323             htobe32(\mbox{\hyperlink{t4fw__interface_8h_ac5d2474d5c06bd24a2359ab3814a537d}{V\_FW\_EQ\_OFLD\_CMD\_FBMIN}}(\mbox{\hyperlink{common_8h_a9760c128d8c5191e65faf12d0ceba0a1}{chip\_id}}(sc) <= \mbox{\hyperlink{common_8h_a2153d86ca1fc4195c2c7fa4cfaf8a57e}{CHELSIO\_T5}} ?}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04324}04324                 \mbox{\hyperlink{t4__regs__values_8h_a38480ce9a21f3ab513027667cc6360c3}{X\_FETCHBURSTMIN\_64B}} : \mbox{\hyperlink{t4__regs__values_8h_a2fa4e64b2793b17d1809f6c05e774009}{X\_FETCHBURSTMIN\_64B\_T6}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04325}04325                 \mbox{\hyperlink{t4fw__interface_8h_ad0bc96eb63e95dfc64257f3c3e928df8}{V\_FW\_EQ\_OFLD\_CMD\_FBMAX}}(\mbox{\hyperlink{t4__regs__values_8h_af060fab81a43e3aaa0b97b592e96d6f6}{X\_FETCHBURSTMAX\_512B}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04326}04326                 \mbox{\hyperlink{t4fw__interface_8h_a991a3bf756a604a37ce482bc39f5dc13}{V\_FW\_EQ\_OFLD\_CMD\_CIDXFTHRESH}}(\mbox{\hyperlink{t4__sge_8c_a2c8672d27c1176c6b37f17c388f0911e}{qsize\_to\_fthresh}}(qsize)) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04327}04327                 \mbox{\hyperlink{t4fw__interface_8h_a37543ef9031ea822a8de4eeca8a9fbef}{V\_FW\_EQ\_OFLD\_CMD\_EQSIZE}}(qsize));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04328}04328         c.eqaddr = htobe64(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_afb31b1b8daa367e09eaf0782f989cc2a}{ba}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04329}04329 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04330}04330         rc = -\/\mbox{\hyperlink{common_8h_a51ef13f7ae089117ec092cf89f8e1247}{t4\_wr\_mbox}}(sc, sc-\/>\mbox{\hyperlink{structadapter_a02cb41b39f831b9529991c57c1725aa9}{mbox}}, \&c, \textcolor{keyword}{sizeof}(c), \&c);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04331}04331         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04332}04332                 device\_printf(vi-\/>\mbox{\hyperlink{structvi__info_a231acb6eb384d964991a1e42e24f4c55}{dev}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04333}04333                     \textcolor{stringliteral}{"{}failed to create egress queue for TCP offload: \%d\(\backslash\)n"{}}, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04334}04334                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04335}04335         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04336}04336 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04337}04337         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a5603f20241fd4fdfa43daafdcab72e9c}{cntxt\_id}} = \mbox{\hyperlink{t4fw__interface_8h_a0adb0a628ef8c7111c20c164e7c9de03}{G\_FW\_EQ\_OFLD\_CMD\_EQID}}(be32toh(c.eqid\_pkd));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04338}04338         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ac2dfe23b9f5193c5899f52d18ee4e368}{abs\_id}} = \mbox{\hyperlink{t4fw__interface_8h_aed8b76043b50f5bbb765ffbc5097e994}{G\_FW\_EQ\_OFLD\_CMD\_PHYSEQID}}(be32toh(c.physeqid\_pkd));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04339}04339         \mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}} = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a5603f20241fd4fdfa43daafdcab72e9c}{cntxt\_id}} -\/ sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a94c8ca3b0e31f396ecef496df682f245}{eq\_start}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04340}04340         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}} >= sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_aa733d2dbe299343d8d25e6dd315b61e4}{eqmap\_sz}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04341}04341             panic(\textcolor{stringliteral}{"{}\%s: eq-\/>cntxt\_id (\%d) more than the max (\%d)"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04342}04342                 \mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}}, sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_aa733d2dbe299343d8d25e6dd315b61e4}{eqmap\_sz}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04343}04343         sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_ad70dbaca4e6a555317d186f7db9692ee}{eqmap}}[\mbox{\hyperlink{adapter_8h_a04e901232f7bafc58474e5e60fa22c5c}{cntxt\_id}}] = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04344}04344 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04345}04345         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04346}04346 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04347}04347 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04348}04348 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04349}04349 \textcolor{comment}{/* SW only */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04350}04350 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04351}\mbox{\hyperlink{t4__sge_8c_aa66692aa7349d86ff110928283c281ca}{04351}} \mbox{\hyperlink{t4__sge_8c_aa66692aa7349d86ff110928283c281ca}{alloc\_eq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, \textcolor{keyword}{struct} sysctl\_ctx\_list *ctx,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04352}04352     \textcolor{keyword}{struct} sysctl\_oid *oid)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04353}04353 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04354}04354         \textcolor{keywordtype}{int} rc, qsize;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04355}04355         \textcolor{keywordtype}{size\_t} len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04356}04356 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04357}04357         MPASS(!(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04358}04358 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04359}04359         qsize = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} + sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_ad88b567efaf5d38f538214804cc4dd35}{spg\_len}} / \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04360}04360         len = qsize * \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04361}04361         rc = \mbox{\hyperlink{t4__sge_8c_aea7f973785a256f94ee94e87ce652f63}{alloc\_ring}}(sc, len, \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9f79d5d1483fb5be47f6f38dac74e3cc}{desc\_tag}}, \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab535b12f074fbf6db348aca1b04d9864}{desc\_map}}, \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_afb31b1b8daa367e09eaf0782f989cc2a}{ba}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04362}04362             (\textcolor{keywordtype}{void} **)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04363}04363         \textcolor{keywordflow}{if} (rc)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04364}04364                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04365}04365         \textcolor{keywordflow}{if} (ctx != NULL \&\& oid != NULL)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04366}04366                 \mbox{\hyperlink{t4__sge_8c_a0f6314ef6c97086aa440f72841c6b5f9}{add\_eq\_sysctls}}(sc, ctx, oid, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04367}04367         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} |= \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04368}04368 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04369}04369         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04370}04370 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04371}04371 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04372}04372 \textcolor{comment}{/* SW only */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04373}04373 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04374}\mbox{\hyperlink{t4__sge_8c_a5cffbcbe968a0aba74e5989647420178}{04374}} \mbox{\hyperlink{t4__sge_8c_a5cffbcbe968a0aba74e5989647420178}{free\_eq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04375}04375 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04376}04376         MPASS(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04377}04377         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_aad96c6b0170c6d4e6bb404ef9c9a490b}{type}} == \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a48b7bb8e67d0821313836e3035a0e454}{EQ\_ETH}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04378}04378                 MPASS(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}} == \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04379}04379 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04380}04380         \mbox{\hyperlink{t4__sge_8c_a91a6cad146796f95940e30d5e73f5298}{free\_ring}}(sc, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9f79d5d1483fb5be47f6f38dac74e3cc}{desc\_tag}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab535b12f074fbf6db348aca1b04d9864}{desc\_map}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_afb31b1b8daa367e09eaf0782f989cc2a}{ba}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04381}04381         mtx\_destroy(\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae8f6d852c2a6a0e32daa4551ebe5000d}{eq\_lock}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04382}04382         bzero(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, \textcolor{keyword}{sizeof}(*\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04383}04383 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04384}04384 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04385}04385 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04386}\mbox{\hyperlink{t4__sge_8c_a0f6314ef6c97086aa440f72841c6b5f9}{04386}} \mbox{\hyperlink{t4__sge_8c_a0f6314ef6c97086aa440f72841c6b5f9}{add\_eq\_sysctls}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} sysctl\_ctx\_list *ctx,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04387}04387     \textcolor{keyword}{struct} sysctl\_oid *oid, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04388}04388 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04389}04389         \textcolor{keyword}{struct }sysctl\_oid\_list *children = SYSCTL\_CHILDREN(oid);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04390}04390 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04391}04391         SYSCTL\_ADD\_UAUTO(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}ba"{}}, CTLFLAG\_RD, \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_afb31b1b8daa367e09eaf0782f989cc2a}{ba}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04392}04392             \textcolor{stringliteral}{"{}bus address of descriptor ring"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04393}04393         SYSCTL\_ADD\_INT(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}dmalen"{}}, CTLFLAG\_RD, NULL,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04394}04394             \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} * \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}} + sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_ad88b567efaf5d38f538214804cc4dd35}{spg\_len}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04395}04395             \textcolor{stringliteral}{"{}desc ring size in bytes"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04396}04396         SYSCTL\_ADD\_UINT(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}abs\_id"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04397}04397             \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ac2dfe23b9f5193c5899f52d18ee4e368}{abs\_id}}, 0, \textcolor{stringliteral}{"{}absolute id of the queue"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04398}04398         SYSCTL\_ADD\_UINT(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}cntxt\_id"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04399}04399             \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a5603f20241fd4fdfa43daafdcab72e9c}{cntxt\_id}}, 0, \textcolor{stringliteral}{"{}SGE context id of the queue"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04400}04400         SYSCTL\_ADD\_U16(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}cidx"{}}, CTLFLAG\_RD, \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04401}04401             0, \textcolor{stringliteral}{"{}consumer index"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04402}04402         SYSCTL\_ADD\_U16(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}pidx"{}}, CTLFLAG\_RD, \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04403}04403             0, \textcolor{stringliteral}{"{}producer index"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04404}04404         SYSCTL\_ADD\_INT(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}sidx"{}}, CTLFLAG\_RD, NULL,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04405}04405             \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}, \textcolor{stringliteral}{"{}status page index"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04406}04406 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04407}04407 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04408}04408 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04409}\mbox{\hyperlink{t4__sge_8c_af71a8049264ddc95eac76d1f5b081fea}{04409}} \mbox{\hyperlink{t4__sge_8c_af71a8049264ddc95eac76d1f5b081fea}{alloc\_eq\_hwq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04410}04410 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04411}04411         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04412}04412 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04413}04413         MPASS(!(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04414}04414 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04415}04415         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ac787bb5caab17934ff10c967ffa55ddb}{iqid}} = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a8cd0679679a5c0f115dd005df49f1c2d}{iq}}-\/>\mbox{\hyperlink{structsge__iq_ad7db32f3e80fe7456ed7d811ee069dee}{cntxt\_id}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04416}04416         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}} = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}} = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9e8218a79e217563b6ca22792f028b37}{dbidx}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04417}04417         \textcolor{comment}{/* Note that equeqidx is not used with sge\_wrq (OFLD/CTRL) queues. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04418}04418         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a7bbfe5916fa5ba0e6fd0dcc0f027846d}{equeqidx}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04419}04419         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a1c224cb0ab97e3d6ecf105c1aba85ae3}{doorbells}} = sc-\/>\mbox{\hyperlink{structadapter_ae4a21f41f78cf16e0728237581092270}{doorbells}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04420}04420         bzero(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} * \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}} + sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_ad88b567efaf5d38f538214804cc4dd35}{spg\_len}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04421}04421 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04422}04422         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_aad96c6b0170c6d4e6bb404ef9c9a490b}{type}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04423}04423         \textcolor{keywordflow}{case} \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a3bee65b0acce2718193750b345f3ac3e}{EQ\_CTRL}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04424}04424                 rc = \mbox{\hyperlink{t4__sge_8c_ac47f777ad76b27ca26696842076fde68}{ctrl\_eq\_alloc}}(sc, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04425}04425                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04426}04426 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04427}04427         \textcolor{keywordflow}{case} \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a48b7bb8e67d0821313836e3035a0e454}{EQ\_ETH}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04428}04428                 rc = \mbox{\hyperlink{t4__sge_8c_aaef0e4b0b96d38d557241a5b3c098455}{eth\_eq\_alloc}}(sc, vi, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04429}04429                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04430}04430 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04431}04431 \textcolor{preprocessor}{\#if defined(TCP\_OFFLOAD) || defined(RATELIMIT)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04432}04432         \textcolor{keywordflow}{case} \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae4f59379f6b71263323a2bd25c7c5b9a}{EQ\_OFLD}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04433}04433                 rc = ofld\_eq\_alloc(sc, vi, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04434}04434                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04435}04435 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04436}04436 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04437}04437         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04438}04438                 panic(\textcolor{stringliteral}{"{}\%s: invalid eq type \%d."{}}, \_\_func\_\_, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_aad96c6b0170c6d4e6bb404ef9c9a490b}{type}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04439}04439         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04440}04440         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04441}04441                 \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(sc, \textcolor{stringliteral}{"{}failed to allocate egress queue(\%d): \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04442}04442                     \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_aad96c6b0170c6d4e6bb404ef9c9a490b}{type}}, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04443}04443                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04444}04444         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04445}04445 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04446}04446         \textcolor{keywordflow}{if} (isset(\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a1c224cb0ab97e3d6ecf105c1aba85ae3}{doorbells}}, \mbox{\hyperlink{adapter_8h_ab04a0655cd1e3bcac5e8f48c18df1a57a7309f8ad518570ec666a104df10f9880}{DOORBELL\_UDB}}) ||}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04447}04447             isset(\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a1c224cb0ab97e3d6ecf105c1aba85ae3}{doorbells}}, \mbox{\hyperlink{adapter_8h_ab04a0655cd1e3bcac5e8f48c18df1a57a699db0c591ec10a9ffc9dbe5a48d02e2}{DOORBELL\_UDBWC}}) ||}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04448}04448             isset(\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a1c224cb0ab97e3d6ecf105c1aba85ae3}{doorbells}}, \mbox{\hyperlink{adapter_8h_ab04a0655cd1e3bcac5e8f48c18df1a57a7d8a965e0f78479fbb8a94ee96617749}{DOORBELL\_WCWR}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04449}04449                 uint32\_t s\_qpp = sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}}.\mbox{\hyperlink{structsge__params_aad09b64dd9cccdcddf4b6551b26939d6}{eq\_s\_qpp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04450}04450                 uint32\_t mask = (1 << s\_qpp) -\/ 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04451}04451                 \textcolor{keyword}{volatile} uint8\_t *\mbox{\hyperlink{adapter_8h_abbeda82717a25578c0c08d013e026731}{udb}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04452}04452 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04453}04453                 \mbox{\hyperlink{adapter_8h_abbeda82717a25578c0c08d013e026731}{udb}} = sc-\/>\mbox{\hyperlink{structadapter_a697d9290a0e010736410840ea37a0a8b}{udbs\_base}} + \mbox{\hyperlink{t4__hw_8h_a39fca1837c5ce7715cbf571669660c13a8ccfd743bab492083a93da4d65c6babb}{UDBS\_DB\_OFFSET}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04454}04454                 \mbox{\hyperlink{adapter_8h_abbeda82717a25578c0c08d013e026731}{udb}} += (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a5603f20241fd4fdfa43daafdcab72e9c}{cntxt\_id}} >> s\_qpp) << PAGE\_SHIFT;      \textcolor{comment}{/* pg offset */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04455}04455                 \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab81f961dcdab3fd7f30f261f0dbbead8}{udb\_qid}} = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a5603f20241fd4fdfa43daafdcab72e9c}{cntxt\_id}} \& mask;           \textcolor{comment}{/* id in page */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04456}04456                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab81f961dcdab3fd7f30f261f0dbbead8}{udb\_qid}} >= PAGE\_SIZE / \mbox{\hyperlink{t4__hw_8h_a39fca1837c5ce7715cbf571669660c13aec472c4694957cb438c9379fef82c2af}{UDBS\_SEG\_SIZE}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04457}04457                         clrbit(\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a1c224cb0ab97e3d6ecf105c1aba85ae3}{doorbells}}, \mbox{\hyperlink{adapter_8h_ab04a0655cd1e3bcac5e8f48c18df1a57a7d8a965e0f78479fbb8a94ee96617749}{DOORBELL\_WCWR}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04458}04458                 \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04459}04459                         \mbox{\hyperlink{adapter_8h_abbeda82717a25578c0c08d013e026731}{udb}} += \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab81f961dcdab3fd7f30f261f0dbbead8}{udb\_qid}} << \mbox{\hyperlink{t4__hw_8h_a39fca1837c5ce7715cbf571669660c13af17746d62e8049e458f4817f233f119e}{UDBS\_SEG\_SHIFT}}; \textcolor{comment}{/* seg offset */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04460}04460                         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab81f961dcdab3fd7f30f261f0dbbead8}{udb\_qid}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04461}04461                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04462}04462                 \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2a66af7471b86d01eb7edc36887d88aa}{udb}} = (\textcolor{keyword}{volatile} \textcolor{keywordtype}{void} *)\mbox{\hyperlink{adapter_8h_abbeda82717a25578c0c08d013e026731}{udb}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04463}04463         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04464}04464 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04465}04465         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} |= \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04466}04466         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04467}04467 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04468}04468 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04469}04469 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04470}\mbox{\hyperlink{t4__sge_8c_a89b0880f2c5684f730b138971f9b46f9}{04470}} \mbox{\hyperlink{t4__sge_8c_a789211e590312421a461f63e96a64079}{free\_eq\_hwq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi \_\_unused, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04471}04471 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04472}04472         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04473}04473 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04474}04474         MPASS(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04475}04475 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04476}04476         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_aad96c6b0170c6d4e6bb404ef9c9a490b}{type}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04477}04477         \textcolor{keywordflow}{case} \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a3bee65b0acce2718193750b345f3ac3e}{EQ\_CTRL}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04478}04478                 rc = -\/\mbox{\hyperlink{common_8h_a61f512cb708881d3f8ab242f52b7f1a6}{t4\_ctrl\_eq\_free}}(sc, sc-\/>\mbox{\hyperlink{structadapter_a02cb41b39f831b9529991c57c1725aa9}{mbox}}, sc-\/>\mbox{\hyperlink{structadapter_a4bd2e26128e44b99fd08533b5ec2008a}{pf}}, 0, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a5603f20241fd4fdfa43daafdcab72e9c}{cntxt\_id}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04479}04479                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04480}04480         \textcolor{keywordflow}{case} \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a48b7bb8e67d0821313836e3035a0e454}{EQ\_ETH}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04481}04481                 rc = -\/\mbox{\hyperlink{common_8h_ac1d2d19232ce57d64e9dfa115fb1c7b2}{t4\_eth\_eq\_free}}(sc, sc-\/>\mbox{\hyperlink{structadapter_a02cb41b39f831b9529991c57c1725aa9}{mbox}}, sc-\/>\mbox{\hyperlink{structadapter_a4bd2e26128e44b99fd08533b5ec2008a}{pf}}, 0, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a5603f20241fd4fdfa43daafdcab72e9c}{cntxt\_id}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04482}04482                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04483}04483 \textcolor{preprocessor}{\#if defined(TCP\_OFFLOAD) || defined(RATELIMIT)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04484}04484         \textcolor{keywordflow}{case} \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae4f59379f6b71263323a2bd25c7c5b9a}{EQ\_OFLD}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04485}04485                 rc = -\/\mbox{\hyperlink{common_8h_af2c84d9c64b453f986848677fe9fc6c0}{t4\_ofld\_eq\_free}}(sc, sc-\/>\mbox{\hyperlink{structadapter_a02cb41b39f831b9529991c57c1725aa9}{mbox}}, sc-\/>\mbox{\hyperlink{structadapter_a4bd2e26128e44b99fd08533b5ec2008a}{pf}}, 0, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a5603f20241fd4fdfa43daafdcab72e9c}{cntxt\_id}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04486}04486                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04487}04487 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04488}04488         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04489}04489                 panic(\textcolor{stringliteral}{"{}\%s: invalid eq type \%d."{}}, \_\_func\_\_, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_aad96c6b0170c6d4e6bb404ef9c9a490b}{type}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04490}04490         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04491}04491         \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04492}04492                 \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(sc, \textcolor{stringliteral}{"{}failed to free eq (type \%d): \%d\(\backslash\)n"{}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_aad96c6b0170c6d4e6bb404ef9c9a490b}{type}}, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04493}04493                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04494}04494         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04495}04495         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \&= \string~EQ\_HW\_ALLOCATED;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04496}04496 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04497}04497         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04498}04498 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04499}04499 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04500}04500 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04501}\mbox{\hyperlink{t4__sge_8c_ad454dd350a42f4f11557e41ba26b0e29}{04501}} \mbox{\hyperlink{t4__sge_8c_ad454dd350a42f4f11557e41ba26b0e29}{alloc\_wrq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__wrq}{sge\_wrq}} *\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04502}04502     \textcolor{keyword}{struct} sysctl\_ctx\_list *ctx, \textcolor{keyword}{struct} sysctl\_oid *oid)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04503}04503 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04504}04504         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04505}04505         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04506}04506 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04507}04507         MPASS(!(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04508}04508 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04509}04509         rc = \mbox{\hyperlink{t4__sge_8c_aa66692aa7349d86ff110928283c281ca}{alloc\_eq}}(sc, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, ctx, oid);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04510}04510         \textcolor{keywordflow}{if} (rc)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04511}04511                 \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04512}04512         MPASS(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04513}04513         \textcolor{comment}{/* Can't fail after this. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04514}04514 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04515}04515         \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a7c38e3751f35cbee8834f2cb3c8e2156}{adapter}} = sc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04516}04516         TASK\_INIT(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a861382e83430251859a803fcd8e49ea2}{wrq\_tx\_task}}, 0, \mbox{\hyperlink{t4__sge_8c_aacf36f8fa6191a39d3aef1d95a48faf9}{wrq\_tx\_drain}}, \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04517}04517         TAILQ\_INIT(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>incomplete\_wrs);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04518}04518         STAILQ\_INIT(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>wr\_list);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04519}04519         \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a536349490c06b0ab7b376814550e882e}{nwr\_pending}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04520}04520         \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a5cecd0aad6989b257a34dcd277c2b83c}{ndesc\_needed}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04521}04521         \mbox{\hyperlink{t4__sge_8c_ab9a9e03db43c2aae1075dbfe44866092}{add\_wrq\_sysctls}}(ctx, oid, \mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04522}04522 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04523}04523         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04524}04524 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04525}04525 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04526}04526 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04527}\mbox{\hyperlink{t4__sge_8c_a50b9795eebe8d82881a973316b4af3ca}{04527}} \mbox{\hyperlink{t4__sge_8c_a50b9795eebe8d82881a973316b4af3ca}{free\_wrq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__wrq}{sge\_wrq}} *\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04528}04528 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04529}04529         \mbox{\hyperlink{t4__sge_8c_a5cffbcbe968a0aba74e5989647420178}{free\_eq}}(sc, \&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04530}04530         MPASS(\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a536349490c06b0ab7b376814550e882e}{nwr\_pending}} == 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04531}04531         MPASS(TAILQ\_EMPTY(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>incomplete\_wrs));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04532}04532         MPASS(STAILQ\_EMPTY(\&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>wr\_list));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04533}04533         bzero(\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}, \textcolor{keyword}{sizeof}(*\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04534}04534 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04535}04535 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04536}04536 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04537}\mbox{\hyperlink{t4__sge_8c_ab9a9e03db43c2aae1075dbfe44866092}{04537}} \mbox{\hyperlink{t4__sge_8c_ab9a9e03db43c2aae1075dbfe44866092}{add\_wrq\_sysctls}}(\textcolor{keyword}{struct} sysctl\_ctx\_list *ctx, \textcolor{keyword}{struct} sysctl\_oid *oid,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04538}04538     \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__wrq}{sge\_wrq}} *\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04539}04539 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04540}04540         \textcolor{keyword}{struct }sysctl\_oid\_list *children;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04541}04541 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04542}04542         \textcolor{keywordflow}{if} (ctx == NULL || oid == NULL)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04543}04543                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04544}04544 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04545}04545         children = SYSCTL\_CHILDREN(oid);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04546}04546         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}tx\_wrs\_direct"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04547}04547             \&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_abec284de2e57c369a3f94868c9a72e04}{tx\_wrs\_direct}}, \textcolor{stringliteral}{"{}\# of work requests (direct)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04548}04548         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}tx\_wrs\_copied"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04549}04549             \&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_ad62b88613ef7b525e9a9f3104a07bd19}{tx\_wrs\_copied}}, \textcolor{stringliteral}{"{}\# of work requests (copied)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04550}04550         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}tx\_wrs\_sspace"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04551}04551             \&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a4f84f292760c384dc0e0d6480280ab1d}{tx\_wrs\_ss}}, \textcolor{stringliteral}{"{}\# of work requests (copied from scratch space)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04552}04552 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04553}04553 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04554}04554 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04555}04555 \textcolor{comment}{ * Idempotent.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04556}04556 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04557}04557 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04558}\mbox{\hyperlink{t4__sge_8c_a0d41f700a943c229254d4bef06326eb7}{04558}} \mbox{\hyperlink{t4__sge_8c_a0d41f700a943c229254d4bef06326eb7}{alloc\_txq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq, \textcolor{keywordtype}{int} idx)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04559}04559 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04560}04560         \textcolor{keywordtype}{int} rc, \mbox{\hyperlink{adapter_8h_aeb7bf7c2eaa5139e603e513eaa58939f}{iqidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04561}04561         \textcolor{keyword}{struct }\mbox{\hyperlink{structport__info}{port\_info}} *pi = \mbox{\hyperlink{structport__info_ad2b72407fdf992f1a96ddb0086b77760}{vi}}-\/>\mbox{\hyperlink{structvi__info_ae67f2a0e25008a327df0e02be08b5906}{pi}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04562}04562         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = vi-\/>\mbox{\hyperlink{structvi__info_a5ed3e511f61e7116aa53d733d7154130}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04563}04563         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_ae7ae404e7b40fddbb86a486c24227067}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04564}04564         \textcolor{keyword}{struct }\mbox{\hyperlink{structtxpkts}{txpkts}} *\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04565}04565         \textcolor{keywordtype}{char} name[16];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04566}04566         \textcolor{keyword}{struct }sysctl\_oid *oid;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04567}04567 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04568}04568         \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04569}04569                 MPASS(!(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04570}04570 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04571}04571                 snprintf(name, \textcolor{keyword}{sizeof}(name), \textcolor{stringliteral}{"{}\%d"{}}, idx);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04572}04572                 oid = SYSCTL\_ADD\_NODE(\&vi-\/>\mbox{\hyperlink{structvi__info_a70c4ab3863c437b93f8dd41fb47548af}{ctx}}, SYSCTL\_CHILDREN(vi-\/>\mbox{\hyperlink{structvi__info_ad81554efa379851e9cf5cb0ebb4f14a4}{txq\_oid}}),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04573}04573                     OID\_AUTO, name, CTLFLAG\_RD | CTLFLAG\_MPSAFE, NULL,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04574}04574                     \textcolor{stringliteral}{"{}tx queue"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04575}04575 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04576}04576                 \mbox{\hyperlink{adapter_8h_aeb7bf7c2eaa5139e603e513eaa58939f}{iqidx}} = vi-\/>\mbox{\hyperlink{structvi__info_a58b7e6197272507dfb34003ed3975364}{first\_rxq}} + (idx \% vi-\/>\mbox{\hyperlink{structvi__info_aa155ce6b641082bdcd9d178803e30383}{nrxq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04577}04577                 snprintf(name, \textcolor{keyword}{sizeof}(name), \textcolor{stringliteral}{"{}\%s txq\%d"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04578}04578                     device\_get\_nameunit(vi-\/>\mbox{\hyperlink{structvi__info_a231acb6eb384d964991a1e42e24f4c55}{dev}}), idx);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04579}04579                 \mbox{\hyperlink{t4__sge_8c_a7c78925258e7e3b91aaec525467ef32b}{init\_eq}}(sc, \&txq-\/>\mbox{\hyperlink{structsge__txq_ae7ae404e7b40fddbb86a486c24227067}{eq}}, \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a48b7bb8e67d0821313836e3035a0e454}{EQ\_ETH}}, vi-\/>\mbox{\hyperlink{structvi__info_afe91cf1def447160ac5a0ae7b81adc22}{qsize\_txq}}, pi-\/>\mbox{\hyperlink{structport__info_a8f6b327a3aebe073516c98344ab196b4}{tx\_chan}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04580}04580                     \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_ac7510f100e524538eebf2b26eebcdd55}{rxq}}[\mbox{\hyperlink{adapter_8h_aeb7bf7c2eaa5139e603e513eaa58939f}{iqidx}}].\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}, name);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04581}04581 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04582}04582                 rc = \mbox{\hyperlink{t4__mp__ring_8c_a479ae30150454a9eecb1eda07163bf41}{mp\_ring\_alloc}}(\&txq-\/>\mbox{\hyperlink{structsge__txq_a09100c100c608e090b08865bb71d4f0c}{r}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}, txq, \mbox{\hyperlink{t4__sge_8c_a19e880b935db347597598ea8d6364566}{eth\_tx}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04583}04583                     \mbox{\hyperlink{t4__sge_8c_a77415cf9e14d475cf12c3099cad5c7db}{can\_resume\_eth\_tx}}, M\_CXGBE, \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae8f6d852c2a6a0e32daa4551ebe5000d}{eq\_lock}}, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04584}04584                 \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04585}04585                         \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(vi, \textcolor{stringliteral}{"{}failed to allocate mp\_ring for txq\%d: \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04586}04586                             idx, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04587}04587 failed:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04588}04588                         sysctl\_remove\_oid(oid, 1, 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04589}04589                         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04590}04590                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04591}04591 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04592}04592                 rc = \mbox{\hyperlink{t4__sge_8c_aa66692aa7349d86ff110928283c281ca}{alloc\_eq}}(sc, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, \&vi-\/>\mbox{\hyperlink{structvi__info_a70c4ab3863c437b93f8dd41fb47548af}{ctx}}, oid);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04593}04593                 \textcolor{keywordflow}{if} (rc) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04594}04594                         \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(vi, \textcolor{stringliteral}{"{}failed to allocate txq\%d: \%d\(\backslash\)n"{}}, idx, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04595}04595                         \mbox{\hyperlink{t4__mp__ring_8c_ad8bb7e26f37ce794901629486e081e42}{mp\_ring\_free}}(txq-\/>\mbox{\hyperlink{structsge__txq_a09100c100c608e090b08865bb71d4f0c}{r}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04596}04596                         \textcolor{keywordflow}{goto} failed;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04597}04597                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04598}04598                 MPASS(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04599}04599                 \textcolor{comment}{/* Can't fail after this point. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04600}04600 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04601}04601                 TASK\_INIT(\&txq-\/>\mbox{\hyperlink{structsge__txq_a929395c6f55d1b76de97e1db712b13e0}{tx\_reclaim\_task}}, 0, \mbox{\hyperlink{t4__sge_8c_a68f484f6b46eb063ab438fb0dca3a957}{tx\_reclaim}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04602}04602                 txq-\/>\mbox{\hyperlink{structsge__txq_a8d0c2945ca5f278385189001a9654464}{ifp}} = vi-\/>\mbox{\hyperlink{structvi__info_aa7924c610f62f17f5e57fdfc83e09ea0}{ifp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04603}04603                 txq-\/>\mbox{\hyperlink{structsge__txq_af3e9321ce632099d57209f8c252deab0}{gl}} = sglist\_alloc(\mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baebfd86cf2e6a67f67be7e8954ddf5af7}{TX\_SGL\_SEGS}}, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04604}04604                 txq-\/>\mbox{\hyperlink{structsge__txq_a9c8b88707107a1b08036b5fd4cbe2614}{sdesc}} = malloc(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structtx__sdesc}{tx\_sdesc}}), M\_CXGBE,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04605}04605                     M\_ZERO | M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04606}04606 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04607}04607                 \mbox{\hyperlink{t4__sge_8c_aa5f8f5c1e0ff31da13d85dc7cbc7b1f4}{add\_txq\_sysctls}}(vi, \&vi-\/>\mbox{\hyperlink{structvi__info_a70c4ab3863c437b93f8dd41fb47548af}{ctx}}, oid, txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04608}04608         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04609}04609 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04610}04610         \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04611}04611                 MPASS(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04612}04612                 rc = \mbox{\hyperlink{t4__sge_8c_af71a8049264ddc95eac76d1f5b081fea}{alloc\_eq\_hwq}}(sc, vi, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04613}04613                 \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04614}04614                         \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(vi, \textcolor{stringliteral}{"{}failed to create hw txq\%d: \%d\(\backslash\)n"{}}, idx, rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04615}04615                         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04616}04616                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04617}04617                 MPASS(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04618}04618                 \textcolor{comment}{/* Can't fail after this point. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04619}04619 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04620}04620                 \textcolor{keywordflow}{if} (idx == 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04621}04621                         sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_ab9537e217b789a05d3917df9430cd66f}{eq\_base}} = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ac2dfe23b9f5193c5899f52d18ee4e368}{abs\_id}} -\/ \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a5603f20241fd4fdfa43daafdcab72e9c}{cntxt\_id}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04622}04622                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04623}04623                         KASSERT(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a5603f20241fd4fdfa43daafdcab72e9c}{cntxt\_id}} + sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_ab9537e217b789a05d3917df9430cd66f}{eq\_base}} == \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ac2dfe23b9f5193c5899f52d18ee4e368}{abs\_id}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04624}04624                             (\textcolor{stringliteral}{"{}eq\_base mismatch"{}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04625}04625                 KASSERT(sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_ab9537e217b789a05d3917df9430cd66f}{eq\_base}} == 0 || sc-\/>\mbox{\hyperlink{structadapter_a5b04a9c8ac519064f43255df133cfe84}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06cab2621d2fb00629ea783dc0442df2356d}{IS\_VF}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04626}04626                     (\textcolor{stringliteral}{"{}PF with non-\/zero eq\_base"{}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04627}04627 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04628}04628                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_a9d9270442d49358fe63c6155f2114968}{txp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04629}04629                 MPASS(nitems(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}) >= sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ad89b200f4ecc9f5d9e5477ba0824c944}{max\_pkts\_per\_eth\_tx\_pkts\_wr}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04630}04630                 txq-\/>\mbox{\hyperlink{structsge__txq_a9d9270442d49358fe63c6155f2114968}{txp}}.\mbox{\hyperlink{structtxpkts_a4647a7e1cf4bf98d587a472b3974dbed}{max\_npkt}} = min(nitems(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04631}04631                     sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ad89b200f4ecc9f5d9e5477ba0824c944}{max\_pkts\_per\_eth\_tx\_pkts\_wr}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04632}04632                 \textcolor{keywordflow}{if} (vi-\/>\mbox{\hyperlink{structvi__info_ae53bfad48994c14a653adc1db0ab0b57}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06ca7ed073f2f00914712f965c4348bfee7e}{TX\_USES\_VM\_WR}} \&\& !(sc-\/>\mbox{\hyperlink{structadapter_a5b04a9c8ac519064f43255df133cfe84}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06cab2621d2fb00629ea783dc0442df2356d}{IS\_VF}}))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04633}04633                         txq-\/>\mbox{\hyperlink{structsge__txq_a9d9270442d49358fe63c6155f2114968}{txp}}.\mbox{\hyperlink{structtxpkts_a4647a7e1cf4bf98d587a472b3974dbed}{max\_npkt}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04634}04634 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04635}04635                 \textcolor{keywordflow}{if} (vi-\/>\mbox{\hyperlink{structvi__info_ae53bfad48994c14a653adc1db0ab0b57}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06ca7ed073f2f00914712f965c4348bfee7e}{TX\_USES\_VM\_WR}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04636}04636                         txq-\/>\mbox{\hyperlink{structsge__txq_a5f790fc508f4155f68e18c513d5242b3}{cpl\_ctrl0}} = htobe32(\mbox{\hyperlink{t4__msg_8h_abe70763ec1bfc1ae178bedcd6a626bec}{V\_TXPKT\_OPCODE}}(\mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebba8672fce739d8874dca44013e68772d6a}{CPL\_TX\_PKT\_XT}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04637}04637                             \mbox{\hyperlink{t4__msg_8h_acd3b26e6886f5a253a07caa99b73f42b}{V\_TXPKT\_INTF}}(pi-\/>\mbox{\hyperlink{structport__info_a8f6b327a3aebe073516c98344ab196b4}{tx\_chan}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04638}04638                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04639}04639                         txq-\/>\mbox{\hyperlink{structsge__txq_a5f790fc508f4155f68e18c513d5242b3}{cpl\_ctrl0}} = htobe32(\mbox{\hyperlink{t4__msg_8h_abe70763ec1bfc1ae178bedcd6a626bec}{V\_TXPKT\_OPCODE}}(\mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebba8672fce739d8874dca44013e68772d6a}{CPL\_TX\_PKT\_XT}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04640}04640                             \mbox{\hyperlink{t4__msg_8h_acd3b26e6886f5a253a07caa99b73f42b}{V\_TXPKT\_INTF}}(pi-\/>\mbox{\hyperlink{structport__info_a8f6b327a3aebe073516c98344ab196b4}{tx\_chan}}) | \mbox{\hyperlink{t4__msg_8h_a633c7a27b67ee209be69d393a1afe9f4}{V\_TXPKT\_PF}}(sc-\/>\mbox{\hyperlink{structadapter_a4bd2e26128e44b99fd08533b5ec2008a}{pf}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04641}04641                             \mbox{\hyperlink{t4__msg_8h_a78dd0c7ac486a65eafd03ebff0faf17e}{V\_TXPKT\_VF}}(vi-\/>\mbox{\hyperlink{structvi__info_acb19ec1db3c358af3d45587218f91622}{vin}}) | \mbox{\hyperlink{t4__msg_8h_aaba3a8b7dcda6be107ce3bb6278e1071}{V\_TXPKT\_VF\_VLD}}(vi-\/>\mbox{\hyperlink{structvi__info_a78213c8395a614b849d9559e199b91fd}{vfvld}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04642}04642 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04643}04643                 txq-\/>\mbox{\hyperlink{structsge__txq_ad85cecd97c369ed6b9d06094ccc39c6c}{tc\_idx}} = -\/1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04644}04644         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04645}04645 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04646}04646         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04647}04647 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04648}04648 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04649}04649 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04650}04650 \textcolor{comment}{ * Idempotent.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04651}04651 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04652}04652 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04653}\mbox{\hyperlink{t4__sge_8c_aaa69bf67b08bd89ddff7470f2dbc85eb}{04653}} \mbox{\hyperlink{t4__sge_8c_aaa69bf67b08bd89ddff7470f2dbc85eb}{free\_txq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04654}04654 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04655}04655         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = vi-\/>\mbox{\hyperlink{structvi__info_a5ed3e511f61e7116aa53d733d7154130}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04656}04656         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_ae7ae404e7b40fddbb86a486c24227067}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04657}04657 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04658}04658         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04659}04659                 MPASS(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04660}04660                 \mbox{\hyperlink{t4__sge_8c_a789211e590312421a461f63e96a64079}{free\_eq\_hwq}}(sc, NULL, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04661}04661                 MPASS(!(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04662}04662         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04663}04663 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04664}04664         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04665}04665                 MPASS(!(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04666}04666                 sglist\_free(txq-\/>\mbox{\hyperlink{structsge__txq_af3e9321ce632099d57209f8c252deab0}{gl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04667}04667                 free(txq-\/>\mbox{\hyperlink{structsge__txq_a9c8b88707107a1b08036b5fd4cbe2614}{sdesc}}, M\_CXGBE);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04668}04668                 \mbox{\hyperlink{t4__mp__ring_8c_ad8bb7e26f37ce794901629486e081e42}{mp\_ring\_free}}(txq-\/>\mbox{\hyperlink{structsge__txq_a09100c100c608e090b08865bb71d4f0c}{r}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04669}04669                 \mbox{\hyperlink{t4__sge_8c_a5cffbcbe968a0aba74e5989647420178}{free\_eq}}(sc, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04670}04670                 MPASS(!(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04671}04671                 bzero(txq, \textcolor{keyword}{sizeof}(*txq));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04672}04672         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04673}04673 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04674}04674 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04675}04675 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04676}\mbox{\hyperlink{t4__sge_8c_aa5f8f5c1e0ff31da13d85dc7cbc7b1f4}{04676}} \mbox{\hyperlink{t4__sge_8c_aa5f8f5c1e0ff31da13d85dc7cbc7b1f4}{add\_txq\_sysctls}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi, \textcolor{keyword}{struct} sysctl\_ctx\_list *ctx,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04677}04677     \textcolor{keyword}{struct} sysctl\_oid *oid, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04678}04678 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04679}04679         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04680}04680         \textcolor{keyword}{struct }sysctl\_oid\_list *children;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04681}04681 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04682}04682         \textcolor{keywordflow}{if} (ctx == NULL || oid == NULL)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04683}04683                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04684}04684 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04685}04685         sc = vi-\/>\mbox{\hyperlink{structvi__info_a5ed3e511f61e7116aa53d733d7154130}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04686}04686         children = SYSCTL\_CHILDREN(oid);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04687}04687 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04688}04688         \mbox{\hyperlink{t4__mp__ring_8c_a5055016b85fe2504969e25b6c1bb7714}{mp\_ring\_sysctls}}(txq-\/>\mbox{\hyperlink{structsge__txq_a09100c100c608e090b08865bb71d4f0c}{r}}, ctx, children);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04689}04689 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04690}04690         SYSCTL\_ADD\_PROC(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}tc"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04691}04691             CTLTYPE\_INT | CTLFLAG\_RW | CTLFLAG\_MPSAFE, vi, txq -\/ sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a8700f13e7fd84ff30dca7592fc3d51db}{txq}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04692}04692             \mbox{\hyperlink{adapter_8h_ab87ec21d0a419232be2f74421805bb0b}{sysctl\_tc}}, \textcolor{stringliteral}{"{}I"{}}, \textcolor{stringliteral}{"{}traffic class (-\/1 means none)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04693}04693 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04694}04694         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}txcsum"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04695}04695             \&txq-\/>\mbox{\hyperlink{structsge__txq_a54bd3e634577fd7b6a61c32c374ec59d}{txcsum}}, \textcolor{stringliteral}{"{}\# of times hardware assisted with checksum"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04696}04696         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}vlan\_insertion"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04697}04697             \&txq-\/>\mbox{\hyperlink{structsge__txq_a3166c7e9216131f72159bc4a34fffe7a}{vlan\_insertion}}, \textcolor{stringliteral}{"{}\# of times hardware inserted 802.1Q tag"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04698}04698         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}tso\_wrs"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04699}04699             \&txq-\/>\mbox{\hyperlink{structsge__txq_ad4918e7e0079a208a5cd44a45e6566c7}{tso\_wrs}}, \textcolor{stringliteral}{"{}\# of TSO work requests"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04700}04700         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}imm\_wrs"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04701}04701             \&txq-\/>\mbox{\hyperlink{structsge__txq_a43b9a6160281fad65709892faf4fe4f9}{imm\_wrs}}, \textcolor{stringliteral}{"{}\# of work requests with immediate data"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04702}04702         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}sgl\_wrs"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04703}04703             \&txq-\/>\mbox{\hyperlink{structsge__txq_ab5ecd4454c9cc7b9cd822cc890f3b6af}{sgl\_wrs}}, \textcolor{stringliteral}{"{}\# of work requests with direct SGL"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04704}04704         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}txpkt\_wrs"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04705}04705             \&txq-\/>\mbox{\hyperlink{structsge__txq_a5baafe1b362a04cbf457a2b9f96f4eee}{txpkt\_wrs}}, \textcolor{stringliteral}{"{}\# of txpkt work requests (one pkt/WR)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04706}04706         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}txpkts0\_wrs"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04707}04707             \&txq-\/>\mbox{\hyperlink{structsge__txq_aa273cf848de3a6bdbab4ecfde620e1ad}{txpkts0\_wrs}}, \textcolor{stringliteral}{"{}\# of txpkts (type 0) work requests"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04708}04708         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}txpkts1\_wrs"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04709}04709             \&txq-\/>\mbox{\hyperlink{structsge__txq_aaede03cbd089c1a3baa7dd848d2f7c7c}{txpkts1\_wrs}}, \textcolor{stringliteral}{"{}\# of txpkts (type 1) work requests"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04710}04710         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}txpkts0\_pkts"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04711}04711             \&txq-\/>\mbox{\hyperlink{structsge__txq_a1371dafcecacb67cdcd62191a13e9eeb}{txpkts0\_pkts}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04712}04712             \textcolor{stringliteral}{"{}\# of frames tx'd using type0 txpkts work requests"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04713}04713         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}txpkts1\_pkts"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04714}04714             \&txq-\/>\mbox{\hyperlink{structsge__txq_adec9f38db3cf34576fead9fbd2454f63}{txpkts1\_pkts}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04715}04715             \textcolor{stringliteral}{"{}\# of frames tx'd using type1 txpkts work requests"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04716}04716         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}txpkts\_flush"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04717}04717             \&txq-\/>\mbox{\hyperlink{structsge__txq_ae81e21d35bf445da7677bf3b8fa0a096}{txpkts\_flush}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04718}04718             \textcolor{stringliteral}{"{}\# of times txpkts had to be flushed out by an egress-\/update"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04719}04719         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}raw\_wrs"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04720}04720             \&txq-\/>\mbox{\hyperlink{structsge__txq_a07e9b9267ebc33eb5449ed4aa4428974}{raw\_wrs}}, \textcolor{stringliteral}{"{}\# of raw work requests (non-\/packets)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04721}04721         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}vxlan\_tso\_wrs"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04722}04722             \&txq-\/>\mbox{\hyperlink{structsge__txq_af7052d1874cd64a3720b639181867212}{vxlan\_tso\_wrs}}, \textcolor{stringliteral}{"{}\# of VXLAN TSO work requests"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04723}04723         \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}vxlan\_txcsum"{}}, CTLFLAG\_RD,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04724}04724             \&txq-\/>\mbox{\hyperlink{structsge__txq_af2597a9bdbf50dec50cdd18b72063dc9}{vxlan\_txcsum}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04725}04725             \textcolor{stringliteral}{"{}\# of times hardware assisted with inner checksums (VXLAN)"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04726}04726 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04727}04727 \textcolor{preprocessor}{\#ifdef KERN\_TLS}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04728}04728         \textcolor{keywordflow}{if} (\mbox{\hyperlink{common_8h_ac9047f3fb8c47d3cdf66ee1f97d9b4a7}{is\_ktls}}(sc)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04729}04729                 \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}kern\_tls\_records"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04730}04730                     CTLFLAG\_RD, \&txq-\/>\mbox{\hyperlink{structsge__txq_accbd8be2e62afd924692a9052ec6aaf9}{kern\_tls\_records}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04731}04731                     \textcolor{stringliteral}{"{}\# of NIC TLS records transmitted"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04732}04732                 \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}kern\_tls\_short"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04733}04733                     CTLFLAG\_RD, \&txq-\/>\mbox{\hyperlink{structsge__txq_aed27116074f7ce60b9d5c36c1a989bc7}{kern\_tls\_short}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04734}04734                     \textcolor{stringliteral}{"{}\# of short NIC TLS records transmitted"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04735}04735                 \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}kern\_tls\_partial"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04736}04736                     CTLFLAG\_RD, \&txq-\/>\mbox{\hyperlink{structsge__txq_abcb4f652e59c6abdecebfbe4d8f7cf59}{kern\_tls\_partial}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04737}04737                     \textcolor{stringliteral}{"{}\# of partial NIC TLS records transmitted"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04738}04738                 \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}kern\_tls\_full"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04739}04739                     CTLFLAG\_RD, \&txq-\/>\mbox{\hyperlink{structsge__txq_a75f83750d22213bcb1e100fbc52ccf8d}{kern\_tls\_full}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04740}04740                     \textcolor{stringliteral}{"{}\# of full NIC TLS records transmitted"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04741}04741                 \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}kern\_tls\_octets"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04742}04742                     CTLFLAG\_RD, \&txq-\/>\mbox{\hyperlink{structsge__txq_a35895e37003b00654b41c711acb006c7}{kern\_tls\_octets}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04743}04743                     \textcolor{stringliteral}{"{}\# of payload octets in transmitted NIC TLS records"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04744}04744                 \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}kern\_tls\_waste"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04745}04745                     CTLFLAG\_RD, \&txq-\/>\mbox{\hyperlink{structsge__txq_a09cabfcaff035aa7746b98614cf65a10}{kern\_tls\_waste}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04746}04746                     \textcolor{stringliteral}{"{}\# of octets DMAd but not transmitted in NIC TLS records"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04747}04747                 \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}kern\_tls\_options"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04748}04748                     CTLFLAG\_RD, \&txq-\/>\mbox{\hyperlink{structsge__txq_a223bd83b1a9593837d84b3538dd9f0a4}{kern\_tls\_options}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04749}04749                     \textcolor{stringliteral}{"{}\# of NIC TLS options-\/only packets transmitted"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04750}04750                 \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}kern\_tls\_header"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04751}04751                     CTLFLAG\_RD, \&txq-\/>\mbox{\hyperlink{structsge__txq_a6533d7c1a3bab53dd2b0ae1a1a857be1}{kern\_tls\_header}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04752}04752                     \textcolor{stringliteral}{"{}\# of NIC TLS header-\/only packets transmitted"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04753}04753                 \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}kern\_tls\_fin"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04754}04754                     CTLFLAG\_RD, \&txq-\/>\mbox{\hyperlink{structsge__txq_a217d2b8f905281a187e917c7b760de8e}{kern\_tls\_fin}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04755}04755                     \textcolor{stringliteral}{"{}\# of NIC TLS FIN-\/only packets transmitted"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04756}04756                 \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}kern\_tls\_fin\_short"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04757}04757                     CTLFLAG\_RD, \&txq-\/>\mbox{\hyperlink{structsge__txq_ae1a08a8dad7147470fcf4cb2c7b45511}{kern\_tls\_fin\_short}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04758}04758                     \textcolor{stringliteral}{"{}\# of NIC TLS padded FIN packets on short TLS records"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04759}04759                 \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}kern\_tls\_cbc"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04760}04760                     CTLFLAG\_RD, \&txq-\/>\mbox{\hyperlink{structsge__txq_ae8d546eec3d0c0074da78bae067df078}{kern\_tls\_cbc}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04761}04761                     \textcolor{stringliteral}{"{}\# of NIC TLS sessions using AES-\/CBC"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04762}04762                 \mbox{\hyperlink{adapter_8h_a543e6d2621b9d5411b9f77994e2f1ffa}{SYSCTL\_ADD\_UQUAD}}(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}kern\_tls\_gcm"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04763}04763                     CTLFLAG\_RD, \&txq-\/>\mbox{\hyperlink{structsge__txq_ae0eef44e5b7b902e5f22255b7c2fe092}{kern\_tls\_gcm}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04764}04764                     \textcolor{stringliteral}{"{}\# of NIC TLS sessions using AES-\/GCM"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04765}04765         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04766}04766 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04767}04767 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04768}04768 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04769}04769 \textcolor{preprocessor}{\#if defined(TCP\_OFFLOAD) || defined(RATELIMIT)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04770}04770 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04771}04771 \textcolor{comment}{ * Idempotent.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04772}04772 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04773}04773 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04774}04774 alloc\_ofld\_txq(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__ofld__txq}{sge\_ofld\_txq}} *ofld\_txq, \textcolor{keywordtype}{int} idx)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04775}04775 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04776}04776         \textcolor{keyword}{struct }sysctl\_oid *oid;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04777}04777         \textcolor{keyword}{struct }\mbox{\hyperlink{structport__info}{port\_info}} *pi = \mbox{\hyperlink{structport__info_ad2b72407fdf992f1a96ddb0086b77760}{vi}}-\/>\mbox{\hyperlink{structvi__info_ae67f2a0e25008a327df0e02be08b5906}{pi}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04778}04778         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = vi-\/>\mbox{\hyperlink{structvi__info_a5ed3e511f61e7116aa53d733d7154130}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04779}04779         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_aa609cd3b3ea709a9c9534a1d911f1495}{wrq}}.\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04780}04780         \textcolor{keywordtype}{int} rc, \mbox{\hyperlink{adapter_8h_aeb7bf7c2eaa5139e603e513eaa58939f}{iqidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04781}04781         \textcolor{keywordtype}{char} name[16];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04782}04782 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04783}04783         MPASS(idx >= 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04784}04784         MPASS(idx < vi-\/>nofldtxq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04785}04785 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04786}04786         \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04787}04787                 snprintf(name, \textcolor{keyword}{sizeof}(name), \textcolor{stringliteral}{"{}\%d"{}}, idx);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04788}04788                 oid = SYSCTL\_ADD\_NODE(\&vi-\/>\mbox{\hyperlink{structvi__info_a70c4ab3863c437b93f8dd41fb47548af}{ctx}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04789}04789                     SYSCTL\_CHILDREN(vi-\/>\mbox{\hyperlink{structvi__info_adba9acb03000e6fe8bccf7ef465ac247}{ofld\_txq\_oid}}), OID\_AUTO, name,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04790}04790                     CTLFLAG\_RD | CTLFLAG\_MPSAFE, NULL, \textcolor{stringliteral}{"{}offload tx queue"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04791}04791 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04792}04792                 snprintf(name, \textcolor{keyword}{sizeof}(name), \textcolor{stringliteral}{"{}\%s ofld\_txq\%d"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04793}04793                     device\_get\_nameunit(vi-\/>\mbox{\hyperlink{structvi__info_a231acb6eb384d964991a1e42e24f4c55}{dev}}), idx);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04794}04794                 \textcolor{keywordflow}{if} (vi-\/>\mbox{\hyperlink{structvi__info_a3c3e2c39b4998f081ce14b2b247364b8}{nofldrxq}} > 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04795}04795                         \mbox{\hyperlink{adapter_8h_aeb7bf7c2eaa5139e603e513eaa58939f}{iqidx}} = vi-\/>\mbox{\hyperlink{structvi__info_a81ff29548c87ac03373ef2c9aef48f23}{first\_ofld\_rxq}} + (idx \% vi-\/>\mbox{\hyperlink{structvi__info_a3c3e2c39b4998f081ce14b2b247364b8}{nofldrxq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04796}04796                         \mbox{\hyperlink{t4__sge_8c_a7c78925258e7e3b91aaec525467ef32b}{init\_eq}}(sc, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae4f59379f6b71263323a2bd25c7c5b9a}{EQ\_OFLD}}, vi-\/>\mbox{\hyperlink{structvi__info_afe91cf1def447160ac5a0ae7b81adc22}{qsize\_txq}}, pi-\/>\mbox{\hyperlink{structport__info_a8f6b327a3aebe073516c98344ab196b4}{tx\_chan}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04797}04797                             \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a3839f0ca8c68eb632d6c592012d4b878}{ofld\_rxq}}[\mbox{\hyperlink{adapter_8h_aeb7bf7c2eaa5139e603e513eaa58939f}{iqidx}}].\mbox{\hyperlink{structsge__ofld__rxq_a71a63ddddfab089c6cc711a10a68e885}{iq}}, name);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04798}04798                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04799}04799                         \mbox{\hyperlink{adapter_8h_aeb7bf7c2eaa5139e603e513eaa58939f}{iqidx}} = vi-\/>\mbox{\hyperlink{structvi__info_a58b7e6197272507dfb34003ed3975364}{first\_rxq}} + (idx \% vi-\/>\mbox{\hyperlink{structvi__info_aa155ce6b641082bdcd9d178803e30383}{nrxq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04800}04800                         \mbox{\hyperlink{t4__sge_8c_a7c78925258e7e3b91aaec525467ef32b}{init\_eq}}(sc, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae4f59379f6b71263323a2bd25c7c5b9a}{EQ\_OFLD}}, vi-\/>\mbox{\hyperlink{structvi__info_afe91cf1def447160ac5a0ae7b81adc22}{qsize\_txq}}, pi-\/>\mbox{\hyperlink{structport__info_a8f6b327a3aebe073516c98344ab196b4}{tx\_chan}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04801}04801                             \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_ac7510f100e524538eebf2b26eebcdd55}{rxq}}[\mbox{\hyperlink{adapter_8h_aeb7bf7c2eaa5139e603e513eaa58939f}{iqidx}}].\mbox{\hyperlink{structsge__rxq_a434cfa09bdef65d63b2300e019915312}{iq}}, name);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04802}04802                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04803}04803 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04804}04804                 rc = \mbox{\hyperlink{t4__sge_8c_ad454dd350a42f4f11557e41ba26b0e29}{alloc\_wrq}}(sc, vi, \&ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_aa609cd3b3ea709a9c9534a1d911f1495}{wrq}}, \&vi-\/>\mbox{\hyperlink{structvi__info_a70c4ab3863c437b93f8dd41fb47548af}{ctx}}, oid);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04805}04805                 \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04806}04806                         \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(vi, \textcolor{stringliteral}{"{}failed to allocate ofld\_txq\%d: \%d\(\backslash\)n"{}}, idx,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04807}04807                             rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04808}04808                         sysctl\_remove\_oid(oid, 1, 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04809}04809                         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04810}04810                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04811}04811                 MPASS(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04812}04812                 \textcolor{comment}{/* Can't fail after this point. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04813}04813 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04814}04814                 ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_aff592c971c912c246726201e4e9ee1cc}{tx\_iscsi\_pdus}} = counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04815}04815                 ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_a0f79a6ddd4cb915ed3de93dfb0710543}{tx\_iscsi\_octets}} = counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04816}04816                 ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_a572b893803372e9d7ea609993fcc26dd}{tx\_iscsi\_iso\_wrs}} = counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04817}04817                 ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_a8575f7d172845b3e1c4ae8d92f0561ca}{tx\_toe\_tls\_records}} = counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04818}04818                 ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_a5b955823d1a12dc9bc42f683404f043c}{tx\_toe\_tls\_octets}} = counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04819}04819                 add\_ofld\_txq\_sysctls(\&vi-\/>\mbox{\hyperlink{structvi__info_a70c4ab3863c437b93f8dd41fb47548af}{ctx}}, oid, ofld\_txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04820}04820         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04821}04821 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04822}04822         \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04823}04823                 rc = \mbox{\hyperlink{t4__sge_8c_af71a8049264ddc95eac76d1f5b081fea}{alloc\_eq\_hwq}}(sc, vi, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04824}04824                 \textcolor{keywordflow}{if} (rc != 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04825}04825                         \mbox{\hyperlink{osdep_8h_acd2a4ebc2a17949329fc3616ff6ae34c}{CH\_ERR}}(vi, \textcolor{stringliteral}{"{}failed to create hw ofld\_txq\%d: \%d\(\backslash\)n"{}}, idx,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04826}04826                             rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04827}04827                         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04828}04828                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04829}04829                 MPASS(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04830}04830         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04831}04831 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04832}04832         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04833}04833 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04834}04834 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04835}04835 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04836}04836 \textcolor{comment}{ * Idempotent.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04837}04837 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04838}04838 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04839}04839 free\_ofld\_txq(\textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__ofld__txq}{sge\_ofld\_txq}} *ofld\_txq)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04840}04840 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04841}04841         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = vi-\/>\mbox{\hyperlink{structvi__info_a5ed3e511f61e7116aa53d733d7154130}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04842}04842         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_aa609cd3b3ea709a9c9534a1d911f1495}{wrq}}.\mbox{\hyperlink{structsge__wrq_ade1463d84e9d23f3b756019e08e4985b}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04843}04843 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04844}04844         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04845}04845                 MPASS(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04846}04846                 \mbox{\hyperlink{t4__sge_8c_a789211e590312421a461f63e96a64079}{free\_eq\_hwq}}(sc, NULL, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04847}04847                 MPASS(!(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04848}04848         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04849}04849 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04850}04850         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04851}04851                 MPASS(!(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a1d8364534c580f537f1090d4258dc1ce}{EQ\_HW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04852}04852                 counter\_u64\_free(ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_aff592c971c912c246726201e4e9ee1cc}{tx\_iscsi\_pdus}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04853}04853                 counter\_u64\_free(ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_a0f79a6ddd4cb915ed3de93dfb0710543}{tx\_iscsi\_octets}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04854}04854                 counter\_u64\_free(ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_a572b893803372e9d7ea609993fcc26dd}{tx\_iscsi\_iso\_wrs}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04855}04855                 counter\_u64\_free(ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_a8575f7d172845b3e1c4ae8d92f0561ca}{tx\_toe\_tls\_records}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04856}04856                 counter\_u64\_free(ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_a5b955823d1a12dc9bc42f683404f043c}{tx\_toe\_tls\_octets}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04857}04857                 \mbox{\hyperlink{t4__sge_8c_a50b9795eebe8d82881a973316b4af3ca}{free\_wrq}}(sc, \&ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_aa609cd3b3ea709a9c9534a1d911f1495}{wrq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04858}04858                 MPASS(!(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2d69d35dce7e8423e7f73cbd7d2c6429}{flags}} \& \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600ae9894649635fdcd7f81d6f7e09e54c79}{EQ\_SW\_ALLOCATED}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04859}04859                 bzero(ofld\_txq, \textcolor{keyword}{sizeof}(*ofld\_txq));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04860}04860         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04861}04861 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04862}04862 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04863}04863 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04864}04864 add\_ofld\_txq\_sysctls(\textcolor{keyword}{struct} sysctl\_ctx\_list *ctx, \textcolor{keyword}{struct} sysctl\_oid *oid,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04865}04865     \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__ofld__txq}{sge\_ofld\_txq}} *ofld\_txq)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04866}04866 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04867}04867         \textcolor{keyword}{struct }sysctl\_oid\_list *children;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04868}04868 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04869}04869         \textcolor{keywordflow}{if} (ctx == NULL || oid == NULL)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04870}04870                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04871}04871 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04872}04872         children = SYSCTL\_CHILDREN(oid);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04873}04873         SYSCTL\_ADD\_COUNTER\_U64(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}tx\_iscsi\_pdus"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04874}04874             CTLFLAG\_RD, \&ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_aff592c971c912c246726201e4e9ee1cc}{tx\_iscsi\_pdus}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04875}04875             \textcolor{stringliteral}{"{}\# of iSCSI PDUs transmitted"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04876}04876         SYSCTL\_ADD\_COUNTER\_U64(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}tx\_iscsi\_octets"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04877}04877             CTLFLAG\_RD, \&ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_a0f79a6ddd4cb915ed3de93dfb0710543}{tx\_iscsi\_octets}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04878}04878             \textcolor{stringliteral}{"{}\# of payload octets in transmitted iSCSI PDUs"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04879}04879         SYSCTL\_ADD\_COUNTER\_U64(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}tx\_iscsi\_iso\_wrs"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04880}04880             CTLFLAG\_RD, \&ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_a572b893803372e9d7ea609993fcc26dd}{tx\_iscsi\_iso\_wrs}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04881}04881             \textcolor{stringliteral}{"{}\# of iSCSI segmentation offload work requests"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04882}04882         SYSCTL\_ADD\_COUNTER\_U64(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}tx\_toe\_tls\_records"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04883}04883             CTLFLAG\_RD, \&ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_a8575f7d172845b3e1c4ae8d92f0561ca}{tx\_toe\_tls\_records}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04884}04884             \textcolor{stringliteral}{"{}\# of TOE TLS records transmitted"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04885}04885         SYSCTL\_ADD\_COUNTER\_U64(ctx, children, OID\_AUTO, \textcolor{stringliteral}{"{}tx\_toe\_tls\_octets"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04886}04886             CTLFLAG\_RD, \&ofld\_txq-\/>\mbox{\hyperlink{structsge__ofld__txq_a5b955823d1a12dc9bc42f683404f043c}{tx\_toe\_tls\_octets}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04887}04887             \textcolor{stringliteral}{"{}\# of payload octets in transmitted TOE TLS records"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04888}04888 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04889}04889 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04890}04890 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04891}04891 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04892}\mbox{\hyperlink{t4__sge_8c_af40ba290a67743180a6848b100bca7d0}{04892}} \mbox{\hyperlink{t4__sge_8c_af40ba290a67743180a6848b100bca7d0}{oneseg\_dma\_callback}}(\textcolor{keywordtype}{void} *arg, bus\_dma\_segment\_t *segs, \textcolor{keywordtype}{int} nseg, \textcolor{keywordtype}{int} error)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04893}04893 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04894}04894         bus\_addr\_t *\mbox{\hyperlink{adapter_8h_a434e8fd1755e5b5324e1d886def99125}{ba}} = arg;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04895}04895 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04896}04896         KASSERT(nseg == 1,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04897}04897             (\textcolor{stringliteral}{"{}\%s meant for single segment mappings only."{}}, \_\_func\_\_));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04898}04898 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04899}04899         *\mbox{\hyperlink{adapter_8h_a434e8fd1755e5b5324e1d886def99125}{ba}} = error ? 0 : segs-\/>ds\_addr;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04900}04900 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04901}04901 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04902}04902 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04903}\mbox{\hyperlink{t4__sge_8c_a3a91bd0ddac7f0c46d2e99c2307e59da}{04903}} \mbox{\hyperlink{t4__sge_8c_a3a91bd0ddac7f0c46d2e99c2307e59da}{ring\_fl\_db}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04904}04904 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04905}04905         uint32\_t n, v;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04906}04906 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04907}04907         n = \mbox{\hyperlink{adapter_8h_a5b0f572f7c8db6dac00cfd7f50b8bd43}{IDXDIFF}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad9cbe038cc934c889c10bf7c6ed3adca}{pidx}} >> 3, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a37f76efd2ceb3bd65623f87d3038464f}{dbidx}}, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0f572e6a95a867a2c848d725b6e30785}{sidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04908}04908         MPASS(n > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04909}04909 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04910}04910         wmb();}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04911}04911         v = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad3651b0a48e845a4256488e35c85500d}{dbval}} | \mbox{\hyperlink{t4__regs_8h_a3d5ada69e3663f91ba04f906b3a82de3}{V\_PIDX}}(n);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04912}04912         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_af33dfd6a54abf7d57f9d4398047a98ab}{udb}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04913}04913                 *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_af33dfd6a54abf7d57f9d4398047a98ab}{udb}} = htole32(v);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04914}04914         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04915}04915                 \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, sc-\/>\mbox{\hyperlink{structadapter_af7128974a6c2b1050ae5eace94a887e9}{sge\_kdoorbell\_reg}}, v);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04916}04916         \mbox{\hyperlink{adapter_8h_aae3f128a52e3e78cf595539bb66425c7}{IDXINCR}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a37f76efd2ceb3bd65623f87d3038464f}{dbidx}}, n, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0f572e6a95a867a2c848d725b6e30785}{sidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04917}04917 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04918}04918 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04919}04919 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04920}04920 \textcolor{comment}{ * Fills up the freelist by allocating up to 'n' buffers.  Buffers that are}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04921}04921 \textcolor{comment}{ * recycled do not count towards this allocation budget.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04922}04922 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04923}04923 \textcolor{comment}{ * Returns non-\/zero to indicate that this freelist should be added to the list}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04924}04924 \textcolor{comment}{ * of starving freelists.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04925}04925 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04926}04926 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04927}\mbox{\hyperlink{t4__sge_8c_ac105ed5d85881e9f6b48414965986423}{04927}} \mbox{\hyperlink{t4__sge_8c_ac105ed5d85881e9f6b48414965986423}{refill\_fl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, \textcolor{keywordtype}{int} n)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04928}04928 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04929}04929         \mbox{\hyperlink{osdep_8h_a575a6be7a3f079739f00e4ac7d75c785}{\_\_be64}} *d;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04930}04930         \textcolor{keyword}{struct }\mbox{\hyperlink{structfl__sdesc}{fl\_sdesc}} *sd;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04931}04931         uintptr\_t pa;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04932}04932         caddr\_t \mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04933}04933         \textcolor{keyword}{struct }\mbox{\hyperlink{structrx__buf__info}{rx\_buf\_info}} *rxb;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04934}04934         \textcolor{keyword}{struct }\mbox{\hyperlink{structcluster__metadata}{cluster\_metadata}} *clm;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04935}04935         uint16\_t max\_pidx, zidx = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a6c0f6b4778a8154ed2946f64fa6161dd}{zidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04936}04936         uint16\_t hw\_cidx = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0d4baa235797170a157e790696ac257b}{hw\_cidx}};                \textcolor{comment}{/* stable snapshot */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04937}04937 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04938}04938         \mbox{\hyperlink{adapter_8h_a99dfec1c62af98de3ce5afeabd7009ed}{FL\_LOCK\_ASSERT\_OWNED}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04939}04939 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04940}04940         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04941}04941 \textcolor{comment}{         * We always stop at the beginning of the hardware descriptor that's just}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04942}04942 \textcolor{comment}{         * before the one with the hw cidx.  This is to avoid hw pidx = hw cidx,}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04943}04943 \textcolor{comment}{         * which would mean an empty freelist to the chip.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04944}04944 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04945}04945         max\_pidx = \_\_predict\_false(hw\_cidx == 0) ? \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0f572e6a95a867a2c848d725b6e30785}{sidx}} -\/ 1 : hw\_cidx -\/ 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04946}04946         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad9cbe038cc934c889c10bf7c6ed3adca}{pidx}} == max\_pidx * 8)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04947}04947                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04948}04948 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04949}04949         d = \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad641675824ad24b021729a376f166308}{desc}}[\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad9cbe038cc934c889c10bf7c6ed3adca}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04950}04950         sd = \&\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a72d761fa3c245d6de3286e7fc055346f}{sdesc}}[\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad9cbe038cc934c889c10bf7c6ed3adca}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04951}04951         rxb = \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a1d0a3ea264db143053eab8e647b3d3fc}{rx\_buf\_info}}[zidx];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04952}04952 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04953}04953         \textcolor{keywordflow}{while} (n > 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04954}04954 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04955}04955                 \textcolor{keywordflow}{if} (sd-\/>\mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04956}04956 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04957}04957                         \textcolor{keywordflow}{if} (sd-\/>\mbox{\hyperlink{structfl__sdesc_a96da93c917bdc281c3a3ed794c0ce5b4}{nmbuf}} == 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04958}04958                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04959}04959 \textcolor{comment}{                                 * Fast recycle without involving any atomics on}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04960}04960 \textcolor{comment}{                                 * the cluster's metadata (if the cluster has}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04961}04961 \textcolor{comment}{                                 * metadata).  This happens when all frames}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04962}04962 \textcolor{comment}{                                 * received in the cluster were small enough to}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04963}04963 \textcolor{comment}{                                 * fit within a single mbuf each.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04964}04964 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04965}04965                                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a2cfb85e321b0f9d55ff7a282298dc0d7}{cl\_fast\_recycled}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04966}04966                                 \textcolor{keywordflow}{goto} recycled;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04967}04967                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04968}04968 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04969}04969                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04970}04970 \textcolor{comment}{                         * Cluster is guaranteed to have metadata.  Clusters}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04971}04971 \textcolor{comment}{                         * without metadata always take the fast recycle path}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04972}04972 \textcolor{comment}{                         * when they're recycled.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04973}04973 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04974}04974                         clm = \mbox{\hyperlink{t4__sge_8c_a90def5cc3b7c312e4c3a9d01e61ea2fc}{cl\_metadata}}(sd);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04975}04975                         MPASS(clm != NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04976}04976 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04977}04977                         \textcolor{keywordflow}{if} (atomic\_fetchadd\_int(\&clm-\/>\mbox{\hyperlink{structcluster__metadata_a4fb25e2d233b522705bfc38dc4f37451}{refcount}}, -\/1) == 1) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04978}04978                                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a89c1125ae24d5f05668ec1087d110d8f}{cl\_recycled}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04979}04979                                 counter\_u64\_add(\mbox{\hyperlink{t4__sge_8c_ae618d620a0161831f318bf78a9d94edb}{extfree\_rels}}, 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04980}04980                                 \textcolor{keywordflow}{goto} recycled;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04981}04981                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04982}04982                         sd-\/>\mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}} = NULL;        \textcolor{comment}{/* gave up my reference */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04983}04983                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04984}04984                 MPASS(sd-\/>\mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}} == NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04985}04985                 \mbox{\hyperlink{structcluster__metadata_af6d9013fef56a6a258aa7e882ea7e42e}{cl}} = uma\_zalloc(rxb-\/>\mbox{\hyperlink{structrx__buf__info_a1b42a285c183e57dcd2f589d5de929ae}{zone}}, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04986}04986                 \textcolor{keywordflow}{if} (\_\_predict\_false(\mbox{\hyperlink{structcluster__metadata_af6d9013fef56a6a258aa7e882ea7e42e}{cl}} == NULL)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04987}04987                         \textcolor{keywordflow}{if} (zidx != \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_aa6f569547ff74311111cb5848b62a602}{safe\_zidx}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04988}04988                                 zidx = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_aa6f569547ff74311111cb5848b62a602}{safe\_zidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04989}04989                                 rxb = \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a1d0a3ea264db143053eab8e647b3d3fc}{rx\_buf\_info}}[zidx];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04990}04990                                 \mbox{\hyperlink{structcluster__metadata_af6d9013fef56a6a258aa7e882ea7e42e}{cl}} = uma\_zalloc(rxb-\/>\mbox{\hyperlink{structrx__buf__info_a1b42a285c183e57dcd2f589d5de929ae}{zone}}, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04991}04991                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04992}04992                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structcluster__metadata_af6d9013fef56a6a258aa7e882ea7e42e}{cl}} == NULL)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04993}04993                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04994}04994                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04995}04995                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_adb30868b906ee09448bdb03dc6665a55}{cl\_allocated}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04996}04996                 n-\/-\/;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04997}04997 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04998}04998                 pa = pmap\_kextract((vm\_offset\_t)\mbox{\hyperlink{structcluster__metadata_af6d9013fef56a6a258aa7e882ea7e42e}{cl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l04999}04999                 sd-\/>\mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}} = \mbox{\hyperlink{structcluster__metadata_af6d9013fef56a6a258aa7e882ea7e42e}{cl}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05000}05000                 sd-\/>\mbox{\hyperlink{structfl__sdesc_a584facf428bd80f31f3d73c489204d73}{zidx}} = zidx;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05001}05001 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05002}05002                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daa0bc2f5c770b6e332fdc75909ee8bb47}{FL\_BUF\_PACKING}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05003}05003                         *d = htobe64(pa | rxb-\/>\mbox{\hyperlink{structrx__buf__info_a3ea12113c04fb9272c95dd0c9459f1a7}{hwidx2}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05004}05004                         sd-\/>\mbox{\hyperlink{structfl__sdesc_a089e1695e94803a929c036d6c56d13bf}{moff}} = rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05005}05005                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05006}05006                         *d = htobe64(pa | rxb-\/>\mbox{\hyperlink{structrx__buf__info_aba1b3a28021975079ea300ef9a65f4fd}{hwidx1}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05007}05007                         sd-\/>\mbox{\hyperlink{structfl__sdesc_a089e1695e94803a929c036d6c56d13bf}{moff}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05008}05008                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05009}05009 recycled:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05010}05010                 sd-\/>\mbox{\hyperlink{structfl__sdesc_a96da93c917bdc281c3a3ed794c0ce5b4}{nmbuf}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05011}05011                 d++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05012}05012                 sd++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05013}05013                 \textcolor{keywordflow}{if} (\_\_predict\_false((++\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad9cbe038cc934c889c10bf7c6ed3adca}{pidx}} \& 7) == 0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05014}05014                         uint16\_t \mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}} = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad9cbe038cc934c889c10bf7c6ed3adca}{pidx}} >> 3;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05015}05015 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05016}05016                         \textcolor{keywordflow}{if} (\_\_predict\_false(\mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}} == \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0f572e6a95a867a2c848d725b6e30785}{sidx}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05017}05017                                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad9cbe038cc934c889c10bf7c6ed3adca}{pidx}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05018}05018                                 \mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05019}05019                                 sd = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a72d761fa3c245d6de3286e7fc055346f}{sdesc}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05020}05020                                 d = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad641675824ad24b021729a376f166308}{desc}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05021}05021                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05022}05022                         \textcolor{keywordflow}{if} (n < 8 || \mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}} == max\_pidx)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05023}05023                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05024}05024 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05025}05025                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a5b0f572f7c8db6dac00cfd7f50b8bd43}{IDXDIFF}}(\mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}}, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a37f76efd2ceb3bd65623f87d3038464f}{dbidx}}, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0f572e6a95a867a2c848d725b6e30785}{sidx}}) >= 4)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05026}05026                                 \mbox{\hyperlink{t4__sge_8c_a3a91bd0ddac7f0c46d2e99c2307e59da}{ring\_fl\_db}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05027}05027                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05028}05028         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05029}05029 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05030}05030         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_ad9cbe038cc934c889c10bf7c6ed3adca}{pidx}} >> 3) != \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a37f76efd2ceb3bd65623f87d3038464f}{dbidx}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05031}05031                 \mbox{\hyperlink{t4__sge_8c_a3a91bd0ddac7f0c46d2e99c2307e59da}{ring\_fl\_db}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05032}05032 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05033}05033         \textcolor{keywordflow}{return} (\mbox{\hyperlink{adapter_8h_aeb9440a457ecfda2ab0018b15e13a40f}{FL\_RUNNING\_LOW}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}) \&\& !(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035da7823ff29cad0529311de1036bf98e6d7}{FL\_STARVING}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05034}05034 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05035}05035 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05036}05036 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05037}05037 \textcolor{comment}{ * Attempt to refill all starving freelists.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05038}05038 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05039}05039 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05040}\mbox{\hyperlink{t4__sge_8c_a8173780e40a7fbd712d976102611cf11}{05040}} \mbox{\hyperlink{t4__sge_8c_a8173780e40a7fbd712d976102611cf11}{refill\_sfl}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05041}05041 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05042}05042         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = arg;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05043}05043         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, *fl\_temp;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05044}05044 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05045}05045         mtx\_assert(\&sc-\/>\mbox{\hyperlink{structadapter_abebcb402e73536fb67f8f78e0ea3eeae}{sfl\_lock}}, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05046}05046         TAILQ\_FOREACH\_SAFE(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, \&sc-\/>sfl, link, fl\_temp) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05047}05047                 \mbox{\hyperlink{adapter_8h_a41c2edc639f8438bba380b1698ecb12e}{FL\_LOCK}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05048}05048                 \mbox{\hyperlink{t4__sge_8c_ac105ed5d85881e9f6b48414965986423}{refill\_fl}}(sc, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, 64);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05049}05049                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a4bcddb5caf7f7533163a8727b3b09165}{FL\_NOT\_RUNNING\_LOW}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}) || \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035da13829ebcbbac07550c2f742de05a3b3d}{FL\_DOOMED}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05050}05050                         TAILQ\_REMOVE(\&sc-\/>sfl, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, link);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05051}05051                         \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \&= \string~FL\_STARVING;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05052}05052                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05053}05053                 \mbox{\hyperlink{adapter_8h_a63ce7ce2eb7ddaa4178b03391b6178a5}{FL\_UNLOCK}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05054}05054         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05055}05055 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05056}05056         \textcolor{keywordflow}{if} (!TAILQ\_EMPTY(\&sc-\/>sfl))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05057}05057                 callout\_schedule(\&sc-\/>\mbox{\hyperlink{structadapter_adfe58d58a118b46d70d4ee875875a2e0}{sfl\_callout}}, hz / 5);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05058}05058 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05059}05059 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05060}05060 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05061}05061 \textcolor{comment}{ * Release the driver's reference on all buffers in the given freelist.  Buffers}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05062}05062 \textcolor{comment}{ * with kernel references cannot be freed and will prevent the driver from being}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05063}05063 \textcolor{comment}{ * unloaded safely.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05064}05064 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05065}05065 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05066}\mbox{\hyperlink{adapter_8h_a47d28e55e59bf6192f4bb586287ebd7d}{05066}} \mbox{\hyperlink{t4__sge_8c_a562b5150eb2977c2480be5c11f98c46c}{free\_fl\_buffers}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05067}05067 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05068}05068         \textcolor{keyword}{struct }\mbox{\hyperlink{structfl__sdesc}{fl\_sdesc}} *sd;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05069}05069         \textcolor{keyword}{struct }\mbox{\hyperlink{structcluster__metadata}{cluster\_metadata}} *clm;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05070}05070         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05071}05071 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05072}05072         sd = \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a72d761fa3c245d6de3286e7fc055346f}{sdesc}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05073}05073         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a0f572e6a95a867a2c848d725b6e30785}{sidx}} * 8; i++, sd++) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05074}05074                 \textcolor{keywordflow}{if} (sd-\/>\mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}} == NULL)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05075}05075                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05076}05076 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05077}05077                 \textcolor{keywordflow}{if} (sd-\/>\mbox{\hyperlink{structfl__sdesc_a96da93c917bdc281c3a3ed794c0ce5b4}{nmbuf}} == 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05078}05078                         uma\_zfree(sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a1d0a3ea264db143053eab8e647b3d3fc}{rx\_buf\_info}}[sd-\/>\mbox{\hyperlink{structfl__sdesc_a584facf428bd80f31f3d73c489204d73}{zidx}}].\mbox{\hyperlink{structrx__buf__info_a1b42a285c183e57dcd2f589d5de929ae}{zone}}, sd-\/>\mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05079}05079                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daa0bc2f5c770b6e332fdc75909ee8bb47}{FL\_BUF\_PACKING}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05080}05080                         clm = \mbox{\hyperlink{t4__sge_8c_a90def5cc3b7c312e4c3a9d01e61ea2fc}{cl\_metadata}}(sd);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05081}05081                         \textcolor{keywordflow}{if} (atomic\_fetchadd\_int(\&clm-\/>\mbox{\hyperlink{structcluster__metadata_a4fb25e2d233b522705bfc38dc4f37451}{refcount}}, -\/1) == 1) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05082}05082                                 uma\_zfree(sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a1d0a3ea264db143053eab8e647b3d3fc}{rx\_buf\_info}}[sd-\/>\mbox{\hyperlink{structfl__sdesc_a584facf428bd80f31f3d73c489204d73}{zidx}}].\mbox{\hyperlink{structrx__buf__info_a1b42a285c183e57dcd2f589d5de929ae}{zone}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05083}05083                                     sd-\/>\mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05084}05084                                 counter\_u64\_add(\mbox{\hyperlink{t4__sge_8c_ae618d620a0161831f318bf78a9d94edb}{extfree\_rels}}, 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05085}05085                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05086}05086                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05087}05087                 sd-\/>\mbox{\hyperlink{structfl__sdesc_a89c6d88e5e779bee75c9d5d296a45825}{cl}} = NULL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05088}05088         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05089}05089 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05090}05090         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035daea6e5181a0f82777f828d3a992d88b55}{FL\_BUF\_RESUME}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05091}05091                 m\_freem(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_af5e12414c693a02b4d8af782a0d1fe2c}{m0}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05092}05092                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \&= \string~FL\_BUF\_RESUME;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05093}05093         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05094}05094 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05095}05095 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05096}05096 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05097}\mbox{\hyperlink{t4__sge_8c_a9b33f2920382e5c3c1308a4e26203b04}{05097}} \mbox{\hyperlink{t4__sge_8c_a9b33f2920382e5c3c1308a4e26203b04}{get\_pkt\_gl}}(\textcolor{keyword}{struct} mbuf *m, \textcolor{keyword}{struct} sglist *\mbox{\hyperlink{adapter_8h_a29e1c73f1ac731c2846ecbe343b56b28}{gl}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05098}05098 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05099}05099         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05100}05100 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05101}05101         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05102}05102 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05103}05103         sglist\_reset(\mbox{\hyperlink{adapter_8h_a29e1c73f1ac731c2846ecbe343b56b28}{gl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05104}05104         rc = sglist\_append\_mbuf(\mbox{\hyperlink{adapter_8h_a29e1c73f1ac731c2846ecbe343b56b28}{gl}}, m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05105}05105         \textcolor{keywordflow}{if} (\_\_predict\_false(rc != 0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05106}05106                 panic(\textcolor{stringliteral}{"{}\%s: mbuf \%p (\%d segs) was vetted earlier but now fails "{}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05107}05107                     \textcolor{stringliteral}{"{}with \%d."{}}, \_\_func\_\_, m, \mbox{\hyperlink{t4__sge_8c_a620de1776baac1a496fbfda0f34d8b39}{mbuf\_nsegs}}(m), rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05108}05108         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05109}05109 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05110}05110         KASSERT(\mbox{\hyperlink{adapter_8h_a29e1c73f1ac731c2846ecbe343b56b28}{gl}}-\/>sg\_nseg == \mbox{\hyperlink{t4__sge_8c_a620de1776baac1a496fbfda0f34d8b39}{mbuf\_nsegs}}(m),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05111}05111             (\textcolor{stringliteral}{"{}\%s: nsegs changed for mbuf \%p from \%d to \%d"{}}, \_\_func\_\_, m,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05112}05112             \mbox{\hyperlink{t4__sge_8c_a620de1776baac1a496fbfda0f34d8b39}{mbuf\_nsegs}}(m), \mbox{\hyperlink{adapter_8h_a29e1c73f1ac731c2846ecbe343b56b28}{gl}}-\/>sg\_nseg));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05113}05113 \textcolor{preprocessor}{\#if 0   }\textcolor{comment}{/* vm\_wr not readily available here. */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05114}05114         KASSERT(\mbox{\hyperlink{adapter_8h_a29e1c73f1ac731c2846ecbe343b56b28}{gl}}-\/>sg\_nseg > 0 \&\& \mbox{\hyperlink{adapter_8h_a29e1c73f1ac731c2846ecbe343b56b28}{gl}}-\/>sg\_nseg <= \mbox{\hyperlink{t4__sge_8c_a500e95bfc28f66ad001142a0d4d64257}{max\_nsegs\_allowed}}(m, vm\_wr),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05115}05115             (\textcolor{stringliteral}{"{}\%s: \%d segments, should have been 1 <= nsegs <= \%d"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05116}05116                 \mbox{\hyperlink{adapter_8h_a29e1c73f1ac731c2846ecbe343b56b28}{gl}}-\/>sg\_nseg, \mbox{\hyperlink{t4__sge_8c_a500e95bfc28f66ad001142a0d4d64257}{max\_nsegs\_allowed}}(m, vm\_wr)));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05117}05117 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05118}05118 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05119}05119 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05120}05120 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05121}05121 \textcolor{comment}{ * len16 for a txpkt WR with a GL.  Includes the firmware work request header.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05122}05122 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05123}05123 \textcolor{keyword}{static} \textcolor{keyword}{inline} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05124}\mbox{\hyperlink{t4__sge_8c_a9ec405955d7d34f2d0b4e7d163cd309f}{05124}} \mbox{\hyperlink{t4__sge_8c_a9ec405955d7d34f2d0b4e7d163cd309f}{txpkt\_len16}}(u\_int nsegs, \textcolor{keyword}{const} u\_int extra)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05125}05125 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05126}05126         u\_int n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05127}05127 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05128}05128         MPASS(nsegs > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05129}05129 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05130}05130         nsegs-\/-\/; \textcolor{comment}{/* first segment is part of ulptx\_sgl */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05131}05131         n = extra + \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structfw__eth__tx__pkt__wr}{fw\_eth\_tx\_pkt\_wr}}) +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05132}05132             sizeof(struct \mbox{\hyperlink{structcpl__tx__pkt__core}{cpl\_tx\_pkt\_core}}) +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05133}05133             sizeof(struct \mbox{\hyperlink{structulptx__sgl}{ulptx\_sgl}}) + 8 * ((3 * nsegs) / 2 + (nsegs \& 1));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05134}05134 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05135}05135         \textcolor{keywordflow}{return} (howmany(n, 16));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05136}05136 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05137}05137 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05138}05138 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05139}05139 \textcolor{comment}{ * len16 for a txpkt\_vm WR with a GL.  Includes the firmware work}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05140}05140 \textcolor{comment}{ * request header.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05141}05141 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05142}05142 \textcolor{keyword}{static} \textcolor{keyword}{inline} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05143}\mbox{\hyperlink{t4__sge_8c_af059001e4d8493a578bff4ec86a48790}{05143}} \mbox{\hyperlink{t4__sge_8c_af059001e4d8493a578bff4ec86a48790}{txpkt\_vm\_len16}}(u\_int nsegs, \textcolor{keyword}{const} u\_int extra)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05144}05144 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05145}05145         u\_int n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05146}05146 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05147}05147         MPASS(nsegs > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05148}05148 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05149}05149         nsegs-\/-\/; \textcolor{comment}{/* first segment is part of ulptx\_sgl */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05150}05150         n = extra + \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structfw__eth__tx__pkt__vm__wr}{fw\_eth\_tx\_pkt\_vm\_wr}}) +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05151}05151             sizeof(struct \mbox{\hyperlink{structcpl__tx__pkt__core}{cpl\_tx\_pkt\_core}}) +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05152}05152             sizeof(struct \mbox{\hyperlink{structulptx__sgl}{ulptx\_sgl}}) + 8 * ((3 * nsegs) / 2 + (nsegs \& 1));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05153}05153 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05154}05154         \textcolor{keywordflow}{return} (howmany(n, 16));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05155}05155 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05156}05156 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05157}05157 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05158}\mbox{\hyperlink{t4__sge_8c_a5d566c57475924b2da78ff5946c44365}{05158}} \mbox{\hyperlink{t4__sge_8c_a5d566c57475924b2da78ff5946c44365}{calculate\_mbuf\_len16}}(\textcolor{keyword}{struct} mbuf *m, \textcolor{keywordtype}{bool} vm\_wr)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05159}05159 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05160}05160         \textcolor{keyword}{const} \textcolor{keywordtype}{int} lso = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__pkt__lso__core}{cpl\_tx\_pkt\_lso\_core}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05161}05161         \textcolor{keyword}{const} \textcolor{keywordtype}{int} tnl\_lso = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__tnl__lso}{cpl\_tx\_tnl\_lso}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05162}05162 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05163}05163         \textcolor{keywordflow}{if} (vm\_wr) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05164}05164                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ae6ecacf657295bf32737d5feea989d27}{needs\_tso}}(m))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05165}05165                         \mbox{\hyperlink{t4__sge_8c_aa079f5fcec3d96d99893ba7d946f329a}{set\_mbuf\_len16}}(m, \mbox{\hyperlink{t4__sge_8c_af059001e4d8493a578bff4ec86a48790}{txpkt\_vm\_len16}}(\mbox{\hyperlink{t4__sge_8c_a620de1776baac1a496fbfda0f34d8b39}{mbuf\_nsegs}}(m), lso));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05166}05166                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05167}05167                         \mbox{\hyperlink{t4__sge_8c_aa079f5fcec3d96d99893ba7d946f329a}{set\_mbuf\_len16}}(m, \mbox{\hyperlink{t4__sge_8c_af059001e4d8493a578bff4ec86a48790}{txpkt\_vm\_len16}}(\mbox{\hyperlink{t4__sge_8c_a620de1776baac1a496fbfda0f34d8b39}{mbuf\_nsegs}}(m), 0));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05168}05168                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05169}05169         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05170}05170 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05171}05171         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ae6ecacf657295bf32737d5feea989d27}{needs\_tso}}(m)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05172}05172                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a0f9f4a3fbae2af076602c29fcb5c18ad}{needs\_vxlan\_tso}}(m))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05173}05173                         \mbox{\hyperlink{t4__sge_8c_aa079f5fcec3d96d99893ba7d946f329a}{set\_mbuf\_len16}}(m, \mbox{\hyperlink{t4__sge_8c_a9ec405955d7d34f2d0b4e7d163cd309f}{txpkt\_len16}}(\mbox{\hyperlink{t4__sge_8c_a620de1776baac1a496fbfda0f34d8b39}{mbuf\_nsegs}}(m), tnl\_lso));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05174}05174                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05175}05175                         \mbox{\hyperlink{t4__sge_8c_aa079f5fcec3d96d99893ba7d946f329a}{set\_mbuf\_len16}}(m, \mbox{\hyperlink{t4__sge_8c_a9ec405955d7d34f2d0b4e7d163cd309f}{txpkt\_len16}}(\mbox{\hyperlink{t4__sge_8c_a620de1776baac1a496fbfda0f34d8b39}{mbuf\_nsegs}}(m), lso));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05176}05176         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05177}05177                 \mbox{\hyperlink{t4__sge_8c_aa079f5fcec3d96d99893ba7d946f329a}{set\_mbuf\_len16}}(m, \mbox{\hyperlink{t4__sge_8c_a9ec405955d7d34f2d0b4e7d163cd309f}{txpkt\_len16}}(\mbox{\hyperlink{t4__sge_8c_a620de1776baac1a496fbfda0f34d8b39}{mbuf\_nsegs}}(m), 0));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05178}05178 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05179}05179 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05180}05180 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05181}05181 \textcolor{comment}{ * len16 for a txpkts type 0 WR with a GL.  Does not include the firmware work}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05182}05182 \textcolor{comment}{ * request header.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05183}05183 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05184}05184 \textcolor{keyword}{static} \textcolor{keyword}{inline} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05185}\mbox{\hyperlink{t4__sge_8c_ab1998119238c6c4c5053563d5daf7b69}{05185}} \mbox{\hyperlink{t4__sge_8c_ab1998119238c6c4c5053563d5daf7b69}{txpkts0\_len16}}(u\_int nsegs)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05186}05186 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05187}05187         u\_int n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05188}05188 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05189}05189         MPASS(nsegs > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05190}05190 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05191}05191         nsegs-\/-\/; \textcolor{comment}{/* first segment is part of ulptx\_sgl */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05192}05192         n = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structulp__txpkt}{ulp\_txpkt}}) + sizeof(struct \mbox{\hyperlink{structulptx__idata}{ulptx\_idata}}) +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05193}05193             sizeof(struct \mbox{\hyperlink{structcpl__tx__pkt__core}{cpl\_tx\_pkt\_core}}) + sizeof(struct \mbox{\hyperlink{structulptx__sgl}{ulptx\_sgl}}) +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05194}05194             8 * ((3 * nsegs) / 2 + (nsegs \& 1));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05195}05195 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05196}05196         \textcolor{keywordflow}{return} (howmany(n, 16));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05197}05197 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05198}05198 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05199}05199 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05200}05200 \textcolor{comment}{ * len16 for a txpkts type 1 WR with a GL.  Does not include the firmware work}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05201}05201 \textcolor{comment}{ * request header.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05202}05202 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05203}05203 \textcolor{keyword}{static} \textcolor{keyword}{inline} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05204}\mbox{\hyperlink{t4__sge_8c_a1bf2a7023f5b2f577c53324bfc94ddcf}{05204}} \mbox{\hyperlink{t4__sge_8c_a1bf2a7023f5b2f577c53324bfc94ddcf}{txpkts1\_len16}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05205}05205 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05206}05206         u\_int n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05207}05207 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05208}05208         n = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__pkt__core}{cpl\_tx\_pkt\_core}}) + sizeof(struct \mbox{\hyperlink{structulptx__sgl}{ulptx\_sgl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05209}05209 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05210}05210         \textcolor{keywordflow}{return} (howmany(n, 16));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05211}05211 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05212}05212 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05213}05213 \textcolor{keyword}{static} \textcolor{keyword}{inline} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05214}\mbox{\hyperlink{t4__sge_8c_aaf6ba5814b2a48cb6f54e1886daa36e8}{05214}} \mbox{\hyperlink{t4__sge_8c_aaf6ba5814b2a48cb6f54e1886daa36e8}{imm\_payload}}(u\_int ndesc)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05215}05215 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05216}05216         u\_int n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05217}05217 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05218}05218         n = ndesc * \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55baf3734448daec2948d8500597c54bf262}{EQ\_ESIZE}} -\/ \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structfw__eth__tx__pkt__wr}{fw\_eth\_tx\_pkt\_wr}}) -\/}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05219}05219             sizeof(struct \mbox{\hyperlink{structcpl__tx__pkt__core}{cpl\_tx\_pkt\_core}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05220}05220 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05221}05221         \textcolor{keywordflow}{return} (n);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05222}05222 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05223}05223 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05224}05224 \textcolor{keyword}{static} \textcolor{keyword}{inline} uint64\_t}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05225}\mbox{\hyperlink{t4__sge_8c_abd1635fecd290bea91271166d26b1d38}{05225}} \mbox{\hyperlink{t4__sge_8c_abd1635fecd290bea91271166d26b1d38}{csum\_to\_ctrl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05226}05226 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05227}05227         uint64\_t ctrl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05228}05228         \textcolor{keywordtype}{int} csum\_type, l2hlen, l3hlen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05229}05229         \textcolor{keywordtype}{int} x, y;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05230}05230         \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{int} csum\_types[3][2] = \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05231}05231                 \{\mbox{\hyperlink{t4__msg_8h_a458e651af6690959efa2afb96be7d609a68edf354d5bfcb7eacc0dc66766415f1}{TX\_CSUM\_TCPIP}}, \mbox{\hyperlink{t4__msg_8h_a458e651af6690959efa2afb96be7d609ae5ee7a6580305c4f455be212431c96b8}{TX\_CSUM\_TCPIP6}}\},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05232}05232                 \{\mbox{\hyperlink{t4__msg_8h_a458e651af6690959efa2afb96be7d609ad052044310c49ec189cb991d514f9ed1}{TX\_CSUM\_UDPIP}}, \mbox{\hyperlink{t4__msg_8h_a458e651af6690959efa2afb96be7d609a2c63ec0d97c17fbae5beed439932fde3}{TX\_CSUM\_UDPIP6}}\},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05233}05233                 \{\mbox{\hyperlink{t4__msg_8h_a458e651af6690959efa2afb96be7d609afbeaf418ea89d1f741890622a2197cf1}{TX\_CSUM\_IP}}, 0\}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05234}05234         \};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05235}05235 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05236}05236         M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05237}05237 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05238}05238         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{t4__sge_8c_a76e650c34cc649130b08fa440dc6d90d}{needs\_hwcsum}}(m))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05239}05239                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{t4__msg_8h_aeb33f4a0d4672077c0385c8b1087fd55}{F\_TXPKT\_IPCSUM\_DIS}} | \mbox{\hyperlink{t4__msg_8h_a57a90ee1ce16cffa9fd1213b283b3b56}{F\_TXPKT\_L4CSUM\_DIS}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05240}05240 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05241}05241         MPASS(m-\/>m\_pkthdr.l2hlen >= ETHER\_HDR\_LEN);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05242}05242         MPASS(m-\/>m\_pkthdr.l3hlen >= \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} ip));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05243}05243 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05244}05244         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a78d685794cce948b56a160eed329b802}{needs\_vxlan\_csum}}(m)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05245}05245                 MPASS(m-\/>m\_pkthdr.l4hlen > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05246}05246                 MPASS(m-\/>m\_pkthdr.l5hlen > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05247}05247                 MPASS(m-\/>m\_pkthdr.inner\_l2hlen >= ETHER\_HDR\_LEN);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05248}05248                 MPASS(m-\/>m\_pkthdr.inner\_l3hlen >= \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} ip));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05249}05249 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05250}05250                 l2hlen = m-\/>m\_pkthdr.l2hlen + m-\/>m\_pkthdr.l3hlen +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05251}05251                     m-\/>m\_pkthdr.l4hlen + m-\/>m\_pkthdr.l5hlen +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05252}05252                     m-\/>m\_pkthdr.inner\_l2hlen -\/ ETHER\_HDR\_LEN;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05253}05253                 l3hlen = m-\/>m\_pkthdr.inner\_l3hlen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05254}05254         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05255}05255                 l2hlen = m-\/>m\_pkthdr.l2hlen -\/ ETHER\_HDR\_LEN;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05256}05256                 l3hlen = m-\/>m\_pkthdr.l3hlen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05257}05257         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05258}05258 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05259}05259         ctrl = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05260}05260         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{t4__sge_8c_aaa07d5056bea90cbfdd4861396dcb7c3}{needs\_l3\_csum}}(m))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05261}05261                 ctrl |= \mbox{\hyperlink{t4__msg_8h_aeb33f4a0d4672077c0385c8b1087fd55}{F\_TXPKT\_IPCSUM\_DIS}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05262}05262 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05263}05263         \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.csum\_flags \& (CSUM\_IP\_TCP | CSUM\_INNER\_IP\_TCP |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05264}05264             CSUM\_IP6\_TCP | CSUM\_INNER\_IP6\_TCP))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05265}05265                 x = 0;  \textcolor{comment}{/* TCP */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05266}05266         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.csum\_flags \& (CSUM\_IP\_UDP | CSUM\_INNER\_IP\_UDP |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05267}05267             CSUM\_IP6\_UDP | CSUM\_INNER\_IP6\_UDP))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05268}05268                 x = 1;  \textcolor{comment}{/* UDP */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05269}05269         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05270}05270                 x = 2;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05271}05271 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05272}05272         \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.csum\_flags \& (CSUM\_IP | CSUM\_IP\_TCP | CSUM\_IP\_UDP |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05273}05273             CSUM\_INNER\_IP | CSUM\_INNER\_IP\_TCP | CSUM\_INNER\_IP\_UDP))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05274}05274                 y = 0;  \textcolor{comment}{/* IPv4 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05275}05275         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05276}05276                 MPASS(m-\/>m\_pkthdr.csum\_flags \& (CSUM\_IP6\_TCP | CSUM\_IP6\_UDP |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05277}05277                     CSUM\_INNER\_IP6\_TCP | CSUM\_INNER\_IP6\_UDP));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05278}05278                 y = 1;  \textcolor{comment}{/* IPv6 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05279}05279         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05280}05280         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05281}05281 \textcolor{comment}{         * needs\_hwcsum returned true earlier so there must be some kind of}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05282}05282 \textcolor{comment}{         * checksum to calculate.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05283}05283 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05284}05284         csum\_type = csum\_types[x][y];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05285}05285         MPASS(csum\_type != 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05286}05286         \textcolor{keywordflow}{if} (csum\_type == \mbox{\hyperlink{t4__msg_8h_a458e651af6690959efa2afb96be7d609afbeaf418ea89d1f741890622a2197cf1}{TX\_CSUM\_IP}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05287}05287                 ctrl |= \mbox{\hyperlink{t4__msg_8h_a57a90ee1ce16cffa9fd1213b283b3b56}{F\_TXPKT\_L4CSUM\_DIS}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05288}05288         ctrl |= \mbox{\hyperlink{t4__msg_8h_a47eefd1920fc20ba1e21b4bd52cbedc7}{V\_TXPKT\_CSUM\_TYPE}}(csum\_type) | \mbox{\hyperlink{t4__msg_8h_acabf71006b3486a50f6afc8072337888}{V\_TXPKT\_IPHDR\_LEN}}(l3hlen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05289}05289         \textcolor{keywordflow}{if} (\mbox{\hyperlink{common_8h_a9760c128d8c5191e65faf12d0ceba0a1}{chip\_id}}(sc) <= \mbox{\hyperlink{common_8h_a2153d86ca1fc4195c2c7fa4cfaf8a57e}{CHELSIO\_T5}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05290}05290                 ctrl |= \mbox{\hyperlink{t4__msg_8h_a634fac4c11a5d57c19b630b610a94530}{V\_TXPKT\_ETHHDR\_LEN}}(l2hlen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05291}05291         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05292}05292                 ctrl |= \mbox{\hyperlink{t4__msg_8h_ae86f1fc0a9c6988baf02eaaf0a3f1157}{V\_T6\_TXPKT\_ETHHDR\_LEN}}(l2hlen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05293}05293 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05294}05294         \textcolor{keywordflow}{return} (ctrl);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05295}05295 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05296}05296 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05297}05297 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void} *}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05298}\mbox{\hyperlink{t4__sge_8c_a2afe76cf222ce1b29cedd636a1fb1ee4}{05298}} \mbox{\hyperlink{t4__sge_8c_a2afe76cf222ce1b29cedd636a1fb1ee4}{write\_lso\_cpl}}(\textcolor{keywordtype}{void} *cpl, \textcolor{keyword}{struct} mbuf *m0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05299}05299 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05300}05300         \textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__pkt__lso__core}{cpl\_tx\_pkt\_lso\_core}} *lso;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05301}05301         uint32\_t ctrl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05302}05302 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05303}05303         KASSERT(m0-\/>m\_pkthdr.l2hlen > 0 \&\& m0-\/>m\_pkthdr.l3hlen > 0 \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05304}05304             m0-\/>m\_pkthdr.l4hlen > 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05305}05305             (\textcolor{stringliteral}{"{}\%s: mbuf \%p needs TSO but missing header lengths"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05306}05306                 \_\_func\_\_, m0));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05307}05307 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05308}05308         ctrl = \mbox{\hyperlink{t4__msg_8h_a105ff541c06eafc90f54867733385a08}{V\_LSO\_OPCODE}}(\mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebba0c481a3afe19e160383ba8caddde1991}{CPL\_TX\_PKT\_LSO}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05309}05309             \mbox{\hyperlink{t4__msg_8h_aa880292d3087b146db1838cc07c31e19}{F\_LSO\_FIRST\_SLICE}} | \mbox{\hyperlink{t4__msg_8h_a29fa19c03799a320128eca511e6e5b91}{F\_LSO\_LAST\_SLICE}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05310}05310             \mbox{\hyperlink{t4__msg_8h_aa060594208b1e95553705ce4afc5c130}{V\_LSO\_ETHHDR\_LEN}}((m0-\/>m\_pkthdr.l2hlen -\/ ETHER\_HDR\_LEN) >> 2) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05311}05311             \mbox{\hyperlink{t4__msg_8h_ad10e9a09965b74a1de46fea0022955c5}{V\_LSO\_IPHDR\_LEN}}(m0-\/>m\_pkthdr.l3hlen >> 2) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05312}05312             \mbox{\hyperlink{t4__msg_8h_a90167e14fd8a16340006c0ee5f558cc7}{V\_LSO\_TCPHDR\_LEN}}(m0-\/>m\_pkthdr.l4hlen >> 2);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05313}05313         \textcolor{keywordflow}{if} (m0-\/>m\_pkthdr.l3hlen == \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} ip6\_hdr))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05314}05314                 ctrl |= \mbox{\hyperlink{t4__msg_8h_ad47bea99d66ddad557f9171ee100eff9}{F\_LSO\_IPV6}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05315}05315 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05316}05316         lso = cpl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05317}05317         lso-\/>\mbox{\hyperlink{structcpl__tx__pkt__lso__core_adfd83fec86090a417fdf143b9109894d}{lso\_ctrl}} = htobe32(ctrl);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05318}05318         lso-\/>\mbox{\hyperlink{structcpl__tx__pkt__lso__core_a31d648ea9f437f212be728d36ce14581}{ipid\_ofst}} = htobe16(0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05319}05319         lso-\/>\mbox{\hyperlink{structcpl__tx__pkt__lso__core_a8040ab9409bddd7dca89dbfdae6654e5}{mss}} = htobe16(m0-\/>m\_pkthdr.tso\_segsz);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05320}05320         lso-\/>\mbox{\hyperlink{structcpl__tx__pkt__lso__core_af44d8cf800e80b7f0152a8e1ab42b610}{seqno\_offset}} = htobe32(0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05321}05321         lso-\/>\mbox{\hyperlink{structcpl__tx__pkt__lso__core_a76ba483518a8a4bc393a074e87140ae5}{len}} = htobe32(m0-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05322}05322 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05323}05323         \textcolor{keywordflow}{return} (lso + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05324}05324 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05325}05325 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05326}05326 \textcolor{keyword}{static} \textcolor{keywordtype}{void} *}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05327}\mbox{\hyperlink{t4__sge_8c_ac1e603737e35f8950e0f028c466a01e4}{05327}} \mbox{\hyperlink{t4__sge_8c_ac1e603737e35f8950e0f028c466a01e4}{write\_tnl\_lso\_cpl}}(\textcolor{keywordtype}{void} *cpl, \textcolor{keyword}{struct} mbuf *m0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05328}05328 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05329}05329         \textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__tnl__lso}{cpl\_tx\_tnl\_lso}} *tnl\_lso = cpl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05330}05330         uint32\_t ctrl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05331}05331 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05332}05332         KASSERT(m0-\/>m\_pkthdr.inner\_l2hlen > 0 \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05333}05333             m0-\/>m\_pkthdr.inner\_l3hlen > 0 \&\& m0-\/>m\_pkthdr.inner\_l4hlen > 0 \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05334}05334             m0-\/>m\_pkthdr.inner\_l5hlen > 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05335}05335             (\textcolor{stringliteral}{"{}\%s: mbuf \%p needs VXLAN\_TSO but missing inner header lengths"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05336}05336                 \_\_func\_\_, m0));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05337}05337         KASSERT(m0-\/>m\_pkthdr.l2hlen > 0 \&\& m0-\/>m\_pkthdr.l3hlen > 0 \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05338}05338             m0-\/>m\_pkthdr.l4hlen > 0 \&\& m0-\/>m\_pkthdr.l5hlen > 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05339}05339             (\textcolor{stringliteral}{"{}\%s: mbuf \%p needs VXLAN\_TSO but missing outer header lengths"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05340}05340                 \_\_func\_\_, m0));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05341}05341 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05342}05342         \textcolor{comment}{/* Outer headers. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05343}05343         ctrl = \mbox{\hyperlink{t4__msg_8h_aeb2d2041575c84bec1b18657e6c1622a}{V\_CPL\_TX\_TNL\_LSO\_OPCODE}}(\mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebbaa7c874595103d92b15147a90da025cc1}{CPL\_TX\_TNL\_LSO}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05344}05344             \mbox{\hyperlink{t4__msg_8h_a0179204882b1116a4ba382cf293dd798}{F\_CPL\_TX\_TNL\_LSO\_FIRST}} | \mbox{\hyperlink{t4__msg_8h_a43b55fb578c3dbbcd9f759c3c548cbc8}{F\_CPL\_TX\_TNL\_LSO\_LAST}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05345}05345             \mbox{\hyperlink{t4__msg_8h_ac09d4e00422547b75aefabba90bdc202}{V\_CPL\_TX\_TNL\_LSO\_ETHHDRLENOUT}}(}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05346}05346                 (m0-\/>m\_pkthdr.l2hlen -\/ ETHER\_HDR\_LEN) >> 2) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05347}05347             \mbox{\hyperlink{t4__msg_8h_ac586daa0a47386f45d6d5484ef6fd29f}{V\_CPL\_TX\_TNL\_LSO\_IPHDRLENOUT}}(m0-\/>m\_pkthdr.l3hlen >> 2) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05348}05348             \mbox{\hyperlink{t4__msg_8h_a70ca411b7499949573a3fa35756097e2}{F\_CPL\_TX\_TNL\_LSO\_IPLENSETOUT}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05349}05349         \textcolor{keywordflow}{if} (m0-\/>m\_pkthdr.l3hlen == \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} ip6\_hdr))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05350}05350                 ctrl |= \mbox{\hyperlink{t4__msg_8h_a1ea263aa0f71b14d47dd68620ccef9c0}{F\_CPL\_TX\_TNL\_LSO\_IPV6OUT}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05351}05351         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05352}05352                 ctrl |= \mbox{\hyperlink{t4__msg_8h_a3e2b7572d0b5cde8d1a6de9e52d994b9}{F\_CPL\_TX\_TNL\_LSO\_IPHDRCHKOUT}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05353}05353                     \mbox{\hyperlink{t4__msg_8h_af2aee6ddbbe1ab9ed5374e77d18d5faf}{F\_CPL\_TX\_TNL\_LSO\_IPIDINCOUT}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05354}05354         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05355}05355         tnl\_lso-\/>\mbox{\hyperlink{structcpl__tx__tnl__lso_aa246f4ed83e4e1a84ff3ba91e6b1f53b}{op\_to\_IpIdSplitOut}} = htobe32(ctrl);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05356}05356         tnl\_lso-\/>\mbox{\hyperlink{structcpl__tx__tnl__lso_a0bdcb9f607e6be2caca7b80465620ff3}{IpIdOffsetOut}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05357}05357         tnl\_lso-\/>\mbox{\hyperlink{structcpl__tx__tnl__lso_ab5870161fb7ee0c2f54010c42b5120c9}{UdpLenSetOut\_to\_TnlHdrLen}} =}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05358}05358                 htobe16(\mbox{\hyperlink{t4__msg_8h_a86684c9e60a4d852c34da9a7649a1638}{F\_CPL\_TX\_TNL\_LSO\_UDPCHKCLROUT}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05359}05359                     \mbox{\hyperlink{t4__msg_8h_acbe541da2c5d032bca64841ca8b3600b}{F\_CPL\_TX\_TNL\_LSO\_UDPLENSETOUT}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05360}05360                     \mbox{\hyperlink{t4__msg_8h_a68b6e97b857996ecc18131fbe90ad685}{V\_CPL\_TX\_TNL\_LSO\_TNLHDRLEN}}(m0-\/>m\_pkthdr.l2hlen +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05361}05361                         m0-\/>m\_pkthdr.l3hlen + m0-\/>m\_pkthdr.l4hlen +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05362}05362                         m0-\/>m\_pkthdr.l5hlen) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05363}05363                     \mbox{\hyperlink{t4__msg_8h_a9257954fd71d917817c66ed3b6cdf1e8}{V\_CPL\_TX\_TNL\_LSO\_TNLTYPE}}(\mbox{\hyperlink{t4__msg_8h_a83cb98d0c72139fe42b3ac4ff396c91da4ffae95eebc5a3cb6b502b7adcafcae2}{TX\_TNL\_TYPE\_VXLAN}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05364}05364         tnl\_lso-\/>\mbox{\hyperlink{structcpl__tx__tnl__lso_ab9f3789559c05ff03f037d1ce3eed1fd}{r1}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05365}05365 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05366}05366         \textcolor{comment}{/* Inner headers. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05367}05367         ctrl = \mbox{\hyperlink{t4__msg_8h_a7186ecff5b83babca27d8d0b4522baa8}{V\_CPL\_TX\_TNL\_LSO\_ETHHDRLEN}}(}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05368}05368             (m0-\/>m\_pkthdr.inner\_l2hlen -\/ ETHER\_HDR\_LEN) >> 2) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05369}05369             \mbox{\hyperlink{t4__msg_8h_a3924ee66d0c7b917b98fe7696abca447}{V\_CPL\_TX\_TNL\_LSO\_IPHDRLEN}}(m0-\/>m\_pkthdr.inner\_l3hlen >> 2) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05370}05370             \mbox{\hyperlink{t4__msg_8h_acb51fbf2b28c85fa9e503bf43e229a4d}{V\_CPL\_TX\_TNL\_LSO\_TCPHDRLEN}}(m0-\/>m\_pkthdr.inner\_l4hlen >> 2);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05371}05371         \textcolor{keywordflow}{if} (m0-\/>m\_pkthdr.inner\_l3hlen == \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} ip6\_hdr))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05372}05372                 ctrl |= \mbox{\hyperlink{t4__msg_8h_abaac2a7a2035b6143ac286d57d0e2bae}{F\_CPL\_TX\_TNL\_LSO\_IPV6}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05373}05373         tnl\_lso-\/>\mbox{\hyperlink{structcpl__tx__tnl__lso_abe6d5bb0f1ad6879b347125a9cb97693}{Flow\_to\_TcpHdrLen}} = htobe32(ctrl);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05374}05374         tnl\_lso-\/>\mbox{\hyperlink{structcpl__tx__tnl__lso_adb37680096e4a26bc57a929895347ae1}{IpIdOffset}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05375}05375         tnl\_lso-\/>\mbox{\hyperlink{structcpl__tx__tnl__lso_aa46fa7cdf96f55a8425b24a16b736ed8}{IpIdSplit\_to\_Mss}} =}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05376}05376             htobe16(\mbox{\hyperlink{t4__msg_8h_aa764367bb90424991d34654e724292b5}{V\_CPL\_TX\_TNL\_LSO\_MSS}}(m0-\/>m\_pkthdr.tso\_segsz));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05377}05377         tnl\_lso-\/>\mbox{\hyperlink{structcpl__tx__tnl__lso_a8dac80e85d1bc693ccd2a19a24115870}{TCPSeqOffset}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05378}05378         tnl\_lso-\/>\mbox{\hyperlink{structcpl__tx__tnl__lso_a6c0a3747a682defd2a8fdbc05acbc859}{EthLenOffset\_Size}} =}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05379}05379             htobe32(\mbox{\hyperlink{t4__msg_8h_a63a3dc1d5170391c2fbb8147b8c8a915}{V\_CPL\_TX\_TNL\_LSO\_SIZE}}(m0-\/>m\_pkthdr.len));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05380}05380 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05381}05381         \textcolor{keywordflow}{return} (tnl\_lso + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05382}05382 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05383}05383 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05384}\mbox{\hyperlink{t4__sge_8c_a2fa456f661fe68c2f7d6d6a98b54da4e}{05384}} \textcolor{preprocessor}{\#define VM\_TX\_L2HDR\_LEN 16      }\textcolor{comment}{/* ethmacdst to vlantci */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05385}05385 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05386}05386 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05387}05387 \textcolor{comment}{ * Write a VM txpkt WR for this packet to the hardware descriptors, update the}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05388}05388 \textcolor{comment}{ * software descriptor, and advance the pidx.  It is guaranteed that enough}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05389}05389 \textcolor{comment}{ * descriptors are available.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05390}05390 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05391}05391 \textcolor{comment}{ * The return value is the \# of hardware descriptors used.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05392}05392 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05393}05393 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05394}\mbox{\hyperlink{t4__sge_8c_abf1d1d93efad4d497cfff16e239ca77b}{05394}} \mbox{\hyperlink{t4__sge_8c_abf1d1d93efad4d497cfff16e239ca77b}{write\_txpkt\_vm\_wr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq, \textcolor{keyword}{struct} mbuf *m0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05395}05395 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05396}05396         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05397}05397         \textcolor{keyword}{struct }\mbox{\hyperlink{structfw__eth__tx__pkt__vm__wr}{fw\_eth\_tx\_pkt\_vm\_wr}} *wr;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05398}05398         \textcolor{keyword}{struct }\mbox{\hyperlink{structtx__sdesc}{tx\_sdesc}} *txsd;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05399}05399         \textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__pkt__core}{cpl\_tx\_pkt\_core}} *cpl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05400}05400         uint32\_t ctrl;  \textcolor{comment}{/* used in many unrelated places */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05401}05401         uint64\_t \mbox{\hyperlink{structcpl__tx__pkt__core_a3c879243195a6dc379671b07e8e5f825}{ctrl1}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05402}05402         \textcolor{keywordtype}{int} len16, ndesc, pktlen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05403}05403         caddr\_t dst;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05404}05404 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05405}05405         \mbox{\hyperlink{adapter_8h_a744901428e6bd5d05414d661903c74b4}{TXQ\_LOCK\_ASSERT\_OWNED}}(txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05406}05406         M\_ASSERTPKTHDR(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05407}05407 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05408}05408         len16 = \mbox{\hyperlink{t4__sge_8c_a62c715deca2b86e88ee28434eebabea4}{mbuf\_len16}}(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05409}05409         pktlen = m0-\/>m\_pkthdr.len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05410}05410         ctrl = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__pkt__core}{cpl\_tx\_pkt\_core}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05411}05411         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ae6ecacf657295bf32737d5feea989d27}{needs\_tso}}(m0))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05412}05412                 ctrl += \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__pkt__lso__core}{cpl\_tx\_pkt\_lso\_core}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05413}05413         ndesc = \mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(len16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05414}05414 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05415}05415         \textcolor{comment}{/* Firmware work request header */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05416}05416         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_ae7ae404e7b40fddbb86a486c24227067}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05417}05417         wr = (\textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05418}05418         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkt__vm__wr_a7053494c2fc7055e231fcf200e2bb6c5}{op\_immdlen}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_a3ff5e4f34a83f6c7d5d5a917fac15be4}{V\_FW\_WR\_OP}}(\mbox{\hyperlink{t4fw__interface_8h_acad922311ad51c6f19f2a62af11cafd7a923e3a7cac3df586cc6ebe0e4a15cdfa}{FW\_ETH\_TX\_PKT\_VM\_WR}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05419}05419             \mbox{\hyperlink{t4fw__interface_8h_a1a050b6965b1d577b0d3da0c7f01e015}{V\_FW\_ETH\_TX\_PKT\_WR\_IMMDLEN}}(ctrl));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05420}05420 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05421}05421         ctrl = \mbox{\hyperlink{t4fw__interface_8h_a5cdd4e9f4ce069b358b161e019330de1}{V\_FW\_WR\_LEN16}}(len16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05422}05422         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkt__vm__wr_a959744548aee98c19e98714893125d80}{equiq\_to\_len16}} = htobe32(ctrl);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05423}05423         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkt__vm__wr_afcfc1c22e19d5d4aec9b0926eebe7e23}{r3}}[0] = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05424}05424         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkt__vm__wr_afcfc1c22e19d5d4aec9b0926eebe7e23}{r3}}[1] = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05425}05425 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05426}05426         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05427}05427 \textcolor{comment}{         * Copy over ethmacdst, ethmacsrc, ethtype, and vlantci.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05428}05428 \textcolor{comment}{         * vlantci is ignored unless the ethtype is 0x8100, so it's}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05429}05429 \textcolor{comment}{         * simpler to always copy it rather than making it}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05430}05430 \textcolor{comment}{         * conditional.  Also, it seems that we do not have to set}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05431}05431 \textcolor{comment}{         * vlantci or fake the ethtype when doing VLAN tag insertion.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05432}05432 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05433}05433         m\_copydata(m0, 0, \mbox{\hyperlink{t4__sge_8c_a2fa456f661fe68c2f7d6d6a98b54da4e}{VM\_TX\_L2HDR\_LEN}}, wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkt__vm__wr_a8363383b10a983e866d86d493309574b}{ethmacdst}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05434}05434 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05435}05435         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ae6ecacf657295bf32737d5feea989d27}{needs\_tso}}(m0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05436}05436                 cpl = \mbox{\hyperlink{t4__sge_8c_a2afe76cf222ce1b29cedd636a1fb1ee4}{write\_lso\_cpl}}(wr + 1, m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05437}05437                 txq-\/>\mbox{\hyperlink{structsge__txq_ad4918e7e0079a208a5cd44a45e6566c7}{tso\_wrs}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05438}05438         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05439}05439                 cpl = (\textcolor{keywordtype}{void} *)(wr + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05440}05440 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05441}05441         \textcolor{comment}{/* Checksum offload */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05442}05442         ctrl1 = \mbox{\hyperlink{t4__sge_8c_abd1635fecd290bea91271166d26b1d38}{csum\_to\_ctrl}}(sc, m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05443}05443         \textcolor{keywordflow}{if} (ctrl1 != (\mbox{\hyperlink{t4__msg_8h_aeb33f4a0d4672077c0385c8b1087fd55}{F\_TXPKT\_IPCSUM\_DIS}} | \mbox{\hyperlink{t4__msg_8h_a57a90ee1ce16cffa9fd1213b283b3b56}{F\_TXPKT\_L4CSUM\_DIS}}))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05444}05444                 txq-\/>\mbox{\hyperlink{structsge__txq_a54bd3e634577fd7b6a61c32c374ec59d}{txcsum}}++;    \textcolor{comment}{/* some hardware assistance provided */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05445}05445 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05446}05446         \textcolor{comment}{/* VLAN tag insertion */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05447}05447         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a94a7316babc844729e5be67779bf1485}{needs\_vlan\_insertion}}(m0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05448}05448                 ctrl1 |= \mbox{\hyperlink{t4__msg_8h_a493d54d3ea80df168f3775568a84ad91}{F\_TXPKT\_VLAN\_VLD}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05449}05449                     \mbox{\hyperlink{t4__msg_8h_a710d87104b120676fef1f28e71c8f6dc}{V\_TXPKT\_VLAN}}(m0-\/>m\_pkthdr.ether\_vtag);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05450}05450                 txq-\/>\mbox{\hyperlink{structsge__txq_a3166c7e9216131f72159bc4a34fffe7a}{vlan\_insertion}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05451}05451         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05452}05452 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05453}05453         \textcolor{comment}{/* CPL header */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05454}05454         cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_ad7ca5b3fec93f44fc575ae84d2337fc4}{ctrl0}} = txq-\/>\mbox{\hyperlink{structsge__txq_a5f790fc508f4155f68e18c513d5242b3}{cpl\_ctrl0}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05455}05455         cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_a344b274ffb11b6b18e69136373bb5a3b}{pack}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05456}05456         cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_a3a92307cc029c9f59ed4ec3c20420df6}{len}} = htobe16(pktlen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05457}05457         cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_a3c879243195a6dc379671b07e8e5f825}{ctrl1}} = htobe64(ctrl1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05458}05458 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05459}05459         \textcolor{comment}{/* SGL */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05460}05460         dst = (\textcolor{keywordtype}{void} *)(cpl + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05461}05461 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05462}05462         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05463}05463 \textcolor{comment}{         * A packet using TSO will use up an entire descriptor for the}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05464}05464 \textcolor{comment}{         * firmware work request header, LSO CPL, and TX\_PKT\_XT CPL.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05465}05465 \textcolor{comment}{         * If this descriptor is the last descriptor in the ring, wrap}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05466}05466 \textcolor{comment}{         * around to the front of the ring explicitly for the start of}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05467}05467 \textcolor{comment}{         * the sgl.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05468}05468 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05469}05469         \textcolor{keywordflow}{if} (dst == (\textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}]) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05470}05470                 dst = (\textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05471}05471                 \mbox{\hyperlink{t4__sge_8c_ab66dd27e913633697554914689038fb4}{write\_gl\_to\_txd}}(txq, m0, \&dst, 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05472}05472         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05473}05473                 \mbox{\hyperlink{t4__sge_8c_ab66dd27e913633697554914689038fb4}{write\_gl\_to\_txd}}(txq, m0, \&dst, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} -\/ ndesc < eq-\/>\mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05474}05474         txq-\/>\mbox{\hyperlink{structsge__txq_ab5ecd4454c9cc7b9cd822cc890f3b6af}{sgl\_wrs}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05475}05475         txq-\/>\mbox{\hyperlink{structsge__txq_a5baafe1b362a04cbf457a2b9f96f4eee}{txpkt\_wrs}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05476}05476 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05477}05477         txsd = \&txq-\/>\mbox{\hyperlink{structsge__txq_a9c8b88707107a1b08036b5fd4cbe2614}{sdesc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05478}05478         txsd-\/>\mbox{\hyperlink{structtx__sdesc_a209a2a7c23bb3d3792807741cc19b316}{m}} = m0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05479}05479         txsd-\/>\mbox{\hyperlink{structtx__sdesc_a169a430f9af4ec540e5a30ca35ccbffe}{desc\_used}} = ndesc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05480}05480 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05481}05481         \textcolor{keywordflow}{return} (ndesc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05482}05482 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05483}05483 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05484}05484 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05485}05485 \textcolor{comment}{ * Write a raw WR to the hardware descriptors, update the software}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05486}05486 \textcolor{comment}{ * descriptor, and advance the pidx.  It is guaranteed that enough}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05487}05487 \textcolor{comment}{ * descriptors are available.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05488}05488 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05489}05489 \textcolor{comment}{ * The return value is the \# of hardware descriptors used.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05490}05490 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05491}05491 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05492}\mbox{\hyperlink{t4__sge_8c_a9f013983c6707d2baafc3280297519e5}{05492}} \mbox{\hyperlink{t4__sge_8c_a9f013983c6707d2baafc3280297519e5}{write\_raw\_wr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq, \textcolor{keywordtype}{void} *wr, \textcolor{keyword}{struct} mbuf *m0, u\_int available)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05493}05493 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05494}05494         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_ae7ae404e7b40fddbb86a486c24227067}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05495}05495         \textcolor{keyword}{struct }\mbox{\hyperlink{structtx__sdesc}{tx\_sdesc}} *txsd;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05496}05496         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05497}05497         caddr\_t dst;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05498}05498         \textcolor{keywordtype}{int} len16, ndesc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05499}05499 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05500}05500         len16 = \mbox{\hyperlink{t4__sge_8c_a62c715deca2b86e88ee28434eebabea4}{mbuf\_len16}}(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05501}05501         ndesc = \mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(len16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05502}05502         MPASS(ndesc <= available);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05503}05503 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05504}05504         dst = wr;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05505}05505         \textcolor{keywordflow}{for} (m = m0; m != NULL; m = m-\/>m\_next)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05506}05506                 \mbox{\hyperlink{t4__sge_8c_aca5145708355fa01ae8c8eba424a8460}{copy\_to\_txd}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, mtod(m, caddr\_t), \&dst, m-\/>m\_len);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05507}05507 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05508}05508         txq-\/>\mbox{\hyperlink{structsge__txq_a07e9b9267ebc33eb5449ed4aa4428974}{raw\_wrs}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05509}05509 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05510}05510         txsd = \&txq-\/>\mbox{\hyperlink{structsge__txq_a9c8b88707107a1b08036b5fd4cbe2614}{sdesc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05511}05511         txsd-\/>\mbox{\hyperlink{structtx__sdesc_a209a2a7c23bb3d3792807741cc19b316}{m}} = m0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05512}05512         txsd-\/>\mbox{\hyperlink{structtx__sdesc_a169a430f9af4ec540e5a30ca35ccbffe}{desc\_used}} = ndesc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05513}05513 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05514}05514         \textcolor{keywordflow}{return} (ndesc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05515}05515 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05516}05516 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05517}05517 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05518}05518 \textcolor{comment}{ * Write a txpkt WR for this packet to the hardware descriptors, update the}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05519}05519 \textcolor{comment}{ * software descriptor, and advance the pidx.  It is guaranteed that enough}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05520}05520 \textcolor{comment}{ * descriptors are available.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05521}05521 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05522}05522 \textcolor{comment}{ * The return value is the \# of hardware descriptors used.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05523}05523 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05524}05524 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05525}\mbox{\hyperlink{t4__sge_8c_a89d48e1713a55754ddfab7e701fd1717}{05525}} \mbox{\hyperlink{t4__sge_8c_a89d48e1713a55754ddfab7e701fd1717}{write\_txpkt\_wr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq, \textcolor{keyword}{struct} mbuf *m0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05526}05526     u\_int available)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05527}05527 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05528}05528         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05529}05529         \textcolor{keyword}{struct }\mbox{\hyperlink{structfw__eth__tx__pkt__wr}{fw\_eth\_tx\_pkt\_wr}} *wr;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05530}05530         \textcolor{keyword}{struct }\mbox{\hyperlink{structtx__sdesc}{tx\_sdesc}} *txsd;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05531}05531         \textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__pkt__core}{cpl\_tx\_pkt\_core}} *cpl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05532}05532         uint32\_t ctrl;  \textcolor{comment}{/* used in many unrelated places */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05533}05533         uint64\_t \mbox{\hyperlink{structcpl__tx__pkt__core_a3c879243195a6dc379671b07e8e5f825}{ctrl1}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05534}05534         \textcolor{keywordtype}{int} len16, ndesc, pktlen, nsegs;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05535}05535         caddr\_t dst;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05536}05536 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05537}05537         \mbox{\hyperlink{adapter_8h_a744901428e6bd5d05414d661903c74b4}{TXQ\_LOCK\_ASSERT\_OWNED}}(txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05538}05538         M\_ASSERTPKTHDR(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05539}05539 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05540}05540         len16 = \mbox{\hyperlink{t4__sge_8c_a62c715deca2b86e88ee28434eebabea4}{mbuf\_len16}}(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05541}05541         nsegs = \mbox{\hyperlink{t4__sge_8c_a620de1776baac1a496fbfda0f34d8b39}{mbuf\_nsegs}}(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05542}05542         pktlen = m0-\/>m\_pkthdr.len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05543}05543         ctrl = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__pkt__core}{cpl\_tx\_pkt\_core}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05544}05544         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ae6ecacf657295bf32737d5feea989d27}{needs\_tso}}(m0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05545}05545                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a0f9f4a3fbae2af076602c29fcb5c18ad}{needs\_vxlan\_tso}}(m0))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05546}05546                         ctrl += \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__tnl__lso}{cpl\_tx\_tnl\_lso}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05547}05547                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05548}05548                         ctrl += \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__pkt__lso__core}{cpl\_tx\_pkt\_lso\_core}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05549}05549         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{t4__sge_8c_ae953eb715e585e362e57c6b64df2fe03}{mbuf\_cflags}}(m0) \& \mbox{\hyperlink{t4__sge_8c_a4353f1e1a017e811c6a8f5b0627da2fb}{MC\_NOMAP}}) \&\& pktlen <= \mbox{\hyperlink{t4__sge_8c_aaf6ba5814b2a48cb6f54e1886daa36e8}{imm\_payload}}(2) \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05550}05550             available >= 2) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05551}05551                 \textcolor{comment}{/* Immediate data.  Recalculate len16 and set nsegs to 0. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05552}05552                 ctrl += pktlen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05553}05553                 len16 = howmany(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structfw__eth__tx__pkt__wr}{fw\_eth\_tx\_pkt\_wr}}) +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05554}05554                     \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcpl__tx__pkt__core}{cpl\_tx\_pkt\_core}}) + pktlen, 16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05555}05555                 nsegs = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05556}05556         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05557}05557         ndesc = \mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(len16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05558}05558         MPASS(ndesc <= available);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05559}05559 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05560}05560         \textcolor{comment}{/* Firmware work request header */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05561}05561         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_ae7ae404e7b40fddbb86a486c24227067}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05562}05562         wr = (\textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05563}05563         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkt__wr_a3317a6243dedf10778b08d6e693f1c1e}{op\_immdlen}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_a3ff5e4f34a83f6c7d5d5a917fac15be4}{V\_FW\_WR\_OP}}(\mbox{\hyperlink{t4fw__interface_8h_acad922311ad51c6f19f2a62af11cafd7a76b3b801080e628d9584be302d220259}{FW\_ETH\_TX\_PKT\_WR}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05564}05564             \mbox{\hyperlink{t4fw__interface_8h_a1a050b6965b1d577b0d3da0c7f01e015}{V\_FW\_ETH\_TX\_PKT\_WR\_IMMDLEN}}(ctrl));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05565}05565 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05566}05566         ctrl = \mbox{\hyperlink{t4fw__interface_8h_a5cdd4e9f4ce069b358b161e019330de1}{V\_FW\_WR\_LEN16}}(len16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05567}05567         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkt__wr_a32064cc75d820febe9458c4ff8c6bd55}{equiq\_to\_len16}} = htobe32(ctrl);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05568}05568         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkt__wr_a7be78ae08bc0baa9dfb1fbafdbc24cd7}{r3}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05569}05569 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05570}05570         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ae6ecacf657295bf32737d5feea989d27}{needs\_tso}}(m0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05571}05571                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a0f9f4a3fbae2af076602c29fcb5c18ad}{needs\_vxlan\_tso}}(m0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05572}05572                         cpl = \mbox{\hyperlink{t4__sge_8c_ac1e603737e35f8950e0f028c466a01e4}{write\_tnl\_lso\_cpl}}(wr + 1, m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05573}05573                         txq-\/>\mbox{\hyperlink{structsge__txq_af7052d1874cd64a3720b639181867212}{vxlan\_tso\_wrs}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05574}05574                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05575}05575                         cpl = \mbox{\hyperlink{t4__sge_8c_a2afe76cf222ce1b29cedd636a1fb1ee4}{write\_lso\_cpl}}(wr + 1, m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05576}05576                         txq-\/>\mbox{\hyperlink{structsge__txq_ad4918e7e0079a208a5cd44a45e6566c7}{tso\_wrs}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05577}05577                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05578}05578         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05579}05579                 cpl = (\textcolor{keywordtype}{void} *)(wr + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05580}05580 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05581}05581         \textcolor{comment}{/* Checksum offload */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05582}05582         ctrl1 = \mbox{\hyperlink{t4__sge_8c_abd1635fecd290bea91271166d26b1d38}{csum\_to\_ctrl}}(sc, m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05583}05583         \textcolor{keywordflow}{if} (ctrl1 != (\mbox{\hyperlink{t4__msg_8h_aeb33f4a0d4672077c0385c8b1087fd55}{F\_TXPKT\_IPCSUM\_DIS}} | \mbox{\hyperlink{t4__msg_8h_a57a90ee1ce16cffa9fd1213b283b3b56}{F\_TXPKT\_L4CSUM\_DIS}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05584}05584                 \textcolor{comment}{/* some hardware assistance provided */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05585}05585                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a78d685794cce948b56a160eed329b802}{needs\_vxlan\_csum}}(m0))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05586}05586                         txq-\/>\mbox{\hyperlink{structsge__txq_af2597a9bdbf50dec50cdd18b72063dc9}{vxlan\_txcsum}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05587}05587                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05588}05588                         txq-\/>\mbox{\hyperlink{structsge__txq_a54bd3e634577fd7b6a61c32c374ec59d}{txcsum}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05589}05589         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05590}05590 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05591}05591         \textcolor{comment}{/* VLAN tag insertion */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05592}05592         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a94a7316babc844729e5be67779bf1485}{needs\_vlan\_insertion}}(m0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05593}05593                 ctrl1 |= \mbox{\hyperlink{t4__msg_8h_a493d54d3ea80df168f3775568a84ad91}{F\_TXPKT\_VLAN\_VLD}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05594}05594                     \mbox{\hyperlink{t4__msg_8h_a710d87104b120676fef1f28e71c8f6dc}{V\_TXPKT\_VLAN}}(m0-\/>m\_pkthdr.ether\_vtag);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05595}05595                 txq-\/>\mbox{\hyperlink{structsge__txq_a3166c7e9216131f72159bc4a34fffe7a}{vlan\_insertion}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05596}05596         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05597}05597 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05598}05598         \textcolor{comment}{/* CPL header */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05599}05599         cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_ad7ca5b3fec93f44fc575ae84d2337fc4}{ctrl0}} = txq-\/>\mbox{\hyperlink{structsge__txq_a5f790fc508f4155f68e18c513d5242b3}{cpl\_ctrl0}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05600}05600         cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_a344b274ffb11b6b18e69136373bb5a3b}{pack}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05601}05601         cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_a3a92307cc029c9f59ed4ec3c20420df6}{len}} = htobe16(pktlen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05602}05602         cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_a3c879243195a6dc379671b07e8e5f825}{ctrl1}} = htobe64(ctrl1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05603}05603 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05604}05604         \textcolor{comment}{/* SGL */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05605}05605         dst = (\textcolor{keywordtype}{void} *)(cpl + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05606}05606         \textcolor{keywordflow}{if} (\_\_predict\_false((uintptr\_t)dst == (uintptr\_t)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}]))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05607}05607                 dst = (caddr\_t)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05608}05608         \textcolor{keywordflow}{if} (nsegs > 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05609}05609 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05610}05610                 \mbox{\hyperlink{t4__sge_8c_ab66dd27e913633697554914689038fb4}{write\_gl\_to\_txd}}(txq, m0, \&dst, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} -\/ ndesc < eq-\/>\mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05611}05611                 txq-\/>\mbox{\hyperlink{structsge__txq_ab5ecd4454c9cc7b9cd822cc890f3b6af}{sgl\_wrs}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05612}05612         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05613}05613                 \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05614}05614 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05615}05615                 \textcolor{keywordflow}{for} (m = m0; m != NULL; m = m-\/>m\_next) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05616}05616                         \mbox{\hyperlink{t4__sge_8c_aca5145708355fa01ae8c8eba424a8460}{copy\_to\_txd}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, mtod(m, caddr\_t), \&dst, m-\/>m\_len);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05617}05617 \textcolor{preprocessor}{\#ifdef INVARIANTS}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05618}05618                         pktlen -\/= m-\/>m\_len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05619}05619 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05620}05620                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05621}05621 \textcolor{preprocessor}{\#ifdef INVARIANTS}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05622}05622                 KASSERT(pktlen == 0, (\textcolor{stringliteral}{"{}\%s: \%d bytes left."{}}, \_\_func\_\_, pktlen));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05623}05623 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05624}05624                 txq-\/>\mbox{\hyperlink{structsge__txq_a43b9a6160281fad65709892faf4fe4f9}{imm\_wrs}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05625}05625         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05626}05626 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05627}05627         txq-\/>\mbox{\hyperlink{structsge__txq_a5baafe1b362a04cbf457a2b9f96f4eee}{txpkt\_wrs}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05628}05628 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05629}05629         txsd = \&txq-\/>\mbox{\hyperlink{structsge__txq_a9c8b88707107a1b08036b5fd4cbe2614}{sdesc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05630}05630         txsd-\/>\mbox{\hyperlink{structtx__sdesc_a209a2a7c23bb3d3792807741cc19b316}{m}} = m0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05631}05631         txsd-\/>\mbox{\hyperlink{structtx__sdesc_a169a430f9af4ec540e5a30ca35ccbffe}{desc\_used}} = ndesc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05632}05632 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05633}05633         \textcolor{keywordflow}{return} (ndesc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05634}05634 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05635}05635 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05636}05636 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05637}\mbox{\hyperlink{t4__sge_8c_ad08bf243cc315336462fbca17ec0faf1}{05637}} \mbox{\hyperlink{t4__sge_8c_ad08bf243cc315336462fbca17ec0faf1}{cmp\_l2hdr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structtxpkts}{txpkts}} *\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}, \textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05638}05638 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05639}05639         \textcolor{keywordtype}{int} len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05640}05640 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05641}05641         MPASS(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05642}05642         MPASS(m-\/>m\_len >= \mbox{\hyperlink{t4__sge_8c_a2fa456f661fe68c2f7d6d6a98b54da4e}{VM\_TX\_L2HDR\_LEN}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05643}05643 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05644}05644         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_abebb43fd32336e2051779b1e3a31ebbd}{ethtype}} == be16toh(ETHERTYPE\_VLAN))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05645}05645                 len = \mbox{\hyperlink{t4__sge_8c_a2fa456f661fe68c2f7d6d6a98b54da4e}{VM\_TX\_L2HDR\_LEN}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05646}05646         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05647}05647                 len = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }ether\_header);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05648}05648 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05649}05649         \textcolor{keywordflow}{return} (memcmp(m-\/>m\_data, \&\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae037424a98685afdb2d78c6e1904cfc6}{ethmacdst}}[0], len) != 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05650}05650 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05651}05651 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05652}05652 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05653}\mbox{\hyperlink{t4__sge_8c_a89a407a0ad48fb0dddff5dc3515442f1}{05653}} \mbox{\hyperlink{t4__sge_8c_a89a407a0ad48fb0dddff5dc3515442f1}{save\_l2hdr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structtxpkts}{txpkts}} *\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}, \textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05654}05654 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05655}05655         MPASS(m-\/>m\_len >= \mbox{\hyperlink{t4__sge_8c_a2fa456f661fe68c2f7d6d6a98b54da4e}{VM\_TX\_L2HDR\_LEN}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05656}05656 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05657}05657         memcpy(\&\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae037424a98685afdb2d78c6e1904cfc6}{ethmacdst}}[0], mtod(m, \textcolor{keyword}{const} \textcolor{keywordtype}{void} *), \mbox{\hyperlink{t4__sge_8c_a2fa456f661fe68c2f7d6d6a98b54da4e}{VM\_TX\_L2HDR\_LEN}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05658}05658 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05659}05659 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05660}05660 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05661}\mbox{\hyperlink{t4__sge_8c_a667f1ae91cbd2e9fc6a2952f1bb2b8e4}{05661}} \mbox{\hyperlink{t4__sge_8c_a667f1ae91cbd2e9fc6a2952f1bb2b8e4}{add\_to\_txpkts\_vf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq, \textcolor{keyword}{struct} mbuf *m,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05662}05662     \textcolor{keywordtype}{int} avail, \textcolor{keywordtype}{bool} *send)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05663}05663 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05664}05664         \textcolor{keyword}{struct }\mbox{\hyperlink{structtxpkts}{txpkts}} *\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_a9d9270442d49358fe63c6155f2114968}{txp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05665}05665 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05666}05666         \textcolor{comment}{/* Cannot have TSO and coalesce at the same time. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05667}05667         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ad61c411fc0dd2e8cbae606c1d281ea54}{cannot\_use\_txpkts}}(m)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05668}05668 cannot\_coalesce:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05669}05669                 *send = \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} > 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05670}05670                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05671}05671         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05672}05672 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05673}05673         \textcolor{comment}{/* VF allows coalescing of type 1 (1 GL) only */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05674}05674         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a620de1776baac1a496fbfda0f34d8b39}{mbuf\_nsegs}}(m) > 1)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05675}05675                 \textcolor{keywordflow}{goto} cannot\_coalesce;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05676}05676 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05677}05677         *send = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05678}05678         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} > 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05679}05679                 MPASS(\mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}}) <= avail);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05680}05680                 MPASS(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} < \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a4647a7e1cf4bf98d587a472b3974dbed}{max\_npkt}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05681}05681                 MPASS(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a89bc6879a801ad968758e46bf441aa06}{wr\_type}} == 1);     \textcolor{comment}{/* VF supports type 1 only */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05682}05682 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05683}05683                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}} + \mbox{\hyperlink{t4__sge_8c_a1bf2a7023f5b2f577c53324bfc94ddcf}{txpkts1\_len16}}()) > avail) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05684}05684 retry\_after\_send:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05685}05685                         *send = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05686}05686                         \textcolor{keywordflow}{return} (EAGAIN);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05687}05687                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05688}05688                 \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.len + \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_af6eddb47465a9e42186c47bae7040f0d}{plen}} > 65535)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05689}05689                         \textcolor{keywordflow}{goto} retry\_after\_send;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05690}05690                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ad08bf243cc315336462fbca17ec0faf1}{cmp\_l2hdr}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}, m))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05691}05691                         \textcolor{keywordflow}{goto} retry\_after\_send;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05692}05692 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05693}05693                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}} += \mbox{\hyperlink{t4__sge_8c_a1bf2a7023f5b2f577c53324bfc94ddcf}{txpkts1\_len16}}();}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05694}05694                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_af6eddb47465a9e42186c47bae7040f0d}{plen}} += m-\/>m\_pkthdr.len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05695}05695                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}}++] = m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05696}05696                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} == \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a4647a7e1cf4bf98d587a472b3974dbed}{max\_npkt}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05697}05697                         *send = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05698}05698         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05699}05699                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}} = howmany(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structfw__eth__tx__pkts__vm__wr}{fw\_eth\_tx\_pkts\_vm\_wr}}), 16) +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05700}05700                     \mbox{\hyperlink{t4__sge_8c_a1bf2a7023f5b2f577c53324bfc94ddcf}{txpkts1\_len16}}();}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05701}05701                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}}) > avail)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05702}05702                         \textcolor{keywordflow}{goto} cannot\_coalesce;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05703}05703                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} = 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05704}05704                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a89bc6879a801ad968758e46bf441aa06}{wr\_type}} = 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05705}05705                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_af6eddb47465a9e42186c47bae7040f0d}{plen}} = m-\/>m\_pkthdr.len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05706}05706                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[0] = m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05707}05707                 \mbox{\hyperlink{t4__sge_8c_a89a407a0ad48fb0dddff5dc3515442f1}{save\_l2hdr}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}, m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05708}05708         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05709}05709         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05710}05710 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05711}05711 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05712}05712 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05713}\mbox{\hyperlink{t4__sge_8c_a464192533ba3c953e74222fe109d8ccd}{05713}} \mbox{\hyperlink{t4__sge_8c_a464192533ba3c953e74222fe109d8ccd}{add\_to\_txpkts\_pf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq, \textcolor{keyword}{struct} mbuf *m,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05714}05714     \textcolor{keywordtype}{int} avail, \textcolor{keywordtype}{bool} *send)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05715}05715 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05716}05716         \textcolor{keyword}{struct }\mbox{\hyperlink{structtxpkts}{txpkts}} *\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_a9d9270442d49358fe63c6155f2114968}{txp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05717}05717         \textcolor{keywordtype}{int} nsegs;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05718}05718 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05719}05719         MPASS(!(sc-\/>\mbox{\hyperlink{structadapter_a5b04a9c8ac519064f43255df133cfe84}{flags}} \& \mbox{\hyperlink{adapter_8h_adc29c2ff13d900c2f185ee95427fb06cab2621d2fb00629ea783dc0442df2356d}{IS\_VF}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05720}05720 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05721}05721         \textcolor{comment}{/* Cannot have TSO and coalesce at the same time. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05722}05722         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ad61c411fc0dd2e8cbae606c1d281ea54}{cannot\_use\_txpkts}}(m)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05723}05723 cannot\_coalesce:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05724}05724                 *send = \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} > 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05725}05725                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05726}05726         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05727}05727 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05728}05728         *send = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05729}05729         nsegs = \mbox{\hyperlink{t4__sge_8c_a620de1776baac1a496fbfda0f34d8b39}{mbuf\_nsegs}}(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05730}05730         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} == 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05731}05731                 \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.len > 65535)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05732}05732                         \textcolor{keywordflow}{goto} cannot\_coalesce;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05733}05733                 \textcolor{keywordflow}{if} (nsegs > 1) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05734}05734                         \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a89bc6879a801ad968758e46bf441aa06}{wr\_type}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05735}05735                         \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}} =}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05736}05736                             howmany(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structfw__eth__tx__pkts__wr}{fw\_eth\_tx\_pkts\_wr}}), 16) +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05737}05737                             \mbox{\hyperlink{t4__sge_8c_ab1998119238c6c4c5053563d5daf7b69}{txpkts0\_len16}}(nsegs);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05738}05738                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05739}05739                         \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a89bc6879a801ad968758e46bf441aa06}{wr\_type}} = 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05740}05740                         \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}} =}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05741}05741                             howmany(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structfw__eth__tx__pkts__wr}{fw\_eth\_tx\_pkts\_wr}}), 16) +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05742}05742                             \mbox{\hyperlink{t4__sge_8c_a1bf2a7023f5b2f577c53324bfc94ddcf}{txpkts1\_len16}}();}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05743}05743                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05744}05744                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}}) > avail)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05745}05745                         \textcolor{keywordflow}{goto} cannot\_coalesce;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05746}05746                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} = 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05747}05747                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_af6eddb47465a9e42186c47bae7040f0d}{plen}} = m-\/>m\_pkthdr.len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05748}05748                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[0] = m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05749}05749         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05750}05750                 MPASS(\mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}}) <= avail);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05751}05751                 MPASS(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} < \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a4647a7e1cf4bf98d587a472b3974dbed}{max\_npkt}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05752}05752 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05753}05753                 \textcolor{keywordflow}{if} (m-\/>m\_pkthdr.len + \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_af6eddb47465a9e42186c47bae7040f0d}{plen}} > 65535) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05754}05754 retry\_after\_send:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05755}05755                         *send = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05756}05756                         \textcolor{keywordflow}{return} (EAGAIN);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05757}05757                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05758}05758 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05759}05759                 MPASS(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a89bc6879a801ad968758e46bf441aa06}{wr\_type}} == 0 || \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a89bc6879a801ad968758e46bf441aa06}{wr\_type}} == 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05760}05760                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a89bc6879a801ad968758e46bf441aa06}{wr\_type}} == 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05761}05761                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}} +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05762}05762                             \mbox{\hyperlink{t4__sge_8c_ab1998119238c6c4c5053563d5daf7b69}{txpkts0\_len16}}(nsegs)) > min(avail, \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba3aa6bc0c73a01553747a2f051f03aab3}{SGE\_MAX\_WR\_NDESC}}))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05763}05763                                 \textcolor{keywordflow}{goto} retry\_after\_send;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05764}05764                         \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}} += \mbox{\hyperlink{t4__sge_8c_ab1998119238c6c4c5053563d5daf7b69}{txpkts0\_len16}}(nsegs);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05765}05765                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05766}05766                         \textcolor{keywordflow}{if} (nsegs != 1)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05767}05767                                 \textcolor{keywordflow}{goto} retry\_after\_send;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05768}05768                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}} + \mbox{\hyperlink{t4__sge_8c_a1bf2a7023f5b2f577c53324bfc94ddcf}{txpkts1\_len16}}()) >}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05769}05769                             avail)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05770}05770                                 \textcolor{keywordflow}{goto} retry\_after\_send;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05771}05771                         \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}} += \mbox{\hyperlink{t4__sge_8c_a1bf2a7023f5b2f577c53324bfc94ddcf}{txpkts1\_len16}}();}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05772}05772                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05773}05773 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05774}05774                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_af6eddb47465a9e42186c47bae7040f0d}{plen}} += m-\/>m\_pkthdr.len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05775}05775                 \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}}++] = m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05776}05776                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} == \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a4647a7e1cf4bf98d587a472b3974dbed}{max\_npkt}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05777}05777                         *send = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05778}05778         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05779}05779         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05780}05780 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05781}05781 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05782}05782 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05783}05783 \textcolor{comment}{ * Write a txpkts WR for the packets in txp to the hardware descriptors, update}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05784}05784 \textcolor{comment}{ * the software descriptor, and advance the pidx.  It is guaranteed that enough}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05785}05785 \textcolor{comment}{ * descriptors are available.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05786}05786 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05787}05787 \textcolor{comment}{ * The return value is the \# of hardware descriptors used.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05788}05788 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05789}05789 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05790}\mbox{\hyperlink{t4__sge_8c_ac3906e06a046bcfaaf4f686ec070d07e}{05790}} \mbox{\hyperlink{t4__sge_8c_ac3906e06a046bcfaaf4f686ec070d07e}{write\_txpkts\_wr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05791}05791 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05792}05792         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structtxpkts}{txpkts}} *\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_a9d9270442d49358fe63c6155f2114968}{txp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05793}05793         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_ae7ae404e7b40fddbb86a486c24227067}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05794}05794         \textcolor{keyword}{struct }\mbox{\hyperlink{structfw__eth__tx__pkts__wr}{fw\_eth\_tx\_pkts\_wr}} *wr;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05795}05795         \textcolor{keyword}{struct }\mbox{\hyperlink{structtx__sdesc}{tx\_sdesc}} *txsd;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05796}05796         \textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__pkt__core}{cpl\_tx\_pkt\_core}} *cpl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05797}05797         uint64\_t \mbox{\hyperlink{structcpl__tx__pkt__core_a3c879243195a6dc379671b07e8e5f825}{ctrl1}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05798}05798         \textcolor{keywordtype}{int} ndesc, i, checkwrap;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05799}05799         \textcolor{keyword}{struct }mbuf *m, *last;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05800}05800         \textcolor{keywordtype}{void} *flitp;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05801}05801 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05802}05802         \mbox{\hyperlink{adapter_8h_a744901428e6bd5d05414d661903c74b4}{TXQ\_LOCK\_ASSERT\_OWNED}}(txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05803}05803         MPASS(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05804}05804         MPASS(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}} <= howmany(\mbox{\hyperlink{t4__hw_8h_aabfcbcb5ac86a1edac4035264bc7d2b8a39f5773d0da7e12c9ab3b7eb43307ecd}{SGE\_MAX\_WR\_LEN}}, 16));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05805}05805 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05806}05806         wr = (\textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05807}05807         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkts__wr_af6282970d125f35ccf221a2a4ad8b94d}{op\_pkd}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_a3ff5e4f34a83f6c7d5d5a917fac15be4}{V\_FW\_WR\_OP}}(\mbox{\hyperlink{t4fw__interface_8h_acad922311ad51c6f19f2a62af11cafd7a16dac2dda81fd1fb0ede5a6e4e9ee530}{FW\_ETH\_TX\_PKTS\_WR}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05808}05808         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkts__wr_a312e78a66a2e150493fd1e3d6c2f1530}{equiq\_to\_len16}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_a5cdd4e9f4ce069b358b161e019330de1}{V\_FW\_WR\_LEN16}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05809}05809         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkts__wr_a8abe89e12d2c60fa4453ada6981a1efa}{plen}} = htobe16(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_af6eddb47465a9e42186c47bae7040f0d}{plen}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05810}05810         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkts__wr_ab33f795c1d067e354efc7e93d9d1e5b5}{npkt}} = \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05811}05811         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkts__wr_a2d1f44d2baa6846234009912091b18b7}{r3}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05812}05812         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkts__wr_a907df8c52fd3ba1b185788647b727d65}{type}} = \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a89bc6879a801ad968758e46bf441aa06}{wr\_type}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05813}05813         flitp = wr + 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05814}05814 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05815}05815         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05816}05816 \textcolor{comment}{         * At this point we are 16B into a hardware descriptor.  If checkwrap is}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05817}05817 \textcolor{comment}{         * set then we know the WR is going to wrap around somewhere.  We'll}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05818}05818 \textcolor{comment}{         * check for that at appropriate points.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05819}05819 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05820}05820         ndesc = \mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05821}05821         last = NULL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05822}05822         checkwrap = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} -\/ ndesc < \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05823}05823         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}}; i++) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05824}05824                 m = \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[i];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05825}05825                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a89bc6879a801ad968758e46bf441aa06}{wr\_type}} == 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05826}05826                         \textcolor{keyword}{struct }\mbox{\hyperlink{structulp__txpkt}{ulp\_txpkt}} *ulpmc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05827}05827                         \textcolor{keyword}{struct }\mbox{\hyperlink{structulptx__idata}{ulptx\_idata}} *ulpsc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05828}05828 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05829}05829                         \textcolor{comment}{/* ULP master command */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05830}05830                         ulpmc = flitp;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05831}05831                         ulpmc-\/>\mbox{\hyperlink{structulp__txpkt_a536571856047e069ddaed433ba4f0a74}{cmd\_dest}} = htobe32(\mbox{\hyperlink{t4__msg_8h_a8e732b552c603b4a2af575b5b74855bc}{V\_ULPTX\_CMD}}(\mbox{\hyperlink{t4__msg_8h_a84627a72058502328269676b81780f89ae693cb2bba289a1324b62df58ffacf2c}{ULP\_TX\_PKT}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05832}05832                             \mbox{\hyperlink{t4__msg_8h_a73b0553e3741f81a6fd0330540016d49}{V\_ULP\_TXPKT\_DEST}}(0) | \mbox{\hyperlink{t4__msg_8h_a1d8e00e019e2f7ebfdcdee5e698f732e}{V\_ULP\_TXPKT\_FID}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ac787bb5caab17934ff10c967ffa55ddb}{iqid}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05833}05833                         ulpmc-\/>\mbox{\hyperlink{structulp__txpkt_a6e3cd1a724c67049c8831d44508342a6}{len}} = htobe32(\mbox{\hyperlink{t4__sge_8c_ab1998119238c6c4c5053563d5daf7b69}{txpkts0\_len16}}(\mbox{\hyperlink{t4__sge_8c_a620de1776baac1a496fbfda0f34d8b39}{mbuf\_nsegs}}(m)));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05834}05834 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05835}05835                         \textcolor{comment}{/* ULP subcommand */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05836}05836                         ulpsc = (\textcolor{keywordtype}{void} *)(ulpmc + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05837}05837                         ulpsc-\/>\mbox{\hyperlink{structulptx__idata_ac43d504dcc12db2ff9f343fd9c6b8446}{cmd\_more}} = htobe32(\mbox{\hyperlink{t4__msg_8h_a8e732b552c603b4a2af575b5b74855bc}{V\_ULPTX\_CMD}}(\mbox{\hyperlink{t4__msg_8h_af3520ff6d43011872bab77edd27d4de3a29ab55a3335ad16ff8e83ae8b120bacb}{ULP\_TX\_SC\_IMM}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05838}05838                             \mbox{\hyperlink{t4__msg_8h_a447a5950cce0586a2ddf7fb200d6b6f8}{F\_ULP\_TX\_SC\_MORE}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05839}05839                         ulpsc-\/>\mbox{\hyperlink{structulptx__idata_a52c87f08764cc8dc504faa9f9e5f1025}{len}} = htobe32(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcpl__tx__pkt__core}{cpl\_tx\_pkt\_core}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05840}05840 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05841}05841                         cpl = (\textcolor{keywordtype}{void} *)(ulpsc + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05842}05842                         \textcolor{keywordflow}{if} (checkwrap \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05843}05843                             (uintptr\_t)cpl == (uintptr\_t)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}])}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05844}05844                                 cpl = (\textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05845}05845                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05846}05846                         cpl = flitp;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05847}05847                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05848}05848 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05849}05849                 \textcolor{comment}{/* Checksum offload */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05850}05850                 ctrl1 = \mbox{\hyperlink{t4__sge_8c_abd1635fecd290bea91271166d26b1d38}{csum\_to\_ctrl}}(sc, m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05851}05851                 \textcolor{keywordflow}{if} (ctrl1 != (\mbox{\hyperlink{t4__msg_8h_aeb33f4a0d4672077c0385c8b1087fd55}{F\_TXPKT\_IPCSUM\_DIS}} | \mbox{\hyperlink{t4__msg_8h_a57a90ee1ce16cffa9fd1213b283b3b56}{F\_TXPKT\_L4CSUM\_DIS}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05852}05852                         \textcolor{comment}{/* some hardware assistance provided */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05853}05853                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a78d685794cce948b56a160eed329b802}{needs\_vxlan\_csum}}(m))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05854}05854                                 txq-\/>\mbox{\hyperlink{structsge__txq_af2597a9bdbf50dec50cdd18b72063dc9}{vxlan\_txcsum}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05855}05855                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05856}05856                                 txq-\/>\mbox{\hyperlink{structsge__txq_a54bd3e634577fd7b6a61c32c374ec59d}{txcsum}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05857}05857                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05858}05858 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05859}05859                 \textcolor{comment}{/* VLAN tag insertion */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05860}05860                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a94a7316babc844729e5be67779bf1485}{needs\_vlan\_insertion}}(m)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05861}05861                         ctrl1 |= \mbox{\hyperlink{t4__msg_8h_a493d54d3ea80df168f3775568a84ad91}{F\_TXPKT\_VLAN\_VLD}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05862}05862                             \mbox{\hyperlink{t4__msg_8h_a710d87104b120676fef1f28e71c8f6dc}{V\_TXPKT\_VLAN}}(m-\/>m\_pkthdr.ether\_vtag);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05863}05863                         txq-\/>\mbox{\hyperlink{structsge__txq_a3166c7e9216131f72159bc4a34fffe7a}{vlan\_insertion}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05864}05864                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05865}05865 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05866}05866                 \textcolor{comment}{/* CPL header */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05867}05867                 cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_ad7ca5b3fec93f44fc575ae84d2337fc4}{ctrl0}} = txq-\/>\mbox{\hyperlink{structsge__txq_a5f790fc508f4155f68e18c513d5242b3}{cpl\_ctrl0}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05868}05868                 cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_a344b274ffb11b6b18e69136373bb5a3b}{pack}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05869}05869                 cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_a3a92307cc029c9f59ed4ec3c20420df6}{len}} = htobe16(m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05870}05870                 cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_a3c879243195a6dc379671b07e8e5f825}{ctrl1}} = htobe64(ctrl1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05871}05871 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05872}05872                 flitp = cpl + 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05873}05873                 \textcolor{keywordflow}{if} (checkwrap \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05874}05874                     (uintptr\_t)flitp == (uintptr\_t)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}])}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05875}05875                         flitp = (\textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05876}05876 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05877}05877                 \mbox{\hyperlink{t4__sge_8c_ab66dd27e913633697554914689038fb4}{write\_gl\_to\_txd}}(txq, m, (caddr\_t *)(\&flitp), checkwrap);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05878}05878 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05879}05879                 \textcolor{keywordflow}{if} (last != NULL)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05880}05880                         last-\/>m\_nextpkt = m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05881}05881                 last = m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05882}05882         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05883}05883 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05884}05884         txq-\/>\mbox{\hyperlink{structsge__txq_ab5ecd4454c9cc7b9cd822cc890f3b6af}{sgl\_wrs}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05885}05885         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a89bc6879a801ad968758e46bf441aa06}{wr\_type}} == 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05886}05886                 txq-\/>\mbox{\hyperlink{structsge__txq_a1371dafcecacb67cdcd62191a13e9eeb}{txpkts0\_pkts}} += \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05887}05887                 txq-\/>\mbox{\hyperlink{structsge__txq_aa273cf848de3a6bdbab4ecfde620e1ad}{txpkts0\_wrs}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05888}05888         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05889}05889                 txq-\/>\mbox{\hyperlink{structsge__txq_adec9f38db3cf34576fead9fbd2454f63}{txpkts1\_pkts}} += \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05890}05890                 txq-\/>\mbox{\hyperlink{structsge__txq_aaede03cbd089c1a3baa7dd848d2f7c7c}{txpkts1\_wrs}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05891}05891         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05892}05892 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05893}05893         txsd = \&txq-\/>\mbox{\hyperlink{structsge__txq_a9c8b88707107a1b08036b5fd4cbe2614}{sdesc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05894}05894         txsd-\/>\mbox{\hyperlink{structtx__sdesc_a209a2a7c23bb3d3792807741cc19b316}{m}} = \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05895}05895         txsd-\/>\mbox{\hyperlink{structtx__sdesc_a169a430f9af4ec540e5a30ca35ccbffe}{desc\_used}} = ndesc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05896}05896 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05897}05897         \textcolor{keywordflow}{return} (ndesc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05898}05898 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05899}05899 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05900}05900 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05901}\mbox{\hyperlink{t4__sge_8c_a13ef435aefdbba7f9966dcb626d73e62}{05901}} \mbox{\hyperlink{t4__sge_8c_a13ef435aefdbba7f9966dcb626d73e62}{write\_txpkts\_vm\_wr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05902}05902 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05903}05903         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structtxpkts}{txpkts}} *\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_a9d9270442d49358fe63c6155f2114968}{txp}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05904}05904         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_ae7ae404e7b40fddbb86a486c24227067}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05905}05905         \textcolor{keyword}{struct }\mbox{\hyperlink{structfw__eth__tx__pkts__vm__wr}{fw\_eth\_tx\_pkts\_vm\_wr}} *wr;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05906}05906         \textcolor{keyword}{struct }\mbox{\hyperlink{structtx__sdesc}{tx\_sdesc}} *txsd;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05907}05907         \textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__pkt__core}{cpl\_tx\_pkt\_core}} *cpl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05908}05908         uint64\_t \mbox{\hyperlink{structcpl__tx__pkt__core_a3c879243195a6dc379671b07e8e5f825}{ctrl1}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05909}05909         \textcolor{keywordtype}{int} ndesc, i;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05910}05910         \textcolor{keyword}{struct }mbuf *m, *last;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05911}05911         \textcolor{keywordtype}{void} *flitp;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05912}05912 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05913}05913         \mbox{\hyperlink{adapter_8h_a744901428e6bd5d05414d661903c74b4}{TXQ\_LOCK\_ASSERT\_OWNED}}(txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05914}05914         MPASS(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}} > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05915}05915         MPASS(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a89bc6879a801ad968758e46bf441aa06}{wr\_type}} == 1);     \textcolor{comment}{/* VF supports type 1 only */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05916}05916         MPASS(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[0] != NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05917}05917         MPASS(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}} <= howmany(\mbox{\hyperlink{t4__hw_8h_aabfcbcb5ac86a1edac4035264bc7d2b8a39f5773d0da7e12c9ab3b7eb43307ecd}{SGE\_MAX\_WR\_LEN}}, 16));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05918}05918 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05919}05919         wr = (\textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05920}05920         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkts__vm__wr_a3326ea4c536b038d265f114701d0555e}{op\_pkd}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_a3ff5e4f34a83f6c7d5d5a917fac15be4}{V\_FW\_WR\_OP}}(\mbox{\hyperlink{t4fw__interface_8h_acad922311ad51c6f19f2a62af11cafd7a52d189ccaa3b440cf0b9b680490d443a}{FW\_ETH\_TX\_PKTS\_VM\_WR}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05921}05921         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkts__vm__wr_a40880fc171c7443f7f6b81ee965c9c7f}{equiq\_to\_len16}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_a5cdd4e9f4ce069b358b161e019330de1}{V\_FW\_WR\_LEN16}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05922}05922         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkts__vm__wr_a492261310138997c46e4f45c6abc91a9}{r3}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05923}05923         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkts__vm__wr_a6ad3bb6d7b016c434c0497a581776bf6}{plen}} = htobe16(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_af6eddb47465a9e42186c47bae7040f0d}{plen}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05924}05924         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkts__vm__wr_a023063458f86ae771ae42f2363fd8b93}{npkt}} = \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05925}05925         wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkts__vm__wr_a8ebdcd0806b4055a7933c58c1f47d5bc}{r4}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05926}05926         memcpy(\&wr-\/>\mbox{\hyperlink{structfw__eth__tx__pkts__vm__wr_adca0401d0709f9655ca9ef0135e00e23}{ethmacdst}}[0], \&\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae037424a98685afdb2d78c6e1904cfc6}{ethmacdst}}[0], 16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05927}05927         flitp = wr + 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05928}05928 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05929}05929         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05930}05930 \textcolor{comment}{         * At this point we are 32B into a hardware descriptor.  Each mbuf in}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05931}05931 \textcolor{comment}{         * the WR will take 32B so we check for the end of the descriptor ring}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05932}05932 \textcolor{comment}{         * before writing odd mbufs (mb[1], 3, 5, ..)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05933}05933 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05934}05934         ndesc = \mbox{\hyperlink{adapter_8h_af673e74b6e44f09cd36eac31ed7e1904}{tx\_len16\_to\_desc}}(\mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a96353605b295cba53aa64e9d583daf1e}{len16}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05935}05935         last = NULL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05936}05936         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}}; i++) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05937}05937                 m = \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[i];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05938}05938                 \textcolor{keywordflow}{if} (i \& 1 \&\& (uintptr\_t)flitp == (uintptr\_t)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}])}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05939}05939                         flitp = \&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05940}05940                 cpl = flitp;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05941}05941 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05942}05942                 \textcolor{comment}{/* Checksum offload */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05943}05943                 ctrl1 = \mbox{\hyperlink{t4__sge_8c_abd1635fecd290bea91271166d26b1d38}{csum\_to\_ctrl}}(sc, m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05944}05944                 \textcolor{keywordflow}{if} (ctrl1 != (\mbox{\hyperlink{t4__msg_8h_aeb33f4a0d4672077c0385c8b1087fd55}{F\_TXPKT\_IPCSUM\_DIS}} | \mbox{\hyperlink{t4__msg_8h_a57a90ee1ce16cffa9fd1213b283b3b56}{F\_TXPKT\_L4CSUM\_DIS}}))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05945}05945                         txq-\/>\mbox{\hyperlink{structsge__txq_a54bd3e634577fd7b6a61c32c374ec59d}{txcsum}}++;    \textcolor{comment}{/* some hardware assistance provided */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05946}05946 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05947}05947                 \textcolor{comment}{/* VLAN tag insertion */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05948}05948                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a94a7316babc844729e5be67779bf1485}{needs\_vlan\_insertion}}(m)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05949}05949                         ctrl1 |= \mbox{\hyperlink{t4__msg_8h_a493d54d3ea80df168f3775568a84ad91}{F\_TXPKT\_VLAN\_VLD}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05950}05950                             \mbox{\hyperlink{t4__msg_8h_a710d87104b120676fef1f28e71c8f6dc}{V\_TXPKT\_VLAN}}(m-\/>m\_pkthdr.ether\_vtag);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05951}05951                         txq-\/>\mbox{\hyperlink{structsge__txq_a3166c7e9216131f72159bc4a34fffe7a}{vlan\_insertion}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05952}05952                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05953}05953 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05954}05954                 \textcolor{comment}{/* CPL header */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05955}05955                 cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_ad7ca5b3fec93f44fc575ae84d2337fc4}{ctrl0}} = txq-\/>\mbox{\hyperlink{structsge__txq_a5f790fc508f4155f68e18c513d5242b3}{cpl\_ctrl0}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05956}05956                 cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_a344b274ffb11b6b18e69136373bb5a3b}{pack}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05957}05957                 cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_a3a92307cc029c9f59ed4ec3c20420df6}{len}} = htobe16(m-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05958}05958                 cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_a3c879243195a6dc379671b07e8e5f825}{ctrl1}} = htobe64(ctrl1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05959}05959 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05960}05960                 flitp = cpl + 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05961}05961                 MPASS(\mbox{\hyperlink{t4__sge_8c_a620de1776baac1a496fbfda0f34d8b39}{mbuf\_nsegs}}(m) == 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05962}05962                 \mbox{\hyperlink{t4__sge_8c_ab66dd27e913633697554914689038fb4}{write\_gl\_to\_txd}}(txq, m, (caddr\_t *)(\&flitp), 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05963}05963 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05964}05964                 \textcolor{keywordflow}{if} (last != NULL)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05965}05965                         last-\/>m\_nextpkt = m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05966}05966                 last = m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05967}05967         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05968}05968 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05969}05969         txq-\/>\mbox{\hyperlink{structsge__txq_ab5ecd4454c9cc7b9cd822cc890f3b6af}{sgl\_wrs}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05970}05970         txq-\/>\mbox{\hyperlink{structsge__txq_adec9f38db3cf34576fead9fbd2454f63}{txpkts1\_pkts}} += \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_a9961f80c82ee7922cbc3b0ebbb3f5149}{npkt}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05971}05971         txq-\/>\mbox{\hyperlink{structsge__txq_aaede03cbd089c1a3baa7dd848d2f7c7c}{txpkts1\_wrs}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05972}05972 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05973}05973         txsd = \&txq-\/>\mbox{\hyperlink{structsge__txq_a9c8b88707107a1b08036b5fd4cbe2614}{sdesc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05974}05974         txsd-\/>\mbox{\hyperlink{structtx__sdesc_a209a2a7c23bb3d3792807741cc19b316}{m}} = \mbox{\hyperlink{adapter_8h_a3321a1ba4ac45339f175e2705102526c}{txp}}-\/>\mbox{\hyperlink{structtxpkts_ae544a5acc53ce9b27efb47012aee5a18}{mb}}[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05975}05975         txsd-\/>\mbox{\hyperlink{structtx__sdesc_a169a430f9af4ec540e5a30ca35ccbffe}{desc\_used}} = ndesc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05976}05976 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05977}05977         \textcolor{keywordflow}{return} (ndesc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05978}05978 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05979}05979 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05980}05980 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05981}05981 \textcolor{comment}{ * If the SGL ends on an address that is not 16 byte aligned, this function will}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05982}05982 \textcolor{comment}{ * add a 0 filled flit at the end.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05983}05983 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05984}05984 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05985}\mbox{\hyperlink{t4__sge_8c_ab66dd27e913633697554914689038fb4}{05985}} \mbox{\hyperlink{t4__sge_8c_ab66dd27e913633697554914689038fb4}{write\_gl\_to\_txd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq, \textcolor{keyword}{struct} mbuf *m, caddr\_t *to, \textcolor{keywordtype}{int} checkwrap)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05986}05986 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05987}05987         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_ae7ae404e7b40fddbb86a486c24227067}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05988}05988         \textcolor{keyword}{struct }sglist *\mbox{\hyperlink{adapter_8h_a29e1c73f1ac731c2846ecbe343b56b28}{gl}} = txq-\/>\mbox{\hyperlink{structsge__txq_af3e9321ce632099d57209f8c252deab0}{gl}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05989}05989         \textcolor{keyword}{struct }sglist\_seg *seg;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05990}05990         \mbox{\hyperlink{osdep_8h_a575a6be7a3f079739f00e4ac7d75c785}{\_\_be64}} *flitp, *wrap;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05991}05991         \textcolor{keyword}{struct }\mbox{\hyperlink{structulptx__sgl}{ulptx\_sgl}} *usgl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05992}05992         \textcolor{keywordtype}{int} i, nflits, nsegs;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05993}05993 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05994}05994         KASSERT(((uintptr\_t)(*to) \& 0xf) == 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05995}05995             (\textcolor{stringliteral}{"{}\%s: SGL must start at a 16 byte boundary: \%p"{}}, \_\_func\_\_, *to));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05996}05996         MPASS((uintptr\_t)(*to) >= (uintptr\_t)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[0]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05997}05997         MPASS((uintptr\_t)(*to) < (uintptr\_t)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05998}05998 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l05999}05999         \mbox{\hyperlink{t4__sge_8c_a9b33f2920382e5c3c1308a4e26203b04}{get\_pkt\_gl}}(m, \mbox{\hyperlink{adapter_8h_a29e1c73f1ac731c2846ecbe343b56b28}{gl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06000}06000         nsegs = \mbox{\hyperlink{adapter_8h_a29e1c73f1ac731c2846ecbe343b56b28}{gl}}-\/>sg\_nseg;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06001}06001         MPASS(nsegs > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06002}06002 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06003}06003         nflits = (3 * (nsegs -\/ 1)) / 2 + ((nsegs -\/ 1) \& 1) + 2;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06004}06004         flitp = (\mbox{\hyperlink{osdep_8h_a575a6be7a3f079739f00e4ac7d75c785}{\_\_be64}} *)(*to);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06005}06005         wrap = (\mbox{\hyperlink{osdep_8h_a575a6be7a3f079739f00e4ac7d75c785}{\_\_be64}} *)(\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06006}06006         seg = \&\mbox{\hyperlink{adapter_8h_a29e1c73f1ac731c2846ecbe343b56b28}{gl}}-\/>sg\_segs[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06007}06007         usgl = (\textcolor{keywordtype}{void} *)flitp;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06008}06008 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06009}06009         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06010}06010 \textcolor{comment}{         * We start at a 16 byte boundary somewhere inside the tx descriptor}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06011}06011 \textcolor{comment}{         * ring, so we're at least 16 bytes away from the status page.  There is}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06012}06012 \textcolor{comment}{         * no chance of a wrap around in the middle of usgl (which is 16 bytes).}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06013}06013 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06014}06014 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06015}06015         usgl-\/>\mbox{\hyperlink{structulptx__sgl_aa82b0d8beab5a9d388294911861cceb6}{cmd\_nsge}} = htobe32(\mbox{\hyperlink{t4__msg_8h_a8e732b552c603b4a2af575b5b74855bc}{V\_ULPTX\_CMD}}(\mbox{\hyperlink{t4__msg_8h_af3520ff6d43011872bab77edd27d4de3a1394a176dbd07d3545dbb21446c79699}{ULP\_TX\_SC\_DSGL}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06016}06016             \mbox{\hyperlink{t4__msg_8h_aaa6ddba32797974de4d63a6b1faab60e}{V\_ULPTX\_NSGE}}(nsegs));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06017}06017         usgl-\/>\mbox{\hyperlink{structulptx__sgl_a661ce1fc091107e1174fe470c7f272c1}{len0}} = htobe32(seg-\/>ss\_len);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06018}06018         usgl-\/>\mbox{\hyperlink{structulptx__sgl_adb5a2b005ebc88282f4c4fb1246258b5}{addr0}} = htobe64(seg-\/>ss\_paddr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06019}06019         seg++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06020}06020 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06021}06021         \textcolor{keywordflow}{if} (checkwrap == 0 || (uintptr\_t)(flitp + nflits) <= (uintptr\_t)wrap) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06022}06022 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06023}06023                 \textcolor{comment}{/* Won't wrap around at all */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06024}06024 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06025}06025                 \textcolor{keywordflow}{for} (i = 0; i < nsegs -\/ 1; i++, seg++) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06026}06026                         usgl-\/>\mbox{\hyperlink{structulptx__sgl_a0f7d647dae4107702dce67bc21b81294}{sge}}[i / 2].\mbox{\hyperlink{structulptx__sge__pair_a93d8d32da5663dd19a6fe64330796502}{len}}[i \& 1] = htobe32(seg-\/>ss\_len);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06027}06027                         usgl-\/>\mbox{\hyperlink{structulptx__sgl_a0f7d647dae4107702dce67bc21b81294}{sge}}[i / 2].\mbox{\hyperlink{structulptx__sge__pair_a81d80aebcdde2354c272cb0a37f63e84}{addr}}[i \& 1] = htobe64(seg-\/>ss\_paddr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06028}06028                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06029}06029                 \textcolor{keywordflow}{if} (i \& 1)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06030}06030                         usgl-\/>\mbox{\hyperlink{structulptx__sgl_a0f7d647dae4107702dce67bc21b81294}{sge}}[i / 2].\mbox{\hyperlink{structulptx__sge__pair_a93d8d32da5663dd19a6fe64330796502}{len}}[1] = htobe32(0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06031}06031                 flitp += nflits;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06032}06032         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06033}06033 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06034}06034                 \textcolor{comment}{/* Will wrap somewhere in the rest of the SGL */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06035}06035 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06036}06036                 \textcolor{comment}{/* 2 flits already written, write the rest flit by flit */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06037}06037                 flitp = (\textcolor{keywordtype}{void} *)(usgl + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06038}06038                 \textcolor{keywordflow}{for} (i = 0; i < nflits -\/ 2; i++) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06039}06039                         \textcolor{keywordflow}{if} (flitp == wrap)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06040}06040                                 flitp = (\textcolor{keywordtype}{void} *)\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06041}06041                         *flitp++ = \mbox{\hyperlink{t4__sge_8c_ae2d2a717842a015c9ce4fe843ec3d02d}{get\_flit}}(seg, nsegs -\/ 1, i);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06042}06042                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06043}06043         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06044}06044 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06045}06045         \textcolor{keywordflow}{if} (nflits \& 1) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06046}06046                 MPASS(((uintptr\_t)flitp) \& 0xf);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06047}06047                 *flitp++ = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06048}06048         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06049}06049 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06050}06050         MPASS((((uintptr\_t)flitp) \& 0xf) == 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06051}06051         \textcolor{keywordflow}{if} (\_\_predict\_false(flitp == wrap))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06052}06052                 *to = (\textcolor{keywordtype}{void} *)\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06053}06053         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06054}06054                 *to = (\textcolor{keywordtype}{void} *)flitp;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06055}06055 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06056}06056 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06057}06057 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06058}\mbox{\hyperlink{t4__sge_8c_aca5145708355fa01ae8c8eba424a8460}{06058}} \mbox{\hyperlink{t4__sge_8c_aca5145708355fa01ae8c8eba424a8460}{copy\_to\_txd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, caddr\_t from, caddr\_t *to, \textcolor{keywordtype}{int} len)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06059}06059 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06060}06060 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06061}06061         MPASS((uintptr\_t)(*to) >= (uintptr\_t)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[0]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06062}06062         MPASS((uintptr\_t)(*to) < (uintptr\_t)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06063}06063 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06064}06064         \textcolor{keywordflow}{if} (\_\_predict\_true((uintptr\_t)(*to) + len <=}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06065}06065             (uintptr\_t)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}])) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06066}06066                 bcopy(from, *to, len);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06067}06067                 (*to) += len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06068}06068         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06069}06069                 \textcolor{keywordtype}{int} portion = (uintptr\_t)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}] -\/ (uintptr\_t)(*to);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06070}06070 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06071}06071                 bcopy(from, *to, portion);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06072}06072                 from += portion;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06073}06073                 portion = len -\/ portion;        \textcolor{comment}{/* remaining */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06074}06074                 bcopy(from, (\textcolor{keywordtype}{void} *)\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}, portion);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06075}06075                 (*to) = (caddr\_t)\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}} + portion;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06076}06076         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06077}06077 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06078}06078 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06079}06079 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06080}\mbox{\hyperlink{t4__sge_8c_a891527ea34b168d58d83f44f750ecc92}{06080}} \mbox{\hyperlink{t4__sge_8c_a891527ea34b168d58d83f44f750ecc92}{ring\_eq\_db}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}, u\_int n)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06081}06081 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06082}06082         u\_int db;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06083}06083 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06084}06084         MPASS(n > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06085}06085 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06086}06086         db = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a1c224cb0ab97e3d6ecf105c1aba85ae3}{doorbells}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06087}06087         \textcolor{keywordflow}{if} (n > 1)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06088}06088                 clrbit(\&db, \mbox{\hyperlink{adapter_8h_ab04a0655cd1e3bcac5e8f48c18df1a57a7d8a965e0f78479fbb8a94ee96617749}{DOORBELL\_WCWR}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06089}06089         wmb();}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06090}06090 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06091}06091         \textcolor{keywordflow}{switch} (ffs(db) -\/ 1) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06092}06092         \textcolor{keywordflow}{case} \mbox{\hyperlink{adapter_8h_ab04a0655cd1e3bcac5e8f48c18df1a57a7309f8ad518570ec666a104df10f9880}{DOORBELL\_UDB}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06093}06093                 *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2a66af7471b86d01eb7edc36887d88aa}{udb}} = htole32(\mbox{\hyperlink{t4__regs_8h_ac26a15f515f89befafcb4e2afa88cee8}{V\_QID}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab81f961dcdab3fd7f30f261f0dbbead8}{udb\_qid}}) | \mbox{\hyperlink{t4__regs_8h_a3d5ada69e3663f91ba04f906b3a82de3}{V\_PIDX}}(n));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06094}06094                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06095}06095 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06096}06096         \textcolor{keywordflow}{case} \mbox{\hyperlink{adapter_8h_ab04a0655cd1e3bcac5e8f48c18df1a57a7d8a965e0f78479fbb8a94ee96617749}{DOORBELL\_WCWR}}: \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06097}06097                 \textcolor{keyword}{volatile} uint64\_t *dst, *src;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06098}06098                 \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06099}06099 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06100}06100                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06101}06101 \textcolor{comment}{                 * Queues whose 128B doorbell segment fits in the page do not}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06102}06102 \textcolor{comment}{                 * use relative qid (udb\_qid is always 0).  Only queues with}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06103}06103 \textcolor{comment}{                 * doorbell segments can do WCWR.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06104}06104 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06105}06105                 KASSERT(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab81f961dcdab3fd7f30f261f0dbbead8}{udb\_qid}} == 0 \&\& n == 1,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06106}06106                     (\textcolor{stringliteral}{"{}\%s: inappropriate doorbell (0x\%x, \%d, \%d) for eq \%p"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06107}06107                     \_\_func\_\_, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a1c224cb0ab97e3d6ecf105c1aba85ae3}{doorbells}}, n, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9e8218a79e217563b6ca22792f028b37}{dbidx}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06108}06108 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06109}06109                 dst = (\textcolor{keyword}{volatile} \textcolor{keywordtype}{void} *)((uintptr\_t)\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2a66af7471b86d01eb7edc36887d88aa}{udb}} + \mbox{\hyperlink{t4__hw_8h_a39fca1837c5ce7715cbf571669660c13aba7ff9f5717006831452484d003ad5cd}{UDBS\_WR\_OFFSET}} -\/}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06110}06110                     \mbox{\hyperlink{t4__hw_8h_a39fca1837c5ce7715cbf571669660c13a8ccfd743bab492083a93da4d65c6babb}{UDBS\_DB\_OFFSET}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06111}06111                 i = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9e8218a79e217563b6ca22792f028b37}{dbidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06112}06112                 src = (\textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[i];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06113}06113                 while (src != (\textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[i + 1])}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06114}06114                         *dst++ = *src++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06115}06115                 wmb();}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06116}06116                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06117}06117         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06118}06118 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06119}06119         \textcolor{keywordflow}{case} \mbox{\hyperlink{adapter_8h_ab04a0655cd1e3bcac5e8f48c18df1a57a699db0c591ec10a9ffc9dbe5a48d02e2}{DOORBELL\_UDBWC}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06120}06120                 *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2a66af7471b86d01eb7edc36887d88aa}{udb}} = htole32(\mbox{\hyperlink{t4__regs_8h_ac26a15f515f89befafcb4e2afa88cee8}{V\_QID}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab81f961dcdab3fd7f30f261f0dbbead8}{udb\_qid}}) | \mbox{\hyperlink{t4__regs_8h_a3d5ada69e3663f91ba04f906b3a82de3}{V\_PIDX}}(n));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06121}06121                 wmb();}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06122}06122                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06123}06123 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06124}06124         \textcolor{keywordflow}{case} \mbox{\hyperlink{adapter_8h_ab04a0655cd1e3bcac5e8f48c18df1a57a4e65dd57ffade87c874a53a4e7551294}{DOORBELL\_KDB}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06125}06125                 \mbox{\hyperlink{adapter_8h_a5853e298022d2e49f591a81b85424532}{t4\_write\_reg}}(sc, sc-\/>\mbox{\hyperlink{structadapter_af7128974a6c2b1050ae5eace94a887e9}{sge\_kdoorbell\_reg}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06126}06126                     \mbox{\hyperlink{t4__regs_8h_ac26a15f515f89befafcb4e2afa88cee8}{V\_QID}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a5603f20241fd4fdfa43daafdcab72e9c}{cntxt\_id}}) | \mbox{\hyperlink{t4__regs_8h_a3d5ada69e3663f91ba04f906b3a82de3}{V\_PIDX}}(n));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06127}06127                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06128}06128         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06129}06129 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06130}06130         \mbox{\hyperlink{adapter_8h_aae3f128a52e3e78cf595539bb66425c7}{IDXINCR}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9e8218a79e217563b6ca22792f028b37}{dbidx}}, n, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06131}06131 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06132}06132 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06133}06133 \textcolor{keyword}{static} \textcolor{keyword}{inline} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06134}\mbox{\hyperlink{t4__sge_8c_a8343b84048ada723d32e1b732c03bd7f}{06134}} \mbox{\hyperlink{t4__sge_8c_a8343b84048ada723d32e1b732c03bd7f}{reclaimable\_tx\_desc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06135}06135 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06136}06136         uint16\_t hw\_cidx;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06137}06137 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06138}06138         hw\_cidx = \mbox{\hyperlink{t4__sge_8c_a573829292f5c253acee129251749445e}{read\_hw\_cidx}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06139}06139         \textcolor{keywordflow}{return} (\mbox{\hyperlink{adapter_8h_a5b0f572f7c8db6dac00cfd7f50b8bd43}{IDXDIFF}}(hw\_cidx, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06140}06140 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06141}06141 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06142}06142 \textcolor{keyword}{static} \textcolor{keyword}{inline} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06143}\mbox{\hyperlink{t4__sge_8c_a93ac7052a1ab492658aa3144aa388a7d}{06143}} \mbox{\hyperlink{t4__sge_8c_a93ac7052a1ab492658aa3144aa388a7d}{total\_available\_tx\_desc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06144}06144 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06145}06145         uint16\_t hw\_cidx, \mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06146}06146 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06147}06147         hw\_cidx = \mbox{\hyperlink{t4__sge_8c_a573829292f5c253acee129251749445e}{read\_hw\_cidx}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06148}06148         \mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}} = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06149}06149 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06150}06150         \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}} == hw\_cidx)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06151}06151                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06152}06152         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06153}06153                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{adapter_8h_a5b0f572f7c8db6dac00cfd7f50b8bd43}{IDXDIFF}}(hw\_cidx, \mbox{\hyperlink{adapter_8h_a44e852fc32ea0b8c1acee1af25587f26}{pidx}}, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}) -\/ 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06154}06154 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06155}06155 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06156}06156 \textcolor{keyword}{static} \textcolor{keyword}{inline} uint16\_t}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06157}\mbox{\hyperlink{t4__sge_8c_a573829292f5c253acee129251749445e}{06157}} \mbox{\hyperlink{t4__sge_8c_a573829292f5c253acee129251749445e}{read\_hw\_cidx}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06158}06158 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06159}06159         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__qstat}{sge\_qstat}} *spg = (\textcolor{keywordtype}{void} *)\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ab973d7cba59899542fb8ad1230cae8b9}{desc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06160}06160         uint16\_t \mbox{\hyperlink{adapter_8h_a3c88dd30dd9b547a4c35f3e1c593f6ec}{cidx}} = spg-\/>\mbox{\hyperlink{structsge__qstat_ad24f611f72f29c34c1c5ae3f1d76ece6}{cidx}};      \textcolor{comment}{/* stable snapshot */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06161}06161 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06162}06162         return (be16toh(\mbox{\hyperlink{adapter_8h_a3c88dd30dd9b547a4c35f3e1c593f6ec}{cidx}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06163}06163 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06164}06164 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06165}06165 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06166}06166 \textcolor{comment}{ * Reclaim 'n' descriptors approximately.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06167}06167 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06168}06168 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06169}\mbox{\hyperlink{t4__sge_8c_a1986cd7e43663cda49915b423e8465b9}{06169}} \mbox{\hyperlink{t4__sge_8c_a1986cd7e43663cda49915b423e8465b9}{reclaim\_tx\_descs}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq, u\_int n)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06170}06170 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06171}06171         \textcolor{keyword}{struct }\mbox{\hyperlink{structtx__sdesc}{tx\_sdesc}} *txsd;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06172}06172         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_ae7ae404e7b40fddbb86a486c24227067}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06173}06173         u\_int can\_reclaim, reclaimed;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06174}06174 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06175}06175         \mbox{\hyperlink{adapter_8h_a744901428e6bd5d05414d661903c74b4}{TXQ\_LOCK\_ASSERT\_OWNED}}(txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06176}06176         MPASS(n > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06177}06177 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06178}06178         reclaimed = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06179}06179         can\_reclaim = \mbox{\hyperlink{t4__sge_8c_a8343b84048ada723d32e1b732c03bd7f}{reclaimable\_tx\_desc}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06180}06180         \textcolor{keywordflow}{while} (can\_reclaim \&\& reclaimed < n) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06181}06181                 \textcolor{keywordtype}{int} ndesc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06182}06182                 \textcolor{keyword}{struct }mbuf *m, *nextpkt;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06183}06183 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06184}06184                 txsd = \&txq-\/>\mbox{\hyperlink{structsge__txq_a9c8b88707107a1b08036b5fd4cbe2614}{sdesc}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06185}06185                 ndesc = txsd-\/>\mbox{\hyperlink{structtx__sdesc_a169a430f9af4ec540e5a30ca35ccbffe}{desc\_used}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06186}06186 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06187}06187                 \textcolor{comment}{/* Firmware doesn't return "{}partial"{} credits. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06188}06188                 KASSERT(can\_reclaim >= ndesc,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06189}06189                     (\textcolor{stringliteral}{"{}\%s: unexpected number of credits: \%d, \%d"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06190}06190                     \_\_func\_\_, can\_reclaim, ndesc));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06191}06191                 KASSERT(ndesc != 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06192}06192                     (\textcolor{stringliteral}{"{}\%s: descriptor with no credits: cidx \%d"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06193}06193                     \_\_func\_\_, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06194}06194 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06195}06195                 \textcolor{keywordflow}{for} (m = txsd-\/>\mbox{\hyperlink{structtx__sdesc_a209a2a7c23bb3d3792807741cc19b316}{m}}; m != NULL; m = nextpkt) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06196}06196                         nextpkt = m-\/>m\_nextpkt;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06197}06197                         m-\/>m\_nextpkt = NULL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06198}06198                         m\_freem(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06199}06199                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06200}06200                 reclaimed += ndesc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06201}06201                 can\_reclaim -\/= ndesc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06202}06202                 \mbox{\hyperlink{adapter_8h_aae3f128a52e3e78cf595539bb66425c7}{IDXINCR}}(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}}, ndesc, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a026c33ab61f5952baa787e0763c98923}{sidx}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06203}06203         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06204}06204 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06205}06205         \textcolor{keywordflow}{return} (reclaimed);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06206}06206 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06207}06207 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06208}06208 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06209}\mbox{\hyperlink{t4__sge_8c_a68f484f6b46eb063ab438fb0dca3a957}{06209}} \mbox{\hyperlink{t4__sge_8c_a68f484f6b46eb063ab438fb0dca3a957}{tx\_reclaim}}(\textcolor{keywordtype}{void} *arg, \textcolor{keywordtype}{int} n)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06210}06210 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06211}06211         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq = arg;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06212}06212         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = \&txq-\/>\mbox{\hyperlink{structsge__txq_ae7ae404e7b40fddbb86a486c24227067}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06213}06213 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06214}06214         \textcolor{keywordflow}{do} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06215}06215                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a39e044aee3521a2fd35507f7c82175b0}{TXQ\_TRYLOCK}}(txq) == 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06216}06216                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06217}06217                 n = \mbox{\hyperlink{t4__sge_8c_a1986cd7e43663cda49915b423e8465b9}{reclaim\_tx\_descs}}(txq, 32);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06218}06218                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_ae24aeaf3a136a398ad4e1a01fcd35b62}{cidx}} == \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06219}06219                         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a7bbfe5916fa5ba0e6fd0dcc0f027846d}{equeqidx}} = \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a9c937cd9964b0e8e87eeba9488d0532f}{pidx}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06220}06220                 \mbox{\hyperlink{adapter_8h_ac036a168fd973bada0a9c5c740075351}{TXQ\_UNLOCK}}(txq);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06221}06221         \} \textcolor{keywordflow}{while} (n > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06222}06222 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06223}06223 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06224}06224 \textcolor{keyword}{static} \mbox{\hyperlink{osdep_8h_a575a6be7a3f079739f00e4ac7d75c785}{\_\_be64}}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06225}\mbox{\hyperlink{t4__sge_8c_ae2d2a717842a015c9ce4fe843ec3d02d}{06225}} \mbox{\hyperlink{t4__sge_8c_ae2d2a717842a015c9ce4fe843ec3d02d}{get\_flit}}(\textcolor{keyword}{struct} sglist\_seg *segs, \textcolor{keywordtype}{int} nsegs, \textcolor{keywordtype}{int} idx)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06226}06226 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06227}06227         \textcolor{keywordtype}{int} i = (idx / 3) * 2;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06228}06228 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06229}06229         \textcolor{keywordflow}{switch} (idx \% 3) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06230}06230         \textcolor{keywordflow}{case} 0: \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06231}06231                 uint64\_t rc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06232}06232 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06233}06233                 rc = (uint64\_t)segs[i].\mbox{\hyperlink{adapter_8h_a85068f8f79a0c0162bf2f39ae67a9b64}{ss\_len}} << 32;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06234}06234                 \textcolor{keywordflow}{if} (i + 1 < nsegs)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06235}06235                         rc |= (uint64\_t)(segs[i + 1].\mbox{\hyperlink{adapter_8h_a85068f8f79a0c0162bf2f39ae67a9b64}{ss\_len}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06236}06236 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06237}06237                 \textcolor{keywordflow}{return} (htobe64(rc));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06238}06238         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06239}06239         \textcolor{keywordflow}{case} 1:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06240}06240                 \textcolor{keywordflow}{return} (htobe64(segs[i].ss\_paddr));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06241}06241         \textcolor{keywordflow}{case} 2:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06242}06242                 \textcolor{keywordflow}{return} (htobe64(segs[i + 1].ss\_paddr));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06243}06243         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06244}06244 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06245}06245         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06246}06246 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06247}06247 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06248}06248 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06249}\mbox{\hyperlink{t4__sge_8c_ad6dd0b621aa9adaa3937ac3a13d030b5}{06249}} \mbox{\hyperlink{t4__sge_8c_ad6dd0b621aa9adaa3937ac3a13d030b5}{find\_refill\_source}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keywordtype}{int} maxp, \textcolor{keywordtype}{bool} packing)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06250}06250 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06251}06251         \textcolor{keywordtype}{int} i, zidx = -\/1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06252}06252         \textcolor{keyword}{struct }\mbox{\hyperlink{structrx__buf__info}{rx\_buf\_info}} *rxb = \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a1d0a3ea264db143053eab8e647b3d3fc}{rx\_buf\_info}}[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06253}06253 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06254}06254         \textcolor{keywordflow}{if} (packing) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06255}06255                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba3c96c0b2a920c024f7910a76f485ab99}{SW\_ZONE\_SIZES}}; i++, rxb++) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06256}06256                         \textcolor{keywordflow}{if} (rxb-\/>\mbox{\hyperlink{structrx__buf__info_a3ea12113c04fb9272c95dd0c9459f1a7}{hwidx2}} == -\/1)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06257}06257                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06258}06258                         \textcolor{keywordflow}{if} (rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}} < PAGE\_SIZE \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06259}06259                             rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}} < \mbox{\hyperlink{t4__sge_8c_afc662bb0583ce4a9ef1867e1e9502fed}{largest\_rx\_cluster}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06260}06260                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06261}06261                         \textcolor{keywordflow}{if} (rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}} > \mbox{\hyperlink{t4__sge_8c_afc662bb0583ce4a9ef1867e1e9502fed}{largest\_rx\_cluster}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06262}06262                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06263}06263                         MPASS(rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}} -\/ rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}} >= \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba29701844ec9189e5881c254e6ee546ce}{CL\_METADATA\_SIZE}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06264}06264                         \textcolor{keywordflow}{if} (rxb-\/>\mbox{\hyperlink{structrx__buf__info_ad08fddcb8d2eba3a17600eaaf4ad612f}{size2}} >= maxp)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06265}06265                                 \textcolor{keywordflow}{return} (i);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06266}06266                         zidx = i;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06267}06267                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06268}06268         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06269}06269                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba3c96c0b2a920c024f7910a76f485ab99}{SW\_ZONE\_SIZES}}; i++, rxb++) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06270}06270                         \textcolor{keywordflow}{if} (rxb-\/>\mbox{\hyperlink{structrx__buf__info_aba1b3a28021975079ea300ef9a65f4fd}{hwidx1}} == -\/1)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06271}06271                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06272}06272                         \textcolor{keywordflow}{if} (rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}} > \mbox{\hyperlink{t4__sge_8c_afc662bb0583ce4a9ef1867e1e9502fed}{largest\_rx\_cluster}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06273}06273                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06274}06274                         \textcolor{keywordflow}{if} (rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}} >= maxp)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06275}06275                                 \textcolor{keywordflow}{return} (i);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06276}06276                         zidx = i;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06277}06277                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06278}06278         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06279}06279 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06280}06280         \textcolor{keywordflow}{return} (zidx);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06281}06281 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06282}06282 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06283}06283 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06284}\mbox{\hyperlink{t4__sge_8c_a0280e71f22d29f8ea1ee29159418d3d9}{06284}} \mbox{\hyperlink{t4__sge_8c_a0280e71f22d29f8ea1ee29159418d3d9}{add\_fl\_to\_sfl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__fl}{sge\_fl}} *\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06285}06285 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06286}06286         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structadapter_abebcb402e73536fb67f8f78e0ea3eeae}{sfl\_lock}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06287}06287         \mbox{\hyperlink{adapter_8h_a41c2edc639f8438bba380b1698ecb12e}{FL\_LOCK}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06288}06288         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} \& \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035da13829ebcbbac07550c2f742de05a3b3d}{FL\_DOOMED}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06289}06289                 \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}-\/>\mbox{\hyperlink{structsge__fl_a58ddd68ab04056db2c5caf65450cf19d}{flags}} |= \mbox{\hyperlink{adapter_8h_abc5c98fcc1211af2b80116dd6e0a035da7823ff29cad0529311de1036bf98e6d7}{FL\_STARVING}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06290}06290                 TAILQ\_INSERT\_TAIL(\&sc-\/>sfl, \mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}}, link);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06291}06291                 callout\_reset(\&sc-\/>\mbox{\hyperlink{structadapter_adfe58d58a118b46d70d4ee875875a2e0}{sfl\_callout}}, hz / 5, \mbox{\hyperlink{t4__sge_8c_a8173780e40a7fbd712d976102611cf11}{refill\_sfl}}, sc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06292}06292         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06293}06293         \mbox{\hyperlink{adapter_8h_a63ce7ce2eb7ddaa4178b03391b6178a5}{FL\_UNLOCK}}(\mbox{\hyperlink{adapter_8h_a0cc4e8d39c89cdd317175a4f3f93094d}{fl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06294}06294         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structadapter_abebcb402e73536fb67f8f78e0ea3eeae}{sfl\_lock}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06295}06295 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06296}06296 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06297}06297 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06298}\mbox{\hyperlink{t4__sge_8c_a2252cb07c0ac5c1724bb7ac6f785af1a}{06298}} \mbox{\hyperlink{t4__sge_8c_a2252cb07c0ac5c1724bb7ac6f785af1a}{handle\_wrq\_egr\_update}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06299}06299 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06300}06300         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__wrq}{sge\_wrq}} *\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}} = (\textcolor{keywordtype}{void} *)\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06301}06301 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06302}06302         atomic\_readandclear\_int(\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2819002c551a9ffe75310581c86e03f7}{equiq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06303}06303         taskqueue\_enqueue(sc-\/>\mbox{\hyperlink{structadapter_ae83964bd27367981a2c2f4bd274d4e2c}{tq}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a214dbfee0f0274229b4a684e2cce42c6}{tx\_chan}}], \&\mbox{\hyperlink{adapter_8h_a2f2779b9d2ef9e13751977f23e0ae18e}{wrq}}-\/>\mbox{\hyperlink{structsge__wrq_a861382e83430251859a803fcd8e49ea2}{wrq\_tx\_task}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06304}06304 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06305}06305 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06306}06306 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06307}\mbox{\hyperlink{t4__sge_8c_aff59676e3659599b16118415c1e8f7c8}{06307}} \mbox{\hyperlink{t4__sge_8c_aff59676e3659599b16118415c1e8f7c8}{handle\_eth\_egr\_update}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06308}06308 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06309}06309         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__txq}{sge\_txq}} *txq = (\textcolor{keywordtype}{void} *)\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06310}06310 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06311}06311         MPASS(\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_aad96c6b0170c6d4e6bb404ef9c9a490b}{type}} == \mbox{\hyperlink{adapter_8h_abed82baf7f470b522273a3e37c24c600a48b7bb8e67d0821313836e3035a0e454}{EQ\_ETH}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06312}06312 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06313}06313         atomic\_readandclear\_int(\&\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a2819002c551a9ffe75310581c86e03f7}{equiq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06314}06314         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__mp__ring_8c_a50abbbd482ac28baf5a7ac30897d5016}{mp\_ring\_is\_idle}}(txq-\/>\mbox{\hyperlink{structsge__txq_a09100c100c608e090b08865bb71d4f0c}{r}}))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06315}06315                 taskqueue\_enqueue(sc-\/>\mbox{\hyperlink{structadapter_ae83964bd27367981a2c2f4bd274d4e2c}{tq}}[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_a214dbfee0f0274229b4a684e2cce42c6}{tx\_chan}}], \&txq-\/>\mbox{\hyperlink{structsge__txq_a929395c6f55d1b76de97e1db712b13e0}{tx\_reclaim\_task}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06316}06316         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06317}06317                 \mbox{\hyperlink{t4__mp__ring_8c_a4b8eb30eff619c51dab36a2d76001f07}{mp\_ring\_check\_drainage}}(txq-\/>\mbox{\hyperlink{structsge__txq_a09100c100c608e090b08865bb71d4f0c}{r}}, 64);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06318}06318 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06319}06319 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06320}06320 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06321}\mbox{\hyperlink{t4__sge_8c_a1e6d94bd37b22818990e88e272280854}{06321}} \mbox{\hyperlink{t4__sge_8c_a1e6d94bd37b22818990e88e272280854}{handle\_sge\_egr\_update}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structrss__header}{rss\_header}} *rss,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06322}06322     \textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06323}06323 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06324}06324         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__sge__egr__update}{cpl\_sge\_egr\_update}} *cpl = (\textcolor{keyword}{const} \textcolor{keywordtype}{void} *)(rss + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06325}06325         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} qid = \mbox{\hyperlink{t4__msg_8h_a4ca48e11a7a5d5b50e35fbf089f5ba35}{G\_EGR\_QID}}(ntohl(cpl-\/>\mbox{\hyperlink{structcpl__sge__egr__update_ac92d0a2e63b9a349e54a2050935d0642}{opcode\_qid}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06326}06326         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a62e77da9c2ffc57fc1cc462a785f6fce}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06327}06327         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge}{sge}} *s = \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06328}06328         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06329}06329         \textcolor{keyword}{static} void (*h[])(\textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *, \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__eq}{sge\_eq}} *) = \{NULL,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06330}06330                 \&\mbox{\hyperlink{t4__sge_8c_a2252cb07c0ac5c1724bb7ac6f785af1a}{handle\_wrq\_egr\_update}}, \&\mbox{\hyperlink{t4__sge_8c_aff59676e3659599b16118415c1e8f7c8}{handle\_eth\_egr\_update}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06331}06331                 \&\mbox{\hyperlink{t4__sge_8c_a2252cb07c0ac5c1724bb7ac6f785af1a}{handle\_wrq\_egr\_update}}\};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06332}06332 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06333}06333         KASSERT(m == NULL, (\textcolor{stringliteral}{"{}\%s: payload with opcode \%02x"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06334}06334             rss-\/>\mbox{\hyperlink{structrss__header_ab18a0a11ee567f3fba4674b7d39044fb}{opcode}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06335}06335 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06336}06336         \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}} = s-\/>\mbox{\hyperlink{structsge_ad70dbaca4e6a555317d186f7db9692ee}{eqmap}}[qid -\/ s-\/>\mbox{\hyperlink{structsge_a94c8ca3b0e31f396ecef496df682f245}{eq\_start}} -\/ s-\/>\mbox{\hyperlink{structsge_ab9537e217b789a05d3917df9430cd66f}{eq\_base}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06337}06337         (*h[\mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}}-\/>\mbox{\hyperlink{structsge__eq_aad96c6b0170c6d4e6bb404ef9c9a490b}{type}}])(sc, \mbox{\hyperlink{adapter_8h_a27d13455c17ae42e0f4efcc4e345d1ea}{eq}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06338}06338 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06339}06339         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06340}06340 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06341}06341 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06342}06342 \textcolor{comment}{/* handle\_fw\_msg works for both fw4\_msg and fw6\_msg because this is valid */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06343}\mbox{\hyperlink{t4__sge_8c_aab7426cf82e1090cfbf7bc21f18c1ed5}{06343}} \mbox{\hyperlink{t4__sge_8c_aab7426cf82e1090cfbf7bc21f18c1ed5}{CTASSERT}}(offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structcpl__fw4__msg}{cpl\_fw4\_msg}}, data) == \(\backslash\)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06344}06344     offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structcpl__fw6__msg}{cpl\_fw6\_msg}}, data));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06345}06345 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06346}06346 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06347}\mbox{\hyperlink{t4__sge_8c_a4fa5fa565b4134cca45dc8d9efaccaa8}{06347}} \mbox{\hyperlink{t4__sge_8c_a4fa5fa565b4134cca45dc8d9efaccaa8}{handle\_fw\_msg}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structrss__header}{rss\_header}} *rss, \textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06348}06348 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06349}06349         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a62e77da9c2ffc57fc1cc462a785f6fce}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06350}06350         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__fw6__msg}{cpl\_fw6\_msg}} *cpl = (\textcolor{keyword}{const} \textcolor{keywordtype}{void} *)(rss + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06351}06351 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06352}06352         KASSERT(m == NULL, (\textcolor{stringliteral}{"{}\%s: payload with opcode \%02x"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06353}06353             rss-\/>\mbox{\hyperlink{structrss__header_ab18a0a11ee567f3fba4674b7d39044fb}{opcode}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06354}06354 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06355}06355         \textcolor{keywordflow}{if} (cpl-\/>\mbox{\hyperlink{structcpl__fw6__msg_a47a56a65b761b66db26606b137a3216d}{type}} == \mbox{\hyperlink{t4__msg_8h_ac205be2172292384dd687b5471a87edda5179858e792eac7068fe2172d3b881c7}{FW\_TYPE\_RSSCPL}} || cpl-\/>\mbox{\hyperlink{structcpl__fw6__msg_a47a56a65b761b66db26606b137a3216d}{type}} == \mbox{\hyperlink{t4__msg_8h_a1fb9092bcdeada2d206bdc74afbbe122ab5e3ee5463eb1f6cd469f53a8b24968e}{FW6\_TYPE\_RSSCPL}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06356}06356                 \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structrss__header}{rss\_header}} *rss2;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06357}06357 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06358}06358                 rss2 = (\textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structrss__header}{rss\_header}} *)\&cpl-\/>\mbox{\hyperlink{structcpl__fw6__msg_a10b8d686a3f01e20289c94689a2b5d11}{data}}[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06359}06359                 return (\mbox{\hyperlink{t4__sge_8c_a7f46019356e6a0919425bc5ac2b32926}{t4\_cpl\_handler}}[rss2-\/>\mbox{\hyperlink{structrss__header_ab18a0a11ee567f3fba4674b7d39044fb}{opcode}}](\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, rss2, m));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06360}06360         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06361}06361 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06362}06362         \textcolor{keywordflow}{return} (\mbox{\hyperlink{t4__sge_8c_abfacfa449879900077ea9b8c839bc3a6}{t4\_fw\_msg\_handler}}[cpl-\/>\mbox{\hyperlink{structcpl__fw6__msg_a47a56a65b761b66db26606b137a3216d}{type}}](sc, \&cpl-\/>\mbox{\hyperlink{structcpl__fw6__msg_a10b8d686a3f01e20289c94689a2b5d11}{data}}[0]));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06363}06363 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06364}06364 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06370}06370 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06371}\mbox{\hyperlink{t4__sge_8c_aa4064d841308edcdf269547cc64342b4}{06371}} \mbox{\hyperlink{t4__sge_8c_aa4064d841308edcdf269547cc64342b4}{t4\_handle\_wrerr\_rpl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *adap, \textcolor{keyword}{const} \mbox{\hyperlink{osdep_8h_a575a6be7a3f079739f00e4ac7d75c785}{\_\_be64}} *rpl)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06372}06372 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06373}06373         \mbox{\hyperlink{osdep_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} \mbox{\hyperlink{structrss__header_ab18a0a11ee567f3fba4674b7d39044fb}{opcode}} = *(\textcolor{keyword}{const} \mbox{\hyperlink{osdep_8h_a92c50087ca0e64fa93fc59402c55f8ca}{u8}} *)rpl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06374}06374         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structfw__error__cmd}{fw\_error\_cmd}} *e = (\textcolor{keyword}{const} \textcolor{keywordtype}{void} *)rpl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06375}06375         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06376}06376 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06377}06377         \textcolor{keywordflow}{if} (opcode != \mbox{\hyperlink{t4fw__interface_8h_a4f2b99c2e426902c1d83fded4f1ba4a8aa2a8cdbeea273356f6c0f5343e57444a}{FW\_ERROR\_CMD}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06378}06378                 log(LOG\_ERR,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06379}06379                     \textcolor{stringliteral}{"{}\%s: Received WRERR\_RPL message with opcode \%\#x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06380}06380                     device\_get\_nameunit(adap-\/>\mbox{\hyperlink{structadapter_aea408064601574166a737fafae5cd4a3}{dev}}), opcode);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06381}06381                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06382}06382         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06383}06383         log(LOG\_ERR, \textcolor{stringliteral}{"{}\%s: FW\_ERROR (\%s) "{}}, device\_get\_nameunit(adap-\/>\mbox{\hyperlink{structadapter_aea408064601574166a737fafae5cd4a3}{dev}}),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06384}06384             \mbox{\hyperlink{t4fw__interface_8h_a2b96ce7e6f806829c98ed9245a3e633b}{G\_FW\_ERROR\_CMD\_FATAL}}(be32toh(e-\/>\mbox{\hyperlink{structfw__error__cmd_a605e04473bacfffd9aa515c73d5a0909}{op\_to\_type}})) ? \textcolor{stringliteral}{"{}fatal"{}} :}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06385}06385             \textcolor{stringliteral}{"{}non-\/fatal"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06386}06386         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{t4fw__interface_8h_a6d38e9ec4085413de60e079fc05c99d9}{G\_FW\_ERROR\_CMD\_TYPE}}(be32toh(e-\/>\mbox{\hyperlink{structfw__error__cmd_a605e04473bacfffd9aa515c73d5a0909}{op\_to\_type}}))) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06387}06387         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4fw__interface_8h_a6ab76d9626b4560475a0da0142cf3675ad96466296a10e12e941f242bf87f91c7}{FW\_ERROR\_TYPE\_EXCEPTION}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06388}06388                 log(LOG\_ERR, \textcolor{stringliteral}{"{}exception info:\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06389}06389                 \textcolor{keywordflow}{for} (i = 0; i < nitems(e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_a0d817b435f0a5f04f27f205cc7f99bd5}{exception}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__exception_a106e3047afb44e9b18c32f957fd6f1cb}{info}}); i++)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06390}06390                         log(LOG\_ERR, \textcolor{stringliteral}{"{}\%s\%08x"{}}, i == 0 ? \textcolor{stringliteral}{"{}\(\backslash\)t"{}} : \textcolor{stringliteral}{"{} "{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06391}06391                             be32toh(e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_a0d817b435f0a5f04f27f205cc7f99bd5}{exception}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__exception_a106e3047afb44e9b18c32f957fd6f1cb}{info}}[i]));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06392}06392                 log(LOG\_ERR, \textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06393}06393                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06394}06394         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4fw__interface_8h_a6ab76d9626b4560475a0da0142cf3675a0d85e882aa5ca64a1c6f27dd83a10e9a}{FW\_ERROR\_TYPE\_HWMODULE}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06395}06395                 log(LOG\_ERR, \textcolor{stringliteral}{"{}HW module regaddr \%08x regval \%08x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06396}06396                     be32toh(e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_a8ad1357d90f302e7b7288d9e0521be32}{hwmodule}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__hwmodule_aad5e144e4da2584c160e0846dbabbeb0}{regaddr}}),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06397}06397                     be32toh(e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_a8ad1357d90f302e7b7288d9e0521be32}{hwmodule}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__hwmodule_a175bbd2f342c3b0a407e2a1526634692}{regval}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06398}06398                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06399}06399         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4fw__interface_8h_a6ab76d9626b4560475a0da0142cf3675a950d79db82dd92ab52d9d4a6c80dea8f}{FW\_ERROR\_TYPE\_WR}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06400}06400                 log(LOG\_ERR, \textcolor{stringliteral}{"{}WR cidx \%d PF \%d VF \%d eqid \%d hdr:\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06401}06401                     be16toh(e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_a7af65fd1fda12d777f68e23e5cd58539}{wr}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__wr_a47bbd6759aa5b3e15fd0a7157df3f733}{cidx}}),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06402}06402                     \mbox{\hyperlink{t4fw__interface_8h_a736a47f861f1540a8f29451c0a9f4de5}{G\_FW\_ERROR\_CMD\_PFN}}(be16toh(e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_a7af65fd1fda12d777f68e23e5cd58539}{wr}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__wr_a473674d0b8272aebf58dfd2508d6a4b9}{pfn\_vfn}})),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06403}06403                     \mbox{\hyperlink{t4fw__interface_8h_a7accecefa4fa5dd24b2d1f9ae92c2066}{G\_FW\_ERROR\_CMD\_VFN}}(be16toh(e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_a7af65fd1fda12d777f68e23e5cd58539}{wr}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__wr_a473674d0b8272aebf58dfd2508d6a4b9}{pfn\_vfn}})),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06404}06404                     be32toh(e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_a7af65fd1fda12d777f68e23e5cd58539}{wr}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__wr_a8c9224211efc6280f3d963b0579cfdb2}{eqid}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06405}06405                 \textcolor{keywordflow}{for} (i = 0; i < nitems(e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_a7af65fd1fda12d777f68e23e5cd58539}{wr}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__wr_a32810bc26f4792b9c7d27207e8ddb2fb}{wrhdr}}); i++)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06406}06406                         log(LOG\_ERR, \textcolor{stringliteral}{"{}\%s\%02x"{}}, i == 0 ? \textcolor{stringliteral}{"{}\(\backslash\)t"{}} : \textcolor{stringliteral}{"{} "{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06407}06407                             e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_a7af65fd1fda12d777f68e23e5cd58539}{wr}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__wr_a32810bc26f4792b9c7d27207e8ddb2fb}{wrhdr}}[i]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06408}06408                 log(LOG\_ERR, \textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06409}06409                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06410}06410         \textcolor{keywordflow}{case} \mbox{\hyperlink{t4fw__interface_8h_a6ab76d9626b4560475a0da0142cf3675ae5c27cf619b20b092b695506a12415f4}{FW\_ERROR\_TYPE\_ACL}}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06411}06411                 log(LOG\_ERR, \textcolor{stringliteral}{"{}ACL cidx \%d PF \%d VF \%d eqid \%d \%s"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06412}06412                     be16toh(e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_aa6369675875ecb5b1df013231e03de6b}{acl}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__acl_a16e6aaa7b9b1fa304edb023bf7bb3f37}{cidx}}),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06413}06413                     \mbox{\hyperlink{t4fw__interface_8h_a736a47f861f1540a8f29451c0a9f4de5}{G\_FW\_ERROR\_CMD\_PFN}}(be16toh(e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_aa6369675875ecb5b1df013231e03de6b}{acl}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__acl_aee95b3a7253265afd553ec536c45cf67}{pfn\_vfn}})),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06414}06414                     \mbox{\hyperlink{t4fw__interface_8h_a7accecefa4fa5dd24b2d1f9ae92c2066}{G\_FW\_ERROR\_CMD\_VFN}}(be16toh(e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_aa6369675875ecb5b1df013231e03de6b}{acl}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__acl_aee95b3a7253265afd553ec536c45cf67}{pfn\_vfn}})),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06415}06415                     be32toh(e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_aa6369675875ecb5b1df013231e03de6b}{acl}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__acl_a7edfea4510b21cfc942efbef6bb3e278}{eqid}}),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06416}06416                     \mbox{\hyperlink{t4fw__interface_8h_a071b21021cd3590e6e4947c30213ec36}{G\_FW\_ERROR\_CMD\_MV}}(be16toh(e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_aa6369675875ecb5b1df013231e03de6b}{acl}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__acl_acbf6d94df606885d3f55ab88467a8ae5}{mv\_pkd}})) ? \textcolor{stringliteral}{"{}vlanid"{}} :}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06417}06417                     \textcolor{stringliteral}{"{}MAC"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06418}06418                 \textcolor{keywordflow}{for} (i = 0; i < nitems(e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_aa6369675875ecb5b1df013231e03de6b}{acl}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__acl_a16b28d1cf91530dbc409a418fbb2de18}{val}}); i++)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06419}06419                         log(LOG\_ERR, \textcolor{stringliteral}{"{} \%02x"{}}, e-\/>\mbox{\hyperlink{structfw__error__cmd_a1042352bfb40d4c57f7397efae5d6eea}{u}}.\mbox{\hyperlink{unionfw__error__cmd_1_1fw__error_aa6369675875ecb5b1df013231e03de6b}{acl}}.\mbox{\hyperlink{structfw__error__cmd_1_1fw__error_1_1fw__error__acl_a16b28d1cf91530dbc409a418fbb2de18}{val}}[i]);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06420}06420                 log(LOG\_ERR, \textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06421}06421                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06422}06422         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06423}06423                 log(LOG\_ERR, \textcolor{stringliteral}{"{}type \%\#x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06424}06424                     \mbox{\hyperlink{t4fw__interface_8h_a6d38e9ec4085413de60e079fc05c99d9}{G\_FW\_ERROR\_CMD\_TYPE}}(be32toh(e-\/>\mbox{\hyperlink{structfw__error__cmd_a605e04473bacfffd9aa515c73d5a0909}{op\_to\_type}})));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06425}06425                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06426}06426         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06427}06427         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06428}06428 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06429}06429 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06430}06430 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06431}\mbox{\hyperlink{t4__sge_8c_a4de25e58ba760f14499fc5c35cf6b3a6}{06431}} \mbox{\hyperlink{t4__sge_8c_a4de25e58ba760f14499fc5c35cf6b3a6}{bufidx\_used}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structadapter}{adapter}} *sc, \textcolor{keywordtype}{int} idx)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06432}06432 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06433}06433         \textcolor{keyword}{struct }\mbox{\hyperlink{structrx__buf__info}{rx\_buf\_info}} *rxb = \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_a1d0a3ea264db143053eab8e647b3d3fc}{rx\_buf\_info}}[0];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06434}06434         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06435}06435 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06436}06436         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{adapter_8h_a06fc87d81c62e9abb8790b6e5713c55ba3c96c0b2a920c024f7910a76f485ab99}{SW\_ZONE\_SIZES}}; i++, rxb++) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06437}06437                 \textcolor{keywordflow}{if} (rxb-\/>\mbox{\hyperlink{structrx__buf__info_a0d517a5ac98b6b2eaa9d27e2082006e7}{size1}} > \mbox{\hyperlink{t4__sge_8c_afc662bb0583ce4a9ef1867e1e9502fed}{largest\_rx\_cluster}})}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06438}06438                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06439}06439                 \textcolor{keywordflow}{if} (rxb-\/>\mbox{\hyperlink{structrx__buf__info_aba1b3a28021975079ea300ef9a65f4fd}{hwidx1}} == idx || rxb-\/>\mbox{\hyperlink{structrx__buf__info_a3ea12113c04fb9272c95dd0c9459f1a7}{hwidx2}} == idx)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06440}06440                         \textcolor{keywordflow}{return} (\textcolor{keyword}{true});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06441}06441         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06442}06442 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06443}06443         \textcolor{keywordflow}{return} (\textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06444}06444 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06445}06445 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06446}06446 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06447}\mbox{\hyperlink{t4__sge_8c_aa53499331be83ff7e7c29175d535a7be}{06447}} \mbox{\hyperlink{t4__sge_8c_aa53499331be83ff7e7c29175d535a7be}{sysctl\_bufsizes}}(SYSCTL\_HANDLER\_ARGS)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06448}06448 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06449}06449         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = arg1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06450}06450         \textcolor{keyword}{struct }\mbox{\hyperlink{structsge__params}{sge\_params}} *sp = \&sc-\/>\mbox{\hyperlink{structadapter_a8748855857e580beb40206d590c8d14e}{params}}.\mbox{\hyperlink{structadapter__params_ab79fe69a2e23dd1a5264bda12c727942}{sge}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06451}06451         \textcolor{keywordtype}{int} i, rc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06452}06452         \textcolor{keyword}{struct }sbuf sb;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06453}06453         \textcolor{keywordtype}{char} c;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06454}06454 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06455}06455         sbuf\_new(\&sb, NULL, 128, SBUF\_AUTOEXTEND);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06456}06456         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{t4__hw_8h_aabfcbcb5ac86a1edac4035264bc7d2b8aa975d3f7f7f19811a68e7f504c3d2e29}{SGE\_FLBUF\_SIZES}}; i++) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06457}06457                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a4de25e58ba760f14499fc5c35cf6b3a6}{bufidx\_used}}(sc, i))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06458}06458                         c = \textcolor{charliteral}{'*'};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06459}06459                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06460}06460                         c = \textcolor{charliteral}{'\(\backslash\)0'};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06461}06461 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06462}06462                 sbuf\_printf(\&sb, \textcolor{stringliteral}{"{}\%u\%c "{}}, sp-\/>\mbox{\hyperlink{structsge__params_afb512a619d5cf5508f036dee75a815d5}{sge\_fl\_buffer\_size}}[i], c);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06463}06463         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06464}06464         sbuf\_trim(\&sb);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06465}06465         sbuf\_finish(\&sb);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06466}06466         rc = sysctl\_handle\_string(oidp, sbuf\_data(\&sb), sbuf\_len(\&sb), req);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06467}06467         sbuf\_delete(\&sb);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06468}06468         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06469}06469 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06470}06470 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06471}06471 \textcolor{preprocessor}{\#ifdef RATELIMIT}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06472}06472 \textcolor{preprocessor}{\#if defined(INET) || defined(INET6)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06473}06473 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06474}06474 \textcolor{comment}{ * len16 for a txpkt WR with a GL.  Includes the firmware work request header.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06475}06475 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06476}06476 \textcolor{keyword}{static} \textcolor{keyword}{inline} u\_int}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06477}06477 txpkt\_eo\_len16(u\_int nsegs, u\_int immhdrs, u\_int tso)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06478}06478 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06479}06479         u\_int n;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06480}06480 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06481}06481         MPASS(immhdrs > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06482}06482 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06483}06483         n = roundup2(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structfw__eth__tx__eo__wr}{fw\_eth\_tx\_eo\_wr}}) +}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06484}06484             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcpl__tx__pkt__core}{cpl\_tx\_pkt\_core}}) + immhdrs, 16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06485}06485         \textcolor{keywordflow}{if} (\_\_predict\_false(nsegs == 0))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06486}06486                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06487}06487 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06488}06488         nsegs-\/-\/; \textcolor{comment}{/* first segment is part of ulptx\_sgl */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06489}06489         n += \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structulptx__sgl}{ulptx\_sgl}}) + 8 * ((3 * nsegs) / 2 + (nsegs \& 1));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06490}06490         \textcolor{keywordflow}{if} (tso)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06491}06491                 n += \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__pkt__lso__core}{cpl\_tx\_pkt\_lso\_core}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06492}06492 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06493}06493 done:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06494}06494         \textcolor{keywordflow}{return} (howmany(n, 16));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06495}06495 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06496}06496 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06497}06497 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06498}06498 \textcolor{preprocessor}{\#define ETID\_FLOWC\_NPARAMS 6}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06499}06499 \textcolor{preprocessor}{\#define ETID\_FLOWC\_LEN (roundup2((sizeof(struct fw\_flowc\_wr) + \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06500}06500 \textcolor{preprocessor}{    ETID\_FLOWC\_NPARAMS * sizeof(struct fw\_flowc\_mnemval)), 16))}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06501}06501 \textcolor{preprocessor}{\#define ETID\_FLOWC\_LEN16 (howmany(ETID\_FLOWC\_LEN, 16))}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06502}06502 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06503}06503 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06504}06504 send\_etid\_flowc\_wr(\textcolor{keyword}{struct} \mbox{\hyperlink{structcxgbe__rate__tag}{cxgbe\_rate\_tag}} *cst, \textcolor{keyword}{struct} \mbox{\hyperlink{structport__info}{port\_info}} *pi,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06505}06505     \textcolor{keyword}{struct} \mbox{\hyperlink{structvi__info}{vi\_info}} *vi)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06506}06506 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06507}06507         \textcolor{keyword}{struct }\mbox{\hyperlink{structwrq__cookie}{wrq\_cookie}} cookie;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06508}06508         u\_int pfvf = pi-\/>\mbox{\hyperlink{structport__info_aba648614041df46933c83c56ec849d33}{adapter}}-\/>\mbox{\hyperlink{structadapter_a4bd2e26128e44b99fd08533b5ec2008a}{pf}} << \mbox{\hyperlink{t4fw__interface_8h_a1fa9bfe0fa64f2f19f5d649fc95c0f1f}{S\_FW\_VIID\_PFN}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06509}06509         \textcolor{keyword}{struct }\mbox{\hyperlink{structfw__flowc__wr}{fw\_flowc\_wr}} *flowc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06510}06510 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06511}06511         mtx\_assert(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a24136f11a1bcd83749a45c0d48769324}{lock}}, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06512}06512         MPASS((cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aaac93093ecef15ad2ee2fd65f728a8bb}{flags}} \& (\mbox{\hyperlink{offload_8h_a1b70d876770ccff427513794d6b0b2a7a87b3edfaeb395f43fa5322ce706315cf}{EO\_FLOWC\_PENDING}} | \mbox{\hyperlink{offload_8h_a1b70d876770ccff427513794d6b0b2a7ac35400930847cf8e67d141c397eb8448}{EO\_FLOWC\_RPL\_PENDING}})) ==}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06513}06513             \mbox{\hyperlink{offload_8h_a1b70d876770ccff427513794d6b0b2a7a87b3edfaeb395f43fa5322ce706315cf}{EO\_FLOWC\_PENDING}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06514}06514 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06515}06515         flowc = \mbox{\hyperlink{t4__sge_8c_ad86cf314f5368b406537a2ea86922004}{start\_wrq\_wr}}(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_abfdef0678774760ed12e0436b95929a1}{eo\_txq}}-\/>\mbox{\hyperlink{structsge__ofld__txq_aa609cd3b3ea709a9c9534a1d911f1495}{wrq}}, ETID\_FLOWC\_LEN16, \&cookie);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06516}06516         \textcolor{keywordflow}{if} (\_\_predict\_false(flowc == NULL))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06517}06517                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06518}06518 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06519}06519         bzero(flowc, ETID\_FLOWC\_LEN);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06520}06520         flowc-\/>\mbox{\hyperlink{structfw__flowc__wr_a7e576b95ee3cae434c7eefe791e4c625}{op\_to\_nparams}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_a3ff5e4f34a83f6c7d5d5a917fac15be4}{V\_FW\_WR\_OP}}(\mbox{\hyperlink{t4fw__interface_8h_acad922311ad51c6f19f2a62af11cafd7a79768618d46064beb53b8b843a213b4c}{FW\_FLOWC\_WR}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06521}06521             \mbox{\hyperlink{t4fw__interface_8h_a64e38a46b83634863c0180e678079e5a}{V\_FW\_FLOWC\_WR\_NPARAMS}}(ETID\_FLOWC\_NPARAMS) | \mbox{\hyperlink{t4fw__interface_8h_a7c60d832de3dd14a83668ede809e95e0}{V\_FW\_WR\_COMPL}}(0));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06522}06522         flowc-\/>\mbox{\hyperlink{structfw__flowc__wr_ac82e1e2d0650d16e00a57a194eba6629}{flowid\_len16}} = htonl(\mbox{\hyperlink{t4fw__interface_8h_a5cdd4e9f4ce069b358b161e019330de1}{V\_FW\_WR\_LEN16}}(ETID\_FLOWC\_LEN16) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06523}06523             \mbox{\hyperlink{t4fw__interface_8h_abff9084df34ff57723903100a5681c24}{V\_FW\_WR\_FLOWID}}(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_af28daaa59b44a12f91b3b21f19ef3562}{etid}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06524}06524         flowc-\/>\mbox{\hyperlink{structfw__flowc__wr_a68c819befac88548d7f41ffc6df6446d}{mnemval}}[0].\mbox{\hyperlink{structfw__flowc__mnemval_add83e302f84cadc72953dd5f2a69664b}{mnemonic}} = \mbox{\hyperlink{t4fw__interface_8h_a9d5bdf07e6a3a935af816fcc9cd63f3ca0da925577d4bb8fb091123c562b0a10c}{FW\_FLOWC\_MNEM\_PFNVFN}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06525}06525         flowc-\/>\mbox{\hyperlink{structfw__flowc__wr_a68c819befac88548d7f41ffc6df6446d}{mnemval}}[0].\mbox{\hyperlink{structfw__flowc__mnemval_add759fb3ccd99dd429fc4aba12c56fee}{val}} = htobe32(pfvf);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06526}06526         flowc-\/>\mbox{\hyperlink{structfw__flowc__wr_a68c819befac88548d7f41ffc6df6446d}{mnemval}}[1].\mbox{\hyperlink{structfw__flowc__mnemval_add83e302f84cadc72953dd5f2a69664b}{mnemonic}} = \mbox{\hyperlink{t4fw__interface_8h_a9d5bdf07e6a3a935af816fcc9cd63f3ca1582803bb5fb24b2772fe2f760b8ab70}{FW\_FLOWC\_MNEM\_CH}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06527}06527         flowc-\/>\mbox{\hyperlink{structfw__flowc__wr_a68c819befac88548d7f41ffc6df6446d}{mnemval}}[1].\mbox{\hyperlink{structfw__flowc__mnemval_add759fb3ccd99dd429fc4aba12c56fee}{val}} = htobe32(pi-\/>\mbox{\hyperlink{structport__info_a8f6b327a3aebe073516c98344ab196b4}{tx\_chan}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06528}06528         flowc-\/>\mbox{\hyperlink{structfw__flowc__wr_a68c819befac88548d7f41ffc6df6446d}{mnemval}}[2].\mbox{\hyperlink{structfw__flowc__mnemval_add83e302f84cadc72953dd5f2a69664b}{mnemonic}} = \mbox{\hyperlink{t4fw__interface_8h_a9d5bdf07e6a3a935af816fcc9cd63f3cadf1018c698425ba2e8846c1fe4aaa18a}{FW\_FLOWC\_MNEM\_PORT}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06529}06529         flowc-\/>\mbox{\hyperlink{structfw__flowc__wr_a68c819befac88548d7f41ffc6df6446d}{mnemval}}[2].\mbox{\hyperlink{structfw__flowc__mnemval_add759fb3ccd99dd429fc4aba12c56fee}{val}} = htobe32(pi-\/>\mbox{\hyperlink{structport__info_a8f6b327a3aebe073516c98344ab196b4}{tx\_chan}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06530}06530         flowc-\/>\mbox{\hyperlink{structfw__flowc__wr_a68c819befac88548d7f41ffc6df6446d}{mnemval}}[3].\mbox{\hyperlink{structfw__flowc__mnemval_add83e302f84cadc72953dd5f2a69664b}{mnemonic}} = \mbox{\hyperlink{t4fw__interface_8h_a9d5bdf07e6a3a935af816fcc9cd63f3ca7074175843dcc0a94bcb441ab890f4d8}{FW\_FLOWC\_MNEM\_IQID}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06531}06531         flowc-\/>\mbox{\hyperlink{structfw__flowc__wr_a68c819befac88548d7f41ffc6df6446d}{mnemval}}[3].\mbox{\hyperlink{structfw__flowc__mnemval_add759fb3ccd99dd429fc4aba12c56fee}{val}} = htobe32(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a4ef73ba1ffd93263a0f3d40ae5d0facb}{iqid}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06532}06532         flowc-\/>\mbox{\hyperlink{structfw__flowc__wr_a68c819befac88548d7f41ffc6df6446d}{mnemval}}[4].\mbox{\hyperlink{structfw__flowc__mnemval_add83e302f84cadc72953dd5f2a69664b}{mnemonic}} = \mbox{\hyperlink{t4fw__interface_8h_a9d5bdf07e6a3a935af816fcc9cd63f3ca03919df1f01637a1c088a6ae09748b77}{FW\_FLOWC\_MNEM\_EOSTATE}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06533}06533         flowc-\/>\mbox{\hyperlink{structfw__flowc__wr_a68c819befac88548d7f41ffc6df6446d}{mnemval}}[4].\mbox{\hyperlink{structfw__flowc__mnemval_add759fb3ccd99dd429fc4aba12c56fee}{val}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_ac9ce27ef46984c99a46162d305959dbeaab463774267b1e3ffc0e4eeefe57e37b}{FW\_FLOWC\_MNEM\_EOSTATE\_ESTABLISHED}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06534}06534         flowc-\/>\mbox{\hyperlink{structfw__flowc__wr_a68c819befac88548d7f41ffc6df6446d}{mnemval}}[5].\mbox{\hyperlink{structfw__flowc__mnemval_add83e302f84cadc72953dd5f2a69664b}{mnemonic}} = \mbox{\hyperlink{t4fw__interface_8h_a9d5bdf07e6a3a935af816fcc9cd63f3ca6e497f759f4bf7e9f77ef9dd4a3e2e59}{FW\_FLOWC\_MNEM\_SCHEDCLASS}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06535}06535         flowc-\/>\mbox{\hyperlink{structfw__flowc__wr_a68c819befac88548d7f41ffc6df6446d}{mnemval}}[5].\mbox{\hyperlink{structfw__flowc__mnemval_add759fb3ccd99dd429fc4aba12c56fee}{val}} = htobe32(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aa3b7d8a56690242733321db2aaa06e71}{schedcl}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06536}06536 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06537}06537         \mbox{\hyperlink{t4__sge_8c_a54d3b4bac7a164bc0a0073290549b121}{commit\_wrq\_wr}}(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_abfdef0678774760ed12e0436b95929a1}{eo\_txq}}-\/>\mbox{\hyperlink{structsge__ofld__txq_aa609cd3b3ea709a9c9534a1d911f1495}{wrq}}, flowc, \&cookie);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06538}06538 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06539}06539         cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aaac93093ecef15ad2ee2fd65f728a8bb}{flags}} \&= \string~EO\_FLOWC\_PENDING;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06540}06540         cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aaac93093ecef15ad2ee2fd65f728a8bb}{flags}} |= \mbox{\hyperlink{offload_8h_a1b70d876770ccff427513794d6b0b2a7ac35400930847cf8e67d141c397eb8448}{EO\_FLOWC\_RPL\_PENDING}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06541}06541         MPASS(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aafc9d7516f2ae12b9200382989ce7d4a}{tx\_credits}} >= ETID\_FLOWC\_LEN16);   \textcolor{comment}{/* flowc is first WR. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06542}06542         cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aafc9d7516f2ae12b9200382989ce7d4a}{tx\_credits}} -\/= ETID\_FLOWC\_LEN16;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06543}06543 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06544}06544         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06545}06545 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06546}06546 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06547}06547 \textcolor{preprocessor}{\#define ETID\_FLUSH\_LEN16 (howmany(sizeof (struct fw\_flowc\_wr), 16))}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06548}06548 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06549}06549 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06550}06550 send\_etid\_flush\_wr(\textcolor{keyword}{struct} \mbox{\hyperlink{structcxgbe__rate__tag}{cxgbe\_rate\_tag}} *cst)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06551}06551 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06552}06552         \textcolor{keyword}{struct }\mbox{\hyperlink{structfw__flowc__wr}{fw\_flowc\_wr}} *flowc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06553}06553         \textcolor{keyword}{struct }\mbox{\hyperlink{structwrq__cookie}{wrq\_cookie}} cookie;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06554}06554 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06555}06555         mtx\_assert(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a24136f11a1bcd83749a45c0d48769324}{lock}}, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06556}06556 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06557}06557         flowc = \mbox{\hyperlink{t4__sge_8c_ad86cf314f5368b406537a2ea86922004}{start\_wrq\_wr}}(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_abfdef0678774760ed12e0436b95929a1}{eo\_txq}}-\/>\mbox{\hyperlink{structsge__ofld__txq_aa609cd3b3ea709a9c9534a1d911f1495}{wrq}}, ETID\_FLUSH\_LEN16, \&cookie);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06558}06558         \textcolor{keywordflow}{if} (\_\_predict\_false(flowc == NULL))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06559}06559                 \mbox{\hyperlink{adapter_8h_aef4bd623dba73998f692194040d4f0e5}{CXGBE\_UNIMPLEMENTED}}(\_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06560}06560 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06561}06561         bzero(flowc, ETID\_FLUSH\_LEN16 * 16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06562}06562         flowc-\/>\mbox{\hyperlink{structfw__flowc__wr_a7e576b95ee3cae434c7eefe791e4c625}{op\_to\_nparams}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_a3ff5e4f34a83f6c7d5d5a917fac15be4}{V\_FW\_WR\_OP}}(\mbox{\hyperlink{t4fw__interface_8h_acad922311ad51c6f19f2a62af11cafd7a79768618d46064beb53b8b843a213b4c}{FW\_FLOWC\_WR}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06563}06563             \mbox{\hyperlink{t4fw__interface_8h_a64e38a46b83634863c0180e678079e5a}{V\_FW\_FLOWC\_WR\_NPARAMS}}(0) | \mbox{\hyperlink{t4fw__interface_8h_aff2dace3ab64156ff0634a6d0f2a4e92}{F\_FW\_WR\_COMPL}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06564}06564         flowc-\/>\mbox{\hyperlink{structfw__flowc__wr_ac82e1e2d0650d16e00a57a194eba6629}{flowid\_len16}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_a5cdd4e9f4ce069b358b161e019330de1}{V\_FW\_WR\_LEN16}}(ETID\_FLUSH\_LEN16) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06565}06565             \mbox{\hyperlink{t4fw__interface_8h_abff9084df34ff57723903100a5681c24}{V\_FW\_WR\_FLOWID}}(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_af28daaa59b44a12f91b3b21f19ef3562}{etid}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06566}06566 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06567}06567         \mbox{\hyperlink{t4__sge_8c_a54d3b4bac7a164bc0a0073290549b121}{commit\_wrq\_wr}}(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_abfdef0678774760ed12e0436b95929a1}{eo\_txq}}-\/>\mbox{\hyperlink{structsge__ofld__txq_aa609cd3b3ea709a9c9534a1d911f1495}{wrq}}, flowc, \&cookie);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06568}06568 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06569}06569         cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aaac93093ecef15ad2ee2fd65f728a8bb}{flags}} |= \mbox{\hyperlink{offload_8h_a1b70d876770ccff427513794d6b0b2a7af050e6fcfcf7fcf24ab7cd7b5c9fb576}{EO\_FLUSH\_RPL\_PENDING}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06570}06570         MPASS(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aafc9d7516f2ae12b9200382989ce7d4a}{tx\_credits}} >= ETID\_FLUSH\_LEN16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06571}06571         cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aafc9d7516f2ae12b9200382989ce7d4a}{tx\_credits}} -\/= ETID\_FLUSH\_LEN16;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06572}06572         cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_ab920d95e3ca8e502408736e9eaf92ecc}{ncompl}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06573}06573 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06574}06574 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06575}06575 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06576}06576 write\_ethofld\_wr(\textcolor{keyword}{struct} \mbox{\hyperlink{structcxgbe__rate__tag}{cxgbe\_rate\_tag}} *cst, \textcolor{keyword}{struct} \mbox{\hyperlink{structfw__eth__tx__eo__wr}{fw\_eth\_tx\_eo\_wr}} *wr,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06577}06577     \textcolor{keyword}{struct} mbuf *m0, \textcolor{keywordtype}{int} compl)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06578}06578 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06579}06579         \textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__pkt__core}{cpl\_tx\_pkt\_core}} *cpl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06580}06580         uint64\_t \mbox{\hyperlink{structcpl__tx__pkt__core_a3c879243195a6dc379671b07e8e5f825}{ctrl1}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06581}06581         uint32\_t ctrl;  \textcolor{comment}{/* used in many unrelated places */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06582}06582         \textcolor{keywordtype}{int} len16, pktlen, nsegs, immhdrs;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06583}06583         uintptr\_t p;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06584}06584         \textcolor{keyword}{struct }\mbox{\hyperlink{structulptx__sgl}{ulptx\_sgl}} *usgl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06585}06585         \textcolor{keyword}{struct }sglist sg;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06586}06586         \textcolor{keyword}{struct }sglist\_seg segs[38];     \textcolor{comment}{/* XXX: find real limit.  XXX: get off the stack */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06587}06587 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06588}06588         mtx\_assert(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a24136f11a1bcd83749a45c0d48769324}{lock}}, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06589}06589         M\_ASSERTPKTHDR(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06590}06590         KASSERT(m0-\/>m\_pkthdr.l2hlen > 0 \&\& m0-\/>m\_pkthdr.l3hlen > 0 \&\&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06591}06591             m0-\/>m\_pkthdr.l4hlen > 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06592}06592             (\textcolor{stringliteral}{"{}\%s: ethofld mbuf \%p is missing header lengths"{}}, \_\_func\_\_, m0));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06593}06593 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06594}06594         len16 = mbuf\_eo\_len16(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06595}06595         nsegs = mbuf\_eo\_nsegs(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06596}06596         pktlen = m0-\/>m\_pkthdr.len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06597}06597         ctrl = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__pkt__core}{cpl\_tx\_pkt\_core}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06598}06598         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ae6ecacf657295bf32737d5feea989d27}{needs\_tso}}(m0))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06599}06599                 ctrl += \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__pkt__lso__core}{cpl\_tx\_pkt\_lso\_core}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06600}06600         immhdrs = m0-\/>m\_pkthdr.l2hlen + m0-\/>m\_pkthdr.l3hlen + m0-\/>m\_pkthdr.l4hlen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06601}06601         ctrl += immhdrs;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06602}06602 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06603}06603         wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_a6cff4258901ad27ade324bee41fbfd35}{op\_immdlen}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_a3ff5e4f34a83f6c7d5d5a917fac15be4}{V\_FW\_WR\_OP}}(\mbox{\hyperlink{t4fw__interface_8h_acad922311ad51c6f19f2a62af11cafd7a85cb393548ec13899b96ff41224004f2}{FW\_ETH\_TX\_EO\_WR}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06604}06604             \mbox{\hyperlink{t4fw__interface_8h_ab1586ac62f8c8f600a3ae6ab29ed83ef}{V\_FW\_ETH\_TX\_EO\_WR\_IMMDLEN}}(ctrl) | \mbox{\hyperlink{t4fw__interface_8h_a7c60d832de3dd14a83668ede809e95e0}{V\_FW\_WR\_COMPL}}(!!compl));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06605}06605         wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_a283ef2e10073cf8714196b3a46e3c0fc}{equiq\_to\_len16}} = htobe32(\mbox{\hyperlink{t4fw__interface_8h_a5cdd4e9f4ce069b358b161e019330de1}{V\_FW\_WR\_LEN16}}(len16) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06606}06606             \mbox{\hyperlink{t4fw__interface_8h_abff9084df34ff57723903100a5681c24}{V\_FW\_WR\_FLOWID}}(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_af28daaa59b44a12f91b3b21f19ef3562}{etid}}));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06607}06607         wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_a5e60d07d5fb6246085f6081dcf3fd7c6}{r3}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06608}06608         \textcolor{keywordflow}{if} (needs\_outer\_udp\_csum(m0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06609}06609                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_a92c902935a058c46a138d844951d1183}{udpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__udpseg_a1c2f23e42c7eb9ae27d190d164f9326a}{type}} = \mbox{\hyperlink{t4fw__interface_8h_a03c724ab06cfb8acbfd3e30bc3752905ae5ab22c73b813423931c70f3ac38b73d}{FW\_ETH\_TX\_EO\_TYPE\_UDPSEG}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06610}06610                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_a92c902935a058c46a138d844951d1183}{udpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__udpseg_a120ace6d6a1e692484c3ae5793f26568}{ethlen}} = m0-\/>m\_pkthdr.l2hlen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06611}06611                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_a92c902935a058c46a138d844951d1183}{udpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__udpseg_a0cf693ab7c34c2c1d65e0efedea6e1ab}{iplen}} = htobe16(m0-\/>m\_pkthdr.l3hlen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06612}06612                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_a92c902935a058c46a138d844951d1183}{udpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__udpseg_af6cb6383180530048aaf7b2a1f048bbb}{udplen}} = m0-\/>m\_pkthdr.l4hlen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06613}06613                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_a92c902935a058c46a138d844951d1183}{udpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__udpseg_aceec98e6be76da0b6c3756606d3f2e47}{rtplen}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06614}06614                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_a92c902935a058c46a138d844951d1183}{udpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__udpseg_aa008beb2bccc6ba6b91f84750b161215}{r4}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06615}06615                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_a92c902935a058c46a138d844951d1183}{udpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__udpseg_acd0381d27489ee5521df4f06440bc88a}{mss}} = htobe16(pktlen -\/ immhdrs);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06616}06616                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_a92c902935a058c46a138d844951d1183}{udpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__udpseg_a193f976d7830b71c63b1e7f2092d2796}{schedpktsize}} = wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_a92c902935a058c46a138d844951d1183}{udpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__udpseg_acd0381d27489ee5521df4f06440bc88a}{mss}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06617}06617                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_a92c902935a058c46a138d844951d1183}{udpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__udpseg_ae948c033a35e6732f39ca2c4fc96f015}{plen}} = htobe32(pktlen -\/ immhdrs);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06618}06618                 cpl = (\textcolor{keywordtype}{void} *)(wr + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06619}06619         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06620}06620                 MPASS(\mbox{\hyperlink{t4__sge_8c_a86c7655961f22435bf11f5b66a0984bc}{needs\_outer\_tcp\_csum}}(m0));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06621}06621                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_ad30cddee2b3438bd38921092959b2f44}{tcpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__tcpseg_aef1f2ae31bf768b7ce76ed64b6376d4b}{type}} = \mbox{\hyperlink{t4fw__interface_8h_a03c724ab06cfb8acbfd3e30bc3752905a4d4b8577af69382b153cd2b783399724}{FW\_ETH\_TX\_EO\_TYPE\_TCPSEG}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06622}06622                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_ad30cddee2b3438bd38921092959b2f44}{tcpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__tcpseg_a4b5c62861b7d9465ff0f46e89d563507}{ethlen}} = m0-\/>m\_pkthdr.l2hlen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06623}06623                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_ad30cddee2b3438bd38921092959b2f44}{tcpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__tcpseg_abc1cff19aec1c72b05d963a83f76288e}{iplen}} = htobe16(m0-\/>m\_pkthdr.l3hlen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06624}06624                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_ad30cddee2b3438bd38921092959b2f44}{tcpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__tcpseg_ac8c365a870ed6e0ca41587f723e31a41}{tcplen}} = m0-\/>m\_pkthdr.l4hlen;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06625}06625                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_ad30cddee2b3438bd38921092959b2f44}{tcpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__tcpseg_a37577e5a327bb509495ee1b1789edb50}{tsclk\_tsoff}} = mbuf\_eo\_tsclk\_tsoff(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06626}06626                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_ad30cddee2b3438bd38921092959b2f44}{tcpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__tcpseg_a2012a8d4710193c5f458bf1b58e29364}{r4}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06627}06627                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_ad30cddee2b3438bd38921092959b2f44}{tcpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__tcpseg_a5843efbd9d78309fdd55b52858114b6c}{r5}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06628}06628                 wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_ad30cddee2b3438bd38921092959b2f44}{tcpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__tcpseg_a3ba4670d633e27d8781c78afa73f9fa0}{plen}} = htobe32(pktlen -\/ immhdrs);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06629}06629 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06630}06630                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_ae6ecacf657295bf32737d5feea989d27}{needs\_tso}}(m0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06631}06631                         \textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__tx__pkt__lso__core}{cpl\_tx\_pkt\_lso\_core}} *lso = (\textcolor{keywordtype}{void} *)(wr + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06632}06632 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06633}06633                         wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_ad30cddee2b3438bd38921092959b2f44}{tcpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__tcpseg_aabea9db59bb06ab9b5cbb89f10e3e134}{mss}} = htobe16(m0-\/>m\_pkthdr.tso\_segsz);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06634}06634 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06635}06635                         ctrl = \mbox{\hyperlink{t4__msg_8h_a105ff541c06eafc90f54867733385a08}{V\_LSO\_OPCODE}}(\mbox{\hyperlink{t4__msg_8h_a0ed680fdb405e7195d9f14032851eebba0c481a3afe19e160383ba8caddde1991}{CPL\_TX\_PKT\_LSO}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06636}06636                             \mbox{\hyperlink{t4__msg_8h_aa880292d3087b146db1838cc07c31e19}{F\_LSO\_FIRST\_SLICE}} | \mbox{\hyperlink{t4__msg_8h_a29fa19c03799a320128eca511e6e5b91}{F\_LSO\_LAST\_SLICE}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06637}06637                             \mbox{\hyperlink{t4__msg_8h_aa060594208b1e95553705ce4afc5c130}{V\_LSO\_ETHHDR\_LEN}}((m0-\/>m\_pkthdr.l2hlen -\/}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06638}06638                                 ETHER\_HDR\_LEN) >> 2) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06639}06639                             \mbox{\hyperlink{t4__msg_8h_ad10e9a09965b74a1de46fea0022955c5}{V\_LSO\_IPHDR\_LEN}}(m0-\/>m\_pkthdr.l3hlen >> 2) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06640}06640                             \mbox{\hyperlink{t4__msg_8h_a90167e14fd8a16340006c0ee5f558cc7}{V\_LSO\_TCPHDR\_LEN}}(m0-\/>m\_pkthdr.l4hlen >> 2);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06641}06641                         \textcolor{keywordflow}{if} (m0-\/>m\_pkthdr.l3hlen == \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} ip6\_hdr))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06642}06642                                 ctrl |= \mbox{\hyperlink{t4__msg_8h_ad47bea99d66ddad557f9171ee100eff9}{F\_LSO\_IPV6}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06643}06643                         lso-\/>\mbox{\hyperlink{structcpl__tx__pkt__lso__core_adfd83fec86090a417fdf143b9109894d}{lso\_ctrl}} = htobe32(ctrl);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06644}06644                         lso-\/>\mbox{\hyperlink{structcpl__tx__pkt__lso__core_a31d648ea9f437f212be728d36ce14581}{ipid\_ofst}} = htobe16(0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06645}06645                         lso-\/>\mbox{\hyperlink{structcpl__tx__pkt__lso__core_a8040ab9409bddd7dca89dbfdae6654e5}{mss}} = htobe16(m0-\/>m\_pkthdr.tso\_segsz);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06646}06646                         lso-\/>\mbox{\hyperlink{structcpl__tx__pkt__lso__core_af44d8cf800e80b7f0152a8e1ab42b610}{seqno\_offset}} = htobe32(0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06647}06647                         lso-\/>\mbox{\hyperlink{structcpl__tx__pkt__lso__core_a76ba483518a8a4bc393a074e87140ae5}{len}} = htobe32(pktlen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06648}06648 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06649}06649                         cpl = (\textcolor{keywordtype}{void} *)(lso + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06650}06650                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06651}06651                         wr-\/>\mbox{\hyperlink{structfw__eth__tx__eo__wr_aeb012e8d3574a6428ac544dffbcd6691}{u}}.\mbox{\hyperlink{unionfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_ad30cddee2b3438bd38921092959b2f44}{tcpseg}}.\mbox{\hyperlink{structfw__eth__tx__eo__wr_1_1fw__eth__tx__eo_1_1fw__eth__tx__eo__tcpseg_aabea9db59bb06ab9b5cbb89f10e3e134}{mss}} = htobe16(0xffff);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06652}06652                         cpl = (\textcolor{keywordtype}{void} *)(wr + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06653}06653                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06654}06654         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06655}06655 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06656}06656         \textcolor{comment}{/* Checksum offload must be requested for ethofld. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06657}06657         MPASS(needs\_outer\_l4\_csum(m0));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06658}06658         ctrl1 = \mbox{\hyperlink{t4__sge_8c_abd1635fecd290bea91271166d26b1d38}{csum\_to\_ctrl}}(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_acecf4e091a8472e38329a8ff4b0d1c41}{adapter}}, m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06659}06659 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06660}06660         \textcolor{comment}{/* VLAN tag insertion */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06661}06661         \textcolor{keywordflow}{if} (\mbox{\hyperlink{t4__sge_8c_a94a7316babc844729e5be67779bf1485}{needs\_vlan\_insertion}}(m0)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06662}06662                 ctrl1 |= \mbox{\hyperlink{t4__msg_8h_a493d54d3ea80df168f3775568a84ad91}{F\_TXPKT\_VLAN\_VLD}} |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06663}06663                     \mbox{\hyperlink{t4__msg_8h_a710d87104b120676fef1f28e71c8f6dc}{V\_TXPKT\_VLAN}}(m0-\/>m\_pkthdr.ether\_vtag);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06664}06664         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06665}06665 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06666}06666         \textcolor{comment}{/* CPL header */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06667}06667         cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_ad7ca5b3fec93f44fc575ae84d2337fc4}{ctrl0}} = cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_ad195467ddd181a27de8fb56baab6d34a}{ctrl0}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06668}06668         cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_a344b274ffb11b6b18e69136373bb5a3b}{pack}} = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06669}06669         cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_a3a92307cc029c9f59ed4ec3c20420df6}{len}} = htobe16(pktlen);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06670}06670         cpl-\/>\mbox{\hyperlink{structcpl__tx__pkt__core_a3c879243195a6dc379671b07e8e5f825}{ctrl1}} = htobe64(ctrl1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06671}06671 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06672}06672         \textcolor{comment}{/* Copy Ethernet, IP \& TCP/UDP hdrs as immediate data */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06673}06673         p = (uintptr\_t)(cpl + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06674}06674         m\_copydata(m0, 0, immhdrs, (\textcolor{keywordtype}{void} *)p);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06675}06675 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06676}06676         \textcolor{comment}{/* SGL */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06677}06677         \textcolor{keywordflow}{if} (nsegs > 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06678}06678                 \textcolor{keywordtype}{int} i, pad;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06679}06679 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06680}06680                 \textcolor{comment}{/* zero-\/pad upto next 16Byte boundary, if not 16Byte aligned */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06681}06681                 p += immhdrs;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06682}06682                 pad = 16 -\/ (immhdrs \& 0xf);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06683}06683                 bzero((\textcolor{keywordtype}{void} *)p, pad);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06684}06684 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06685}06685                 usgl = (\textcolor{keywordtype}{void} *)(p + pad);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06686}06686                 usgl-\/>\mbox{\hyperlink{structulptx__sgl_aa82b0d8beab5a9d388294911861cceb6}{cmd\_nsge}} = htobe32(\mbox{\hyperlink{t4__msg_8h_a8e732b552c603b4a2af575b5b74855bc}{V\_ULPTX\_CMD}}(\mbox{\hyperlink{t4__msg_8h_af3520ff6d43011872bab77edd27d4de3a1394a176dbd07d3545dbb21446c79699}{ULP\_TX\_SC\_DSGL}}) |}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06687}06687                     \mbox{\hyperlink{t4__msg_8h_aaa6ddba32797974de4d63a6b1faab60e}{V\_ULPTX\_NSGE}}(nsegs));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06688}06688 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06689}06689                 sglist\_init(\&sg, nitems(segs), segs);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06690}06690                 \textcolor{keywordflow}{for} (; m0 != NULL; m0 = m0-\/>m\_next) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06691}06691                         \textcolor{keywordflow}{if} (\_\_predict\_false(m0-\/>m\_len == 0))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06692}06692                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06693}06693                         \textcolor{keywordflow}{if} (immhdrs >= m0-\/>m\_len) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06694}06694                                 immhdrs -\/= m0-\/>m\_len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06695}06695                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06696}06696                         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06697}06697                         \textcolor{keywordflow}{if} (m0-\/>m\_flags \& M\_EXTPG)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06698}06698                                 sglist\_append\_mbuf\_epg(\&sg, m0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06699}06699                                     mtod(m0, vm\_offset\_t), m0-\/>m\_len);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06700}06700                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06701}06701                                 sglist\_append(\&sg, mtod(m0, \textcolor{keywordtype}{char} *) + immhdrs,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06702}06702                                     m0-\/>m\_len -\/ immhdrs);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06703}06703                         immhdrs = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06704}06704                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06705}06705                 MPASS(sg.sg\_nseg == nsegs);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06706}06706 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06707}06707                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06708}06708 \textcolor{comment}{                 * Zero pad last 8B in case the WR doesn't end on a 16B}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06709}06709 \textcolor{comment}{                 * boundary.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06710}06710 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06711}06711                 *(uint64\_t *)((\textcolor{keywordtype}{char} *)wr + len16 * 16 -\/ 8) = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06712}06712 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06713}06713                 usgl-\/>\mbox{\hyperlink{structulptx__sgl_a661ce1fc091107e1174fe470c7f272c1}{len0}} = htobe32(segs[0].\mbox{\hyperlink{adapter_8h_a85068f8f79a0c0162bf2f39ae67a9b64}{ss\_len}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06714}06714                 usgl-\/>\mbox{\hyperlink{structulptx__sgl_adb5a2b005ebc88282f4c4fb1246258b5}{addr0}} = htobe64(segs[0].ss\_paddr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06715}06715                 \textcolor{keywordflow}{for} (i = 0; i < nsegs -\/ 1; i++) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06716}06716                         usgl-\/>\mbox{\hyperlink{structulptx__sgl_a0f7d647dae4107702dce67bc21b81294}{sge}}[i / 2].\mbox{\hyperlink{structulptx__sge__pair_a93d8d32da5663dd19a6fe64330796502}{len}}[i \& 1] = htobe32(segs[i + 1].\mbox{\hyperlink{adapter_8h_a85068f8f79a0c0162bf2f39ae67a9b64}{ss\_len}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06717}06717                         usgl-\/>\mbox{\hyperlink{structulptx__sgl_a0f7d647dae4107702dce67bc21b81294}{sge}}[i / 2].\mbox{\hyperlink{structulptx__sge__pair_a81d80aebcdde2354c272cb0a37f63e84}{addr}}[i \& 1] = htobe64(segs[i + 1].ss\_paddr);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06718}06718                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06719}06719                 \textcolor{keywordflow}{if} (i \& 1)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06720}06720                         usgl-\/>\mbox{\hyperlink{structulptx__sgl_a0f7d647dae4107702dce67bc21b81294}{sge}}[i / 2].\mbox{\hyperlink{structulptx__sge__pair_a93d8d32da5663dd19a6fe64330796502}{len}}[1] = htobe32(0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06721}06721         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06722}06722 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06723}06723 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06724}06724 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06725}06725 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06726}06726 ethofld\_tx(\textcolor{keyword}{struct} \mbox{\hyperlink{structcxgbe__rate__tag}{cxgbe\_rate\_tag}} *cst)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06727}06727 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06728}06728         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06729}06729         \textcolor{keyword}{struct }\mbox{\hyperlink{structwrq__cookie}{wrq\_cookie}} cookie;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06730}06730         \textcolor{keywordtype}{int} next\_credits, compl;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06731}06731         \textcolor{keyword}{struct }\mbox{\hyperlink{structfw__eth__tx__eo__wr}{fw\_eth\_tx\_eo\_wr}} *wr;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06732}06732 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06733}06733         mtx\_assert(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a24136f11a1bcd83749a45c0d48769324}{lock}}, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06734}06734 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06735}06735         \textcolor{keywordflow}{while} ((m = mbufq\_first(\&cst-\/>pending\_tx)) != NULL) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06736}06736                 M\_ASSERTPKTHDR(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06737}06737 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06738}06738                 \textcolor{comment}{/* How many len16 credits do we need to send this mbuf. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06739}06739                 next\_credits = mbuf\_eo\_len16(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06740}06740                 MPASS(next\_credits > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06741}06741                 \textcolor{keywordflow}{if} (next\_credits > cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aafc9d7516f2ae12b9200382989ce7d4a}{tx\_credits}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06742}06742                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06743}06743 \textcolor{comment}{                         * Tx will make progress eventually because there is at}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06744}06744 \textcolor{comment}{                         * least one outstanding fw4\_ack that will return}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06745}06745 \textcolor{comment}{                         * credits and kick the tx.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06746}06746 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06747}06747                         MPASS(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_ab920d95e3ca8e502408736e9eaf92ecc}{ncompl}} > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06748}06748                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06749}06749                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06750}06750                 wr = \mbox{\hyperlink{t4__sge_8c_ad86cf314f5368b406537a2ea86922004}{start\_wrq\_wr}}(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_abfdef0678774760ed12e0436b95929a1}{eo\_txq}}-\/>\mbox{\hyperlink{structsge__ofld__txq_aa609cd3b3ea709a9c9534a1d911f1495}{wrq}}, next\_credits, \&cookie);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06751}06751                 \textcolor{keywordflow}{if} (\_\_predict\_false(wr == NULL)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06752}06752                         \textcolor{comment}{/* XXX: wishful thinking, not a real assertion. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06753}06753                         MPASS(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_ab920d95e3ca8e502408736e9eaf92ecc}{ncompl}} > 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06754}06754                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06755}06755                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06756}06756                 cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aafc9d7516f2ae12b9200382989ce7d4a}{tx\_credits}} -\/= next\_credits;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06757}06757                 cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_abb500e581f5a624d78dcdcd1a11b13a5}{tx\_nocompl}} += next\_credits;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06758}06758                 compl = cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_ab920d95e3ca8e502408736e9eaf92ecc}{ncompl}} == 0 || cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_abb500e581f5a624d78dcdcd1a11b13a5}{tx\_nocompl}} >= cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a73e5b3ae092a592db5d76157f0dd9318}{tx\_total}} / 2;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06759}06759                 ETHER\_BPF\_MTAP(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a813a19ae2b58185794fbb805ba9e7ad7}{com}}.ifp, m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06760}06760                 write\_ethofld\_wr(cst, wr, m, compl);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06761}06761                 \mbox{\hyperlink{t4__sge_8c_a54d3b4bac7a164bc0a0073290549b121}{commit\_wrq\_wr}}(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_abfdef0678774760ed12e0436b95929a1}{eo\_txq}}-\/>\mbox{\hyperlink{structsge__ofld__txq_aa609cd3b3ea709a9c9534a1d911f1495}{wrq}}, wr, \&cookie);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06762}06762                 \textcolor{keywordflow}{if} (compl) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06763}06763                         cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_ab920d95e3ca8e502408736e9eaf92ecc}{ncompl}}++;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06764}06764                         cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_abb500e581f5a624d78dcdcd1a11b13a5}{tx\_nocompl}}       = 0;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06765}06765                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06766}06766                 (void) mbufq\_dequeue(\&cst-\/>pending\_tx);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06767}06767 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06768}06768                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06769}06769 \textcolor{comment}{                 * Drop the mbuf's reference on the tag now rather}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06770}06770 \textcolor{comment}{                 * than waiting until m\_freem().  This ensures that}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06771}06771 \textcolor{comment}{                 * cxgbe\_rate\_tag\_free gets called when the inp drops}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06772}06772 \textcolor{comment}{                 * its reference on the tag and there are no more}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06773}06773 \textcolor{comment}{                 * mbufs in the pending\_tx queue and can flush any}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06774}06774 \textcolor{comment}{                 * pending requests.  Otherwise if the last mbuf}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06775}06775 \textcolor{comment}{                 * doesn't request a completion the etid will never be}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06776}06776 \textcolor{comment}{                 * released.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06777}06777 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06778}06778                 m-\/>m\_pkthdr.snd\_tag = NULL;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06779}06779                 m-\/>m\_pkthdr.csum\_flags \&= \string~CSUM\_SND\_TAG;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06780}06780                 m\_snd\_tag\_rele(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a813a19ae2b58185794fbb805ba9e7ad7}{com}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06781}06781 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06782}06782                 mbufq\_enqueue(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_af1b77a568e4925f8c7b7880e019e1e8f}{pending\_fwack}}, m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06783}06783         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06784}06784 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06785}06785 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06786}06786 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06787}06787 ethofld\_transmit(\textcolor{keyword}{struct} ifnet *\mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}, \textcolor{keyword}{struct} mbuf *m0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06788}06788 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06789}06789         \textcolor{keyword}{struct }\mbox{\hyperlink{structcxgbe__rate__tag}{cxgbe\_rate\_tag}} *cst;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06790}06790         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06791}06791 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06792}06792         MPASS(m0-\/>m\_nextpkt == NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06793}06793         MPASS(m0-\/>m\_pkthdr.csum\_flags \& CSUM\_SND\_TAG);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06794}06794         MPASS(m0-\/>m\_pkthdr.snd\_tag != NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06795}06795         cst = \mbox{\hyperlink{offload_8h_ab49e64bcf7a7ad14e8cebcec0ed6bc6a}{mst\_to\_crt}}(m0-\/>m\_pkthdr.snd\_tag);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06796}06796 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06797}06797         mtx\_lock(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a24136f11a1bcd83749a45c0d48769324}{lock}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06798}06798         MPASS(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aaac93093ecef15ad2ee2fd65f728a8bb}{flags}} \& \mbox{\hyperlink{offload_8h_a1b70d876770ccff427513794d6b0b2a7aa068a927265443561114fdf902886d0f}{EO\_SND\_TAG\_REF}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06799}06799 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06800}06800         \textcolor{keywordflow}{if} (\_\_predict\_false(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aaac93093ecef15ad2ee2fd65f728a8bb}{flags}} \& \mbox{\hyperlink{offload_8h_a1b70d876770ccff427513794d6b0b2a7a87b3edfaeb395f43fa5322ce706315cf}{EO\_FLOWC\_PENDING}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06801}06801                 \textcolor{keyword}{struct }\mbox{\hyperlink{structvi__info}{vi\_info}} *vi = \mbox{\hyperlink{adapter_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06802}06802                 \textcolor{keyword}{struct }\mbox{\hyperlink{structport__info}{port\_info}} *pi = \mbox{\hyperlink{structport__info_ad2b72407fdf992f1a96ddb0086b77760}{vi}}-\/>\mbox{\hyperlink{structvi__info_ae67f2a0e25008a327df0e02be08b5906}{pi}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06803}06803                 \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = pi-\/>\mbox{\hyperlink{structport__info_aba648614041df46933c83c56ec849d33}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06804}06804                 \textcolor{keyword}{const} uint32\_t rss\_mask = vi-\/>\mbox{\hyperlink{structvi__info_ac8074d61452c003ccf46c5c899e3901d}{rss\_size}} -\/ 1;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06805}06805                 uint32\_t rss\_hash;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06806}06806 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06807}06807                 cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_abfdef0678774760ed12e0436b95929a1}{eo\_txq}} = \&sc-\/>\mbox{\hyperlink{structadapter_accc81620095a4f3c873756327c3e8190}{sge}}.\mbox{\hyperlink{structsge_af2de6ebec43a09467ba00438b8ad55f9}{ofld\_txq}}[vi-\/>\mbox{\hyperlink{structvi__info_a9592c85bd46fd780671c2ea1631ebdec}{first\_ofld\_txq}}];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06808}06808                 \textcolor{keywordflow}{if} (M\_HASHTYPE\_ISHASH(m0))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06809}06809                         rss\_hash = m0-\/>m\_pkthdr.flowid;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06810}06810                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06811}06811                         rss\_hash = arc4random();}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06812}06812                 \textcolor{comment}{/* We assume RSS hashing */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06813}06813                 cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a4ef73ba1ffd93263a0f3d40ae5d0facb}{iqid}} = vi-\/>\mbox{\hyperlink{structvi__info_a09a3f23cd91f6e20dc590749b97d586d}{rss}}[rss\_hash \& rss\_mask];}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06814}06814                 cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_abfdef0678774760ed12e0436b95929a1}{eo\_txq}} += rss\_hash \% vi-\/>\mbox{\hyperlink{structvi__info_a39dc30c886ce9e18e6dfd44224ae066b}{nofldtxq}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06815}06815                 rc = send\_etid\_flowc\_wr(cst, pi, vi);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06816}06816                 \textcolor{keywordflow}{if} (rc != 0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06817}06817                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06818}06818         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06819}06819 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06820}06820         \textcolor{keywordflow}{if} (\_\_predict\_false(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a1cac33d22a5d609d715ae4d415943635}{plen}} + m0-\/>m\_pkthdr.len > eo\_max\_backlog)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06821}06821                 rc = ENOBUFS;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06822}06822                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06823}06823         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06824}06824 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06825}06825         mbufq\_enqueue(\&cst-\/>pending\_tx, m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06826}06826         cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a1cac33d22a5d609d715ae4d415943635}{plen}} += m0-\/>m\_pkthdr.len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06827}06827 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06828}06828         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06829}06829 \textcolor{comment}{         * Hold an extra reference on the tag while generating work}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06830}06830 \textcolor{comment}{         * requests to ensure that we don't try to free the tag during}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06831}06831 \textcolor{comment}{         * ethofld\_tx() in case we are sending the final mbuf after}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06832}06832 \textcolor{comment}{         * the inp was freed.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06833}06833 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06834}06834         m\_snd\_tag\_ref(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a813a19ae2b58185794fbb805ba9e7ad7}{com}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06835}06835         ethofld\_tx(cst);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06836}06836         mtx\_unlock(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a24136f11a1bcd83749a45c0d48769324}{lock}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06837}06837         m\_snd\_tag\_rele(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a813a19ae2b58185794fbb805ba9e7ad7}{com}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06838}06838         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06839}06839 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06840}06840 done:}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06841}06841         mtx\_unlock(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a24136f11a1bcd83749a45c0d48769324}{lock}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06842}06842         \textcolor{keywordflow}{if} (\_\_predict\_false(rc != 0))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06843}06843                 m\_freem(m0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06844}06844         \textcolor{keywordflow}{return} (rc);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06845}06845 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06846}06846 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06847}06847 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06848}06848 ethofld\_fw4\_ack(\textcolor{keyword}{struct} \mbox{\hyperlink{structsge__iq}{sge\_iq}} *\mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}, \textcolor{keyword}{const} \textcolor{keyword}{struct} \mbox{\hyperlink{structrss__header}{rss\_header}} *rss, \textcolor{keyword}{struct} mbuf *m0)}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06849}06849 \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06850}06850         \textcolor{keyword}{struct }\mbox{\hyperlink{structadapter}{adapter}} *sc = \mbox{\hyperlink{adapter_8h_ab285ab4f4153408d21e8cffed421a5d2}{iq}}-\/>\mbox{\hyperlink{structsge__iq_a62e77da9c2ffc57fc1cc462a785f6fce}{adapter}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06851}06851         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structcpl__fw4__ack}{cpl\_fw4\_ack}} *cpl = (\textcolor{keyword}{const} \textcolor{keywordtype}{void} *)(rss + 1);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06852}06852         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06853}06853         u\_int etid = \mbox{\hyperlink{t4__msg_8h_aa99487b2f861287f902036872616679e}{G\_CPL\_FW4\_ACK\_FLOWID}}(be32toh(\mbox{\hyperlink{t4__msg_8h_a81700cbe96e8b2bb960f800be2958ed1}{OPCODE\_TID}}(cpl)));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06854}06854         \textcolor{keyword}{struct }\mbox{\hyperlink{structcxgbe__rate__tag}{cxgbe\_rate\_tag}} *cst;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06855}06855         uint8\_t credits = cpl-\/>\mbox{\hyperlink{structcpl__fw4__ack_a7c0e5b02456384751e8a09d57e308291}{credits}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06856}06856 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06857}06857         cst = lookup\_etid(sc, \mbox{\hyperlink{structcxgbe__rate__tag_af28daaa59b44a12f91b3b21f19ef3562}{etid}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06858}06858         mtx\_lock(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a24136f11a1bcd83749a45c0d48769324}{lock}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06859}06859         \textcolor{keywordflow}{if} (\_\_predict\_false(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aaac93093ecef15ad2ee2fd65f728a8bb}{flags}} \& \mbox{\hyperlink{offload_8h_a1b70d876770ccff427513794d6b0b2a7ac35400930847cf8e67d141c397eb8448}{EO\_FLOWC\_RPL\_PENDING}})) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06860}06860                 MPASS(credits >= ETID\_FLOWC\_LEN16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06861}06861                 credits -\/= ETID\_FLOWC\_LEN16;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06862}06862                 cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aaac93093ecef15ad2ee2fd65f728a8bb}{flags}} \&= \string~EO\_FLOWC\_RPL\_PENDING;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06863}06863         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06864}06864 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06865}06865         KASSERT(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_ab920d95e3ca8e502408736e9eaf92ecc}{ncompl}} > 0,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06866}06866             (\textcolor{stringliteral}{"{}\%s: etid \%u (\%p) wasn't expecting completion."{}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06867}06867             \_\_func\_\_, \mbox{\hyperlink{structcxgbe__rate__tag_af28daaa59b44a12f91b3b21f19ef3562}{etid}}, cst));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06868}06868         cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_ab920d95e3ca8e502408736e9eaf92ecc}{ncompl}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06869}06869 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06870}06870         \textcolor{keywordflow}{while} (credits > 0) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06871}06871                 m = mbufq\_dequeue(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_af1b77a568e4925f8c7b7880e019e1e8f}{pending\_fwack}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06872}06872                 \textcolor{keywordflow}{if} (\_\_predict\_false(m == NULL)) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06873}06873                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06874}06874 \textcolor{comment}{                         * The remaining credits are for the final flush that}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06875}06875 \textcolor{comment}{                         * was issued when the tag was freed by the kernel.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06876}06876 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06877}06877                         MPASS((cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aaac93093ecef15ad2ee2fd65f728a8bb}{flags}} \&}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06878}06878                             (\mbox{\hyperlink{offload_8h_a1b70d876770ccff427513794d6b0b2a7af050e6fcfcf7fcf24ab7cd7b5c9fb576}{EO\_FLUSH\_RPL\_PENDING}} | \mbox{\hyperlink{offload_8h_a1b70d876770ccff427513794d6b0b2a7aa068a927265443561114fdf902886d0f}{EO\_SND\_TAG\_REF}})) ==}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06879}06879                             \mbox{\hyperlink{offload_8h_a1b70d876770ccff427513794d6b0b2a7af050e6fcfcf7fcf24ab7cd7b5c9fb576}{EO\_FLUSH\_RPL\_PENDING}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06880}06880                         MPASS(credits == ETID\_FLUSH\_LEN16);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06881}06881                         MPASS(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aafc9d7516f2ae12b9200382989ce7d4a}{tx\_credits}} + cpl-\/>\mbox{\hyperlink{structcpl__fw4__ack_a7c0e5b02456384751e8a09d57e308291}{credits}} == cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a73e5b3ae092a592db5d76157f0dd9318}{tx\_total}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06882}06882                         MPASS(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_ab920d95e3ca8e502408736e9eaf92ecc}{ncompl}} == 0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06883}06883 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06884}06884                         cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aaac93093ecef15ad2ee2fd65f728a8bb}{flags}} \&= \string~EO\_FLUSH\_RPL\_PENDING;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06885}06885                         cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aafc9d7516f2ae12b9200382989ce7d4a}{tx\_credits}} += cpl-\/>\mbox{\hyperlink{structcpl__fw4__ack_a7c0e5b02456384751e8a09d57e308291}{credits}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06886}06886                         cxgbe\_rate\_tag\_free\_locked(cst);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06887}06887                         \textcolor{keywordflow}{return} (0);     \textcolor{comment}{/* cst is gone. */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06888}06888                 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06889}06889                 KASSERT(m != NULL,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06890}06890                     (\textcolor{stringliteral}{"{}\%s: too many credits (\%u, \%u)"{}}, \_\_func\_\_, cpl-\/>\mbox{\hyperlink{structcpl__fw4__ack_a7c0e5b02456384751e8a09d57e308291}{credits}},}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06891}06891                     credits));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06892}06892                 KASSERT(credits >= mbuf\_eo\_len16(m),}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06893}06893                     (\textcolor{stringliteral}{"{}\%s: too few credits (\%u, \%u, \%u)"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06894}06894                     cpl-\/>\mbox{\hyperlink{structcpl__fw4__ack_a7c0e5b02456384751e8a09d57e308291}{credits}}, credits, mbuf\_eo\_len16(m)));}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06895}06895                 credits -\/= mbuf\_eo\_len16(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06896}06896                 cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a1cac33d22a5d609d715ae4d415943635}{plen}} -\/= m-\/>m\_pkthdr.len;}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06897}06897                 m\_freem(m);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06898}06898         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06899}06899 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06900}06900         cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aafc9d7516f2ae12b9200382989ce7d4a}{tx\_credits}} += cpl-\/>\mbox{\hyperlink{structcpl__fw4__ack_a7c0e5b02456384751e8a09d57e308291}{credits}};}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06901}06901         MPASS(cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aafc9d7516f2ae12b9200382989ce7d4a}{tx\_credits}} <= cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a73e5b3ae092a592db5d76157f0dd9318}{tx\_total}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06902}06902 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06903}06903         \textcolor{keywordflow}{if} (cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aaac93093ecef15ad2ee2fd65f728a8bb}{flags}} \& \mbox{\hyperlink{offload_8h_a1b70d876770ccff427513794d6b0b2a7aa068a927265443561114fdf902886d0f}{EO\_SND\_TAG\_REF}}) \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06904}06904                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06905}06905 \textcolor{comment}{                 * As with ethofld\_transmit(), hold an extra reference}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06906}06906 \textcolor{comment}{                 * so that the tag is stable across ethold\_tx().}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06907}06907 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06908}06908                 m\_snd\_tag\_ref(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a813a19ae2b58185794fbb805ba9e7ad7}{com}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06909}06909                 m = mbufq\_first(\&cst-\/>pending\_tx);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06910}06910                 \textcolor{keywordflow}{if} (m != NULL \&\& cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_aafc9d7516f2ae12b9200382989ce7d4a}{tx\_credits}} >= mbuf\_eo\_len16(m))}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06911}06911                         ethofld\_tx(cst);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06912}06912                 mtx\_unlock(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a24136f11a1bcd83749a45c0d48769324}{lock}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06913}06913                 m\_snd\_tag\_rele(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a813a19ae2b58185794fbb805ba9e7ad7}{com}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06914}06914         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06915}06915                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06916}06916 \textcolor{comment}{                 * There shouldn't be any pending packets if the tag}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06917}06917 \textcolor{comment}{                 * was freed by the kernel since any pending packet}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06918}06918 \textcolor{comment}{                 * should hold a reference to the tag.}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06919}06919 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06920}06920                 MPASS(mbufq\_first(\&cst-\/>pending\_tx) == NULL);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06921}06921                 mtx\_unlock(\&cst-\/>\mbox{\hyperlink{structcxgbe__rate__tag_a24136f11a1bcd83749a45c0d48769324}{lock}});}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06922}06922         \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06923}06923 }
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06924}06924         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06925}06925 \}}
\DoxyCodeLine{\Hypertarget{t4__sge_8c_source_l06926}06926 \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
