\hypertarget{lio__droq_8c_source}{}\doxysection{lio\+\_\+droq.\+c}
\label{lio__droq_8c_source}\index{dev/liquidio/base/lio\_droq.c@{dev/liquidio/base/lio\_droq.c}}
\mbox{\hyperlink{lio__droq_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00001}00001 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00002}00002 \textcolor{comment}{ *   BSD LICENSE}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00004}00004 \textcolor{comment}{ *   Copyright(c) 2017 Cavium, Inc.. All rights reserved.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00005}00005 \textcolor{comment}{ *   All rights reserved.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00007}00007 \textcolor{comment}{ *   Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00008}00008 \textcolor{comment}{ *   modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00009}00009 \textcolor{comment}{ *   are met:}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00011}00011 \textcolor{comment}{ *     * Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00012}00012 \textcolor{comment}{ *       notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00013}00013 \textcolor{comment}{ *     * Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00014}00014 \textcolor{comment}{ *       notice, this list of conditions and the following disclaimer in}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00015}00015 \textcolor{comment}{ *       the documentation and/or other materials provided with the}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00016}00016 \textcolor{comment}{ *       distribution.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00017}00017 \textcolor{comment}{ *     * Neither the name of Cavium, Inc. nor the names of its}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00018}00018 \textcolor{comment}{ *       contributors may be used to endorse or promote products derived}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00019}00019 \textcolor{comment}{ *       from this software without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00020}00020 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00021}00021 \textcolor{comment}{ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00022}00022 \textcolor{comment}{ *   "{}AS IS"{} AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00023}00023 \textcolor{comment}{ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00024}00024 \textcolor{comment}{ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00025}00025 \textcolor{comment}{ *   OWNER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00026}00026 \textcolor{comment}{ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00027}00027 \textcolor{comment}{ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00028}00028 \textcolor{comment}{ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00029}00029 \textcolor{comment}{ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00030}00030 \textcolor{comment}{ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00031}00031 \textcolor{comment}{ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00032}00032 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00033}00033 \textcolor{comment}{/*\$FreeBSD\$*/}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00035}00035 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__bsd_8h}{lio\_bsd.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00036}00036 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__common_8h}{lio\_common.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00037}00037 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__droq_8h}{lio\_droq.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00038}00038 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__iq_8h}{lio\_iq.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00039}00039 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__response__manager_8h}{lio\_response\_manager.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00040}00040 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__device_8h}{lio\_device.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00041}00041 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__main_8h}{lio\_main.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00042}00042 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{cn23xx__pf__device_8h}{cn23xx\_pf\_device.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00043}00043 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__network_8h}{lio\_network.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00045}\mbox{\hyperlink{struct____dispatch}{00045}} \textcolor{keyword}{struct }\mbox{\hyperlink{struct____dispatch}{\_\_dispatch}} \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00046}\mbox{\hyperlink{struct____dispatch_ae8f26aab4c3ad09af12a71e471217231}{00046}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__stailq__node}{lio\_stailq\_node}}   \mbox{\hyperlink{struct____dispatch_ae8f26aab4c3ad09af12a71e471217231}{node}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00047}\mbox{\hyperlink{struct____dispatch_a5aa25ef93235012300c32eaf3d6e18fc}{00047}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__recv__info}{lio\_recv\_info}}       *\mbox{\hyperlink{struct____dispatch_a5aa25ef93235012300c32eaf3d6e18fc}{rinfo}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00048}\mbox{\hyperlink{struct____dispatch_aee1d5af70f5ed1532f1d9ec96645053f}{00048}}         \mbox{\hyperlink{lio__droq_8h_ad5ea08f46f27dc54d86cc04739eacd0f}{lio\_dispatch\_fn\_t}}      \mbox{\hyperlink{struct____dispatch_aee1d5af70f5ed1532f1d9ec96645053f}{disp\_fn}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00049}00049 \};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00051}00051 \textcolor{keywordtype}{void}    *\mbox{\hyperlink{lio__droq_8c_a0085e7e6a8cdeda47e47d57eb5ced197}{lio\_get\_dispatch\_arg}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00052}00052                               uint16\_t opcode, uint16\_t subcode);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00053}00053 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00054}00054 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00055}00055 \textcolor{comment}{ *  Get the argument that the user set when registering dispatch}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00056}00056 \textcolor{comment}{ *  function for a given opcode/subcode.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00057}00057 \textcolor{comment}{ *  @param  octeon\_dev -\/ the octeon device pointer.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00058}00058 \textcolor{comment}{ *  @param  opcode     -\/ the opcode for which the dispatch argument}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00059}00059 \textcolor{comment}{ *                       is to be checked.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00060}00060 \textcolor{comment}{ *  @param  subcode    -\/ the subcode for which the dispatch argument}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00061}00061 \textcolor{comment}{ *                       is to be checked.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00062}00062 \textcolor{comment}{ *  @return  Success: void * (argument to the dispatch function)}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00063}00063 \textcolor{comment}{ *  @return  Failure: NULL}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00064}00064 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00065}00065 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00066}00066 \textcolor{keywordtype}{void}   *}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00067}\mbox{\hyperlink{lio__droq_8c_a0085e7e6a8cdeda47e47d57eb5ced197}{00067}} \mbox{\hyperlink{lio__droq_8c_a0085e7e6a8cdeda47e47d57eb5ced197}{lio\_get\_dispatch\_arg}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *octeon\_dev,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00068}00068                      uint16\_t opcode, uint16\_t subcode)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00069}00069 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00070}00070         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__stailq__node}{lio\_stailq\_node}}   *dispatch;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00071}00071         \textcolor{keywordtype}{void}                    *fn\_arg = NULL;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00072}00072         \textcolor{keywordtype}{int}                     idx;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00073}00073         uint16\_t                combined\_opcode;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00074}00074 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00075}00075         combined\_opcode = \mbox{\hyperlink{lio__common_8h_ab0ba764f2e92752462effa789d8582b1}{LIO\_OPCODE\_SUBCODE}}(opcode, subcode);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00076}00076 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00077}00077         idx = combined\_opcode \& \mbox{\hyperlink{lio__config_8h_a4550e561bc22eb5bbfe4638fa073bf15}{LIO\_OPCODE\_MASK}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00078}00078 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00079}00079         mtx\_lock(\&octeon\_dev-\/>\mbox{\hyperlink{structocteon__device_a9930fbafc3665b5500e77fcc3b79a113}{dispatch}}.\mbox{\hyperlink{structlio__dispatch__list_a3ac2b6826d8da3a47340542203a4c9d8}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00080}00080 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00081}00081         \textcolor{keywordflow}{if} (octeon\_dev-\/>\mbox{\hyperlink{structocteon__device_a9930fbafc3665b5500e77fcc3b79a113}{dispatch}}.\mbox{\hyperlink{structlio__dispatch__list_ae99bb7ab5c9c9f1300e678d56aaee0d4}{count}} == 0) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00082}00082                 mtx\_unlock(\&octeon\_dev-\/>\mbox{\hyperlink{structocteon__device_a9930fbafc3665b5500e77fcc3b79a113}{dispatch}}.\mbox{\hyperlink{structlio__dispatch__list_a3ac2b6826d8da3a47340542203a4c9d8}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00083}00083                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00084}00084         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00085}00085 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00086}00086         \textcolor{keywordflow}{if} (octeon\_dev-\/>\mbox{\hyperlink{structocteon__device_a9930fbafc3665b5500e77fcc3b79a113}{dispatch}}.\mbox{\hyperlink{structlio__dispatch__list_a9b03bcab72fc036a9e30ac65c20f2682}{dlist}}[idx].\mbox{\hyperlink{structlio__dispatch_a646af9bd2b4c86518a5f35f1591716a0}{opcode}} == combined\_opcode) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00087}00087                 fn\_arg = octeon\_dev-\/>\mbox{\hyperlink{structocteon__device_a9930fbafc3665b5500e77fcc3b79a113}{dispatch}}.\mbox{\hyperlink{structlio__dispatch__list_a9b03bcab72fc036a9e30ac65c20f2682}{dlist}}[idx].\mbox{\hyperlink{structlio__dispatch_a5401a4e33d371d0d019b259cfde6e4dc}{arg}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00088}00088         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00089}00089                 STAILQ\_FOREACH(dispatch,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00090}00090                                \&octeon\_dev-\/>\mbox{\hyperlink{structocteon__device_a9930fbafc3665b5500e77fcc3b79a113}{dispatch}}.\mbox{\hyperlink{structlio__dispatch__list_a9b03bcab72fc036a9e30ac65c20f2682}{dlist}}[idx].\mbox{\hyperlink{structlio__dispatch_ad04cbaa77e9013ae4553b403ab5037c7}{head}}, entries) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00091}00091                         \textcolor{keywordflow}{if} (((\textcolor{keyword}{struct} \mbox{\hyperlink{structlio__dispatch}{lio\_dispatch}} *)dispatch)-\/>opcode ==}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00092}00092                             combined\_opcode) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00093}00093                                 fn\_arg = ((\textcolor{keyword}{struct }\mbox{\hyperlink{structlio__dispatch}{lio\_dispatch}} *)dispatch)-\/>arg;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00094}00094                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00095}00095                         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00096}00096                 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00097}00097         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00099}00099         mtx\_unlock(\&octeon\_dev-\/>\mbox{\hyperlink{structocteon__device_a9930fbafc3665b5500e77fcc3b79a113}{dispatch}}.\mbox{\hyperlink{structlio__dispatch__list_a3ac2b6826d8da3a47340542203a4c9d8}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00100}00100         \textcolor{keywordflow}{return} (fn\_arg);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00101}00101 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00103}00103 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00104}00104 \textcolor{comment}{ *  Check for packets on Droq. This function should be called with lock held.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00105}00105 \textcolor{comment}{ *  @param  droq -\/ Droq on which count is checked.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00106}00106 \textcolor{comment}{ *  @return Returns packet count.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00107}00107 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00108}00108 uint32\_t}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00109}\mbox{\hyperlink{lio__droq_8c_ad33dc530043bc887d6cfdc451be9794a}{00109}} \mbox{\hyperlink{lio__droq_8c_ad33dc530043bc887d6cfdc451be9794a}{lio\_droq\_check\_hw\_for\_pkts}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq}{lio\_droq}} *droq)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00110}00110 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00111}00111         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__device}{octeon\_device}}       *oct = \mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_abfe9c93b6ecc98001aee1aba83e2d237}{oct\_dev}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00112}00112         uint32\_t                last\_count;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00113}00113         uint32\_t                pkt\_count = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00114}00114 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00115}00115         pkt\_count = \mbox{\hyperlink{lio__device_8h_af7ada375bed24a2721a516ad01e40c80}{lio\_read\_csr32}}(oct, \mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_a21beaa31b946600c6e1c9652f909d41e}{pkts\_sent\_reg}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00116}00116 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00117}00117         last\_count = pkt\_count -\/ \mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_a7e4188ebcc228a188655c0d72ddfab57}{pkt\_count}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00118}00118         \mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_a7e4188ebcc228a188655c0d72ddfab57}{pkt\_count}} = pkt\_count;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00119}00119 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00120}00120         \textcolor{comment}{/* we shall write to cnts at the end of processing */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00121}00121         \textcolor{keywordflow}{if} (last\_count)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00122}00122                 atomic\_add\_int(\&\mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_ad2d6a2f0ddd1504443b2c4e78c2f4844}{pkts\_pending}}, last\_count);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00123}00123 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00124}00124         \textcolor{keywordflow}{return} (last\_count);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00125}00125 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00126}00126 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00127}00127 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00128}\mbox{\hyperlink{lio__droq_8c_a4e2b77e5a174083858213e208331cd3a}{00128}} \mbox{\hyperlink{lio__droq_8c_a4e2b77e5a174083858213e208331cd3a}{lio\_droq\_compute\_max\_packet\_bufs}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq}{lio\_droq}} *\mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}})}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00129}00129 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00130}00130         uint32\_t        count = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00132}00132         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00133}00133 \textcolor{comment}{         * max\_empty\_descs is the max. no. of descs that can have no buffers.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00134}00134 \textcolor{comment}{         * If the empty desc count goes beyond this value, we cannot safely}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00135}00135 \textcolor{comment}{         * read in a 64K packet sent by Octeon}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00136}00136 \textcolor{comment}{         * (64K is max pkt size from Octeon)}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00137}00137 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00138}00138         \mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_a52a418d93af4d0028c9dd4917cdbbf74}{max\_empty\_descs}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00139}00139 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00140}00140         \textcolor{keywordflow}{do} \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00141}00141                 \mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_a52a418d93af4d0028c9dd4917cdbbf74}{max\_empty\_descs}}++;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00142}00142                 count += \mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_a1ae80ac1aa8801f7ba98f5934bcd50a1}{buffer\_size}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00143}00143         \} \textcolor{keywordflow}{while} (count < (64 * 1024));}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00144}00144 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00145}00145         \mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_a52a418d93af4d0028c9dd4917cdbbf74}{max\_empty\_descs}} = \mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}} -\/ \mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_a52a418d93af4d0028c9dd4917cdbbf74}{max\_empty\_descs}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00146}00146 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00148}00148 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00149}\mbox{\hyperlink{lio__droq_8c_a168561952e41b7f2e5c7462175290c87}{00149}} \mbox{\hyperlink{lio__droq_8c_a168561952e41b7f2e5c7462175290c87}{lio\_droq\_reset\_indices}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq}{lio\_droq}} *\mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}})}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00150}00150 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00151}00151 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00152}00152         \mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00153}00153         \mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_a19aff95c84a1e597bfe02cb77852743b}{refill\_idx}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00154}00154         \mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_aca3878dba23d563bf2279feddba97491}{refill\_count}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00155}00155         atomic\_store\_rel\_int(\&\mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_ad2d6a2f0ddd1504443b2c4e78c2f4844}{pkts\_pending}}, 0);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00156}00156 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00157}00157 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00158}00158 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00159}\mbox{\hyperlink{lio__droq_8c_a36d98e438bf3b6a989fc4136ca624e50}{00159}} \mbox{\hyperlink{lio__droq_8c_a36d98e438bf3b6a989fc4136ca624e50}{lio\_droq\_destroy\_ring\_buffers}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00160}00160                               \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq}{lio\_droq}} *\mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}})}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00161}00161 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00162}00162         uint32\_t        i;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00163}00163 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00164}00164         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}}; i++) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00165}00165                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[i].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00166}00166                         \mbox{\hyperlink{lio__network_8h_a567443b40ed2cc007f9eb3a146779059}{lio\_recv\_buffer\_free}}(\mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[i].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00167}00167                         \mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[i].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}} = NULL;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00168}00168                 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00169}00169         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00170}00170 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00171}00171         \mbox{\hyperlink{lio__droq_8c_a168561952e41b7f2e5c7462175290c87}{lio\_droq\_reset\_indices}}(\mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00172}00172 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00173}00173 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00174}00174 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00175}\mbox{\hyperlink{lio__droq_8c_aaba1ae540987fbb26f1b9f1c1db3a962}{00175}} \mbox{\hyperlink{lio__droq_8c_aaba1ae540987fbb26f1b9f1c1db3a962}{lio\_droq\_setup\_ring\_buffers}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00176}00176                             \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq}{lio\_droq}} *\mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}})}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00177}00177 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00178}00178         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__droq__desc}{lio\_droq\_desc}}       *desc\_ring = droq-\/>\mbox{\hyperlink{structlio__droq_a964950f902d9033c717463b2ca020b79}{desc\_ring}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00179}00179         \textcolor{keywordtype}{void}                    *buf;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00180}00180         uint32\_t                i;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00181}00181 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00182}00182         \textcolor{keywordflow}{for} (i = 0; i < droq-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}}; i++) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00183}00183                 buf = \mbox{\hyperlink{lio__network_8h_a27ad60010e29678678bd4f24f37992c9}{lio\_recv\_buffer\_alloc}}(droq-\/>\mbox{\hyperlink{structlio__droq_a1ae80ac1aa8801f7ba98f5934bcd50a1}{buffer\_size}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00184}00184 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00185}00185                 \textcolor{keywordflow}{if} (buf == NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00186}00186                         \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}\%s buffer alloc failed\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00187}00187                                     \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00188}00188                         droq-\/>\mbox{\hyperlink{structlio__droq_a8f9ff977aef838fdce6aee0d18286afb}{stats}}.\mbox{\hyperlink{structlio__droq__stats_a10cefb6fb2997dc4dfc4287b170cab5c}{rx\_alloc\_failure}}++;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00189}00189                         \textcolor{keywordflow}{return} (-\/ENOMEM);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00190}00190                 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00191}00191 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00192}00192                 droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[i].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}} = buf;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00193}00193                 droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[i].\mbox{\hyperlink{structlio__recv__buffer_a15a275f9e0810091cf5b426e42a2b61d}{data}} = ((\textcolor{keyword}{struct }mbuf *)buf)-\/>m\_data;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00194}00194                 desc\_ring[i].\mbox{\hyperlink{structlio__droq__desc_a0dfd463cdca83b05fe986356a28bba25}{info\_ptr}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00195}00195                 desc\_ring[i].\mbox{\hyperlink{structlio__droq__desc_a04ffb7c6d114c12003c5caaeed6b2a2a}{buffer\_ptr}} =}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00196}00196                         \mbox{\hyperlink{lio__network_8h_ae1c4b45f6c758ab48bfab0a1a0b38455}{lio\_map\_ring}}(oct-\/>\mbox{\hyperlink{structocteon__device_a2d1f835586ad43c0e0be46da81cd0f3c}{device}}, droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[i].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00197}00197                                      droq-\/>\mbox{\hyperlink{structlio__droq_a1ae80ac1aa8801f7ba98f5934bcd50a1}{buffer\_size}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00198}00198         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00199}00199 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00200}00200         \mbox{\hyperlink{lio__droq_8c_a168561952e41b7f2e5c7462175290c87}{lio\_droq\_reset\_indices}}(droq);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00202}00202         \mbox{\hyperlink{lio__droq_8c_a4e2b77e5a174083858213e208331cd3a}{lio\_droq\_compute\_max\_packet\_bufs}}(droq);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00203}00203 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00204}00204         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00205}00205 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00206}00206 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00207}00207 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00208}\mbox{\hyperlink{lio__droq_8c_a2bfce0bc110d2d53e2b5ab44151600e6}{00208}} \mbox{\hyperlink{lio__droq_8c_a2bfce0bc110d2d53e2b5ab44151600e6}{lio\_delete\_droq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, uint32\_t q\_no)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00209}00209 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00210}00210         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__droq}{lio\_droq}} *droq = oct-\/>\mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}[\mbox{\hyperlink{structlio__droq_a47165d09beab28fd12aff1d79cfb3cab}{q\_no}}];}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00211}00211 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00212}00212         \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(oct, \textcolor{stringliteral}{"{}\%s[\%d]\(\backslash\)n"{}}, \_\_func\_\_, \mbox{\hyperlink{structlio__droq_a47165d09beab28fd12aff1d79cfb3cab}{q\_no}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00213}00213 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00214}00214         \textcolor{keywordflow}{while} (taskqueue\_cancel(droq-\/>\mbox{\hyperlink{structlio__droq_ab239046de0e4e7b355023308f5bced5b}{droq\_taskqueue}}, \&droq-\/>\mbox{\hyperlink{structlio__droq_aec53447ea85ed1c19cd8b7e0cea12cfe}{droq\_task}}, NULL))}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00215}00215                 taskqueue\_drain(droq-\/>\mbox{\hyperlink{structlio__droq_ab239046de0e4e7b355023308f5bced5b}{droq\_taskqueue}}, \&droq-\/>\mbox{\hyperlink{structlio__droq_aec53447ea85ed1c19cd8b7e0cea12cfe}{droq\_task}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00216}00216 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00217}00217         taskqueue\_free(droq-\/>\mbox{\hyperlink{structlio__droq_ab239046de0e4e7b355023308f5bced5b}{droq\_taskqueue}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00218}00218         droq-\/>\mbox{\hyperlink{structlio__droq_ab239046de0e4e7b355023308f5bced5b}{droq\_taskqueue}} = NULL;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00219}00219 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00220}00220         \mbox{\hyperlink{lio__droq_8c_a36d98e438bf3b6a989fc4136ca624e50}{lio\_droq\_destroy\_ring\_buffers}}(oct, droq);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00221}00221         free(droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00222}00222 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00223}00223         \textcolor{keywordflow}{if} (droq-\/>\mbox{\hyperlink{structlio__droq_a964950f902d9033c717463b2ca020b79}{desc\_ring}} != NULL)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00224}00224                 \mbox{\hyperlink{lio__network_8h_aa9eae17416dcdc92e8370166df882c34}{lio\_dma\_free}}((droq-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}} * \mbox{\hyperlink{lio__droq_8h_af2c0bcd9defa87c1aaa24938bbf31604}{LIO\_DROQ\_DESC\_SIZE}}),}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00225}00225                              droq-\/>\mbox{\hyperlink{structlio__droq_a964950f902d9033c717463b2ca020b79}{desc\_ring}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00226}00226 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00227}00227         oct-\/>\mbox{\hyperlink{structocteon__device_a2572013042e73f339174c82cf587494c}{io\_qmask}}.\mbox{\hyperlink{structlio__io__enable_a4eef5bebf2bae1622649170bdb0bb774}{oq}} \&= \string~(1ULL << \mbox{\hyperlink{structlio__droq_a47165d09beab28fd12aff1d79cfb3cab}{q\_no}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00228}00228         bzero(oct-\/>\mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}[\mbox{\hyperlink{structlio__droq_a47165d09beab28fd12aff1d79cfb3cab}{q\_no}}], \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq}{lio\_droq}}));}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00229}00229         oct-\/>\mbox{\hyperlink{structocteon__device_a54c2f2f4558411f501e0f46dab998d52}{num\_oqs}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00230}00230 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00231}00231         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00232}00232 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00234}00234 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00235}\mbox{\hyperlink{lio__droq_8c_afc56a097d4b8c16de11eab8cd58a0a4b}{00235}} \mbox{\hyperlink{lio__droq_8c_afc56a097d4b8c16de11eab8cd58a0a4b}{lio\_droq\_bh}}(\textcolor{keywordtype}{void} *ptr, \textcolor{keywordtype}{int} pending \_\_unused)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00236}00236 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00237}00237         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__droq}{lio\_droq}}         *droq = ptr;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00238}00238         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__device}{octeon\_device}}       *oct = \mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}-\/>\mbox{\hyperlink{structlio__droq_abfe9c93b6ecc98001aee1aba83e2d237}{oct\_dev}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00239}00239         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__instr__queue}{lio\_instr\_queue}}   *iq = oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[droq-\/>\mbox{\hyperlink{structlio__droq_a47165d09beab28fd12aff1d79cfb3cab}{q\_no}}];}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00240}00240         \textcolor{keywordtype}{int}     reschedule, tx\_done = 1;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00241}00241 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00242}00242         reschedule = \mbox{\hyperlink{lio__droq_8c_a8d74c6fbc7377197651c550150bdca0a}{lio\_droq\_process\_packets}}(oct, droq, oct-\/>\mbox{\hyperlink{structocteon__device_a5c44ee18a555ca84d4c999d0b9e53595}{rx\_budget}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00243}00243 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00244}00244         \textcolor{keywordflow}{if} (atomic\_load\_acq\_int(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_a2ba81d22f0552e9e2dab0dbed1c378b2}{instr\_pending}}))}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00245}00245                 tx\_done = \mbox{\hyperlink{lio__iq_8h_a963139a14cc9f08985e3a319c3b0b863}{lio\_flush\_iq}}(oct, iq, oct-\/>\mbox{\hyperlink{structocteon__device_aace791b16fff0fdf160b522f8bbf72c1}{tx\_budget}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00246}00246 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00247}00247         \textcolor{keywordflow}{if} (reschedule || !tx\_done)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00248}00248                 taskqueue\_enqueue(droq-\/>\mbox{\hyperlink{structlio__droq_ab239046de0e4e7b355023308f5bced5b}{droq\_taskqueue}}, \&droq-\/>\mbox{\hyperlink{structlio__droq_aec53447ea85ed1c19cd8b7e0cea12cfe}{droq\_task}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00249}00249         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00250}00250                 \mbox{\hyperlink{lio__device_8c_a2a05dfb4afadd2182b26674ca21d6ffb}{lio\_enable\_irq}}(droq, iq);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00251}00251 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00252}00252 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00253}00253 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00254}\mbox{\hyperlink{lio__droq_8c_a066447f50e87b50de4e48d7c01ee779c}{00254}} \mbox{\hyperlink{lio__droq_8c_a066447f50e87b50de4e48d7c01ee779c}{lio\_init\_droq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, uint32\_t q\_no,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00255}00255               uint32\_t num\_descs, uint32\_t desc\_size, \textcolor{keywordtype}{void} *\mbox{\hyperlink{structlio__instr__queue_a2003bc06e8366c1382cce010e187aa85}{app\_ctx}})}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00256}00256 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00257}00257         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__droq}{lio\_droq}} *droq;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00258}00258         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long}   size;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00259}00259         uint32\_t        c\_buf\_size = 0, c\_num\_descs = 0, c\_pkts\_per\_intr = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00260}00260         uint32\_t        c\_refill\_threshold = 0, desc\_ring\_size = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00261}00261 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00262}00262         \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(oct, \textcolor{stringliteral}{"{}\%s[\%d]\(\backslash\)n"{}}, \_\_func\_\_, \mbox{\hyperlink{structlio__droq_a47165d09beab28fd12aff1d79cfb3cab}{q\_no}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00263}00263 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00264}00264         droq = oct-\/>\mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}[\mbox{\hyperlink{structlio__droq_a47165d09beab28fd12aff1d79cfb3cab}{q\_no}}];}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00265}00265         bzero(droq, \mbox{\hyperlink{lio__droq_8h_a5b62cdc01704410922ce9eedf88ba02c}{LIO\_DROQ\_SIZE}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00266}00266 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00267}00267         droq-\/>\mbox{\hyperlink{structlio__droq_abfe9c93b6ecc98001aee1aba83e2d237}{oct\_dev}} = oct;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00268}00268         droq-\/>\mbox{\hyperlink{structlio__droq_a47165d09beab28fd12aff1d79cfb3cab}{q\_no}} = \mbox{\hyperlink{structlio__droq_a47165d09beab28fd12aff1d79cfb3cab}{q\_no}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00269}00269         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structlio__droq_aebd798671f0dd78fd015b80946635234}{app\_ctx}} != NULL)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00270}00270                 droq-\/>\mbox{\hyperlink{structlio__droq_aebd798671f0dd78fd015b80946635234}{app\_ctx}} = \mbox{\hyperlink{structlio__droq_aebd798671f0dd78fd015b80946635234}{app\_ctx}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00271}00271         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00272}00272                 droq-\/>\mbox{\hyperlink{structlio__droq_aebd798671f0dd78fd015b80946635234}{app\_ctx}} = (\textcolor{keywordtype}{void} *)(\textcolor{keywordtype}{size\_t})\mbox{\hyperlink{structlio__droq_a47165d09beab28fd12aff1d79cfb3cab}{q\_no}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00273}00273 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00274}00274         c\_num\_descs = num\_descs;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00275}00275         c\_buf\_size = desc\_size;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00276}00276         \textcolor{keywordflow}{if} (\mbox{\hyperlink{lio__device_8h_a6d886e3e4427e03cb0c9b3bed8ee8728}{LIO\_CN23XX\_PF}}(oct)) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00277}00277                 \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__config}{lio\_config}} *conf23 = \mbox{\hyperlink{lio__device_8h_a5100c1d00094791cc657d811578b35db}{LIO\_CHIP\_CONF}}(oct, cn23xx\_pf);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00278}00278 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00279}00279                 c\_pkts\_per\_intr =}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00280}00280                         (uint32\_t)\mbox{\hyperlink{lio__config_8h_adcc660814d1b4e1a79c1059df328a9fa}{LIO\_GET\_OQ\_PKTS\_PER\_INTR\_CFG}}(conf23);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00281}00281                 c\_refill\_threshold =}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00282}00282                         (uint32\_t)\mbox{\hyperlink{lio__config_8h_ad378813665b36ae1c8d0ec62d9730bdb}{LIO\_GET\_OQ\_REFILL\_THRESHOLD\_CFG}}(conf23);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00283}00283         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00284}00284                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00285}00285         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00286}00286 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00287}00287         droq-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}} = c\_num\_descs;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00288}00288         droq-\/>\mbox{\hyperlink{structlio__droq_a1ae80ac1aa8801f7ba98f5934bcd50a1}{buffer\_size}} = c\_buf\_size;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00289}00289 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00290}00290         desc\_ring\_size = droq-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}} * \mbox{\hyperlink{lio__droq_8h_af2c0bcd9defa87c1aaa24938bbf31604}{LIO\_DROQ\_DESC\_SIZE}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00291}00291         droq-\/>\mbox{\hyperlink{structlio__droq_a964950f902d9033c717463b2ca020b79}{desc\_ring}} = \mbox{\hyperlink{lio__network_8h_a5cadbb52714f0c4c6eb2f61ff06a4a52}{lio\_dma\_alloc}}(desc\_ring\_size, \&droq-\/>\mbox{\hyperlink{structlio__droq_a947cadd3c6107afc0a53f5b146aea976}{desc\_ring\_dma}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00292}00292         \textcolor{keywordflow}{if} (droq-\/>\mbox{\hyperlink{structlio__droq_a964950f902d9033c717463b2ca020b79}{desc\_ring}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00293}00293                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}Output queue \%d ring alloc failed\(\backslash\)n"{}}, q\_no);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00294}00294                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00295}00295         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00296}00296 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00297}00297         \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(oct, \textcolor{stringliteral}{"{}droq[\%d]: desc\_ring: virt: 0x\%p, dma: \%llx\(\backslash\)n"{}}, q\_no,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00298}00298                     droq-\/>\mbox{\hyperlink{structlio__droq_a964950f902d9033c717463b2ca020b79}{desc\_ring}}, \mbox{\hyperlink{lio__main_8h_ae67a87eb5deeb31e550aa38dfa869505}{LIO\_CAST64}}(droq-\/>\mbox{\hyperlink{structlio__droq_a947cadd3c6107afc0a53f5b146aea976}{desc\_ring\_dma}}));}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00299}00299         \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(oct, \textcolor{stringliteral}{"{}droq[\%d]: num\_desc: \%d\(\backslash\)n"{}}, q\_no, droq-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00300}00300 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00301}00301         size = droq-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}} * \mbox{\hyperlink{lio__droq_8h_a1e51bf31da6805e7a031bb6657e34b84}{LIO\_DROQ\_RECVBUF\_SIZE}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00302}00302         droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}} =}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00303}00303                 (\textcolor{keyword}{struct }\mbox{\hyperlink{structlio__recv__buffer}{lio\_recv\_buffer}} *)malloc(size, M\_DEVBUF,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00304}00304                                                  M\_NOWAIT | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00305}00305         \textcolor{keywordflow}{if} (droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00306}00306                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}Output queue recv buf list alloc failed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00307}00307                 \textcolor{keywordflow}{goto} init\_droq\_fail;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00308}00308         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00309}00309 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00310}00310         \textcolor{keywordflow}{if} (\mbox{\hyperlink{lio__droq_8c_aaba1ae540987fbb26f1b9f1c1db3a962}{lio\_droq\_setup\_ring\_buffers}}(oct, droq))}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00311}00311                 \textcolor{keywordflow}{goto} init\_droq\_fail;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00312}00312 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00313}00313         droq-\/>\mbox{\hyperlink{structlio__droq_a0096ca7a82bc865e2b3040695ec15fac}{pkts\_per\_intr}} = c\_pkts\_per\_intr;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00314}00314         droq-\/>\mbox{\hyperlink{structlio__droq_af15c36d3df1d3e3905cdab406a4a2141}{refill\_threshold}} = c\_refill\_threshold;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00315}00315 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00316}00316         \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(oct, \textcolor{stringliteral}{"{}DROQ INIT: max\_empty\_descs: \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00317}00317                     droq-\/>\mbox{\hyperlink{structlio__droq_a52a418d93af4d0028c9dd4917cdbbf74}{max\_empty\_descs}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00318}00318 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00319}00319         mtx\_init(\&droq-\/>\mbox{\hyperlink{structlio__droq_a7251e1f94d2cddfad791a291af24c9d5}{lock}}, \textcolor{stringliteral}{"{}droq\_lock"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00320}00320 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00321}00321         STAILQ\_INIT(\&droq-\/>\mbox{\hyperlink{structlio__droq_ac3f06ae0b248da4d5a26feff10dce63a}{dispatch\_stq\_head}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00322}00322 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00323}00323         oct-\/>\mbox{\hyperlink{structocteon__device_a07eedda72ba39292f548957a394234dd}{fn\_list}}.\mbox{\hyperlink{structlio__fn__list_aac81227852b3ff8f43427962e9d0d2c2}{setup\_oq\_regs}}(oct, q\_no);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00324}00324 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00325}00325         oct-\/>\mbox{\hyperlink{structocteon__device_a2572013042e73f339174c82cf587494c}{io\_qmask}}.\mbox{\hyperlink{structlio__io__enable_a4eef5bebf2bae1622649170bdb0bb774}{oq}} |= \mbox{\hyperlink{lio__main_8h_aed42b76522e8377b3b0e77b64ee04fae}{BIT\_ULL}}(q\_no);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00326}00326 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00327}00327         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00328}00328 \textcolor{comment}{         * Initialize the taskqueue that handles}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00329}00329 \textcolor{comment}{         * output queue packet processing.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00330}00330 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00331}00331         \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(oct, \textcolor{stringliteral}{"{}Initializing droq\%d taskqueue\(\backslash\)n"{}}, q\_no);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00332}00332         NET\_TASK\_INIT(\&droq-\/>\mbox{\hyperlink{structlio__droq_aec53447ea85ed1c19cd8b7e0cea12cfe}{droq\_task}}, 0, \mbox{\hyperlink{lio__droq_8c_afc56a097d4b8c16de11eab8cd58a0a4b}{lio\_droq\_bh}}, (\textcolor{keywordtype}{void} *)droq);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00333}00333 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00334}00334         droq-\/>\mbox{\hyperlink{structlio__droq_ab239046de0e4e7b355023308f5bced5b}{droq\_taskqueue}} = taskqueue\_create\_fast(\textcolor{stringliteral}{"{}lio\_droq\_task"{}}, M\_NOWAIT,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00335}00335                                                      taskqueue\_thread\_enqueue,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00336}00336                                                      \&droq-\/>\mbox{\hyperlink{structlio__droq_ab239046de0e4e7b355023308f5bced5b}{droq\_taskqueue}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00337}00337         taskqueue\_start\_threads\_cpuset(\&droq-\/>\mbox{\hyperlink{structlio__droq_ab239046de0e4e7b355023308f5bced5b}{droq\_taskqueue}}, 1, PI\_NET,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00338}00338                                        \&oct-\/>\mbox{\hyperlink{structocteon__device_a71e3dab0368e240c06387057f5858425}{ioq\_vector}}[q\_no].\mbox{\hyperlink{structlio__ioq__vector_a3b7959afefcfa6e7a031697bc93c6430}{affinity\_mask}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00339}00339                                        \textcolor{stringliteral}{"{}lio\%d\_droq\%d\_task"{}}, oct-\/>\mbox{\hyperlink{structocteon__device_a6574a7bba62b9a35337dfe332ac83799}{octeon\_id}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00340}00340                                        q\_no);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00341}00341 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00342}00342         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00343}00343 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00344}00344 init\_droq\_fail:}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00345}00345         \mbox{\hyperlink{lio__droq_8c_a2bfce0bc110d2d53e2b5ab44151600e6}{lio\_delete\_droq}}(oct, q\_no);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00346}00346         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00347}00347 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00348}00348 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00349}00349 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00350}00350 \textcolor{comment}{ * lio\_create\_recv\_info}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00351}00351 \textcolor{comment}{ * Parameters:}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00352}00352 \textcolor{comment}{ *  octeon\_dev -\/ pointer to the octeon device structure}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00353}00353 \textcolor{comment}{ *  droq       -\/ droq in which the packet arrived.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00354}00354 \textcolor{comment}{ *  buf\_cnt    -\/ no. of buffers used by the packet.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00355}00355 \textcolor{comment}{ *  idx        -\/ index in the descriptor for the first buffer in the packet.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00356}00356 \textcolor{comment}{ * Description:}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00357}00357 \textcolor{comment}{ *  Allocates a recv\_info\_t and copies the buffer addresses for packet data}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00358}00358 \textcolor{comment}{ *  into the recv\_pkt space which starts at an 8B offset from recv\_info\_t.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00359}00359 \textcolor{comment}{ *  Flags the descriptors for refill later. If available descriptors go}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00360}00360 \textcolor{comment}{ *  below the threshold to receive a 64K pkt, new buffers are first allocated}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00361}00361 \textcolor{comment}{ *  before the recv\_pkt\_t is created.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00362}00362 \textcolor{comment}{ *  This routine will be called in interrupt context.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00363}00363 \textcolor{comment}{ * Returns:}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00364}00364 \textcolor{comment}{ *  Success: Pointer to recv\_info\_t}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00365}00365 \textcolor{comment}{ *  Failure: NULL.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00366}00366 \textcolor{comment}{ * Locks:}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00367}00367 \textcolor{comment}{ *  The droq-\/>lock is held when this routine is called.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00368}00368 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00369}00369 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__recv__info}{lio\_recv\_info}} *}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00370}\mbox{\hyperlink{lio__droq_8c_a6b7c67f1017094c59e14bd331f3a260d}{00370}} \mbox{\hyperlink{lio__droq_8c_a6b7c67f1017094c59e14bd331f3a260d}{lio\_create\_recv\_info}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *octeon\_dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq}{lio\_droq}} *droq,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00371}00371                      uint32\_t buf\_cnt, uint32\_t idx)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00372}00372 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00373}00373         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__droq__info}{lio\_droq\_info}}       *info;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00374}00374         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__recv__pkt}{lio\_recv\_pkt}} *recv\_pkt;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00375}00375         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__recv__info}{lio\_recv\_info}}       *recv\_info;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00376}00376         uint32\_t                bytes\_left, i;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00377}00377 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00378}00378         info = (\textcolor{keyword}{struct }\mbox{\hyperlink{structlio__droq__info}{lio\_droq\_info}} *)droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[idx].\mbox{\hyperlink{structlio__recv__buffer_a15a275f9e0810091cf5b426e42a2b61d}{data}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00379}00379 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00380}00380         recv\_info = \mbox{\hyperlink{lio__droq_8h_aca06bdc084c01378831f142e11184353}{lio\_alloc\_recv\_info}}(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{struct____dispatch}{\_\_dispatch}}));}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00381}00381         \textcolor{keywordflow}{if} (recv\_info == NULL)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00382}00382                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00383}00383 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00384}00384         recv\_pkt = recv\_info-\/>\mbox{\hyperlink{structlio__recv__info_af74be43e7c57a463316f57b9b26e6231}{recv\_pkt}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00385}00385         recv\_pkt-\/>\mbox{\hyperlink{structlio__recv__pkt_ad9934d21e17e8082c40dd044ea49622a}{rh}} = info-\/>\mbox{\hyperlink{structlio__droq__info_a14e965b67f4fcee91dc47fa613475f36}{rh}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00386}00386         recv\_pkt-\/>\mbox{\hyperlink{structlio__recv__pkt_a90228bc207e3567d63de999440eb8fc2}{length}} = (uint32\_t)info-\/>\mbox{\hyperlink{structlio__droq__info_ad2f69ca2da313a15771cc0d92c65bf11}{length}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00387}00387         recv\_pkt-\/>\mbox{\hyperlink{structlio__recv__pkt_a756ac1586a62f8c682e3bdb031890cc5}{buffer\_count}} = (uint16\_t)buf\_cnt;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00388}00388         recv\_pkt-\/>\mbox{\hyperlink{structlio__recv__pkt_a79e567bfb11e26bffe2844c36210b680}{octeon\_id}} = (uint16\_t)octeon\_dev-\/>\mbox{\hyperlink{structocteon__device_a6574a7bba62b9a35337dfe332ac83799}{octeon\_id}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00389}00389 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00390}00390         i = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00391}00391         bytes\_left = (uint32\_t)info-\/>\mbox{\hyperlink{structlio__droq__info_ad2f69ca2da313a15771cc0d92c65bf11}{length}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00392}00392 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00393}00393         \textcolor{keywordflow}{while} (buf\_cnt) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00394}00394                 recv\_pkt-\/>\mbox{\hyperlink{structlio__recv__pkt_a1b1292fb259e9a0f6481efdf8516a9b8}{buffer\_size}}[i] = (bytes\_left >= droq-\/>\mbox{\hyperlink{structlio__droq_a1ae80ac1aa8801f7ba98f5934bcd50a1}{buffer\_size}}) ?}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00395}00395                         droq-\/>\mbox{\hyperlink{structlio__droq_a1ae80ac1aa8801f7ba98f5934bcd50a1}{buffer\_size}} : bytes\_left;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00396}00396 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00397}00397                 recv\_pkt-\/>\mbox{\hyperlink{structlio__recv__pkt_a80709536f103c2df8b2ade47ddb07d99}{buffer\_ptr}}[i] = droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[idx].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00398}00398                 droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[idx].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}} = NULL;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00399}00399 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00400}00400                 idx = \mbox{\hyperlink{lio__common_8h_aab9e2438e83ac73b196a655afd9b5053}{lio\_incr\_index}}(idx, 1, droq-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00401}00401                 bytes\_left -\/= droq-\/>\mbox{\hyperlink{structlio__droq_a1ae80ac1aa8801f7ba98f5934bcd50a1}{buffer\_size}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00402}00402                 i++;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00403}00403                 buf\_cnt-\/-\/;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00404}00404         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00405}00405 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00406}00406         \textcolor{keywordflow}{return} (recv\_info);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00407}00407 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00408}00408 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00409}00409 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00410}00410 \textcolor{comment}{ * If we were not able to refill all buffers, try to move around}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00411}00411 \textcolor{comment}{ * the buffers that were not dispatched.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00412}00412 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00413}00413 \textcolor{keyword}{static} \textcolor{keyword}{inline} uint32\_t}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00414}\mbox{\hyperlink{lio__droq_8c_ae07a61fb6b60a40ef0c109c06ea66bb3}{00414}} \mbox{\hyperlink{lio__droq_8c_ae07a61fb6b60a40ef0c109c06ea66bb3}{lio\_droq\_refill\_pullup\_descs}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq}{lio\_droq}} *droq,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00415}00415                              \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq__desc}{lio\_droq\_desc}} *desc\_ring)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00416}00416 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00417}00417         uint32\_t        desc\_refilled = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00418}00418         uint32\_t        refill\_index = droq-\/>\mbox{\hyperlink{structlio__droq_a19aff95c84a1e597bfe02cb77852743b}{refill\_idx}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00419}00419 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00420}00420         \textcolor{keywordflow}{while} (refill\_index != droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}}) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00421}00421                 \textcolor{keywordflow}{if} (droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[refill\_index].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00422}00422                         droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[droq-\/>\mbox{\hyperlink{structlio__droq_a19aff95c84a1e597bfe02cb77852743b}{refill\_idx}}].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}} =}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00423}00423                                 droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[refill\_index].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00424}00424                         droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[droq-\/>\mbox{\hyperlink{structlio__droq_a19aff95c84a1e597bfe02cb77852743b}{refill\_idx}}].\mbox{\hyperlink{structlio__recv__buffer_a15a275f9e0810091cf5b426e42a2b61d}{data}} =}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00425}00425                                 droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[refill\_index].\mbox{\hyperlink{structlio__recv__buffer_a15a275f9e0810091cf5b426e42a2b61d}{data}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00426}00426                         desc\_ring[droq-\/>\mbox{\hyperlink{structlio__droq_a19aff95c84a1e597bfe02cb77852743b}{refill\_idx}}].\mbox{\hyperlink{structlio__droq__desc_a04ffb7c6d114c12003c5caaeed6b2a2a}{buffer\_ptr}} =}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00427}00427                                 desc\_ring[refill\_index].\mbox{\hyperlink{structlio__droq__desc_a04ffb7c6d114c12003c5caaeed6b2a2a}{buffer\_ptr}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00428}00428                         droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[refill\_index].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}} = NULL;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00429}00429                         desc\_ring[refill\_index].\mbox{\hyperlink{structlio__droq__desc_a04ffb7c6d114c12003c5caaeed6b2a2a}{buffer\_ptr}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00430}00430                         \textcolor{keywordflow}{do} \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00431}00431                                 droq-\/>\mbox{\hyperlink{structlio__droq_a19aff95c84a1e597bfe02cb77852743b}{refill\_idx}} =}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00432}00432                                         \mbox{\hyperlink{lio__common_8h_aab9e2438e83ac73b196a655afd9b5053}{lio\_incr\_index}}(droq-\/>\mbox{\hyperlink{structlio__droq_a19aff95c84a1e597bfe02cb77852743b}{refill\_idx}}, 1,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00433}00433                                                        droq-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00434}00434                                 desc\_refilled++;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00435}00435                                 droq-\/>\mbox{\hyperlink{structlio__droq_aca3878dba23d563bf2279feddba97491}{refill\_count}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00436}00436                         \} \textcolor{keywordflow}{while} (droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[droq-\/>\mbox{\hyperlink{structlio__droq_a19aff95c84a1e597bfe02cb77852743b}{refill\_idx}}].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}} !=}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00437}00437                                  NULL);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00438}00438                 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00439}00439                 refill\_index = \mbox{\hyperlink{lio__common_8h_aab9e2438e83ac73b196a655afd9b5053}{lio\_incr\_index}}(refill\_index, 1, droq-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00440}00440         \}       \textcolor{comment}{/* while */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00441}00441         \textcolor{keywordflow}{return} (desc\_refilled);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00442}00442 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00443}00443 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00444}00444 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00445}00445 \textcolor{comment}{ * lio\_droq\_refill}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00446}00446 \textcolor{comment}{ * Parameters:}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00447}00447 \textcolor{comment}{ *  droq       -\/ droq in which descriptors require new buffers.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00448}00448 \textcolor{comment}{ * Description:}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00449}00449 \textcolor{comment}{ *  Called during normal DROQ processing in interrupt mode or by the poll}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00450}00450 \textcolor{comment}{ *  thread to refill the descriptors from which buffers were dispatched}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00451}00451 \textcolor{comment}{ *  to upper layers. Attempts to allocate new buffers. If that fails, moves}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00452}00452 \textcolor{comment}{ *  up buffers (that were not dispatched) to form a contiguous ring.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00453}00453 \textcolor{comment}{ * Returns:}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00454}00454 \textcolor{comment}{ *  No of descriptors refilled.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00455}00455 \textcolor{comment}{ * Locks:}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00456}00456 \textcolor{comment}{ *  This routine is called with droq-\/>lock held.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00457}00457 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00458}00458 uint32\_t}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00459}\mbox{\hyperlink{lio__droq_8c_a0d890b5348eb19255227e4781f87c03e}{00459}} \mbox{\hyperlink{lio__droq_8c_a0d890b5348eb19255227e4781f87c03e}{lio\_droq\_refill}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *octeon\_dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq}{lio\_droq}} *droq)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00460}00460 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00461}00461         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__droq__desc}{lio\_droq\_desc}}       *desc\_ring;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00462}00462         \textcolor{keywordtype}{void}                    *buf = NULL;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00463}00463         uint32\_t                desc\_refilled = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00464}00464         uint8\_t                 *data;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00465}00465 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00466}00466         desc\_ring = droq-\/>\mbox{\hyperlink{structlio__droq_a964950f902d9033c717463b2ca020b79}{desc\_ring}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00467}00467 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00468}00468         \textcolor{keywordflow}{while} (droq-\/>\mbox{\hyperlink{structlio__droq_aca3878dba23d563bf2279feddba97491}{refill\_count}} \&\& (desc\_refilled < droq-\/>max\_count)) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00469}00469                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00470}00470 \textcolor{comment}{                 * If a valid buffer exists (happens if there is no dispatch),}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00471}00471 \textcolor{comment}{                 * reuse}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00472}00472 \textcolor{comment}{                 * the buffer, else allocate.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00473}00473 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00474}00474                 \textcolor{keywordflow}{if} (droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[droq-\/>\mbox{\hyperlink{structlio__droq_a19aff95c84a1e597bfe02cb77852743b}{refill\_idx}}].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00475}00475                         buf = \mbox{\hyperlink{lio__network_8h_a27ad60010e29678678bd4f24f37992c9}{lio\_recv\_buffer\_alloc}}(droq-\/>\mbox{\hyperlink{structlio__droq_a1ae80ac1aa8801f7ba98f5934bcd50a1}{buffer\_size}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00476}00476                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00477}00477 \textcolor{comment}{                         * If a buffer could not be allocated, no point in}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00478}00478 \textcolor{comment}{                         * continuing}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00479}00479 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00480}00480                         \textcolor{keywordflow}{if} (buf == NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00481}00481                                 droq-\/>\mbox{\hyperlink{structlio__droq_a8f9ff977aef838fdce6aee0d18286afb}{stats}}.\mbox{\hyperlink{structlio__droq__stats_a10cefb6fb2997dc4dfc4287b170cab5c}{rx\_alloc\_failure}}++;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00482}00482                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00483}00483                         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00484}00484 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00485}00485                         droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[droq-\/>\mbox{\hyperlink{structlio__droq_a19aff95c84a1e597bfe02cb77852743b}{refill\_idx}}].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}} = buf;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00486}00486                         data = ((\textcolor{keyword}{struct }mbuf *)buf)-\/>m\_data;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00487}00487                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00488}00488                         data = ((\textcolor{keyword}{struct }mbuf *)droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00489}00489                                 [droq-\/>\mbox{\hyperlink{structlio__droq_a19aff95c84a1e597bfe02cb77852743b}{refill\_idx}}].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}})-\/>m\_data;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00490}00490                 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00491}00491 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00492}00492                 droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[droq-\/>\mbox{\hyperlink{structlio__droq_a19aff95c84a1e597bfe02cb77852743b}{refill\_idx}}].\mbox{\hyperlink{structlio__recv__buffer_a15a275f9e0810091cf5b426e42a2b61d}{data}} = data;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00493}00493 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00494}00494                 desc\_ring[droq-\/>\mbox{\hyperlink{structlio__droq_a19aff95c84a1e597bfe02cb77852743b}{refill\_idx}}].\mbox{\hyperlink{structlio__droq__desc_a04ffb7c6d114c12003c5caaeed6b2a2a}{buffer\_ptr}} =}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00495}00495                     \mbox{\hyperlink{lio__network_8h_ae1c4b45f6c758ab48bfab0a1a0b38455}{lio\_map\_ring}}(octeon\_dev-\/>\mbox{\hyperlink{structocteon__device_a2d1f835586ad43c0e0be46da81cd0f3c}{device}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00496}00496                                  droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[droq-\/>\mbox{\hyperlink{structlio__droq_a19aff95c84a1e597bfe02cb77852743b}{refill\_idx}}].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00497}00497                                  droq-\/>\mbox{\hyperlink{structlio__droq_a1ae80ac1aa8801f7ba98f5934bcd50a1}{buffer\_size}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00498}00498 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00499}00499                 droq-\/>\mbox{\hyperlink{structlio__droq_a19aff95c84a1e597bfe02cb77852743b}{refill\_idx}} = \mbox{\hyperlink{lio__common_8h_aab9e2438e83ac73b196a655afd9b5053}{lio\_incr\_index}}(droq-\/>\mbox{\hyperlink{structlio__droq_a19aff95c84a1e597bfe02cb77852743b}{refill\_idx}}, 1,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00500}00500                                                   droq-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00501}00501                 desc\_refilled++;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00502}00502                 droq-\/>\mbox{\hyperlink{structlio__droq_aca3878dba23d563bf2279feddba97491}{refill\_count}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00503}00503         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00504}00504 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00505}00505         \textcolor{keywordflow}{if} (droq-\/>\mbox{\hyperlink{structlio__droq_aca3878dba23d563bf2279feddba97491}{refill\_count}})}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00506}00506                 desc\_refilled += \mbox{\hyperlink{lio__droq_8c_ae07a61fb6b60a40ef0c109c06ea66bb3}{lio\_droq\_refill\_pullup\_descs}}(droq, desc\_ring);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00507}00507 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00508}00508         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00509}00509 \textcolor{comment}{         * if droq-\/>refill\_count}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00510}00510 \textcolor{comment}{         * The refill count would not change in pass two. We only moved buffers}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00511}00511 \textcolor{comment}{         * to close the gap in the ring, but we would still have the same no. of}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00512}00512 \textcolor{comment}{         * buffers to refill.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00513}00513 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00514}00514         \textcolor{keywordflow}{return} (desc\_refilled);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00515}00515 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00516}00516 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00517}00517 \textcolor{keyword}{static} \textcolor{keyword}{inline} uint32\_t}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00518}\mbox{\hyperlink{lio__droq_8c_a354162dda1a3180287c51cdcd8a3f9b7}{00518}} \mbox{\hyperlink{lio__droq_8c_a354162dda1a3180287c51cdcd8a3f9b7}{lio\_droq\_get\_bufcount}}(uint32\_t buf\_size, uint32\_t total\_len)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00519}00519 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00520}00520 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00521}00521         \textcolor{keywordflow}{return} ((total\_len + buf\_size -\/ 1) / buf\_size);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00522}00522 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00523}00523 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00524}00524 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00525}\mbox{\hyperlink{lio__droq_8c_a427d8efbd5a5b3e9d9a17e0ed6c48b82}{00525}} \mbox{\hyperlink{lio__droq_8c_a427d8efbd5a5b3e9d9a17e0ed6c48b82}{lio\_droq\_dispatch\_pkt}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq}{lio\_droq}} *droq,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00526}00526                       \textcolor{keyword}{union} \mbox{\hyperlink{unionocteon__rh}{octeon\_rh}} *rh, \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq__info}{lio\_droq\_info}} *info)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00527}00527 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00528}00528         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__recv__info}{lio\_recv\_info}}       *rinfo;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00529}00529         \mbox{\hyperlink{lio__droq_8h_ad5ea08f46f27dc54d86cc04739eacd0f}{lio\_dispatch\_fn\_t}}      disp\_fn;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00530}00530         uint32\_t                cnt;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00531}00531 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00532}00532         cnt = \mbox{\hyperlink{lio__droq_8c_a354162dda1a3180287c51cdcd8a3f9b7}{lio\_droq\_get\_bufcount}}(droq-\/>\mbox{\hyperlink{structlio__droq_a1ae80ac1aa8801f7ba98f5934bcd50a1}{buffer\_size}}, (uint32\_t)info-\/>\mbox{\hyperlink{structlio__droq__info_ad2f69ca2da313a15771cc0d92c65bf11}{length}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00533}00533 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00534}00534         disp\_fn = \mbox{\hyperlink{lio__device_8c_a69e53bef0c473ec22d90c3df59a9050a}{lio\_get\_dispatch}}(oct, (uint16\_t)rh-\/>\mbox{\hyperlink{unionocteon__rh_a962ff9890261a8b3cae08f00874785ef}{r}}.\mbox{\hyperlink{unionocteon__rh_ab9c07d205bd948398a3f26f8a1e1ce2d}{opcode}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00535}00535                                    (uint16\_t)rh-\/>\mbox{\hyperlink{unionocteon__rh_a962ff9890261a8b3cae08f00874785ef}{r}}.\mbox{\hyperlink{unionocteon__rh_a7dca6f6733944c1ad8af3cbcd4e6a21b}{subcode}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00536}00536         \textcolor{keywordflow}{if} (disp\_fn) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00537}00537                 rinfo = \mbox{\hyperlink{lio__droq_8c_a6b7c67f1017094c59e14bd331f3a260d}{lio\_create\_recv\_info}}(oct, droq, cnt, droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00538}00538                 \textcolor{keywordflow}{if} (rinfo != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00539}00539                         \textcolor{keyword}{struct }\mbox{\hyperlink{struct____dispatch}{\_\_dispatch}} *rdisp = \mbox{\hyperlink{struct____dispatch_a5aa25ef93235012300c32eaf3d6e18fc}{rinfo}}-\/>\mbox{\hyperlink{structlio__recv__info_aae19d36f6343d2dc2e6715f02b2ff40b}{rsvd}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00540}00540 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00541}00541                         rdisp-\/>\mbox{\hyperlink{struct____dispatch_a5aa25ef93235012300c32eaf3d6e18fc}{rinfo}} = \mbox{\hyperlink{struct____dispatch_a5aa25ef93235012300c32eaf3d6e18fc}{rinfo}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00542}00542                         rdisp-\/>\mbox{\hyperlink{struct____dispatch_aee1d5af70f5ed1532f1d9ec96645053f}{disp\_fn}} = \mbox{\hyperlink{struct____dispatch_aee1d5af70f5ed1532f1d9ec96645053f}{disp\_fn}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00543}00543                         \mbox{\hyperlink{struct____dispatch_a5aa25ef93235012300c32eaf3d6e18fc}{rinfo}}-\/>\mbox{\hyperlink{structlio__recv__info_af74be43e7c57a463316f57b9b26e6231}{recv\_pkt}}-\/>\mbox{\hyperlink{structlio__recv__pkt_ad9934d21e17e8082c40dd044ea49622a}{rh}} = *rh;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00544}00544                         STAILQ\_INSERT\_TAIL(\&droq-\/>\mbox{\hyperlink{structlio__droq_ac3f06ae0b248da4d5a26feff10dce63a}{dispatch\_stq\_head}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00545}00545                                            \&rdisp-\/>\mbox{\hyperlink{struct____dispatch_ae8f26aab4c3ad09af12a71e471217231}{node}}, entries);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00546}00546                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00547}00547                         droq-\/>\mbox{\hyperlink{structlio__droq_a8f9ff977aef838fdce6aee0d18286afb}{stats}}.\mbox{\hyperlink{structlio__droq__stats_aa21c24220776519cf476f3a34251a966}{dropped\_nomem}}++;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00548}00548                 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00549}00549         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00550}00550                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}DROQ: No dispatch function (opcode \%u/\%u)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00551}00551                             (\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int})rh-\/>\mbox{\hyperlink{unionocteon__rh_a962ff9890261a8b3cae08f00874785ef}{r}}.\mbox{\hyperlink{unionocteon__rh_ab9c07d205bd948398a3f26f8a1e1ce2d}{opcode}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00552}00552                             (\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int})rh-\/>\mbox{\hyperlink{unionocteon__rh_a962ff9890261a8b3cae08f00874785ef}{r}}.\mbox{\hyperlink{unionocteon__rh_a7dca6f6733944c1ad8af3cbcd4e6a21b}{subcode}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00553}00553                 droq-\/>\mbox{\hyperlink{structlio__droq_a8f9ff977aef838fdce6aee0d18286afb}{stats}}.\mbox{\hyperlink{structlio__droq__stats_a5c14c6f42a8ffab26d32010a4ea3a745}{dropped\_nodispatch}}++;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00554}00554         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00555}00555 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00556}00556         \textcolor{keywordflow}{return} (cnt);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00557}00557 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00558}00558 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00559}00559 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00560}\mbox{\hyperlink{lio__droq_8c_a1cdfadfd126d66759684f7d5d9ae1aea}{00560}} \mbox{\hyperlink{lio__droq_8c_a1cdfadfd126d66759684f7d5d9ae1aea}{lio\_droq\_drop\_packets}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq}{lio\_droq}} *droq,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00561}00561                       uint32\_t cnt)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00562}00562 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00563}00563         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__droq__info}{lio\_droq\_info}}       *info;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00564}00564         uint32\_t                i = 0, buf\_cnt;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00565}00565 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00566}00566         \textcolor{keywordflow}{for} (i = 0; i < cnt; i++) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00567}00567                 info = (\textcolor{keyword}{struct }\mbox{\hyperlink{structlio__droq__info}{lio\_droq\_info}} *)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00568}00568                         droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}}].\mbox{\hyperlink{structlio__recv__buffer_a15a275f9e0810091cf5b426e42a2b61d}{data}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00569}00569 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00570}00570                 \mbox{\hyperlink{lio__main_8h_ab294e8e0e748bf0d78f5c1c0283a79cf}{lio\_swap\_8B\_data}}((uint64\_t *)info, 2);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00571}00571 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00572}00572                 \textcolor{keywordflow}{if} (info-\/>\mbox{\hyperlink{structlio__droq__info_ad2f69ca2da313a15771cc0d92c65bf11}{length}}) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00573}00573                         info-\/>\mbox{\hyperlink{structlio__droq__info_ad2f69ca2da313a15771cc0d92c65bf11}{length}} += 8;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00574}00574                         droq-\/>\mbox{\hyperlink{structlio__droq_a8f9ff977aef838fdce6aee0d18286afb}{stats}}.\mbox{\hyperlink{structlio__droq__stats_aaeca37f23f6adc6a7f825ac201c05b5b}{bytes\_received}} += info-\/>\mbox{\hyperlink{structlio__droq__info_ad2f69ca2da313a15771cc0d92c65bf11}{length}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00575}00575                         buf\_cnt = \mbox{\hyperlink{lio__droq_8c_a354162dda1a3180287c51cdcd8a3f9b7}{lio\_droq\_get\_bufcount}}(droq-\/>\mbox{\hyperlink{structlio__droq_a1ae80ac1aa8801f7ba98f5934bcd50a1}{buffer\_size}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00576}00576                                                         (uint32\_t)info-\/>\mbox{\hyperlink{structlio__droq__info_ad2f69ca2da313a15771cc0d92c65bf11}{length}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00577}00577                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00578}00578                         \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}DROQ: In drop: pkt with len 0\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00579}00579                         buf\_cnt = 1;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00580}00580                 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00581}00581 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00582}00582                 droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}} = \mbox{\hyperlink{lio__common_8h_aab9e2438e83ac73b196a655afd9b5053}{lio\_incr\_index}}(droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}}, buf\_cnt,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00583}00583                                                 droq-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00584}00584                 droq-\/>\mbox{\hyperlink{structlio__droq_aca3878dba23d563bf2279feddba97491}{refill\_count}} += buf\_cnt;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00585}00585         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00586}00586 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00587}00587 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00588}00588 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00589}\mbox{\hyperlink{lio__droq_8c_a7f49b50524b4acfbe2be987eff4a85c7}{00589}} \mbox{\hyperlink{lio__droq_8c_a7f49b50524b4acfbe2be987eff4a85c7}{lio\_droq\_fast\_process\_packets}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq}{lio\_droq}} *droq,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00590}00590                               uint32\_t pkts\_to\_process)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00591}00591 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00592}00592         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__droq__info}{lio\_droq\_info}}       *info;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00593}00593         \textcolor{keyword}{union                   }\mbox{\hyperlink{unionocteon__rh}{octeon\_rh}} *rh;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00594}00594         uint32\_t                pkt, pkt\_count, total\_len = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00595}00595 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00596}00596         pkt\_count = pkts\_to\_process;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00597}00597 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00598}00598         \textcolor{keywordflow}{for} (pkt = 0; pkt < pkt\_count; pkt++) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00599}00599                 \textcolor{keyword}{struct }mbuf     *nicbuf = NULL;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00600}00600                 uint32\_t        pkt\_len = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00601}00601 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00602}00602                 info = (\textcolor{keyword}{struct }\mbox{\hyperlink{structlio__droq__info}{lio\_droq\_info}} *)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00603}00603                     droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}}].\mbox{\hyperlink{structlio__recv__buffer_a15a275f9e0810091cf5b426e42a2b61d}{data}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00604}00604 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00605}00605                 \mbox{\hyperlink{lio__main_8h_ab294e8e0e748bf0d78f5c1c0283a79cf}{lio\_swap\_8B\_data}}((uint64\_t *)info, 2);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00606}00606 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00607}00607                 \textcolor{keywordflow}{if} (!info-\/>\mbox{\hyperlink{structlio__droq__info_ad2f69ca2da313a15771cc0d92c65bf11}{length}}) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00608}00608                         \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00609}00609                                     \textcolor{stringliteral}{"{}DROQ[\%d] idx: \%d len:0, pkt\_cnt: \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00610}00610                                     droq-\/>\mbox{\hyperlink{structlio__droq_a47165d09beab28fd12aff1d79cfb3cab}{q\_no}}, droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}}, pkt\_count);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00611}00611                         hexdump((uint8\_t *)info, \mbox{\hyperlink{lio__droq_8h_aaac9c27a5385c5ae787c0b5be2214e13}{LIO\_DROQ\_INFO\_SIZE}}, NULL,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00612}00612                                 HD\_OMIT\_CHARS);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00613}00613                         pkt++;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00614}00614                         \mbox{\hyperlink{lio__common_8h_aab9e2438e83ac73b196a655afd9b5053}{lio\_incr\_index}}(droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}}, 1, droq-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00615}00615                         droq-\/>\mbox{\hyperlink{structlio__droq_aca3878dba23d563bf2279feddba97491}{refill\_count}}++;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00616}00616                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00617}00617                 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00618}00618 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00619}00619                 \mbox{\hyperlink{structlio__droq__info_a14e965b67f4fcee91dc47fa613475f36}{rh}} = \&info-\/>\mbox{\hyperlink{structlio__droq__info_a14e965b67f4fcee91dc47fa613475f36}{rh}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00620}00620 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00621}00621                 info-\/>\mbox{\hyperlink{structlio__droq__info_ad2f69ca2da313a15771cc0d92c65bf11}{length}} += 8;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00622}00622                 \mbox{\hyperlink{structlio__droq__info_a14e965b67f4fcee91dc47fa613475f36}{rh}}-\/>\mbox{\hyperlink{unionocteon__rh_a913b1cf87e59268d7c75f46ae3aa926a}{r\_dh}}.\mbox{\hyperlink{unionocteon__rh_a008ab41aa4e40a0ddfdd85ae76a4e4f7}{len}} += (\mbox{\hyperlink{lio__droq_8h_aaac9c27a5385c5ae787c0b5be2214e13}{LIO\_DROQ\_INFO\_SIZE}} + 7) / 8;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00623}00623 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00624}00624                 total\_len += (uint32\_t)info-\/>\mbox{\hyperlink{structlio__droq__info_ad2f69ca2da313a15771cc0d92c65bf11}{length}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00625}00625                 if (\mbox{\hyperlink{lio__common_8h_aaef56e97b5f9236aa4fc5ed28f34695e}{lio\_opcode\_slow\_path}}(\mbox{\hyperlink{structlio__droq__info_a14e965b67f4fcee91dc47fa613475f36}{rh}})) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00626}00626                         uint32\_t        buf\_cnt;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00627}00627 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00628}00628                         buf\_cnt = \mbox{\hyperlink{lio__droq_8c_a427d8efbd5a5b3e9d9a17e0ed6c48b82}{lio\_droq\_dispatch\_pkt}}(oct, droq, \mbox{\hyperlink{structlio__droq__info_a14e965b67f4fcee91dc47fa613475f36}{rh}}, info);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00629}00629                         droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}} = \mbox{\hyperlink{lio__common_8h_aab9e2438e83ac73b196a655afd9b5053}{lio\_incr\_index}}(droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}},   buf\_cnt,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00630}00630                                                         droq-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00631}00631                         droq-\/>\mbox{\hyperlink{structlio__droq_aca3878dba23d563bf2279feddba97491}{refill\_count}} += buf\_cnt;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00632}00632                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00633}00633                         \textcolor{keywordflow}{if} (info-\/>\mbox{\hyperlink{structlio__droq__info_ad2f69ca2da313a15771cc0d92c65bf11}{length}} <= droq-\/>\mbox{\hyperlink{structlio__droq_a1ae80ac1aa8801f7ba98f5934bcd50a1}{buffer\_size}}) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00634}00634                                 pkt\_len = (uint32\_t)info-\/>\mbox{\hyperlink{structlio__droq__info_ad2f69ca2da313a15771cc0d92c65bf11}{length}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00635}00635                                 nicbuf = droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00636}00636                                                        droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}}].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00637}00637                                 nicbuf-\/>m\_len = pkt\_len;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00638}00638                                 droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}}].\mbox{\hyperlink{structlio__recv__buffer_a3488e41a585200845e7a437b46cced3d}{buffer}} =}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00639}00639                                         NULL;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00640}00640 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00641}00641                                 droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}} =}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00642}00642                                         \mbox{\hyperlink{lio__common_8h_aab9e2438e83ac73b196a655afd9b5053}{lio\_incr\_index}}(droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00643}00643                                                        1, droq-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00644}00644                                 droq-\/>\mbox{\hyperlink{structlio__droq_aca3878dba23d563bf2279feddba97491}{refill\_count}}++;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00645}00645                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00646}00646                                 \textcolor{keywordtype}{bool}    secondary\_frag = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00647}00647 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00648}00648                                 pkt\_len = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00649}00649 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00650}00650                                 \textcolor{keywordflow}{while} (pkt\_len < info-\/>\mbox{\hyperlink{structlio__droq__info_ad2f69ca2da313a15771cc0d92c65bf11}{length}}) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00651}00651                                         \textcolor{keywordtype}{int}     frag\_len, idx = droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00652}00652                                         \textcolor{keyword}{struct }mbuf     *buffer;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00653}00653 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00654}00654                                         frag\_len =}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00655}00655                                                 ((pkt\_len + droq-\/>\mbox{\hyperlink{structlio__droq_a1ae80ac1aa8801f7ba98f5934bcd50a1}{buffer\_size}}) >}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00656}00656                                                  info-\/>\mbox{\hyperlink{structlio__droq__info_ad2f69ca2da313a15771cc0d92c65bf11}{length}}) ?}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00657}00657                                                 ((uint32\_t)info-\/>\mbox{\hyperlink{structlio__droq__info_ad2f69ca2da313a15771cc0d92c65bf11}{length}} -\/}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00658}00658                                                  pkt\_len) : droq-\/>\mbox{\hyperlink{structlio__droq_a1ae80ac1aa8801f7ba98f5934bcd50a1}{buffer\_size}};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00659}00659 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00660}00660                                         buffer = ((\textcolor{keyword}{struct }mbuf *)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00661}00661                                                   droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[idx].}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00662}00662                                                   buffer);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00663}00663                                         buffer-\/>m\_len = frag\_len;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00664}00664                                         \textcolor{keywordflow}{if} (\_\_predict\_true(secondary\_frag)) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00665}00665                                                 m\_cat(nicbuf, buffer);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00666}00666                                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00667}00667                                                 nicbuf = buffer;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00668}00668                                                 secondary\_frag = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00669}00669                                         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00670}00670 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00671}00671                                         droq-\/>\mbox{\hyperlink{structlio__droq_a931484986ed0017b4685ea5b8293219c}{recv\_buf\_list}}[droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}}].}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00672}00672                                                 buffer = NULL;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00673}00673 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00674}00674                                         pkt\_len += frag\_len;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00675}00675                                         droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}} =}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00676}00676                                                 \mbox{\hyperlink{lio__common_8h_aab9e2438e83ac73b196a655afd9b5053}{lio\_incr\_index}}(droq-\/>\mbox{\hyperlink{structlio__droq_a9b4449c2b3fc4151bd2f4142723de1df}{read\_idx}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00677}00677                                                                1,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00678}00678                                                                droq-\/>\mbox{\hyperlink{structlio__droq_a04b2786b96b7d2824968691a5f052c26}{max\_count}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00679}00679                                         droq-\/>\mbox{\hyperlink{structlio__droq_aca3878dba23d563bf2279feddba97491}{refill\_count}}++;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00680}00680                                 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00681}00681                         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00682}00682 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00683}00683                         \textcolor{keywordflow}{if} (nicbuf != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00684}00684                                 \textcolor{keywordflow}{if} (droq-\/>\mbox{\hyperlink{structlio__droq_ae88a0286d66cf94bb9d0ff1ac5df1dbd}{ops}}.\mbox{\hyperlink{structlio__droq__ops_a3af9e6d88a3e035687f01f8f9f23df90}{fptr}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00685}00685                                         droq-\/>\mbox{\hyperlink{structlio__droq_ae88a0286d66cf94bb9d0ff1ac5df1dbd}{ops}}.\mbox{\hyperlink{structlio__droq__ops_a3af9e6d88a3e035687f01f8f9f23df90}{fptr}}(nicbuf, pkt\_len, rh,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00686}00686                                                        droq, droq-\/>\mbox{\hyperlink{structlio__droq_ae88a0286d66cf94bb9d0ff1ac5df1dbd}{ops}}.\mbox{\hyperlink{structlio__droq__ops_a8d6399fb87c92fa1f7c8182bd74a9825}{farg}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00687}00687                                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00688}00688                                         \mbox{\hyperlink{lio__network_8h_a567443b40ed2cc007f9eb3a146779059}{lio\_recv\_buffer\_free}}(nicbuf);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00689}00689                                 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00690}00690                         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00691}00691                 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00692}00692 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00693}00693                 \textcolor{keywordflow}{if} (droq-\/>\mbox{\hyperlink{structlio__droq_aca3878dba23d563bf2279feddba97491}{refill\_count}} >= droq-\/>\mbox{\hyperlink{structlio__droq_af15c36d3df1d3e3905cdab406a4a2141}{refill\_threshold}}) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00694}00694                         \textcolor{keywordtype}{int} desc\_refilled = \mbox{\hyperlink{lio__droq_8c_a0d890b5348eb19255227e4781f87c03e}{lio\_droq\_refill}}(oct, droq);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00695}00695 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00696}00696                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00697}00697 \textcolor{comment}{                         * Flush the droq descriptor data to memory to be sure}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00698}00698 \textcolor{comment}{                         * that when we update the credits the data in memory}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00699}00699 \textcolor{comment}{                         * is accurate.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00700}00700 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00701}00701                         wmb();}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00702}00702                         \mbox{\hyperlink{lio__device_8h_a946180ca969df8cd2d4b2c3eb4e9cb3c}{lio\_write\_csr32}}(oct, droq-\/>\mbox{\hyperlink{structlio__droq_a6c03b162185dfc04f00630a1acee54c5}{pkts\_credit\_reg}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00703}00703                                         desc\_refilled);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00704}00704                         \textcolor{comment}{/* make sure mmio write completes */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00705}00705                         \_\_compiler\_membar();}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00706}00706                 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00707}00707         \}       \textcolor{comment}{/* for (each packet)... */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00708}00708 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00709}00709         \textcolor{comment}{/* Increment refill\_count by the number of buffers processed. */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00710}00710         droq-\/>\mbox{\hyperlink{structlio__droq_a8f9ff977aef838fdce6aee0d18286afb}{stats}}.\mbox{\hyperlink{structlio__droq__stats_a68147c1ccbbb203db10cfd30b83441fe}{pkts\_received}} += pkt;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00711}00711         droq-\/>\mbox{\hyperlink{structlio__droq_a8f9ff977aef838fdce6aee0d18286afb}{stats}}.\mbox{\hyperlink{structlio__droq__stats_aaeca37f23f6adc6a7f825ac201c05b5b}{bytes\_received}} += total\_len;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00712}00712 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00713}00713         tcp\_lro\_flush\_all(\&droq-\/>\mbox{\hyperlink{structlio__droq_a2266e708f7d9e8f9f72222d392e2ade8}{lro}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00714}00714 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00715}00715         \textcolor{keywordflow}{if} ((droq-\/>\mbox{\hyperlink{structlio__droq_ae88a0286d66cf94bb9d0ff1ac5df1dbd}{ops}}.\mbox{\hyperlink{structlio__droq__ops_ad8637959ec8d28db4e71bceb3cd0bb72}{drop\_on\_max}}) \&\& (pkts\_to\_process -\/ pkt)) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00716}00716                 \mbox{\hyperlink{lio__droq_8c_a1cdfadfd126d66759684f7d5d9ae1aea}{lio\_droq\_drop\_packets}}(oct, droq, (pkts\_to\_process -\/ pkt));}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00717}00717 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00718}00718                 droq-\/>\mbox{\hyperlink{structlio__droq_a8f9ff977aef838fdce6aee0d18286afb}{stats}}.\mbox{\hyperlink{structlio__droq__stats_a6d147f027c4763956929383c8e5a072c}{dropped\_toomany}} += (pkts\_to\_process -\/ pkt);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00719}00719                 \textcolor{keywordflow}{return} (pkts\_to\_process);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00720}00720         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00721}00721 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00722}00722         \textcolor{keywordflow}{return} (pkt);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00723}00723 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00724}00724 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00725}00725 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00726}\mbox{\hyperlink{lio__droq_8c_a8d74c6fbc7377197651c550150bdca0a}{00726}} \mbox{\hyperlink{lio__droq_8c_a8d74c6fbc7377197651c550150bdca0a}{lio\_droq\_process\_packets}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq}{lio\_droq}} *droq,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00727}00727                          uint32\_t budget)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00728}00728 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00729}00729         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__stailq__node}{lio\_stailq\_node}}   *tmp, *tmp2;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00730}00730         uint32\_t                pkt\_count = 0, pkts\_processed = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00731}00731 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00732}00732         \textcolor{comment}{/* Grab the droq lock */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00733}00733         mtx\_lock(\&droq-\/>\mbox{\hyperlink{structlio__droq_a7251e1f94d2cddfad791a291af24c9d5}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00734}00734 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00735}00735         \mbox{\hyperlink{lio__droq_8c_ad33dc530043bc887d6cfdc451be9794a}{lio\_droq\_check\_hw\_for\_pkts}}(droq);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00736}00736         pkt\_count = atomic\_load\_acq\_int(\&droq-\/>\mbox{\hyperlink{structlio__droq_ad2d6a2f0ddd1504443b2c4e78c2f4844}{pkts\_pending}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00737}00737 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00738}00738         \textcolor{keywordflow}{if} (!pkt\_count) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00739}00739                 mtx\_unlock(\&droq-\/>\mbox{\hyperlink{structlio__droq_a7251e1f94d2cddfad791a291af24c9d5}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00740}00740                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00741}00741         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00742}00742         \textcolor{keywordflow}{if} (pkt\_count > budget)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00743}00743                 pkt\_count = budget;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00744}00744 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00745}00745         pkts\_processed = \mbox{\hyperlink{lio__droq_8c_a7f49b50524b4acfbe2be987eff4a85c7}{lio\_droq\_fast\_process\_packets}}(oct, droq, pkt\_count);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00746}00746 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00747}00747         atomic\_subtract\_int(\&droq-\/>\mbox{\hyperlink{structlio__droq_ad2d6a2f0ddd1504443b2c4e78c2f4844}{pkts\_pending}}, pkts\_processed);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00748}00748 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00749}00749         \textcolor{comment}{/* Release the lock */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00750}00750         mtx\_unlock(\&droq-\/>\mbox{\hyperlink{structlio__droq_a7251e1f94d2cddfad791a291af24c9d5}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00751}00751 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00752}00752         STAILQ\_FOREACH\_SAFE(tmp, \&droq-\/>\mbox{\hyperlink{structlio__droq_ac3f06ae0b248da4d5a26feff10dce63a}{dispatch\_stq\_head}}, entries, tmp2) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00753}00753                 \textcolor{keyword}{struct }\mbox{\hyperlink{struct____dispatch}{\_\_dispatch}} *rdisp = (\textcolor{keyword}{struct }\mbox{\hyperlink{struct____dispatch}{\_\_dispatch}} *)tmp;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00754}00754 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00755}00755                 STAILQ\_REMOVE\_HEAD(\&droq-\/>\mbox{\hyperlink{structlio__droq_ac3f06ae0b248da4d5a26feff10dce63a}{dispatch\_stq\_head}}, entries);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00756}00756                 rdisp-\/>\mbox{\hyperlink{struct____dispatch_aee1d5af70f5ed1532f1d9ec96645053f}{disp\_fn}}(rdisp-\/>\mbox{\hyperlink{struct____dispatch_a5aa25ef93235012300c32eaf3d6e18fc}{rinfo}}, \mbox{\hyperlink{lio__droq_8c_a0085e7e6a8cdeda47e47d57eb5ced197}{lio\_get\_dispatch\_arg}}(oct,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00757}00757                         (uint16\_t)rdisp-\/>\mbox{\hyperlink{struct____dispatch_a5aa25ef93235012300c32eaf3d6e18fc}{rinfo}}-\/>\mbox{\hyperlink{structlio__recv__info_af74be43e7c57a463316f57b9b26e6231}{recv\_pkt}}-\/>\mbox{\hyperlink{structlio__recv__pkt_ad9934d21e17e8082c40dd044ea49622a}{rh}}.\mbox{\hyperlink{unionocteon__rh_a962ff9890261a8b3cae08f00874785ef}{r}}.\mbox{\hyperlink{unionocteon__rh_ab9c07d205bd948398a3f26f8a1e1ce2d}{opcode}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00758}00758                         (uint16\_t)rdisp-\/>\mbox{\hyperlink{struct____dispatch_a5aa25ef93235012300c32eaf3d6e18fc}{rinfo}}-\/>\mbox{\hyperlink{structlio__recv__info_af74be43e7c57a463316f57b9b26e6231}{recv\_pkt}}-\/>\mbox{\hyperlink{structlio__recv__pkt_ad9934d21e17e8082c40dd044ea49622a}{rh}}.\mbox{\hyperlink{unionocteon__rh_a962ff9890261a8b3cae08f00874785ef}{r}}.\mbox{\hyperlink{unionocteon__rh_a7dca6f6733944c1ad8af3cbcd4e6a21b}{subcode}}));}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00759}00759         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00760}00760 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00761}00761         \textcolor{comment}{/* If there are packets pending. schedule tasklet again */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00762}00762         \textcolor{keywordflow}{if} (atomic\_load\_acq\_int(\&droq-\/>\mbox{\hyperlink{structlio__droq_ad2d6a2f0ddd1504443b2c4e78c2f4844}{pkts\_pending}}))}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00763}00763                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00764}00764 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00765}00765         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00766}00766 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00767}00767 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00768}00768 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00769}\mbox{\hyperlink{lio__droq_8c_aa6cbb0408dce789e716024ae1a208b31}{00769}} \mbox{\hyperlink{lio__droq_8c_aa6cbb0408dce789e716024ae1a208b31}{lio\_register\_droq\_ops}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, uint32\_t q\_no,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00770}00770                       \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq__ops}{lio\_droq\_ops}} *ops)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00771}00771 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00772}00772         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__droq}{lio\_droq}}         *droq;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00773}00773         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__config}{lio\_config}}     *lio\_cfg = NULL;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00774}00774 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00775}00775         lio\_cfg = \mbox{\hyperlink{lio__device_8c_a8f946cabd046605ba62dbc2dd068b075}{lio\_get\_conf}}(oct);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00776}00776 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00777}00777         \textcolor{keywordflow}{if} (lio\_cfg == NULL)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00778}00778                 \textcolor{keywordflow}{return} (-\/EINVAL);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00779}00779 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00780}00780         \textcolor{keywordflow}{if} (ops == NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00781}00781                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}\%s: droq\_ops pointer is NULL\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00782}00782                 \textcolor{keywordflow}{return} (-\/EINVAL);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00783}00783         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00784}00784 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00785}00785         \textcolor{keywordflow}{if} (q\_no >= \mbox{\hyperlink{lio__config_8h_a0b93c03445ee8e942d632505e2012b7c}{LIO\_GET\_OQ\_MAX\_Q\_CFG}}(lio\_cfg)) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00786}00786                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}\%s: droq id (\%d) exceeds MAX (\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00787}00787                             \_\_func\_\_, q\_no, (oct-\/>\mbox{\hyperlink{structocteon__device_a54c2f2f4558411f501e0f46dab998d52}{num\_oqs}} -\/ 1));}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00788}00788                 \textcolor{keywordflow}{return} (-\/EINVAL);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00789}00789         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00790}00790         droq = oct-\/>\mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}[q\_no];}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00791}00791 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00792}00792         mtx\_lock(\&droq-\/>\mbox{\hyperlink{structlio__droq_a7251e1f94d2cddfad791a291af24c9d5}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00793}00793 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00794}00794         memcpy(\&droq-\/>\mbox{\hyperlink{structlio__droq_ae88a0286d66cf94bb9d0ff1ac5df1dbd}{ops}}, ops, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq__ops}{lio\_droq\_ops}}));}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00795}00795 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00796}00796         mtx\_unlock(\&droq-\/>\mbox{\hyperlink{structlio__droq_a7251e1f94d2cddfad791a291af24c9d5}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00797}00797 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00798}00798         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00799}00799 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00800}00800 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00801}00801 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00802}\mbox{\hyperlink{lio__droq_8c_a1f89c5971a094028121830eb9d611e03}{00802}} \mbox{\hyperlink{lio__droq_8c_a1f89c5971a094028121830eb9d611e03}{lio\_unregister\_droq\_ops}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, uint32\_t q\_no)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00803}00803 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00804}00804         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__droq}{lio\_droq}}         *droq;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00805}00805         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__config}{lio\_config}}     *lio\_cfg = NULL;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00806}00806 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00807}00807         lio\_cfg = \mbox{\hyperlink{lio__device_8c_a8f946cabd046605ba62dbc2dd068b075}{lio\_get\_conf}}(oct);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00808}00808 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00809}00809         \textcolor{keywordflow}{if} (lio\_cfg == NULL)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00810}00810                 \textcolor{keywordflow}{return} (-\/EINVAL);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00811}00811 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00812}00812         \textcolor{keywordflow}{if} (q\_no >= \mbox{\hyperlink{lio__config_8h_a0b93c03445ee8e942d632505e2012b7c}{LIO\_GET\_OQ\_MAX\_Q\_CFG}}(lio\_cfg)) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00813}00813                 \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}\%s: droq id (\%d) exceeds MAX (\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00814}00814                             \_\_func\_\_, q\_no, oct-\/>\mbox{\hyperlink{structocteon__device_a54c2f2f4558411f501e0f46dab998d52}{num\_oqs}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00815}00815                 \textcolor{keywordflow}{return} (-\/EINVAL);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00816}00816         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00817}00817 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00818}00818         droq = oct-\/>\mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}[q\_no];}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00819}00819 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00820}00820         \textcolor{keywordflow}{if} (droq == NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00821}00821                 \mbox{\hyperlink{lio__bsd_8h_ae98de25aa714ca601589b31d9364062a}{lio\_dev\_info}}(oct, \textcolor{stringliteral}{"{}Droq id (\%d) not available.\(\backslash\)n"{}}, q\_no);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00822}00822                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00823}00823         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00824}00824 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00825}00825         mtx\_lock(\&droq-\/>\mbox{\hyperlink{structlio__droq_a7251e1f94d2cddfad791a291af24c9d5}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00826}00826 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00827}00827         droq-\/>\mbox{\hyperlink{structlio__droq_ae88a0286d66cf94bb9d0ff1ac5df1dbd}{ops}}.\mbox{\hyperlink{structlio__droq__ops_a3af9e6d88a3e035687f01f8f9f23df90}{fptr}} = NULL;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00828}00828         droq-\/>\mbox{\hyperlink{structlio__droq_ae88a0286d66cf94bb9d0ff1ac5df1dbd}{ops}}.\mbox{\hyperlink{structlio__droq__ops_a8d6399fb87c92fa1f7c8182bd74a9825}{farg}} = NULL;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00829}00829         droq-\/>\mbox{\hyperlink{structlio__droq_ae88a0286d66cf94bb9d0ff1ac5df1dbd}{ops}}.\mbox{\hyperlink{structlio__droq__ops_ad8637959ec8d28db4e71bceb3cd0bb72}{drop\_on\_max}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00830}00830 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00831}00831         mtx\_unlock(\&droq-\/>\mbox{\hyperlink{structlio__droq_a7251e1f94d2cddfad791a291af24c9d5}{lock}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00832}00832 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00833}00833         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00834}00834 \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00835}00835 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00836}00836 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00837}\mbox{\hyperlink{lio__droq_8c_a6319a6eb35898836f553ef711af35b48}{00837}} \mbox{\hyperlink{lio__droq_8c_a6319a6eb35898836f553ef711af35b48}{lio\_create\_droq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structocteon__device}{octeon\_device}} *oct, uint32\_t q\_no, uint32\_t num\_descs,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00838}00838                 uint32\_t desc\_size, \textcolor{keywordtype}{void} *app\_ctx)}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00839}00839 \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00840}00840 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00841}00841         \textcolor{keywordflow}{if} (oct-\/>\mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}[q\_no]-\/>\mbox{\hyperlink{structlio__droq_abfe9c93b6ecc98001aee1aba83e2d237}{oct\_dev}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00842}00842                 \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(oct, \textcolor{stringliteral}{"{}Droq already in use. Cannot create droq \%d again\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00843}00843                             q\_no);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00844}00844                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00845}00845         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00846}00846 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00847}00847         \textcolor{comment}{/* Initialize the Droq */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00848}00848         \textcolor{keywordflow}{if} (\mbox{\hyperlink{lio__droq_8c_a066447f50e87b50de4e48d7c01ee779c}{lio\_init\_droq}}(oct, q\_no, num\_descs, desc\_size, app\_ctx)) \{}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00849}00849                 bzero(oct-\/>\mbox{\hyperlink{structocteon__device_aa5854f223a4f85c18564802c6a8d2b82}{droq}}[q\_no], \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlio__droq}{lio\_droq}}));}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00850}00850                 \textcolor{keywordflow}{goto} create\_droq\_fail;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00851}00851         \}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00852}00852 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00853}00853         oct-\/>\mbox{\hyperlink{structocteon__device_a54c2f2f4558411f501e0f46dab998d52}{num\_oqs}}++;}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00854}00854 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00855}00855         \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(oct, \textcolor{stringliteral}{"{}\%s: Total number of OQ: \%d\(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00856}00856                     oct-\/>\mbox{\hyperlink{structocteon__device_a54c2f2f4558411f501e0f46dab998d52}{num\_oqs}});}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00857}00857 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00858}00858         \textcolor{comment}{/* Global Droq register settings */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00859}00859 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00860}00860         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00861}00861 \textcolor{comment}{         * As of now not required, as setting are done for all 32 Droqs at}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00862}00862 \textcolor{comment}{         * the same time.}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00863}00863 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00864}00864         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00865}00865 }
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00866}00866 create\_droq\_fail:}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00867}00867         \textcolor{keywordflow}{return} (-\/ENOMEM);}
\DoxyCodeLine{\Hypertarget{lio__droq_8c_source_l00868}00868 \}}

\end{DoxyCode}
