\hypertarget{mlx5__ib__cq_8c_source}{}\doxysection{mlx5\+\_\+ib\+\_\+cq.\+c}
\label{mlx5__ib__cq_8c_source}\index{dev/mlx5/mlx5\_ib/mlx5\_ib\_cq.c@{dev/mlx5/mlx5\_ib/mlx5\_ib\_cq.c}}
\mbox{\hyperlink{mlx5__ib__cq_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2013-\/2020, Mellanox Technologies.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00004}00004 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00005}00005 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00006}00006 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00007}00007 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00008}00008 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00009}00009 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00010}00010 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00011}00011 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00013}00013 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00014}00014 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00015}00015 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00016}00016 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00017}00017 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00018}00018 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00019}00019 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00020}00020 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00021}00021 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00022}00022 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00023}00023 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00024}00024 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00025}00025 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00026}00026 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00027}00027 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00028}00028 \textcolor{preprocessor}{\#include "{}opt\_rss.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00029}00029 \textcolor{preprocessor}{\#include "{}opt\_ratelimit.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <linux/kref.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <rdma/ib\_umem.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <rdma/ib\_user\_verbs.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <rdma/ib\_cache.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <rdma/uverbs\_ioctl.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mlx5__ib_8h}{dev/mlx5/mlx5\_ib/mlx5\_ib.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00038}\mbox{\hyperlink{mlx5__ib__cq_8c_a14d4b218307852d3a414934f1ddf1beb}{00038}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_a14d4b218307852d3a414934f1ddf1beb}{mlx5\_ib\_cq\_comp}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__cq}{mlx5\_core\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eqe}{mlx5\_eqe}} *eqe \_\_unused)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00039}00039 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00040}00040         \textcolor{keyword}{struct }ib\_cq *ibcq = \&\mbox{\hyperlink{mlx5__ib_8h_a70338e5a1862be20f04dfd801e36854a}{to\_mibcq}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}})-\/>\mbox{\hyperlink{structmlx5__ib__cq_a8d54c698aa989c1c47047b15c1540b02}{ibcq}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00041}00041 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00042}00042         ibcq-\/>comp\_handler(ibcq, ibcq-\/>cq\_context);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00043}00043 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00045}\mbox{\hyperlink{mlx5__ib__cq_8c_a897e56934b000056b937f318c6a9a267}{00045}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_a897e56934b000056b937f318c6a9a267}{mlx5\_ib\_cq\_event}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__cq}{mlx5\_core\_cq}} *\mbox{\hyperlink{en_8h_af69a66154472918b7d1481f1b1d974c8}{mcq}}, \textcolor{keywordtype}{int} type)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00046}00046 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00047}00047         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}} = container\_of(\mbox{\hyperlink{en_8h_af69a66154472918b7d1481f1b1d974c8}{mcq}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}}, \mbox{\hyperlink{en_8h_af69a66154472918b7d1481f1b1d974c8}{mcq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00048}00048         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev = \mbox{\hyperlink{mlx5__ib_8h_a1806639f13e6865f0fa7aab4dd3ec6c7}{to\_mdev}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq.device);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00049}00049         \textcolor{keyword}{struct }ib\_cq *ibcq = \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00050}00050         \textcolor{keyword}{struct }ib\_event event;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00051}00051 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00052}00052         \textcolor{keywordflow}{if} (type != \mbox{\hyperlink{mlx5__ifc_8h_aeb8d583a31cccbb8cf9b452a8e298063ac5f53a36d84d888535c4fa3988187f4a}{MLX5\_EVENT\_TYPE\_CQ\_ERROR}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00053}00053                 \mbox{\hyperlink{mlx5__ib_8h_a648fb83654f708e827821ca7fa53779a}{mlx5\_ib\_warn}}(dev, \textcolor{stringliteral}{"{}Unexpected event type \%d on CQ \%06x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00054}00054                              type, \mbox{\hyperlink{en_8h_af69a66154472918b7d1481f1b1d974c8}{mcq}}-\/>\mbox{\hyperlink{structmlx5__core__cq_aa4a997291e120b040c7a95d59639e62a}{cqn}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00055}00055                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00056}00056         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00057}00057 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00058}00058         \textcolor{keywordflow}{if} (ibcq-\/>event\_handler) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00059}00059                 \textcolor{keyword}{event}.device     = \&dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad6e3ba2b9a0e5ae708df08538ef40b45}{ib\_dev}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00060}00060                 \textcolor{keyword}{event}.event      = IB\_EVENT\_CQ\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00061}00061                 \textcolor{keyword}{event}.element.cq = ibcq;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00062}00062                 ibcq-\/>event\_handler(\&event, ibcq-\/>cq\_context);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00063}00063         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00064}00064 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00065}00065 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00066}\mbox{\hyperlink{mlx5__ib__cq_8c_a0816a16a8c95dbb0e379248cc6ab654f}{00066}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} *\mbox{\hyperlink{mlx5__ib__cq_8c_a0816a16a8c95dbb0e379248cc6ab654f}{get\_cqe\_from\_buf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq__buf}{mlx5\_ib\_cq\_buf}} *buf, \textcolor{keywordtype}{int} n, \textcolor{keywordtype}{int} size)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00067}00067 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00068}00068         \textcolor{keywordflow}{return} \mbox{\hyperlink{driver_8h_a33cbf18448505cb9cafe531bbf041d14}{mlx5\_buf\_offset}}(\&buf-\/>\mbox{\hyperlink{structmlx5__ib__cq__buf_a29729d4f468db77f10e05db04abe66ef}{buf}}, n * size);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00069}00069 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00070}00070 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00071}\mbox{\hyperlink{mlx5__ib__cq_8c_a23ca4da078bd890da65b067bb1d9f065}{00071}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} *\mbox{\hyperlink{mlx5__ib__cq_8c_a23ca4da078bd890da65b067bb1d9f065}{get\_cqe}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, \textcolor{keywordtype}{int} n)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00072}00072 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00073}00073         \textcolor{keywordflow}{return} \mbox{\hyperlink{mlx5__ib__cq_8c_a0816a16a8c95dbb0e379248cc6ab654f}{get\_cqe\_from\_buf}}(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf, n, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_a458436764ec16a503d3e3fbb1457b394}{cqe\_sz}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00074}00074 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00076}\mbox{\hyperlink{mlx5__ib__cq_8c_a647a399c594063c79547ebf66b012bc0}{00076}} \textcolor{keyword}{static} u8 \mbox{\hyperlink{mlx5__ib__cq_8c_a647a399c594063c79547ebf66b012bc0}{sw\_ownership\_bit}}(\textcolor{keywordtype}{int} n, \textcolor{keywordtype}{int} nent)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00077}00077 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00078}00078         \textcolor{keywordflow}{return} (n \& nent) ? 1 : 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00079}00079 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00080}00080 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00081}\mbox{\hyperlink{mlx5__ib__cq_8c_a48c3a821c73d2ca5653a45907f812d88}{00081}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} *\mbox{\hyperlink{mlx5__ib__cq_8c_a48c3a821c73d2ca5653a45907f812d88}{get\_sw\_cqe}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, \textcolor{keywordtype}{int} n)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00082}00082 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00083}00083         \textcolor{keywordtype}{void} *cqe = \mbox{\hyperlink{mlx5__ib__cq_8c_a23ca4da078bd890da65b067bb1d9f065}{get\_cqe}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, n \& \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq.cqe);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00084}00084         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__cqe64}{mlx5\_cqe64}} *cqe64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00085}00085 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00086}00086         cqe64 = (\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_a458436764ec16a503d3e3fbb1457b394}{cqe\_sz}} == 64) ? cqe : cqe + 64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00087}00087 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00088}00088         \textcolor{keywordflow}{if} (likely((cqe64-\/>\mbox{\hyperlink{structmlx5__cqe64_a3dbb1dc2c9f2ee64863edf7f750f5885}{op\_own}}) >> 4 != \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a040ca8ae114748853a108b181d3dadca}{MLX5\_CQE\_INVALID}}) \&\&}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00089}00089             !((cqe64-\/>\mbox{\hyperlink{structmlx5__cqe64_a3dbb1dc2c9f2ee64863edf7f750f5885}{op\_own}} \& \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a62a86c5fb0a5057f1703dbe3d840e4e7}{MLX5\_CQE\_OWNER\_MASK}}) \string^ !!(n \& (\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq.cqe + 1)))) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00090}00090                 \textcolor{keywordflow}{return} cqe;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00091}00091         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00092}00092                 \textcolor{keywordflow}{return} NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00093}00093         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00094}00094 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00095}00095 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00096}\mbox{\hyperlink{mlx5__ib__cq_8c_acebfdc0ba27fabf4c4ab0256bce6a19a}{00096}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} *\mbox{\hyperlink{mlx5__ib__cq_8c_acebfdc0ba27fabf4c4ab0256bce6a19a}{next\_cqe\_sw}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}})}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00097}00097 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00098}00098         \textcolor{keywordflow}{return} \mbox{\hyperlink{mlx5__ib__cq_8c_a48c3a821c73d2ca5653a45907f812d88}{get\_sw\_cqe}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_afb2887dc8c075ba41ca2e359dbcfdde2}{cons\_index}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00099}00099 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00100}00100 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00101}\mbox{\hyperlink{mlx5__ib__cq_8c_add96a33dfe76d6f0a9a0fdc349303b44}{00101}} \textcolor{keyword}{static} \textcolor{keyword}{enum} ib\_wc\_opcode \mbox{\hyperlink{mlx5__ib__cq_8c_add96a33dfe76d6f0a9a0fdc349303b44}{get\_umr\_comp}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__wq}{mlx5\_ib\_wq}} *\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}, \textcolor{keywordtype}{int} idx)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00102}00102 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00103}00103         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>wr\_data[idx]) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00104}00104         \textcolor{keywordflow}{case} \mbox{\hyperlink{mlx5__ib_8h_a9c1a097bc875c8f49b91b7548bcd9021}{MLX5\_IB\_WR\_UMR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00105}00105                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00106}00106 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00107}00107         \textcolor{keywordflow}{case} IB\_WR\_LOCAL\_INV:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00108}00108                 \textcolor{keywordflow}{return} IB\_WC\_LOCAL\_INV;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00109}00109 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00110}00110         \textcolor{keywordflow}{case} IB\_WR\_REG\_MR:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00111}00111                 \textcolor{keywordflow}{return} IB\_WC\_REG\_MR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00112}00112 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00113}00113         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00114}00114                 pr\_warn(\textcolor{stringliteral}{"{}unknown completion status\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00115}00115                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00116}00116         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00117}00117 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00118}00118 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00119}\mbox{\hyperlink{mlx5__ib__cq_8c_a5c9c63c6bd03593992cad167a3f1f783}{00119}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_a5c9c63c6bd03593992cad167a3f1f783}{handle\_good\_req}}(\textcolor{keyword}{struct} ib\_wc *wc, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__cqe64}{mlx5\_cqe64}} *cqe,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00120}00120                             \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__wq}{mlx5\_ib\_wq}} *\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}, \textcolor{keywordtype}{int} idx)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00121}00121 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00122}00122         wc-\/>wc\_flags = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00123}00123         \textcolor{keywordflow}{switch} (be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_ad6fa2d0b532424a656f4a6769961ef58}{sop\_drop\_qpn}}) >> 24) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00124}00124         \textcolor{keywordflow}{case} \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4ad1befec238e111274342ade68571223d}{MLX5\_OPCODE\_RDMA\_WRITE\_IMM}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00125}00125                 wc-\/>wc\_flags |= IB\_WC\_WITH\_IMM;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00126}00126         \textcolor{keywordflow}{case} \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4a106dfac82fcf8cf221e6a08334874c71}{MLX5\_OPCODE\_RDMA\_WRITE}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00127}00127                 wc-\/>opcode    = IB\_WC\_RDMA\_WRITE;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00128}00128                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00129}00129         \textcolor{keywordflow}{case} \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4ab159cebdfa7716d6968422bc70c586b8}{MLX5\_OPCODE\_SEND\_IMM}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00130}00130                 wc-\/>wc\_flags |= IB\_WC\_WITH\_IMM;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00131}00131         \textcolor{keywordflow}{case} \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4a99df50bc06e7d55dee6c4f2fbef34d52}{MLX5\_OPCODE\_SEND}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00132}00132         \textcolor{keywordflow}{case} \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4ad6d7210d0d143b792832a3f042df8127}{MLX5\_OPCODE\_SEND\_INVAL}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00133}00133                 wc-\/>opcode    = IB\_WC\_SEND;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00134}00134                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00135}00135         \textcolor{keywordflow}{case} \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4aef453f87b2671274af5bbeaba4332418}{MLX5\_OPCODE\_RDMA\_READ}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00136}00136                 wc-\/>opcode    = IB\_WC\_RDMA\_READ;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00137}00137                 wc-\/>byte\_len  = be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_a153afdc80bf9d2ccfb3be09055f1a5c6}{byte\_cnt}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00138}00138                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00139}00139         \textcolor{keywordflow}{case} \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4acea566dffcaaf2c131d02e7517956dc8}{MLX5\_OPCODE\_ATOMIC\_CS}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00140}00140                 wc-\/>opcode    = IB\_WC\_COMP\_SWAP;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00141}00141                 wc-\/>byte\_len  = 8;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00142}00142                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00143}00143         \textcolor{keywordflow}{case} \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4aa8e3209c2c9584b3d3dd71eb9ac41cb8}{MLX5\_OPCODE\_ATOMIC\_FA}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00144}00144                 wc-\/>opcode    = IB\_WC\_FETCH\_ADD;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00145}00145                 wc-\/>byte\_len  = 8;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00146}00146                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00147}00147         \textcolor{keywordflow}{case} \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4ae96d8d114d686f87359a295b31b85313}{MLX5\_OPCODE\_ATOMIC\_MASKED\_CS}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00148}00148                 wc-\/>opcode    = IB\_WC\_MASKED\_COMP\_SWAP;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00149}00149                 wc-\/>byte\_len  = 8;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00150}00150                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00151}00151         \textcolor{keywordflow}{case} \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4a53a090ddf757990f3914a1a48fa8cf30}{MLX5\_OPCODE\_ATOMIC\_MASKED\_FA}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00152}00152                 wc-\/>opcode    = IB\_WC\_MASKED\_FETCH\_ADD;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00153}00153                 wc-\/>byte\_len  = 8;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00154}00154                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00155}00155         \textcolor{keywordflow}{case} \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4a1dee01cb68b417221f0eb394ea086cbd}{MLX5\_OPCODE\_UMR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00156}00156                 wc-\/>opcode = \mbox{\hyperlink{mlx5__ib__cq_8c_add96a33dfe76d6f0a9a0fdc349303b44}{get\_umr\_comp}}(\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}, idx);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00157}00157                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00158}00158         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00159}00159 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00160}00160 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00161}00161 \textcolor{keyword}{enum} \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00162}\mbox{\hyperlink{mlx5__ib__cq_8c_a6739788b75165c40c5fa298fbd9c18bda0f5ee041d070f82ef2f0a69ca891f867}{00162}}         \mbox{\hyperlink{mlx5__ib__cq_8c_a6739788b75165c40c5fa298fbd9c18bda0f5ee041d070f82ef2f0a69ca891f867}{MLX5\_GRH\_IN\_BUFFER}} = 1,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00163}\mbox{\hyperlink{mlx5__ib__cq_8c_a6739788b75165c40c5fa298fbd9c18bda168d137f96c073fbbc2fb27aaec4a988}{00163}}         \mbox{\hyperlink{mlx5__ib__cq_8c_a6739788b75165c40c5fa298fbd9c18bda168d137f96c073fbbc2fb27aaec4a988}{MLX5\_GRH\_IN\_CQE}}     = 2,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00164}00164 \};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00165}00165 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00166}\mbox{\hyperlink{mlx5__ib__cq_8c_a8717e07da3075c311c7586871b3b5450}{00166}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_a8717e07da3075c311c7586871b3b5450}{handle\_responder}}(\textcolor{keyword}{struct} ib\_wc *wc, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__cqe64}{mlx5\_cqe64}} *cqe,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00167}00167                              \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__qp}{mlx5\_ib\_qp}} *qp)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00168}00168 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00169}00169         \textcolor{keyword}{enum} rdma\_link\_layer ll = rdma\_port\_get\_link\_layer(qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a13cb76e255a9f8cfd61db355965c81bd}{ibqp}}.device, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00170}00170         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev = \mbox{\hyperlink{mlx5__ib_8h_a1806639f13e6865f0fa7aab4dd3ec6c7}{to\_mdev}}(qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a13cb76e255a9f8cfd61db355965c81bd}{ibqp}}.device);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00171}00171         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__srq}{mlx5\_ib\_srq}} *srq;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00172}00172         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__wq}{mlx5\_ib\_wq}} *\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00173}00173         u16 wqe\_ctr;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00174}00174         u8  roce\_packet\_type;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00175}00175         \textcolor{keywordtype}{bool} vlan\_present;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00176}00176         u8 g;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00177}00177 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00178}00178         \textcolor{keywordflow}{if} (qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a13cb76e255a9f8cfd61db355965c81bd}{ibqp}}.srq || qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a13cb76e255a9f8cfd61db355965c81bd}{ibqp}}.xrcd) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00179}00179                 \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__srq}{mlx5\_core\_srq}} *msrq = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00180}00180 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00181}00181                 \textcolor{keywordflow}{if} (qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a13cb76e255a9f8cfd61db355965c81bd}{ibqp}}.xrcd) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00182}00182                         msrq = \mbox{\hyperlink{driver_8h_a7df4cd92e7b3d5dd44a0aedc5905a383}{mlx5\_core\_get\_srq}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00183}00183                                                  be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_ac521313917e46afa6384835d4189c7f2}{srqn}}));}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00184}00184                         srq = \mbox{\hyperlink{mlx5__ib_8h_ac391764bda9ad778b2f413ec56534c72}{to\_mibsrq}}(msrq);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00185}00185                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00186}00186                         srq = \mbox{\hyperlink{mlx5__ib_8h_ac3092313e8729930c5d8be58c72a1e13}{to\_msrq}}(qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a13cb76e255a9f8cfd61db355965c81bd}{ibqp}}.srq);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00187}00187                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00188}00188                 \textcolor{keywordflow}{if} (srq) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00189}00189                         wqe\_ctr = be16\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_af16e0b265dec7e07555179d5cd7388c6}{wqe\_counter}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00190}00190                         wc-\/>wr\_id = srq-\/>\mbox{\hyperlink{structmlx5__ib__srq_a59b2b00f4b9e82b11581137a5b03de55}{wrid}}[wqe\_ctr];}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00191}00191                         \mbox{\hyperlink{mlx5__ib_8h_ad4da9e65d2931a7d7c88019fe3a8351c}{mlx5\_ib\_free\_srq\_wqe}}(srq, wqe\_ctr);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00192}00192                         \textcolor{keywordflow}{if} (msrq \&\& atomic\_dec\_and\_test(\&msrq-\/>\mbox{\hyperlink{structmlx5__core__srq_a804a34356664f7fd828f19d927f0efc4}{refcount}}))}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00193}00193                                 complete(\&msrq-\/>\mbox{\hyperlink{structmlx5__core__srq_aee4906372ed33fd606e3d79fe4db4f2e}{free}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00194}00194                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00195}00195         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00196}00196                 \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}      = \&qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a12a1f638aaf356cabfb9d47795c53f18}{rq}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00197}00197                 wc-\/>wr\_id = \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>wrid[\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>tail \& (\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>wqe\_cnt -\/ 1)];}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00198}00198                 ++\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>tail;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00199}00199         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00200}00200         wc-\/>byte\_len = be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_a153afdc80bf9d2ccfb3be09055f1a5c6}{byte\_cnt}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00202}00202         \textcolor{keywordflow}{switch} (cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_a3dbb1dc2c9f2ee64863edf7f750f5885}{op\_own}} >> 4) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00203}00203         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a550a8f7911b291f3b346565761556928}{MLX5\_CQE\_RESP\_WR\_IMM}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00204}00204                 wc-\/>opcode      = IB\_WC\_RECV\_RDMA\_WITH\_IMM;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00205}00205                 wc-\/>wc\_flags    = IB\_WC\_WITH\_IMM;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00206}00206                 wc-\/>ex.imm\_data = cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_a13062bd2eaa96fdbbf5da70c65c27ca6}{imm\_inval\_pkey}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00207}00207                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00208}00208         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7ab4fc60bde7cd4b1acc475584ef6ea813}{MLX5\_CQE\_RESP\_SEND}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00209}00209                 wc-\/>opcode   = IB\_WC\_RECV;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00210}00210                 wc-\/>wc\_flags = IB\_WC\_IP\_CSUM\_OK;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00211}00211                 \textcolor{keywordflow}{if} (unlikely(!((cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_a6fdd1e0f9f018dd9a69e79839b75d1c7}{hds\_ip\_ext}} \& \mbox{\hyperlink{device_8h_a84627a72058502328269676b81780f89a0651552a9aa449325a82a8c3703dde5a}{CQE\_L3\_OK}}) \&\&}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00212}00212                                (cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_a6fdd1e0f9f018dd9a69e79839b75d1c7}{hds\_ip\_ext}} \& \mbox{\hyperlink{device_8h_a84627a72058502328269676b81780f89afd29c1e7b479be60f3d4a08321615429}{CQE\_L4\_OK}}))))}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00213}00213                         wc-\/>wc\_flags = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00214}00214                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00215}00215         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a74f57a76503ba29d06ad602a63c8ba58}{MLX5\_CQE\_RESP\_SEND\_IMM}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00216}00216                 wc-\/>opcode      = IB\_WC\_RECV;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00217}00217                 wc-\/>wc\_flags    = IB\_WC\_WITH\_IMM;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00218}00218                 wc-\/>ex.imm\_data = cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_a13062bd2eaa96fdbbf5da70c65c27ca6}{imm\_inval\_pkey}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00219}00219                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00220}00220         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a65137cff3e2670e83a39da48a9d3ced5}{MLX5\_CQE\_RESP\_SEND\_INV}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00221}00221                 wc-\/>opcode      = IB\_WC\_RECV;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00222}00222                 wc-\/>wc\_flags    = IB\_WC\_WITH\_INVALIDATE;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00223}00223                 wc-\/>ex.invalidate\_rkey = be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_a13062bd2eaa96fdbbf5da70c65c27ca6}{imm\_inval\_pkey}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00224}00224                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00225}00225         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00226}00226         wc-\/>src\_qp         = be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_a52f0122da16f7ef4c19b4e70fa28730c}{flags\_rqpn}}) \& 0xffffff;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00227}00227         wc-\/>dlid\_path\_bits = cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_a98b1a6d7bd89ecd5de422d1a828ad7ce}{ml\_path}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00228}00228         g = (be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_a52f0122da16f7ef4c19b4e70fa28730c}{flags\_rqpn}}) >> 28) \& 3;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00229}00229         wc-\/>wc\_flags |= g ? IB\_WC\_GRH : 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00230}00230         \textcolor{keywordflow}{if} (unlikely(\mbox{\hyperlink{mlx5__ib_8h_a3e0a62aa0bc279aa9b5d6585d20d7f34}{is\_qp1}}(qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a13cb76e255a9f8cfd61db355965c81bd}{ibqp}}.qp\_type))) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00231}00231                 u16 pkey = be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_a13062bd2eaa96fdbbf5da70c65c27ca6}{imm\_inval\_pkey}}) \& 0xffff;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00232}00232 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00233}00233                 ib\_find\_cached\_pkey(\&dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad6e3ba2b9a0e5ae708df08538ef40b45}{ib\_dev}}, qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a1f7fb946fb17be44cdf310075104a91f}{port}}, pkey,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00234}00234                                     \&wc-\/>pkey\_index);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00235}00235         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00236}00236                 wc-\/>pkey\_index = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00237}00237         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00238}00238 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00239}00239         \textcolor{keywordflow}{if} (ll != IB\_LINK\_LAYER\_ETHERNET) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00240}00240                 wc-\/>slid = be16\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_a1527ac071e80be2d50634867cc7325fe}{slid}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00241}00241                 wc-\/>sl = (be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_a52f0122da16f7ef4c19b4e70fa28730c}{flags\_rqpn}}) >> 24) \& 0xf;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00242}00242                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00243}00243         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00244}00244 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00245}00245         wc-\/>slid = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00246}00246         vlan\_present = \mbox{\hyperlink{device_8h_a785ff7f6d7f0682a608921bf00ee512a}{cqe\_has\_vlan}}(cqe);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00247}00247         roce\_packet\_type   = (be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_a52f0122da16f7ef4c19b4e70fa28730c}{flags\_rqpn}}) >> 24) \& 0x3;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00248}00248         \textcolor{keywordflow}{if} (vlan\_present) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00249}00249                 wc-\/>vlan\_id = (be16\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_adbdedfb8bd0521bd676ade4d6a01db26}{vlan\_info}})) \& 0xfff;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00250}00250                 wc-\/>sl = (be16\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__cqe64_adbdedfb8bd0521bd676ade4d6a01db26}{vlan\_info}}) >> 13) \& 0x7;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00251}00251                 wc-\/>wc\_flags |= IB\_WC\_WITH\_VLAN;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00252}00252         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00253}00253                 wc-\/>sl = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00254}00254         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00255}00255 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00256}00256         \textcolor{keywordflow}{switch} (roce\_packet\_type) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00257}00257         \textcolor{keywordflow}{case} \mbox{\hyperlink{device_8h_a1fb9092bcdeada2d206bdc74afbbe122a7c8a9bdb662506b4a7fea8f813b78287}{MLX5\_CQE\_ROCE\_L3\_HEADER\_TYPE\_GRH}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00258}00258                 wc-\/>network\_hdr\_type = RDMA\_NETWORK\_IB;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00259}00259                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00260}00260         \textcolor{keywordflow}{case} \mbox{\hyperlink{device_8h_a1fb9092bcdeada2d206bdc74afbbe122a55e051ea31b20212f2b5073ba704628d}{MLX5\_CQE\_ROCE\_L3\_HEADER\_TYPE\_IPV6}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00261}00261                 wc-\/>network\_hdr\_type = RDMA\_NETWORK\_IPV6;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00262}00262                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00263}00263         \textcolor{keywordflow}{case} \mbox{\hyperlink{device_8h_a1fb9092bcdeada2d206bdc74afbbe122ac8b677074cd08bc77dd1f828b64791ea}{MLX5\_CQE\_ROCE\_L3\_HEADER\_TYPE\_IPV4}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00264}00264                 wc-\/>network\_hdr\_type = RDMA\_NETWORK\_IPV4;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00265}00265                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00266}00266         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00267}00267         wc-\/>wc\_flags |= IB\_WC\_WITH\_NETWORK\_HDR\_TYPE;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00268}00268 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00269}00269 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00270}\mbox{\hyperlink{mlx5__ib__cq_8c_ad48740af8b4571808c91d54926c68366}{00270}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_ad48740af8b4571808c91d54926c68366}{dump\_cqe}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__err__cqe}{mlx5\_err\_cqe}} *cqe)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00271}00271 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00272}00272         \_\_be32 *p = (\_\_be32 *)cqe;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00273}00273         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00274}00274 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00275}00275         \mbox{\hyperlink{mlx5__ib_8h_a648fb83654f708e827821ca7fa53779a}{mlx5\_ib\_warn}}(dev, \textcolor{stringliteral}{"{}dump error cqe\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00276}00276         \textcolor{keywordflow}{for} (i = 0; i < \textcolor{keyword}{sizeof}(*cqe) / 16; i++, p += 4)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00277}00277                 pr\_info(\textcolor{stringliteral}{"{}\%08x \%08x \%08x \%08x\(\backslash\)n"{}}, be32\_to\_cpu(p[0]),}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00278}00278                         be32\_to\_cpu(p[1]), be32\_to\_cpu(p[2]),}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00279}00279                         be32\_to\_cpu(p[3]));}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00280}00280 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00281}00281 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00282}\mbox{\hyperlink{mlx5__ib__cq_8c_a2ac8f161596c01303ecf1243e82602b0}{00282}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_a2ac8f161596c01303ecf1243e82602b0}{mlx5\_handle\_error\_cqe}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00283}00283                                   \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__err__cqe}{mlx5\_err\_cqe}} *cqe,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00284}00284                                   \textcolor{keyword}{struct} ib\_wc *wc)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00285}00285 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00286}00286         \textcolor{keywordtype}{int} dump = 1;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00287}00287 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00288}00288         \textcolor{keywordflow}{switch} (cqe-\/>\mbox{\hyperlink{structmlx5__err__cqe_a4ba3edd29f0fe4545eb5b82661f62ce2}{syndrome}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00289}00289         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_a06fc87d81c62e9abb8790b6e5713c55ba850e3cc1ee9c7c58b9870afc46373ceb}{MLX5\_CQE\_SYNDROME\_LOCAL\_LENGTH\_ERR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00290}00290                 wc-\/>status = IB\_WC\_LOC\_LEN\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00291}00291                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00292}00292         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_a06fc87d81c62e9abb8790b6e5713c55ba4939395c3638c4cd33bd1a74a6f1961f}{MLX5\_CQE\_SYNDROME\_LOCAL\_QP\_OP\_ERR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00293}00293                 wc-\/>status = IB\_WC\_LOC\_QP\_OP\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00294}00294                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00295}00295         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_a06fc87d81c62e9abb8790b6e5713c55ba4203c81709b1f035900741f3353d34e4}{MLX5\_CQE\_SYNDROME\_LOCAL\_PROT\_ERR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00296}00296                 wc-\/>status = IB\_WC\_LOC\_PROT\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00297}00297                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00298}00298         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_a06fc87d81c62e9abb8790b6e5713c55ba194f282fd1045d8fd1caca58888269f4}{MLX5\_CQE\_SYNDROME\_WR\_FLUSH\_ERR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00299}00299                 dump = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00300}00300                 wc-\/>status = IB\_WC\_WR\_FLUSH\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00301}00301                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00302}00302         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_a06fc87d81c62e9abb8790b6e5713c55ba74b47164eefe696f45d19f708415b032}{MLX5\_CQE\_SYNDROME\_MW\_BIND\_ERR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00303}00303                 wc-\/>status = IB\_WC\_MW\_BIND\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00304}00304                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00305}00305         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_a06fc87d81c62e9abb8790b6e5713c55ba62570930c6e37f0611953899b3d3fc2e}{MLX5\_CQE\_SYNDROME\_BAD\_RESP\_ERR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00306}00306                 wc-\/>status = IB\_WC\_BAD\_RESP\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00307}00307                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00308}00308         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_a06fc87d81c62e9abb8790b6e5713c55ba991fc6d2a5c7b3721796a42c911c684f}{MLX5\_CQE\_SYNDROME\_LOCAL\_ACCESS\_ERR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00309}00309                 wc-\/>status = IB\_WC\_LOC\_ACCESS\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00310}00310                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00311}00311         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_a06fc87d81c62e9abb8790b6e5713c55bafa1e0523e84e9ae92495024b446510a3}{MLX5\_CQE\_SYNDROME\_REMOTE\_INVAL\_REQ\_ERR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00312}00312                 wc-\/>status = IB\_WC\_REM\_INV\_REQ\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00313}00313                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00314}00314         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_a06fc87d81c62e9abb8790b6e5713c55babee9173fb07bd1b2f1a16ca0e786cde6}{MLX5\_CQE\_SYNDROME\_REMOTE\_ACCESS\_ERR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00315}00315                 wc-\/>status = IB\_WC\_REM\_ACCESS\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00316}00316                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00317}00317         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_a06fc87d81c62e9abb8790b6e5713c55baa75896bfdae1078f6f73801a477814a3}{MLX5\_CQE\_SYNDROME\_REMOTE\_OP\_ERR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00318}00318                 wc-\/>status = IB\_WC\_REM\_OP\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00319}00319                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00320}00320         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_a06fc87d81c62e9abb8790b6e5713c55ba031da282baff2ac73deb28f836c771b7}{MLX5\_CQE\_SYNDROME\_TRANSPORT\_RETRY\_EXC\_ERR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00321}00321                 wc-\/>status = IB\_WC\_RETRY\_EXC\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00322}00322                 dump = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00323}00323                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00324}00324         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_a06fc87d81c62e9abb8790b6e5713c55ba71f90cb4b89accd2dd2950377a408709}{MLX5\_CQE\_SYNDROME\_RNR\_RETRY\_EXC\_ERR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00325}00325                 wc-\/>status = IB\_WC\_RNR\_RETRY\_EXC\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00326}00326                 dump = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00327}00327                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00328}00328         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_a06fc87d81c62e9abb8790b6e5713c55ba1d538f4939e9455051f273d55a991640}{MLX5\_CQE\_SYNDROME\_REMOTE\_ABORTED\_ERR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00329}00329                 wc-\/>status = IB\_WC\_REM\_ABORT\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00330}00330                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00331}00331         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00332}00332                 wc-\/>status = IB\_WC\_GENERAL\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00333}00333                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00334}00334         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00335}00335 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00336}00336         wc-\/>vendor\_err = cqe-\/>\mbox{\hyperlink{structmlx5__err__cqe_ae7316e407593439aef977b4c4b385d2a}{vendor\_err\_synd}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00337}00337         \textcolor{keywordflow}{if} (dump)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00338}00338                 \mbox{\hyperlink{mlx5__ib__cq_8c_ad48740af8b4571808c91d54926c68366}{dump\_cqe}}(dev, cqe);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00339}00339 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00340}00340 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00341}\mbox{\hyperlink{mlx5__ib__cq_8c_a7a54b0d1a8213a77252df566988bdd3a}{00341}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_a7a54b0d1a8213a77252df566988bdd3a}{is\_atomic\_response}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__qp}{mlx5\_ib\_qp}} *qp, uint16\_t idx)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00342}00342 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00343}00343         \textcolor{comment}{/* TBD: waiting decision}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00344}00344 \textcolor{comment}{        */}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00345}00345         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00346}00346 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00347}00347 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00348}\mbox{\hyperlink{mlx5__ib__cq_8c_a79ce7058fd452185a433aff456c58ff1}{00348}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} *\mbox{\hyperlink{mlx5__ib__cq_8c_a79ce7058fd452185a433aff456c58ff1}{mlx5\_get\_atomic\_laddr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__qp}{mlx5\_ib\_qp}} *qp, uint16\_t idx)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00349}00349 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00350}00350         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__wqe__data__seg}{mlx5\_wqe\_data\_seg}} *dpseg;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00351}00351         \textcolor{keywordtype}{void} *\mbox{\hyperlink{structmlx5__wqe__data__seg_a12d24c2dede618f9700fc54ba3fb1662}{addr}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00352}00352 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00353}00353         dpseg = \mbox{\hyperlink{mlx5__ib_8h_a3f1f8398d0713f9c2c9ab945e9333991}{mlx5\_get\_send\_wqe}}(qp, idx) + \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__wqe__ctrl__seg}{mlx5\_wqe\_ctrl\_seg}}) +}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00354}00354                 sizeof(struct \mbox{\hyperlink{structmlx5__wqe__raddr__seg}{mlx5\_wqe\_raddr\_seg}}) +}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00355}00355                 sizeof(struct \mbox{\hyperlink{structmlx5__wqe__atomic__seg}{mlx5\_wqe\_atomic\_seg}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00356}00356         addr = (\textcolor{keywordtype}{void} *)(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long})be64\_to\_cpu(dpseg-\/>\mbox{\hyperlink{structmlx5__wqe__data__seg_a12d24c2dede618f9700fc54ba3fb1662}{addr}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00357}00357         \textcolor{keywordflow}{return} addr;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00358}00358 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00359}00359 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00360}\mbox{\hyperlink{mlx5__ib__cq_8c_ac8a8ce077ebd79a85564f0ee5b554526}{00360}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_ac8a8ce077ebd79a85564f0ee5b554526}{handle\_atomic}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__qp}{mlx5\_ib\_qp}} *qp, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__cqe64}{mlx5\_cqe64}} *cqe64,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00361}00361                           uint16\_t idx)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00362}00362 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00363}00363         \textcolor{keywordtype}{void} *addr;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00364}00364         \textcolor{keywordtype}{int} byte\_count;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00365}00365         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00366}00366 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00367}00367         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{mlx5__ib__cq_8c_a7a54b0d1a8213a77252df566988bdd3a}{is\_atomic\_response}}(qp, idx))}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00368}00368                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00369}00369 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00370}00370         byte\_count = be32\_to\_cpu(cqe64-\/>\mbox{\hyperlink{structmlx5__cqe64_a153afdc80bf9d2ccfb3be09055f1a5c6}{byte\_cnt}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00371}00371         addr = \mbox{\hyperlink{mlx5__ib__cq_8c_a79ce7058fd452185a433aff456c58ff1}{mlx5\_get\_atomic\_laddr}}(qp, idx);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00372}00372 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00373}00373         \textcolor{keywordflow}{if} (byte\_count == 4) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00374}00374                 *(uint32\_t *)addr = be32\_to\_cpu(*((\_\_be32 *)addr));}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00375}00375         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00376}00376                 \textcolor{keywordflow}{for} (i = 0; i < byte\_count; i += 8) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00377}00377                         *(uint64\_t *)addr = be64\_to\_cpu(*((\_\_be64 *)addr));}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00378}00378                         addr += 8;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00379}00379                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00380}00380         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00381}00381 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00382}00382         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00383}00383 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00384}00384 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00385}\mbox{\hyperlink{mlx5__ib__cq_8c_a80bfc09b28b012c7bbee5649c58764e8}{00385}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_a80bfc09b28b012c7bbee5649c58764e8}{handle\_atomics}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__qp}{mlx5\_ib\_qp}} *qp, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__cqe64}{mlx5\_cqe64}} *cqe64,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00386}00386                            u16 tail, u16 head)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00387}00387 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00388}00388         u16 idx;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00389}00389 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00390}00390         \textcolor{keywordflow}{do} \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00391}00391                 idx = tail \& (qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a4117d78bec75c701c0453b659d57374f}{sq}}.\mbox{\hyperlink{structmlx5__ib__wq_ae81ea8dd37848c00b5900cca3b4b0275}{wqe\_cnt}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00392}00392                 \mbox{\hyperlink{mlx5__ib__cq_8c_ac8a8ce077ebd79a85564f0ee5b554526}{handle\_atomic}}(qp, cqe64, idx);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00393}00393                 \textcolor{keywordflow}{if} (idx == head)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00394}00394                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00395}00395 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00396}00396                 tail = qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a4117d78bec75c701c0453b659d57374f}{sq}}.\mbox{\hyperlink{structmlx5__ib__wq_a38a6f1e846078ca22981b925832b5f67}{w\_list}}[idx].\mbox{\hyperlink{structwr__list_ab8d319d98478bdba8cc6c3d9cc305853}{next}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00397}00397         \} \textcolor{keywordflow}{while} (1);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00398}00398         tail = qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a4117d78bec75c701c0453b659d57374f}{sq}}.\mbox{\hyperlink{structmlx5__ib__wq_a38a6f1e846078ca22981b925832b5f67}{w\_list}}[idx].\mbox{\hyperlink{structwr__list_ab8d319d98478bdba8cc6c3d9cc305853}{next}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00399}00399         qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a4117d78bec75c701c0453b659d57374f}{sq}}.\mbox{\hyperlink{structmlx5__ib__wq_aa3322a5ecc46a48cb5dde2b0d16a1d9e}{last\_poll}} = tail;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00400}00400 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00401}00401 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00402}\mbox{\hyperlink{mlx5__ib__cq_8c_a85123e49ea547174ddf7ee5ed7de8009}{00402}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_a85123e49ea547174ddf7ee5ed7de8009}{free\_cq\_buf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq__buf}{mlx5\_ib\_cq\_buf}} *buf)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00403}00403 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00404}00404         \mbox{\hyperlink{driver_8h_a1c3786da4ff727bd0e8bd0a9fd4d451c}{mlx5\_buf\_free}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, \&buf-\/>\mbox{\hyperlink{structmlx5__ib__cq__buf_a29729d4f468db77f10e05db04abe66ef}{buf}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00405}00405 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00406}00406 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00407}\mbox{\hyperlink{mlx5__ib__cq_8c_a92118c0ae91dfae13048e653d481c6c8}{00407}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_a92118c0ae91dfae13048e653d481c6c8}{get\_sig\_err\_item}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__sig__err__cqe}{mlx5\_sig\_err\_cqe}} *cqe,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00408}00408                              \textcolor{keyword}{struct} ib\_sig\_err *item)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00409}00409 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00410}00410         u16 syndrome = be16\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__sig__err__cqe_a20dcb39dada7b6171100c8cedb04b093}{syndrome}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00411}00411 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00412}00412 \textcolor{preprocessor}{\#define GUARD\_ERR   (1 << 13)}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00413}00413 \textcolor{preprocessor}{\#define APPTAG\_ERR  (1 << 12)}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00414}00414 \textcolor{preprocessor}{\#define REFTAG\_ERR  (1 << 11)}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00415}00415 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00416}00416         \textcolor{keywordflow}{if} (syndrome \& \mbox{\hyperlink{mlx5__ib__cq_8c_af814f97a5c61b848748e8634971df895}{GUARD\_ERR}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00417}00417                 item-\/>err\_type = IB\_SIG\_BAD\_GUARD;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00418}00418                 item-\/>expected = be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__sig__err__cqe_ac8733da44beb18d7c7892976dd76e860}{expected\_trans\_sig}}) >> 16;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00419}00419                 item-\/>actual = be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__sig__err__cqe_ad0893615f98c6c7d4bafe3d141e4577b}{actual\_trans\_sig}}) >> 16;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00420}00420         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00421}00421         \textcolor{keywordflow}{if} (syndrome \& \mbox{\hyperlink{mlx5__ib__cq_8c_a92f54c8c6b4f80dc944023cb5955fd9a}{REFTAG\_ERR}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00422}00422                 item-\/>err\_type = IB\_SIG\_BAD\_REFTAG;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00423}00423                 item-\/>expected = be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__sig__err__cqe_a2938f0fdee993a82a2fe251b50e5bf3e}{expected\_reftag}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00424}00424                 item-\/>actual = be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__sig__err__cqe_af19554afe97f43d0dbc26c6b09de4854}{actual\_reftag}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00425}00425         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00426}00426         \textcolor{keywordflow}{if} (syndrome \& \mbox{\hyperlink{mlx5__ib__cq_8c_a9376a541bc426b2157b584fd40d405bc}{APPTAG\_ERR}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00427}00427                 item-\/>err\_type = IB\_SIG\_BAD\_APPTAG;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00428}00428                 item-\/>expected = be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__sig__err__cqe_ac8733da44beb18d7c7892976dd76e860}{expected\_trans\_sig}}) \& 0xffff;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00429}00429                 item-\/>actual = be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__sig__err__cqe_ad0893615f98c6c7d4bafe3d141e4577b}{actual\_trans\_sig}}) \& 0xffff;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00430}00430         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00431}00431                 pr\_err(\textcolor{stringliteral}{"{}Got signature completion error with bad syndrome \%04x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00432}00432                        syndrome);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00433}00433         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00434}00434 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00435}00435         item-\/>sig\_err\_offset = be64\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__sig__err__cqe_ac5b48c66252044ed052a383b82b191f8}{err\_offset}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00436}00436         item-\/>key = be32\_to\_cpu(cqe-\/>\mbox{\hyperlink{structmlx5__sig__err__cqe_af43028662fb0c81965d27aa5feef91ec}{mkey}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00437}00437 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00438}00438 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00439}\mbox{\hyperlink{mlx5__ib__cq_8c_abe4376ffcc08507ff8b5c0a8f8fc467a}{00439}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_abe4376ffcc08507ff8b5c0a8f8fc467a}{sw\_send\_comp}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__qp}{mlx5\_ib\_qp}} *qp, \textcolor{keywordtype}{int} num\_entries,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00440}00440                          \textcolor{keyword}{struct} ib\_wc *wc, \textcolor{keywordtype}{int} *npolled)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00441}00441 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00442}00442         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__wq}{mlx5\_ib\_wq}} *\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00443}00443         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} cur;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00444}00444         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} idx;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00445}00445         \textcolor{keywordtype}{int} np;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00446}00446         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00447}00447 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00448}00448         \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}} = \&qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a4117d78bec75c701c0453b659d57374f}{sq}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00449}00449         cur = \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>head -\/ \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>tail;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00450}00450         np = *npolled;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00451}00451 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00452}00452         \textcolor{keywordflow}{if} (cur == 0)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00453}00453                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00454}00454 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00455}00455         \textcolor{keywordflow}{for} (i = 0;  i < cur \&\& np < num\_entries; i++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00456}00456                 idx = \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>last\_poll \& (\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>wqe\_cnt -\/ 1);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00457}00457                 wc-\/>wr\_id = \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>wrid[idx];}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00458}00458                 wc-\/>status = IB\_WC\_WR\_FLUSH\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00459}00459                 wc-\/>vendor\_err = \mbox{\hyperlink{cq_8h_a06fc87d81c62e9abb8790b6e5713c55ba194f282fd1045d8fd1caca58888269f4}{MLX5\_CQE\_SYNDROME\_WR\_FLUSH\_ERR}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00460}00460                 \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>tail++;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00461}00461                 np++;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00462}00462                 wc-\/>qp = \&qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a13cb76e255a9f8cfd61db355965c81bd}{ibqp}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00463}00463                 wc++;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00464}00464                 \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>last\_poll = \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>w\_list[idx].next;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00465}00465         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00466}00466         *npolled = np;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00467}00467 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00468}00468 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00469}\mbox{\hyperlink{mlx5__ib__cq_8c_acd8dc5a400a7e5f8d3bffeb05e1fc1fe}{00469}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_acd8dc5a400a7e5f8d3bffeb05e1fc1fe}{sw\_recv\_comp}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__qp}{mlx5\_ib\_qp}} *qp, \textcolor{keywordtype}{int} num\_entries,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00470}00470                          \textcolor{keyword}{struct} ib\_wc *wc, \textcolor{keywordtype}{int} *npolled)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00471}00471 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00472}00472         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__wq}{mlx5\_ib\_wq}} *\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00473}00473         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} cur;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00474}00474         \textcolor{keywordtype}{int} np;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00475}00475         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00476}00476 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00477}00477         \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}} = \&qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a12a1f638aaf356cabfb9d47795c53f18}{rq}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00478}00478         cur = \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>head -\/ \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>tail;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00479}00479         np = *npolled;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00480}00480 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00481}00481         \textcolor{keywordflow}{if} (cur == 0)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00482}00482                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00483}00483 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00484}00484         \textcolor{keywordflow}{for} (i = 0;  i < cur \&\& np < num\_entries; i++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00485}00485                 wc-\/>wr\_id = \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>wrid[\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>tail \& (\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>wqe\_cnt -\/ 1)];}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00486}00486                 wc-\/>status = IB\_WC\_WR\_FLUSH\_ERR;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00487}00487                 wc-\/>vendor\_err = \mbox{\hyperlink{cq_8h_a06fc87d81c62e9abb8790b6e5713c55ba194f282fd1045d8fd1caca58888269f4}{MLX5\_CQE\_SYNDROME\_WR\_FLUSH\_ERR}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00488}00488                 \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>tail++;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00489}00489                 np++;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00490}00490                 wc-\/>qp = \&qp-\/>\mbox{\hyperlink{structmlx5__ib__qp_a13cb76e255a9f8cfd61db355965c81bd}{ibqp}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00491}00491                 wc++;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00492}00492         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00493}00493         *npolled = np;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00494}00494 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00495}00495 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00496}\mbox{\hyperlink{mlx5__ib__cq_8c_aea34d4a9c800529fa8231433f292c297}{00496}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_aea34d4a9c800529fa8231433f292c297}{mlx5\_ib\_poll\_sw\_comp}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, \textcolor{keywordtype}{int} num\_entries,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00497}00497                                  \textcolor{keyword}{struct} ib\_wc *wc, \textcolor{keywordtype}{int} *npolled)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00498}00498 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00499}00499         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__qp}{mlx5\_ib\_qp}} *qp;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00500}00500 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00501}00501         *npolled = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00502}00502         \textcolor{comment}{/* Find uncompleted WQEs belonging to that cq and retrun mmics ones */}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00503}00503         list\_for\_each\_entry(qp, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>list\_send\_qp, \mbox{\hyperlink{structmlx5__ib__qp_ad53be8bfd610ba4fb0eac89c09be5372}{cq\_send\_list}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00504}00504                 \mbox{\hyperlink{mlx5__ib__cq_8c_abe4376ffcc08507ff8b5c0a8f8fc467a}{sw\_send\_comp}}(qp, num\_entries, wc + *npolled, npolled);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00505}00505                 \textcolor{keywordflow}{if} (*npolled >= num\_entries)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00506}00506                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00507}00507         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00508}00508 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00509}00509         list\_for\_each\_entry(qp, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>list\_recv\_qp, \mbox{\hyperlink{structmlx5__ib__qp_a88885337f92887328e0f40e5127e85b0}{cq\_recv\_list}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00510}00510                 \mbox{\hyperlink{mlx5__ib__cq_8c_acd8dc5a400a7e5f8d3bffeb05e1fc1fe}{sw\_recv\_comp}}(qp, num\_entries, wc + *npolled, npolled);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00511}00511                 \textcolor{keywordflow}{if} (*npolled >= num\_entries)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00512}00512                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00513}00513         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00514}00514 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00515}00515 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00516}\mbox{\hyperlink{mlx5__ib__cq_8c_a2811b8ed1a370c2f8cd2fe78dac76bc3}{00516}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_a2811b8ed1a370c2f8cd2fe78dac76bc3}{mlx5\_poll\_one}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00517}00517                          \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__qp}{mlx5\_ib\_qp}} **cur\_qp,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00518}00518                          \textcolor{keyword}{struct} ib\_wc *wc)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00519}00519 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00520}00520         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev = \mbox{\hyperlink{mlx5__ib_8h_a1806639f13e6865f0fa7aab4dd3ec6c7}{to\_mdev}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq.device);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00521}00521         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__err__cqe}{mlx5\_err\_cqe}} *err\_cqe;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00522}00522         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__cqe64}{mlx5\_cqe64}} *cqe64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00523}00523         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__qp}{mlx5\_core\_qp}} *mqp;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00524}00524         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__wq}{mlx5\_ib\_wq}} *\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00525}00525         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__sig__err__cqe}{mlx5\_sig\_err\_cqe}} *sig\_err\_cqe;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00526}00526         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__mkey}{mlx5\_core\_mkey}} *mmkey;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00527}00527         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__mr}{mlx5\_ib\_mr}} *mr;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00528}00528         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} flags;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00529}00529         uint8\_t opcode;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00530}00530         uint32\_t qpn;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00531}00531         u16 wqe\_ctr;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00532}00532         \textcolor{keywordtype}{void} *cqe;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00533}00533         \textcolor{keywordtype}{int} idx;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00534}00534 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00535}00535 repoll:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00536}00536         cqe = \mbox{\hyperlink{mlx5__ib__cq_8c_acebfdc0ba27fabf4c4ab0256bce6a19a}{next\_cqe\_sw}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00537}00537         \textcolor{keywordflow}{if} (!cqe)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00538}00538                 \textcolor{keywordflow}{return} -\/EAGAIN;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00539}00539 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00540}00540         cqe64 = (\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_a458436764ec16a503d3e3fbb1457b394}{cqe\_sz}} == 64) ? cqe : cqe + 64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00541}00541 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00542}00542         ++\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_afb2887dc8c075ba41ca2e359dbcfdde2}{cons\_index}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00543}00543 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00544}00544         \textcolor{comment}{/* Make sure we read CQ entry contents after we've checked the}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00545}00545 \textcolor{comment}{         * ownership bit.}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00546}00546 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00547}00547         rmb();}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00548}00548 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00549}00549         opcode = cqe64-\/>\mbox{\hyperlink{structmlx5__cqe64_a3dbb1dc2c9f2ee64863edf7f750f5885}{op\_own}} >> 4;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00550}00550         \textcolor{keywordflow}{if} (unlikely(opcode == \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a1c3148402db2b597afcb3a5b4653469c}{MLX5\_CQE\_RESIZE\_CQ}})) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00551}00551                 \textcolor{keywordflow}{if} (likely(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00552}00552                         \mbox{\hyperlink{mlx5__ib__cq_8c_a85123e49ea547174ddf7ee5ed7de8009}{free\_cq\_buf}}(\mbox{\hyperlink{structmlx5__ib__mr_acb7157751bb0930b1ba3841180b659ba}{dev}}, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00553}00553                         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf = *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00554}00554                         kfree(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00555}00555                         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00556}00556                         \textcolor{keywordflow}{goto} repoll;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00557}00557                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00558}00558                         \mbox{\hyperlink{mlx5__ib_8h_a648fb83654f708e827821ca7fa53779a}{mlx5\_ib\_warn}}(\mbox{\hyperlink{structmlx5__ib__mr_acb7157751bb0930b1ba3841180b659ba}{dev}}, \textcolor{stringliteral}{"{}unexpected resize cqe\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00559}00559                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00560}00560         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00561}00561 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00562}00562         qpn = ntohl(cqe64-\/>\mbox{\hyperlink{structmlx5__cqe64_ad6fa2d0b532424a656f4a6769961ef58}{sop\_drop\_qpn}}) \& 0xffffff;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00563}00563         \textcolor{keywordflow}{if} (!*cur\_qp || (qpn != (*cur\_qp)-\/>ibqp.qp\_num)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00564}00564                 \textcolor{comment}{/* We do not have to take the QP table lock here,}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00565}00565 \textcolor{comment}{                 * because CQs will be locked while QPs are removed}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00566}00566 \textcolor{comment}{                 * from the table.}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00567}00567 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00568}00568                 mqp = \mbox{\hyperlink{qp_8h_ab320e53aa38a8a680b3ae754eb913723}{\_\_mlx5\_qp\_lookup}}(\mbox{\hyperlink{structmlx5__ib__mr_acb7157751bb0930b1ba3841180b659ba}{dev}}-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, qpn);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00569}00569                 *cur\_qp = \mbox{\hyperlink{mlx5__ib_8h_a924202146cef52c6dbc062aa87bed108}{to\_mibqp}}(mqp);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00570}00570         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00571}00571 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00572}00572         wc-\/>qp  = \&(*cur\_qp)-\/>ibqp;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00573}00573         \textcolor{keywordflow}{switch} (opcode) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00574}00574         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a40ac256eda7211b77ebd0faf8f8df63e}{MLX5\_CQE\_REQ}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00575}00575                 \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}} = \&(*cur\_qp)-\/>sq;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00576}00576                 wqe\_ctr = be16\_to\_cpu(cqe64-\/>\mbox{\hyperlink{structmlx5__cqe64_af16e0b265dec7e07555179d5cd7388c6}{wqe\_counter}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00577}00577                 idx = wqe\_ctr \& (\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>wqe\_cnt -\/ 1);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00578}00578                 \mbox{\hyperlink{mlx5__ib__cq_8c_a5c9c63c6bd03593992cad167a3f1f783}{handle\_good\_req}}(wc, cqe64, \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}, idx);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00579}00579                 \mbox{\hyperlink{mlx5__ib__cq_8c_a80bfc09b28b012c7bbee5649c58764e8}{handle\_atomics}}(*cur\_qp, cqe64, \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>last\_poll, idx);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00580}00580                 wc-\/>wr\_id = \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>wrid[idx];}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00581}00581                 \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>tail = \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>wqe\_head[idx] + 1;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00582}00582                 wc-\/>status = IB\_WC\_SUCCESS;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00583}00583                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00584}00584         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a550a8f7911b291f3b346565761556928}{MLX5\_CQE\_RESP\_WR\_IMM}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00585}00585         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7ab4fc60bde7cd4b1acc475584ef6ea813}{MLX5\_CQE\_RESP\_SEND}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00586}00586         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a74f57a76503ba29d06ad602a63c8ba58}{MLX5\_CQE\_RESP\_SEND\_IMM}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00587}00587         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a65137cff3e2670e83a39da48a9d3ced5}{MLX5\_CQE\_RESP\_SEND\_INV}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00588}00588                 \mbox{\hyperlink{mlx5__ib__cq_8c_a8717e07da3075c311c7586871b3b5450}{handle\_responder}}(wc, cqe64, *cur\_qp);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00589}00589                 wc-\/>status = IB\_WC\_SUCCESS;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00590}00590                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00591}00591         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a1c3148402db2b597afcb3a5b4653469c}{MLX5\_CQE\_RESIZE\_CQ}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00592}00592                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00593}00593         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a7932d36dcd0aabba93860645a69f309a}{MLX5\_CQE\_REQ\_ERR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00594}00594         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a231f03fc9993015a0ccf553d431db771}{MLX5\_CQE\_RESP\_ERR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00595}00595                 err\_cqe = (\textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__err__cqe}{mlx5\_err\_cqe}} *)cqe64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00596}00596                 \mbox{\hyperlink{mlx5__ib__cq_8c_a2ac8f161596c01303ecf1243e82602b0}{mlx5\_handle\_error\_cqe}}(dev, err\_cqe, wc);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00597}00597                 \mbox{\hyperlink{mlx5__ib_8h_ad0c148e0ae3bd0d552c0f392c473271f}{mlx5\_ib\_dbg}}(dev, \textcolor{stringliteral}{"{}\%s error cqe on cqn 0x\%x:\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00598}00598                             opcode == \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a7932d36dcd0aabba93860645a69f309a}{MLX5\_CQE\_REQ\_ERR}} ?}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00599}00599                             \textcolor{stringliteral}{"{}Requestor"{}} : \textcolor{stringliteral}{"{}Responder"{}}, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_aa4a997291e120b040c7a95d59639e62a}{cqn}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00600}00600                 \mbox{\hyperlink{mlx5__ib_8h_ad0c148e0ae3bd0d552c0f392c473271f}{mlx5\_ib\_dbg}}(dev, \textcolor{stringliteral}{"{}syndrome 0x\%x, vendor syndrome 0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00601}00601                             err\_cqe-\/>\mbox{\hyperlink{structmlx5__err__cqe_a4ba3edd29f0fe4545eb5b82661f62ce2}{syndrome}}, err\_cqe-\/>\mbox{\hyperlink{structmlx5__err__cqe_ae7316e407593439aef977b4c4b385d2a}{vendor\_err\_synd}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00602}00602                 \textcolor{keywordflow}{if} (opcode == \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a7932d36dcd0aabba93860645a69f309a}{MLX5\_CQE\_REQ\_ERR}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00603}00603                         \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}} = \&(*cur\_qp)-\/>sq;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00604}00604                         wqe\_ctr = be16\_to\_cpu(cqe64-\/>\mbox{\hyperlink{structmlx5__cqe64_af16e0b265dec7e07555179d5cd7388c6}{wqe\_counter}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00605}00605                         idx = wqe\_ctr \& (\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>wqe\_cnt -\/ 1);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00606}00606                         wc-\/>wr\_id = \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>wrid[idx];}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00607}00607                         \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>tail = \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>wqe\_head[idx] + 1;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00608}00608                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00609}00609                         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__srq}{mlx5\_ib\_srq}} *srq;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00610}00610 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00611}00611                         \textcolor{keywordflow}{if} ((*cur\_qp)-\/>ibqp.srq) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00612}00612                                 srq = \mbox{\hyperlink{mlx5__ib_8h_ac3092313e8729930c5d8be58c72a1e13}{to\_msrq}}((*cur\_qp)-\/>ibqp.srq);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00613}00613                                 \mbox{\hyperlink{structmlx5__ib__srq_a13f5b0292178775a132724db4ae828d4}{wqe\_ctr}} = be16\_to\_cpu(cqe64-\/>\mbox{\hyperlink{structmlx5__cqe64_af16e0b265dec7e07555179d5cd7388c6}{wqe\_counter}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00614}00614                                 wc-\/>wr\_id = srq-\/>\mbox{\hyperlink{structmlx5__ib__srq_a59b2b00f4b9e82b11581137a5b03de55}{wrid}}[\mbox{\hyperlink{structmlx5__ib__srq_a13f5b0292178775a132724db4ae828d4}{wqe\_ctr}}];}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00615}00615                                 \mbox{\hyperlink{mlx5__ib_8h_ad4da9e65d2931a7d7c88019fe3a8351c}{mlx5\_ib\_free\_srq\_wqe}}(srq, \mbox{\hyperlink{structmlx5__ib__srq_a13f5b0292178775a132724db4ae828d4}{wqe\_ctr}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00616}00616                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00617}00617                                 \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}} = \&(*cur\_qp)-\/>rq;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00618}00618                                 wc-\/>wr\_id = \mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>wrid[\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>tail \& (\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>wqe\_cnt -\/ 1)];}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00619}00619                                 ++\mbox{\hyperlink{en_8h_a7d3b6ace6641f1454eb59728e77cac94}{wq}}-\/>tail;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00620}00620                         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00621}00621                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00622}00622                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00623}00623         \textcolor{keywordflow}{case} \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a94c742d7c516320fdedf8a7d627fe5f4}{MLX5\_CQE\_SIG\_ERR}}:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00624}00624                 sig\_err\_cqe = (\textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__sig__err__cqe}{mlx5\_sig\_err\_cqe}} *)cqe64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00625}00625 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00626}00626                 spin\_lock\_irqsave(\&dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_a3361c1d42e64541bf7c71c98149c8cc5}{mr\_table}}.\mbox{\hyperlink{structmlx5__mr__table_a5730e6ace8e7b808769fd919b8d1f1af}{lock}}, flags);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00627}00627                 mmkey = \mbox{\hyperlink{qp_8h_a3a12aeabe95c3b26dc7ace65ab208c92}{\_\_mlx5\_mr\_lookup}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00628}00628                                          \mbox{\hyperlink{driver_8h_aa256b8c7e877cdcfd3d3cfac9075aa04}{mlx5\_base\_mkey}}(be32\_to\_cpu(sig\_err\_cqe-\/>\mbox{\hyperlink{structmlx5__sig__err__cqe_af43028662fb0c81965d27aa5feef91ec}{mkey}})));}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00629}00629                 mr = \mbox{\hyperlink{mlx5__ib_8h_a1ced1fad55827190502441b72d29cd00}{to\_mibmr}}(mmkey);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00630}00630                 \mbox{\hyperlink{mlx5__ib__cq_8c_a92118c0ae91dfae13048e653d481c6c8}{get\_sig\_err\_item}}(sig\_err\_cqe, \&mr-\/>\mbox{\hyperlink{structmlx5__ib__mr_aef14dd5d1c3128819d5d270bedfce0ff}{sig}}-\/>\mbox{\hyperlink{structmlx5__core__sig__ctx_af81ab56d8e51c03c295054a1f272eadf}{err\_item}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00631}00631                 mr-\/>\mbox{\hyperlink{structmlx5__ib__mr_aef14dd5d1c3128819d5d270bedfce0ff}{sig}}-\/>\mbox{\hyperlink{structmlx5__core__sig__ctx_aa0cdbd324783a4e03eaec85b30a5ddce}{sig\_err\_exists}} = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00632}00632                 mr-\/>\mbox{\hyperlink{structmlx5__ib__mr_aef14dd5d1c3128819d5d270bedfce0ff}{sig}}-\/>\mbox{\hyperlink{structmlx5__core__sig__ctx_af3dc4572d5c58807e736407af6c2a461}{sigerr\_count}}++;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00633}00633 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00634}00634                 \mbox{\hyperlink{mlx5__ib_8h_a648fb83654f708e827821ca7fa53779a}{mlx5\_ib\_warn}}(dev, \textcolor{stringliteral}{"{}CQN: 0x\%x Got SIGERR on key: 0x\%x err\_type \%x err\_offset \%llx expected \%x actual \%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00635}00635                              \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_aa4a997291e120b040c7a95d59639e62a}{cqn}}, mr-\/>\mbox{\hyperlink{structmlx5__ib__mr_aef14dd5d1c3128819d5d270bedfce0ff}{sig}}-\/>\mbox{\hyperlink{structmlx5__core__sig__ctx_af81ab56d8e51c03c295054a1f272eadf}{err\_item}}.key,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00636}00636                              mr-\/>\mbox{\hyperlink{structmlx5__ib__mr_aef14dd5d1c3128819d5d270bedfce0ff}{sig}}-\/>\mbox{\hyperlink{structmlx5__core__sig__ctx_af81ab56d8e51c03c295054a1f272eadf}{err\_item}}.err\_type,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00637}00637                              (\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})mr-\/>\mbox{\hyperlink{structmlx5__ib__mr_aef14dd5d1c3128819d5d270bedfce0ff}{sig}}-\/>\mbox{\hyperlink{structmlx5__core__sig__ctx_af81ab56d8e51c03c295054a1f272eadf}{err\_item}}.sig\_err\_offset,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00638}00638                              mr-\/>\mbox{\hyperlink{structmlx5__ib__mr_aef14dd5d1c3128819d5d270bedfce0ff}{sig}}-\/>\mbox{\hyperlink{structmlx5__core__sig__ctx_af81ab56d8e51c03c295054a1f272eadf}{err\_item}}.expected,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00639}00639                              mr-\/>\mbox{\hyperlink{structmlx5__ib__mr_aef14dd5d1c3128819d5d270bedfce0ff}{sig}}-\/>\mbox{\hyperlink{structmlx5__core__sig__ctx_af81ab56d8e51c03c295054a1f272eadf}{err\_item}}.actual);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00640}00640 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00641}00641                 spin\_unlock\_irqrestore(\&dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_a3361c1d42e64541bf7c71c98149c8cc5}{mr\_table}}.\mbox{\hyperlink{structmlx5__mr__table_a5730e6ace8e7b808769fd919b8d1f1af}{lock}}, flags);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00642}00642                 \textcolor{keywordflow}{goto} repoll;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00643}00643         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00644}00644 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00645}00645         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00646}00646 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00647}00647 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00648}\mbox{\hyperlink{mlx5__ib__cq_8c_aff1dd703f9d37fcc3850899ebd963f45}{00648}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_aff1dd703f9d37fcc3850899ebd963f45}{poll\_soft\_wc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, \textcolor{keywordtype}{int} num\_entries,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00649}00649                         \textcolor{keyword}{struct} ib\_wc *wc)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00650}00650 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00651}00651         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev = \mbox{\hyperlink{mlx5__ib_8h_a1806639f13e6865f0fa7aab4dd3ec6c7}{to\_mdev}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq.device);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00652}00652         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__wc}{mlx5\_ib\_wc}} *soft\_wc, *next;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00653}00653         \textcolor{keywordtype}{int} npolled = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00654}00654 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00655}00655         list\_for\_each\_entry\_safe(soft\_wc, next, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>wc\_list, \mbox{\hyperlink{structmlx5__ib__wc_a355fe35a62a292cc50206b3f60342a40}{list}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00656}00656                 \textcolor{keywordflow}{if} (npolled >= num\_entries)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00657}00657                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00658}00658 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00659}00659                 \mbox{\hyperlink{mlx5__ib_8h_ad0c148e0ae3bd0d552c0f392c473271f}{mlx5\_ib\_dbg}}(dev, \textcolor{stringliteral}{"{}polled software generated completion on CQ 0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00660}00660                             \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_aa4a997291e120b040c7a95d59639e62a}{cqn}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00661}00661 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00662}00662                 \mbox{\hyperlink{structmlx5__ib__wc_ada1068596e0a3b498390336d6f55ebb3}{wc}}[npolled++] = soft\_wc-\/>\mbox{\hyperlink{structmlx5__ib__wc_ada1068596e0a3b498390336d6f55ebb3}{wc}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00663}00663                 list\_del(\&soft\_wc-\/>\mbox{\hyperlink{structmlx5__ib__wc_a355fe35a62a292cc50206b3f60342a40}{list}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00664}00664                 kfree(soft\_wc);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00665}00665         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00666}00666 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00667}00667         \textcolor{keywordflow}{return} npolled;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00668}00668 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00669}00669 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00670}\mbox{\hyperlink{mlx5__ib_8h_af0d267961c810844465216e062bd09d8}{00670}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_af0d267961c810844465216e062bd09d8}{mlx5\_ib\_poll\_cq}}(\textcolor{keyword}{struct} ib\_cq *ibcq, \textcolor{keywordtype}{int} num\_entries, \textcolor{keyword}{struct} ib\_wc *\mbox{\hyperlink{structmlx5__ib__wc_ada1068596e0a3b498390336d6f55ebb3}{wc}})}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00671}00671 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00672}00672         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}} = \mbox{\hyperlink{mlx5__ib_8h_a3f1e6fd123a26621fe1de5993fc033f7}{to\_mcq}}(\mbox{\hyperlink{structmlx5__ib__cq_a8d54c698aa989c1c47047b15c1540b02}{ibcq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00673}00673         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__qp}{mlx5\_ib\_qp}} *cur\_qp = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00674}00674         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev = \mbox{\hyperlink{mlx5__ib_8h_a1806639f13e6865f0fa7aab4dd3ec6c7}{to\_mdev}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq.device);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00675}00675         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev = dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00676}00676         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} flags;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00677}00677         \textcolor{keywordtype}{int} soft\_polled = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00678}00678         \textcolor{keywordtype}{int} npolled;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00679}00679 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00680}00680         spin\_lock\_irqsave(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00681}00681         \textcolor{keywordflow}{if} (unlikely(mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_aaee056f22d7ec1c4298ffb20189ec7e5}{state}} == \mbox{\hyperlink{driver_8h_aa42b19437cec785545106d8c76e3d9dda09cf6fffb12218a75a5f45b789ce5c62}{MLX5\_DEVICE\_STATE\_INTERNAL\_ERROR}})) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00682}00682                 \mbox{\hyperlink{mlx5__ib__cq_8c_aea34d4a9c800529fa8231433f292c297}{mlx5\_ib\_poll\_sw\_comp}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, num\_entries, wc, \&npolled);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00683}00683                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00684}00684         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00685}00685 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00686}00686         \textcolor{keywordflow}{if} (unlikely(!list\_empty(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>wc\_list)))}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00687}00687                 soft\_polled = \mbox{\hyperlink{mlx5__ib__cq_8c_aff1dd703f9d37fcc3850899ebd963f45}{poll\_soft\_wc}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, num\_entries, wc);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00688}00688 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00689}00689         \textcolor{keywordflow}{for} (npolled = 0; npolled < num\_entries -\/ soft\_polled; npolled++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00690}00690                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{mlx5__ib__cq_8c_a2811b8ed1a370c2f8cd2fe78dac76bc3}{mlx5\_poll\_one}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, \&cur\_qp, wc + soft\_polled + npolled))}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00691}00691                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00692}00692         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00693}00693 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00694}00694         \textcolor{keywordflow}{if} (npolled)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00695}00695                 \mbox{\hyperlink{cq_8h_ae7e9ad2aa76df79fbbf0873f46b1ef7c}{mlx5\_cq\_set\_ci}}(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00696}00696 out:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00697}00697         spin\_unlock\_irqrestore(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00698}00698 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00699}00699         \textcolor{keywordflow}{return} soft\_polled + npolled;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00700}00700 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00701}00701 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00702}\mbox{\hyperlink{mlx5__ib_8h_a9e4ec09a862a84c9f0cc81b81c67b15d}{00702}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_a9e4ec09a862a84c9f0cc81b81c67b15d}{mlx5\_ib\_arm\_cq}}(\textcolor{keyword}{struct} ib\_cq *ibcq, \textcolor{keyword}{enum} ib\_cq\_notify\_flags flags)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00703}00703 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00704}00704         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev = \mbox{\hyperlink{mlx5__ib_8h_a1806639f13e6865f0fa7aab4dd3ec6c7}{to\_mdev}}(ibcq-\/>device)-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00705}00705         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}} = \mbox{\hyperlink{mlx5__ib_8h_a3f1e6fd123a26621fe1de5993fc033f7}{to\_mcq}}(\mbox{\hyperlink{structmlx5__ib__cq_a8d54c698aa989c1c47047b15c1540b02}{ibcq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00706}00706         \textcolor{keywordtype}{void} \_\_iomem *uar\_page = mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_ac476fb1d38cdac2b8f6cee43aa25c2dd}{uar}}-\/>\mbox{\hyperlink{structmlx5__uars__page_a9b63936588412053d28c8a32165b8ab9}{map}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00707}00707         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} irq\_flags;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00708}00708         \textcolor{keywordtype}{int} ret = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00709}00709 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00710}00710         \textcolor{keywordflow}{if} (unlikely(mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_aaee056f22d7ec1c4298ffb20189ec7e5}{state}} == \mbox{\hyperlink{driver_8h_aa42b19437cec785545106d8c76e3d9dda09cf6fffb12218a75a5f45b789ce5c62}{MLX5\_DEVICE\_STATE\_INTERNAL\_ERROR}}))}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00711}00711                 \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00712}00712 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00713}00713         spin\_lock\_irqsave(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>lock, irq\_flags);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00714}00714         \textcolor{keywordflow}{if} (\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>notify\_flags != IB\_CQ\_NEXT\_COMP)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00715}00715                 \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>notify\_flags = flags \& IB\_CQ\_SOLICITED\_MASK;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00716}00716 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00717}00717         \textcolor{keywordflow}{if} ((flags \& IB\_CQ\_REPORT\_MISSED\_EVENTS) \&\& !list\_empty(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>wc\_list))}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00718}00718                 ret = 1;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00719}00719         spin\_unlock\_irqrestore(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>lock, irq\_flags);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00720}00720 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00721}00721         \mbox{\hyperlink{cq_8h_a9b62d79172a706d5616363654ffdc0be}{mlx5\_cq\_arm}}(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00722}00722                     (flags \& IB\_CQ\_SOLICITED\_MASK) == IB\_CQ\_SOLICITED ?}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00723}00723                     \mbox{\hyperlink{cq_8h_adc29c2ff13d900c2f185ee95427fb06ca44c39002efff03aa0c4d993d5cee0399}{MLX5\_CQ\_DB\_REQ\_NOT\_SOL}} : \mbox{\hyperlink{cq_8h_adc29c2ff13d900c2f185ee95427fb06ca335efec9cc6e8fb8f55bc662d60f54dd}{MLX5\_CQ\_DB\_REQ\_NOT}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00724}00724                     uar\_page,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00725}00725                     \mbox{\hyperlink{doorbell_8h_ab8aa70fd78380f89ef76837858b16bd9}{MLX5\_GET\_DOORBELL\_LOCK}}(\&mdev-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.cq\_uar\_lock),}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00726}00726                     \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_afb2887dc8c075ba41ca2e359dbcfdde2}{cons\_index}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00727}00727 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00728}00728         \textcolor{keywordflow}{return} ret;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00729}00729 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00730}00730 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00731}\mbox{\hyperlink{mlx5__ib__cq_8c_a07a35b5d95ae1f3f50a31c3e1ea6d9d7}{00731}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_a07a35b5d95ae1f3f50a31c3e1ea6d9d7}{alloc\_cq\_buf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq__buf}{mlx5\_ib\_cq\_buf}} *\mbox{\hyperlink{structmlx5__ib__cq_af8569ff8325d98105be6ae3e3f334a66}{buf}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00732}00732                         \textcolor{keywordtype}{int} nent, \textcolor{keywordtype}{int} \mbox{\hyperlink{structmlx5__ib__cq_a721fd7db86e331ac395f3286f6090906}{cqe\_size}})}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00733}00733 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00734}00734         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00735}00735 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00736}00736         err = \mbox{\hyperlink{driver_8h_aa8d46364cdf04a52c6e6c31165fcf07a}{mlx5\_buf\_alloc}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, nent * \mbox{\hyperlink{structmlx5__ib__cq_a721fd7db86e331ac395f3286f6090906}{cqe\_size}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00737}00737             2 * PAGE\_SIZE, \&\mbox{\hyperlink{structmlx5__ib__cq_af8569ff8325d98105be6ae3e3f334a66}{buf}}-\/>\mbox{\hyperlink{structmlx5__ib__cq__buf_a29729d4f468db77f10e05db04abe66ef}{buf}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00738}00738         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00739}00739                 \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00740}00740 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00741}00741         \mbox{\hyperlink{structmlx5__ib__cq_af8569ff8325d98105be6ae3e3f334a66}{buf}}-\/>\mbox{\hyperlink{structmlx5__ib__cq__buf_a99787d404af2ea2d5e0610860215d23f}{cqe\_size}} = \mbox{\hyperlink{structmlx5__ib__cq_a721fd7db86e331ac395f3286f6090906}{cqe\_size}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00742}00742         \mbox{\hyperlink{structmlx5__ib__cq_af8569ff8325d98105be6ae3e3f334a66}{buf}}-\/>\mbox{\hyperlink{structmlx5__ib__cq__buf_a8ed6d223e27e32920c3c57f7d3089f86}{nent}} = nent;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00743}00743 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00744}00744         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00745}00745 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00746}00746 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00747}\mbox{\hyperlink{mlx5__ib__cq_8c_a2258e6ca7cb8be4c49c5f8a0b18abc9c}{00747}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_a2258e6ca7cb8be4c49c5f8a0b18abc9c}{create\_cq\_user}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev, \textcolor{keyword}{struct} ib\_udata *udata,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00748}00748                           \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, \textcolor{keywordtype}{int} entries, u32 **cqb,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00749}00749                           \textcolor{keywordtype}{int} *\mbox{\hyperlink{structmlx5__ib__cq_a721fd7db86e331ac395f3286f6090906}{cqe\_size}}, \textcolor{keywordtype}{int} *index, \textcolor{keywordtype}{int} *inlen)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00750}00750 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00751}00751         \textcolor{keyword}{struct }\mbox{\hyperlink{mlx5__ib__cq_8c_a19f4d5f031a713cf3cfa85e31e5a139c}{mlx5\_ib\_create\_cq}} ucmd = \{\};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00752}00752         \textcolor{keywordtype}{size\_t} ucmdlen;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00753}00753         \textcolor{keywordtype}{int} page\_shift;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00754}00754         \_\_be64 *pas;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00755}00755         \textcolor{keywordtype}{int} npages;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00756}00756         \textcolor{keywordtype}{int} ncont;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00757}00757         \textcolor{keywordtype}{void} *cqc;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00758}00758         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00759}00759         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__ucontext}{mlx5\_ib\_ucontext}} *context = rdma\_udata\_to\_drv\_context(}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00760}00760                 udata, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__ucontext}{mlx5\_ib\_ucontext}}, \mbox{\hyperlink{structmlx5__ib__ucontext_a24d3d8689a016cb4244d05e9a2453882}{ibucontext}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00761}00761 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00762}00762         ucmdlen = min(udata-\/>inlen, \textcolor{keyword}{sizeof}(ucmd));}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00763}00763         \textcolor{keywordflow}{if} (ucmdlen < offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{mlx5__ib__cq_8c_a19f4d5f031a713cf3cfa85e31e5a139c}{mlx5\_ib\_create\_cq}}, flags))}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00764}00764                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00765}00765 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00766}00766         \textcolor{keywordflow}{if} (ib\_copy\_from\_udata(\&ucmd, udata, ucmdlen))}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00767}00767                 \textcolor{keywordflow}{return} -\/EFAULT;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00768}00768 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00769}00769         \textcolor{keywordflow}{if} ((ucmd.flags \& \string~(MLX5\_IB\_CREATE\_CQ\_FLAGS\_UAR\_PAGE\_INDEX)))}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00770}00770                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00771}00771 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00772}00772         \textcolor{keywordflow}{if} (ucmd.cqe\_size != 64 \&\& ucmd.cqe\_size != 128)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00773}00773                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00774}00774 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00775}00775         *cqe\_size = ucmd.cqe\_size;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00776}00776 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00777}00777         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf.umem = ib\_umem\_get(\&context-\/>\mbox{\hyperlink{structmlx5__ib__ucontext_a24d3d8689a016cb4244d05e9a2453882}{ibucontext}}, ucmd.buf\_addr,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00778}00778                                    entries * ucmd.cqe\_size,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00779}00779                                    IB\_ACCESS\_LOCAL\_WRITE, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00780}00780         \textcolor{keywordflow}{if} (IS\_ERR(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf.umem)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00781}00781                 err = PTR\_ERR(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf.umem);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00782}00782                 \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00783}00783         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00784}00784 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00785}00785         err = \mbox{\hyperlink{mlx5__ib_8h_a238cfb961f2177ad859f02afc2f1941e}{mlx5\_ib\_db\_map\_user}}(context, ucmd.db\_addr,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00786}00786                                   \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>db);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00787}00787         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00788}00788                 \textcolor{keywordflow}{goto} err\_umem;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00789}00789 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00790}00790         \mbox{\hyperlink{mlx5__ib_8h_a078af05e9a50b56546252df6754917b9}{mlx5\_ib\_cont\_pages}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf.umem, ucmd.buf\_addr, 0, \&npages, \&page\_shift,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00791}00791                            \&ncont, NULL);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00792}00792         \mbox{\hyperlink{mlx5__ib_8h_ad0c148e0ae3bd0d552c0f392c473271f}{mlx5\_ib\_dbg}}(dev, \textcolor{stringliteral}{"{}addr 0x\%llx, size \%u, npages \%d, page\_shift \%d, ncont \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00793}00793                     (\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})ucmd.buf\_addr, entries * ucmd.cqe\_size, npages, page\_shift, ncont);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00794}00794 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00795}00795         *inlen = \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(create\_cq\_in) +}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00796}00796                  \mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(create\_cq\_in, pas[0]) * ncont;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00797}00797         *cqb = \mbox{\hyperlink{driver_8h_af928b1985830513c1c81b095b31ad8a7}{mlx5\_vzalloc}}(*inlen);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00798}00798         \textcolor{keywordflow}{if} (!*cqb) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00799}00799                 err = -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00800}00800                 \textcolor{keywordflow}{goto} err\_db;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00801}00801         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00802}00802 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00803}00803         pas = (\_\_be64 *)\mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(create\_cq\_in, *cqb, pas);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00804}00804         \mbox{\hyperlink{mlx5__ib_8h_aa632996b34ed7613321620a079856f8e}{mlx5\_ib\_populate\_pas}}(dev, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf.umem, page\_shift, pas, 0);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00805}00805 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00806}00806         cqc = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(create\_cq\_in, *cqb, cq\_context);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00807}00807         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(cqc, cqc, log\_page\_size,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00808}00808                  page\_shift -\/ \mbox{\hyperlink{device_8h_aae05225933a42f81e7c4a9fb286596f9aa4614720009368aaf55770e64acced36}{MLX5\_ADAPTER\_PAGE\_SHIFT}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00809}00809 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00810}00810         \textcolor{keywordflow}{if} (ucmd.flags \& MLX5\_IB\_CREATE\_CQ\_FLAGS\_UAR\_PAGE\_INDEX) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00811}00811                 *index = ucmd.uar\_page\_index;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00812}00812         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (context-\/>\mbox{\hyperlink{structmlx5__ib__ucontext_a2ea7d21b52e241f9879be5f5dc0a3473}{bfregi}}.\mbox{\hyperlink{structmlx5__bfreg__info_ae0fc23d02bf4b0c5c0912b672f3027a9}{lib\_uar\_dyn}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00813}00813                 err = -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00814}00814                 \textcolor{keywordflow}{goto} err\_cqb;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00815}00815         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00816}00816                 *index = context-\/>\mbox{\hyperlink{structmlx5__ib__ucontext_a2ea7d21b52e241f9879be5f5dc0a3473}{bfregi}}.\mbox{\hyperlink{structmlx5__bfreg__info_a3bcdae676f20afb9aed7bc6f208c1941}{sys\_pages}}[0];}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00817}00817         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00818}00818 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00819}00819         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_cq\_in, *cqb, uid, context-\/>\mbox{\hyperlink{structmlx5__ib__ucontext_a8cccfb39980840fe3c7dae623a96f708}{devx\_uid}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00820}00820         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00821}00821 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00822}00822 err\_cqb:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00823}00823         kvfree(*cqb);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00824}00824 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00825}00825 err\_db:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00826}00826         \mbox{\hyperlink{mlx5__ib_8h_a3fb9708bf403ffbb6fc43e42ed9cca02}{mlx5\_ib\_db\_unmap\_user}}(context, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>db);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00827}00827 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00828}00828 err\_umem:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00829}00829         ib\_umem\_release(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf.umem);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00830}00830         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00831}00831 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00832}00832 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00833}\mbox{\hyperlink{mlx5__ib__cq_8c_af16a0897337ae7f1620a7af27f0415ff}{00833}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_af16a0897337ae7f1620a7af27f0415ff}{destroy\_cq\_user}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, \textcolor{keyword}{struct} ib\_udata *udata)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00834}00834 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00835}00835         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__ucontext}{mlx5\_ib\_ucontext}} *context = rdma\_udata\_to\_drv\_context(}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00836}00836                 udata, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__ucontext}{mlx5\_ib\_ucontext}}, \mbox{\hyperlink{structmlx5__ib__ucontext_a24d3d8689a016cb4244d05e9a2453882}{ibucontext}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00837}00837 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00838}00838         \mbox{\hyperlink{mlx5__ib_8h_a3fb9708bf403ffbb6fc43e42ed9cca02}{mlx5\_ib\_db\_unmap\_user}}(context, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>db);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00839}00839         ib\_umem\_release(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf.umem);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00840}00840 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00841}00841 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00842}\mbox{\hyperlink{mlx5__ib__cq_8c_a70157d12ba631d32c2edd844f644b3cc}{00842}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_a70157d12ba631d32c2edd844f644b3cc}{init\_cq\_buf}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq__buf}{mlx5\_ib\_cq\_buf}} *buf)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00843}00843 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00844}00844         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00845}00845         \textcolor{keywordtype}{void} *cqe;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00846}00846         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__cqe64}{mlx5\_cqe64}} *cqe64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00847}00847 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00848}00848         \textcolor{keywordflow}{for} (i = 0; i < buf-\/>\mbox{\hyperlink{structmlx5__ib__cq__buf_a8ed6d223e27e32920c3c57f7d3089f86}{nent}}; i++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00849}00849                 cqe = \mbox{\hyperlink{mlx5__ib__cq_8c_a0816a16a8c95dbb0e379248cc6ab654f}{get\_cqe\_from\_buf}}(buf, i, buf-\/>\mbox{\hyperlink{structmlx5__ib__cq__buf_a99787d404af2ea2d5e0610860215d23f}{cqe\_size}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00850}00850                 cqe64 = buf-\/>\mbox{\hyperlink{structmlx5__ib__cq__buf_a99787d404af2ea2d5e0610860215d23f}{cqe\_size}} == 64 ? cqe : cqe + 64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00851}00851                 cqe64-\/>\mbox{\hyperlink{structmlx5__cqe64_a3dbb1dc2c9f2ee64863edf7f750f5885}{op\_own}} = \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a040ca8ae114748853a108b181d3dadca}{MLX5\_CQE\_INVALID}} << 4;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00852}00852         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00853}00853 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00854}00854 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00855}\mbox{\hyperlink{mlx5__ib__cq_8c_a44d45b8a4a15b3a43fb8776a1e05399f}{00855}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_a44d45b8a4a15b3a43fb8776a1e05399f}{create\_cq\_kernel}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00856}00856                             \textcolor{keywordtype}{int} entries, \textcolor{keywordtype}{int} cqe\_size,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00857}00857                             u32 **cqb, \textcolor{keywordtype}{int} *index, \textcolor{keywordtype}{int} *inlen)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00858}00858 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00859}00859         \_\_be64 *pas;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00860}00860         \textcolor{keywordtype}{void} *cqc;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00861}00861         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00862}00862 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00863}00863         err = \mbox{\hyperlink{driver_8h_a1c040bdd9b0bde54fe40b0dd0e760b19}{mlx5\_db\_alloc}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>db);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00864}00864         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00865}00865                 \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00866}00866 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00867}00867         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_a1feaf10833bbd5fe6686d52108e0fd70}{set\_ci\_db}}  = \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>db.db;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00868}00868         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_a1a441188f2c4f406e29bdc804fea49c3}{arm\_db}}     = \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>db.db + 1;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00869}00869         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_a458436764ec16a503d3e3fbb1457b394}{cqe\_sz}} = cqe\_size;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00870}00870 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00871}00871         err = \mbox{\hyperlink{mlx5__ib__cq_8c_a07a35b5d95ae1f3f50a31c3e1ea6d9d7}{alloc\_cq\_buf}}(dev, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf, entries, cqe\_size);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00872}00872         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00873}00873                 \textcolor{keywordflow}{goto} err\_db;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00874}00874 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00875}00875         \mbox{\hyperlink{mlx5__ib__cq_8c_a70157d12ba631d32c2edd844f644b3cc}{init\_cq\_buf}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00876}00876 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00877}00877         *inlen = \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(create\_cq\_in) +}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00878}00878                  \mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(create\_cq\_in, pas[0]) * \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf.buf.npages;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00879}00879         *cqb = \mbox{\hyperlink{driver_8h_af928b1985830513c1c81b095b31ad8a7}{mlx5\_vzalloc}}(*inlen);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00880}00880         \textcolor{keywordflow}{if} (!*cqb) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00881}00881                 err = -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00882}00882                 \textcolor{keywordflow}{goto} err\_buf;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00883}00883         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00884}00884 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00885}00885         pas = (\_\_be64 *)\mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(create\_cq\_in, *cqb, pas);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00886}00886         \mbox{\hyperlink{driver_8h_adbd58dd0790cfdfce0e245704e92deec}{mlx5\_fill\_page\_array}}(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf.buf, pas);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00887}00887 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00888}00888         cqc = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(create\_cq\_in, *cqb, cq\_context);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00889}00889         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(cqc, cqc, log\_page\_size,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00890}00890                  \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf.buf.page\_shift -\/ \mbox{\hyperlink{device_8h_aae05225933a42f81e7c4a9fb286596f9aa4614720009368aaf55770e64acced36}{MLX5\_ADAPTER\_PAGE\_SHIFT}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00891}00891 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00892}00892         *index = dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_ac476fb1d38cdac2b8f6cee43aa25c2dd}{uar}}-\/>\mbox{\hyperlink{structmlx5__uars__page_a69d90f44b52999c724e78c9b76393da6}{index}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00893}00893 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00894}00894         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00895}00895 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00896}00896 err\_buf:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00897}00897         \mbox{\hyperlink{mlx5__ib__cq_8c_a85123e49ea547174ddf7ee5ed7de8009}{free\_cq\_buf}}(dev, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00898}00898 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00899}00899 err\_db:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00900}00900         \mbox{\hyperlink{driver_8h_a7ba1d84f90bdf82c2bc0eba76a445e24}{mlx5\_db\_free}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>db);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00901}00901         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00902}00902 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00903}00903 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00904}\mbox{\hyperlink{mlx5__ib__cq_8c_a67c532ee95cbb08842a3566e3f4116e7}{00904}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_a67c532ee95cbb08842a3566e3f4116e7}{destroy\_cq\_kernel}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}})}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00905}00905 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00906}00906         \mbox{\hyperlink{mlx5__ib__cq_8c_a85123e49ea547174ddf7ee5ed7de8009}{free\_cq\_buf}}(dev, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00907}00907         \mbox{\hyperlink{driver_8h_a7ba1d84f90bdf82c2bc0eba76a445e24}{mlx5\_db\_free}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>db);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00908}00908 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00909}00909 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00910}\mbox{\hyperlink{mlx5__ib__cq_8c_a124c59e42a04ed0c15674deec3a169b5}{00910}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_a124c59e42a04ed0c15674deec3a169b5}{notify\_soft\_wc\_handler}}(\textcolor{keyword}{struct} work\_struct *\mbox{\hyperlink{en__hw__tls_8h_a623997e11b94d7c467ce26627cc488a2}{work}})}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00911}00911 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00912}00912         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}} = container\_of(\mbox{\hyperlink{en__hw__tls_8h_a623997e11b94d7c467ce26627cc488a2}{work}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00913}00913                                              \mbox{\hyperlink{structmlx5__ib__cq_ab80838930fe0bfe7d768aeaa71f1f95e}{notify\_work}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00914}00914 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00915}00915         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq.comp\_handler(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq.cq\_context);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00916}00916 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00917}00917 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00918}\mbox{\hyperlink{mlx5__ib_8h_a19f4d5f031a713cf3cfa85e31e5a139c}{00918}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_a19f4d5f031a713cf3cfa85e31e5a139c}{mlx5\_ib\_create\_cq}}(\textcolor{keyword}{struct} ib\_cq *\mbox{\hyperlink{structmlx5__ib__cq_a8d54c698aa989c1c47047b15c1540b02}{ibcq}}, \textcolor{keyword}{const} \textcolor{keyword}{struct} ib\_cq\_init\_attr *attr,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00919}00919                       \textcolor{keyword}{struct} ib\_udata *udata)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00920}00920 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00921}00921         \textcolor{keyword}{struct }ib\_device *ibdev = ibcq-\/>device;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00922}00922         \textcolor{keywordtype}{int} entries = attr-\/>cqe;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00923}00923         \textcolor{keywordtype}{int} vector = attr-\/>comp\_vector;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00924}00924         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev = \mbox{\hyperlink{mlx5__ib_8h_a1806639f13e6865f0fa7aab4dd3ec6c7}{to\_mdev}}(ibdev);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00925}00925         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(create\_cq\_out)];}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00926}00926         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}} = \mbox{\hyperlink{mlx5__ib_8h_a3f1e6fd123a26621fe1de5993fc033f7}{to\_mcq}}(\mbox{\hyperlink{structmlx5__ib__cq_a8d54c698aa989c1c47047b15c1540b02}{ibcq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00927}00927         \textcolor{keywordtype}{int} uninitialized\_var(index);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00928}00928         \textcolor{keywordtype}{int} uninitialized\_var(inlen);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00929}00929         u32 *cqb = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00930}00930         \textcolor{keywordtype}{void} *cqc;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00931}00931         \textcolor{keywordtype}{int} \mbox{\hyperlink{structmlx5__ib__cq_a721fd7db86e331ac395f3286f6090906}{cqe\_size}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00932}00932         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} irqn;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00933}00933         \textcolor{keywordtype}{int} eqn;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00934}00934         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00935}00935 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00936}00936         \textcolor{keywordflow}{if} (entries < 0 ||}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00937}00937             (entries > (1 << \mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, log\_max\_cq\_sz))))}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00938}00938                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00939}00939 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00940}00940         \textcolor{keywordflow}{if} (\mbox{\hyperlink{mlx5__ib_8h_ac148402c80262a07ad9cfcf120fe8f47}{check\_cq\_create\_flags}}(attr-\/>flags))}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00941}00941                 \textcolor{keywordflow}{return} -\/EOPNOTSUPP;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00942}00942 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00943}00943         entries = roundup\_pow\_of\_two(entries + 1);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00944}00944         \textcolor{keywordflow}{if} (entries > (1 << \mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, log\_max\_cq\_sz)))}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00945}00945                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00946}00946 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00947}00947         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq.cqe = entries -\/ 1;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00948}00948         mutex\_init(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_mutex);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00949}00949         spin\_lock\_init(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>lock);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00950}00950         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00951}00951         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_umem = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00952}00952         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>create\_flags = attr-\/>flags;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00953}00953         INIT\_LIST\_HEAD(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>list\_send\_qp);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00954}00954         INIT\_LIST\_HEAD(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>list\_recv\_qp);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00955}00955 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00956}00956         \textcolor{keywordflow}{if} (udata) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00957}00957                 err = \mbox{\hyperlink{mlx5__ib__cq_8c_a2258e6ca7cb8be4c49c5f8a0b18abc9c}{create\_cq\_user}}(dev, udata, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, entries, \&cqb, \&\mbox{\hyperlink{structmlx5__ib__cq_a721fd7db86e331ac395f3286f6090906}{cqe\_size}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00958}00958                                      \&index, \&inlen);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00959}00959                 \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00960}00960                         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00961}00961         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00962}00962                 \mbox{\hyperlink{structmlx5__ib__cq_a721fd7db86e331ac395f3286f6090906}{cqe\_size}} = cache\_line\_size() == 128 ? 128 : 64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00963}00963                 err = \mbox{\hyperlink{mlx5__ib__cq_8c_a44d45b8a4a15b3a43fb8776a1e05399f}{create\_cq\_kernel}}(dev, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, entries, \mbox{\hyperlink{structmlx5__ib__cq_a721fd7db86e331ac395f3286f6090906}{cqe\_size}}, \&cqb,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00964}00964                                        \&index, \&inlen);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00965}00965                 \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00966}00966                         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00967}00967 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00968}00968                 INIT\_WORK(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>notify\_work, \mbox{\hyperlink{mlx5__ib__cq_8c_a124c59e42a04ed0c15674deec3a169b5}{notify\_soft\_wc\_handler}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00969}00969         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00970}00970 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00971}00971         err = \mbox{\hyperlink{driver_8h_aeaccd90e6d73c5463f84985214248baa}{mlx5\_vector2eqn}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, vector, \&eqn, \&irqn);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00972}00972         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00973}00973                 \textcolor{keywordflow}{goto} err\_cqb;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00974}00974 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00975}00975         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cqe\_size = \mbox{\hyperlink{structmlx5__ib__cq_a721fd7db86e331ac395f3286f6090906}{cqe\_size}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00976}00976 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00977}00977         cqc = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(create\_cq\_in, cqb, cq\_context);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00978}00978         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(cqc, cqc, cqe\_sz, \mbox{\hyperlink{cq_8h_afc92b60f02a50d2f48fb60a78e6dd0de}{cqe\_sz\_to\_mlx\_sz}}(\mbox{\hyperlink{structmlx5__ib__cq_a721fd7db86e331ac395f3286f6090906}{cqe\_size}}));}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00979}00979         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(cqc, cqc, log\_cq\_size, ilog2(entries));}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00980}00980         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(cqc, cqc, uar\_page, index);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00981}00981         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(cqc, cqc, c\_eqn, eqn);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00982}00982         \mbox{\hyperlink{device_8h_a6e7776ca1e3178584753950058580eb6}{MLX5\_SET64}}(cqc, cqc, dbr\_addr, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>db.dma);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00983}00983         \textcolor{keywordflow}{if} (\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>create\_flags \& IB\_CQ\_FLAGS\_IGNORE\_OVERRUN)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00984}00984                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(cqc, cqc, oi, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00985}00985 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00986}00986         err = \mbox{\hyperlink{cq_8h_aea2bfcf5366ba54470890849d731ec22}{mlx5\_core\_create\_cq}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}, cqb, inlen, out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00987}00987         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00988}00988                 \textcolor{keywordflow}{goto} err\_cqb;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00989}00989 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00990}00990         \mbox{\hyperlink{mlx5__ib_8h_ad0c148e0ae3bd0d552c0f392c473271f}{mlx5\_ib\_dbg}}(dev, \textcolor{stringliteral}{"{}cqn 0x\%x\(\backslash\)n"{}}, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_aa4a997291e120b040c7a95d59639e62a}{cqn}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00991}00991         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_a11efe15093ea834e41b4c8a217bc7abe}{irqn}} = irqn;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00992}00992         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_a7fd008e4e7eb4f052083824c0a0d7589}{comp}}  = \mbox{\hyperlink{mlx5__ib__cq_8c_a14d4b218307852d3a414934f1ddf1beb}{mlx5\_ib\_cq\_comp}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00993}00993         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_a79af75889dbfdd02e154cece0f670a23}{event}} = \mbox{\hyperlink{mlx5__ib__cq_8c_a897e56934b000056b937f318c6a9a267}{mlx5\_ib\_cq\_event}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00994}00994 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00995}00995         INIT\_LIST\_HEAD(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>wc\_list);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00996}00996 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00997}00997         \textcolor{keywordflow}{if} (udata)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00998}00998                 \textcolor{keywordflow}{if} (ib\_copy\_to\_udata(udata, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_aa4a997291e120b040c7a95d59639e62a}{cqn}}, \textcolor{keyword}{sizeof}(\_\_u32))) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l00999}00999                         err = -\/EFAULT;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01000}01000                         \textcolor{keywordflow}{goto} err\_cmd;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01001}01001                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01002}01002 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01003}01003 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01004}01004         kvfree(cqb);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01005}01005         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01006}01006 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01007}01007 err\_cmd:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01008}01008         \mbox{\hyperlink{cq_8h_ada3ee9d5d56150686d9f6a2ca3a7af84}{mlx5\_core\_destroy\_cq}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01009}01009 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01010}01010 err\_cqb:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01011}01011         kvfree(cqb);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01012}01012         \textcolor{keywordflow}{if} (udata)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01013}01013                 \mbox{\hyperlink{mlx5__ib__cq_8c_af16a0897337ae7f1620a7af27f0415ff}{destroy\_cq\_user}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, udata);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01014}01014         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01015}01015                 \mbox{\hyperlink{mlx5__ib__cq_8c_a67c532ee95cbb08842a3566e3f4116e7}{destroy\_cq\_kernel}}(dev, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01016}01016         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01017}01017 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01018}01018 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01019}\mbox{\hyperlink{mlx5__ib_8h_a895f65c96ea4e4775f22a9f52f8c2561}{01019}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_a895f65c96ea4e4775f22a9f52f8c2561}{mlx5\_ib\_destroy\_cq}}(\textcolor{keyword}{struct} ib\_cq *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, \textcolor{keyword}{struct} ib\_udata *udata)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01020}01020 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01021}01021         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev = \mbox{\hyperlink{mlx5__ib_8h_a1806639f13e6865f0fa7aab4dd3ec6c7}{to\_mdev}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>device);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01022}01022         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_af69a66154472918b7d1481f1b1d974c8}{mcq}} = \mbox{\hyperlink{mlx5__ib_8h_a3f1e6fd123a26621fe1de5993fc033f7}{to\_mcq}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01023}01023 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01024}01024         \mbox{\hyperlink{cq_8h_ada3ee9d5d56150686d9f6a2ca3a7af84}{mlx5\_core\_destroy\_cq}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, \&\mbox{\hyperlink{en_8h_af69a66154472918b7d1481f1b1d974c8}{mcq}}-\/>mcq);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01025}01025         \textcolor{keywordflow}{if} (udata)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01026}01026                 \mbox{\hyperlink{mlx5__ib__cq_8c_af16a0897337ae7f1620a7af27f0415ff}{destroy\_cq\_user}}(\mbox{\hyperlink{en_8h_af69a66154472918b7d1481f1b1d974c8}{mcq}}, udata);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01027}01027         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01028}01028                 \mbox{\hyperlink{mlx5__ib__cq_8c_a67c532ee95cbb08842a3566e3f4116e7}{destroy\_cq\_kernel}}(dev, \mbox{\hyperlink{en_8h_af69a66154472918b7d1481f1b1d974c8}{mcq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01029}01029 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01030}01030 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01031}\mbox{\hyperlink{mlx5__ib__cq_8c_a22f55625368eecd19bd6f5c5b1e18d73}{01031}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_a22f55625368eecd19bd6f5c5b1e18d73}{is\_equal\_rsn}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__cqe64}{mlx5\_cqe64}} *cqe64, u32 rsn)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01032}01032 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01033}01033         \textcolor{keywordflow}{return} rsn == (ntohl(cqe64-\/>\mbox{\hyperlink{structmlx5__cqe64_ad6fa2d0b532424a656f4a6769961ef58}{sop\_drop\_qpn}}) \& 0xffffff);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01034}01034 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01035}01035 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01036}\mbox{\hyperlink{mlx5__ib_8h_a5c71b0b9ab631cdb1a53913ab6263e29}{01036}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_a2e81a7e2dfeee169d619d30664dfdb18}{\_\_mlx5\_ib\_cq\_clean}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, u32 rsn, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__srq}{mlx5\_ib\_srq}} *srq)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01037}01037 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01038}01038         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__cqe64}{mlx5\_cqe64}} *cqe64, *dest64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01039}01039         \textcolor{keywordtype}{void} *cqe, *dest;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01040}01040         u32 prod\_index;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01041}01041         \textcolor{keywordtype}{int} nfreed = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01042}01042         u8 owner\_bit;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01043}01043 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01044}01044         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}})}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01045}01045                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01046}01046 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01047}01047         \textcolor{comment}{/* First we need to find the current producer index, so we}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01048}01048 \textcolor{comment}{         * know where to start cleaning from.  It doesn't matter if HW}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01049}01049 \textcolor{comment}{         * adds new entries after this loop -\/-\/ the QP we're worried}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01050}01050 \textcolor{comment}{         * about is already in RESET, so the new entries won't come}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01051}01051 \textcolor{comment}{         * from our QP and therefore don't need to be checked.}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01052}01052 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01053}01053         \textcolor{keywordflow}{for} (prod\_index = \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_afb2887dc8c075ba41ca2e359dbcfdde2}{cons\_index}}; \mbox{\hyperlink{mlx5__ib__cq_8c_a48c3a821c73d2ca5653a45907f812d88}{get\_sw\_cqe}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, prod\_index); prod\_index++)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01054}01054                 \textcolor{keywordflow}{if} (prod\_index == \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_afb2887dc8c075ba41ca2e359dbcfdde2}{cons\_index}} + \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq.cqe)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01055}01055                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01056}01056 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01057}01057         \textcolor{comment}{/* Now sweep backwards through the CQ, removing CQ entries}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01058}01058 \textcolor{comment}{         * that match our QP by copying older entries on top of them.}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01059}01059 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01060}01060         \textcolor{keywordflow}{while} ((\textcolor{keywordtype}{int}) -\/-\/prod\_index -\/ (\textcolor{keywordtype}{int}) \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_afb2887dc8c075ba41ca2e359dbcfdde2}{cons\_index}} >= 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01061}01061                 cqe = \mbox{\hyperlink{mlx5__ib__cq_8c_a23ca4da078bd890da65b067bb1d9f065}{get\_cqe}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, prod\_index \& \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq.cqe);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01062}01062                 cqe64 = (\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_a458436764ec16a503d3e3fbb1457b394}{cqe\_sz}} == 64) ? cqe : cqe + 64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01063}01063                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{mlx5__ib__cq_8c_a22f55625368eecd19bd6f5c5b1e18d73}{is\_equal\_rsn}}(cqe64, rsn)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01064}01064                         \textcolor{keywordflow}{if} (srq \&\& (ntohl(cqe64-\/>\mbox{\hyperlink{structmlx5__cqe64_ac521313917e46afa6384835d4189c7f2}{srqn}}) \& 0xffffff))}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01065}01065                                 \mbox{\hyperlink{mlx5__ib_8h_ad4da9e65d2931a7d7c88019fe3a8351c}{mlx5\_ib\_free\_srq\_wqe}}(srq, be16\_to\_cpu(cqe64-\/>\mbox{\hyperlink{structmlx5__cqe64_af16e0b265dec7e07555179d5cd7388c6}{wqe\_counter}}));}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01066}01066                         ++nfreed;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01067}01067                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (nfreed) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01068}01068                         dest = \mbox{\hyperlink{mlx5__ib__cq_8c_a23ca4da078bd890da65b067bb1d9f065}{get\_cqe}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, (prod\_index + nfreed) \& \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq.cqe);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01069}01069                         dest64 = (\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_a458436764ec16a503d3e3fbb1457b394}{cqe\_sz}} == 64) ? dest : dest + 64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01070}01070                         owner\_bit = dest64-\/>\mbox{\hyperlink{structmlx5__cqe64_a3dbb1dc2c9f2ee64863edf7f750f5885}{op\_own}} \& \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a62a86c5fb0a5057f1703dbe3d840e4e7}{MLX5\_CQE\_OWNER\_MASK}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01071}01071                         memcpy(dest, cqe, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_a458436764ec16a503d3e3fbb1457b394}{cqe\_sz}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01072}01072                         dest64-\/>\mbox{\hyperlink{structmlx5__cqe64_a3dbb1dc2c9f2ee64863edf7f750f5885}{op\_own}} = owner\_bit |}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01073}01073                                 (dest64-\/>\mbox{\hyperlink{structmlx5__cqe64_a3dbb1dc2c9f2ee64863edf7f750f5885}{op\_own}} \& \string~MLX5\_CQE\_OWNER\_MASK);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01074}01074                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01075}01075         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01076}01076 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01077}01077         \textcolor{keywordflow}{if} (nfreed) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01078}01078                 \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_afb2887dc8c075ba41ca2e359dbcfdde2}{cons\_index}} += nfreed;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01079}01079                 \textcolor{comment}{/* Make sure update of buffer contents is done before}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01080}01080 \textcolor{comment}{                 * updating consumer index.}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01081}01081 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01082}01082                 wmb();}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01083}01083                 \mbox{\hyperlink{cq_8h_ae7e9ad2aa76df79fbbf0873f46b1ef7c}{mlx5\_cq\_set\_ci}}(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01084}01084         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01085}01085 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01086}01086 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01087}\mbox{\hyperlink{mlx5__ib_8h_a4a088aec8e5a3e1a907cbdb9fc4855a6}{01087}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_a4a088aec8e5a3e1a907cbdb9fc4855a6}{mlx5\_ib\_cq\_clean}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, u32 qpn, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__srq}{mlx5\_ib\_srq}} *srq)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01088}01088 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01089}01089         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}})}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01090}01090                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01091}01091 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01092}01092         spin\_lock\_irq(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>lock);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01093}01093         \mbox{\hyperlink{mlx5__ib__cq_8c_a2e81a7e2dfeee169d619d30664dfdb18}{\_\_mlx5\_ib\_cq\_clean}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, qpn, srq);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01094}01094         spin\_unlock\_irq(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>lock);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01095}01095 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01096}01096 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01097}\mbox{\hyperlink{mlx5__ib_8h_a2eb452b645d26c602566653c3544f5f9}{01097}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_a2eb452b645d26c602566653c3544f5f9}{mlx5\_ib\_modify\_cq}}(\textcolor{keyword}{struct} ib\_cq *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, u16 cq\_count, u16 cq\_period)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01098}01098 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01099}01099         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev = \mbox{\hyperlink{mlx5__ib_8h_a1806639f13e6865f0fa7aab4dd3ec6c7}{to\_mdev}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>device);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01100}01100         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_af69a66154472918b7d1481f1b1d974c8}{mcq}} = \mbox{\hyperlink{mlx5__ib_8h_a3f1e6fd123a26621fe1de5993fc033f7}{to\_mcq}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01101}01101         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01102}01102 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01103}01103         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, cq\_moderation))}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01104}01104                 \textcolor{keywordflow}{return} -\/ENOSYS;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01105}01105 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01106}01106         err = \mbox{\hyperlink{cq_8h_af35b8c739c52933c447ea25a9e0532d6}{mlx5\_core\_modify\_cq\_moderation}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, \&\mbox{\hyperlink{en_8h_af69a66154472918b7d1481f1b1d974c8}{mcq}}-\/>mcq,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01107}01107                                              cq\_period, cq\_count);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01108}01108         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01109}01109                 \mbox{\hyperlink{mlx5__ib_8h_a648fb83654f708e827821ca7fa53779a}{mlx5\_ib\_warn}}(dev, \textcolor{stringliteral}{"{}modify cq 0x\%x failed\(\backslash\)n"{}}, \mbox{\hyperlink{en_8h_af69a66154472918b7d1481f1b1d974c8}{mcq}}-\/>mcq.\mbox{\hyperlink{structmlx5__core__cq_aa4a997291e120b040c7a95d59639e62a}{cqn}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01110}01110 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01111}01111         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01112}01112 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01113}01113 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01114}\mbox{\hyperlink{mlx5__ib__cq_8c_ae234f2a09d55beaddc49d80c5805be3e}{01114}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_ae234f2a09d55beaddc49d80c5805be3e}{resize\_user}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01115}01115                        \textcolor{keywordtype}{int} entries, \textcolor{keyword}{struct} ib\_udata *udata, \textcolor{keywordtype}{int} *npas,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01116}01116                        \textcolor{keywordtype}{int} *page\_shift, \textcolor{keywordtype}{int} *\mbox{\hyperlink{structmlx5__ib__cq_a721fd7db86e331ac395f3286f6090906}{cqe\_size}})}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01117}01117 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01118}01118         \textcolor{keyword}{struct }\mbox{\hyperlink{mlx5__ib__cq_8c_a7de0f4dc9a5153fad1f0721bf9ba92fb}{mlx5\_ib\_resize\_cq}} ucmd;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01119}01119         \textcolor{keyword}{struct }ib\_umem *umem;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01120}01120         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01121}01121         \textcolor{keywordtype}{int} npages;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01122}01122         \textcolor{keyword}{struct }ib\_ucontext *context = \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf.umem-\/>context;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01123}01123 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01124}01124         err = ib\_copy\_from\_udata(\&ucmd, udata, \textcolor{keyword}{sizeof}(ucmd));}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01125}01125         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01126}01126                 \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01127}01127 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01128}01128         \textcolor{keywordflow}{if} (ucmd.reserved0 || ucmd.reserved1)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01129}01129                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01130}01130 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01131}01131         \textcolor{comment}{/* check multiplication overflow */}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01132}01132         \textcolor{keywordflow}{if} (ucmd.cqe\_size \&\& SIZE\_MAX / ucmd.cqe\_size <= entries -\/ 1)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01133}01133                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01134}01134 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01135}01135         umem = ib\_umem\_get(context, ucmd.buf\_addr,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01136}01136                            (\textcolor{keywordtype}{size\_t})ucmd.cqe\_size * entries,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01137}01137                            IB\_ACCESS\_LOCAL\_WRITE, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01138}01138         \textcolor{keywordflow}{if} (IS\_ERR(umem)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01139}01139                 err = PTR\_ERR(umem);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01140}01140                 \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01141}01141         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01142}01142 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01143}01143         \mbox{\hyperlink{mlx5__ib_8h_a078af05e9a50b56546252df6754917b9}{mlx5\_ib\_cont\_pages}}(umem, ucmd.buf\_addr, 0, \&npages, page\_shift,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01144}01144                            npas, NULL);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01145}01145 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01146}01146         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_umem = umem;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01147}01147         *cqe\_size = ucmd.cqe\_size;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01148}01148 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01149}01149         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01150}01150 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01151}01151 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01152}\mbox{\hyperlink{mlx5__ib__cq_8c_aca70e50ae174ebebb317ded58171a22d}{01152}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_aca70e50ae174ebebb317ded58171a22d}{un\_resize\_user}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}})}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01153}01153 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01154}01154         ib\_umem\_release(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_umem);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01155}01155 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01156}01156 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01157}\mbox{\hyperlink{mlx5__ib__cq_8c_a77052634e8f797fc0b720dd84eb1a052}{01157}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_a77052634e8f797fc0b720dd84eb1a052}{resize\_kernel}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01158}01158                          \textcolor{keywordtype}{int} entries, \textcolor{keywordtype}{int} cqe\_size)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01159}01159 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01160}01160         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01161}01161 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01162}01162         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf = kzalloc(\textcolor{keyword}{sizeof}(*\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf), GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01163}01163         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01164}01164                 \textcolor{keywordflow}{return} -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01165}01165 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01166}01166         err = \mbox{\hyperlink{mlx5__ib__cq_8c_a07a35b5d95ae1f3f50a31c3e1ea6d9d7}{alloc\_cq\_buf}}(dev, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf, entries, cqe\_size);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01167}01167         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01168}01168                 \textcolor{keywordflow}{goto} ex;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01169}01169 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01170}01170         \mbox{\hyperlink{mlx5__ib__cq_8c_a70157d12ba631d32c2edd844f644b3cc}{init\_cq\_buf}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01171}01171 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01172}01172         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01173}01173 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01174}01174 ex:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01175}01175         kfree(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01176}01176         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01177}01177 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01178}01178 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01179}\mbox{\hyperlink{mlx5__ib__cq_8c_a789a6f7653f877282fc3292c9d1582ca}{01179}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__ib__cq_8c_a789a6f7653f877282fc3292c9d1582ca}{un\_resize\_kernel}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}})}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01180}01180 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01181}01181         \mbox{\hyperlink{mlx5__ib__cq_8c_a85123e49ea547174ddf7ee5ed7de8009}{free\_cq\_buf}}(dev, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01182}01182         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01183}01183 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01184}01184 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01185}\mbox{\hyperlink{mlx5__ib__cq_8c_a2e8ecbe4559726fe3976628ea1c621e9}{01185}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_a2e8ecbe4559726fe3976628ea1c621e9}{copy\_resize\_cqes}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}})}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01186}01186 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01187}01187         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev = \mbox{\hyperlink{mlx5__ib_8h_a1806639f13e6865f0fa7aab4dd3ec6c7}{to\_mdev}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq.device);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01188}01188         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__cqe64}{mlx5\_cqe64}} *scqe64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01189}01189         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__cqe64}{mlx5\_cqe64}} *dcqe64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01190}01190         \textcolor{keywordtype}{void} *start\_cqe;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01191}01191         \textcolor{keywordtype}{void} *scqe;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01192}01192         \textcolor{keywordtype}{void} *dcqe;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01193}01193         \textcolor{keywordtype}{int} ssize;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01194}01194         \textcolor{keywordtype}{int} dsize;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01195}01195         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01196}01196         u8 sw\_own;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01197}01197 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01198}01198         ssize = \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf.cqe\_size;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01199}01199         dsize = \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf-\/>cqe\_size;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01200}01200         \textcolor{keywordflow}{if} (ssize != dsize) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01201}01201                 \mbox{\hyperlink{mlx5__ib_8h_a648fb83654f708e827821ca7fa53779a}{mlx5\_ib\_warn}}(dev, \textcolor{stringliteral}{"{}resize from different cqe size is not supported\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01202}01202                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01203}01203         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01204}01204 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01205}01205         i = \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_afb2887dc8c075ba41ca2e359dbcfdde2}{cons\_index}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01206}01206         scqe = \mbox{\hyperlink{mlx5__ib__cq_8c_a48c3a821c73d2ca5653a45907f812d88}{get\_sw\_cqe}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, i);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01207}01207         scqe64 = ssize == 64 ? scqe : scqe + 64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01208}01208         start\_cqe = scqe;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01209}01209         \textcolor{keywordflow}{if} (!scqe) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01210}01210                 \mbox{\hyperlink{mlx5__ib_8h_a648fb83654f708e827821ca7fa53779a}{mlx5\_ib\_warn}}(dev, \textcolor{stringliteral}{"{}expected cqe in sw ownership\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01211}01211                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01212}01212         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01213}01213 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01214}01214         \textcolor{keywordflow}{while} ((scqe64-\/>\mbox{\hyperlink{structmlx5__cqe64_a3dbb1dc2c9f2ee64863edf7f750f5885}{op\_own}} >> 4) != \mbox{\hyperlink{cq_8h_adf764cbdea00d65edcd07bb9953ad2b7a1c3148402db2b597afcb3a5b4653469c}{MLX5\_CQE\_RESIZE\_CQ}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01215}01215                 dcqe = \mbox{\hyperlink{mlx5__ib__cq_8c_a0816a16a8c95dbb0e379248cc6ab654f}{get\_cqe\_from\_buf}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01216}01216                                         (i + 1) \& (\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf-\/>nent),}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01217}01217                                         dsize);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01218}01218                 dcqe64 = dsize == 64 ? dcqe : dcqe + 64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01219}01219                 sw\_own = \mbox{\hyperlink{mlx5__ib__cq_8c_a647a399c594063c79547ebf66b012bc0}{sw\_ownership\_bit}}(i + 1, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf-\/>nent);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01220}01220                 memcpy(dcqe, scqe, dsize);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01221}01221                 dcqe64-\/>\mbox{\hyperlink{structmlx5__cqe64_a3dbb1dc2c9f2ee64863edf7f750f5885}{op\_own}} = (dcqe64-\/>\mbox{\hyperlink{structmlx5__cqe64_a3dbb1dc2c9f2ee64863edf7f750f5885}{op\_own}} \& \string~MLX5\_CQE\_OWNER\_MASK) | sw\_own;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01222}01222 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01223}01223                 ++i;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01224}01224                 scqe = \mbox{\hyperlink{mlx5__ib__cq_8c_a48c3a821c73d2ca5653a45907f812d88}{get\_sw\_cqe}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, i);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01225}01225                 scqe64 = ssize == 64 ? scqe : scqe + 64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01226}01226                 \textcolor{keywordflow}{if} (!scqe) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01227}01227                         \mbox{\hyperlink{mlx5__ib_8h_a648fb83654f708e827821ca7fa53779a}{mlx5\_ib\_warn}}(dev, \textcolor{stringliteral}{"{}expected cqe in sw ownership\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01228}01228                         \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01229}01229                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01230}01230 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01231}01231                 \textcolor{keywordflow}{if} (scqe == start\_cqe) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01232}01232                         pr\_warn(\textcolor{stringliteral}{"{}resize CQ failed to get resize CQE, CQN 0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01233}01233                                 \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_aa4a997291e120b040c7a95d59639e62a}{cqn}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01234}01234                         \textcolor{keywordflow}{return} -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01235}01235                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01236}01236         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01237}01237         ++\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_afb2887dc8c075ba41ca2e359dbcfdde2}{cons\_index}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01238}01238         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01239}01239 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01240}01240 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01241}\mbox{\hyperlink{mlx5__ib_8h_a7de0f4dc9a5153fad1f0721bf9ba92fb}{01241}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_a7de0f4dc9a5153fad1f0721bf9ba92fb}{mlx5\_ib\_resize\_cq}}(\textcolor{keyword}{struct} ib\_cq *ibcq, \textcolor{keywordtype}{int} entries, \textcolor{keyword}{struct} ib\_udata *udata)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01242}01242 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01243}01243         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev = \mbox{\hyperlink{mlx5__ib_8h_a1806639f13e6865f0fa7aab4dd3ec6c7}{to\_mdev}}(ibcq-\/>device);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01244}01244         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}} = \mbox{\hyperlink{mlx5__ib_8h_a3f1e6fd123a26621fe1de5993fc033f7}{to\_mcq}}(\mbox{\hyperlink{structmlx5__ib__cq_a8d54c698aa989c1c47047b15c1540b02}{ibcq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01245}01245         \textcolor{keywordtype}{void} *cqc;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01246}01246         u32 *in;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01247}01247         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01248}01248         \textcolor{keywordtype}{int} npas;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01249}01249         \_\_be64 *pas;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01250}01250         \textcolor{keywordtype}{int} page\_shift;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01251}01251         \textcolor{keywordtype}{int} inlen;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01252}01252         \textcolor{keywordtype}{int} uninitialized\_var(\mbox{\hyperlink{structmlx5__ib__cq_a721fd7db86e331ac395f3286f6090906}{cqe\_size}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01253}01253         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} flags;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01254}01254 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01255}01255         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, cq\_resize)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01256}01256                 pr\_info(\textcolor{stringliteral}{"{}Firmware does not support resize CQ\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01257}01257                 \textcolor{keywordflow}{return} -\/ENOSYS;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01258}01258         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01259}01259 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01260}01260         \textcolor{keywordflow}{if} (entries < 1 ||}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01261}01261             entries > (1 << \mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, log\_max\_cq\_sz))) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01262}01262                 \mbox{\hyperlink{mlx5__ib_8h_a648fb83654f708e827821ca7fa53779a}{mlx5\_ib\_warn}}(dev, \textcolor{stringliteral}{"{}wrong entries number \%d, max \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01263}01263                              entries,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01264}01264                              1 << \mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, log\_max\_cq\_sz));}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01265}01265                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01266}01266         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01267}01267 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01268}01268         entries = roundup\_pow\_of\_two(entries + 1);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01269}01269         \textcolor{keywordflow}{if} (entries > (1 << \mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, log\_max\_cq\_sz)) + 1)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01270}01270                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01271}01271 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01272}01272         \textcolor{keywordflow}{if} (entries == \mbox{\hyperlink{structmlx5__ib__cq_a8d54c698aa989c1c47047b15c1540b02}{ibcq}}-\/>cqe + 1)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01273}01273                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01274}01274 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01275}01275         mutex\_lock(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_mutex);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01276}01276         \textcolor{keywordflow}{if} (udata) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01277}01277                 err = \mbox{\hyperlink{mlx5__ib__cq_8c_ae234f2a09d55beaddc49d80c5805be3e}{resize\_user}}(dev, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, entries, udata, \&npas, \&page\_shift,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01278}01278                                   \&\mbox{\hyperlink{structmlx5__ib__cq_a721fd7db86e331ac395f3286f6090906}{cqe\_size}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01279}01279         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01280}01280                 \mbox{\hyperlink{structmlx5__ib__cq_a721fd7db86e331ac395f3286f6090906}{cqe\_size}} = 64;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01281}01281                 err = \mbox{\hyperlink{mlx5__ib__cq_8c_a77052634e8f797fc0b720dd84eb1a052}{resize\_kernel}}(dev, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}, entries, \mbox{\hyperlink{structmlx5__ib__cq_a721fd7db86e331ac395f3286f6090906}{cqe\_size}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01282}01282                 \textcolor{keywordflow}{if} (!err) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01283}01283                         npas = \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf-\/>buf.npages;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01284}01284                         page\_shift = \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf-\/>buf.page\_shift;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01285}01285                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01286}01286         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01287}01287 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01288}01288         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01289}01289                 \textcolor{keywordflow}{goto} ex;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01290}01290 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01291}01291         inlen = \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(modify\_cq\_in) +}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01292}01292                 \mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(modify\_cq\_in, pas[0]) * npas;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01293}01293 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01294}01294         in = \mbox{\hyperlink{driver_8h_af928b1985830513c1c81b095b31ad8a7}{mlx5\_vzalloc}}(inlen);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01295}01295         \textcolor{keywordflow}{if} (!in) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01296}01296                 err = -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01297}01297                 \textcolor{keywordflow}{goto} ex\_resize;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01298}01298         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01299}01299 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01300}01300         pas = (\_\_be64 *)\mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(modify\_cq\_in, in, pas);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01301}01301         \textcolor{keywordflow}{if} (udata)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01302}01302                 \mbox{\hyperlink{mlx5__ib_8h_aa632996b34ed7613321620a079856f8e}{mlx5\_ib\_populate\_pas}}(dev, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_umem, page\_shift,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01303}01303                                      pas, 0);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01304}01304         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01305}01305                 \mbox{\hyperlink{driver_8h_adbd58dd0790cfdfce0e245704e92deec}{mlx5\_fill\_page\_array}}(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf-\/>buf, pas);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01306}01306 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01307}01307         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_cq\_in, in,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01308}01308                  modify\_field\_select\_resize\_field\_select.resize\_field\_select.resize\_field\_select,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01309}01309                  \mbox{\hyperlink{cq_8h_abc6126af1d45847bc59afa0aa3216b04ad82f5b77aec4907f9cf61ff50e280735}{MLX5\_MODIFY\_CQ\_MASK\_LOG\_SIZE}}  |}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01310}01310                  \mbox{\hyperlink{cq_8h_abc6126af1d45847bc59afa0aa3216b04a79c3bf085cab3ce7841d17c9ef7db82c}{MLX5\_MODIFY\_CQ\_MASK\_PG\_OFFSET}} |}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01311}01311                  \mbox{\hyperlink{cq_8h_abc6126af1d45847bc59afa0aa3216b04a59bcd53743c0ad24c17c8969f44132ef}{MLX5\_MODIFY\_CQ\_MASK\_PG\_SIZE}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01312}01312 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01313}01313         cqc = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(modify\_cq\_in, in, cq\_context);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01314}01314 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01315}01315         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(cqc, cqc, log\_page\_size,}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01316}01316                  page\_shift -\/ \mbox{\hyperlink{device_8h_aae05225933a42f81e7c4a9fb286596f9aa4614720009368aaf55770e64acced36}{MLX5\_ADAPTER\_PAGE\_SHIFT}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01317}01317         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(cqc, cqc, cqe\_sz, \mbox{\hyperlink{cq_8h_afc92b60f02a50d2f48fb60a78e6dd0de}{cqe\_sz\_to\_mlx\_sz}}(\mbox{\hyperlink{structmlx5__ib__cq_a721fd7db86e331ac395f3286f6090906}{cqe\_size}}));}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01318}01318         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(cqc, cqc, log\_cq\_size, ilog2(entries));}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01319}01319 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01320}01320         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_cq\_in, in, op\_mod, \mbox{\hyperlink{cq_8h_abc6126af1d45847bc59afa0aa3216b04a3082d1c78d5f9992353bde5408801cac}{MLX5\_CQ\_OPMOD\_RESIZE}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01321}01321         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_cq\_in, in, cqn, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}.\mbox{\hyperlink{structmlx5__core__cq_aa4a997291e120b040c7a95d59639e62a}{cqn}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01322}01322 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01323}01323         err = \mbox{\hyperlink{cq_8h_a6daee9f9e6ec29274f1bd0311630d719}{mlx5\_core\_modify\_cq}}(dev-\/>\mbox{\hyperlink{structmlx5__ib__dev_ad83604569dbe7573baa7644158cee224}{mdev}}, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>\mbox{\hyperlink{structmlx5e__cq_ad9262877d1d03c6f244bdd35128e89ba}{mcq}}, in, inlen);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01324}01324         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01325}01325                 \textcolor{keywordflow}{goto} ex\_alloc;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01326}01326 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01327}01327         \textcolor{keywordflow}{if} (udata) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01328}01328                 \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq.cqe = entries -\/ 1;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01329}01329                 ib\_umem\_release(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf.umem);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01330}01330                 \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf.umem = \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_umem;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01331}01331                 \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_umem = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01332}01332         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01333}01333                 \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__cq__buf}{mlx5\_ib\_cq\_buf}} tbuf;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01334}01334                 \textcolor{keywordtype}{int} resized = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01335}01335 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01336}01336                 spin\_lock\_irqsave(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01337}01337                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01338}01338                         err = \mbox{\hyperlink{mlx5__ib__cq_8c_a2e8ecbe4559726fe3976628ea1c621e9}{copy\_resize\_cqes}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01339}01339                         \textcolor{keywordflow}{if} (!err) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01340}01340                                 tbuf = \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01341}01341                                 \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>buf = *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01342}01342                                 kfree(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01343}01343                                 \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_buf = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01344}01344                                 resized = 1;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01345}01345                         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01346}01346                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01347}01347                 \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>ibcq.cqe = entries -\/ 1;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01348}01348                 spin\_unlock\_irqrestore(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01349}01349                 \textcolor{keywordflow}{if} (resized)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01350}01350                         \mbox{\hyperlink{mlx5__ib__cq_8c_a85123e49ea547174ddf7ee5ed7de8009}{free\_cq\_buf}}(dev, \&tbuf);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01351}01351         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01352}01352         mutex\_unlock(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_mutex);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01353}01353 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01354}01354         kvfree(in);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01355}01355         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01356}01356 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01357}01357 ex\_alloc:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01358}01358         kvfree(in);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01359}01359 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01360}01360 ex\_resize:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01361}01361         \textcolor{keywordflow}{if} (udata)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01362}01362                 \mbox{\hyperlink{mlx5__ib__cq_8c_aca70e50ae174ebebb317ded58171a22d}{un\_resize\_user}}(\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01363}01363         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01364}01364                 \mbox{\hyperlink{mlx5__ib__cq_8c_a789a6f7653f877282fc3292c9d1582ca}{un\_resize\_kernel}}(dev, \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01365}01365 ex:}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01366}01366         mutex\_unlock(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>resize\_mutex);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01367}01367         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01368}01368 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01369}01369 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01370}\mbox{\hyperlink{mlx5__ib_8h_a5389ad76428fa3c963382d0b0052e8f8}{01370}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_a5389ad76428fa3c963382d0b0052e8f8}{mlx5\_ib\_get\_cqe\_size}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__ib__dev}{mlx5\_ib\_dev}} *dev, \textcolor{keyword}{struct} ib\_cq *ibcq)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01371}01371 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01372}01372         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}};}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01373}01373 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01374}01374         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{structmlx5__ib__cq_a8d54c698aa989c1c47047b15c1540b02}{ibcq}})}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01375}01375                 \textcolor{keywordflow}{return} 128;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01376}01376 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01377}01377         \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}} = \mbox{\hyperlink{mlx5__ib_8h_a3f1e6fd123a26621fe1de5993fc033f7}{to\_mcq}}(\mbox{\hyperlink{structmlx5__ib__cq_a8d54c698aa989c1c47047b15c1540b02}{ibcq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01378}01378         \textcolor{keywordflow}{return} \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>cqe\_size;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01379}01379 \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01380}01380 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01381}01381 \textcolor{comment}{/* Called from atomic context */}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01382}\mbox{\hyperlink{mlx5__ib_8h_ad3c85ea19ce71ea512c4abe054ed9be1}{01382}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__ib__cq_8c_ad3c85ea19ce71ea512c4abe054ed9be1}{mlx5\_ib\_generate\_wc}}(\textcolor{keyword}{struct} ib\_cq *\mbox{\hyperlink{structmlx5__ib__cq_a8d54c698aa989c1c47047b15c1540b02}{ibcq}}, \textcolor{keyword}{struct} ib\_wc *wc)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01383}01383 \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01384}01384         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__wc}{mlx5\_ib\_wc}} *soft\_wc;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01385}01385         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ib__cq}{mlx5\_ib\_cq}} *\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}} = \mbox{\hyperlink{mlx5__ib_8h_a3f1e6fd123a26621fe1de5993fc033f7}{to\_mcq}}(\mbox{\hyperlink{structmlx5__ib__cq_a8d54c698aa989c1c47047b15c1540b02}{ibcq}});}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01386}01386         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} flags;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01387}01387 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01388}01388         soft\_wc = kmalloc(\textcolor{keyword}{sizeof}(*soft\_wc), GFP\_ATOMIC);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01389}01389         \textcolor{keywordflow}{if} (!soft\_wc)}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01390}01390                 \textcolor{keywordflow}{return} -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01391}01391 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01392}01392         soft\_wc-\/>\mbox{\hyperlink{structmlx5__ib__wc_ada1068596e0a3b498390336d6f55ebb3}{wc}} = *wc;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01393}01393         spin\_lock\_irqsave(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01394}01394         list\_add\_tail(\&soft\_wc-\/>\mbox{\hyperlink{structmlx5__ib__wc_a355fe35a62a292cc50206b3f60342a40}{list}}, \&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>wc\_list);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01395}01395         \textcolor{keywordflow}{if} (\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>notify\_flags == IB\_CQ\_NEXT\_COMP ||}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01396}01396             wc-\/>status != IB\_WC\_SUCCESS) \{}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01397}01397                 \mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>notify\_flags = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01398}01398                 schedule\_work(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>notify\_work);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01399}01399         \}}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01400}01400         spin\_unlock\_irqrestore(\&\mbox{\hyperlink{en_8h_a124cdf1cec8a4103ace100a401cd893c}{cq}}-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01401}01401 }
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01402}01402         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__ib__cq_8c_source_l01403}01403 \}}

\end{DoxyCode}
