\hypertarget{lio__request__manager_8c_source}{}\doxysection{lio\+\_\+request\+\_\+manager.\+c}
\label{lio__request__manager_8c_source}\index{dev/liquidio/base/lio\_request\_manager.c@{dev/liquidio/base/lio\_request\_manager.c}}
\mbox{\hyperlink{lio__request__manager_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00001}00001 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00002}00002 \textcolor{comment}{ *   BSD LICENSE}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00004}00004 \textcolor{comment}{ *   Copyright(c) 2017 Cavium, Inc.. All rights reserved.}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00005}00005 \textcolor{comment}{ *   All rights reserved.}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00007}00007 \textcolor{comment}{ *   Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00008}00008 \textcolor{comment}{ *   modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00009}00009 \textcolor{comment}{ *   are met:}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00011}00011 \textcolor{comment}{ *     * Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00012}00012 \textcolor{comment}{ *       notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00013}00013 \textcolor{comment}{ *     * Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00014}00014 \textcolor{comment}{ *       notice, this list of conditions and the following disclaimer in}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00015}00015 \textcolor{comment}{ *       the documentation and/or other materials provided with the}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00016}00016 \textcolor{comment}{ *       distribution.}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00017}00017 \textcolor{comment}{ *     * Neither the name of Cavium, Inc. nor the names of its}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00018}00018 \textcolor{comment}{ *       contributors may be used to endorse or promote products derived}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00019}00019 \textcolor{comment}{ *       from this software without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00020}00020 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00021}00021 \textcolor{comment}{ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00022}00022 \textcolor{comment}{ *   "{}AS IS"{} AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00023}00023 \textcolor{comment}{ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00024}00024 \textcolor{comment}{ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00025}00025 \textcolor{comment}{ *   OWNER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00026}00026 \textcolor{comment}{ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00027}00027 \textcolor{comment}{ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00028}00028 \textcolor{comment}{ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00029}00029 \textcolor{comment}{ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00030}00030 \textcolor{comment}{ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00031}00031 \textcolor{comment}{ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00032}00032 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00033}00033 \textcolor{comment}{/*\$FreeBSD\$*/}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00035}00035 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__bsd_8h}{lio\_bsd.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00036}00036 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__common_8h}{lio\_common.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00037}00037 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__droq_8h}{lio\_droq.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00038}00038 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__iq_8h}{lio\_iq.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00039}00039 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__response__manager_8h}{lio\_response\_manager.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00040}00040 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__device_8h}{lio\_device.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00041}00041 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__main_8h}{lio\_main.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00042}00042 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__network_8h}{lio\_network.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00043}00043 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{cn23xx__pf__device_8h}{cn23xx\_pf\_device.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00044}00044 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__rxtx_8h}{lio\_rxtx.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00045}00045 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00046}\mbox{\hyperlink{structlio__iq__post__status}{00046}} \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__iq__post__status}{lio\_iq\_post\_status}} \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00047}\mbox{\hyperlink{structlio__iq__post__status_a067d37e81147f4c35832a005516a5c8a}{00047}}         \textcolor{keywordtype}{int}     \mbox{\hyperlink{structlio__iq__post__status_a067d37e81147f4c35832a005516a5c8a}{status}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00048}\mbox{\hyperlink{structlio__iq__post__status_a5c4c00cc907835aef2fa2215b3f2a461}{00048}}         \textcolor{keywordtype}{int}     \mbox{\hyperlink{structlio__iq__post__status_a5c4c00cc907835aef2fa2215b3f2a461}{index}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00049}00049 \};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00051}00051 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{lio__request__manager_8c_a48de570fc922e0109f3566242e029e29}{lio\_check\_db\_timeout}}(\textcolor{keywordtype}{void} *arg, \textcolor{keywordtype}{int} pending);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00052}00052 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{lio__request__manager_8c_adf9ad9cce887a9740c0eb549c222e498}{\_\_lio\_check\_db\_timeout}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00053}00053                                        uint64\_t iq\_no);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00055}00055 \textcolor{comment}{/* Return 0 on success, 1 on failure */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00056}00056 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00057}\mbox{\hyperlink{lio__iq_8h_a7cfbfc0650995b3568ad6a87bb737cbd}{00057}} \mbox{\hyperlink{lio__request__manager_8c_a4e6d2d98b4d7696957fdf21f92a70fed}{lio\_init\_instr\_queue}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, \textcolor{keyword}{union} \mbox{\hyperlink{unionocteon__txpciq}{octeon\_txpciq}} txpciq,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00058}00058                      uint32\_t num\_descs)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00059}00059 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00060}00060         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__instr__queue}{lio\_instr\_queue}}   *iq;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00061}00061         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__iq__config}{lio\_iq\_config}}       *conf = NULL;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00062}00062         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__tq}{lio\_tq}}             *db\_tq;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00063}00063         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__request__list}{lio\_request\_list}} *request\_buf;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00064}00064         bus\_size\_t              max\_size;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00065}00065         uint32\_t                iq\_no = (uint32\_t)txpciq.\mbox{\hyperlink{unionocteon__txpciq_a6d4c2fdb74975a61c5ff707a70b8b277}{s}}.\mbox{\hyperlink{unionocteon__txpciq_a036a1f65fa239c8b4dbdcca730c8e47a}{q\_no}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00066}00066         uint32\_t                q\_size;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00067}00067         \textcolor{keywordtype}{int}                     error, i;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00068}00068 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00069}00069         if (\mbox{\hyperlink{lio__device_8h_a6d886e3e4427e03cb0c9b3bed8ee8728}{LIO\_CN23XX\_PF}}(oct))}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00070}00070                 conf = \&(\mbox{\hyperlink{lio__config_8h_a8ea03374d31f7ec8669950f73d2b698e}{LIO\_GET\_IQ\_CFG}}(\mbox{\hyperlink{lio__device_8h_a5100c1d00094791cc657d811578b35db}{LIO\_CHIP\_CONF}}(oct, cn23xx\_pf)));}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00071}00071         \textcolor{keywordflow}{if} (conf == NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00072}00072                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}Unsupported Chip \%x\(\backslash\)n"{}}, oct-\/>\mbox{\hyperlink{structocteon__device_a802673a741d5580468a49ebadc729af9}{chip\_id}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00073}00073                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00074}00074         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00076}00076         q\_size = (uint32\_t)conf-\/>\mbox{\hyperlink{structlio__iq__config_afd9018688f56afb71a1f7e1531fa8f13}{instr\_type}} * num\_descs;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00077}00077         iq = oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[iq\_no];}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00078}00078         iq-\/>\mbox{\hyperlink{structlio__instr__queue_a93a4882d7471320902b3445ee35f1a88}{oct\_dev}} = oct;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00079}00079 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00080}00080         max\_size = \mbox{\hyperlink{lio__config_8h_a9432805f1e787c2fc87a8ad8ee42c709}{LIO\_CN23XX\_PKI\_MAX\_FRAME\_SIZE}} * num\_descs;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00082}00082         error = bus\_dma\_tag\_create(bus\_get\_dma\_tag(oct-\/>\mbox{\hyperlink{structocteon__device_a2d1f835586ad43c0e0be46da81cd0f3c}{device}}),  \textcolor{comment}{/* parent */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00083}00083                                    1, 0,                                \textcolor{comment}{/* alignment, bounds */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00084}00084                                    BUS\_SPACE\_MAXADDR,                   \textcolor{comment}{/* lowaddr */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00085}00085                                    BUS\_SPACE\_MAXADDR,                   \textcolor{comment}{/* highaddr */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00086}00086                                    NULL, NULL,                          \textcolor{comment}{/* filter, filterarg */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00087}00087                                    max\_size,                            \textcolor{comment}{/* maxsize */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00088}00088                                    \mbox{\hyperlink{lio__network_8h_aa52cb75819e079f0cc21d14f42af60b0}{LIO\_MAX\_SG}},                                \textcolor{comment}{/* nsegments */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00089}00089                                    PAGE\_SIZE,                           \textcolor{comment}{/* maxsegsize */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00090}00090                                    0,                                   \textcolor{comment}{/* flags */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00091}00091                                    NULL,                                \textcolor{comment}{/* lockfunc */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00092}00092                                    NULL,                                \textcolor{comment}{/* lockfuncarg */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00093}00093                                    \&iq-\/>\mbox{\hyperlink{structlio__instr__queue_abe0999a1b9ad355655c815c85eefd061}{txtag}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00094}00094         \textcolor{keywordflow}{if} (error) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00095}00095                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}Cannot allocate memory for instr queue \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00096}00096                             iq\_no);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00097}00097                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00098}00098         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00099}00099 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00100}00100         iq-\/>\mbox{\hyperlink{structlio__instr__queue_a352264619cfcb0f84542717aeec26e38}{base\_addr}} = \mbox{\hyperlink{lio__network_8h_a5cadbb52714f0c4c6eb2f61ff06a4a52}{lio\_dma\_alloc}}(q\_size, (vm\_paddr\_t *)\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_a0b99fe6257fd909148240bf295b82501}{base\_addr\_dma}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00101}00101         \textcolor{keywordflow}{if} (!iq-\/>\mbox{\hyperlink{structlio__instr__queue_a352264619cfcb0f84542717aeec26e38}{base\_addr}}) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00102}00102                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}Cannot allocate memory for instr queue \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00103}00103                             iq\_no);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00104}00104                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00105}00105         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00106}00106 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00107}00107         iq-\/>\mbox{\hyperlink{structlio__instr__queue_aacc240455d509d0f895ff0cefa62ec16}{max\_count}} = num\_descs;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00109}00109         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00110}00110 \textcolor{comment}{         * Initialize a list to holds requests that have been posted to}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00111}00111 \textcolor{comment}{         * Octeon but has yet to be fetched by octeon}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00112}00112 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00113}00113         iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4e5bff40aeeea3e15a6624aecee178ea}{request\_list}} = malloc(\textcolor{keyword}{sizeof}(*iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4e5bff40aeeea3e15a6624aecee178ea}{request\_list}}) * num\_descs,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00114}00114                                   M\_DEVBUF, M\_NOWAIT | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00115}00115         \textcolor{keywordflow}{if} (iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4e5bff40aeeea3e15a6624aecee178ea}{request\_list}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00116}00116                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}Alloc failed for IQ[\%d] nr free list\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00117}00117                             iq\_no);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00118}00118                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00119}00119         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00121}00121         \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(oct, \textcolor{stringliteral}{"{}IQ[\%d]: base: \%p basedma: \%llx count: \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00122}00122                     iq\_no, iq-\/>\mbox{\hyperlink{structlio__instr__queue_a352264619cfcb0f84542717aeec26e38}{base\_addr}}, \mbox{\hyperlink{lio__main_8h_ae67a87eb5deeb31e550aa38dfa869505}{LIO\_CAST64}}(iq-\/>\mbox{\hyperlink{structlio__instr__queue_a0b99fe6257fd909148240bf295b82501}{base\_addr\_dma}}),}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00123}00123                     iq-\/>\mbox{\hyperlink{structlio__instr__queue_aacc240455d509d0f895ff0cefa62ec16}{max\_count}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00124}00124 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00125}00125         \textcolor{comment}{/* Create the descriptor buffer dma maps */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00126}00126         request\_buf = iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4e5bff40aeeea3e15a6624aecee178ea}{request\_list}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00127}00127         \textcolor{keywordflow}{for} (i = 0; i < num\_descs; i++, request\_buf++) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00128}00128                 error = bus\_dmamap\_create(iq-\/>\mbox{\hyperlink{structlio__instr__queue_abe0999a1b9ad355655c815c85eefd061}{txtag}}, 0, \&request\_buf-\/>\mbox{\hyperlink{structlio__request__list_a485e722002f5ce766f41e9947b56726b}{map}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00129}00129                 \textcolor{keywordflow}{if} (error) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00130}00130                         \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}Unable to create TX DMA map\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00131}00131                         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00132}00132                 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00133}00133         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00134}00134 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00135}00135         iq-\/>\mbox{\hyperlink{structlio__instr__queue_a0f80e25acea3c55a342c247a68038dec}{txpciq}}.\mbox{\hyperlink{unionocteon__txpciq_a250f69b890af54dabd4195fc0c9663b4}{txpciq64}} = txpciq.\mbox{\hyperlink{unionocteon__txpciq_a250f69b890af54dabd4195fc0c9663b4}{txpciq64}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00136}00136         iq-\/>\mbox{\hyperlink{structlio__instr__queue_a8b79a25fe03aae8b247b6b357bd2f499}{fill\_cnt}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00137}00137         iq-\/>\mbox{\hyperlink{structlio__instr__queue_ae41b850d5975e90e5d817eeacfa1d19e}{host\_write\_index}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00138}00138         iq-\/>\mbox{\hyperlink{structlio__instr__queue_a0018c29f49eb103d7247a4edd05ac9e4}{octeon\_read\_index}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00139}00139         iq-\/>\mbox{\hyperlink{structlio__instr__queue_a709e16cc840bcc752004517c429e0666}{flush\_index}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00140}00140         iq-\/>\mbox{\hyperlink{structlio__instr__queue_a3555c31a9990cd2523de71fccd404382}{last\_db\_time}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00141}00141         iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4261e2e3810f01eb8894e1adcafda6a8}{db\_timeout}} = (uint32\_t)conf-\/>\mbox{\hyperlink{structlio__iq__config_a16fb324feb386a9f022961ade4ff9ad4}{db\_timeout}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00142}00142         atomic\_store\_rel\_int(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_a2ba81d22f0552e9e2dab0dbed1c378b2}{instr\_pending}}, 0);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00143}00143 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00144}00144         \textcolor{comment}{/* Initialize the lock for this instruction queue */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00145}00145         mtx\_init(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_a2c7a4073945f78eec5cf43a652cb314f}{lock}}, \textcolor{stringliteral}{"{}Tx\_lock"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00146}00146         mtx\_init(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_a366d8e34b6bb0ca7591ecb6487c15fea}{post\_lock}}, \textcolor{stringliteral}{"{}iq\_post\_lock"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00147}00147         mtx\_init(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_aedf00f27438279abe25f4926facac1ef}{enq\_lock}}, \textcolor{stringliteral}{"{}enq\_lock"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00148}00148 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00149}00149         mtx\_init(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_ac5b2a9335c1e5a6e6ee201417d1e0d02}{iq\_flush\_running\_lock}}, \textcolor{stringliteral}{"{}iq\_flush\_running\_lock"{}}, NULL,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00150}00150                  MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00151}00151 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00152}00152         oct-\/>\mbox{\hyperlink{structocteon__device_a2572013042e73f339174c82cf587494c}{io\_qmask}}.\mbox{\hyperlink{structlio__io__enable_ac488befca84b2b1657e8d7044be22383}{iq}} |= \mbox{\hyperlink{lio__main_8h_aed42b76522e8377b3b0e77b64ee04fae}{BIT\_ULL}}(iq\_no);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00154}00154         \textcolor{comment}{/* Set the 32B/64B mode for each input queue */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00155}00155         oct-\/>\mbox{\hyperlink{structocteon__device_a2572013042e73f339174c82cf587494c}{io\_qmask}}.\mbox{\hyperlink{structlio__io__enable_a01fc51f9e4145c8fdd3381ad9a0ef877}{iq64B}} |= ((conf-\/>\mbox{\hyperlink{structlio__iq__config_afd9018688f56afb71a1f7e1531fa8f13}{instr\_type}} == 64) << iq\_no);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00156}00156         iq-\/>\mbox{\hyperlink{structlio__instr__queue_af6cb01a60fa855d01289da864d76a336}{iqcmd\_64B}} = (conf-\/>\mbox{\hyperlink{structlio__iq__config_afd9018688f56afb71a1f7e1531fa8f13}{instr\_type}} == 64);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00157}00157 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00158}00158         oct-\/>\mbox{\hyperlink{structocteon__device_a07eedda72ba39292f548957a394234dd}{fn\_list}}.\mbox{\hyperlink{structlio__fn__list_a432a42e669b9fc11e3946ac42d200035}{setup\_iq\_regs}}(oct, iq\_no);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00159}00159 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00160}00160         db\_tq = \&oct-\/>\mbox{\hyperlink{structocteon__device_adf7a907caa43a96ff8d6a49138f9dd07}{check\_db\_tq}}[iq\_no];}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00161}00161         db\_tq-\/>\mbox{\hyperlink{structlio__tq_a367b9bb34b913f264e45e286ccc9b499}{tq}} = taskqueue\_create(\textcolor{stringliteral}{"{}lio\_check\_db\_timeout"{}}, M\_WAITOK,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00162}00162                                      taskqueue\_thread\_enqueue, \&db\_tq-\/>\mbox{\hyperlink{structlio__tq_a367b9bb34b913f264e45e286ccc9b499}{tq}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00163}00163         \textcolor{keywordflow}{if} (db\_tq-\/>\mbox{\hyperlink{structlio__tq_a367b9bb34b913f264e45e286ccc9b499}{tq}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00164}00164                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}check db wq create failed for iq \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00165}00165                             iq\_no);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00166}00166                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00167}00167         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00168}00168 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00169}00169         TIMEOUT\_TASK\_INIT(db\_tq-\/>\mbox{\hyperlink{structlio__tq_a367b9bb34b913f264e45e286ccc9b499}{tq}}, \&db\_tq-\/>\mbox{\hyperlink{structlio__tq_a93a5d499ac3cec352a5bed558ec35168}{work}}, 0, \mbox{\hyperlink{lio__request__manager_8c_a48de570fc922e0109f3566242e029e29}{lio\_check\_db\_timeout}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00170}00170                           (\textcolor{keywordtype}{void} *)db\_tq);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00171}00171         db\_tq-\/>\mbox{\hyperlink{structlio__tq_addd0e9bb5478f06fafe1d13055893134}{ctxul}} = iq\_no;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00172}00172         db\_tq-\/>\mbox{\hyperlink{structlio__tq_a5770f6cc05773a63e58dd8f6ed1006af}{ctxptr}} = oct;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00173}00173 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00174}00174         taskqueue\_start\_threads(\&db\_tq-\/>\mbox{\hyperlink{structlio__tq_a367b9bb34b913f264e45e286ccc9b499}{tq}}, 1, PI\_NET,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00175}00175                                 \textcolor{stringliteral}{"{}lio\%d\_check\_db\_timeout:\%d"{}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00176}00176                                 oct-\/>\mbox{\hyperlink{structocteon__device_a6574a7bba62b9a35337dfe332ac83799}{octeon\_id}}, iq\_no);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00177}00177         taskqueue\_enqueue\_timeout(db\_tq-\/>\mbox{\hyperlink{structlio__tq_a367b9bb34b913f264e45e286ccc9b499}{tq}}, \&db\_tq-\/>\mbox{\hyperlink{structlio__tq_a93a5d499ac3cec352a5bed558ec35168}{work}}, 1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00178}00178 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00179}00179         \textcolor{comment}{/* Allocate a buf ring */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00180}00180         oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[iq\_no]-\/>\mbox{\hyperlink{structlio__instr__queue_ad8faf8e3254cabbbe74d35048cfd88a5}{br}} =}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00181}00181                 buf\_ring\_alloc(\mbox{\hyperlink{lio__config_8h_a4faf18e34c937d2c4c94abc7eddc128b}{LIO\_BR\_SIZE}}, M\_DEVBUF, M\_WAITOK,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00182}00182                                \&oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[iq\_no]-\/>\mbox{\hyperlink{structlio__instr__queue_aedf00f27438279abe25f4926facac1ef}{enq\_lock}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00183}00183         \textcolor{keywordflow}{if} (oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[iq\_no]-\/>\mbox{\hyperlink{structlio__instr__queue_ad8faf8e3254cabbbe74d35048cfd88a5}{br}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00184}00184                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}Critical Failure setting up buf ring\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00185}00185                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00186}00186         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00187}00187 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00188}00188         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00189}00189 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00190}00190 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00191}00191 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00192}\mbox{\hyperlink{lio__iq_8h_aa8e334609feb4119fcd037b89fc12298}{00192}} \mbox{\hyperlink{lio__request__manager_8c_ab5379cfe88c0dbf68e3f147dc18ba091}{lio\_delete\_instr\_queue}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, uint32\_t iq\_no)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00193}00193 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00194}00194         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__instr__queue}{lio\_instr\_queue}}           *iq = oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[iq\_no];}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00195}00195         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__request__list}{lio\_request\_list}}         *request\_buf;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00196}00196         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__mbuf__free__info}{lio\_mbuf\_free\_info}}     *finfo;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00197}00197         uint64\_t                        desc\_size = 0, q\_size;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00198}00198         \textcolor{keywordtype}{int}                             i;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00199}00199 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00200}00200         \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(oct, \textcolor{stringliteral}{"{}\%s[\%d]\(\backslash\)n"{}}, \_\_func\_\_, iq\_no);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00202}00202         \textcolor{keywordflow}{if} (oct-\/>\mbox{\hyperlink{structocteon__device_adf7a907caa43a96ff8d6a49138f9dd07}{check\_db\_tq}}[iq\_no].\mbox{\hyperlink{structlio__tq_a367b9bb34b913f264e45e286ccc9b499}{tq}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00203}00203                 \textcolor{keywordflow}{while} (taskqueue\_cancel\_timeout(oct-\/>\mbox{\hyperlink{structocteon__device_adf7a907caa43a96ff8d6a49138f9dd07}{check\_db\_tq}}[iq\_no].\mbox{\hyperlink{structlio__tq_a367b9bb34b913f264e45e286ccc9b499}{tq}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00204}00204                                                 \&oct-\/>\mbox{\hyperlink{structocteon__device_adf7a907caa43a96ff8d6a49138f9dd07}{check\_db\_tq}}[iq\_no].\mbox{\hyperlink{structlio__tq_a93a5d499ac3cec352a5bed558ec35168}{work}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00205}00205                                                 NULL))}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00206}00206                         taskqueue\_drain\_timeout(oct-\/>\mbox{\hyperlink{structocteon__device_adf7a907caa43a96ff8d6a49138f9dd07}{check\_db\_tq}}[iq\_no].\mbox{\hyperlink{structlio__tq_a367b9bb34b913f264e45e286ccc9b499}{tq}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00207}00207                                                 \&oct-\/>\mbox{\hyperlink{structocteon__device_adf7a907caa43a96ff8d6a49138f9dd07}{check\_db\_tq}}[iq\_no].\mbox{\hyperlink{structlio__tq_a93a5d499ac3cec352a5bed558ec35168}{work}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00208}00208                 taskqueue\_free(oct-\/>\mbox{\hyperlink{structocteon__device_adf7a907caa43a96ff8d6a49138f9dd07}{check\_db\_tq}}[iq\_no].\mbox{\hyperlink{structlio__tq_a367b9bb34b913f264e45e286ccc9b499}{tq}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00209}00209                 oct-\/>\mbox{\hyperlink{structocteon__device_adf7a907caa43a96ff8d6a49138f9dd07}{check\_db\_tq}}[iq\_no].\mbox{\hyperlink{structlio__tq_a367b9bb34b913f264e45e286ccc9b499}{tq}} = NULL;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00210}00210         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00211}00211 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00212}00212         \textcolor{keywordflow}{if} (\mbox{\hyperlink{lio__device_8h_a6d886e3e4427e03cb0c9b3bed8ee8728}{LIO\_CN23XX\_PF}}(oct))}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00213}00213                 desc\_size =}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00214}00214                     \mbox{\hyperlink{lio__config_8h_a6cd3ead62ad3d595c7c97bb624575a4d}{LIO\_GET\_IQ\_INSTR\_TYPE\_CFG}}(\mbox{\hyperlink{lio__device_8h_a5100c1d00094791cc657d811578b35db}{LIO\_CHIP\_CONF}}(oct, cn23xx\_pf));}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00215}00215 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00216}00216         request\_buf = iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4e5bff40aeeea3e15a6624aecee178ea}{request\_list}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00217}00217         \textcolor{keywordflow}{for} (i = 0; i < iq-\/>\mbox{\hyperlink{structlio__instr__queue_aacc240455d509d0f895ff0cefa62ec16}{max\_count}}; i++, request\_buf++) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00218}00218                 \textcolor{keywordflow}{if} ((request\_buf-\/>\mbox{\hyperlink{structlio__request__list_a1f3e4dd70f337e354058c11e4972388b}{reqtype}} == \mbox{\hyperlink{lio__iq_8h_a39c656cae9d6ced0d82d1a3ee980a472}{LIO\_REQTYPE\_NORESP\_NET}}) ||}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00219}00219                     (request\_buf-\/>\mbox{\hyperlink{structlio__request__list_a1f3e4dd70f337e354058c11e4972388b}{reqtype}} == \mbox{\hyperlink{lio__iq_8h_ae9a1a7ccae115012756db05cc36ade19}{LIO\_REQTYPE\_NORESP\_NET\_SG}})) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00220}00220                         \textcolor{keywordflow}{if} (request\_buf-\/>\mbox{\hyperlink{structlio__request__list_aaebfd6050d7e1644a8baf54771babbc9}{buf}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00221}00221                                 finfo = request\_buf-\/>\mbox{\hyperlink{structlio__request__list_aaebfd6050d7e1644a8baf54771babbc9}{buf}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00222}00222                                 bus\_dmamap\_sync(iq-\/>\mbox{\hyperlink{structlio__instr__queue_abe0999a1b9ad355655c815c85eefd061}{txtag}}, request\_buf-\/>\mbox{\hyperlink{structlio__request__list_a485e722002f5ce766f41e9947b56726b}{map}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00223}00223                                                 BUS\_DMASYNC\_POSTWRITE);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00224}00224                                 bus\_dmamap\_unload(iq-\/>\mbox{\hyperlink{structlio__instr__queue_abe0999a1b9ad355655c815c85eefd061}{txtag}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00225}00225                                                   request\_buf-\/>\mbox{\hyperlink{structlio__request__list_a485e722002f5ce766f41e9947b56726b}{map}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00226}00226                                 m\_freem(finfo-\/>\mbox{\hyperlink{structlio__mbuf__free__info_a8fd8ae090b47b0674bdf9b8a9c6f0f96}{mb}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00227}00227                                 request\_buf-\/>\mbox{\hyperlink{structlio__request__list_aaebfd6050d7e1644a8baf54771babbc9}{buf}} = NULL;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00228}00228                                 \textcolor{keywordflow}{if} (request\_buf-\/>\mbox{\hyperlink{structlio__request__list_a485e722002f5ce766f41e9947b56726b}{map}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00229}00229                                         bus\_dmamap\_destroy(iq-\/>\mbox{\hyperlink{structlio__instr__queue_abe0999a1b9ad355655c815c85eefd061}{txtag}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00230}00230                                                            request\_buf-\/>\mbox{\hyperlink{structlio__request__list_a485e722002f5ce766f41e9947b56726b}{map}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00231}00231                                         request\_buf-\/>\mbox{\hyperlink{structlio__request__list_a485e722002f5ce766f41e9947b56726b}{map}} = NULL;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00232}00232                                 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00233}00233                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (request\_buf-\/>\mbox{\hyperlink{structlio__request__list_a485e722002f5ce766f41e9947b56726b}{map}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00234}00234                                 bus\_dmamap\_unload(iq-\/>\mbox{\hyperlink{structlio__instr__queue_abe0999a1b9ad355655c815c85eefd061}{txtag}}, request\_buf-\/>\mbox{\hyperlink{structlio__request__list_a485e722002f5ce766f41e9947b56726b}{map}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00235}00235                                 bus\_dmamap\_destroy(iq-\/>\mbox{\hyperlink{structlio__instr__queue_abe0999a1b9ad355655c815c85eefd061}{txtag}}, request\_buf-\/>\mbox{\hyperlink{structlio__request__list_a485e722002f5ce766f41e9947b56726b}{map}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00236}00236                                 request\_buf-\/>\mbox{\hyperlink{structlio__request__list_a485e722002f5ce766f41e9947b56726b}{map}} = NULL;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00237}00237                         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00238}00238                 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00239}00239         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00241}00241         \textcolor{keywordflow}{if} (iq-\/>\mbox{\hyperlink{structlio__instr__queue_ad8faf8e3254cabbbe74d35048cfd88a5}{br}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00242}00242                 buf\_ring\_free(iq-\/>\mbox{\hyperlink{structlio__instr__queue_ad8faf8e3254cabbbe74d35048cfd88a5}{br}}, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00243}00243                 iq-\/>\mbox{\hyperlink{structlio__instr__queue_ad8faf8e3254cabbbe74d35048cfd88a5}{br}} = NULL;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00244}00244         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00245}00245 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00246}00246         \textcolor{keywordflow}{if} (iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4e5bff40aeeea3e15a6624aecee178ea}{request\_list}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00247}00247                 free(iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4e5bff40aeeea3e15a6624aecee178ea}{request\_list}}, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00248}00248                 iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4e5bff40aeeea3e15a6624aecee178ea}{request\_list}} = NULL;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00249}00249         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00250}00250 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00251}00251         \textcolor{keywordflow}{if} (iq-\/>\mbox{\hyperlink{structlio__instr__queue_abe0999a1b9ad355655c815c85eefd061}{txtag}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00252}00252                 bus\_dma\_tag\_destroy(iq-\/>\mbox{\hyperlink{structlio__instr__queue_abe0999a1b9ad355655c815c85eefd061}{txtag}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00253}00253                 iq-\/>\mbox{\hyperlink{structlio__instr__queue_abe0999a1b9ad355655c815c85eefd061}{txtag}} = NULL;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00254}00254         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00255}00255 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00256}00256         \textcolor{keywordflow}{if} (iq-\/>\mbox{\hyperlink{structlio__instr__queue_a352264619cfcb0f84542717aeec26e38}{base\_addr}}) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00257}00257                 q\_size = iq-\/>\mbox{\hyperlink{structlio__instr__queue_aacc240455d509d0f895ff0cefa62ec16}{max\_count}} * desc\_size;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00258}00258                 \mbox{\hyperlink{lio__network_8h_aa9eae17416dcdc92e8370166df882c34}{lio\_dma\_free}}((uint32\_t)q\_size, iq-\/>\mbox{\hyperlink{structlio__instr__queue_a352264619cfcb0f84542717aeec26e38}{base\_addr}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00259}00259 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00260}00260                 oct-\/>\mbox{\hyperlink{structocteon__device_a2572013042e73f339174c82cf587494c}{io\_qmask}}.\mbox{\hyperlink{structlio__io__enable_ac488befca84b2b1657e8d7044be22383}{iq}} \&= \string~(1ULL << iq\_no);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00261}00261                 bzero(oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[iq\_no], \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlio__instr__queue}{lio\_instr\_queue}}));}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00262}00262                 oct-\/>\mbox{\hyperlink{structocteon__device_aa5139c7e09f7a8eca4676713d09b00e5}{num\_iqs}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00263}00263 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00264}00264                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00265}00265         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00266}00266 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00267}00267         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00268}00268 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00269}00269 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00270}00270 \textcolor{comment}{/* Return 0 on success, 1 on failure */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00271}00271 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00272}\mbox{\hyperlink{lio__iq_8h_a38cb13793bdd782c0aa7bff275e91de9}{00272}} \mbox{\hyperlink{lio__request__manager_8c_af5dc081d6e4a1694d91660f2fc7458cd}{lio\_setup\_iq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, \textcolor{keywordtype}{int} ifidx, \textcolor{keywordtype}{int} q\_index,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00273}00273              \textcolor{keyword}{union} \mbox{\hyperlink{unionocteon__txpciq}{octeon\_txpciq}} txpciq, uint32\_t num\_descs)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00274}00274 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00275}00275         uint32\_t        iq\_no = (uint32\_t)txpciq.\mbox{\hyperlink{unionocteon__txpciq_a6d4c2fdb74975a61c5ff707a70b8b277}{s}}.\mbox{\hyperlink{unionocteon__txpciq_a036a1f65fa239c8b4dbdcca730c8e47a}{q\_no}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00276}00276 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00277}00277         if (oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[iq\_no]-\/>\mbox{\hyperlink{structlio__instr__queue_a93a4882d7471320902b3445ee35f1a88}{oct\_dev}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00278}00278                 \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(oct, \textcolor{stringliteral}{"{}IQ is in use. Cannot create the IQ: \%d again\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00279}00279                             iq\_no);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00280}00280                 oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[iq\_no]-\/>\mbox{\hyperlink{structlio__instr__queue_a0f80e25acea3c55a342c247a68038dec}{txpciq}}.\mbox{\hyperlink{unionocteon__txpciq_a250f69b890af54dabd4195fc0c9663b4}{txpciq64}} = txpciq.\mbox{\hyperlink{unionocteon__txpciq_a250f69b890af54dabd4195fc0c9663b4}{txpciq64}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00281}00281                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00282}00282         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00283}00283 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00284}00284         oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[iq\_no]-\/>\mbox{\hyperlink{structlio__instr__queue_a8d5da19e9a0e075f5cb5b02c6b713968}{q\_index}} = q\_index;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00285}00285         oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[iq\_no]-\/>\mbox{\hyperlink{structlio__instr__queue_acd81cfb9b1ca36b7c1c5bc1e3ad1c262}{ifidx}} = ifidx;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00286}00286 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00287}00287         \textcolor{keywordflow}{if} (\mbox{\hyperlink{lio__request__manager_8c_a4e6d2d98b4d7696957fdf21f92a70fed}{lio\_init\_instr\_queue}}(oct, txpciq, num\_descs)) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00288}00288                 \mbox{\hyperlink{lio__request__manager_8c_ab5379cfe88c0dbf68e3f147dc18ba091}{lio\_delete\_instr\_queue}}(oct, iq\_no);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00289}00289                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00290}00290         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00291}00291 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00292}00292         oct-\/>\mbox{\hyperlink{structocteon__device_aa5139c7e09f7a8eca4676713d09b00e5}{num\_iqs}}++;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00293}00293         \textcolor{keywordflow}{if} (oct-\/>\mbox{\hyperlink{structocteon__device_a07eedda72ba39292f548957a394234dd}{fn\_list}}.\mbox{\hyperlink{structlio__fn__list_a39961d09a6e48a1ae00fab27606c261d}{enable\_io\_queues}}(oct))}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00294}00294                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00295}00295 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00296}00296         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00297}00297 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00298}00298 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00299}00299 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00300}\mbox{\hyperlink{lio__iq_8h_ac4900db5765b1b439c6cac79a94ce7b3}{00300}} \mbox{\hyperlink{lio__request__manager_8c_ac4900db5765b1b439c6cac79a94ce7b3}{lio\_wait\_for\_instr\_fetch}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00301}00301 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00302}00302         \textcolor{keywordtype}{int}     i, retry = 1000, pending, instr\_cnt = 0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00303}00303 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00304}00304         \textcolor{keywordflow}{do} \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00305}00305                 instr\_cnt = 0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00306}00306 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00307}00307                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{lio__config_8h_ad5027b8a431b10ce01025a2887fba297}{LIO\_MAX\_INSTR\_QUEUES}}(oct); i++) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00308}00308                         \textcolor{keywordflow}{if} (!(oct-\/>\mbox{\hyperlink{structocteon__device_a2572013042e73f339174c82cf587494c}{io\_qmask}}.\mbox{\hyperlink{structlio__io__enable_ac488befca84b2b1657e8d7044be22383}{iq}} \& \mbox{\hyperlink{lio__main_8h_aed42b76522e8377b3b0e77b64ee04fae}{BIT\_ULL}}(i)))}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00309}00309                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00310}00310                         pending = atomic\_load\_acq\_int(}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00311}00311                                         \&oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[i]-\/>\mbox{\hyperlink{structlio__instr__queue_a2ba81d22f0552e9e2dab0dbed1c378b2}{instr\_pending}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00312}00312                         \textcolor{keywordflow}{if} (pending)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00313}00313                                 \mbox{\hyperlink{lio__request__manager_8c_adf9ad9cce887a9740c0eb549c222e498}{\_\_lio\_check\_db\_timeout}}(oct, i);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00314}00314                         instr\_cnt += pending;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00315}00315                 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00316}00316 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00317}00317                 \textcolor{keywordflow}{if} (instr\_cnt == 0)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00318}00318                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00319}00319 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00320}00320                 \mbox{\hyperlink{lio__bsd_8h_a7127c19922ac115d8494a76ae19d0480}{lio\_sleep\_timeout}}(1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00321}00321 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00322}00322         \} \textcolor{keywordflow}{while} (retry-\/-\/ \&\& instr\_cnt);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00323}00323 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00324}00324         \textcolor{keywordflow}{return} (instr\_cnt);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00325}00325 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00326}00326 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00327}00327 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00328}\mbox{\hyperlink{lio__request__manager_8c_adaf9b5e54230caf75afc3f685e803c61}{00328}} \mbox{\hyperlink{lio__request__manager_8c_adaf9b5e54230caf75afc3f685e803c61}{lio\_ring\_doorbell}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__instr__queue}{lio\_instr\_queue}} *iq)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00329}00329 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00330}00330 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00331}00331         \textcolor{keywordflow}{if} (atomic\_load\_acq\_int(\&oct-\/>\mbox{\hyperlink{structocteon__device_a58bdbcf5e1e1809ae0e3471e81e92a08}{status}}) == \mbox{\hyperlink{lio__device_8h_a9680c4e9ce767a2c48ed34111b244448}{LIO\_DEV\_RUNNING}}) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00332}00332                 \mbox{\hyperlink{lio__device_8h_a946180ca969df8cd2d4b2c3eb4e9cb3c}{lio\_write\_csr32}}(oct, iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4e3f0715ac3bce49e550b145ec686966}{doorbell\_reg}}, iq-\/>\mbox{\hyperlink{structlio__instr__queue_a8b79a25fe03aae8b247b6b357bd2f499}{fill\_cnt}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00333}00333                 \textcolor{comment}{/* make sure doorbell write goes through */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00334}00334                 \_\_compiler\_membar();}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00335}00335                 iq-\/>\mbox{\hyperlink{structlio__instr__queue_a8b79a25fe03aae8b247b6b357bd2f499}{fill\_cnt}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00336}00336                 iq-\/>\mbox{\hyperlink{structlio__instr__queue_a3555c31a9990cd2523de71fccd404382}{last\_db\_time}} = ticks;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00337}00337                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00338}00338         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00339}00339 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00340}00340 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00341}00341 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00342}\mbox{\hyperlink{lio__request__manager_8c_a4b3db063773f29d1cef788f04261d91a}{00342}} \mbox{\hyperlink{lio__request__manager_8c_a4b3db063773f29d1cef788f04261d91a}{\_\_lio\_copy\_cmd\_into\_iq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlio__instr__queue}{lio\_instr\_queue}} *iq, uint8\_t *cmd)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00343}00343 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00344}00344         uint8\_t *iqptr, cmdsize;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00345}00345 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00346}00346         cmdsize = ((iq-\/>\mbox{\hyperlink{structlio__instr__queue_af6cb01a60fa855d01289da864d76a336}{iqcmd\_64B}}) ? 64 : 32);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00347}00347         iqptr = iq-\/>\mbox{\hyperlink{structlio__instr__queue_a352264619cfcb0f84542717aeec26e38}{base\_addr}} + (cmdsize * iq-\/>\mbox{\hyperlink{structlio__instr__queue_ae41b850d5975e90e5d817eeacfa1d19e}{host\_write\_index}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00348}00348 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00349}00349         memcpy(iqptr, cmd, cmdsize);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00350}00350 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00351}00351 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00352}00352 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__iq__post__status}{lio\_iq\_post\_status}}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00353}\mbox{\hyperlink{lio__request__manager_8c_a07978d8c5033369153ea266df0ae11e1}{00353}} \mbox{\hyperlink{lio__request__manager_8c_a07978d8c5033369153ea266df0ae11e1}{\_\_lio\_post\_command2}}(struct \mbox{\hyperlink{structlio__instr__queue}{lio\_instr\_queue}} *iq, uint8\_t *cmd)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00354}00354 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00355}00355         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__iq__post__status}{lio\_iq\_post\_status}}     st;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00356}00356 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00357}00357         st.\mbox{\hyperlink{structlio__iq__post__status_a067d37e81147f4c35832a005516a5c8a}{status}} = \mbox{\hyperlink{lio__iq_8h_a8d27f24cbaef8cd667c4ef0d3f31f5b3}{LIO\_IQ\_SEND\_OK}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00358}00358 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00359}00359         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00360}00360 \textcolor{comment}{         * This ensures that the read index does not wrap around to the same}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00361}00361 \textcolor{comment}{         * position if queue gets full before Octeon could fetch any instr.}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00362}00362 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00363}00363         \textcolor{keywordflow}{if} (atomic\_load\_acq\_int(\&iq-\/>instr\_pending) >=}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00364}00364             (int32\_t)(iq-\/>max\_count -\/ 1)) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00365}00365                 st.\mbox{\hyperlink{structlio__iq__post__status_a067d37e81147f4c35832a005516a5c8a}{status}} = \mbox{\hyperlink{lio__iq_8h_a7a8baba01e32a87bd344a3ec2c8f703a}{LIO\_IQ\_SEND\_FAILED}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00366}00366                 st.\mbox{\hyperlink{structlio__iq__post__status_a5c4c00cc907835aef2fa2215b3f2a461}{index}} = -\/1;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00367}00367                 \textcolor{keywordflow}{return} (st);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00368}00368         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00369}00369 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00370}00370         \textcolor{keywordflow}{if} (atomic\_load\_acq\_int(\&iq-\/>instr\_pending) >=}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00371}00371             (int32\_t)(iq-\/>max\_count -\/ 2))}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00372}00372                 st.\mbox{\hyperlink{structlio__iq__post__status_a067d37e81147f4c35832a005516a5c8a}{status}} = \mbox{\hyperlink{lio__iq_8h_a104488f61352352c0e0de2403a18c58f}{LIO\_IQ\_SEND\_STOP}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00373}00373 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00374}00374         \mbox{\hyperlink{lio__request__manager_8c_a4b3db063773f29d1cef788f04261d91a}{\_\_lio\_copy\_cmd\_into\_iq}}(iq, cmd);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00375}00375 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00376}00376         \textcolor{comment}{/* "{}index"{} is returned, host\_write\_index is modified. */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00377}00377         st.\mbox{\hyperlink{structlio__iq__post__status_a5c4c00cc907835aef2fa2215b3f2a461}{index}} = iq-\/>host\_write\_index;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00378}00378         iq-\/>host\_write\_index = \mbox{\hyperlink{lio__common_8h_aab9e2438e83ac73b196a655afd9b5053}{lio\_incr\_index}}(iq-\/>host\_write\_index, 1,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00379}00379                                               iq-\/>max\_count);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00380}00380         iq-\/>fill\_cnt++;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00381}00381 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00382}00382         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00383}00383 \textcolor{comment}{         * Flush the command into memory. We need to be sure the data is in}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00384}00384 \textcolor{comment}{         * memory before indicating that the instruction is pending.}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00385}00385 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00386}00386         wmb();}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00387}00387 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00388}00388         atomic\_add\_int(\&iq-\/>instr\_pending, 1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00389}00389 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00390}00390         \textcolor{keywordflow}{return} (st);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00391}00391 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00392}00392 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00393}00393 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00394}\mbox{\hyperlink{lio__request__manager_8c_a65f9bbd7fe9a5589de7eac6c8dd6920e}{00394}} \mbox{\hyperlink{lio__request__manager_8c_a65f9bbd7fe9a5589de7eac6c8dd6920e}{\_\_lio\_add\_to\_request\_list}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlio__instr__queue}{lio\_instr\_queue}} *iq, \textcolor{keywordtype}{int} idx, \textcolor{keywordtype}{void} *buf,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00395}00395                           \textcolor{keywordtype}{int} reqtype)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00396}00396 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00397}00397 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00398}00398         iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4e5bff40aeeea3e15a6624aecee178ea}{request\_list}}[idx].\mbox{\hyperlink{structlio__request__list_aaebfd6050d7e1644a8baf54771babbc9}{buf}} = buf;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00399}00399         iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4e5bff40aeeea3e15a6624aecee178ea}{request\_list}}[idx].\mbox{\hyperlink{structlio__request__list_a1f3e4dd70f337e354058c11e4972388b}{reqtype}} = reqtype;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00400}00400 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00401}00401 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00402}00402 \textcolor{comment}{/* Can only run in process context */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00403}00403 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00404}\mbox{\hyperlink{lio__iq_8h_a65afb6e1646fc39bfa82450e1965b39e}{00404}} \mbox{\hyperlink{lio__request__manager_8c_a65afb6e1646fc39bfa82450e1965b39e}{lio\_process\_iq\_request\_list}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00405}00405                             \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__instr__queue}{lio\_instr\_queue}} *iq, uint32\_t budget)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00406}00406 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00407}00407         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__soft__command}{lio\_soft\_command}}         *sc;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00408}00408         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__instr__irh}{octeon\_instr\_irh}}         *irh = NULL;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00409}00409         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__mbuf__free__info}{lio\_mbuf\_free\_info}}     *finfo;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00410}00410         \textcolor{keywordtype}{void}                            *buf;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00411}00411         uint32\_t                        inst\_count = 0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00412}00412         uint32\_t                        old = iq-\/>\mbox{\hyperlink{structlio__instr__queue_a709e16cc840bcc752004517c429e0666}{flush\_index}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00413}00413         \textcolor{keywordtype}{int}                             reqtype;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00414}00414 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00415}00415         \textcolor{keywordflow}{while} (old != iq-\/>\mbox{\hyperlink{structlio__instr__queue_a0018c29f49eb103d7247a4edd05ac9e4}{octeon\_read\_index}}) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00416}00416                 reqtype = iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4e5bff40aeeea3e15a6624aecee178ea}{request\_list}}[old].\mbox{\hyperlink{structlio__request__list_a1f3e4dd70f337e354058c11e4972388b}{reqtype}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00417}00417                 buf = iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4e5bff40aeeea3e15a6624aecee178ea}{request\_list}}[old].\mbox{\hyperlink{structlio__request__list_aaebfd6050d7e1644a8baf54771babbc9}{buf}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00418}00418                 finfo = buf;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00419}00419 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00420}00420                 \textcolor{keywordflow}{if} (reqtype == \mbox{\hyperlink{lio__iq_8h_a9dbc5f26deb0c5285e6cac2e35eaebe0}{LIO\_REQTYPE\_NONE}})}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00421}00421                         \textcolor{keywordflow}{goto} skip\_this;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00422}00422 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00423}00423                 \textcolor{keywordflow}{switch} (reqtype) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00424}00424                 \textcolor{keywordflow}{case} \mbox{\hyperlink{lio__iq_8h_a39c656cae9d6ced0d82d1a3ee980a472}{LIO\_REQTYPE\_NORESP\_NET}}:}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00425}00425                         \mbox{\hyperlink{lio__main_8c_a599a43d2ebe5cec4e42f46f5a7c0739d}{lio\_free\_mbuf}}(iq, buf);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00426}00426                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00427}00427                 \textcolor{keywordflow}{case} \mbox{\hyperlink{lio__iq_8h_ae9a1a7ccae115012756db05cc36ade19}{LIO\_REQTYPE\_NORESP\_NET\_SG}}:}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00428}00428                         \mbox{\hyperlink{lio__main_8c_acbc4a2c503a3cd5db0f9906596451a9e}{lio\_free\_sgmbuf}}(iq, buf);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00429}00429                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00430}00430                 \textcolor{keywordflow}{case} \mbox{\hyperlink{lio__iq_8h_a531e027b22887b321cb1773db6808e77}{LIO\_REQTYPE\_RESP\_NET}}:}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00431}00431                 \textcolor{keywordflow}{case} \mbox{\hyperlink{lio__iq_8h_a565fd3fdcde5b63b6ee2ad4ee3ce867a}{LIO\_REQTYPE\_SOFT\_COMMAND}}:}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00432}00432                         sc = buf;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00433}00433                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{lio__device_8h_a6d886e3e4427e03cb0c9b3bed8ee8728}{LIO\_CN23XX\_PF}}(oct))}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00434}00434                                 irh = (\textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__instr__irh}{octeon\_instr\_irh}} *)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00435}00435                                         \&sc-\/>\mbox{\hyperlink{structlio__soft__command_a700d56e1f724f6dbb50abb77fd2d98f2}{cmd}}.\mbox{\hyperlink{unionlio__instr__64B_aa7ec9f85a5dee448e720d3779e0363c4}{cmd3}}.\mbox{\hyperlink{structlio__instr3__64B_af53f292fb39e1eb4f33adbffaa00f7d3}{irh}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00436}00436                         if (irh-\/>\mbox{\hyperlink{structocteon__instr__irh_a2bb5bb3c1b4fa3036e9c78f7a7506d9a}{rflag}}) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00437}00437                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00438}00438 \textcolor{comment}{                                 * We're expecting a response from Octeon.}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00439}00439 \textcolor{comment}{                                 * It's up to lio\_process\_ordered\_list() to}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00440}00440 \textcolor{comment}{                                 * process  sc. Add sc to the ordered soft}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00441}00441 \textcolor{comment}{                                 * command response list because we expect}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00442}00442 \textcolor{comment}{                                 * a response from Octeon.}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00443}00443 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00444}00444                                 mtx\_lock(\&oct-\/>\mbox{\hyperlink{structocteon__device_ad426f813a4e8c575116987354206fb52}{response\_list}}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00445}00445                                          [\mbox{\hyperlink{lio__response__manager_8h_aaf105ae5beaca1dee30ae54530691fcea5422bc0a9ca1817fa2fed27de3788a37}{LIO\_ORDERED\_SC\_LIST}}].\mbox{\hyperlink{structlio__response__list_ace43bc509dbd78806cea845a98ace1f3}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00446}00446                                 atomic\_add\_int(\&oct-\/>\mbox{\hyperlink{structocteon__device_ad426f813a4e8c575116987354206fb52}{response\_list}}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00447}00447                                                [\mbox{\hyperlink{lio__response__manager_8h_aaf105ae5beaca1dee30ae54530691fcea5422bc0a9ca1817fa2fed27de3788a37}{LIO\_ORDERED\_SC\_LIST}}].}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00448}00448                                                pending\_req\_count, 1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00449}00449                                 STAILQ\_INSERT\_TAIL(\&oct-\/>\mbox{\hyperlink{structocteon__device_ad426f813a4e8c575116987354206fb52}{response\_list}}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00450}00450                                                    [\mbox{\hyperlink{lio__response__manager_8h_aaf105ae5beaca1dee30ae54530691fcea5422bc0a9ca1817fa2fed27de3788a37}{LIO\_ORDERED\_SC\_LIST}}].}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00451}00451                                                    head, \&sc-\/>\mbox{\hyperlink{structlio__soft__command_abddb60881d4717d684ca6a1707b5c960}{node}}, entries);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00452}00452                                 mtx\_unlock(\&oct-\/>\mbox{\hyperlink{structocteon__device_ad426f813a4e8c575116987354206fb52}{response\_list}}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00453}00453                                            [\mbox{\hyperlink{lio__response__manager_8h_aaf105ae5beaca1dee30ae54530691fcea5422bc0a9ca1817fa2fed27de3788a37}{LIO\_ORDERED\_SC\_LIST}}].\mbox{\hyperlink{structlio__response__list_ace43bc509dbd78806cea845a98ace1f3}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00454}00454                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00455}00455                                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structlio__soft__command_a912a296891fe84dc401a7219a8847063}{callback}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00456}00456                                         \textcolor{comment}{/* This callback must not sleep */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00457}00457                                         sc-\/>\mbox{\hyperlink{structlio__soft__command_a912a296891fe84dc401a7219a8847063}{callback}}(oct, \mbox{\hyperlink{lio__response__manager_8h_a80155586fa275b28773c9b203f52cabaa216c91047b7304dc94d9dad0459daf60}{LIO\_REQUEST\_DONE}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00458}00458                                                      sc-\/>\mbox{\hyperlink{structlio__soft__command_a998df93b613de98f6a4f5f47ac72f64a}{callback\_arg}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00459}00459                                 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00460}00460                         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00461}00461 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00462}00462                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00463}00463                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00464}00464                         \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}\%s Unknown reqtype: \%d buf: \%p at idx \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00465}00465                                     \_\_func\_\_, reqtype, buf, old);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00466}00466                 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00467}00467 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00468}00468                 iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4e5bff40aeeea3e15a6624aecee178ea}{request\_list}}[old].\mbox{\hyperlink{structlio__request__list_aaebfd6050d7e1644a8baf54771babbc9}{buf}} = NULL;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00469}00469                 iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4e5bff40aeeea3e15a6624aecee178ea}{request\_list}}[old].\mbox{\hyperlink{structlio__request__list_a1f3e4dd70f337e354058c11e4972388b}{reqtype}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00470}00470 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00471}00471 skip\_this:}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00472}00472                 inst\_count++;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00473}00473                 old = \mbox{\hyperlink{lio__common_8h_aab9e2438e83ac73b196a655afd9b5053}{lio\_incr\_index}}(old, 1, iq-\/>\mbox{\hyperlink{structlio__instr__queue_aacc240455d509d0f895ff0cefa62ec16}{max\_count}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00474}00474 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00475}00475                 \textcolor{keywordflow}{if} ((budget) \&\& (inst\_count >= budget))}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00476}00476                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00477}00477         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00478}00478 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00479}00479         iq-\/>\mbox{\hyperlink{structlio__instr__queue_a709e16cc840bcc752004517c429e0666}{flush\_index}} = old;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00480}00480 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00481}00481         \textcolor{keywordflow}{return} (inst\_count);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00482}00482 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00483}00483 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00484}00484 \textcolor{comment}{/* Can only be called from process context */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00485}00485 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00486}\mbox{\hyperlink{lio__iq_8h_a963139a14cc9f08985e3a319c3b0b863}{00486}} \mbox{\hyperlink{lio__request__manager_8c_a963139a14cc9f08985e3a319c3b0b863}{lio\_flush\_iq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__instr__queue}{lio\_instr\_queue}} *iq,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00487}00487              uint32\_t budget)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00488}00488 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00489}00489         uint32\_t        inst\_processed = 0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00490}00490         uint32\_t        tot\_inst\_processed = 0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00491}00491         \textcolor{keywordtype}{int}             tx\_done = 1;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00492}00492 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00493}00493         \textcolor{keywordflow}{if} (!mtx\_trylock(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_ac5b2a9335c1e5a6e6ee201417d1e0d02}{iq\_flush\_running\_lock}}))}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00494}00494                 \textcolor{keywordflow}{return} (tx\_done);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00495}00495 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00496}00496         mtx\_lock(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_a2c7a4073945f78eec5cf43a652cb314f}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00497}00497 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00498}00498         iq-\/>\mbox{\hyperlink{structlio__instr__queue_a0018c29f49eb103d7247a4edd05ac9e4}{octeon\_read\_index}} = oct-\/>\mbox{\hyperlink{structocteon__device_a07eedda72ba39292f548957a394234dd}{fn\_list}}.\mbox{\hyperlink{structlio__fn__list_a28423d01ec89c31fc277fe24e497b0d3}{update\_iq\_read\_idx}}(iq);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00499}00499 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00500}00500         \textcolor{keywordflow}{do} \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00501}00501                 \textcolor{comment}{/* Process any outstanding IQ packets. */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00502}00502                 \textcolor{keywordflow}{if} (iq-\/>\mbox{\hyperlink{structlio__instr__queue_a709e16cc840bcc752004517c429e0666}{flush\_index}} == iq-\/>\mbox{\hyperlink{structlio__instr__queue_a0018c29f49eb103d7247a4edd05ac9e4}{octeon\_read\_index}})}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00503}00503                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00504}00504 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00505}00505                 \textcolor{keywordflow}{if} (budget)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00506}00506                         inst\_processed =}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00507}00507                                 \mbox{\hyperlink{lio__request__manager_8c_a65afb6e1646fc39bfa82450e1965b39e}{lio\_process\_iq\_request\_list}}(oct, iq,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00508}00508                                                             budget -\/}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00509}00509                                                             tot\_inst\_processed);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00510}00510                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00511}00511                         inst\_processed =}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00512}00512                                 \mbox{\hyperlink{lio__request__manager_8c_a65afb6e1646fc39bfa82450e1965b39e}{lio\_process\_iq\_request\_list}}(oct, iq, 0);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00513}00513 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00514}00514                 \textcolor{keywordflow}{if} (inst\_processed) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00515}00515                         atomic\_subtract\_int(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_a2ba81d22f0552e9e2dab0dbed1c378b2}{instr\_pending}}, inst\_processed);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00516}00516                         iq-\/>\mbox{\hyperlink{structlio__instr__queue_ae643e92210d775f5ab51b3ea613abbad}{stats}}.\mbox{\hyperlink{structlio__iq__stats_ad0cc8adf88fc1996abb440ab8c24aab6}{instr\_processed}} += inst\_processed;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00517}00517                 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00518}00518                 tot\_inst\_processed += inst\_processed;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00519}00519                 inst\_processed = 0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00520}00520 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00521}00521         \} \textcolor{keywordflow}{while} (tot\_inst\_processed < budget);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00522}00522 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00523}00523         \textcolor{keywordflow}{if} (budget \&\& (tot\_inst\_processed >= budget))}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00524}00524                 tx\_done = 0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00525}00525 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00526}00526         iq-\/>\mbox{\hyperlink{structlio__instr__queue_a3555c31a9990cd2523de71fccd404382}{last\_db\_time}} = ticks;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00527}00527 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00528}00528         mtx\_unlock(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_a2c7a4073945f78eec5cf43a652cb314f}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00529}00529 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00530}00530         mtx\_unlock(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_ac5b2a9335c1e5a6e6ee201417d1e0d02}{iq\_flush\_running\_lock}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00531}00531 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00532}00532         \textcolor{keywordflow}{return} (tx\_done);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00533}00533 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00534}00534 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00535}00535 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00536}00536 \textcolor{comment}{ * Process instruction queue after timeout.}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00537}00537 \textcolor{comment}{ * This routine gets called from a taskqueue or when removing the module.}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00538}00538 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00539}00539 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00540}\mbox{\hyperlink{lio__request__manager_8c_adf9ad9cce887a9740c0eb549c222e498}{00540}} \mbox{\hyperlink{lio__request__manager_8c_adf9ad9cce887a9740c0eb549c222e498}{\_\_lio\_check\_db\_timeout}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, uint64\_t iq\_no)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00541}00541 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00542}00542         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__instr__queue}{lio\_instr\_queue}}   *iq;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00543}00543         uint64\_t                next\_time;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00544}00544 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00545}00545         \textcolor{keywordflow}{if} (oct == NULL)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00546}00546                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00547}00547 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00548}00548         iq = oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[iq\_no];}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00549}00549         \textcolor{keywordflow}{if} (iq == NULL)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00550}00550                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00551}00551 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00552}00552         \textcolor{keywordflow}{if} (atomic\_load\_acq\_int(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_a2ba81d22f0552e9e2dab0dbed1c378b2}{instr\_pending}})) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00553}00553                 \textcolor{comment}{/* If ticks -\/ last\_db\_time < db\_timeout do nothing  */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00554}00554                 next\_time = iq-\/>\mbox{\hyperlink{structlio__instr__queue_a3555c31a9990cd2523de71fccd404382}{last\_db\_time}} + \mbox{\hyperlink{lio__bsd_8h_ae6eb6d875a682c72af6de3d0fa0876e5}{lio\_ms\_to\_ticks}}(iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4261e2e3810f01eb8894e1adcafda6a8}{db\_timeout}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00555}00555                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{lio__bsd_8h_acf7d0437f6cf08fe1df1b265b83362f0}{lio\_check\_timeout}}(ticks, next\_time))}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00556}00556                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00557}00557 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00558}00558                 iq-\/>\mbox{\hyperlink{structlio__instr__queue_a3555c31a9990cd2523de71fccd404382}{last\_db\_time}} = ticks;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00559}00559 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00560}00560                 \textcolor{comment}{/* Flush the instruction queue */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00561}00561                 \mbox{\hyperlink{lio__request__manager_8c_a963139a14cc9f08985e3a319c3b0b863}{lio\_flush\_iq}}(oct, iq, 0);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00562}00562 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00563}00563                 \mbox{\hyperlink{lio__device_8c_a2a05dfb4afadd2182b26674ca21d6ffb}{lio\_enable\_irq}}(NULL, iq);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00564}00564         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00565}00565 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00566}00566         \textcolor{keywordflow}{if} (oct-\/>\mbox{\hyperlink{structocteon__device_a15987c578f76afc4e6d187252efe23bc}{props}}.\mbox{\hyperlink{structlio__if__props_a66039d2909b1fbff45e0898d81d515c9}{ifp}} != NULL \&\& iq-\/>\mbox{\hyperlink{structlio__instr__queue_ad8faf8e3254cabbbe74d35048cfd88a5}{br}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00567}00567                 \textcolor{keywordflow}{if} (mtx\_trylock(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_aedf00f27438279abe25f4926facac1ef}{enq\_lock}})) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00568}00568                         \textcolor{keywordflow}{if} (!drbr\_empty(oct-\/>\mbox{\hyperlink{structocteon__device_a15987c578f76afc4e6d187252efe23bc}{props}}.\mbox{\hyperlink{structlio__if__props_a66039d2909b1fbff45e0898d81d515c9}{ifp}}, iq-\/>\mbox{\hyperlink{structlio__instr__queue_ad8faf8e3254cabbbe74d35048cfd88a5}{br}}))}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00569}00569                                 \mbox{\hyperlink{lio__rxtx_8c_a61ddde62ce3624ee8e0fc182077e3862}{lio\_mq\_start\_locked}}(oct-\/>\mbox{\hyperlink{structocteon__device_a15987c578f76afc4e6d187252efe23bc}{props}}.\mbox{\hyperlink{structlio__if__props_a66039d2909b1fbff45e0898d81d515c9}{ifp}}, iq);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00570}00570 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00571}00571                         mtx\_unlock(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_aedf00f27438279abe25f4926facac1ef}{enq\_lock}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00572}00572                 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00573}00573         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00574}00574 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00575}00575 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00576}00576 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00577}00577 \textcolor{comment}{ * Called by the Poll thread at regular intervals to check the instruction}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00578}00578 \textcolor{comment}{ * queue for commands to be posted and for commands that were fetched by Octeon.}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00579}00579 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00580}00580 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00581}\mbox{\hyperlink{lio__request__manager_8c_a48de570fc922e0109f3566242e029e29}{00581}} \mbox{\hyperlink{lio__request__manager_8c_a48de570fc922e0109f3566242e029e29}{lio\_check\_db\_timeout}}(\textcolor{keywordtype}{void} *arg, \textcolor{keywordtype}{int} pending)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00582}00582 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00583}00583         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__tq}{lio\_tq}}             *db\_tq = (\textcolor{keyword}{struct }\mbox{\hyperlink{structlio__tq}{lio\_tq}} *)arg;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00584}00584         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__device}{octeon\_device}}       *oct = db\_tq-\/>\mbox{\hyperlink{structlio__tq_a5770f6cc05773a63e58dd8f6ed1006af}{ctxptr}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00585}00585         uint64\_t                iq\_no = db\_tq-\/>\mbox{\hyperlink{structlio__tq_addd0e9bb5478f06fafe1d13055893134}{ctxul}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00586}00586         uint32\_t                delay = 10;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00587}00587 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00588}00588         \mbox{\hyperlink{lio__request__manager_8c_adf9ad9cce887a9740c0eb549c222e498}{\_\_lio\_check\_db\_timeout}}(oct, iq\_no);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00589}00589         taskqueue\_enqueue\_timeout(db\_tq-\/>\mbox{\hyperlink{structlio__tq_a367b9bb34b913f264e45e286ccc9b499}{tq}}, \&db\_tq-\/>\mbox{\hyperlink{structlio__tq_a93a5d499ac3cec352a5bed558ec35168}{work}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00590}00590                                   \mbox{\hyperlink{lio__bsd_8h_ae6eb6d875a682c72af6de3d0fa0876e5}{lio\_ms\_to\_ticks}}(delay));}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00591}00591 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00592}00592 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00593}00593 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00594}\mbox{\hyperlink{lio__iq_8h_ad69baa289afaf465ca55687cba8f8ff0}{00594}} \mbox{\hyperlink{lio__request__manager_8c_ad69baa289afaf465ca55687cba8f8ff0}{lio\_send\_command}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, uint32\_t iq\_no,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00595}00595                  uint32\_t force\_db, \textcolor{keywordtype}{void} *cmd, \textcolor{keywordtype}{void} *buf,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00596}00596                  uint32\_t datasize, uint32\_t reqtype)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00597}00597 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00598}00598         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__iq__post__status}{lio\_iq\_post\_status}}     st;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00599}00599         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__instr__queue}{lio\_instr\_queue}}           *iq = oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[iq\_no];}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00600}00600 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00601}00601         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00602}00602 \textcolor{comment}{         * Get the lock and prevent other tasks and tx interrupt handler}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00603}00603 \textcolor{comment}{         * from running.}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00604}00604 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00605}00605         mtx\_lock(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_a366d8e34b6bb0ca7591ecb6487c15fea}{post\_lock}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00606}00606 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00607}00607         st = \mbox{\hyperlink{lio__request__manager_8c_a07978d8c5033369153ea266df0ae11e1}{\_\_lio\_post\_command2}}(iq, cmd);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00608}00608 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00609}00609         \textcolor{keywordflow}{if} (st.\mbox{\hyperlink{structlio__iq__post__status_a067d37e81147f4c35832a005516a5c8a}{status}} != \mbox{\hyperlink{lio__iq_8h_a7a8baba01e32a87bd344a3ec2c8f703a}{LIO\_IQ\_SEND\_FAILED}}) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00610}00610                 \mbox{\hyperlink{lio__request__manager_8c_a65f9bbd7fe9a5589de7eac6c8dd6920e}{\_\_lio\_add\_to\_request\_list}}(iq, st.\mbox{\hyperlink{structlio__iq__post__status_a5c4c00cc907835aef2fa2215b3f2a461}{index}}, buf, reqtype);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00611}00611                 \mbox{\hyperlink{lio__iq_8h_a55cd3ee6558fb874a3f6a96dd5d2426c}{LIO\_INCR\_INSTRQUEUE\_PKT\_COUNT}}(oct, iq\_no, bytes\_sent, datasize);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00612}00612                 \mbox{\hyperlink{lio__iq_8h_a55cd3ee6558fb874a3f6a96dd5d2426c}{LIO\_INCR\_INSTRQUEUE\_PKT\_COUNT}}(oct, iq\_no, instr\_posted, 1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00613}00613 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00614}00614                 \textcolor{keywordflow}{if} (force\_db || (st.\mbox{\hyperlink{structlio__iq__post__status_a067d37e81147f4c35832a005516a5c8a}{status}} == \mbox{\hyperlink{lio__iq_8h_a104488f61352352c0e0de2403a18c58f}{LIO\_IQ\_SEND\_STOP}}))}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00615}00615                         \mbox{\hyperlink{lio__request__manager_8c_adaf9b5e54230caf75afc3f685e803c61}{lio\_ring\_doorbell}}(oct, iq);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00616}00616         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00617}00617                 \mbox{\hyperlink{lio__iq_8h_a55cd3ee6558fb874a3f6a96dd5d2426c}{LIO\_INCR\_INSTRQUEUE\_PKT\_COUNT}}(oct, iq\_no, instr\_dropped, 1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00618}00618         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00619}00619 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00620}00620         mtx\_unlock(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_a366d8e34b6bb0ca7591ecb6487c15fea}{post\_lock}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00621}00621 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00622}00622         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00623}00623 \textcolor{comment}{         * This is only done here to expedite packets being flushed for}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00624}00624 \textcolor{comment}{         * cases where there are no IQ completion interrupts.}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00625}00625 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00626}00626 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00627}00627         \textcolor{keywordflow}{return} (st.\mbox{\hyperlink{structlio__iq__post__status_a067d37e81147f4c35832a005516a5c8a}{status}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00628}00628 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00629}00629 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00630}00630 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00631}\mbox{\hyperlink{lio__iq_8h_a6bd987af0b5107ea95f63de23cb68cda}{00631}} \mbox{\hyperlink{lio__request__manager_8c_a6bd987af0b5107ea95f63de23cb68cda}{lio\_prepare\_soft\_command}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__soft__command}{lio\_soft\_command}} *sc,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00632}00632                          uint8\_t opcode, uint8\_t subcode, uint32\_t irh\_ossp,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00633}00633                          uint64\_t ossp0, uint64\_t ossp1)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00634}00634 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00635}00635         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__config}{lio\_config}}             *lio\_cfg;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00636}00636         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__instr__ih3}{octeon\_instr\_ih3}}         *ih3;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00637}00637         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__instr__pki__ih3}{octeon\_instr\_pki\_ih3}} *pki\_ih3;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00638}00638         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__instr__irh}{octeon\_instr\_irh}}         *irh;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00639}00639         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__instr__rdp}{octeon\_instr\_rdp}}         *rdp;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00640}00640 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00641}00641         KASSERT(opcode <= 15, (\textcolor{stringliteral}{"{}\%s, \%d, opcode > 15"{}}, \_\_func\_\_, \_\_LINE\_\_));}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00642}00642         KASSERT(subcode <= 127, (\textcolor{stringliteral}{"{}\%s, \%d, opcode > 127"{}}, \_\_func\_\_, \_\_LINE\_\_));}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00643}00643 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00644}00644         lio\_cfg = \mbox{\hyperlink{lio__device_8c_a8f946cabd046605ba62dbc2dd068b075}{lio\_get\_conf}}(oct);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00645}00645 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00646}00646         \textcolor{keywordflow}{if} (\mbox{\hyperlink{lio__device_8h_a6d886e3e4427e03cb0c9b3bed8ee8728}{LIO\_CN23XX\_PF}}(oct)) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00647}00647                 ih3 = (\textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__instr__ih3}{octeon\_instr\_ih3}} *)\&sc-\/>\mbox{\hyperlink{structlio__soft__command_a700d56e1f724f6dbb50abb77fd2d98f2}{cmd}}.\mbox{\hyperlink{unionlio__instr__64B_aa7ec9f85a5dee448e720d3779e0363c4}{cmd3}}.\mbox{\hyperlink{structlio__instr3__64B_af412fd769c61734b9ec13857601e4ca7}{ih3}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00648}00648 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00649}00649                 ih3-\/>\mbox{\hyperlink{structocteon__instr__ih3_a0a234826c645548e50064e0e33f3c980}{pkind}} = oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[sc-\/>\mbox{\hyperlink{structlio__soft__command_ad15512a7fe14de8f48679ea491ceef6d}{iq\_no}}]-\/>\mbox{\hyperlink{structlio__instr__queue_a0f80e25acea3c55a342c247a68038dec}{txpciq}}.\mbox{\hyperlink{unionocteon__txpciq_a6d4c2fdb74975a61c5ff707a70b8b277}{s}}.\mbox{\hyperlink{unionocteon__txpciq_a1b38615066b6f900328b2251dd7f99fa}{pkind}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00650}00650 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00651}00651                 pki\_ih3 = (\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__instr__pki__ih3}{octeon\_instr\_pki\_ih3}} *)\&sc-\/>\mbox{\hyperlink{structlio__soft__command_a700d56e1f724f6dbb50abb77fd2d98f2}{cmd}}.\mbox{\hyperlink{unionlio__instr__64B_aa7ec9f85a5dee448e720d3779e0363c4}{cmd3}}.\mbox{\hyperlink{structlio__instr3__64B_aefccce1ab81fe0fe0b73e9570a174cf1}{pki\_ih3}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00652}00652 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00653}00653                 pki\_ih3-\/>\mbox{\hyperlink{structocteon__instr__pki__ih3_a21a70cb0ebe80c1fc47e0d2458bb4111}{w}} = 1;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00654}00654                 pki\_ih3-\/>\mbox{\hyperlink{structocteon__instr__pki__ih3_aafe5c64377d3f5f1849c00595670ce18}{raw}} = 1;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00655}00655                 pki\_ih3-\/>\mbox{\hyperlink{structocteon__instr__pki__ih3_a55b9c34d75ef6d22f5995c976d316e2b}{utag}} = 1;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00656}00656                 pki\_ih3-\/>\mbox{\hyperlink{structocteon__instr__pki__ih3_a5d57848f6d7b2d9657b9dc2b6d59193e}{uqpg}} = oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[sc-\/>\mbox{\hyperlink{structlio__soft__command_ad15512a7fe14de8f48679ea491ceef6d}{iq\_no}}]-\/>\mbox{\hyperlink{structlio__instr__queue_a0f80e25acea3c55a342c247a68038dec}{txpciq}}.\mbox{\hyperlink{unionocteon__txpciq_a6d4c2fdb74975a61c5ff707a70b8b277}{s}}.\mbox{\hyperlink{unionocteon__txpciq_af60fba7123de0517587e9b3eb04dbad6}{use\_qpg}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00657}00657                 pki\_ih3-\/>\mbox{\hyperlink{structocteon__instr__pki__ih3_a92512f138c26420092a334c1ba2e83da}{utt}} = 1;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00658}00658                 pki\_ih3-\/>\mbox{\hyperlink{structocteon__instr__pki__ih3_a2de59c408c760964f94d59000dc99ef1}{tag}} = \mbox{\hyperlink{lio__common_8h_a49467ad066fb0c40a97f9c66cb093ddc}{LIO\_CONTROL}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00659}00659                 pki\_ih3-\/>\mbox{\hyperlink{structocteon__instr__pki__ih3_a56a7993d5b3588ce5978259d4802fb0d}{tagtype}} = \mbox{\hyperlink{lio__common_8h_afafc1bb5328c197aa115830f7563e547ab94f8908b68eeb8114ef0c07a86f5b75}{LIO\_ATOMIC\_TAG}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00660}00660                 pki\_ih3-\/>\mbox{\hyperlink{structocteon__instr__pki__ih3_a01b8982de95bd898d468738e84ee9223}{qpg}} = oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[sc-\/>\mbox{\hyperlink{structlio__soft__command_ad15512a7fe14de8f48679ea491ceef6d}{iq\_no}}]-\/>\mbox{\hyperlink{structlio__instr__queue_a0f80e25acea3c55a342c247a68038dec}{txpciq}}.\mbox{\hyperlink{unionocteon__txpciq_a6d4c2fdb74975a61c5ff707a70b8b277}{s}}.\mbox{\hyperlink{unionocteon__txpciq_aa0cb941f425c56e1678060c7bebf9d1d}{qpg}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00661}00661                 pki\_ih3-\/>\mbox{\hyperlink{structocteon__instr__pki__ih3_a1fa1676abe5dd760c9ad7f35b1119e50}{pm}} = 0x7;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00662}00662                 pki\_ih3-\/>\mbox{\hyperlink{structocteon__instr__pki__ih3_a0f146a708803ac2257d328d39d2da9b7}{sl}} = 8;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00663}00663 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00664}00664                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structlio__soft__command_a1de9fae89229b51c7a51950253bbe3e1}{datasize}})}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00665}00665                         ih3-\/>\mbox{\hyperlink{structocteon__instr__ih3_ad5787c4e551749eca2e1e208665ceae9}{dlengsz}} = sc-\/>\mbox{\hyperlink{structlio__soft__command_a1de9fae89229b51c7a51950253bbe3e1}{datasize}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00666}00666 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00667}00667                 irh = (\textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__instr__irh}{octeon\_instr\_irh}} *)\&sc-\/>\mbox{\hyperlink{structlio__soft__command_a700d56e1f724f6dbb50abb77fd2d98f2}{cmd}}.\mbox{\hyperlink{unionlio__instr__64B_aa7ec9f85a5dee448e720d3779e0363c4}{cmd3}}.\mbox{\hyperlink{structlio__instr3__64B_af53f292fb39e1eb4f33adbffaa00f7d3}{irh}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00668}00668                 irh-\/>\mbox{\hyperlink{structocteon__instr__irh_ad91fbebf11a9a8db69226b8c3867b98f}{opcode}} = \mbox{\hyperlink{structocteon__instr__irh_ad91fbebf11a9a8db69226b8c3867b98f}{opcode}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00669}00669                 irh-\/>\mbox{\hyperlink{structocteon__instr__irh_ac3c99562e93aba17151a67ddc1622576}{subcode}} = \mbox{\hyperlink{structocteon__instr__irh_ac3c99562e93aba17151a67ddc1622576}{subcode}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00670}00670 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00671}00671                 \textcolor{comment}{/* opcode/subcode specific parameters (ossp) */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00672}00672                 irh-\/>\mbox{\hyperlink{structocteon__instr__irh_a931eba1900a8dd76b4a9bd7247583029}{ossp}} = irh\_ossp;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00673}00673                 sc-\/>\mbox{\hyperlink{structlio__soft__command_a700d56e1f724f6dbb50abb77fd2d98f2}{cmd}}.\mbox{\hyperlink{unionlio__instr__64B_aa7ec9f85a5dee448e720d3779e0363c4}{cmd3}}.\mbox{\hyperlink{structlio__instr3__64B_a3ad43b3219f365687cd6535ca3c029f7}{ossp}}[0] = ossp0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00674}00674                 sc-\/>\mbox{\hyperlink{structlio__soft__command_a700d56e1f724f6dbb50abb77fd2d98f2}{cmd}}.\mbox{\hyperlink{unionlio__instr__64B_aa7ec9f85a5dee448e720d3779e0363c4}{cmd3}}.\mbox{\hyperlink{structlio__instr3__64B_a3ad43b3219f365687cd6535ca3c029f7}{ossp}}[1] = ossp1;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00675}00675 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00676}00676                 if (sc-\/>\mbox{\hyperlink{structlio__soft__command_a604102083dd4445c12ca625394e8ebd5}{rdatasize}}) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00677}00677                         rdp = (\textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__instr__rdp}{octeon\_instr\_rdp}} *)\&sc-\/>\mbox{\hyperlink{structlio__soft__command_a700d56e1f724f6dbb50abb77fd2d98f2}{cmd}}.\mbox{\hyperlink{unionlio__instr__64B_aa7ec9f85a5dee448e720d3779e0363c4}{cmd3}}.\mbox{\hyperlink{structlio__instr3__64B_a8023c4063c9f46f1adf4b391ff48d2be}{rdp}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00678}00678                         rdp-\/>\mbox{\hyperlink{structocteon__instr__rdp_ad2bf8e83b160668d302b52a9485acedc}{pcie\_port}} = oct-\/>\mbox{\hyperlink{structocteon__device_a784086072cc47554f23d04669f924dd3}{pcie\_port}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00679}00679                         rdp-\/>\mbox{\hyperlink{structocteon__instr__rdp_ad7c5f1564cf21458f47eff0ae55e971d}{rlen}} = sc-\/>\mbox{\hyperlink{structlio__soft__command_a604102083dd4445c12ca625394e8ebd5}{rdatasize}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00680}00680 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00681}00681                         irh-\/>\mbox{\hyperlink{structocteon__instr__irh_a2bb5bb3c1b4fa3036e9c78f7a7506d9a}{rflag}} = 1;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00682}00682                         \textcolor{comment}{/* PKI IH3 */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00683}00683                         \textcolor{comment}{/* pki\_ih3 irh+ossp[0]+ossp[1]+rdp+rptr = 48 bytes */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00684}00684                         ih3-\/>\mbox{\hyperlink{structocteon__instr__ih3_a1fc6526030a933243b21e9d39232527d}{fsz}} = \mbox{\hyperlink{lio__common_8h_a39c1c4976fa30db2e2f3c83953778cca}{LIO\_SOFTCMDRESP\_IH3}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00685}00685                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00686}00686                         irh-\/>\mbox{\hyperlink{structocteon__instr__irh_a2bb5bb3c1b4fa3036e9c78f7a7506d9a}{rflag}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00687}00687                         \textcolor{comment}{/* PKI IH3 */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00688}00688                         \textcolor{comment}{/* pki\_h3 + irh + ossp[0] + ossp[1] = 32 bytes */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00689}00689                         ih3-\/>\mbox{\hyperlink{structocteon__instr__ih3_a1fc6526030a933243b21e9d39232527d}{fsz}} = \mbox{\hyperlink{lio__common_8h_ab7ddbb3b292312831fe9989f77d2b39e}{LIO\_PCICMD\_O3}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00690}00690                 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00691}00691         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00692}00692 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00693}00693 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00694}00694 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00695}\mbox{\hyperlink{lio__iq_8h_a208aa2e8ecfdc37f4f3f961afd44c264}{00695}} \mbox{\hyperlink{lio__request__manager_8c_a208aa2e8ecfdc37f4f3f961afd44c264}{lio\_send\_soft\_command}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__soft__command}{lio\_soft\_command}} *sc)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00696}00696 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00697}00697         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__instr__ih3}{octeon\_instr\_ih3}} *ih3;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00698}00698         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__instr__irh}{octeon\_instr\_irh}} *irh;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00699}00699         uint32\_t                len = 0;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00700}00700 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00701}00701         \textcolor{keywordflow}{if} (\mbox{\hyperlink{lio__device_8h_a6d886e3e4427e03cb0c9b3bed8ee8728}{LIO\_CN23XX\_PF}}(oct)) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00702}00702                 ih3 = (\textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__instr__ih3}{octeon\_instr\_ih3}} *)\&sc-\/>\mbox{\hyperlink{structlio__soft__command_a700d56e1f724f6dbb50abb77fd2d98f2}{cmd}}.\mbox{\hyperlink{unionlio__instr__64B_aa7ec9f85a5dee448e720d3779e0363c4}{cmd3}}.\mbox{\hyperlink{structlio__instr3__64B_af412fd769c61734b9ec13857601e4ca7}{ih3}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00703}00703                 if (ih3-\/>\mbox{\hyperlink{structocteon__instr__ih3_ad5787c4e551749eca2e1e208665ceae9}{dlengsz}}) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00704}00704                         KASSERT(sc-\/>\mbox{\hyperlink{structlio__soft__command_a851e9f1d363b95b092bc4c84c45b1dcf}{dmadptr}}, (\textcolor{stringliteral}{"{}\%s, \%d, sc-\/>dmadptr is NULL"{}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00705}00705                                               \_\_func\_\_, \_\_LINE\_\_));}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00706}00706                         sc-\/>\mbox{\hyperlink{structlio__soft__command_a700d56e1f724f6dbb50abb77fd2d98f2}{cmd}}.\mbox{\hyperlink{unionlio__instr__64B_aa7ec9f85a5dee448e720d3779e0363c4}{cmd3}}.\mbox{\hyperlink{structlio__instr3__64B_ac19df0c9adaeb4d8532352ea9006d317}{dptr}} = sc-\/>\mbox{\hyperlink{structlio__soft__command_a851e9f1d363b95b092bc4c84c45b1dcf}{dmadptr}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00707}00707                 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00708}00708 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00709}00709                 irh = (\textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__instr__irh}{octeon\_instr\_irh}} *)\&sc-\/>\mbox{\hyperlink{structlio__soft__command_a700d56e1f724f6dbb50abb77fd2d98f2}{cmd}}.\mbox{\hyperlink{unionlio__instr__64B_aa7ec9f85a5dee448e720d3779e0363c4}{cmd3}}.\mbox{\hyperlink{structlio__instr3__64B_af53f292fb39e1eb4f33adbffaa00f7d3}{irh}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00710}00710                 if (irh-\/>\mbox{\hyperlink{structocteon__instr__irh_a2bb5bb3c1b4fa3036e9c78f7a7506d9a}{rflag}}) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00711}00711                         KASSERT(sc-\/>\mbox{\hyperlink{structlio__soft__command_ad671da5c5547b1cfcded8f9f07b9ae61}{dmarptr}}, (\textcolor{stringliteral}{"{}\%s, \%d, sc-\/>dmarptr is NULL"{}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00712}00712                                               \_\_func\_\_, \_\_LINE\_\_));}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00713}00713                         KASSERT(sc-\/>\mbox{\hyperlink{structlio__soft__command_a01a8cb64ee068bdd3ba55f404a99af56}{status\_word}}, (\textcolor{stringliteral}{"{}\%s, \%d, sc-\/>status\_word is NULL"{}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00714}00714                                                   \_\_func\_\_, \_\_LINE\_\_));}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00715}00715                         *sc-\/>\mbox{\hyperlink{structlio__soft__command_a01a8cb64ee068bdd3ba55f404a99af56}{status\_word}} = \mbox{\hyperlink{lio__iq_8h_a54ac797cb9154664456e42f47a4ab860}{COMPLETION\_WORD\_INIT}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00716}00716                         sc-\/>\mbox{\hyperlink{structlio__soft__command_a700d56e1f724f6dbb50abb77fd2d98f2}{cmd}}.\mbox{\hyperlink{unionlio__instr__64B_aa7ec9f85a5dee448e720d3779e0363c4}{cmd3}}.\mbox{\hyperlink{structlio__instr3__64B_a6db448de70bce721d96ef8122f32895d}{rptr}} = sc-\/>\mbox{\hyperlink{structlio__soft__command_ad671da5c5547b1cfcded8f9f07b9ae61}{dmarptr}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00717}00717                 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00718}00718                 len = (uint32\_t)ih3-\/>\mbox{\hyperlink{structocteon__instr__ih3_ad5787c4e551749eca2e1e208665ceae9}{dlengsz}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00719}00719         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00720}00720         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structlio__soft__command_a8e77d97141a049d956998e5bc28bc90d}{wait\_time}})}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00721}00721                 sc-\/>\mbox{\hyperlink{structlio__soft__command_aac44b9c90f9a025341b26e9fc101ec86}{timeout}} = ticks + \mbox{\hyperlink{lio__bsd_8h_ae6eb6d875a682c72af6de3d0fa0876e5}{lio\_ms\_to\_ticks}}(sc-\/>\mbox{\hyperlink{structlio__soft__command_a8e77d97141a049d956998e5bc28bc90d}{wait\_time}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00722}00722 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00723}00723         \textcolor{keywordflow}{return} (\mbox{\hyperlink{lio__request__manager_8c_ad69baa289afaf465ca55687cba8f8ff0}{lio\_send\_command}}(oct, sc-\/>\mbox{\hyperlink{structlio__soft__command_ad15512a7fe14de8f48679ea491ceef6d}{iq\_no}}, 1, \&sc-\/>\mbox{\hyperlink{structlio__soft__command_a700d56e1f724f6dbb50abb77fd2d98f2}{cmd}}, sc,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00724}00724                                  len, \mbox{\hyperlink{lio__iq_8h_a565fd3fdcde5b63b6ee2ad4ee3ce867a}{LIO\_REQTYPE\_SOFT\_COMMAND}}));}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00725}00725 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00726}00726 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00727}00727 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00728}\mbox{\hyperlink{lio__iq_8h_a25bafee1c52d75d9725a7b40406e9990}{00728}} \mbox{\hyperlink{lio__request__manager_8c_a25bafee1c52d75d9725a7b40406e9990}{lio\_setup\_sc\_buffer\_pool}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00729}00729 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00730}00730         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__soft__command}{lio\_soft\_command}} *sc;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00731}00731         uint64\_t                \mbox{\hyperlink{structlio__soft__command_a61048369d550bbfb3b1060d54cae12ba}{dma\_addr}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00732}00732         \textcolor{keywordtype}{int}                     i;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00733}00733 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00734}00734         STAILQ\_INIT(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_a84b1088b35244439ac4619b614f93f5c}{head}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00735}00735         mtx\_init(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_aa004e6ffb17d79efacb80020f2a476c6}{lock}}, \textcolor{stringliteral}{"{}sc\_pool\_lock"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00736}00736         atomic\_store\_rel\_int(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_a5eabd8deebddfaa8e7263955ddc7e91b}{alloc\_buf\_count}}, 0);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00737}00737 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00738}00738         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{lio__iq_8h_ad9bf9b88d763153073169d375e885554}{LIO\_MAX\_SOFT\_COMMAND\_BUFFERS}}; i++) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00739}00739                 sc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structlio__soft__command}{lio\_soft\_command}} *)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00740}00740                         \mbox{\hyperlink{lio__network_8h_a5cadbb52714f0c4c6eb2f61ff06a4a52}{lio\_dma\_alloc}}(\mbox{\hyperlink{lio__iq_8h_a5c2b5ef28df0842ea26bc630ca8b67f1}{LIO\_SOFT\_COMMAND\_BUFFER\_SIZE}}, (vm\_paddr\_t *)\&\mbox{\hyperlink{structlio__soft__command_a61048369d550bbfb3b1060d54cae12ba}{dma\_addr}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00741}00741                 \textcolor{keywordflow}{if} (sc == NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00742}00742                         \mbox{\hyperlink{lio__request__manager_8c_a1a098b81a6c70e9715022bff13860b4f}{lio\_free\_sc\_buffer\_pool}}(oct);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00743}00743                         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00744}00744                 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00745}00745 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00746}00746                 sc-\/>\mbox{\hyperlink{structlio__soft__command_a61048369d550bbfb3b1060d54cae12ba}{dma\_addr}} = \mbox{\hyperlink{structlio__soft__command_a61048369d550bbfb3b1060d54cae12ba}{dma\_addr}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00747}00747                 sc-\/>\mbox{\hyperlink{structlio__soft__command_aee6c6c4584fc15c588a4345eae4b5592}{size}} = \mbox{\hyperlink{lio__iq_8h_a5c2b5ef28df0842ea26bc630ca8b67f1}{LIO\_SOFT\_COMMAND\_BUFFER\_SIZE}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00748}00748 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00749}00749                 STAILQ\_INSERT\_TAIL(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_a84b1088b35244439ac4619b614f93f5c}{head}}, \&sc-\/>\mbox{\hyperlink{structlio__soft__command_abddb60881d4717d684ca6a1707b5c960}{node}}, entries);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00750}00750         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00751}00751 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00752}00752         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00753}00753 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00754}00754 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00755}00755 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00756}\mbox{\hyperlink{lio__iq_8h_a1a098b81a6c70e9715022bff13860b4f}{00756}} \mbox{\hyperlink{lio__request__manager_8c_a1a098b81a6c70e9715022bff13860b4f}{lio\_free\_sc\_buffer\_pool}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00757}00757 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00758}00758         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__stailq__node}{lio\_stailq\_node}}   *tmp, *tmp2;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00759}00759         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__soft__command}{lio\_soft\_command}} *sc;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00760}00760 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00761}00761         mtx\_lock(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_aa004e6ffb17d79efacb80020f2a476c6}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00762}00762 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00763}00763         STAILQ\_FOREACH\_SAFE(tmp, \&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_a84b1088b35244439ac4619b614f93f5c}{head}}, entries, tmp2) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00764}00764                 sc = \mbox{\hyperlink{lio__response__manager_8h_a8efea90da41534b9bf4cbb9d39d2af31}{LIO\_STAILQ\_FIRST\_ENTRY}}(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_a84b1088b35244439ac4619b614f93f5c}{head}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00765}00765                                             \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__soft__command}{lio\_soft\_command}}, \mbox{\hyperlink{structlio__soft__command_abddb60881d4717d684ca6a1707b5c960}{node}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00766}00766 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00767}00767                 STAILQ\_REMOVE\_HEAD(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_a84b1088b35244439ac4619b614f93f5c}{head}}, entries);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00768}00768 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00769}00769                 \mbox{\hyperlink{lio__network_8h_aa9eae17416dcdc92e8370166df882c34}{lio\_dma\_free}}(sc-\/>\mbox{\hyperlink{structlio__soft__command_aee6c6c4584fc15c588a4345eae4b5592}{size}}, sc);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00770}00770         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00771}00771 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00772}00772         STAILQ\_INIT(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_a84b1088b35244439ac4619b614f93f5c}{head}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00773}00773 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00774}00774         mtx\_unlock(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_aa004e6ffb17d79efacb80020f2a476c6}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00775}00775 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00776}00776         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00777}00777 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00778}00778 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00779}00779 \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__soft__command}{lio\_soft\_command}} *}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00780}\mbox{\hyperlink{lio__iq_8h_add1cd4d610e5132e206f17aa347c6116}{00780}} \mbox{\hyperlink{lio__request__manager_8c_add1cd4d610e5132e206f17aa347c6116}{lio\_alloc\_soft\_command}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, uint32\_t \mbox{\hyperlink{structlio__soft__command_a1de9fae89229b51c7a51950253bbe3e1}{datasize}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00781}00781                        uint32\_t \mbox{\hyperlink{structlio__soft__command_a604102083dd4445c12ca625394e8ebd5}{rdatasize}}, uint32\_t \mbox{\hyperlink{structlio__soft__command_ac0d64906eafcf10c7130bd5d8ef56119}{ctxsize}})}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00782}00782 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00783}00783         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__soft__command}{lio\_soft\_command}} *sc = NULL;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00784}00784         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__stailq__node}{lio\_stailq\_node}}   *tmp;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00785}00785         uint64\_t                dma\_addr;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00786}00786         uint32\_t                size;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00787}00787         uint32\_t                offset = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structlio__soft__command}{lio\_soft\_command}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00788}00788 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00789}00789         KASSERT((offset + \mbox{\hyperlink{structlio__soft__command_a1de9fae89229b51c7a51950253bbe3e1}{datasize}} + \mbox{\hyperlink{structlio__soft__command_a604102083dd4445c12ca625394e8ebd5}{rdatasize}} + \mbox{\hyperlink{structlio__soft__command_ac0d64906eafcf10c7130bd5d8ef56119}{ctxsize}}) <=}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00790}00790                 \mbox{\hyperlink{lio__iq_8h_a5c2b5ef28df0842ea26bc630ca8b67f1}{LIO\_SOFT\_COMMAND\_BUFFER\_SIZE}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00791}00791                 (\textcolor{stringliteral}{"{}\%s, \%d, offset + datasize + rdatasize + ctxsize > LIO\_SOFT\_COMMAND\_BUFFER\_SIZE"{}},}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00792}00792                  \_\_func\_\_, \_\_LINE\_\_));}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00793}00793 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00794}00794         mtx\_lock(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_aa004e6ffb17d79efacb80020f2a476c6}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00795}00795 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00796}00796         \textcolor{keywordflow}{if} (STAILQ\_EMPTY(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_a84b1088b35244439ac4619b614f93f5c}{head}})) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00797}00797                 mtx\_unlock(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_aa004e6ffb17d79efacb80020f2a476c6}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00798}00798                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00799}00799         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00800}00800         tmp = STAILQ\_LAST(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_a84b1088b35244439ac4619b614f93f5c}{head}}, \mbox{\hyperlink{structlio__stailq__node}{lio\_stailq\_node}}, entries);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00801}00801 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00802}00802         STAILQ\_REMOVE(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_a84b1088b35244439ac4619b614f93f5c}{head}}, tmp, \mbox{\hyperlink{structlio__stailq__node}{lio\_stailq\_node}}, entries);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00803}00803 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00804}00804         atomic\_add\_int(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_a5eabd8deebddfaa8e7263955ddc7e91b}{alloc\_buf\_count}}, 1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00805}00805 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00806}00806         mtx\_unlock(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_aa004e6ffb17d79efacb80020f2a476c6}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00807}00807 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00808}00808         sc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structlio__soft__command}{lio\_soft\_command}} *)tmp;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00809}00809 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00810}00810         \mbox{\hyperlink{structlio__soft__command_a61048369d550bbfb3b1060d54cae12ba}{dma\_addr}} = sc-\/>\mbox{\hyperlink{structlio__soft__command_a61048369d550bbfb3b1060d54cae12ba}{dma\_addr}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00811}00811         \mbox{\hyperlink{structlio__soft__command_aee6c6c4584fc15c588a4345eae4b5592}{size}} = sc-\/>\mbox{\hyperlink{structlio__soft__command_aee6c6c4584fc15c588a4345eae4b5592}{size}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00812}00812 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00813}00813         bzero(sc, sc-\/>\mbox{\hyperlink{structlio__soft__command_aee6c6c4584fc15c588a4345eae4b5592}{size}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00814}00814 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00815}00815         sc-\/>\mbox{\hyperlink{structlio__soft__command_a61048369d550bbfb3b1060d54cae12ba}{dma\_addr}} = \mbox{\hyperlink{structlio__soft__command_a61048369d550bbfb3b1060d54cae12ba}{dma\_addr}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00816}00816         sc-\/>\mbox{\hyperlink{structlio__soft__command_aee6c6c4584fc15c588a4345eae4b5592}{size}} = \mbox{\hyperlink{structlio__soft__command_aee6c6c4584fc15c588a4345eae4b5592}{size}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00817}00817 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00818}00818         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structlio__soft__command_ac0d64906eafcf10c7130bd5d8ef56119}{ctxsize}}) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00819}00819                 sc-\/>\mbox{\hyperlink{structlio__soft__command_a288d7c6ce348f6c917681748ebf432fd}{ctxptr}} = (uint8\_t *)sc + offset;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00820}00820                 sc-\/>\mbox{\hyperlink{structlio__soft__command_ac0d64906eafcf10c7130bd5d8ef56119}{ctxsize}} = \mbox{\hyperlink{structlio__soft__command_ac0d64906eafcf10c7130bd5d8ef56119}{ctxsize}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00821}00821         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00822}00822 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00823}00823         \textcolor{comment}{/* Start data at 128 byte boundary */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00824}00824         offset = (offset + \mbox{\hyperlink{structlio__soft__command_ac0d64906eafcf10c7130bd5d8ef56119}{ctxsize}} + 127) \& 0xffffff80;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00825}00825 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00826}00826         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structlio__soft__command_a1de9fae89229b51c7a51950253bbe3e1}{datasize}}) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00827}00827                 sc-\/>\mbox{\hyperlink{structlio__soft__command_acaf5313ed39db3b404d471eb73a6494d}{virtdptr}} = (uint8\_t *)sc + offset;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00828}00828                 sc-\/>\mbox{\hyperlink{structlio__soft__command_a851e9f1d363b95b092bc4c84c45b1dcf}{dmadptr}} = \mbox{\hyperlink{structlio__soft__command_a61048369d550bbfb3b1060d54cae12ba}{dma\_addr}} + offset;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00829}00829                 sc-\/>\mbox{\hyperlink{structlio__soft__command_a1de9fae89229b51c7a51950253bbe3e1}{datasize}} = \mbox{\hyperlink{structlio__soft__command_a1de9fae89229b51c7a51950253bbe3e1}{datasize}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00830}00830         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00831}00831         \textcolor{comment}{/* Start rdata at 128 byte boundary */}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00832}00832         offset = (offset + \mbox{\hyperlink{structlio__soft__command_a1de9fae89229b51c7a51950253bbe3e1}{datasize}} + 127) \& 0xffffff80;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00833}00833 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00834}00834         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structlio__soft__command_a604102083dd4445c12ca625394e8ebd5}{rdatasize}}) \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00835}00835                 KASSERT(\mbox{\hyperlink{structlio__soft__command_a604102083dd4445c12ca625394e8ebd5}{rdatasize}} >= 16, (\textcolor{stringliteral}{"{}\%s, \%d, rdatasize < 16"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00836}00836                                           \_\_LINE\_\_));}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00837}00837                 sc-\/>\mbox{\hyperlink{structlio__soft__command_aacfcbb9eb30a919cbc55077f21490974}{virtrptr}} = (uint8\_t *)sc + offset;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00838}00838                 sc-\/>\mbox{\hyperlink{structlio__soft__command_ad671da5c5547b1cfcded8f9f07b9ae61}{dmarptr}} = \mbox{\hyperlink{structlio__soft__command_a61048369d550bbfb3b1060d54cae12ba}{dma\_addr}} + offset;}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00839}00839                 sc-\/>\mbox{\hyperlink{structlio__soft__command_a604102083dd4445c12ca625394e8ebd5}{rdatasize}} = \mbox{\hyperlink{structlio__soft__command_a604102083dd4445c12ca625394e8ebd5}{rdatasize}};}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00840}00840                 sc-\/>\mbox{\hyperlink{structlio__soft__command_a01a8cb64ee068bdd3ba55f404a99af56}{status\_word}} = (uint64\_t *)((uint8\_t *)(sc-\/>\mbox{\hyperlink{structlio__soft__command_aacfcbb9eb30a919cbc55077f21490974}{virtrptr}}) +}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00841}00841                                                \mbox{\hyperlink{structlio__soft__command_a604102083dd4445c12ca625394e8ebd5}{rdatasize}} -\/ 8);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00842}00842         \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00843}00843         \textcolor{keywordflow}{return} (sc);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00844}00844 \}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00845}00845 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00846}00846 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00847}\mbox{\hyperlink{lio__iq_8h_aeacdddc60eaf524a3482cbd54a8e6fb0}{00847}} \mbox{\hyperlink{lio__request__manager_8c_aeacdddc60eaf524a3482cbd54a8e6fb0}{lio\_free\_soft\_command}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct,}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00848}00848                       \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__soft__command}{lio\_soft\_command}} *sc)}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00849}00849 \{}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00850}00850 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00851}00851         mtx\_lock(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_aa004e6ffb17d79efacb80020f2a476c6}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00852}00852 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00853}00853         STAILQ\_INSERT\_TAIL(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_a84b1088b35244439ac4619b614f93f5c}{head}}, \&sc-\/>\mbox{\hyperlink{structlio__soft__command_abddb60881d4717d684ca6a1707b5c960}{node}}, entries);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00854}00854 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00855}00855         atomic\_subtract\_int(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_a5eabd8deebddfaa8e7263955ddc7e91b}{alloc\_buf\_count}}, 1);}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00856}00856 }
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00857}00857         mtx\_unlock(\&oct-\/>\mbox{\hyperlink{structocteon__device_a66a8e8ef71aff7e5cee26c99bbaef987}{sc\_buf\_pool}}.\mbox{\hyperlink{structlio__sc__buffer__pool_aa004e6ffb17d79efacb80020f2a476c6}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__request__manager_8c_source_l00858}00858 \}}

\end{DoxyCode}
