\hypertarget{mlx5__tls_8c_source}{}\doxysection{mlx5\+\_\+tls.\+c}
\label{mlx5__tls_8c_source}\index{dev/mlx5/mlx5\_core/mlx5\_tls.c@{dev/mlx5/mlx5\_core/mlx5\_tls.c}}
\mbox{\hyperlink{mlx5__tls_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2019-\/2021, Mellanox Technologies, Ltd.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00004}00004 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00005}00005 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00006}00006 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00007}00007 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00008}00008 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00009}00009 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00010}00010 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00011}00011 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00013}00013 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00014}00014 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00015}00015 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00016}00016 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00017}00017 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00018}00018 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00019}00019 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00020}00020 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00021}00021 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00022}00022 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00023}00023 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00024}00024 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00025}00025 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00026}00026 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00027}00027 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00028}00028 \textcolor{preprocessor}{\#include "{}opt\_rss.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00029}00029 \textcolor{preprocessor}{\#include "{}opt\_ratelimit.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <linux/kernel.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <linux/module.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{driver_8h}{dev/mlx5/driver.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{tls_8h}{dev/mlx5/tls.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mlx5__core_8h}{dev/mlx5/mlx5\_core/mlx5\_core.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{transobj_8h}{dev/mlx5/mlx5\_core/transobj.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00038}\mbox{\hyperlink{mlx5__tls_8c_a12ad79d75719d67815a938331297bea1}{00038}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__tls_8c_a12ad79d75719d67815a938331297bea1}{mlx5\_encryption\_key\_create}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev, u32 pdn,}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00039}00039     \textcolor{keyword}{const} \textcolor{keywordtype}{void} *p\_key, u32 key\_len, u32 *p\_obj\_id)}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00040}00040 \{}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00041}00041         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(create\_encryption\_key\_in)] = \{\};}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00042}00042         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(create\_encryption\_key\_out)] = \{\};}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00043}00043         u64 general\_obj\_types;}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00044}00044         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00045}00045 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00046}00046         general\_obj\_types = \mbox{\hyperlink{device_8h_a5f83367d7cbbfb90c339f7d28b256f88}{MLX5\_CAP\_GEN\_64}}(mdev, general\_obj\_types);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00047}00047         \textcolor{keywordflow}{if} (!(general\_obj\_types \& \mbox{\hyperlink{mlx5__ifc_8h_a0e96acf73ec595679ffcca6fecc4d705ace5621938fec02dcb9c8656866650bda}{MLX5\_HCA\_CAP\_GENERAL\_OBJ\_TYPES\_ENCRYPTION\_KEY}}))}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00048}00048                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00050}00050         \textcolor{keywordflow}{switch} (key\_len) \{}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00051}00051         \textcolor{keywordflow}{case} 128 / 8:}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00052}00052                 memcpy(\mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(create\_encryption\_key\_in, in,}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00053}00053                     encryption\_key\_object.key[4]), p\_key, 128 / 8);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00054}00054                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_encryption\_key\_in, in, encryption\_key\_object.pd, pdn);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00055}00055                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_encryption\_key\_in, in, encryption\_key\_object.key\_size,}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00056}00056                          \mbox{\hyperlink{mlx5__ifc_8h_a223be06596dd9ff740bf0a09c8632294ae0fa65dfeda6c8ca6384f1ac7663e721}{MLX5\_GENERAL\_OBJECT\_TYPE\_ENCRYPTION\_KEY\_KEY\_SIZE\_128}});}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00057}00057                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_encryption\_key\_in, in, encryption\_key\_object.key\_type,}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00058}00058                          \mbox{\hyperlink{mlx5__ifc_8h_ac1351f3e26da80ee24b2888ecc68fca6af09ef8ca855a4e5cc6c39a7e48eb2842}{MLX5\_GENERAL\_OBJECT\_TYPE\_ENCRYPTION\_KEY\_TYPE\_DEK}});}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00059}00059                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00060}00060         \textcolor{keywordflow}{case} 256 / 8:}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00061}00061                 memcpy(\mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(create\_encryption\_key\_in, in,}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00062}00062                     encryption\_key\_object.key[0]), p\_key, 256 / 8);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00063}00063                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_encryption\_key\_in, in, encryption\_key\_object.pd, pdn);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00064}00064                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_encryption\_key\_in, in, encryption\_key\_object.key\_size,}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00065}00065                          \mbox{\hyperlink{mlx5__ifc_8h_a223be06596dd9ff740bf0a09c8632294a5456492572bfefe0a09aa190376feba0}{MLX5\_GENERAL\_OBJECT\_TYPE\_ENCRYPTION\_KEY\_KEY\_SIZE\_256}});}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00066}00066                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_encryption\_key\_in, in, encryption\_key\_object.key\_type,}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00067}00067                          \mbox{\hyperlink{mlx5__ifc_8h_ac1351f3e26da80ee24b2888ecc68fca6af09ef8ca855a4e5cc6c39a7e48eb2842}{MLX5\_GENERAL\_OBJECT\_TYPE\_ENCRYPTION\_KEY\_TYPE\_DEK}});}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00068}00068                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00069}00069         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00070}00070                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00071}00071         \}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00072}00072 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00073}00073         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_encryption\_key\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a4cec65632507a48bfac46d7f86b541e3}{MLX5\_CMD\_OP\_CREATE\_GENERAL\_OBJ}});}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00074}00074         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_encryption\_key\_in, in, obj\_type, \mbox{\hyperlink{mlx5__ifc_8h_aa35bbc7be42569ff9ba436cf05942ce6aceccfe2e8d0de5581447b667ee4c2967}{MLX5\_GENERAL\_OBJECT\_TYPES\_ENCRYPTION\_KEY}});}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00076}00076         err = \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(mdev, in, \textcolor{keyword}{sizeof}(in), out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00077}00077         \textcolor{keywordflow}{if} (err == 0)}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00078}00078                 *p\_obj\_id = \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(create\_encryption\_key\_out, out, obj\_id);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00079}00079 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00080}00080         \textcolor{comment}{/* avoid leaking key on the stack */}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00081}00081         memset(in, 0, \textcolor{keyword}{sizeof}(in));}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00083}00083         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00084}00084 \}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00085}00085 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00086}\mbox{\hyperlink{mlx5__tls_8c_acaf4b93cdf33dbdbd90fa3d3de424803}{00086}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__tls_8c_acaf4b93cdf33dbdbd90fa3d3de424803}{mlx5\_encryption\_key\_destroy}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev, u32 oid)}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00087}00087 \{}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00088}00088         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(destroy\_encryption\_key\_in)] = \{\};}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00089}00089         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(destroy\_encryption\_key\_out)] = \{\};}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00091}00091         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_encryption\_key\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a6f3a58f3f7f83b53984fc5990a2c0fb0}{MLX5\_CMD\_OP\_DESTROY\_GENERAL\_OBJ}});}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00092}00092         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_encryption\_key\_in, in, obj\_type, \mbox{\hyperlink{mlx5__ifc_8h_aa35bbc7be42569ff9ba436cf05942ce6aceccfe2e8d0de5581447b667ee4c2967}{MLX5\_GENERAL\_OBJECT\_TYPES\_ENCRYPTION\_KEY}});}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00093}00093         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_encryption\_key\_in, in, obj\_id, oid);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00094}00094 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00095}00095         \textcolor{keywordflow}{return} \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(mdev, in, \textcolor{keyword}{sizeof}(in), out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00096}00096 \}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00097}00097 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00098}\mbox{\hyperlink{mlx5__tls_8c_a04f53bbfd8f233950819b6f81ccf1a64}{00098}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__tls_8c_a04f53bbfd8f233950819b6f81ccf1a64}{mlx5\_tls\_open\_tis}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev, \textcolor{keywordtype}{int} \mbox{\hyperlink{en_8h_a0cea5104d05c6d3949115ddd0eed432e}{tc}}, \textcolor{keywordtype}{int} tdn, \textcolor{keywordtype}{int} pdn, u32 *p\_tisn)}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00099}00099 \{}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00100}00100         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(create\_tis\_in)] = \{\};}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00101}00101         \textcolor{keywordtype}{void} *tisc = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(create\_tis\_in, in, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}});}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00102}00102         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00103}00103 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00104}00104         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(tisc, tisc, prio, \mbox{\hyperlink{en_8h_a0cea5104d05c6d3949115ddd0eed432e}{tc}});}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00105}00105         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(tisc, tisc, transport\_domain, tdn);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00106}00106         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(tisc, tisc, tls\_en, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00107}00107         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(tisc, tisc, pd, pdn);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00109}00109         err = \mbox{\hyperlink{mlx5__transobj_8c_af54739f9cb48038030be4f6d57ebd898}{mlx5\_core\_create\_tis}}(mdev, in, \textcolor{keyword}{sizeof}(in), p\_tisn);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00110}00110         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00111}00111                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00112}00112         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (*p\_tisn == 0)}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00113}00113                 \textcolor{keywordflow}{return} (-\/EINVAL);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00114}00114         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00115}00115                 \textcolor{keywordflow}{return} (0);     \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00116}00116 \}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00117}00117 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00118}\mbox{\hyperlink{mlx5__tls_8c_abe216d2526d653b1858bb2eea6b7a2ab}{00118}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__tls_8c_abe216d2526d653b1858bb2eea6b7a2ab}{mlx5\_tls\_close\_tis}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev, u32 \mbox{\hyperlink{en__hw__tls_8h_a33d586020a05722555d43c4e38a3d3bc}{tisn}})}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00119}00119 \{}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00121}00121         \mbox{\hyperlink{mlx5__transobj_8c_a5ee965b5ac0bd9938614a60a7752bc77}{mlx5\_core\_destroy\_tis}}(mdev, \mbox{\hyperlink{en__hw__tls_8h_a33d586020a05722555d43c4e38a3d3bc}{tisn}}, 0);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00122}00122 \}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00123}00123 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00124}\mbox{\hyperlink{mlx5__tls_8c_adeaad2fdb6996fab9304d2840626c5c0}{00124}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__tls_8c_adeaad2fdb6996fab9304d2840626c5c0}{mlx5\_tls\_open\_tir}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev, \textcolor{keywordtype}{int} tdn, \textcolor{keywordtype}{int} \mbox{\hyperlink{en_8h_aab1d72225f1261399d9944a11816f74d}{rqtn}}, u32 *p\_tirn)}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00125}00125 \{}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00126}00126         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(create\_tir\_in)] = \{\};}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00127}00127         \textcolor{keywordtype}{void} *tirc = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(create\_tir\_in, in, tir\_context);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00128}00128         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00129}00129 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00130}00130         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(tirc, tirc, transport\_domain, tdn);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00131}00131         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(tirc, tirc, disp\_type, \mbox{\hyperlink{mlx5__ifc_8h_ae7c221b877c671251f317a43dbea2583a6a81ec6f28aa701f39ee10e3cc712c35}{MLX5\_TIRC\_DISP\_TYPE\_INDIRECT}});}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00132}00132         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(tirc, tirc, rx\_hash\_fn, \mbox{\hyperlink{mlx5__ifc_8h_a6d8d14defa336cd0180dccd1e0170dd5aaa4605c94bb04eee9cd761e204590b42}{MLX5\_TIRC\_RX\_HASH\_FN\_HASH\_INVERTED\_XOR8}});}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00133}00133         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(tirc, tirc, indirect\_table, \mbox{\hyperlink{en_8h_aab1d72225f1261399d9944a11816f74d}{rqtn}});}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00134}00134         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(tirc, tirc, tls\_en, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00135}00135         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(tirc, tirc, self\_lb\_en,}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00136}00136                  \mbox{\hyperlink{mlx5__ifc_8h_a48b7364b5ceec8a2d131dc2cf2587628a0a640af86b8ed85748d3aab23fdad78f}{MLX5\_TIRC\_SELF\_LB\_EN\_ENABLE\_UNICAST}} |}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00137}00137                  \mbox{\hyperlink{mlx5__ifc_8h_a48b7364b5ceec8a2d131dc2cf2587628aa00f8fb02cef453e47f84096f0824088}{MLX5\_TIRC\_SELF\_LB\_EN\_ENABLE\_MULTICAST}});}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00138}00138 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00139}00139         err = \mbox{\hyperlink{mlx5__transobj_8c_adc82885b68cd8c07fb47826aede2c4b3}{mlx5\_core\_create\_tir}}(mdev, in, \textcolor{keyword}{sizeof}(in), p\_tirn);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00140}00140         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00141}00141                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00142}00142         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (*p\_tirn == 0)}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00143}00143                 \textcolor{keywordflow}{return} (-\/EINVAL);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00144}00144         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00145}00145                 \textcolor{keywordflow}{return} (0);     \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00146}00146 \}}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00148}\mbox{\hyperlink{mlx5__tls_8c_af92381f137a851572518e9d4e5129304}{00148}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__tls_8c_af92381f137a851572518e9d4e5129304}{mlx5\_tls\_close\_tir}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev, u32 \mbox{\hyperlink{en__hw__tls__rx_8h_aa62e8a451871642b40879686a141fd20}{tirn}})}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00149}00149 \{}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00150}00150         \mbox{\hyperlink{mlx5__transobj_8c_a563b8d8a20d29e15bafa91c704c68d0e}{mlx5\_core\_destroy\_tir}}(mdev, \mbox{\hyperlink{en__hw__tls__rx_8h_aa62e8a451871642b40879686a141fd20}{tirn}}, 0);}
\DoxyCodeLine{\Hypertarget{mlx5__tls_8c_source_l00151}00151 \}}

\end{DoxyCode}
