\hypertarget{mlx5__en__hw__tls_8c_source}{}\doxysection{mlx5\+\_\+en\+\_\+hw\+\_\+tls.\+c}
\label{mlx5__en__hw__tls_8c_source}\index{dev/mlx5/mlx5\_en/mlx5\_en\_hw\_tls.c@{dev/mlx5/mlx5\_en/mlx5\_en\_hw\_tls.c}}
\mbox{\hyperlink{mlx5__en__hw__tls_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2019-\/2021 Mellanox Technologies. All rights reserved.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00003}00003 \textcolor{comment}{ * Copyright (c) 2022 NVIDIA corporation \& affiliates.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00004}00004 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00005}00005 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00006}00006 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00007}00007 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00008}00008 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00009}00009 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00010}00010 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00012}00012 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00013}00013 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00014}00014 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00015}00015 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00016}00016 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00017}00017 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00018}00018 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00019}00019 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00020}00020 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00021}00021 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00022}00022 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00023}00023 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00024}00024 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00025}00025 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00026}00026 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00029}00029 \textcolor{preprocessor}{\#include "{}opt\_kern\_tls.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00030}00030 \textcolor{preprocessor}{\#include "{}opt\_rss.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00031}00031 \textcolor{preprocessor}{\#include "{}opt\_ratelimit.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00032}00032 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{en_8h}{dev/mlx5/mlx5\_en/en.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{tls_8h}{dev/mlx5/tls.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00036}00036 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <linux/delay.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/ktls.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <opencrypto/cryptodev.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00040}00040 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00041}00041 \textcolor{preprocessor}{\#ifdef KERN\_TLS}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00042}00042 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00043}00043 \textcolor{preprocessor}{\#ifdef RATELIMIT}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00044}00044 \textcolor{keyword}{static} if\_snd\_tag\_modify\_t mlx5e\_tls\_rl\_snd\_tag\_modify;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00045}00045 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00046}00046 \textcolor{keyword}{static} if\_snd\_tag\_query\_t mlx5e\_tls\_snd\_tag\_query;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00047}00047 \textcolor{keyword}{static} if\_snd\_tag\_free\_t mlx5e\_tls\_snd\_tag\_free;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00048}00048 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00049}00049 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }if\_snd\_tag\_sw mlx5e\_tls\_snd\_tag\_sw = \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00050}00050         .snd\_tag\_query = mlx5e\_tls\_snd\_tag\_query,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00051}00051         .snd\_tag\_free = mlx5e\_tls\_snd\_tag\_free,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00052}00052         .type = IF\_SND\_TAG\_TYPE\_TLS}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00053}00053 \};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00055}00055 \textcolor{preprocessor}{\#ifdef RATELIMIT}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00056}00056 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }if\_snd\_tag\_sw mlx5e\_tls\_rl\_snd\_tag\_sw = \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00057}00057         .snd\_tag\_modify = mlx5e\_tls\_rl\_snd\_tag\_modify,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00058}00058         .snd\_tag\_query = mlx5e\_tls\_snd\_tag\_query,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00059}00059         .snd\_tag\_free = mlx5e\_tls\_snd\_tag\_free,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00060}00060         .type = IF\_SND\_TAG\_TYPE\_TLS\_RATE\_LIMIT}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00061}00061 \};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00062}00062 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00063}00063 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00064}00064 \mbox{\hyperlink{mlx5__en__main_8c_a896a7cfa8964247cfca28272de2572da}{MALLOC\_DEFINE}}(M\_MLX5E\_TLS, \textcolor{stringliteral}{"{}MLX5E\_TLS"{}}, \textcolor{stringliteral}{"{}MLX5 ethernet HW TLS"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00065}00065 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00066}00066 \textcolor{comment}{/* software TLS context */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00067}00067 \textcolor{keyword}{struct }mlx5\_ifc\_sw\_tls\_cntx\_bits \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00068}00068         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ifc__tls__static__params__bits}{mlx5\_ifc\_tls\_static\_params\_bits}} param;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00069}00069         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ifc__tls__progress__params__bits}{mlx5\_ifc\_tls\_progress\_params\_bits}} progress;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00070}00070         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00071}00071                 uint8\_t key\_data[8][0x20];}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00072}00072                 uint8\_t key\_len[0x20];}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00073}00073         \} key;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00074}00074 \};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00076}00076 \mbox{\hyperlink{device_8h_a304bfae1ba4b2b82404598b5304e1f1f}{CTASSERT}}(\mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(sw\_tls\_cntx) <= \textcolor{keyword}{sizeof}(((\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}} *)0)-\/>crypto\_params));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00077}00077 \mbox{\hyperlink{device_8h_a304bfae1ba4b2b82404598b5304e1f1f}{CTASSERT}}(\mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(mkc) == \textcolor{keyword}{sizeof}(((\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tx__umr__wqe}{mlx5e\_tx\_umr\_wqe}} *)0)-\/>mkc));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00078}00078 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00079}00079 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *mlx5e\_tls\_stats\_desc[] = \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00080}00080         \mbox{\hyperlink{en__hw__tls_8h_aaaba2c3e4b6c666ccc2d0fac7aa46c76}{MLX5E\_TLS\_STATS}}(\mbox{\hyperlink{en_8h_af4656c8e301a23dbeeedaafa0d11ed58}{MLX5E\_STATS\_DESC}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00081}00081 \};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00083}00083 \textcolor{keyword}{static} \textcolor{keywordtype}{void} mlx5e\_tls\_work(\textcolor{keyword}{struct} work\_struct *);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00084}00084 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00085}00085 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00086}00086 mlx5e\_tls\_tag\_import(\textcolor{keywordtype}{void} *arg, \textcolor{keywordtype}{void} **store, \textcolor{keywordtype}{int} cnt, \textcolor{keywordtype}{int} domain, \textcolor{keywordtype}{int} flags)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00087}00087 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00088}00088         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}} *ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00089}00089         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00091}00091         \textcolor{keywordflow}{for} (i = 0; i != cnt; i++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00092}00092                 ptag = malloc\_domainset(\textcolor{keyword}{sizeof}(*ptag), M\_MLX5E\_TLS,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00093}00093                     \mbox{\hyperlink{driver_8h_aaafcfeb207aa2c90303af921f2c3ade8}{mlx5\_dev\_domainset}}(arg), flags | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00094}00094                 mtx\_init(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a631bdfee33619f55827b7ac12c4014d5}{mtx}}, \textcolor{stringliteral}{"{}mlx5-\/tls-\/tag-\/mtx"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00095}00095                 INIT\_WORK(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a30adaf20fdd439d8fbba17b783154933}{work}}, mlx5e\_tls\_work);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00096}00096                 store[i] = ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00097}00097         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00098}00098         \textcolor{keywordflow}{return} (i);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00099}00099 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00100}00100 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00101}00101 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00102}00102 mlx5e\_tls\_tag\_release(\textcolor{keywordtype}{void} *arg, \textcolor{keywordtype}{void} **store, \textcolor{keywordtype}{int} cnt)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00103}00103 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00104}00104         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}} *ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00105}00105         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00106}00106         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls}{mlx5e\_tls}} *ptls;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00107}00107         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00109}00109         \textcolor{keywordflow}{for} (i = 0; i != cnt; i++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00110}00110                 ptag = store[i];}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00111}00111                 ptls = ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0158ae56cb4bb035958a3fa39d81e69b}{tls}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00112}00112                 \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}} = container\_of(ptls, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}}, \mbox{\hyperlink{en__hw__tls_8h_a8e820422ca7fcc65f8f4af68d85635ac}{tls}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00113}00113 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00114}00114                 flush\_work(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a30adaf20fdd439d8fbba17b783154933}{work}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00115}00115 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00116}00116                 \textcolor{keywordflow}{if} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_ab1b60e86fa261a489bdc02757a42d3e0}{tisn}} != 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00117}00117                         \mbox{\hyperlink{mlx5__tls_8c_abe216d2526d653b1858bb2eea6b7a2ab}{mlx5\_tls\_close\_tis}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_ab1b60e86fa261a489bdc02757a42d3e0}{tisn}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00118}00118                         atomic\_add\_32(\&ptls-\/>\mbox{\hyperlink{structmlx5e__tls_afc853cefce16754b25bae4aa41a6d216}{num\_resources}}, -\/1U);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00119}00119                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00121}00121                 mtx\_destroy(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a631bdfee33619f55827b7ac12c4014d5}{mtx}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00122}00122 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00123}00123                 free(ptag, M\_MLX5E\_TLS);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00124}00124         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00125}00125 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00126}00126 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00127}00127 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00128}00128 mlx5e\_tls\_tag\_zfree(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}} *ptag)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00129}00129 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00130}00130         \textcolor{comment}{/* make sure any unhandled taskqueue events are ignored */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00131}00131         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0f9ae93e71b30fc9918111edd16d5043}{state}} = \mbox{\hyperlink{en__hw__tls_8h_acea590affc44d46fc1699c898596e723}{MLX5E\_TLS\_ST\_FREED}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00132}00132 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00133}00133         \textcolor{comment}{/* reset some variables */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00134}00134         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_aaea036cbd1bcf912136ce3139668f16e}{dek\_index}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00135}00135         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a9ea9f5723abb7a05e1aedfab0ec93b41}{dek\_index\_ok}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00136}00136 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00137}00137         \textcolor{comment}{/* avoid leaking keys */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00138}00138         memset(ptag-\/>crypto\_params, 0, \textcolor{keyword}{sizeof}(ptag-\/>crypto\_params));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00139}00139 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00140}00140         \textcolor{comment}{/* update number of TIS contexts */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00141}00141         \textcolor{keywordflow}{if} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_ab1b60e86fa261a489bdc02757a42d3e0}{tisn}} == 0)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00142}00142                 atomic\_add\_32(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0158ae56cb4bb035958a3fa39d81e69b}{tls}}-\/>\mbox{\hyperlink{structmlx5e__tls_afc853cefce16754b25bae4aa41a6d216}{num\_resources}}, -\/1U);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00143}00143 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00144}00144         \textcolor{comment}{/* return tag to UMA */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00145}00145         uma\_zfree(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0158ae56cb4bb035958a3fa39d81e69b}{tls}}-\/>\mbox{\hyperlink{structmlx5e__tls_acb221ad66d3d72a72c3655f82fe4037a}{zone}}, ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00146}00146 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00148}00148 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00149}00149 \mbox{\hyperlink{mlx5__en__hw__tls_8c_a11b8a3142a6a1b57e37f741213f994c5}{mlx5e\_tls\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00150}00150 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00151}00151         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls}{mlx5e\_tls}} *ptls = \&\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a5fc53857b1601a2cc0d9f8731405d8b1}{tls}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00152}00152         \textcolor{keyword}{struct }sysctl\_oid *node;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00153}00153         uint32\_t x;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00154}00154 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00155}00155         \textcolor{keywordflow}{if} (\mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, tls\_tx) == 0 ||}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00156}00156             \mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, log\_max\_dek) == 0)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00157}00157                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00158}00158 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00159}00159         ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a464fc84e76e3dbbdedeb23988b332c6f}{wq}} = create\_singlethread\_workqueue(\textcolor{stringliteral}{"{}mlx5-\/tls-\/wq"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00160}00160         \textcolor{keywordflow}{if} (ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a464fc84e76e3dbbdedeb23988b332c6f}{wq}} == NULL)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00161}00161                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00162}00162 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00163}00163         sysctl\_ctx\_init(\&ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a30be56261b387174eed85135e2fb0eee}{ctx}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00164}00164 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00165}00165         snprintf(ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a48962e9d003efd82cc1560db23f1e12f}{zname}}, \textcolor{keyword}{sizeof}(ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a48962e9d003efd82cc1560db23f1e12f}{zname}}),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00166}00166             \textcolor{stringliteral}{"{}mlx5\_\%u\_tls"{}}, device\_get\_unit(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}-\/>\mbox{\hyperlink{structmlx5__core__dev_a0819dc9fa4983c9140507e1a02aa8313}{pdev}}-\/>dev.bsddev));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00167}00167 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00168}00168         ptls-\/>\mbox{\hyperlink{structmlx5e__tls_acb221ad66d3d72a72c3655f82fe4037a}{zone}} = uma\_zcache\_create(ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a48962e9d003efd82cc1560db23f1e12f}{zname}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00169}00169              \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}}), NULL, NULL, NULL, NULL,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00170}00170              mlx5e\_tls\_tag\_import, mlx5e\_tls\_tag\_release, \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00171}00171              UMA\_ZONE\_UNMANAGED);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00172}00172 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00173}00173         \textcolor{comment}{/* shared between RX and TX TLS */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00174}00174         ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a7ba8e1c23b6d36b9dd44835b71d30a63}{max\_resources}} = 1U << (\mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, log\_max\_dek) -\/ 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00175}00175 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00176}00176         \textcolor{keywordflow}{for} (x = 0; x != \mbox{\hyperlink{en__hw__tls_8h_abb2ccbd5d41510138b7ea20705f8d801}{MLX5E\_TLS\_STATS\_NUM}}; x++)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00177}00177                 ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a0c55cb52cd4080accf3cbe1f703a6c4c}{stats}}.\mbox{\hyperlink{structmlx5e__tls__stats_a62d51aa37918158c24aca85e07659e4f}{arg}}[x] = counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00178}00178 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00179}00179         ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a27568169f9754fb2a4bd4b0474fa8f60}{init}} = 1;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00180}00180 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00181}00181         node = SYSCTL\_ADD\_NODE(\&\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_ab8f466ca91f232b49ea361c662c6b0d2}{sysctl\_ctx}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00182}00182             SYSCTL\_CHILDREN(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_ae61717d6358ea9565ea0dcc3ef683d67}{sysctl\_ifnet}}), OID\_AUTO,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00183}00183             \textcolor{stringliteral}{"{}tls"{}}, CTLFLAG\_RW | CTLFLAG\_MPSAFE, NULL, \textcolor{stringliteral}{"{}Hardware TLS offload"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00184}00184         \textcolor{keywordflow}{if} (node == NULL)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00185}00185                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00186}00186 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00187}00187         \mbox{\hyperlink{en_8h_aa2ad7d69980d8530a8d52f4a155bccf9}{mlx5e\_create\_counter\_stats}}(\&ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a30be56261b387174eed85135e2fb0eee}{ctx}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00188}00188             SYSCTL\_CHILDREN(node), \textcolor{stringliteral}{"{}stats"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00189}00189             mlx5e\_tls\_stats\_desc, \mbox{\hyperlink{en__hw__tls_8h_abb2ccbd5d41510138b7ea20705f8d801}{MLX5E\_TLS\_STATS\_NUM}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00190}00190             ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a0c55cb52cd4080accf3cbe1f703a6c4c}{stats}}.\mbox{\hyperlink{structmlx5e__tls__stats_a62d51aa37918158c24aca85e07659e4f}{arg}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00191}00191 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00192}00192         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00193}00193 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00194}00194 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00195}00195 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00196}00196 \mbox{\hyperlink{mlx5__en__hw__tls_8c_a4d23cde6f7bb70d19e04b4f028567f30}{mlx5e\_tls\_cleanup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00197}00197 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00198}00198         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls}{mlx5e\_tls}} *ptls = \&\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a5fc53857b1601a2cc0d9f8731405d8b1}{tls}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00199}00199         uint32\_t x;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00200}00200 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00201}00201         \textcolor{keywordflow}{if} (ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a27568169f9754fb2a4bd4b0474fa8f60}{init}} == 0)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00202}00202                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00203}00203 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00204}00204         ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a27568169f9754fb2a4bd4b0474fa8f60}{init}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00205}00205         flush\_workqueue(ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a464fc84e76e3dbbdedeb23988b332c6f}{wq}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00206}00206         sysctl\_ctx\_free(\&ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a30be56261b387174eed85135e2fb0eee}{ctx}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00207}00207         uma\_zdestroy(ptls-\/>\mbox{\hyperlink{structmlx5e__tls_acb221ad66d3d72a72c3655f82fe4037a}{zone}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00208}00208         destroy\_workqueue(ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a464fc84e76e3dbbdedeb23988b332c6f}{wq}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00209}00209 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00210}00210         \textcolor{comment}{/* check if all resources are freed */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00211}00211         MPASS(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a5fc53857b1601a2cc0d9f8731405d8b1}{tls}}.\mbox{\hyperlink{structmlx5e__tls_afc853cefce16754b25bae4aa41a6d216}{num\_resources}} == 0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00212}00212 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00213}00213         \textcolor{keywordflow}{for} (x = 0; x != \mbox{\hyperlink{en__hw__tls_8h_abb2ccbd5d41510138b7ea20705f8d801}{MLX5E\_TLS\_STATS\_NUM}}; x++)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00214}00214                 counter\_u64\_free(ptls-\/>\mbox{\hyperlink{structmlx5e__tls_a0c55cb52cd4080accf3cbe1f703a6c4c}{stats}}.\mbox{\hyperlink{structmlx5e__tls__stats_a62d51aa37918158c24aca85e07659e4f}{arg}}[x]);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00215}00215 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00216}00216 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00217}00217 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00218}00218 mlx5e\_tls\_work(\textcolor{keyword}{struct} work\_struct *\mbox{\hyperlink{en__hw__tls_8h_a623997e11b94d7c467ce26627cc488a2}{work}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00219}00219 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00220}00220         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}} *ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00221}00221         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00222}00222         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00223}00223 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00224}00224         ptag = container\_of(\mbox{\hyperlink{en__hw__tls_8h_a623997e11b94d7c467ce26627cc488a2}{work}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}}, \mbox{\hyperlink{en__hw__tls_8h_a623997e11b94d7c467ce26627cc488a2}{work}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00225}00225         \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}} = container\_of(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0158ae56cb4bb035958a3fa39d81e69b}{tls}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}}, \mbox{\hyperlink{en__hw__tls_8h_a8e820422ca7fcc65f8f4af68d85635ac}{tls}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00226}00226 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00227}00227         \textcolor{keywordflow}{switch} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0f9ae93e71b30fc9918111edd16d5043}{state}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00228}00228         \textcolor{keywordflow}{case} \mbox{\hyperlink{en__hw__tls_8h_acc9d4d096c0e45150bed2d65540b3e99}{MLX5E\_TLS\_ST\_INIT}}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00229}00229                 \textcolor{comment}{/* try to open TIS, if not present */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00230}00230                 \textcolor{keywordflow}{if} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_ab1b60e86fa261a489bdc02757a42d3e0}{tisn}} == 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00231}00231                         err = \mbox{\hyperlink{mlx5__tls_8c_a04f53bbfd8f233950819b6f81ccf1a64}{mlx5\_tls\_open\_tis}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, 0, \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a8b1627033e2f64d0e3720f368a615014}{tdn}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00232}00232                             \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a9fb017d5f0afd3f0a0c96c22bd6e8ac6}{pdn}}, \&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_ab1b60e86fa261a489bdc02757a42d3e0}{tisn}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00233}00233                         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00234}00234                                 \mbox{\hyperlink{en__hw__tls_8h_a164e6e9a196ecb4e59a904dca8fdf8c3}{MLX5E\_TLS\_STAT\_INC}}(ptag, tx\_error, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00235}00235                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00236}00236                         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00237}00237                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00238}00238                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_cntx, ptag-\/>crypto\_params, progress.pd, ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_ab1b60e86fa261a489bdc02757a42d3e0}{tisn}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00239}00239 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00240}00240                 \textcolor{comment}{/* try to allocate a DEK context ID */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00241}00241                 err = \mbox{\hyperlink{mlx5__tls_8c_a12ad79d75719d67815a938331297bea1}{mlx5\_encryption\_key\_create}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a9fb017d5f0afd3f0a0c96c22bd6e8ac6}{pdn}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00242}00242                     \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(sw\_tls\_cntx, ptag-\/>crypto\_params, key.key\_data),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00243}00243                     \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(sw\_tls\_cntx, ptag-\/>crypto\_params, key.key\_len),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00244}00244                     \&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_aaea036cbd1bcf912136ce3139668f16e}{dek\_index}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00245}00245                 \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00246}00246                         \mbox{\hyperlink{en__hw__tls_8h_a164e6e9a196ecb4e59a904dca8fdf8c3}{MLX5E\_TLS\_STAT\_INC}}(ptag, tx\_error, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00247}00247                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00248}00248                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00249}00249 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00250}00250                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_cntx, ptag-\/>crypto\_params, param.\mbox{\hyperlink{structmlx5e__tls__tag_aaea036cbd1bcf912136ce3139668f16e}{dek\_index}}, ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_aaea036cbd1bcf912136ce3139668f16e}{dek\_index}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00252}00252                 ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a9ea9f5723abb7a05e1aedfab0ec93b41}{dek\_index\_ok}} = 1;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00253}00253 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00254}00254                 \mbox{\hyperlink{en__hw__tls_8h_ac1cc18c455c078442e8ae44e30e3e41d}{MLX5E\_TLS\_TAG\_LOCK}}(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00255}00255                 \textcolor{keywordflow}{if} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0f9ae93e71b30fc9918111edd16d5043}{state}} == \mbox{\hyperlink{en__hw__tls_8h_acc9d4d096c0e45150bed2d65540b3e99}{MLX5E\_TLS\_ST\_INIT}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00256}00256                         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0f9ae93e71b30fc9918111edd16d5043}{state}} = \mbox{\hyperlink{en__hw__tls_8h_a0fec11db3200b53dd5c117cced32337b}{MLX5E\_TLS\_ST\_SETUP}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00257}00257                 \mbox{\hyperlink{en__hw__tls_8h_afc3cd24b7d3e4ff351452327fe9c7139}{MLX5E\_TLS\_TAG\_UNLOCK}}(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00258}00258                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00259}00259 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00260}00260         \textcolor{keywordflow}{case} \mbox{\hyperlink{en__hw__tls_8h_afdb7125e537bb0162d736637b66af376}{MLX5E\_TLS\_ST\_RELEASE}}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00261}00261                 \textcolor{comment}{/* try to destroy DEK context by ID */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00262}00262                 \textcolor{keywordflow}{if} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a9ea9f5723abb7a05e1aedfab0ec93b41}{dek\_index\_ok}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00263}00263                         err = \mbox{\hyperlink{mlx5__tls_8c_acaf4b93cdf33dbdbd90fa3d3de424803}{mlx5\_encryption\_key\_destroy}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_aaea036cbd1bcf912136ce3139668f16e}{dek\_index}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00264}00264 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00265}00265                 \textcolor{comment}{/* free tag */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00266}00266                 mlx5e\_tls\_tag\_zfree(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00267}00267                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00268}00268 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00269}00269         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00270}00270                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00271}00271         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00272}00272 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00273}00273 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00274}00274 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00275}00275 mlx5e\_tls\_set\_params(\textcolor{keywordtype}{void} *\mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, \textcolor{keyword}{const} \textcolor{keyword}{struct} tls\_session\_params *en)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00276}00276 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00277}00277 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00278}00278         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, param.const\_2, 2);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00279}00279         \textcolor{keywordflow}{if} (en-\/>tls\_vminor == TLS\_MINOR\_VER\_TWO)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00280}00280                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, param.tls\_version, 2); \textcolor{comment}{/* v1.2 */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00281}00281         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00282}00282                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, param.tls\_version, 3); \textcolor{comment}{/* v1.3 */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00283}00283         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, param.const\_1, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00284}00284         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, param.encryption\_standard, 1); \textcolor{comment}{/* TLS */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00285}00285 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00286}00286         \textcolor{comment}{/* copy the initial vector in place */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00287}00287         \textcolor{keywordflow}{switch} (en-\/>iv\_len) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00288}00288         \textcolor{keywordflow}{case} \mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_cntx, param.gcm\_iv):}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00289}00289         case \mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_cntx, param.gcm\_iv) +}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00290}00290              \mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_cntx, param.implicit\_iv):}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00291}00291                 memcpy(\mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(sw\_tls\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, param.gcm\_iv),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00292}00292                     en-\/>iv, en-\/>iv\_len);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00293}00293                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00294}00294         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00295}00295                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00296}00296         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00297}00297 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00298}00298         \textcolor{keywordflow}{if} (en-\/>cipher\_key\_len <= \mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_cntx, key.key\_data)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00299}00299                 memcpy(\mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(sw\_tls\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, key.key\_data),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00300}00300                     en-\/>cipher\_key, en-\/>cipher\_key\_len);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00301}00301                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, key.key\_len, en-\/>cipher\_key\_len);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00302}00302         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00303}00303                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00304}00304         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00305}00305         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00306}00306 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00307}00307 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00308}00308 \textcolor{comment}{/* Verify zero default */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00309}00309 \mbox{\hyperlink{device_8h_a304bfae1ba4b2b82404598b5304e1f1f}{CTASSERT}}(\mbox{\hyperlink{en__hw__tls_8h_acc9d4d096c0e45150bed2d65540b3e99}{MLX5E\_TLS\_ST\_INIT}} == 0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00310}00310 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00311}00311 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00312}00312 \mbox{\hyperlink{en__hw__tls_8h_a835c4aac14d32d191aa2af819a46392a}{mlx5e\_tls\_snd\_tag\_alloc}}(\textcolor{keyword}{struct} ifnet *\mbox{\hyperlink{en_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00313}00313     \textcolor{keyword}{union} if\_snd\_tag\_alloc\_params *\mbox{\hyperlink{structmlx5e__priv_a082db7e920f50827afe0cf93857b5043}{params}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00314}00314     \textcolor{keyword}{struct} m\_snd\_tag **ppmt)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00315}00315 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00316}00316         \textcolor{keyword}{union }if\_snd\_tag\_alloc\_params rl\_params;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00317}00317         \textcolor{keyword}{const} \textcolor{keyword}{struct }if\_snd\_tag\_sw *snd\_tag\_sw;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00318}00318         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00319}00319         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}} *ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00320}00320         \textcolor{keyword}{const} \textcolor{keyword}{struct }tls\_session\_params *en;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00321}00321         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00322}00322 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00323}00323         \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}} = \mbox{\hyperlink{en_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00324}00324 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00325}00325         \textcolor{keywordflow}{if} (\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a4795b5a0fa2d0a63a36e40c448f9f50b}{gone}} != 0 || \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a5fc53857b1601a2cc0d9f8731405d8b1}{tls}}.\mbox{\hyperlink{structmlx5e__tls_a27568169f9754fb2a4bd4b0474fa8f60}{init}} == 0)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00326}00326                 \textcolor{keywordflow}{return} (EOPNOTSUPP);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00327}00327 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00328}00328         \textcolor{comment}{/* allocate new tag from zone, if any */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00329}00329         ptag = uma\_zalloc(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a5fc53857b1601a2cc0d9f8731405d8b1}{tls}}.\mbox{\hyperlink{structmlx5e__tls_acb221ad66d3d72a72c3655f82fe4037a}{zone}}, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00330}00330         \textcolor{keywordflow}{if} (ptag == NULL)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00331}00331                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00332}00332 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00333}00333         \textcolor{comment}{/* sanity check default values */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00334}00334         MPASS(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_aaea036cbd1bcf912136ce3139668f16e}{dek\_index}} == 0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00335}00335         MPASS(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a9ea9f5723abb7a05e1aedfab0ec93b41}{dek\_index\_ok}} == 0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00336}00336 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00337}00337         \textcolor{comment}{/* setup TLS tag */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00338}00338         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0158ae56cb4bb035958a3fa39d81e69b}{tls}} = \&\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a5fc53857b1601a2cc0d9f8731405d8b1}{tls}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00339}00339 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00340}00340         \textcolor{comment}{/* check if there is no TIS context */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00341}00341         \textcolor{keywordflow}{if} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_ab1b60e86fa261a489bdc02757a42d3e0}{tisn}} == 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00342}00342                 uint32\_t value;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00343}00343 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00344}00344                 value = atomic\_fetchadd\_32(\&\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a5fc53857b1601a2cc0d9f8731405d8b1}{tls}}.\mbox{\hyperlink{structmlx5e__tls_afc853cefce16754b25bae4aa41a6d216}{num\_resources}}, 1U);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00345}00345 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00346}00346                 \textcolor{comment}{/* check resource limits */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00347}00347                 \textcolor{keywordflow}{if} (value >= \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a5fc53857b1601a2cc0d9f8731405d8b1}{tls}}.\mbox{\hyperlink{structmlx5e__tls_a7ba8e1c23b6d36b9dd44835b71d30a63}{max\_resources}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00348}00348                         error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00349}00349                         \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00350}00350                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00351}00351         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00352}00352 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00353}00353         en = \&params-\/>tls.tls-\/>params;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00354}00354 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00355}00355         \textcolor{comment}{/* only TLS v1.2 and v1.3 is currently supported */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00356}00356         \textcolor{keywordflow}{if} (en-\/>tls\_vmajor != TLS\_MAJOR\_VER\_ONE ||}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00357}00357             (en-\/>tls\_vminor != TLS\_MINOR\_VER\_TWO}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00358}00358 \#ifdef TLS\_MINOR\_VER\_THREE}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00359}00359              \&\& en-\/>tls\_vminor != TLS\_MINOR\_VER\_THREE}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00360}00360 \#endif}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00361}00361              )) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00362}00362                 error = EPROTONOSUPPORT;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00363}00363                 \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00364}00364         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00365}00365 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00366}00366         \textcolor{keywordflow}{switch} (en-\/>cipher\_algorithm) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00367}00367         \textcolor{keywordflow}{case} CRYPTO\_AES\_NIST\_GCM\_16:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00368}00368                 \textcolor{keywordflow}{switch} (en-\/>cipher\_key\_len) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00369}00369                 \textcolor{keywordflow}{case} 128 / 8:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00370}00370                         \textcolor{keywordflow}{if} (en-\/>tls\_vminor == TLS\_MINOR\_VER\_TWO) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00371}00371                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{device_8h_abb3a60f881889fe61a749759d05357eca74da7cae9b317b559aef54ba619eeb85}{MLX5\_CAP\_TLS}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, tls\_1\_2\_aes\_gcm\_128) == 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00372}00372                                         error = EPROTONOSUPPORT;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00373}00373                                         \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00374}00374                                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00375}00375                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00376}00376                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{device_8h_abb3a60f881889fe61a749759d05357eca74da7cae9b317b559aef54ba619eeb85}{MLX5\_CAP\_TLS}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, tls\_1\_3\_aes\_gcm\_128) == 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00377}00377                                         error = EPROTONOSUPPORT;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00378}00378                                         \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00379}00379                                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00380}00380                         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00381}00381                         error = mlx5e\_tls\_set\_params(ptag-\/>crypto\_params, en);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00382}00382                         \textcolor{keywordflow}{if} (error)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00383}00383                                 \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00384}00384                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00385}00385 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00386}00386                 \textcolor{keywordflow}{case} 256 / 8:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00387}00387                         \textcolor{keywordflow}{if} (en-\/>tls\_vminor == TLS\_MINOR\_VER\_TWO) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00388}00388                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{device_8h_abb3a60f881889fe61a749759d05357eca74da7cae9b317b559aef54ba619eeb85}{MLX5\_CAP\_TLS}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, tls\_1\_2\_aes\_gcm\_256) == 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00389}00389                                         error = EPROTONOSUPPORT;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00390}00390                                         \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00391}00391                                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00392}00392                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00393}00393                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{device_8h_abb3a60f881889fe61a749759d05357eca74da7cae9b317b559aef54ba619eeb85}{MLX5\_CAP\_TLS}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, tls\_1\_3\_aes\_gcm\_256) == 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00394}00394                                         error = EPROTONOSUPPORT;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00395}00395                                         \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00396}00396                                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00397}00397                         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00398}00398                         error = mlx5e\_tls\_set\_params(ptag-\/>crypto\_params, en);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00399}00399                         \textcolor{keywordflow}{if} (error)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00400}00400                                 \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00401}00401                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00402}00402 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00403}00403                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00404}00404                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00405}00405                         \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00406}00406                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00407}00407                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00408}00408         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00409}00409                 error = EPROTONOSUPPORT;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00410}00410                 \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00411}00411         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00412}00412 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00413}00413         memset(\&rl\_params, 0, \textcolor{keyword}{sizeof}(rl\_params));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00414}00414         rl\_params.hdr = params-\/>hdr;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00415}00415         \textcolor{keywordflow}{switch} (params-\/>hdr.type) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00416}00416 \textcolor{preprocessor}{\#ifdef RATELIMIT}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00417}00417         \textcolor{keywordflow}{case} IF\_SND\_TAG\_TYPE\_TLS\_RATE\_LIMIT:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00418}00418                 rl\_params.hdr.type = IF\_SND\_TAG\_TYPE\_RATE\_LIMIT;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00419}00419                 rl\_params.rate\_limit.max\_rate = params-\/>tls\_rate\_limit.max\_rate;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00420}00420                 snd\_tag\_sw = \&mlx5e\_tls\_rl\_snd\_tag\_sw;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00421}00421                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00422}00422 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00423}00423         \textcolor{keywordflow}{case} IF\_SND\_TAG\_TYPE\_TLS:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00424}00424                 rl\_params.hdr.type = IF\_SND\_TAG\_TYPE\_UNLIMITED;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00425}00425                 snd\_tag\_sw = \&mlx5e\_tls\_snd\_tag\_sw;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00426}00426                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00427}00427         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00428}00428                 error = EOPNOTSUPP;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00429}00429                 \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00430}00430         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00431}00431 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00432}00432         error = m\_snd\_tag\_alloc(\mbox{\hyperlink{en_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}, \&rl\_params, \&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0595c6b03a0bcdd7797571949dc1b26f}{rl\_tag}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00433}00433         \textcolor{keywordflow}{if} (error)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00434}00434                 \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00435}00435 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00436}00436         \textcolor{comment}{/* store pointer to mbuf tag */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00437}00437         MPASS(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a4818d71262e574bd40075d79e01cf0fb}{tag}}.refcount == 0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00438}00438         m\_snd\_tag\_init(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a4818d71262e574bd40075d79e01cf0fb}{tag}}, \mbox{\hyperlink{en_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}, snd\_tag\_sw);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00439}00439         *ppmt = \&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a4818d71262e574bd40075d79e01cf0fb}{tag}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00440}00440 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00441}00441         \textcolor{comment}{/* reset state */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00442}00442         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0f9ae93e71b30fc9918111edd16d5043}{state}} = \mbox{\hyperlink{en__hw__tls_8h_acc9d4d096c0e45150bed2d65540b3e99}{MLX5E\_TLS\_ST\_INIT}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00443}00443 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00444}00444         queue\_work(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a5fc53857b1601a2cc0d9f8731405d8b1}{tls}}.\mbox{\hyperlink{structmlx5e__tls_a464fc84e76e3dbbdedeb23988b332c6f}{wq}}, \&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a30adaf20fdd439d8fbba17b783154933}{work}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00445}00445         flush\_work(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a30adaf20fdd439d8fbba17b783154933}{work}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00446}00446 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00447}00447         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00448}00448 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00449}00449 failure:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00450}00450         mlx5e\_tls\_tag\_zfree(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00451}00451         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00452}00452 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00453}00453 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00454}00454 \textcolor{preprocessor}{\#ifdef RATELIMIT}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00455}00455 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00456}00456 mlx5e\_tls\_rl\_snd\_tag\_modify(\textcolor{keyword}{struct} m\_snd\_tag *pmt, \textcolor{keyword}{union} if\_snd\_tag\_modify\_params *params)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00457}00457 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00458}00458         \textcolor{keyword}{union }if\_snd\_tag\_modify\_params rl\_params;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00459}00459         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}} *ptag =}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00460}00460             container\_of(pmt, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}}, \mbox{\hyperlink{en_8h_afc9f03e6e54bbc07f5b9e002750fe675}{tag}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00461}00461         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00462}00462 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00463}00463         memset(\&rl\_params, 0, \textcolor{keyword}{sizeof}(rl\_params));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00464}00464         rl\_params.rate\_limit.max\_rate = params-\/>tls\_rate\_limit.max\_rate;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00465}00465         error = ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0595c6b03a0bcdd7797571949dc1b26f}{rl\_tag}}-\/>sw-\/>snd\_tag\_modify(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0595c6b03a0bcdd7797571949dc1b26f}{rl\_tag}}, \&rl\_params);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00466}00466         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00467}00467 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00468}00468 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00469}00469 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00470}00470 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00471}00471 mlx5e\_tls\_snd\_tag\_query(\textcolor{keyword}{struct} m\_snd\_tag *pmt, \textcolor{keyword}{union} if\_snd\_tag\_query\_params *params)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00472}00472 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00473}00473         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}} *ptag =}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00474}00474             container\_of(pmt, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}}, \mbox{\hyperlink{en_8h_afc9f03e6e54bbc07f5b9e002750fe675}{tag}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00475}00475 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00476}00476         \textcolor{keywordflow}{return} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0595c6b03a0bcdd7797571949dc1b26f}{rl\_tag}}-\/>sw-\/>snd\_tag\_query(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0595c6b03a0bcdd7797571949dc1b26f}{rl\_tag}}, params));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00477}00477 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00478}00478 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00479}00479 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00480}00480 mlx5e\_tls\_snd\_tag\_free(\textcolor{keyword}{struct} m\_snd\_tag *pmt)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00481}00481 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00482}00482         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}} *ptag =}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00483}00483             container\_of(pmt, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}}, \mbox{\hyperlink{en_8h_afc9f03e6e54bbc07f5b9e002750fe675}{tag}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00484}00484         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00485}00485 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00486}00486         m\_snd\_tag\_rele(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0595c6b03a0bcdd7797571949dc1b26f}{rl\_tag}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00487}00487 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00488}00488         \mbox{\hyperlink{en__hw__tls_8h_ac1cc18c455c078442e8ae44e30e3e41d}{MLX5E\_TLS\_TAG\_LOCK}}(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00489}00489         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0f9ae93e71b30fc9918111edd16d5043}{state}} = \mbox{\hyperlink{en__hw__tls_8h_afdb7125e537bb0162d736637b66af376}{MLX5E\_TLS\_ST\_RELEASE}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00490}00490         \mbox{\hyperlink{en__hw__tls_8h_afc3cd24b7d3e4ff351452327fe9c7139}{MLX5E\_TLS\_TAG\_UNLOCK}}(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00491}00491 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00492}00492         \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}} = ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a4818d71262e574bd40075d79e01cf0fb}{tag}}.ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00493}00493         queue\_work(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a5fc53857b1601a2cc0d9f8731405d8b1}{tls}}.\mbox{\hyperlink{structmlx5e__tls_a464fc84e76e3dbbdedeb23988b332c6f}{wq}}, \&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a30adaf20fdd439d8fbba17b783154933}{work}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00494}00494 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00495}00495 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00496}00496 \mbox{\hyperlink{device_8h_a304bfae1ba4b2b82404598b5304e1f1f}{CTASSERT}}((\mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_cntx, param) \% 16) == 0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00497}00497 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00498}00498 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00499}00499 mlx5e\_tls\_send\_static\_parameters(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__sq}{mlx5e\_sq}} *\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}} *ptag)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00500}00500 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00501}00501         \textcolor{keyword}{const} u32 ds\_cnt = DIV\_ROUND\_UP(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tx__umr__wqe}{mlx5e\_tx\_umr\_wqe}}) +}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00502}00502             \mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_cntx, param), \mbox{\hyperlink{qp_8h_ae4c20810de6abebbd0c6b246bba0d8c9}{MLX5\_SEND\_WQE\_DS}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00503}00503         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tx__umr__wqe}{mlx5e\_tx\_umr\_wqe}} *wqe;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00504}00504         u16 pi;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00505}00505 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00506}00506         pi = \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>pc \& \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_a9b10abfe8962af01e045a33b866e64e7}{wq}}.\mbox{\hyperlink{structmlx5__wq__cyc_a517c3e9c4324552b799683ecaa0ffcd1}{sz\_m1}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00507}00507         wqe = \mbox{\hyperlink{wq_8h_ac44dbf6d3f68034d259613bc6910f436}{mlx5\_wq\_cyc\_get\_wqe}}(\&\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_a9b10abfe8962af01e045a33b866e64e7}{wq}}, pi);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00508}00508 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00509}00509         memset(wqe, 0, \textcolor{keyword}{sizeof}(*wqe));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00510}00510 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00511}00511         wqe-\/>\mbox{\hyperlink{structmlx5e__tx__umr__wqe_a6871fe0cae692bb236c02d5aa81d73bd}{ctrl}}.\mbox{\hyperlink{structmlx5__wqe__ctrl__seg_aaddb4d0262711abc16daa51b8d912d0e}{opmod\_idx\_opcode}} = cpu\_to\_be32((\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>pc << 8) |}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00512}00512             \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4a1dee01cb68b417221f0eb394ea086cbd}{MLX5\_OPCODE\_UMR}} | (\mbox{\hyperlink{device_8h_a96a58e29e8dbf2b5bdeb775cba46556eadcb8df71c5f462f07ba9a030d10ed279}{MLX5\_OPCODE\_MOD\_UMR\_TLS\_TIS\_STATIC\_PARAMS}} << 24));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00513}00513         wqe-\/>\mbox{\hyperlink{structmlx5e__tx__umr__wqe_a6871fe0cae692bb236c02d5aa81d73bd}{ctrl}}.\mbox{\hyperlink{structmlx5__wqe__ctrl__seg_a6ffef5693dd860fda08b0d2a891942bc}{qpn\_ds}} = cpu\_to\_be32((\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae65e9f03d02b152e7f24b1ae80917ac0}{sqn}} << 8) | ds\_cnt);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00514}00514         wqe-\/>\mbox{\hyperlink{structmlx5e__tx__umr__wqe_a6871fe0cae692bb236c02d5aa81d73bd}{ctrl}}.\mbox{\hyperlink{structmlx5__wqe__ctrl__seg_ab97655212a69f960f1e81363dfc2d14e}{imm}} = cpu\_to\_be32(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_ab1b60e86fa261a489bdc02757a42d3e0}{tisn}} << 8);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00515}00515 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00516}00516         \textcolor{keywordflow}{if} (\mbox{\hyperlink{en_8h_a256b6eccaa6c63e42f0b1c74b3da615a}{mlx5e\_do\_send\_cqe}}(\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}))}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00517}00517                 wqe-\/>\mbox{\hyperlink{structmlx5e__tx__umr__wqe_a6871fe0cae692bb236c02d5aa81d73bd}{ctrl}}.\mbox{\hyperlink{structmlx5__wqe__ctrl__seg_a7d85321973d98bdd15e5e3f8b7bd6a46}{fm\_ce\_se}} = \mbox{\hyperlink{qp_8h_aded9ca14dda7907d5a7b2bf085928aafa3565d308348b6941261cd92da38e5d87}{MLX5\_WQE\_CTRL\_CQ\_UPDATE}} | \mbox{\hyperlink{qp_8h_aa0ead9a390ae1a2e9537f8ea60f4f355a20962f1b04a083d788c3f91d35c41b1c}{MLX5\_FENCE\_MODE\_INITIATOR\_SMALL}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00518}00518         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00519}00519                 wqe-\/>\mbox{\hyperlink{structmlx5e__tx__umr__wqe_a6871fe0cae692bb236c02d5aa81d73bd}{ctrl}}.\mbox{\hyperlink{structmlx5__wqe__ctrl__seg_a7d85321973d98bdd15e5e3f8b7bd6a46}{fm\_ce\_se}} = \mbox{\hyperlink{qp_8h_aa0ead9a390ae1a2e9537f8ea60f4f355a20962f1b04a083d788c3f91d35c41b1c}{MLX5\_FENCE\_MODE\_INITIATOR\_SMALL}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00520}00520 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00521}00521         \textcolor{comment}{/* fill out UMR control segment */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00522}00522         wqe-\/>\mbox{\hyperlink{structmlx5e__tx__umr__wqe_a4cf4ac5554a16e9ba03f3658c0585a50}{umr}}.\mbox{\hyperlink{structmlx5__wqe__umr__ctrl__seg_ab2bf67f5548e9e61c142c2fd1aecf017}{flags}} = 0x80;  \textcolor{comment}{/* inline data */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00523}00523         wqe-\/>\mbox{\hyperlink{structmlx5e__tx__umr__wqe_a4cf4ac5554a16e9ba03f3658c0585a50}{umr}}.\mbox{\hyperlink{structmlx5__wqe__umr__ctrl__seg_a68b649a74fb6c4568ae87683b7a76483}{bsf\_octowords}} = cpu\_to\_be16(\mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_cntx, param) / 16);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00524}00524 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00525}00525         \textcolor{comment}{/* copy in the static crypto parameters */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00526}00526         memcpy(wqe + 1, \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(sw\_tls\_cntx, ptag-\/>crypto\_params, param),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00527}00527             \mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_cntx, param));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00528}00528 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00529}00529         \textcolor{comment}{/* copy data for doorbell */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00530}00530         memcpy(\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_aba0338793ccf6d370305287e2a68898b}{doorbell}}.\mbox{\hyperlink{structmlx5e__sq_ab07dead7746d58408a4c5912a30f155d}{d32}}, \&wqe-\/>\mbox{\hyperlink{structmlx5e__tx__umr__wqe_a6871fe0cae692bb236c02d5aa81d73bd}{ctrl}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_aba0338793ccf6d370305287e2a68898b}{doorbell}}.\mbox{\hyperlink{structmlx5e__sq_ab07dead7746d58408a4c5912a30f155d}{d32}}));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00531}00531 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00532}00532         \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae693d19c30022391524f7f37cb689eec}{mbuf}}[pi].\mbox{\hyperlink{structmlx5e__sq__mbuf_a13f0be39bf93187913825ab3e35a63a3}{mbuf}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00533}00533         \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae693d19c30022391524f7f37cb689eec}{mbuf}}[pi].\mbox{\hyperlink{structmlx5e__sq__mbuf_ad95fe7615802394306ba5bbb5b0c170f}{num\_bytes}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00534}00534         \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae693d19c30022391524f7f37cb689eec}{mbuf}}[pi].\mbox{\hyperlink{structmlx5e__sq__mbuf_ae0c5114abe888e43107b20b3f80a0bee}{num\_wqebbs}} = DIV\_ROUND\_UP(ds\_cnt, \mbox{\hyperlink{qp_8h_a88b69dacf4ab72cdfa5e7c9f855647cd}{MLX5\_SEND\_WQEBB\_NUM\_DS}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00535}00535         \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae693d19c30022391524f7f37cb689eec}{mbuf}}[pi].\mbox{\hyperlink{structmlx5e__sq__mbuf_a06bc3c3030c2d7883d3b8ac6831067e2}{mst}} = m\_snd\_tag\_ref(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a4818d71262e574bd40075d79e01cf0fb}{tag}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00536}00536 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00537}00537         \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>pc += \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae693d19c30022391524f7f37cb689eec}{mbuf}}[pi].\mbox{\hyperlink{structmlx5e__sq__mbuf_ae0c5114abe888e43107b20b3f80a0bee}{num\_wqebbs}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00538}00538 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00539}00539 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00540}00540 \mbox{\hyperlink{device_8h_a304bfae1ba4b2b82404598b5304e1f1f}{CTASSERT}}(\mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_cntx, progress) ==}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00541}00541     \textcolor{keyword}{sizeof}(((\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tx__psv__wqe}{mlx5e\_tx\_psv\_wqe}} *)0)-\/>psv));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00542}00542 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00543}00543 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00544}00544 mlx5e\_tls\_send\_progress\_parameters(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__sq}{mlx5e\_sq}} *\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}} *ptag)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00545}00545 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00546}00546         \textcolor{keyword}{const} u32 ds\_cnt = DIV\_ROUND\_UP(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tx__psv__wqe}{mlx5e\_tx\_psv\_wqe}}),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00547}00547             \mbox{\hyperlink{qp_8h_ae4c20810de6abebbd0c6b246bba0d8c9}{MLX5\_SEND\_WQE\_DS}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00548}00548         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tx__psv__wqe}{mlx5e\_tx\_psv\_wqe}} *wqe;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00549}00549         u16 pi;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00550}00550 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00551}00551         pi = \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>pc \& \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_a9b10abfe8962af01e045a33b866e64e7}{wq}}.\mbox{\hyperlink{structmlx5__wq__cyc_a517c3e9c4324552b799683ecaa0ffcd1}{sz\_m1}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00552}00552         wqe = \mbox{\hyperlink{wq_8h_ac44dbf6d3f68034d259613bc6910f436}{mlx5\_wq\_cyc\_get\_wqe}}(\&\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_a9b10abfe8962af01e045a33b866e64e7}{wq}}, pi);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00553}00553 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00554}00554         memset(wqe, 0, \textcolor{keyword}{sizeof}(*wqe));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00555}00555 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00556}00556         wqe-\/>\mbox{\hyperlink{structmlx5e__tx__psv__wqe_a39c4507039e2cd2692fcd253bf83f5cd}{ctrl}}.\mbox{\hyperlink{structmlx5__wqe__ctrl__seg_aaddb4d0262711abc16daa51b8d912d0e}{opmod\_idx\_opcode}} = cpu\_to\_be32((\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>pc << 8) |}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00557}00557             \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4a60156208e1b9809b313dd8cc2d66f5ec}{MLX5\_OPCODE\_SET\_PSV}} | (\mbox{\hyperlink{device_8h_ab48899087cc647f0f791ed0c459adc53a5f66a9038d1ef2b40241790fbe0b4028}{MLX5\_OPCODE\_MOD\_PSV\_TLS\_TIS\_PROGRESS\_PARAMS}} << 24));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00558}00558         wqe-\/>\mbox{\hyperlink{structmlx5e__tx__psv__wqe_a39c4507039e2cd2692fcd253bf83f5cd}{ctrl}}.\mbox{\hyperlink{structmlx5__wqe__ctrl__seg_a6ffef5693dd860fda08b0d2a891942bc}{qpn\_ds}} = cpu\_to\_be32((\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae65e9f03d02b152e7f24b1ae80917ac0}{sqn}} << 8) | ds\_cnt);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00559}00559 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00560}00560         \textcolor{keywordflow}{if} (\mbox{\hyperlink{en_8h_a256b6eccaa6c63e42f0b1c74b3da615a}{mlx5e\_do\_send\_cqe}}(\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}))}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00561}00561                 wqe-\/>\mbox{\hyperlink{structmlx5e__tx__psv__wqe_a39c4507039e2cd2692fcd253bf83f5cd}{ctrl}}.\mbox{\hyperlink{structmlx5__wqe__ctrl__seg_a7d85321973d98bdd15e5e3f8b7bd6a46}{fm\_ce\_se}} = \mbox{\hyperlink{qp_8h_aded9ca14dda7907d5a7b2bf085928aafa3565d308348b6941261cd92da38e5d87}{MLX5\_WQE\_CTRL\_CQ\_UPDATE}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00562}00562 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00563}00563         \textcolor{comment}{/* copy in the PSV control segment */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00564}00564         memcpy(\&wqe-\/>\mbox{\hyperlink{structmlx5e__tx__psv__wqe_a5189366d0b2b97b26c022c1e10f06792}{psv}}, \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(sw\_tls\_cntx, ptag-\/>crypto\_params, progress),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00565}00565             \textcolor{keyword}{sizeof}(wqe-\/>\mbox{\hyperlink{structmlx5e__tx__psv__wqe_a5189366d0b2b97b26c022c1e10f06792}{psv}}));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00566}00566 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00567}00567         \textcolor{comment}{/* copy data for doorbell */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00568}00568         memcpy(\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_aba0338793ccf6d370305287e2a68898b}{doorbell}}.\mbox{\hyperlink{structmlx5e__sq_ab07dead7746d58408a4c5912a30f155d}{d32}}, \&wqe-\/>\mbox{\hyperlink{structmlx5e__tx__psv__wqe_a39c4507039e2cd2692fcd253bf83f5cd}{ctrl}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_aba0338793ccf6d370305287e2a68898b}{doorbell}}.\mbox{\hyperlink{structmlx5e__sq_ab07dead7746d58408a4c5912a30f155d}{d32}}));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00569}00569 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00570}00570         \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae693d19c30022391524f7f37cb689eec}{mbuf}}[pi].\mbox{\hyperlink{structmlx5e__sq__mbuf_a13f0be39bf93187913825ab3e35a63a3}{mbuf}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00571}00571         \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae693d19c30022391524f7f37cb689eec}{mbuf}}[pi].\mbox{\hyperlink{structmlx5e__sq__mbuf_ad95fe7615802394306ba5bbb5b0c170f}{num\_bytes}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00572}00572         \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae693d19c30022391524f7f37cb689eec}{mbuf}}[pi].\mbox{\hyperlink{structmlx5e__sq__mbuf_ae0c5114abe888e43107b20b3f80a0bee}{num\_wqebbs}} = DIV\_ROUND\_UP(ds\_cnt, \mbox{\hyperlink{qp_8h_a88b69dacf4ab72cdfa5e7c9f855647cd}{MLX5\_SEND\_WQEBB\_NUM\_DS}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00573}00573         \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae693d19c30022391524f7f37cb689eec}{mbuf}}[pi].\mbox{\hyperlink{structmlx5e__sq__mbuf_a06bc3c3030c2d7883d3b8ac6831067e2}{mst}} = m\_snd\_tag\_ref(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a4818d71262e574bd40075d79e01cf0fb}{tag}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00574}00574 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00575}00575         \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>pc += \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae693d19c30022391524f7f37cb689eec}{mbuf}}[pi].\mbox{\hyperlink{structmlx5e__sq__mbuf_ae0c5114abe888e43107b20b3f80a0bee}{num\_wqebbs}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00576}00576 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00577}00577 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00578}00578 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00579}00579 mlx5e\_tls\_send\_nop(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__sq}{mlx5e\_sq}} *\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}} *ptag)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00580}00580 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00581}00581         \textcolor{keyword}{const} u32 ds\_cnt = \mbox{\hyperlink{qp_8h_a88b69dacf4ab72cdfa5e7c9f855647cd}{MLX5\_SEND\_WQEBB\_NUM\_DS}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00582}00582         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tx__wqe}{mlx5e\_tx\_wqe}} *wqe;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00583}00583         u16 pi;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00584}00584 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00585}00585         pi = \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>pc \& \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_a9b10abfe8962af01e045a33b866e64e7}{wq}}.\mbox{\hyperlink{structmlx5__wq__cyc_a517c3e9c4324552b799683ecaa0ffcd1}{sz\_m1}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00586}00586         wqe = \mbox{\hyperlink{wq_8h_ac44dbf6d3f68034d259613bc6910f436}{mlx5\_wq\_cyc\_get\_wqe}}(\&\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_a9b10abfe8962af01e045a33b866e64e7}{wq}}, pi);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00587}00587 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00588}00588         memset(\&wqe-\/>\mbox{\hyperlink{structmlx5e__tx__wqe_a861d616691d386374323b199008febe0}{ctrl}}, 0, \textcolor{keyword}{sizeof}(wqe-\/>\mbox{\hyperlink{structmlx5e__tx__wqe_a861d616691d386374323b199008febe0}{ctrl}}));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00589}00589 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00590}00590         wqe-\/>\mbox{\hyperlink{structmlx5e__tx__wqe_a861d616691d386374323b199008febe0}{ctrl}}.\mbox{\hyperlink{structmlx5__wqe__ctrl__seg_aaddb4d0262711abc16daa51b8d912d0e}{opmod\_idx\_opcode}} = cpu\_to\_be32((\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>pc << 8) | \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4a12af45af9f239a5c42260a4755e06fc7}{MLX5\_OPCODE\_NOP}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00591}00591         wqe-\/>\mbox{\hyperlink{structmlx5e__tx__wqe_a861d616691d386374323b199008febe0}{ctrl}}.\mbox{\hyperlink{structmlx5__wqe__ctrl__seg_a6ffef5693dd860fda08b0d2a891942bc}{qpn\_ds}} = cpu\_to\_be32((\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae65e9f03d02b152e7f24b1ae80917ac0}{sqn}} << 8) | ds\_cnt);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00592}00592         \textcolor{keywordflow}{if} (\mbox{\hyperlink{en_8h_a256b6eccaa6c63e42f0b1c74b3da615a}{mlx5e\_do\_send\_cqe}}(\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}))}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00593}00593                 wqe-\/>\mbox{\hyperlink{structmlx5e__tx__wqe_a861d616691d386374323b199008febe0}{ctrl}}.\mbox{\hyperlink{structmlx5__wqe__ctrl__seg_a7d85321973d98bdd15e5e3f8b7bd6a46}{fm\_ce\_se}} = \mbox{\hyperlink{qp_8h_aded9ca14dda7907d5a7b2bf085928aafa3565d308348b6941261cd92da38e5d87}{MLX5\_WQE\_CTRL\_CQ\_UPDATE}} | \mbox{\hyperlink{qp_8h_aa0ead9a390ae1a2e9537f8ea60f4f355a20962f1b04a083d788c3f91d35c41b1c}{MLX5\_FENCE\_MODE\_INITIATOR\_SMALL}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00594}00594         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00595}00595                 wqe-\/>\mbox{\hyperlink{structmlx5e__tx__wqe_a861d616691d386374323b199008febe0}{ctrl}}.\mbox{\hyperlink{structmlx5__wqe__ctrl__seg_a7d85321973d98bdd15e5e3f8b7bd6a46}{fm\_ce\_se}} = \mbox{\hyperlink{qp_8h_aa0ead9a390ae1a2e9537f8ea60f4f355a20962f1b04a083d788c3f91d35c41b1c}{MLX5\_FENCE\_MODE\_INITIATOR\_SMALL}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00596}00596 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00597}00597         \textcolor{comment}{/* Copy data for doorbell */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00598}00598         memcpy(\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_aba0338793ccf6d370305287e2a68898b}{doorbell}}.\mbox{\hyperlink{structmlx5e__sq_ab07dead7746d58408a4c5912a30f155d}{d32}}, \&wqe-\/>\mbox{\hyperlink{structmlx5e__tx__wqe_a861d616691d386374323b199008febe0}{ctrl}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_aba0338793ccf6d370305287e2a68898b}{doorbell}}.\mbox{\hyperlink{structmlx5e__sq_ab07dead7746d58408a4c5912a30f155d}{d32}}));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00599}00599 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00600}00600         \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae693d19c30022391524f7f37cb689eec}{mbuf}}[pi].\mbox{\hyperlink{structmlx5e__sq__mbuf_a13f0be39bf93187913825ab3e35a63a3}{mbuf}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00601}00601         \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae693d19c30022391524f7f37cb689eec}{mbuf}}[pi].\mbox{\hyperlink{structmlx5e__sq__mbuf_ad95fe7615802394306ba5bbb5b0c170f}{num\_bytes}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00602}00602         \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae693d19c30022391524f7f37cb689eec}{mbuf}}[pi].\mbox{\hyperlink{structmlx5e__sq__mbuf_ae0c5114abe888e43107b20b3f80a0bee}{num\_wqebbs}} = DIV\_ROUND\_UP(ds\_cnt, \mbox{\hyperlink{qp_8h_a88b69dacf4ab72cdfa5e7c9f855647cd}{MLX5\_SEND\_WQEBB\_NUM\_DS}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00603}00603         \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae693d19c30022391524f7f37cb689eec}{mbuf}}[pi].\mbox{\hyperlink{structmlx5e__sq__mbuf_a06bc3c3030c2d7883d3b8ac6831067e2}{mst}} = m\_snd\_tag\_ref(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a4818d71262e574bd40075d79e01cf0fb}{tag}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00604}00604 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00605}00605         \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>pc += \mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}-\/>\mbox{\hyperlink{structmlx5e__sq_ae693d19c30022391524f7f37cb689eec}{mbuf}}[pi].\mbox{\hyperlink{structmlx5e__sq__mbuf_ae0c5114abe888e43107b20b3f80a0bee}{num\_wqebbs}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00606}00606 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00607}00607 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00608}00608 \textcolor{preprocessor}{\#define SBTLS\_MBUF\_NO\_DATA ((struct mbuf *)1)}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00609}00609 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00610}00610 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{en_8h_afe7667866ada7786d2c5a74903709909}{mbuf}} *}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00611}00611 sbtls\_recover\_record(\textcolor{keyword}{struct} \mbox{\hyperlink{en_8h_afe7667866ada7786d2c5a74903709909}{mbuf}} *mb, \textcolor{keywordtype}{int} wait, uint32\_t tcp\_old, uint32\_t *ptcp\_seq, \textcolor{keywordtype}{bool} *pis\_start)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00612}00612 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00613}00613         \textcolor{keyword}{struct }\mbox{\hyperlink{en_8h_afe7667866ada7786d2c5a74903709909}{mbuf}} *mr, *top;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00614}00614         uint32\_t offset;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00615}00615         uint32\_t delta;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00616}00616 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00617}00617         \textcolor{comment}{/* check format of incoming mbuf */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00618}00618         \textcolor{keywordflow}{if} (mb-\/>m\_next == NULL ||}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00619}00619             (mb-\/>m\_next-\/>m\_flags \& (M\_EXTPG | M\_EXT)) != (M\_EXTPG | M\_EXT)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00620}00620                 top = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00621}00621                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00622}00622         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00623}00623 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00624}00624         \textcolor{comment}{/* get unmapped data offset */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00625}00625         offset = mtod(mb-\/>m\_next, uintptr\_t);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00626}00626 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00627}00627         \textcolor{comment}{/* check if we don't need to re-\/transmit anything */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00628}00628         \textcolor{keywordflow}{if} (offset == 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00629}00629                 top = SBTLS\_MBUF\_NO\_DATA;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00630}00630                 *pis\_start = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00631}00631                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00632}00632         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00633}00633 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00634}00634         \textcolor{comment}{/* try to get a new  packet header */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00635}00635         top = m\_gethdr(wait, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00636}00636         \textcolor{keywordflow}{if} (top == NULL)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00637}00637                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00638}00638 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00639}00639         mr = m\_get(wait, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00640}00640         \textcolor{keywordflow}{if} (mr == NULL) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00641}00641                 m\_free(top);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00642}00642                 top = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00643}00643                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00644}00644         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00645}00645 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00646}00646         top-\/>m\_next = mr;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00647}00647 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00648}00648         mb\_dupcl(mr, mb-\/>m\_next);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00649}00649 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00650}00650         \textcolor{comment}{/* the beginning of the TLS record */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00651}00651         mr-\/>m\_data = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00652}00652 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00653}00653         \textcolor{comment}{/* setup packet header length */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00654}00654         top-\/>m\_pkthdr.len = mr-\/>m\_len = offset;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00655}00655         top-\/>m\_len = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00656}00656 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00657}00657         \textcolor{comment}{/* check for partial re-\/transmit */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00658}00658         delta = *ptcp\_seq -\/ tcp\_old;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00659}00659 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00660}00660         \textcolor{keywordflow}{if} (delta < offset) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00661}00661                 m\_adj(top, offset -\/ delta);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00662}00662                 offset = delta;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00663}00663 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00664}00664                 \textcolor{comment}{/* continue where we left off */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00665}00665                 *pis\_start = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00666}00666         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00667}00667                 *pis\_start = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00668}00668         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00669}00669 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00670}00670         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00671}00671 \textcolor{comment}{         * Rewind the TCP sequence number by the amount of data}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00672}00672 \textcolor{comment}{         * retransmitted:}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00673}00673 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00674}00674         *ptcp\_seq -\/= offset;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00675}00675 done:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00676}00676         \textcolor{keywordflow}{return} (top);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00677}00677 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00678}00678 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00679}00679 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00680}00680 mlx5e\_sq\_tls\_populate(\textcolor{keyword}{struct} \mbox{\hyperlink{en_8h_afe7667866ada7786d2c5a74903709909}{mbuf}} *mb, uint64\_t *pseq)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00681}00681 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00682}00682 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00683}00683         \textcolor{keywordflow}{for} (; mb != NULL; mb = mb-\/>m\_next) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00684}00684                 \textcolor{keywordflow}{if} (!(mb-\/>m\_flags \& M\_EXTPG))}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00685}00685                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00686}00686                 *pseq = mb-\/>m\_epg\_seqno;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00687}00687                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00688}00688         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00689}00689         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00690}00690 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00691}00691 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00692}00692 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00693}00693 \mbox{\hyperlink{en__hw__tls_8h_abda2c66954e6027dd2d201e82eb657cb}{mlx5e\_sq\_tls\_xmit}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__sq}{mlx5e\_sq}} *\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__xmit__args}{mlx5e\_xmit\_args}} *parg, \textcolor{keyword}{struct} \mbox{\hyperlink{en_8h_afe7667866ada7786d2c5a74903709909}{mbuf}} **ppmb)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00694}00694 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00695}00695         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}} *ptls\_tag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00696}00696         \textcolor{keyword}{struct }m\_snd\_tag *ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00697}00697         \textcolor{keyword}{const} \textcolor{keyword}{struct }tcphdr *th;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00698}00698         \textcolor{keyword}{struct }\mbox{\hyperlink{en_8h_afe7667866ada7786d2c5a74903709909}{mbuf}} *mb = *ppmb;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00699}00699         u64 rcd\_sn;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00700}00700         u32 header\_size;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00701}00701         u32 mb\_seq;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00702}00702 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00703}00703         \textcolor{keywordflow}{if} ((mb-\/>m\_pkthdr.csum\_flags \& CSUM\_SND\_TAG) == 0)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00704}00704                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{en__hw__tls_8h_a25e50be5c73e0b2fab54944e68dd48c2a8cdfb5a8fe3a3351ed38de473abab54b}{MLX5E\_TLS\_CONTINUE}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00705}00705 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00706}00706         ptag = mb-\/>m\_pkthdr.snd\_tag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00707}00707 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00708}00708         \textcolor{keywordflow}{if} (}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00709}00709 \#ifdef RATELIMIT}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00710}00710             ptag-\/>sw-\/>type != IF\_SND\_TAG\_TYPE\_TLS\_RATE\_LIMIT \&\&}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00711}00711 \#endif}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00712}00712             ptag-\/>sw-\/>type != IF\_SND\_TAG\_TYPE\_TLS)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00713}00713                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{en__hw__tls_8h_a25e50be5c73e0b2fab54944e68dd48c2a8cdfb5a8fe3a3351ed38de473abab54b}{MLX5E\_TLS\_CONTINUE}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00714}00714 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00715}00715         ptls\_tag = container\_of(ptag, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__tag}{mlx5e\_tls\_tag}}, \mbox{\hyperlink{en_8h_afc9f03e6e54bbc07f5b9e002750fe675}{tag}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00716}00716 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00717}00717         header\_size = \mbox{\hyperlink{en_8h_a2fea305e4db9d866df7271f7b56679b0}{mlx5e\_get\_full\_header\_size}}(mb, \&th);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00718}00718         \textcolor{keywordflow}{if} (unlikely(header\_size == 0 || th == NULL))}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00719}00719                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{en__hw__tls_8h_a25e50be5c73e0b2fab54944e68dd48c2abe15570a36cbcae6efebb015affa8238}{MLX5E\_TLS\_FAILURE}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00720}00720 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00721}00721         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00722}00722 \textcolor{comment}{         * Send non-\/TLS TCP packets AS-\/IS:}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00723}00723 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00724}00724         \textcolor{keywordflow}{if} (header\_size == mb-\/>m\_pkthdr.len ||}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00725}00725             mlx5e\_sq\_tls\_populate(mb, \&rcd\_sn) == 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00726}00726                 parg-\/>\mbox{\hyperlink{structmlx5e__xmit__args_a7a0470848dbc632e852e3d31d1a95984}{tisn}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00727}00727                 parg-\/>\mbox{\hyperlink{structmlx5e__xmit__args_a430a9b14515b1f862f39bb94609f9821}{ihs}} = header\_size;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00728}00728                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{en__hw__tls_8h_a25e50be5c73e0b2fab54944e68dd48c2a8cdfb5a8fe3a3351ed38de473abab54b}{MLX5E\_TLS\_CONTINUE}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00729}00729         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00730}00730 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00731}00731         mb\_seq = ntohl(th-\/>th\_seq);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00732}00732 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00733}00733         \mbox{\hyperlink{en__hw__tls_8h_ac1cc18c455c078442e8ae44e30e3e41d}{MLX5E\_TLS\_TAG\_LOCK}}(ptls\_tag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00734}00734         \textcolor{keywordflow}{switch} (ptls\_tag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0f9ae93e71b30fc9918111edd16d5043}{state}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00735}00735         \textcolor{keywordflow}{case} \mbox{\hyperlink{en__hw__tls_8h_acc9d4d096c0e45150bed2d65540b3e99}{MLX5E\_TLS\_ST\_INIT}}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00736}00736                 \mbox{\hyperlink{en__hw__tls_8h_afc3cd24b7d3e4ff351452327fe9c7139}{MLX5E\_TLS\_TAG\_UNLOCK}}(ptls\_tag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00737}00737                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{en__hw__tls_8h_a25e50be5c73e0b2fab54944e68dd48c2abe15570a36cbcae6efebb015affa8238}{MLX5E\_TLS\_FAILURE}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00738}00738         \textcolor{keywordflow}{case} \mbox{\hyperlink{en__hw__tls_8h_a0fec11db3200b53dd5c117cced32337b}{MLX5E\_TLS\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00739}00739                 ptls\_tag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a0f9ae93e71b30fc9918111edd16d5043}{state}} = \mbox{\hyperlink{en__hw__tls_8h_a7bd2fcf993246205f917655349a464a6}{MLX5E\_TLS\_ST\_TXRDY}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00740}00740                 ptls\_tag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_aec8883fc30ca8c44c833e9dffd93797c}{expected\_seq}} = \string~mb\_seq;   \textcolor{comment}{/* force setup */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00741}00741         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00742}00742                 \mbox{\hyperlink{en__hw__tls_8h_afc3cd24b7d3e4ff351452327fe9c7139}{MLX5E\_TLS\_TAG\_UNLOCK}}(ptls\_tag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00743}00743                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00744}00744         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00745}00745 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00746}00746         \textcolor{keywordflow}{if} (unlikely(ptls\_tag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_aec8883fc30ca8c44c833e9dffd93797c}{expected\_seq}} != mb\_seq)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00747}00747                 \textcolor{keywordtype}{bool} is\_start;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00748}00748                 \textcolor{keyword}{struct }\mbox{\hyperlink{en_8h_afe7667866ada7786d2c5a74903709909}{mbuf}} *r\_mb;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00749}00749                 uint32\_t tcp\_seq = mb\_seq;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00750}00750 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00751}00751                 r\_mb = sbtls\_recover\_record(mb, M\_NOWAIT, ptls\_tag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_aec8883fc30ca8c44c833e9dffd93797c}{expected\_seq}}, \&tcp\_seq, \&is\_start);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00752}00752                 \textcolor{keywordflow}{if} (r\_mb == NULL) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00753}00753                         \mbox{\hyperlink{en__hw__tls_8h_a164e6e9a196ecb4e59a904dca8fdf8c3}{MLX5E\_TLS\_STAT\_INC}}(ptls\_tag, tx\_error, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00754}00754                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{en__hw__tls_8h_a25e50be5c73e0b2fab54944e68dd48c2abe15570a36cbcae6efebb015affa8238}{MLX5E\_TLS\_FAILURE}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00755}00755                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00756}00756 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00757}00757                 \mbox{\hyperlink{en__hw__tls_8h_a164e6e9a196ecb4e59a904dca8fdf8c3}{MLX5E\_TLS\_STAT\_INC}}(ptls\_tag, tx\_packets\_ooo, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00758}00758 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00759}00759                 \textcolor{comment}{/* check if this is the first fragment of a TLS record */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00760}00760                 \textcolor{keywordflow}{if} (is\_start) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00761}00761                         \textcolor{comment}{/* setup TLS static parameters */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00762}00762                         \mbox{\hyperlink{device_8h_a6e7776ca1e3178584753950058580eb6}{MLX5\_SET64}}(sw\_tls\_cntx, ptls\_tag-\/>crypto\_params,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00763}00763                             param.initial\_record\_number, rcd\_sn);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00764}00764 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00765}00765                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00766}00766 \textcolor{comment}{                         * NOTE: The sendqueue should have enough room to}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00767}00767 \textcolor{comment}{                         * carry both the static and the progress parameters}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00768}00768 \textcolor{comment}{                         * when we get here!}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00769}00769 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00770}00770                         mlx5e\_tls\_send\_static\_parameters(\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}, ptls\_tag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00771}00771                         mlx5e\_tls\_send\_progress\_parameters(\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}, ptls\_tag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00772}00772 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00773}00773                         \textcolor{keywordflow}{if} (r\_mb == SBTLS\_MBUF\_NO\_DATA) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00774}00774                                 mlx5e\_tls\_send\_nop(\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}, ptls\_tag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00775}00775                                 ptls\_tag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_aec8883fc30ca8c44c833e9dffd93797c}{expected\_seq}} = mb\_seq;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00776}00776                                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{en__hw__tls_8h_a25e50be5c73e0b2fab54944e68dd48c2a8a1787cf788df6cbff7a2baf0050a532}{MLX5E\_TLS\_LOOP}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00777}00777                         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00778}00778                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00779}00779 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00780}00780                 \mbox{\hyperlink{en__hw__tls_8h_a164e6e9a196ecb4e59a904dca8fdf8c3}{MLX5E\_TLS\_STAT\_INC}}(ptls\_tag, tx\_bytes\_ooo, r\_mb-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00781}00781 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00782}00782                 \textcolor{comment}{/* setup transmit arguments */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00783}00783                 parg-\/>\mbox{\hyperlink{structmlx5e__xmit__args_a7a0470848dbc632e852e3d31d1a95984}{tisn}} = ptls\_tag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_ab1b60e86fa261a489bdc02757a42d3e0}{tisn}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00784}00784                 parg-\/>\mbox{\hyperlink{structmlx5e__xmit__args_ab8e658c3a6d3dde23832ce253a6145a7}{mst}} = \&ptls\_tag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a4818d71262e574bd40075d79e01cf0fb}{tag}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00785}00785 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00786}00786                 \textcolor{comment}{/* try to send DUMP data */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00787}00787                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{en_8h_a41097ab0309a9c95c836badb83e26d7a}{mlx5e\_sq\_dump\_xmit}}(\mbox{\hyperlink{en_8h_a64e9e48395dc8b3b44c1edd328af2aac}{sq}}, parg, \&r\_mb) != 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00788}00788                         m\_freem(r\_mb);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00789}00789                         ptls\_tag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_aec8883fc30ca8c44c833e9dffd93797c}{expected\_seq}} = tcp\_seq;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00790}00790                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{en__hw__tls_8h_a25e50be5c73e0b2fab54944e68dd48c2abe15570a36cbcae6efebb015affa8238}{MLX5E\_TLS\_FAILURE}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00791}00791                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00792}00792                         ptls\_tag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_aec8883fc30ca8c44c833e9dffd93797c}{expected\_seq}} = mb\_seq;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00793}00793                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{en__hw__tls_8h_a25e50be5c73e0b2fab54944e68dd48c2a8a1787cf788df6cbff7a2baf0050a532}{MLX5E\_TLS\_LOOP}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00794}00794                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00795}00795         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00796}00796                 \mbox{\hyperlink{en__hw__tls_8h_a164e6e9a196ecb4e59a904dca8fdf8c3}{MLX5E\_TLS\_STAT\_INC}}(ptls\_tag, tx\_packets, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00797}00797                 \mbox{\hyperlink{en__hw__tls_8h_a164e6e9a196ecb4e59a904dca8fdf8c3}{MLX5E\_TLS\_STAT\_INC}}(ptls\_tag, tx\_bytes, mb-\/>m\_pkthdr.len);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00798}00798         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00799}00799         ptls\_tag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_aec8883fc30ca8c44c833e9dffd93797c}{expected\_seq}} += mb-\/>m\_pkthdr.len -\/ header\_size;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00800}00800 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00801}00801         parg-\/>\mbox{\hyperlink{structmlx5e__xmit__args_a7a0470848dbc632e852e3d31d1a95984}{tisn}} = ptls\_tag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_ab1b60e86fa261a489bdc02757a42d3e0}{tisn}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00802}00802         parg-\/>\mbox{\hyperlink{structmlx5e__xmit__args_a430a9b14515b1f862f39bb94609f9821}{ihs}} = header\_size;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00803}00803         parg-\/>\mbox{\hyperlink{structmlx5e__xmit__args_ab8e658c3a6d3dde23832ce253a6145a7}{mst}} = \&ptls\_tag-\/>\mbox{\hyperlink{structmlx5e__tls__tag_a4818d71262e574bd40075d79e01cf0fb}{tag}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00804}00804         \textcolor{keywordflow}{return} (\mbox{\hyperlink{en__hw__tls_8h_a25e50be5c73e0b2fab54944e68dd48c2a8cdfb5a8fe3a3351ed38de473abab54b}{MLX5E\_TLS\_CONTINUE}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00805}00805 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00806}00806 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00807}00807 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00808}00808 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00809}00809 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00810}\mbox{\hyperlink{en__hw__tls_8h_a326ae3fabcb2c8cfedd463484a72e127}{00810}} \mbox{\hyperlink{mlx5__en__hw__tls_8c_a11b8a3142a6a1b57e37f741213f994c5}{mlx5e\_tls\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00811}00811 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00812}00812 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00813}00813         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00814}00814 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00815}00815 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00816}00816 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00817}\mbox{\hyperlink{en__hw__tls_8h_a24eda1fe5222f921d08ce2adb340bf3f}{00817}} \mbox{\hyperlink{mlx5__en__hw__tls_8c_a4d23cde6f7bb70d19e04b4f028567f30}{mlx5e\_tls\_cleanup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00818}00818 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00819}00819         \textcolor{comment}{/* NOP */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00820}00820 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00821}00821 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls_8c_source_l00822}00822 \textcolor{preprocessor}{\#endif          }\textcolor{comment}{/* KERN\_TLS */}\textcolor{preprocessor}{}}

\end{DoxyCode}
