\hypertarget{lio__rxtx_8c_source}{}\doxysection{lio\+\_\+rxtx.\+c}
\label{lio__rxtx_8c_source}\index{dev/liquidio/lio\_rxtx.c@{dev/liquidio/lio\_rxtx.c}}
\mbox{\hyperlink{lio__rxtx_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00001}00001 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00002}00002 \textcolor{comment}{ *   BSD LICENSE}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00004}00004 \textcolor{comment}{ *   Copyright(c) 2017 Cavium, Inc.. All rights reserved.}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00005}00005 \textcolor{comment}{ *   All rights reserved.}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00007}00007 \textcolor{comment}{ *   Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00008}00008 \textcolor{comment}{ *   modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00009}00009 \textcolor{comment}{ *   are met:}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00011}00011 \textcolor{comment}{ *     * Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00012}00012 \textcolor{comment}{ *       notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00013}00013 \textcolor{comment}{ *     * Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00014}00014 \textcolor{comment}{ *       notice, this list of conditions and the following disclaimer in}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00015}00015 \textcolor{comment}{ *       the documentation and/or other materials provided with the}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00016}00016 \textcolor{comment}{ *       distribution.}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00017}00017 \textcolor{comment}{ *     * Neither the name of Cavium, Inc. nor the names of its}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00018}00018 \textcolor{comment}{ *       contributors may be used to endorse or promote products derived}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00019}00019 \textcolor{comment}{ *       from this software without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00020}00020 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00021}00021 \textcolor{comment}{ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00022}00022 \textcolor{comment}{ *   "{}AS IS"{} AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00023}00023 \textcolor{comment}{ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00024}00024 \textcolor{comment}{ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00025}00025 \textcolor{comment}{ *   OWNER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00026}00026 \textcolor{comment}{ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00027}00027 \textcolor{comment}{ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00028}00028 \textcolor{comment}{ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00029}00029 \textcolor{comment}{ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00030}00030 \textcolor{comment}{ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00031}00031 \textcolor{comment}{ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00032}00032 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00033}00033 \textcolor{comment}{/*\$FreeBSD\$*/}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00035}00035 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__bsd_8h}{lio\_bsd.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00036}00036 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__common_8h}{lio\_common.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00037}00037 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__droq_8h}{lio\_droq.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00038}00038 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__iq_8h}{lio\_iq.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00039}00039 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__response__manager_8h}{lio\_response\_manager.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00040}00040 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__device_8h}{lio\_device.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00041}00041 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__ctrl_8h}{lio\_ctrl.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00042}00042 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__main_8h}{lio\_main.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00043}00043 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__network_8h}{lio\_network.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00044}00044 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{lio__rxtx_8h}{lio\_rxtx.h}}"{}}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00045}00045 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00046}00046 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00047}\mbox{\hyperlink{lio__rxtx_8c_a357e0a6229c74147b38de453604e3a2b}{00047}} \mbox{\hyperlink{lio__rxtx_8c_a357e0a6229c74147b38de453604e3a2b}{lio\_xmit}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlio}{lio}} *\mbox{\hyperlink{structlio}{lio}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__instr__queue}{lio\_instr\_queue}} *iq,}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00048}00048          \textcolor{keyword}{struct} mbuf **m\_headp)}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00049}00049 \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00050}00050         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__data__pkt}{lio\_data\_pkt}}         ndata;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00051}00051         \textcolor{keyword}{union }\mbox{\hyperlink{unionlio__cmd__setup}{lio\_cmd\_setup}}                cmdsetup;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00052}00052         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__mbuf__free__info}{lio\_mbuf\_free\_info}}     *finfo = NULL;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00053}00053         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__device}{octeon\_device}}               *oct = iq-\/>\mbox{\hyperlink{structlio__instr__queue_a93a4882d7471320902b3445ee35f1a88}{oct\_dev}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00054}00054         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__iq__stats}{lio\_iq\_stats}}         *stats;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00055}00055         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__instr__irh}{octeon\_instr\_irh}}         *irh;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00056}00056         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__request__list}{lio\_request\_list}}         *tx\_buf;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00057}00057         \textcolor{keyword}{union }\mbox{\hyperlink{unionlio__tx__info}{lio\_tx\_info}}            *tx\_info;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00058}00058         \textcolor{keyword}{struct }mbuf                     *m\_head;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00059}00059         bus\_dma\_segment\_t               segs[\mbox{\hyperlink{lio__network_8h_aa52cb75819e079f0cc21d14f42af60b0}{LIO\_MAX\_SG}}];}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00060}00060         bus\_dmamap\_t                    map;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00061}00061         uint64\_t        dptr = 0;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00062}00062         uint32\_t        tag = 0;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00063}00063         \textcolor{keywordtype}{int}             iq\_no = 0;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00064}00064         \textcolor{keywordtype}{int}             nsegs;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00065}00065         \textcolor{keywordtype}{int}             status = 0;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00066}00066 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00067}00067         iq\_no = iq-\/>\mbox{\hyperlink{structlio__instr__queue_a0f80e25acea3c55a342c247a68038dec}{txpciq}}.\mbox{\hyperlink{unionocteon__txpciq_a6d4c2fdb74975a61c5ff707a70b8b277}{s}}.\mbox{\hyperlink{unionocteon__txpciq_a036a1f65fa239c8b4dbdcca730c8e47a}{q\_no}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00068}00068         tag = iq\_no;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00069}00069         stats = \&oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[iq\_no]-\/>\mbox{\hyperlink{structlio__instr__queue_ae643e92210d775f5ab51b3ea613abbad}{stats}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00070}00070         tx\_buf = iq-\/>\mbox{\hyperlink{structlio__instr__queue_a4e5bff40aeeea3e15a6624aecee178ea}{request\_list}} + iq-\/>\mbox{\hyperlink{structlio__instr__queue_ae41b850d5975e90e5d817eeacfa1d19e}{host\_write\_index}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00071}00071 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00072}00072         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00073}00073 \textcolor{comment}{         * Check for all conditions in which the current packet cannot be}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00074}00074 \textcolor{comment}{         * transmitted.}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00075}00075 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00076}00076         \textcolor{keywordflow}{if} (!(atomic\_load\_acq\_int(\&\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_aa69df616e50527613761d53375065bb7}{ifstate}}) \& \mbox{\hyperlink{lio__rxtx_8h_a6ee79fd2e38d1717a146513ac126fe4b}{LIO\_IFSTATE\_RUNNING}}) ||}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00077}00077             (!\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_aea3442e0b2b012f49360d68d80e30323}{linfo}}.\mbox{\hyperlink{structocteon__link__info_ab938dec6629cd68cf950f7e72f8a274d}{link}}.\mbox{\hyperlink{unionocteon__link__status_ae37b5eac8622127d61e40081d5e5f4ed}{s}}.\mbox{\hyperlink{unionocteon__link__status_a4c66290c810d4bc3372d88e9dec84008}{link\_up}})) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00078}00078                 \mbox{\hyperlink{lio__bsd_8h_ae98de25aa714ca601589b31d9364062a}{lio\_dev\_info}}(oct, \textcolor{stringliteral}{"{}Transmit failed link\_status : \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00079}00079                              \mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_aea3442e0b2b012f49360d68d80e30323}{linfo}}.\mbox{\hyperlink{structocteon__link__info_ab938dec6629cd68cf950f7e72f8a274d}{link}}.\mbox{\hyperlink{unionocteon__link__status_ae37b5eac8622127d61e40081d5e5f4ed}{s}}.\mbox{\hyperlink{unionocteon__link__status_a4c66290c810d4bc3372d88e9dec84008}{link\_up}});}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00080}00080                 status = ENETDOWN;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00081}00081                 \textcolor{keywordflow}{goto} drop\_packet;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00082}00082         \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00084}00084         \textcolor{keywordflow}{if} (\mbox{\hyperlink{lio__ctrl_8h_ad49e9332836211d9354f36168b4f5fe6}{lio\_iq\_is\_full}}(oct, iq\_no)) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00085}00085                 \textcolor{comment}{/* Defer sending if queue is full */}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00086}00086                 \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(oct, \textcolor{stringliteral}{"{}Transmit failed iq:\%d full\(\backslash\)n"{}}, iq\_no);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00087}00087                 stats-\/>\mbox{\hyperlink{structlio__iq__stats_ac661f273d6f4afe3b13971db559755b2}{tx\_iq\_busy}}++;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00088}00088                 \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00089}00089         \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00091}00091         map = tx\_buf-\/>\mbox{\hyperlink{structlio__request__list_a485e722002f5ce766f41e9947b56726b}{map}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00092}00092         status = bus\_dmamap\_load\_mbuf\_sg(iq-\/>\mbox{\hyperlink{structlio__instr__queue_abe0999a1b9ad355655c815c85eefd061}{txtag}}, map, *m\_headp, segs, \&nsegs,}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00093}00093                                          BUS\_DMA\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00094}00094         \textcolor{keywordflow}{if} (status == EFBIG) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00095}00095                 \textcolor{keyword}{struct }mbuf     *m;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00096}00096 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00097}00097                 m = m\_defrag(*m\_headp, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00098}00098                 \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00099}00099                         stats-\/>\mbox{\hyperlink{structlio__iq__stats_a39ed3e8f048c90a4a0357b2b4d6e2e77}{mbuf\_defrag\_failed}}++;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00100}00100                         \textcolor{keywordflow}{goto} drop\_packet;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00101}00101                 \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00103}00103                 *m\_headp = m;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00104}00104                 status = bus\_dmamap\_load\_mbuf\_sg(iq-\/>\mbox{\hyperlink{structlio__instr__queue_abe0999a1b9ad355655c815c85eefd061}{txtag}}, map,}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00105}00105                                                  *m\_headp, segs, \&nsegs,}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00106}00106                                                  BUS\_DMA\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00107}00107         \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00109}00109         \textcolor{keywordflow}{if} (status == ENOMEM) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00110}00110                 \textcolor{keywordflow}{goto} retry;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00111}00111         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (status) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00112}00112                 stats-\/>\mbox{\hyperlink{structlio__iq__stats_a8188e3d1514d2dd8b61d72a5e09b9d6a}{tx\_dmamap\_fail}}++;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00113}00113                 \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(oct, \textcolor{stringliteral}{"{}bus\_dmamap\_load\_mbuf\_sg failed with error \%d. iq:\%d"{}},}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00114}00114                             status, iq\_no);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00115}00115                 \textcolor{keywordflow}{goto} drop\_packet;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00116}00116         \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00117}00117 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00118}00118         m\_head = *m\_headp;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00119}00119 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00120}00120         \textcolor{comment}{/* Info used to unmap and free the buffers. */}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00121}00121         finfo = \&tx\_buf-\/>\mbox{\hyperlink{structlio__request__list_a75892855cd84b730e9a420ec9c8f1266}{finfo}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00122}00122         finfo-\/>\mbox{\hyperlink{structlio__mbuf__free__info_a2a4d1a328ae532fdc96a06e972ed3565}{map}} = map;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00123}00123         finfo-\/>\mbox{\hyperlink{structlio__mbuf__free__info_a8fd8ae090b47b0674bdf9b8a9c6f0f96}{mb}} = m\_head;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00124}00124 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00125}00125         \textcolor{comment}{/* Prepare the attributes for the data to be passed to OSI. */}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00126}00126         bzero(\&ndata, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structlio__data__pkt}{lio\_data\_pkt}}));}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00127}00127 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00128}00128         ndata.\mbox{\hyperlink{structlio__data__pkt_a325b2e2eb843eebc6b9bc24a35126a28}{buf}} = (\textcolor{keywordtype}{void} *)finfo;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00129}00129         ndata.\mbox{\hyperlink{structlio__data__pkt_aeff507c9edb9a92de781b0165a1a71c5}{q\_no}} = iq\_no;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00130}00130         ndata.\mbox{\hyperlink{structlio__data__pkt_a5c58b99afb9a5b22f18af7c410d12715}{datasize}} = m\_head-\/>m\_pkthdr.len;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00132}00132         cmdsetup.\mbox{\hyperlink{unionlio__cmd__setup_ac0b7e260cc39c8889f14a28b4bb98949}{cmd\_setup64}} = 0;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00133}00133         cmdsetup.\mbox{\hyperlink{unionlio__cmd__setup_a4fa45a2b072aab999adc5e82c6c2ea53}{s}}.\mbox{\hyperlink{unionlio__cmd__setup_a77047bd01337472c112bd3877b2d5582}{iq\_no}} = iq\_no;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00134}00134 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00135}00135         \textcolor{keywordflow}{if} (m\_head-\/>m\_pkthdr.csum\_flags \& CSUM\_IP)}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00136}00136                 cmdsetup.\mbox{\hyperlink{unionlio__cmd__setup_a4fa45a2b072aab999adc5e82c6c2ea53}{s}}.\mbox{\hyperlink{unionlio__cmd__setup_a63a558618507762455c1a1078a62fab5}{ip\_csum}} = 1;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00137}00137 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00138}00138         \textcolor{keywordflow}{if} ((m\_head-\/>m\_pkthdr.csum\_flags \& (CSUM\_IP\_TCP | CSUM\_IP6\_TCP)) ||}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00139}00139             (m\_head-\/>m\_pkthdr.csum\_flags \& (CSUM\_IP\_UDP | CSUM\_IP6\_UDP)))}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00140}00140                 cmdsetup.\mbox{\hyperlink{unionlio__cmd__setup_a4fa45a2b072aab999adc5e82c6c2ea53}{s}}.\mbox{\hyperlink{unionlio__cmd__setup_a45c7d52c7a64ad563331441c5e17ed8a}{transport\_csum}} = 1;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00141}00141 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00142}00142         if (nsegs == 1) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00143}00143                 cmdsetup.\mbox{\hyperlink{unionlio__cmd__setup_a4fa45a2b072aab999adc5e82c6c2ea53}{s}}.\mbox{\hyperlink{unionlio__cmd__setup_af6077ded8535c2255a9aefc7edf1ad3b}{u}}.\mbox{\hyperlink{unionlio__cmd__setup_a7d970ea2d76ed9d535e5279952c1c0a3}{datasize}} = segs[0].ds\_len;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00144}00144                 \mbox{\hyperlink{lio__ctrl_8h_a605586f09a7ebf403750467becba4142}{lio\_prepare\_pci\_cmd}}(oct, \&ndata.\mbox{\hyperlink{structlio__data__pkt_ae77ae7d3c0659157efda0c0230405e7c}{cmd}}, \&cmdsetup, tag);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00145}00145 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00146}00146                 dptr = segs[0].ds\_addr;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00147}00147                 ndata.\mbox{\hyperlink{structlio__data__pkt_ae77ae7d3c0659157efda0c0230405e7c}{cmd}}.\mbox{\hyperlink{unionlio__instr__64B_aa7ec9f85a5dee448e720d3779e0363c4}{cmd3}}.\mbox{\hyperlink{structlio__instr3__64B_ac19df0c9adaeb4d8532352ea9006d317}{dptr}} = dptr;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00148}00148                 ndata.\mbox{\hyperlink{structlio__data__pkt_a91149557742e4d8874c1576a98455555}{reqtype}} = \mbox{\hyperlink{lio__iq_8h_a39c656cae9d6ced0d82d1a3ee980a472}{LIO\_REQTYPE\_NORESP\_NET}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00149}00149 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00150}00150         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00151}00151                 \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__gather}{lio\_gather}}     *g;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00152}00152                 \textcolor{keywordtype}{int}     i;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00154}00154                 mtx\_lock(\&\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a1fcf7c8fbcb0b8a7e7e43a72bca67bf2}{glist\_lock}}[iq\_no]);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00155}00155                 g = (\textcolor{keyword}{struct }\mbox{\hyperlink{structlio__gather}{lio\_gather}} *)}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00156}00156                         \mbox{\hyperlink{lio__bsd_8h_a0a40303ded54bd63591be7584a998306}{lio\_delete\_first\_node}}(\&\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a0d9ddaa68dd8fbe28aa38037079e5603}{ghead}}[iq\_no]);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00157}00157                 mtx\_unlock(\&\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a1fcf7c8fbcb0b8a7e7e43a72bca67bf2}{glist\_lock}}[iq\_no]);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00158}00158 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00159}00159                 \textcolor{keywordflow}{if} (g == NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00160}00160                         \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct,}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00161}00161                                     \textcolor{stringliteral}{"{}Transmit scatter gather: glist null!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00162}00162                         \textcolor{keywordflow}{goto} retry;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00163}00163                 \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00164}00164 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00165}00165                 cmdsetup.\mbox{\hyperlink{unionlio__cmd__setup_a4fa45a2b072aab999adc5e82c6c2ea53}{s}}.\mbox{\hyperlink{unionlio__cmd__setup_a9339eb0785893155ce93eeb0560e29d0}{gather}} = 1;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00166}00166                 cmdsetup.\mbox{\hyperlink{unionlio__cmd__setup_a4fa45a2b072aab999adc5e82c6c2ea53}{s}}.\mbox{\hyperlink{unionlio__cmd__setup_af6077ded8535c2255a9aefc7edf1ad3b}{u}}.\mbox{\hyperlink{unionlio__cmd__setup_a75386b3d071061aaeb1be7c6f13b239d}{gatherptrs}} = nsegs;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00167}00167                 \mbox{\hyperlink{lio__ctrl_8h_a605586f09a7ebf403750467becba4142}{lio\_prepare\_pci\_cmd}}(oct, \&ndata.\mbox{\hyperlink{structlio__data__pkt_ae77ae7d3c0659157efda0c0230405e7c}{cmd}}, \&cmdsetup, tag);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00168}00168 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00169}00169                 bzero(g-\/>\mbox{\hyperlink{structlio__gather_aa9f0d8b8241c2588883f2d2bb3d61094}{sg}}, g-\/>\mbox{\hyperlink{structlio__gather_a3f865ea14d3428a4d5c042c930e2ac3d}{sg\_size}});}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00170}00170 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00171}00171                 i = 0;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00172}00172                 \textcolor{keywordflow}{while} (nsegs-\/-\/) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00173}00173                         g-\/>\mbox{\hyperlink{structlio__gather_aa9f0d8b8241c2588883f2d2bb3d61094}{sg}}[(i >> 2)].ptr[(i \& 3)] = segs[i].ds\_addr;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00174}00174                         \mbox{\hyperlink{lio__common_8h_a6ec88d76259f482a55c2a990d07e0b33}{lio\_add\_sg\_size}}(\&g-\/>\mbox{\hyperlink{structlio__gather_aa9f0d8b8241c2588883f2d2bb3d61094}{sg}}[(i >> 2)], segs[i].ds\_len,}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00175}00175                                         (i \& 3));}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00176}00176                         i++;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00177}00177                 \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00178}00178 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00179}00179                 dptr = g-\/>\mbox{\hyperlink{structlio__gather_a845d9b5fc0ebe4ec3fa17bc08505d8b6}{sg\_dma\_ptr}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00180}00180 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00181}00181                 ndata.\mbox{\hyperlink{structlio__data__pkt_ae77ae7d3c0659157efda0c0230405e7c}{cmd}}.\mbox{\hyperlink{unionlio__instr__64B_aa7ec9f85a5dee448e720d3779e0363c4}{cmd3}}.\mbox{\hyperlink{structlio__instr3__64B_ac19df0c9adaeb4d8532352ea9006d317}{dptr}} = dptr;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00182}00182                 finfo-\/>\mbox{\hyperlink{structlio__mbuf__free__info_ad02cacc15814394734987994710848fd}{g}} = g;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00183}00183 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00184}00184                 ndata.\mbox{\hyperlink{structlio__data__pkt_a91149557742e4d8874c1576a98455555}{reqtype}} = \mbox{\hyperlink{lio__iq_8h_ae9a1a7ccae115012756db05cc36ade19}{LIO\_REQTYPE\_NORESP\_NET\_SG}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00185}00185         \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00186}00186 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00187}00187         irh = (\textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__instr__irh}{octeon\_instr\_irh}} *)\&ndata.\mbox{\hyperlink{structlio__data__pkt_ae77ae7d3c0659157efda0c0230405e7c}{cmd}}.\mbox{\hyperlink{unionlio__instr__64B_aa7ec9f85a5dee448e720d3779e0363c4}{cmd3}}.\mbox{\hyperlink{structlio__instr3__64B_af53f292fb39e1eb4f33adbffaa00f7d3}{irh}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00188}00188         tx\_info = (\textcolor{keyword}{union} \mbox{\hyperlink{unionlio__tx__info}{lio\_tx\_info}} *)\&ndata.\mbox{\hyperlink{structlio__data__pkt_ae77ae7d3c0659157efda0c0230405e7c}{cmd}}.\mbox{\hyperlink{unionlio__instr__64B_aa7ec9f85a5dee448e720d3779e0363c4}{cmd3}}.\mbox{\hyperlink{structlio__instr3__64B_a3ad43b3219f365687cd6535ca3c029f7}{ossp}}[0];}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00189}00189 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00190}00190         \textcolor{keywordflow}{if} (m\_head-\/>m\_pkthdr.csum\_flags \& (CSUM\_IP\_TSO | CSUM\_IP6\_TSO)) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00191}00191                 tx\_info-\/>\mbox{\hyperlink{unionlio__tx__info_a6f756d9441accbb54f1ee1dc410f15f5}{s}}.\mbox{\hyperlink{unionlio__tx__info_ad34305f3acd6adb81fee1f778077c65f}{gso\_size}} = m\_head-\/>m\_pkthdr.tso\_segsz;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00192}00192                 tx\_info-\/>\mbox{\hyperlink{unionlio__tx__info_a6f756d9441accbb54f1ee1dc410f15f5}{s}}.\mbox{\hyperlink{unionlio__tx__info_aaff849c9dcd6cd7b2b8cf4db8dda3040}{gso\_segs}} = howmany(m\_head-\/>m\_pkthdr.len,}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00193}00193                                               m\_head-\/>m\_pkthdr.tso\_segsz);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00194}00194                 stats-\/>\mbox{\hyperlink{structlio__iq__stats_afc2ce43993ad2d1c36a62a4c2acef9bf}{tx\_gso}}++;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00195}00195         \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00196}00196 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00197}00197         \textcolor{comment}{/* HW insert VLAN tag */}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00198}00198         \textcolor{keywordflow}{if} (m\_head-\/>m\_flags \& M\_VLANTAG) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00199}00199                 irh-\/>\mbox{\hyperlink{structocteon__instr__irh_a15e9e95c1d92b0713272680671dd69ff}{priority}} = m\_head-\/>m\_pkthdr.ether\_vtag >> 13;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00200}00200                 irh-\/>\mbox{\hyperlink{structocteon__instr__irh_a5dc6da11d991dd0e60dfb83584d9861e}{vlan}} = m\_head-\/>m\_pkthdr.ether\_vtag \& 0xfff;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00201}00201         \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00202}00202 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00203}00203         status = \mbox{\hyperlink{lio__ctrl_8c_a983d3d30828169adae4e8a58c1817fd1}{lio\_send\_data\_pkt}}(oct, \&ndata);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00204}00204         \textcolor{keywordflow}{if} (status == \mbox{\hyperlink{lio__iq_8h_a7a8baba01e32a87bd344a3ec2c8f703a}{LIO\_IQ\_SEND\_FAILED}})}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00205}00205                 \textcolor{keywordflow}{goto} retry;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00206}00206 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00207}00207         \textcolor{keywordflow}{if} (tx\_info-\/>\mbox{\hyperlink{unionlio__tx__info_a6f756d9441accbb54f1ee1dc410f15f5}{s}}.\mbox{\hyperlink{unionlio__tx__info_aaff849c9dcd6cd7b2b8cf4db8dda3040}{gso\_segs}})}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00208}00208                 stats-\/>\mbox{\hyperlink{structlio__iq__stats_a05b3db5300ff3030adcc8150a672cfda}{tx\_done}} += tx\_info-\/>\mbox{\hyperlink{unionlio__tx__info_a6f756d9441accbb54f1ee1dc410f15f5}{s}}.\mbox{\hyperlink{unionlio__tx__info_aaff849c9dcd6cd7b2b8cf4db8dda3040}{gso\_segs}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00209}00209         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00210}00210                 stats-\/>\mbox{\hyperlink{structlio__iq__stats_a05b3db5300ff3030adcc8150a672cfda}{tx\_done}}++;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00211}00211 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00212}00212         stats-\/>\mbox{\hyperlink{structlio__iq__stats_a6d899154a9db06c055c017201ff9938d}{tx\_tot\_bytes}} += ndata.\mbox{\hyperlink{structlio__data__pkt_a5c58b99afb9a5b22f18af7c410d12715}{datasize}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00213}00213 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00214}00214         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00215}00215 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00216}00216 retry:}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00217}00217         \textcolor{keywordflow}{return} (ENOBUFS);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00218}00218 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00219}00219 drop\_packet:}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00220}00220         stats-\/>\mbox{\hyperlink{structlio__iq__stats_af990b38eef526802f42c3578f22669ad}{tx\_dropped}}++;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00221}00221         \mbox{\hyperlink{lio__bsd_8h_abe414f7d7854f53de3fe9db975df03db}{lio\_dev\_err}}(oct, \textcolor{stringliteral}{"{}IQ\%d Transmit dropped: \%llu\(\backslash\)n"{}}, iq\_no,}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00222}00222                     \mbox{\hyperlink{lio__main_8h_ae67a87eb5deeb31e550aa38dfa869505}{LIO\_CAST64}}(stats-\/>\mbox{\hyperlink{structlio__iq__stats_af990b38eef526802f42c3578f22669ad}{tx\_dropped}}));}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00223}00223 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00224}00224         m\_freem(*m\_headp);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00225}00225         *m\_headp = NULL;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00226}00226 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00227}00227         \textcolor{keywordflow}{return} (status);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00228}00228 \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00229}00229 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00230}00230 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00231}\mbox{\hyperlink{lio__rxtx_8c_a61ddde62ce3624ee8e0fc182077e3862}{00231}} \mbox{\hyperlink{lio__rxtx_8c_a61ddde62ce3624ee8e0fc182077e3862}{lio\_mq\_start\_locked}}(\textcolor{keyword}{struct} ifnet *ifp, \textcolor{keyword}{struct} \mbox{\hyperlink{structlio__instr__queue}{lio\_instr\_queue}} *iq)}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00232}00232 \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00233}00233         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio}{lio}}   *\mbox{\hyperlink{structlio}{lio}} = if\_getsoftc(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}});}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00234}00234         \textcolor{keyword}{struct }mbuf     *next;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00235}00235         \textcolor{keywordtype}{int}             err = 0;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00236}00236 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00237}00237         \textcolor{keywordflow}{if} (((if\_getdrvflags(ifp) \& IFF\_DRV\_RUNNING) == 0) ||}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00238}00238             (!\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_aea3442e0b2b012f49360d68d80e30323}{linfo}}.\mbox{\hyperlink{structocteon__link__info_ab938dec6629cd68cf950f7e72f8a274d}{link}}.\mbox{\hyperlink{unionocteon__link__status_ae37b5eac8622127d61e40081d5e5f4ed}{s}}.\mbox{\hyperlink{unionocteon__link__status_a4c66290c810d4bc3372d88e9dec84008}{link\_up}}))}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00239}00239                 \textcolor{keywordflow}{return} (-\/ENETDOWN);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00241}00241         \textcolor{comment}{/* Process the queue */}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00242}00242         \textcolor{keywordflow}{while} ((next = drbr\_peek(ifp, iq-\/>\mbox{\hyperlink{structlio__instr__queue_ad8faf8e3254cabbbe74d35048cfd88a5}{br}})) != NULL) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00243}00243                 err = \mbox{\hyperlink{lio__rxtx_8c_a357e0a6229c74147b38de453604e3a2b}{lio\_xmit}}(\mbox{\hyperlink{structlio}{lio}}, iq, \&next);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00244}00244                 \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00245}00245                         \textcolor{keywordflow}{if} (next == NULL)}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00246}00246                                 drbr\_advance(ifp, iq-\/>\mbox{\hyperlink{structlio__instr__queue_ad8faf8e3254cabbbe74d35048cfd88a5}{br}});}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00247}00247                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00248}00248                                 drbr\_putback(ifp, iq-\/>\mbox{\hyperlink{structlio__instr__queue_ad8faf8e3254cabbbe74d35048cfd88a5}{br}}, next);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00249}00249                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00250}00250                 \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00251}00251                 drbr\_advance(ifp, iq-\/>\mbox{\hyperlink{structlio__instr__queue_ad8faf8e3254cabbbe74d35048cfd88a5}{br}});}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00252}00252                 \textcolor{comment}{/* Send a copy of the frame to the BPF listener */}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00253}00253                 ETHER\_BPF\_MTAP(ifp, next);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00254}00254                 \textcolor{keywordflow}{if} (((if\_getdrvflags(ifp) \& IFF\_DRV\_RUNNING) == 0) ||}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00255}00255                     (!\mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_aea3442e0b2b012f49360d68d80e30323}{linfo}}.\mbox{\hyperlink{structocteon__link__info_ab938dec6629cd68cf950f7e72f8a274d}{link}}.\mbox{\hyperlink{unionocteon__link__status_ae37b5eac8622127d61e40081d5e5f4ed}{s}}.\mbox{\hyperlink{unionocteon__link__status_a4c66290c810d4bc3372d88e9dec84008}{link\_up}}))}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00256}00256                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00257}00257         \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00258}00258 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00259}00259         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00260}00260 \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00261}00261 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00262}00262 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00263}\mbox{\hyperlink{lio__rxtx_8c_a9df63599d6f995462dca5a547fd2dbd6}{00263}} \mbox{\hyperlink{lio__rxtx_8c_a9df63599d6f995462dca5a547fd2dbd6}{lio\_mq\_start}}(\textcolor{keyword}{struct} ifnet *ifp, \textcolor{keyword}{struct} mbuf *m)}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00264}00264 \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00265}00265         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio}{lio}}           *\mbox{\hyperlink{structlio}{lio}} = if\_getsoftc(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}});}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00266}00266         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__device}{octeon\_device}}       *oct = \mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00267}00267         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__instr__queue}{lio\_instr\_queue}}   *iq;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00268}00268         \textcolor{keywordtype}{int}     err = 0, i;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00269}00269 \textcolor{preprocessor}{\#ifdef RSS}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00270}00270         uint32\_t        bucket\_id;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00271}00271 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00272}00272 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00273}00273         \textcolor{keywordflow}{if} (M\_HASHTYPE\_GET(m) != M\_HASHTYPE\_NONE) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00274}00274 \textcolor{preprocessor}{\#ifdef RSS}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00275}00275                 \textcolor{keywordflow}{if} (rss\_hash2bucket(m-\/>m\_pkthdr.flowid, M\_HASHTYPE\_GET(m),}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00276}00276                                     \&bucket\_id) == 0) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00277}00277                         i = bucket\_id \% oct-\/>\mbox{\hyperlink{structocteon__device_aa5139c7e09f7a8eca4676713d09b00e5}{num\_iqs}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00278}00278                         \textcolor{keywordflow}{if} (bucket\_id > oct-\/>\mbox{\hyperlink{structocteon__device_aa5139c7e09f7a8eca4676713d09b00e5}{num\_iqs}})}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00279}00279                                 \mbox{\hyperlink{lio__bsd_8h_a1e6b64f2d951d285e7d956ce8cd5dd04}{lio\_dev\_dbg}}(oct,}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00280}00280                                             \textcolor{stringliteral}{"{}bucket\_id (\%d) > num\_iqs (\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00281}00281                                             bucket\_id, oct-\/>\mbox{\hyperlink{structocteon__device_aa5139c7e09f7a8eca4676713d09b00e5}{num\_iqs}});}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00282}00282                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00283}00283 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00284}00284                         i = m-\/>m\_pkthdr.flowid \% oct-\/>\mbox{\hyperlink{structocteon__device_aa5139c7e09f7a8eca4676713d09b00e5}{num\_iqs}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00285}00285         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00286}00286                 i = curcpu \% oct-\/>\mbox{\hyperlink{structocteon__device_aa5139c7e09f7a8eca4676713d09b00e5}{num\_iqs}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00287}00287 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00288}00288         iq = oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[i];}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00289}00289 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00290}00290         err = drbr\_enqueue(ifp, iq-\/>\mbox{\hyperlink{structlio__instr__queue_ad8faf8e3254cabbbe74d35048cfd88a5}{br}}, m);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00291}00291         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00292}00292                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00293}00293 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00294}00294         \textcolor{keywordflow}{if} (mtx\_trylock(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_aedf00f27438279abe25f4926facac1ef}{enq\_lock}})) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00295}00295                 \mbox{\hyperlink{lio__rxtx_8c_a61ddde62ce3624ee8e0fc182077e3862}{lio\_mq\_start\_locked}}(ifp, iq);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00296}00296                 mtx\_unlock(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_aedf00f27438279abe25f4926facac1ef}{enq\_lock}});}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00297}00297         \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00298}00298 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00299}00299         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00300}00300 \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00301}00301 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00302}00302 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00303}\mbox{\hyperlink{lio__rxtx_8c_a05d8ae514c414dd15157920756336af0}{00303}} \mbox{\hyperlink{lio__rxtx_8c_a05d8ae514c414dd15157920756336af0}{lio\_qflush}}(\textcolor{keyword}{struct} ifnet *ifp)}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00304}00304 \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00305}00305         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio}{lio}}           *\mbox{\hyperlink{structlio}{lio}} = if\_getsoftc(\mbox{\hyperlink{structlio_a697242953be9b24a43568960906f5b86}{ifp}});}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00306}00306         \textcolor{keyword}{struct }\mbox{\hyperlink{structocteon__device}{octeon\_device}}       *oct = \mbox{\hyperlink{structlio}{lio}}-\/>\mbox{\hyperlink{structlio_a8b0ccb8d2631f975afe11246f7010a6d}{oct\_dev}};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00307}00307         \textcolor{keyword}{struct }\mbox{\hyperlink{structlio__instr__queue}{lio\_instr\_queue}}   *iq;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00308}00308         \textcolor{keyword}{struct }mbuf             *m;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00309}00309         \textcolor{keywordtype}{int}     i;}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00310}00310 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00311}00311         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{lio__config_8h_ad5027b8a431b10ce01025a2887fba297}{LIO\_MAX\_INSTR\_QUEUES}}(oct); i++) \{}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00312}00312                 \textcolor{keywordflow}{if} (!(oct-\/>\mbox{\hyperlink{structocteon__device_a2572013042e73f339174c82cf587494c}{io\_qmask}}.\mbox{\hyperlink{structlio__io__enable_ac488befca84b2b1657e8d7044be22383}{iq}} \& \mbox{\hyperlink{lio__main_8h_aed42b76522e8377b3b0e77b64ee04fae}{BIT\_ULL}}(i)))}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00313}00313                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00314}00314 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00315}00315                 iq = oct-\/>\mbox{\hyperlink{structocteon__device_ad3b9d2c9e6e5c1f264886dcd3f373676}{instr\_queue}}[i];}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00316}00316 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00317}00317                 mtx\_lock(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_aedf00f27438279abe25f4926facac1ef}{enq\_lock}});}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00318}00318                 \textcolor{keywordflow}{while} ((m = buf\_ring\_dequeue\_sc(iq-\/>\mbox{\hyperlink{structlio__instr__queue_ad8faf8e3254cabbbe74d35048cfd88a5}{br}})) != NULL)}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00319}00319                         m\_freem(m);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00320}00320 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00321}00321                 mtx\_unlock(\&iq-\/>\mbox{\hyperlink{structlio__instr__queue_aedf00f27438279abe25f4926facac1ef}{enq\_lock}});}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00322}00322         \}}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00323}00323 }
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00324}00324         if\_qflush(ifp);}
\DoxyCodeLine{\Hypertarget{lio__rxtx_8c_source_l00325}00325 \}}

\end{DoxyCode}
