\hypertarget{mlx5__mr_8c_source}{}\doxysection{mlx5\+\_\+mr.\+c}
\label{mlx5__mr_8c_source}\index{dev/mlx5/mlx5\_core/mlx5\_mr.c@{dev/mlx5/mlx5\_core/mlx5\_mr.c}}
\mbox{\hyperlink{mlx5__mr_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2013-\/2018, Mellanox Technologies, Ltd.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00004}00004 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00005}00005 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00006}00006 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00007}00007 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00008}00008 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00009}00009 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00010}00010 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00011}00011 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00013}00013 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00014}00014 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00015}00015 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00016}00016 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00017}00017 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00018}00018 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00019}00019 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00020}00020 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00021}00021 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00022}00022 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00023}00023 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00024}00024 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00025}00025 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00026}00026 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00027}00027 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00028}00028 \textcolor{preprocessor}{\#include "{}opt\_rss.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00029}00029 \textcolor{preprocessor}{\#include "{}opt\_ratelimit.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <linux/kernel.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <linux/module.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{driver_8h}{dev/mlx5/driver.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mlx5__core_8h}{dev/mlx5/mlx5\_core/mlx5\_core.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00036}\mbox{\hyperlink{mlx5__mr_8c_a92ba4d3332d0dd6a6b5c5c8cc139c45d}{00036}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__mr_8c_a92ba4d3332d0dd6a6b5c5c8cc139c45d}{mlx5\_relaxed\_ordering\_write}};}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00037}\mbox{\hyperlink{mlx5__mr_8c_a47a9007352e26b82cc96ec0ba1fe420a}{00037}} \mbox{\hyperlink{mlx5__mr_8c_a47a9007352e26b82cc96ec0ba1fe420a}{SYSCTL\_INT}}(\_hw\_mlx5, OID\_AUTO, relaxed\_ordering\_write, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00038}00038     \&\mbox{\hyperlink{mlx5__mr_8c_a92ba4d3332d0dd6a6b5c5c8cc139c45d}{mlx5\_relaxed\_ordering\_write}}, 0,}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00039}00039     \textcolor{stringliteral}{"{}Set to enable relaxed ordering for PCIe writes"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00040}00040 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00041}\mbox{\hyperlink{driver_8h_a2e26663d2838c13a2a6f6df4467d508c}{00041}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__mr_8c_a2e26663d2838c13a2a6f6df4467d508c}{mlx5\_init\_mr\_table}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev)}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00042}00042 \{}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00043}00043         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__mr__table}{mlx5\_mr\_table}} *table = \&dev-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_a3361c1d42e64541bf7c71c98149c8cc5}{mr\_table}};}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00045}00045         memset(table, 0, \textcolor{keyword}{sizeof}(*table));}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00046}00046         spin\_lock\_init(\&table-\/>\mbox{\hyperlink{structmlx5__mr__table_a5730e6ace8e7b808769fd919b8d1f1af}{lock}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00047}00047         INIT\_RADIX\_TREE(\&table-\/>\mbox{\hyperlink{structmlx5__mr__table_a1dfcce11962ff48ec786fea6fdc80fa5}{tree}}, GFP\_ATOMIC);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00048}00048 \}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00050}\mbox{\hyperlink{driver_8h_a495819a5e5aeb1e6c0ace1d60491eeb1}{00050}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__mr_8c_a495819a5e5aeb1e6c0ace1d60491eeb1}{mlx5\_cleanup\_mr\_table}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev)}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00051}00051 \{}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00052}00052 \}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00053}00053 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00054}\mbox{\hyperlink{driver_8h_afb84a7e03e2dbd56d565a9d3e0630851}{00054}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__mr_8c_afb84a7e03e2dbd56d565a9d3e0630851}{mlx5\_core\_create\_mkey\_cb}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev,}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00055}00055                              \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__mkey}{mlx5\_core\_mkey}} *mkey,}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00056}00056                              \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__async__ctx}{mlx5\_async\_ctx}} *async\_ctx, u32 *in,}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00057}00057                              \textcolor{keywordtype}{int} inlen, u32 *out, \textcolor{keywordtype}{int} outlen,}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00058}00058                              \mbox{\hyperlink{driver_8h_aba176ecd1ee61fd20947b348ce9dca80}{mlx5\_async\_cbk\_t}} callback,}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00059}00059                              \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__async__work}{mlx5\_async\_work}} *context)}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00060}00060 \{}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00061}00061         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__mr__table}{mlx5\_mr\_table}} *table = \&dev-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_a3361c1d42e64541bf7c71c98149c8cc5}{mr\_table}};}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00062}00062         u32 lout[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(create\_mkey\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00063}00063         u32 mkey\_index;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00064}00064         \textcolor{keywordtype}{void} *mkc;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00065}00065         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} flags;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00066}00066         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00067}00067         u8 key;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00068}00068 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00069}00069         spin\_lock\_irq(\&dev-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_ae2186e7a0aecba1a6f5532b260eff06c}{mkey\_lock}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00070}00070         key = dev-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_ac6911e12a2fc56d0f0e17c93f4a277f4}{mkey\_key}}++;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00071}00071         spin\_unlock\_irq(\&dev-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_ae2186e7a0aecba1a6f5532b260eff06c}{mkey\_lock}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00072}00072         mkc = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(create\_mkey\_in, in, memory\_key\_mkey\_entry);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00073}00073         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_mkey\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a223c7109f2adb1f20c60cf4848534536}{MLX5\_CMD\_OP\_CREATE\_MKEY}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00074}00074         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(mkc, mkc, mkey\_7\_0, key);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00076}00076         \textcolor{keywordflow}{if} (\mbox{\hyperlink{mlx5__mr_8c_a92ba4d3332d0dd6a6b5c5c8cc139c45d}{mlx5\_relaxed\_ordering\_write}} != 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00077}00077                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(dev, relaxed\_ordering\_write))}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00078}00078                         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(mkc, mkc, relaxed\_ordering\_write, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00079}00079                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00080}00080                         \textcolor{keywordflow}{return} (-\/EPROTONOSUPPORT);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00081}00081         \}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00083}00083         \textcolor{keywordflow}{if} (callback)}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00084}00084                 \textcolor{keywordflow}{return} \mbox{\hyperlink{driver_8h_a6d2246766967489ad01723ece03fc50b}{mlx5\_cmd\_exec\_cb}}(async\_ctx, in, inlen, out, outlen,}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00085}00085                                         callback, context);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00087}00087         err = \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in, inlen, lout, \textcolor{keyword}{sizeof}(lout));}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00088}00088         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00089}00089                 \mbox{\hyperlink{mlx5__core_8h_abecf5f90e845f80efc57b10bd4c67c2b}{mlx5\_core\_dbg}}(dev, \textcolor{stringliteral}{"{}cmd exec failed \%d\(\backslash\)n"{}}, err);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00090}00090                 \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00091}00091         \}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00092}00092 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00093}00093         mkey\_index = \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(create\_mkey\_out, lout, mkey\_index);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00094}00094         mkey-\/>\mbox{\hyperlink{structmlx5__core__mkey_a1c5bf7e726bc6fd00047dee8706eb27c}{iova}} = \mbox{\hyperlink{device_8h_ac7ded81380b3a6c3a63a7c9f4581368b}{MLX5\_GET64}}(mkc, mkc, start\_addr);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00095}00095         mkey-\/>\mbox{\hyperlink{structmlx5__core__mkey_a76bdd58ff2c0cf110e6234be91da9ff4}{size}} = \mbox{\hyperlink{device_8h_ac7ded81380b3a6c3a63a7c9f4581368b}{MLX5\_GET64}}(mkc, mkc, len);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00096}00096         mkey-\/>\mbox{\hyperlink{structmlx5__core__mkey_a35815af7a03d7540ee9fa07fcb74548c}{key}} = \mbox{\hyperlink{driver_8h_ad8a720070bde83cd55739f561e79cfd5}{mlx5\_idx\_to\_mkey}}(mkey\_index) | key;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00097}00097         mkey-\/>\mbox{\hyperlink{structmlx5__core__mkey_adc1003b7a05604ad94b034f5faba8e95}{pd}} = \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(mkc, mkc, pd);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00099}00099         \mbox{\hyperlink{mlx5__core_8h_abecf5f90e845f80efc57b10bd4c67c2b}{mlx5\_core\_dbg}}(dev, \textcolor{stringliteral}{"{}out 0x\%x, key 0x\%x, mkey 0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00100}00100                       mkey\_index, key, mkey-\/>\mbox{\hyperlink{structmlx5__core__mkey_a35815af7a03d7540ee9fa07fcb74548c}{key}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00101}00101 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00102}00102         \textcolor{comment}{/* connect to MR tree */}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00103}00103         spin\_lock\_irqsave(\&table-\/>\mbox{\hyperlink{structmlx5__mr__table_a5730e6ace8e7b808769fd919b8d1f1af}{lock}}, flags);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00104}00104         err = radix\_tree\_insert(\&table-\/>\mbox{\hyperlink{structmlx5__mr__table_a1dfcce11962ff48ec786fea6fdc80fa5}{tree}}, \mbox{\hyperlink{driver_8h_aa35d31fc98ef8df8fdef0536c4a83632}{mlx5\_mkey\_to\_idx}}(mkey-\/>\mbox{\hyperlink{structmlx5__core__mkey_a35815af7a03d7540ee9fa07fcb74548c}{key}}), mkey);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00105}00105         spin\_unlock\_irqrestore(\&table-\/>\mbox{\hyperlink{structmlx5__mr__table_a5730e6ace8e7b808769fd919b8d1f1af}{lock}}, flags);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00106}00106         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00107}00107                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(dev, \textcolor{stringliteral}{"{}failed radix tree insert of mr 0x\%x, \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00108}00108                                mkey-\/>\mbox{\hyperlink{structmlx5__core__mkey_a35815af7a03d7540ee9fa07fcb74548c}{key}}, err);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00109}00109                 \mbox{\hyperlink{mlx5__mr_8c_a1bb1877ebc3a53b0563d915e4a061178}{mlx5\_core\_destroy\_mkey}}(dev, mkey);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00110}00110         \}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00111}00111 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00112}00112         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00113}00113 \}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00114}\mbox{\hyperlink{mlx5__mr_8c_aa498cb0b8f8b967d6cc7490f39887599}{00114}} \mbox{\hyperlink{mlx5__mr_8c_aa498cb0b8f8b967d6cc7490f39887599}{EXPORT\_SYMBOL}}(\mbox{\hyperlink{mlx5__mr_8c_afb84a7e03e2dbd56d565a9d3e0630851}{mlx5\_core\_create\_mkey\_cb}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00115}00115 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00116}\mbox{\hyperlink{driver_8h_aa55afac86fb98fe1a074177838e412bf}{00116}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__mr_8c_a3d57cb691e963bbc513485a7b0680d33}{mlx5\_core\_create\_mkey}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev,}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00117}00117                           \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__mkey}{mlx5\_core\_mkey}} *mkey,}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00118}00118                           u32 *in, \textcolor{keywordtype}{int} inlen)}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00119}00119 \{}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00120}00120         \textcolor{keywordflow}{return} \mbox{\hyperlink{mlx5__mr_8c_afb84a7e03e2dbd56d565a9d3e0630851}{mlx5\_core\_create\_mkey\_cb}}(dev, mkey, NULL, in, inlen,}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00121}00121                                         NULL, 0, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00122}00122 \}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00123}\mbox{\hyperlink{mlx5__mr_8c_a63b76cc0d7db10eb8e0a50f37e180350}{00123}} \mbox{\hyperlink{mlx5__mr_8c_aa498cb0b8f8b967d6cc7490f39887599}{EXPORT\_SYMBOL}}(\mbox{\hyperlink{mlx5__mr_8c_a3d57cb691e963bbc513485a7b0680d33}{mlx5\_core\_create\_mkey}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00124}00124 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00125}\mbox{\hyperlink{driver_8h_a1bb1877ebc3a53b0563d915e4a061178}{00125}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__mr_8c_a1bb1877ebc3a53b0563d915e4a061178}{mlx5\_core\_destroy\_mkey}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__mkey}{mlx5\_core\_mkey}} *mkey)}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00126}00126 \{}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00127}00127         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__mr__table}{mlx5\_mr\_table}} *table = \&dev-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_a3361c1d42e64541bf7c71c98149c8cc5}{mr\_table}};}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00128}00128         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(destroy\_mkey\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00129}00129         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(destroy\_mkey\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00130}00130         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__mkey}{mlx5\_core\_mkey}} *deleted\_mr;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00131}00131         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} flags;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00132}00132 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00133}00133         spin\_lock\_irqsave(\&table-\/>\mbox{\hyperlink{structmlx5__mr__table_a5730e6ace8e7b808769fd919b8d1f1af}{lock}}, flags);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00134}00134         deleted\_mr = radix\_tree\_delete(\&table-\/>\mbox{\hyperlink{structmlx5__mr__table_a1dfcce11962ff48ec786fea6fdc80fa5}{tree}}, \mbox{\hyperlink{driver_8h_aa35d31fc98ef8df8fdef0536c4a83632}{mlx5\_mkey\_to\_idx}}(mkey-\/>\mbox{\hyperlink{structmlx5__core__mkey_a35815af7a03d7540ee9fa07fcb74548c}{key}}));}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00135}00135         spin\_unlock\_irqrestore(\&table-\/>\mbox{\hyperlink{structmlx5__mr__table_a5730e6ace8e7b808769fd919b8d1f1af}{lock}}, flags);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00136}00136         \textcolor{keywordflow}{if} (!deleted\_mr) \{}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00137}00137                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(dev, \textcolor{stringliteral}{"{}failed radix tree delete of mr 0x\%x\(\backslash\)n"{}}, mkey-\/>\mbox{\hyperlink{structmlx5__core__mkey_a35815af7a03d7540ee9fa07fcb74548c}{key}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00138}00138                 \textcolor{keywordflow}{return} -\/ENOENT;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00139}00139         \}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00140}00140 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00141}00141         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_mkey\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a5beff7af51bca1a3a43a91a4f08f5eaa}{MLX5\_CMD\_OP\_DESTROY\_MKEY}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00142}00142         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_mkey\_in, in, mkey\_index, \mbox{\hyperlink{driver_8h_aa35d31fc98ef8df8fdef0536c4a83632}{mlx5\_mkey\_to\_idx}}(mkey-\/>\mbox{\hyperlink{structmlx5__core__mkey_a35815af7a03d7540ee9fa07fcb74548c}{key}}));}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00143}00143 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00144}00144         \textcolor{keywordflow}{return} \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in, \textcolor{keyword}{sizeof}(in), out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00145}00145 \}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00146}\mbox{\hyperlink{mlx5__mr_8c_a89e49f92da95a7d43626928775945728}{00146}} \mbox{\hyperlink{mlx5__mr_8c_aa498cb0b8f8b967d6cc7490f39887599}{EXPORT\_SYMBOL}}(\mbox{\hyperlink{mlx5__mr_8c_a1bb1877ebc3a53b0563d915e4a061178}{mlx5\_core\_destroy\_mkey}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00148}\mbox{\hyperlink{driver_8h_aeabd92986ab3bf131045f384a1a3bee2}{00148}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__mr_8c_aeabd92986ab3bf131045f384a1a3bee2}{mlx5\_core\_query\_mkey}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__mkey}{mlx5\_core\_mkey}} *mkey,}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00149}00149                          u32 *out, \textcolor{keywordtype}{int} outlen)}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00150}00150 \{}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00151}00151         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(query\_mkey\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00152}00152 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00153}00153         memset(out, 0, outlen);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00154}00154         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(query\_mkey\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a401bfa5cbf748b1e5ea0f4afd5ffd572}{MLX5\_CMD\_OP\_QUERY\_MKEY}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00155}00155         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(query\_mkey\_in, in, mkey\_index, \mbox{\hyperlink{driver_8h_aa35d31fc98ef8df8fdef0536c4a83632}{mlx5\_mkey\_to\_idx}}(mkey-\/>\mbox{\hyperlink{structmlx5__core__mkey_a35815af7a03d7540ee9fa07fcb74548c}{key}}));}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00156}00156 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00157}00157         \textcolor{keywordflow}{return} \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in, \textcolor{keyword}{sizeof}(in), out, outlen);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00158}00158 \}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00159}\mbox{\hyperlink{mlx5__mr_8c_a8fc83a72be2daf6535ddc0bc1c2f051f}{00159}} \mbox{\hyperlink{mlx5__mr_8c_aa498cb0b8f8b967d6cc7490f39887599}{EXPORT\_SYMBOL}}(\mbox{\hyperlink{mlx5__mr_8c_aeabd92986ab3bf131045f384a1a3bee2}{mlx5\_core\_query\_mkey}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00160}00160 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00161}\mbox{\hyperlink{driver_8h_a0d4371fb082a4324fe8d1a0dbe333d87}{00161}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__mr_8c_ae413dc08528013ed9c443ef75a4e368c}{mlx5\_core\_dump\_fill\_mkey}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__mkey}{mlx5\_core\_mkey}} *\_mkey,}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00162}00162                              u32 *mkey)}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00163}00163 \{}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00164}00164         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(query\_special\_contexts\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00165}00165         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(query\_special\_contexts\_in)]   = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00166}00166         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00167}00167 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00168}00168         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(query\_special\_contexts\_in, in, opcode,}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00169}00169                  \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a741e638ed9bc3438af8f173ab8570cd6}{MLX5\_CMD\_OP\_QUERY\_SPECIAL\_CONTEXTS}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00170}00170         err = \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in, \textcolor{keyword}{sizeof}(in), out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00171}00171         \textcolor{keywordflow}{if} (!err)}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00172}00172                 *mkey = \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(query\_special\_contexts\_out, out, dump\_fill\_mkey);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00173}00173 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00174}00174         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00175}00175 \}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00176}\mbox{\hyperlink{mlx5__mr_8c_a0ab1442aec0fa863cb460d851ab27f5d}{00176}} \mbox{\hyperlink{mlx5__mr_8c_aa498cb0b8f8b967d6cc7490f39887599}{EXPORT\_SYMBOL}}(\mbox{\hyperlink{mlx5__mr_8c_ae413dc08528013ed9c443ef75a4e368c}{mlx5\_core\_dump\_fill\_mkey}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00177}00177 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00178}\mbox{\hyperlink{mlx5__mr_8c_a5ed6cea3166ed03bd348f6e2c0bec35b}{00178}} \textcolor{keyword}{static} \textcolor{keyword}{inline} u32 \mbox{\hyperlink{mlx5__mr_8c_a5ed6cea3166ed03bd348f6e2c0bec35b}{mlx5\_get\_psv}}(u32 *out, \textcolor{keywordtype}{int} psv\_index)}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00179}00179 \{}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00180}00180         \textcolor{keywordflow}{switch} (psv\_index) \{}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00181}00181         \textcolor{keywordflow}{case} 1: \textcolor{keywordflow}{return} \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(create\_psv\_out, out, psv1\_index);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00182}00182         \textcolor{keywordflow}{case} 2: \textcolor{keywordflow}{return} \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(create\_psv\_out, out, psv2\_index);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00183}00183         \textcolor{keywordflow}{case} 3: \textcolor{keywordflow}{return} \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(create\_psv\_out, out, psv3\_index);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00184}00184         \textcolor{keywordflow}{default}: \textcolor{keywordflow}{return} \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(create\_psv\_out, out, psv0\_index);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00185}00185         \}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00186}00186 \}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00187}00187 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00188}\mbox{\hyperlink{driver_8h_a315988ca574805767c2d9c6e1272f775}{00188}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__mr_8c_a315988ca574805767c2d9c6e1272f775}{mlx5\_core\_create\_psv}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, u32 pdn,}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00189}00189                          \textcolor{keywordtype}{int} npsvs, u32 *sig\_index)}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00190}00190 \{}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00191}00191         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(create\_psv\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00192}00192         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(create\_psv\_in)]   = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00193}00193         \textcolor{keywordtype}{int} i, err;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00194}00194 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00195}00195         \textcolor{keywordflow}{if} (npsvs > \mbox{\hyperlink{device_8h_ab04a0655cd1e3bcac5e8f48c18df1a57a4aac4f37f3dc7f7efe681027b5d9b0d1}{MLX5\_MAX\_PSVS}})}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00196}00196                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00197}00197 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00198}00198         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_psv\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a423f59a079c4d7fb418a24af82270e31}{MLX5\_CMD\_OP\_CREATE\_PSV}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00199}00199         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_psv\_in, in, \mbox{\hyperlink{structmlx5__core__mkey_adc1003b7a05604ad94b034f5faba8e95}{pd}}, pdn);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00200}00200         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_psv\_in, in, num\_psv, npsvs);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00201}00201         err = \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in, \textcolor{keyword}{sizeof}(in), out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00202}00202         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00203}00203                 \mbox{\hyperlink{mlx5__core_8h_aeead4611cdbd6dbc272371c77201a6a5}{mlx5\_core\_err}}(dev, \textcolor{stringliteral}{"{}create\_psv cmd exec failed \%d\(\backslash\)n"{}}, err);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00204}00204                 \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00205}00205         \}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00206}00206 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00207}00207         \textcolor{keywordflow}{for} (i = 0; i < npsvs; i++)}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00208}00208                 sig\_index[i] = \mbox{\hyperlink{mlx5__mr_8c_a5ed6cea3166ed03bd348f6e2c0bec35b}{mlx5\_get\_psv}}(out, i);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00209}00209 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00210}00210         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00211}00211 \}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00212}\mbox{\hyperlink{mlx5__mr_8c_a540cf9fb17fa1310fa60f519ccdc43e9}{00212}} \mbox{\hyperlink{mlx5__mr_8c_aa498cb0b8f8b967d6cc7490f39887599}{EXPORT\_SYMBOL}}(\mbox{\hyperlink{mlx5__mr_8c_a315988ca574805767c2d9c6e1272f775}{mlx5\_core\_create\_psv}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00213}00213 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00214}\mbox{\hyperlink{driver_8h_aaa1c2d4ee1a79171669b394fbb77f5ce}{00214}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__mr_8c_aaa1c2d4ee1a79171669b394fbb77f5ce}{mlx5\_core\_destroy\_psv}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, \textcolor{keywordtype}{int} psv\_num)}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00215}00215 \{}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00216}00216         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(destroy\_psv\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00217}00217         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(destroy\_psv\_in)]      = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00218}00218 }
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00219}00219         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_psv\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a1231bfc879cae08a3e981efb31b83c76}{MLX5\_CMD\_OP\_DESTROY\_PSV}});}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00220}00220         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_psv\_in, in, psvn, psv\_num);}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00221}00221         \textcolor{keywordflow}{return} \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in, \textcolor{keyword}{sizeof}(in), out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00222}00222 \}}
\DoxyCodeLine{\Hypertarget{mlx5__mr_8c_source_l00223}\mbox{\hyperlink{mlx5__mr_8c_a5617033bbdf42379a6549d2e9477291a}{00223}} \mbox{\hyperlink{mlx5__mr_8c_aa498cb0b8f8b967d6cc7490f39887599}{EXPORT\_SYMBOL}}(\mbox{\hyperlink{mlx5__mr_8c_aaa1c2d4ee1a79171669b394fbb77f5ce}{mlx5\_core\_destroy\_psv}});}

\end{DoxyCode}
