\hypertarget{mlx5__cq_8c_source}{}\doxysection{mlx5\+\_\+cq.\+c}
\label{mlx5__cq_8c_source}\index{dev/mlx5/mlx5\_core/mlx5\_cq.c@{dev/mlx5/mlx5\_core/mlx5\_cq.c}}
\mbox{\hyperlink{mlx5__cq_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2013-\/2017, Mellanox Technologies, Ltd.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00004}00004 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00005}00005 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00006}00006 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00007}00007 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00008}00008 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00009}00009 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00010}00010 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00011}00011 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00013}00013 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00014}00014 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00015}00015 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00016}00016 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00017}00017 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00018}00018 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00019}00019 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00020}00020 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00021}00021 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00022}00022 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00023}00023 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00024}00024 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00025}00025 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00026}00026 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00027}00027 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00028}00028 \textcolor{preprocessor}{\#include "{}opt\_rss.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00029}00029 \textcolor{preprocessor}{\#include "{}opt\_ratelimit.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <linux/kernel.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <linux/module.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <linux/hardirq.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{driver_8h}{dev/mlx5/driver.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <rdma/ib\_verbs.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cq_8h}{dev/mlx5/cq.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mlx5__core_8h}{dev/mlx5/mlx5\_core/mlx5\_core.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00038}00038 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/epoch.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00040}00040 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00041}00041 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00042}\mbox{\hyperlink{mlx5__cq_8c_a9ceac7084d3703967cef8f4709cfa3fe}{00042}} \mbox{\hyperlink{mlx5__cq_8c_a9ceac7084d3703967cef8f4709cfa3fe}{mlx5\_cq\_table\_write\_lock}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__cq__table}{mlx5\_cq\_table}} *table)}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00043}00043 \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00045}00045         atomic\_inc(\&table-\/>\mbox{\hyperlink{structmlx5__cq__table_a3377a51a39d9af0a776d96b5cebe7568}{writercount}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00046}00046         \textcolor{comment}{/* make sure all see the updated writercount */}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00047}00047         NET\_EPOCH\_WAIT();}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00048}00048         spin\_lock(\&table-\/>\mbox{\hyperlink{structmlx5__cq__table_a921068ae17afb0b80b987d8690e122c9}{writerlock}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00049}00049 \}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00051}00051 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00052}\mbox{\hyperlink{mlx5__cq_8c_a646d51bbef3f5dcd991d53e5df3fb622}{00052}} \mbox{\hyperlink{mlx5__cq_8c_a646d51bbef3f5dcd991d53e5df3fb622}{mlx5\_cq\_table\_write\_unlock}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__cq__table}{mlx5\_cq\_table}} *table)}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00053}00053 \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00055}00055         spin\_unlock(\&table-\/>\mbox{\hyperlink{structmlx5__cq__table_a921068ae17afb0b80b987d8690e122c9}{writerlock}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00056}00056         atomic\_dec(\&table-\/>\mbox{\hyperlink{structmlx5__cq__table_a3377a51a39d9af0a776d96b5cebe7568}{writercount}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00057}00057         \textcolor{comment}{/* drain all pending CQ callers */}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00058}00058         NET\_EPOCH\_WAIT();}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00059}00059 \}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00060}00060 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00061}\mbox{\hyperlink{driver_8h_ac5d87f72d2d6d9104beeeb746805826a}{00061}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__cq_8c_ac5d87f72d2d6d9104beeeb746805826a}{mlx5\_cq\_completion}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eqe}{mlx5\_eqe}} *eqe)}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00062}00062 \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00063}00063         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__cq__table}{mlx5\_cq\_table}} *table = \&dev-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_a1c58783b72732686cf03e690a5ed7bb2}{cq\_table}};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00064}00064         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__cq}{mlx5\_core\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00065}00065         \textcolor{keyword}{struct }epoch\_tracker et;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00066}00066         u32 cqn;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00067}00067         \textcolor{keywordtype}{bool} do\_lock;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00068}00068 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00069}00069         cqn = be32\_to\_cpu(eqe-\/>\mbox{\hyperlink{structmlx5__eqe_a23d790d7732ba01f68202e2f410f9248}{data}}.\mbox{\hyperlink{unionev__data_aca8308f38d48a83675ce589dae6c0446}{comp}}.\mbox{\hyperlink{structmlx5__eqe__comp_af8dfb575ce70e8f3392fea0944a1835c}{cqn}}) \& 0xffffff;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00070}00070 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00071}00071         NET\_EPOCH\_ENTER(et);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00072}00072 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00073}00073         do\_lock = atomic\_read(\&table-\/>\mbox{\hyperlink{structmlx5__cq__table_a3377a51a39d9af0a776d96b5cebe7568}{writercount}}) != 0;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00074}00074         \textcolor{keywordflow}{if} (unlikely(do\_lock))}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00075}00075                 spin\_lock(\&table-\/>\mbox{\hyperlink{structmlx5__cq__table_a921068ae17afb0b80b987d8690e122c9}{writerlock}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00076}00076 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00077}00077         \textcolor{keywordflow}{if} (likely(cqn < \mbox{\hyperlink{driver_8h_af2d2848012e6b53992029e6722db2adc}{MLX5\_CQ\_LINEAR\_ARRAY\_SIZE}}))}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00078}00078                 \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}} = table-\/>\mbox{\hyperlink{structmlx5__cq__table_a10a18dce602d775bc75e9de82c5c90ad}{linear\_array}}[cqn].\mbox{\hyperlink{structmlx5__cq__linear__array__entry_a2699118c11a90302398e69650393729a}{cq}};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00079}00079         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00080}00080                 \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}} = radix\_tree\_lookup(\&table-\/>\mbox{\hyperlink{structmlx5__cq__table_a1fc79a52c2caef57fcd72ea57474c8a1}{tree}}, cqn);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00082}00082         \textcolor{keywordflow}{if} (unlikely(do\_lock))}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00083}00083                 spin\_unlock(\&table-\/>\mbox{\hyperlink{structmlx5__cq__table_a921068ae17afb0b80b987d8690e122c9}{writerlock}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00084}00084 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00085}00085         \textcolor{keywordflow}{if} (likely(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}} != NULL)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00086}00086                 ++\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>arm\_sn;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00087}00087                 \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>comp(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, eqe);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00088}00088         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00089}00089                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(dev,}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00090}00090                     \textcolor{stringliteral}{"{}Completion event for bogus CQ 0x\%x\(\backslash\)n"{}}, cqn);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00091}00091         \}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00092}00092 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00093}00093         NET\_EPOCH\_EXIT(et);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00094}00094 \}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00095}00095 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00096}\mbox{\hyperlink{driver_8h_ae0e5002483dd04d57862acb4b0a7a21a}{00096}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__cq_8c_ae0e5002483dd04d57862acb4b0a7a21a}{mlx5\_cq\_event}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, u32 cqn, \textcolor{keywordtype}{int} event\_type)}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00097}00097 \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00098}00098         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__cq__table}{mlx5\_cq\_table}} *table = \&dev-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_a1c58783b72732686cf03e690a5ed7bb2}{cq\_table}};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00099}00099         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__cq}{mlx5\_core\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00100}00100         \textcolor{keyword}{struct }epoch\_tracker et;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00101}00101         \textcolor{keywordtype}{bool} do\_lock;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00103}00103         NET\_EPOCH\_ENTER(et);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00104}00104 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00105}00105         do\_lock = atomic\_read(\&table-\/>\mbox{\hyperlink{structmlx5__cq__table_a3377a51a39d9af0a776d96b5cebe7568}{writercount}}) != 0;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00106}00106         \textcolor{keywordflow}{if} (unlikely(do\_lock))}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00107}00107                 spin\_lock(\&table-\/>\mbox{\hyperlink{structmlx5__cq__table_a921068ae17afb0b80b987d8690e122c9}{writerlock}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00109}00109         \textcolor{keywordflow}{if} (likely(cqn < \mbox{\hyperlink{driver_8h_af2d2848012e6b53992029e6722db2adc}{MLX5\_CQ\_LINEAR\_ARRAY\_SIZE}}))}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00110}00110                 \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}} = table-\/>\mbox{\hyperlink{structmlx5__cq__table_a10a18dce602d775bc75e9de82c5c90ad}{linear\_array}}[cqn].\mbox{\hyperlink{structmlx5__cq__linear__array__entry_a2699118c11a90302398e69650393729a}{cq}};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00111}00111         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00112}00112                 \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}} = radix\_tree\_lookup(\&table-\/>\mbox{\hyperlink{structmlx5__cq__table_a1fc79a52c2caef57fcd72ea57474c8a1}{tree}}, cqn);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00113}00113 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00114}00114         \textcolor{keywordflow}{if} (unlikely(do\_lock))}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00115}00115                 spin\_unlock(\&table-\/>\mbox{\hyperlink{structmlx5__cq__table_a921068ae17afb0b80b987d8690e122c9}{writerlock}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00116}00116 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00117}00117         \textcolor{keywordflow}{if} (likely(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}} != NULL)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00118}00118                 \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>event(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, event\_type);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00119}00119         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00120}00120                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(dev,}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00121}00121                     \textcolor{stringliteral}{"{}Asynchronous event for bogus CQ 0x\%x\(\backslash\)n"{}}, cqn);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00122}00122         \}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00123}00123 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00124}00124         NET\_EPOCH\_EXIT(et);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00125}00125 \}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00126}00126 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00127}\mbox{\hyperlink{cq_8h_aea2bfcf5366ba54470890849d731ec22}{00127}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__cq_8c_aea2bfcf5366ba54470890849d731ec22}{mlx5\_core\_create\_cq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__cq}{mlx5\_core\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}},}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00128}00128                         u32 *in, \textcolor{keywordtype}{int} inlen, u32 *out, \textcolor{keywordtype}{int} outlen)}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00129}00129 \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00130}00130         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__cq__table}{mlx5\_cq\_table}} *table = \&dev-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_a1c58783b72732686cf03e690a5ed7bb2}{cq\_table}};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00131}00131         u32 din[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(destroy\_cq\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00132}00132         u32 dout[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(destroy\_cq\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00133}00133         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00134}00134 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00135}00135         memset(out, 0, outlen);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00136}00136         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_cq\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39adafb39333f61741603c45f14abedf47d}{MLX5\_CMD\_OP\_CREATE\_CQ}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00137}00137         err = \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in, inlen, out, outlen);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00138}00138         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00139}00139                 \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00140}00140 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00141}00141         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cqn = \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(create\_cq\_out, out, cqn);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00142}00142         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cons\_index = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00143}00143         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>arm\_sn     = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00144}00144 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00145}00145         \mbox{\hyperlink{mlx5__cq_8c_a9ceac7084d3703967cef8f4709cfa3fe}{mlx5\_cq\_table\_write\_lock}}(table);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00146}00146         err = radix\_tree\_insert(\&table-\/>\mbox{\hyperlink{structmlx5__cq__table_a1fc79a52c2caef57fcd72ea57474c8a1}{tree}}, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cqn, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00147}00147         \textcolor{keywordflow}{if} (likely(err == 0 \&\& \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cqn < \mbox{\hyperlink{driver_8h_af2d2848012e6b53992029e6722db2adc}{MLX5\_CQ\_LINEAR\_ARRAY\_SIZE}}))}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00148}00148                 table-\/>\mbox{\hyperlink{structmlx5__cq__table_a10a18dce602d775bc75e9de82c5c90ad}{linear\_array}}[\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cqn].\mbox{\hyperlink{structmlx5__cq__linear__array__entry_a2699118c11a90302398e69650393729a}{cq}} = \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00149}00149         \mbox{\hyperlink{mlx5__cq_8c_a646d51bbef3f5dcd991d53e5df3fb622}{mlx5\_cq\_table\_write\_unlock}}(table);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00150}00150 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00151}00151         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00152}00152                 \textcolor{keywordflow}{goto} err\_cmd;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00154}00154         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>pid = curthread-\/>td\_proc-\/>p\_pid;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00155}00155         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>uar = dev-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_ac476fb1d38cdac2b8f6cee43aa25c2dd}{uar}};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00156}00156 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00157}00157         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00158}00158 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00159}00159 err\_cmd:}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00160}00160         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_cq\_in, din, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a587431d31459660605a978e362777bd7}{MLX5\_CMD\_OP\_DESTROY\_CQ}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00161}00161         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_cq\_in, din, cqn, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cqn);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00162}00162         \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, din, \textcolor{keyword}{sizeof}(din), dout, \textcolor{keyword}{sizeof}(dout));}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00163}00163         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00164}00164 \}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00165}\mbox{\hyperlink{mlx5__cq_8c_a548c37a4faf8653b57432d9a796ccafd}{00165}} \mbox{\hyperlink{mlx5__cq_8c_a548c37a4faf8653b57432d9a796ccafd}{EXPORT\_SYMBOL}}(\mbox{\hyperlink{mlx5__cq_8c_aea2bfcf5366ba54470890849d731ec22}{mlx5\_core\_create\_cq}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00166}00166 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00167}\mbox{\hyperlink{cq_8h_ada3ee9d5d56150686d9f6a2ca3a7af84}{00167}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__cq_8c_ada3ee9d5d56150686d9f6a2ca3a7af84}{mlx5\_core\_destroy\_cq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__cq}{mlx5\_core\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}})}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00168}00168 \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00169}00169         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__cq__table}{mlx5\_cq\_table}} *table = \&dev-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_a1c58783b72732686cf03e690a5ed7bb2}{cq\_table}};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00170}00170         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(destroy\_cq\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00171}00171         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(destroy\_cq\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00172}00172         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__cq}{mlx5\_core\_cq}} *tmp;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00173}00173 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00174}00174         \mbox{\hyperlink{mlx5__cq_8c_a9ceac7084d3703967cef8f4709cfa3fe}{mlx5\_cq\_table\_write\_lock}}(table);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00175}00175         \textcolor{keywordflow}{if} (likely(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cqn < \mbox{\hyperlink{driver_8h_af2d2848012e6b53992029e6722db2adc}{MLX5\_CQ\_LINEAR\_ARRAY\_SIZE}}))}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00176}00176                 table-\/>\mbox{\hyperlink{structmlx5__cq__table_a10a18dce602d775bc75e9de82c5c90ad}{linear\_array}}[\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cqn].\mbox{\hyperlink{structmlx5__cq__linear__array__entry_a2699118c11a90302398e69650393729a}{cq}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00177}00177         tmp = radix\_tree\_delete(\&table-\/>\mbox{\hyperlink{structmlx5__cq__table_a1fc79a52c2caef57fcd72ea57474c8a1}{tree}}, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cqn);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00178}00178         \mbox{\hyperlink{mlx5__cq_8c_a646d51bbef3f5dcd991d53e5df3fb622}{mlx5\_cq\_table\_write\_unlock}}(table);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00179}00179 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00180}00180         \textcolor{keywordflow}{if} (unlikely(tmp == NULL)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00181}00181                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(dev, \textcolor{stringliteral}{"{}cq 0x\%x not found in tree\(\backslash\)n"{}}, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cqn);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00182}00182                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00183}00183         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (unlikely(tmp != \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}})) \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00184}00184                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(dev, \textcolor{stringliteral}{"{}corrupted cqn 0x\%x\(\backslash\)n"{}}, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cqn);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00185}00185                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00186}00186         \}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00187}00187 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00188}00188         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_cq\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a587431d31459660605a978e362777bd7}{MLX5\_CMD\_OP\_DESTROY\_CQ}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00189}00189         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_cq\_in, in, \mbox{\hyperlink{structmlx5__core__cq_aa4a997291e120b040c7a95d59639e62a}{cqn}}, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cqn);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00190}00190         \textcolor{keywordflow}{return} \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in, \textcolor{keyword}{sizeof}(in), out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00191}00191 \}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00192}\mbox{\hyperlink{mlx5__cq_8c_a6ad349601fde3a831d52e5114ea0048a}{00192}} \mbox{\hyperlink{mlx5__cq_8c_a548c37a4faf8653b57432d9a796ccafd}{EXPORT\_SYMBOL}}(\mbox{\hyperlink{mlx5__cq_8c_ada3ee9d5d56150686d9f6a2ca3a7af84}{mlx5\_core\_destroy\_cq}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00193}00193 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00194}\mbox{\hyperlink{cq_8h_ad797017d6e66b38e62fbef7e1c006669}{00194}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__cq_8c_ad797017d6e66b38e62fbef7e1c006669}{mlx5\_core\_query\_cq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__cq}{mlx5\_core\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}},}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00195}00195                        u32 *out, \textcolor{keywordtype}{int} outlen)}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00196}00196 \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00197}00197         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(query\_cq\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00198}00198 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00199}00199         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(query\_cq\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39ac5f34d01394a843f130e47c64e13659f}{MLX5\_CMD\_OP\_QUERY\_CQ}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00200}00200         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(query\_cq\_in, in, \mbox{\hyperlink{structmlx5__core__cq_aa4a997291e120b040c7a95d59639e62a}{cqn}}, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cqn);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00202}00202         \textcolor{keywordflow}{return} \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in, \textcolor{keyword}{sizeof}(in), out, outlen);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00203}00203 \}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00204}\mbox{\hyperlink{mlx5__cq_8c_adfd314b4207b33e1d8111f1c639e2c7e}{00204}} \mbox{\hyperlink{mlx5__cq_8c_a548c37a4faf8653b57432d9a796ccafd}{EXPORT\_SYMBOL}}(\mbox{\hyperlink{mlx5__cq_8c_ad797017d6e66b38e62fbef7e1c006669}{mlx5\_core\_query\_cq}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00205}00205 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00206}00206 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00207}\mbox{\hyperlink{cq_8h_a6daee9f9e6ec29274f1bd0311630d719}{00207}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__cq_8c_a6daee9f9e6ec29274f1bd0311630d719}{mlx5\_core\_modify\_cq}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__cq}{mlx5\_core\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}},}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00208}00208                         u32 *in, \textcolor{keywordtype}{int} inlen)}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00209}00209 \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00210}00210         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(modify\_cq\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00211}00211 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00212}00212         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_cq\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a4958220e0cdb1c570d5098fff978646c}{MLX5\_CMD\_OP\_MODIFY\_CQ}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00213}00213         \textcolor{keywordflow}{return} \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in, inlen, out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00214}00214 \}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00215}\mbox{\hyperlink{mlx5__cq_8c_a19a9533ebd62ad6c5691c63f78672349}{00215}} \mbox{\hyperlink{mlx5__cq_8c_a548c37a4faf8653b57432d9a796ccafd}{EXPORT\_SYMBOL}}(\mbox{\hyperlink{mlx5__cq_8c_a6daee9f9e6ec29274f1bd0311630d719}{mlx5\_core\_modify\_cq}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00216}00216 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00217}\mbox{\hyperlink{cq_8h_af35b8c739c52933c447ea25a9e0532d6}{00217}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__cq_8c_af35b8c739c52933c447ea25a9e0532d6}{mlx5\_core\_modify\_cq\_moderation}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev,}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00218}00218                                    \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__cq}{mlx5\_core\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}},}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00219}00219                                    u16 cq\_period,}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00220}00220                                    u16 cq\_max\_count)}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00221}00221 \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00222}00222         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(modify\_cq\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00223}00223         \textcolor{keywordtype}{void} *cqc;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00224}00224 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00225}00225         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_cq\_in, in, \mbox{\hyperlink{structmlx5__core__cq_aa4a997291e120b040c7a95d59639e62a}{cqn}}, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cqn);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00226}00226         cqc = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(modify\_cq\_in, in, cq\_context);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00227}00227         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(cqc, cqc, cq\_period, cq\_period);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00228}00228         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(cqc, cqc, cq\_max\_count, cq\_max\_count);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00229}00229         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_cq\_in, in,}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00230}00230                  modify\_field\_select\_resize\_field\_select.modify\_field\_select.modify\_field\_select,}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00231}00231                  \mbox{\hyperlink{cq_8h_a99fb83031ce9923c84392b4e92f956b5a9bc72649ff6d1e6f373a497912167396}{MLX5\_CQ\_MODIFY\_PERIOD}} | \mbox{\hyperlink{cq_8h_a99fb83031ce9923c84392b4e92f956b5a2298749d205c00a9c58d3d73b8f6aeae}{MLX5\_CQ\_MODIFY\_COUNT}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00232}00232 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00233}00233         \textcolor{keywordflow}{return} \mbox{\hyperlink{mlx5__cq_8c_a6daee9f9e6ec29274f1bd0311630d719}{mlx5\_core\_modify\_cq}}(dev, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, in, \textcolor{keyword}{sizeof}(in));}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00234}00234 \}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00235}00235 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00236}\mbox{\hyperlink{cq_8h_aacab8774d8950ce5e4f199aa7c343ea4}{00236}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__cq_8c_aacab8774d8950ce5e4f199aa7c343ea4}{mlx5\_core\_modify\_cq\_moderation\_mode}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev,}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00237}00237                                         \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__cq}{mlx5\_core\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}},}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00238}00238                                         u16 cq\_period,}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00239}00239                                         u16 cq\_max\_count,}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00240}00240                                         u8 cq\_mode)}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00241}00241 \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00242}00242         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(modify\_cq\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00243}00243         \textcolor{keywordtype}{void} *cqc;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00244}00244 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00245}00245         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_cq\_in, in, \mbox{\hyperlink{structmlx5__core__cq_aa4a997291e120b040c7a95d59639e62a}{cqn}}, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cqn);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00246}00246         cqc = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(modify\_cq\_in, in, cq\_context);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00247}00247         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(cqc, cqc, cq\_period, cq\_period);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00248}00248         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(cqc, cqc, cq\_max\_count, cq\_max\_count);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00249}00249         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(cqc, cqc, cq\_period\_mode, cq\_mode);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00250}00250         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_cq\_in, in,}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00251}00251                  modify\_field\_select\_resize\_field\_select.modify\_field\_select.modify\_field\_select,}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00252}00252                  \mbox{\hyperlink{cq_8h_a99fb83031ce9923c84392b4e92f956b5a9bc72649ff6d1e6f373a497912167396}{MLX5\_CQ\_MODIFY\_PERIOD}} | \mbox{\hyperlink{cq_8h_a99fb83031ce9923c84392b4e92f956b5a2298749d205c00a9c58d3d73b8f6aeae}{MLX5\_CQ\_MODIFY\_COUNT}} | \mbox{\hyperlink{cq_8h_a99fb83031ce9923c84392b4e92f956b5af4602488373ade45c835081c44944da6}{MLX5\_CQ\_MODIFY\_PERIOD\_MODE}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00253}00253 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00254}00254         \textcolor{keywordflow}{return} \mbox{\hyperlink{mlx5__cq_8c_a6daee9f9e6ec29274f1bd0311630d719}{mlx5\_core\_modify\_cq}}(dev, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, in, \textcolor{keyword}{sizeof}(in));}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00255}00255 \}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00256}00256 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00257}\mbox{\hyperlink{cq_8h_a7a46de12ec5bbd709d4c2bcc2e674a26}{00257}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__cq_8c_a7a46de12ec5bbd709d4c2bcc2e674a26}{mlx5\_init\_cq\_table}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev)}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00258}00258 \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00259}00259         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__cq__table}{mlx5\_cq\_table}} *table = \&dev-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_a1c58783b72732686cf03e690a5ed7bb2}{cq\_table}};}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00260}00260 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00261}00261         memset(table, 0, \textcolor{keyword}{sizeof}(*table));}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00262}00262         spin\_lock\_init(\&table-\/>\mbox{\hyperlink{structmlx5__cq__table_a921068ae17afb0b80b987d8690e122c9}{writerlock}});}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00263}00263         INIT\_RADIX\_TREE(\&table-\/>\mbox{\hyperlink{structmlx5__cq__table_a1fc79a52c2caef57fcd72ea57474c8a1}{tree}}, GFP\_ATOMIC);}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00264}00264 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00265}00265         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00266}00266 \}}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00267}00267 }
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00268}\mbox{\hyperlink{cq_8h_ab2579d5b942cfe03cc251e7e2d46af20}{00268}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__cq_8c_ab2579d5b942cfe03cc251e7e2d46af20}{mlx5\_cleanup\_cq\_table}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev)}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00269}00269 \{}
\DoxyCodeLine{\Hypertarget{mlx5__cq_8c_source_l00270}00270 \}}

\end{DoxyCode}
