\hypertarget{mlx5__en__hw__tls__rx_8c_source}{}\doxysection{mlx5\+\_\+en\+\_\+hw\+\_\+tls\+\_\+rx.\+c}
\label{mlx5__en__hw__tls__rx_8c_source}\index{dev/mlx5/mlx5\_en/mlx5\_en\_hw\_tls\_rx.c@{dev/mlx5/mlx5\_en/mlx5\_en\_hw\_tls\_rx.c}}
\mbox{\hyperlink{mlx5__en__hw__tls__rx_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2021-\/2022 NVIDIA corporation \& affiliates.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00004}00004 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00005}00005 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00006}00006 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00007}00007 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00008}00008 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00009}00009 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00010}00010 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00011}00011 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00013}00013 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00014}00014 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00015}00015 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00016}00016 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00017}00017 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00018}00018 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00019}00019 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00020}00020 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00021}00021 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00022}00022 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00023}00023 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00024}00024 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00025}00025 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00026}00026 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00027}00027 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00028}00028 \textcolor{preprocessor}{\#include "{}opt\_kern\_tls.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00029}00029 \textcolor{preprocessor}{\#include "{}opt\_rss.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00030}00030 \textcolor{preprocessor}{\#include "{}opt\_ratelimit.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00031}00031 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{en_8h}{dev/mlx5/mlx5\_en/en.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00033}00033 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{tls_8h}{dev/mlx5/tls.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{fs_8h}{dev/mlx5/fs.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{fs__tcp_8h}{dev/mlx5/mlx5\_core/fs\_tcp.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00038}00038 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/ktls.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <opencrypto/cryptodev.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00041}00041 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00042}00042 \textcolor{preprocessor}{\#ifdef KERN\_TLS}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00044}00044 \textcolor{keyword}{static} if\_snd\_tag\_free\_t mlx5e\_tls\_rx\_snd\_tag\_free;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00045}00045 \textcolor{keyword}{static} if\_snd\_tag\_modify\_t mlx5e\_tls\_rx\_snd\_tag\_modify;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00047}00047 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }if\_snd\_tag\_sw mlx5e\_tls\_rx\_snd\_tag\_sw = \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00048}00048         .snd\_tag\_modify = mlx5e\_tls\_rx\_snd\_tag\_modify,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00049}00049         .snd\_tag\_free = mlx5e\_tls\_rx\_snd\_tag\_free,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00050}00050         .type = IF\_SND\_TAG\_TYPE\_TLS\_RX}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00051}00051 \};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00053}00053 \mbox{\hyperlink{mlx5__en__main_8c_a896a7cfa8964247cfca28272de2572da}{MALLOC\_DEFINE}}(M\_MLX5E\_TLS\_RX, \textcolor{stringliteral}{"{}MLX5E\_TLS\_RX"{}}, \textcolor{stringliteral}{"{}MLX5 ethernet HW TLS RX"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00055}00055 \textcolor{comment}{/* software TLS RX context */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00056}00056 \textcolor{keyword}{struct }mlx5\_ifc\_sw\_tls\_rx\_cntx\_bits \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00057}00057         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ifc__tls__static__params__bits}{mlx5\_ifc\_tls\_static\_params\_bits}} param;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00058}00058         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__ifc__tls__progress__params__bits}{mlx5\_ifc\_tls\_progress\_params\_bits}} progress;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00059}00059         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00060}00060                 uint8\_t key\_data[8][0x20];}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00061}00061                 uint8\_t key\_len[0x20];}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00062}00062         \} key;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00063}00063 \};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00064}00064 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00065}00065 \mbox{\hyperlink{device_8h_a304bfae1ba4b2b82404598b5304e1f1f}{CTASSERT}}(\mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(sw\_tls\_rx\_cntx) <= \textcolor{keyword}{sizeof}(((\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *)NULL)-\/>crypto\_params));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00066}00066 \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}} *)NULL)-\/>mkc));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00068}00068 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *mlx5e\_tls\_rx\_stats\_desc[] = \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00069}00069         \mbox{\hyperlink{en__hw__tls__rx_8h_a25122ab1e163cebb153e6348f631192b}{MLX5E\_TLS\_RX\_STATS}}(\mbox{\hyperlink{en_8h_af4656c8e301a23dbeeedaafa0d11ed58}{MLX5E\_STATS\_DESC}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00070}00070 \};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00071}00071 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00072}00072 \textcolor{keyword}{static} \textcolor{keywordtype}{void} mlx5e\_tls\_rx\_work(\textcolor{keyword}{struct} work\_struct *);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00073}00073 \textcolor{keyword}{static} \textcolor{keywordtype}{bool} mlx5e\_tls\_rx\_snd\_tag\_find\_tcp\_sn\_and\_tls\_rcd(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00074}00074     uint32\_t, uint32\_t *, uint64\_t *);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00076}00076 \mbox{\hyperlink{device_8h_a304bfae1ba4b2b82404598b5304e1f1f}{CTASSERT}}((\mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_rx\_cntx, param) \% 16) == 0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00077}00077 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00078}00078 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00079}00079 mlx5e\_tls\_rx\_get\_ch(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, uint32\_t \mbox{\hyperlink{en__hw__tls__rx_8h_aa66f7363af4fe6fd78b77c27bffc36dc}{flowid}}, uint32\_t \mbox{\hyperlink{en__hw__tls__rx_8h_a716bc231bb643ca8169d607171a58462}{flowtype}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00080}00080 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00081}00081         u32 ch;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00082}00082 \textcolor{preprocessor}{\#ifdef RSS}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00083}00083         u32 temp;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00084}00084 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00085}00085 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00086}00086         \textcolor{comment}{/* keep this code synced with mlx5e\_select\_queue() */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00087}00087         ch = \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a082db7e920f50827afe0cf93857b5043}{params}}.\mbox{\hyperlink{structmlx5e__params_a1685215dbf54ebe54fe976013ec6644a}{num\_channels}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00088}00088 \textcolor{preprocessor}{\#ifdef RSS}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00089}00089         \textcolor{keywordflow}{if} (rss\_hash2bucket(\mbox{\hyperlink{en__hw__tls__rx_8h_aa66f7363af4fe6fd78b77c27bffc36dc}{flowid}}, \mbox{\hyperlink{en__hw__tls__rx_8h_a716bc231bb643ca8169d607171a58462}{flowtype}}, \&temp) == 0)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00090}00090                 ch = temp \% ch;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00091}00091         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00092}00092 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00093}00093                 ch = (\mbox{\hyperlink{en__hw__tls__rx_8h_aa66f7363af4fe6fd78b77c27bffc36dc}{flowid}} \% 128) \% ch;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00094}00094         \textcolor{keywordflow}{return} (ch);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00095}00095 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00096}00096 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00097}00097 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00098}00098 \textcolor{comment}{ * This function gets a pointer to an internal queue, IQ, based on the}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00099}00099 \textcolor{comment}{ * provided "{}flowid"{} and "{}flowtype"{}. The IQ returned may in some rare}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00100}00100 \textcolor{comment}{ * cases not be activated or running, but this is all handled by the}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00101}00101 \textcolor{comment}{ * "{}mlx5e\_iq\_get\_producer\_index()"{} function.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00102}00102 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00103}00103 \textcolor{comment}{ * The idea behind this function is to spread the IQ traffic as much}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00104}00104 \textcolor{comment}{ * as possible and to avoid congestion on the same IQ when processing}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00105}00105 \textcolor{comment}{ * RX traffic.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00106}00106 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00107}00107 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__iq}{mlx5e\_iq}} *}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00108}00108 mlx5e\_tls\_rx\_get\_iq(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, uint32\_t \mbox{\hyperlink{en__hw__tls__rx_8h_aa66f7363af4fe6fd78b77c27bffc36dc}{flowid}}, uint32\_t \mbox{\hyperlink{en__hw__tls__rx_8h_a716bc231bb643ca8169d607171a58462}{flowtype}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00109}00109 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00110}00110         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00111}00111 \textcolor{comment}{         * NOTE: The channels array is only freed at detach}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00112}00112 \textcolor{comment}{         * and it safe to return a pointer to the send tag}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00113}00113 \textcolor{comment}{         * inside the channels structure as long as we}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00114}00114 \textcolor{comment}{         * reference the priv.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00115}00115 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00116}00116         \textcolor{keywordflow}{return} (\&\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a9f8b97cbaf574081e1c05b8a0001c92b}{channel}}[mlx5e\_tls\_rx\_get\_ch(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, \mbox{\hyperlink{en__hw__tls__rx_8h_aa66f7363af4fe6fd78b77c27bffc36dc}{flowid}}, \mbox{\hyperlink{en__hw__tls__rx_8h_a716bc231bb643ca8169d607171a58462}{flowtype}})].\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00117}00117 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00118}00118 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00119}00119 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00120}00120 mlx5e\_tls\_rx\_send\_static\_parameters\_cb(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00121}00121 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00122}00122         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00123}00123 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00124}00124         ptag = (\textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *)arg;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00125}00125 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00126}00126         m\_snd\_tag\_rele(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a5a2716bb5da384d10bf612bc0114affd}{tag}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00127}00127 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00128}00128 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00129}00129 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00130}00130 \textcolor{comment}{ * This function sends the so-\/called TLS RX static parameters to the}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00131}00131 \textcolor{comment}{ * hardware. These parameters are temporarily stored in the}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00132}00132 \textcolor{comment}{ * "{}crypto\_params"{} field of the TLS RX tag.  Most importantly this}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00133}00133 \textcolor{comment}{ * function sets the TCP sequence number (32-\/bit) and TLS record}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00134}00134 \textcolor{comment}{ * number (64-\/bit) where the decryption can resume.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00135}00135 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00136}00136 \textcolor{comment}{ * Zero is returned upon success. Else some error happend.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00137}00137 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00138}00138 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00139}00139 mlx5e\_tls\_rx\_send\_static\_parameters(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__iq}{mlx5e\_iq}} *\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *ptag)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00140}00140 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00141}00141         \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__rx_8c_source_l00142}00142             \mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_rx\_cntx, param), \mbox{\hyperlink{qp_8h_ae4c20810de6abebbd0c6b246bba0d8c9}{MLX5\_SEND\_WQE\_DS}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00143}00143         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tx__umr__wqe}{mlx5e\_tx\_umr\_wqe}} *wqe;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00144}00144         \textcolor{keywordtype}{int} pi;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00145}00145 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00146}00146         mtx\_lock(\&\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_ae4a2e99bdd4c30b2a45133670848e121}{lock}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00147}00147         pi = \mbox{\hyperlink{en_8h_a45a8a983178b3c93336abfb01ff63176}{mlx5e\_iq\_get\_producer\_index}}(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00148}00148         \textcolor{keywordflow}{if} (pi < 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00149}00149                 mtx\_unlock(\&\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_ae4a2e99bdd4c30b2a45133670848e121}{lock}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00150}00150                 \textcolor{keywordflow}{return} (-\/ENOMEM);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00151}00151         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00152}00152         wqe = \mbox{\hyperlink{wq_8h_ac44dbf6d3f68034d259613bc6910f436}{mlx5\_wq\_cyc\_get\_wqe}}(\&\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_a62a8ef1aa264214d48d2113033abad5c}{wq}}, pi);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00154}00154         memset(wqe, 0, \textcolor{keyword}{sizeof}(*wqe));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00155}00155 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00156}00156         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_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>pc << 8) |}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00157}00157             \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4a1dee01cb68b417221f0eb394ea086cbd}{MLX5\_OPCODE\_UMR}} | (\mbox{\hyperlink{device_8h_a96a58e29e8dbf2b5bdeb775cba46556ea2aed2e6b86b37f18aa8fa457b33ab56e}{MLX5\_OPCODE\_MOD\_UMR\_TLS\_TIR\_STATIC\_PARAMS}} << 24));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00158}00158         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_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_aa7be6322162103ed23a8c332e57442b5}{sqn}} << 8) | ds\_cnt);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00159}00159         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__rx__tag_a955100fd032337ee9690108753a4083f}{tirn}} << 8);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00160}00160         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__rx_8c_source_l00161}00161 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00162}00162         \textcolor{comment}{/* fill out UMR control segment */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00163}00163         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__rx_8c_source_l00164}00164         wqe-\/>\mbox{\hyperlink{structmlx5e__tx__umr__wqe_a4cf4ac5554a16e9ba03f3658c0585a50}{umr}}.\mbox{\hyperlink{structmlx5__wqe__umr__ctrl__seg_a68b649a74fb6c4568ae87683b7a76483}{bsf\_octowords}} =}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00165}00165             cpu\_to\_be16(\mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_rx\_cntx, param) / 16);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00166}00166 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00167}00167         \textcolor{comment}{/* copy in the static crypto parameters */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00168}00168         memcpy(wqe + 1, \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(sw\_tls\_rx\_cntx, ptag-\/>crypto\_params, param),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00169}00169             \mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_rx\_cntx, param));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00170}00170 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00171}00171         \textcolor{comment}{/* copy data for doorbell */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00172}00172         memcpy(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_a7f89e0a4ab6f8f63a1064e677ed2d8e2}{doorbell}}.\mbox{\hyperlink{structmlx5e__iq_a823024472f14f8f947cc1352e461e714}{d32}}, \&wqe-\/>\mbox{\hyperlink{structmlx5e__tx__umr__wqe_a6871fe0cae692bb236c02d5aa81d73bd}{ctrl}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_a7f89e0a4ab6f8f63a1064e677ed2d8e2}{doorbell}}.\mbox{\hyperlink{structmlx5e__iq_a823024472f14f8f947cc1352e461e714}{d32}}));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00173}00173 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00174}00174         \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_aa3c34174288d253de9ebb5e3b49bdcc5}{data}}[pi].\mbox{\hyperlink{structmlx5e__iq__data_acfde053f4f28c96c5c9c7c35cfd35640}{num\_wqebbs}} = DIV\_ROUND\_UP(ds\_cnt, \mbox{\hyperlink{qp_8h_a88b69dacf4ab72cdfa5e7c9f855647cd}{MLX5\_SEND\_WQEBB\_NUM\_DS}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00175}00175         \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_aa3c34174288d253de9ebb5e3b49bdcc5}{data}}[pi].\mbox{\hyperlink{structmlx5e__iq__data_a08eb367e9ca467ada1cad90d52d4341b}{callback}} = \&mlx5e\_tls\_rx\_send\_static\_parameters\_cb;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00176}00176         \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_aa3c34174288d253de9ebb5e3b49bdcc5}{data}}[pi].\mbox{\hyperlink{structmlx5e__iq__data_a625beacb75c98a904039e33a49446319}{arg}} = ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00177}00177 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00178}00178         m\_snd\_tag\_ref(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a5a2716bb5da384d10bf612bc0114affd}{tag}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00179}00179 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00180}00180         \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>pc += \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_aa3c34174288d253de9ebb5e3b49bdcc5}{data}}[pi].\mbox{\hyperlink{structmlx5e__iq__data_acfde053f4f28c96c5c9c7c35cfd35640}{num\_wqebbs}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00181}00181 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00182}00182         \mbox{\hyperlink{en_8h_a2b7166bf8392480e8718cdbdf21c2315}{mlx5e\_iq\_notify\_hw}}(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00183}00183 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00184}00184         mtx\_unlock(\&\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_ae4a2e99bdd4c30b2a45133670848e121}{lock}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00185}00185 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00186}00186         \textcolor{keywordflow}{return} (0);     \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00187}00187 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00188}00188 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00189}00189 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00190}00190 mlx5e\_tls\_rx\_send\_progress\_parameters\_cb(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00191}00191 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00192}00192         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00193}00193 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00194}00194         ptag = (\textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *)arg;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00195}00195 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00196}00196         complete(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a80942b99a34e727b0191b151d2e075ac}{progress\_complete}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00197}00197 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00198}00198 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00199}00199 \mbox{\hyperlink{device_8h_a304bfae1ba4b2b82404598b5304e1f1f}{CTASSERT}}(\mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_rx\_cntx, progress) ==}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00200}00200     \textcolor{keyword}{sizeof}(((\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tx__psv__wqe}{mlx5e\_tx\_psv\_wqe}} *)NULL)-\/>psv));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00202}00202 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00203}00203 \textcolor{comment}{ * This function resets the state of the TIR context to start}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00204}00204 \textcolor{comment}{ * searching for a valid TLS header and is used only when allocating}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00205}00205 \textcolor{comment}{ * the TLS RX tag.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00206}00206 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00207}00207 \textcolor{comment}{ * Zero is returned upon success, else some error happened.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00208}00208 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00209}00209 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00210}00210 mlx5e\_tls\_rx\_send\_progress\_parameters\_sync(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__iq}{mlx5e\_iq}} *\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00211}00211     \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *ptag)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00212}00212 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00213}00213         \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__rx_8c_source_l00214}00214             \mbox{\hyperlink{qp_8h_ae4c20810de6abebbd0c6b246bba0d8c9}{MLX5\_SEND\_WQE\_DS}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00215}00215         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00216}00216         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tx__psv__wqe}{mlx5e\_tx\_psv\_wqe}} *wqe;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00217}00217         \textcolor{keywordtype}{int} pi;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00218}00218 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00219}00219         mtx\_lock(\&\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_ae4a2e99bdd4c30b2a45133670848e121}{lock}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00220}00220         pi = \mbox{\hyperlink{en_8h_a45a8a983178b3c93336abfb01ff63176}{mlx5e\_iq\_get\_producer\_index}}(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00221}00221         \textcolor{keywordflow}{if} (pi < 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00222}00222                 mtx\_unlock(\&\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_ae4a2e99bdd4c30b2a45133670848e121}{lock}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00223}00223                 \textcolor{keywordflow}{return} (-\/ENOMEM);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00224}00224         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00225}00225         wqe = \mbox{\hyperlink{wq_8h_ac44dbf6d3f68034d259613bc6910f436}{mlx5\_wq\_cyc\_get\_wqe}}(\&\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_a62a8ef1aa264214d48d2113033abad5c}{wq}}, pi);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00226}00226 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00227}00227         memset(wqe, 0, \textcolor{keyword}{sizeof}(*wqe));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00228}00228 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00229}00229         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_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>pc << 8) |}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00230}00230             \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4a60156208e1b9809b313dd8cc2d66f5ec}{MLX5\_OPCODE\_SET\_PSV}} | (\mbox{\hyperlink{device_8h_ab48899087cc647f0f791ed0c459adc53ac328842cab591ed8b631ab80244769fa}{MLX5\_OPCODE\_MOD\_PSV\_TLS\_TIR\_PROGRESS\_PARAMS}} << 24));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00231}00231         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_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_aa7be6322162103ed23a8c332e57442b5}{sqn}} << 8) | ds\_cnt);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00232}00232         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__rx_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00234}00234         \textcolor{comment}{/* copy in the PSV control segment */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00235}00235         memcpy(\&wqe-\/>\mbox{\hyperlink{structmlx5e__tx__psv__wqe_a5189366d0b2b97b26c022c1e10f06792}{psv}}, \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(sw\_tls\_rx\_cntx, ptag-\/>crypto\_params, progress),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00236}00236             \textcolor{keyword}{sizeof}(wqe-\/>\mbox{\hyperlink{structmlx5e__tx__psv__wqe_a5189366d0b2b97b26c022c1e10f06792}{psv}}));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00237}00237 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00238}00238         \textcolor{comment}{/* copy data for doorbell */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00239}00239         memcpy(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_a7f89e0a4ab6f8f63a1064e677ed2d8e2}{doorbell}}.\mbox{\hyperlink{structmlx5e__iq_a823024472f14f8f947cc1352e461e714}{d32}}, \&wqe-\/>\mbox{\hyperlink{structmlx5e__tx__psv__wqe_a39c4507039e2cd2692fcd253bf83f5cd}{ctrl}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_a7f89e0a4ab6f8f63a1064e677ed2d8e2}{doorbell}}.\mbox{\hyperlink{structmlx5e__iq_a823024472f14f8f947cc1352e461e714}{d32}}));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00241}00241         \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_aa3c34174288d253de9ebb5e3b49bdcc5}{data}}[pi].\mbox{\hyperlink{structmlx5e__iq__data_acfde053f4f28c96c5c9c7c35cfd35640}{num\_wqebbs}} = DIV\_ROUND\_UP(ds\_cnt, \mbox{\hyperlink{qp_8h_a88b69dacf4ab72cdfa5e7c9f855647cd}{MLX5\_SEND\_WQEBB\_NUM\_DS}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00242}00242         \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_aa3c34174288d253de9ebb5e3b49bdcc5}{data}}[pi].\mbox{\hyperlink{structmlx5e__iq__data_a08eb367e9ca467ada1cad90d52d4341b}{callback}} = \&mlx5e\_tls\_rx\_send\_progress\_parameters\_cb;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00243}00243         \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_aa3c34174288d253de9ebb5e3b49bdcc5}{data}}[pi].\mbox{\hyperlink{structmlx5e__iq__data_a625beacb75c98a904039e33a49446319}{arg}} = ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00244}00244 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00245}00245         \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>pc += \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_aa3c34174288d253de9ebb5e3b49bdcc5}{data}}[pi].\mbox{\hyperlink{structmlx5e__iq__data_acfde053f4f28c96c5c9c7c35cfd35640}{num\_wqebbs}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00246}00246 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00247}00247         init\_completion(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a80942b99a34e727b0191b151d2e075ac}{progress\_complete}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00248}00248 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00249}00249         \mbox{\hyperlink{en_8h_a2b7166bf8392480e8718cdbdf21c2315}{mlx5e\_iq\_notify\_hw}}(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00250}00250 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00251}00251         mtx\_unlock(\&\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_ae4a2e99bdd4c30b2a45133670848e121}{lock}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00252}00252 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00253}00253         \textcolor{keywordflow}{while} (1) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00254}00254                 \textcolor{keywordflow}{if} (wait\_for\_completion\_timeout(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a80942b99a34e727b0191b151d2e075ac}{progress\_complete}}, hz) != 0)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00255}00255                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00256}00256                 \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}} = container\_of(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__channel}{mlx5e\_channel}}, \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}})-\/>priv;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00257}00257                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}-\/>\mbox{\hyperlink{structmlx5__core__dev_aaee056f22d7ec1c4298ffb20189ec7e5}{state}} == \mbox{\hyperlink{driver_8h_aa42b19437cec785545106d8c76e3d9dda09cf6fffb12218a75a5f45b789ce5c62}{MLX5\_DEVICE\_STATE\_INTERNAL\_ERROR}} ||}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00258}00258                     pci\_channel\_offline(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}-\/>\mbox{\hyperlink{structmlx5__core__dev_a0819dc9fa4983c9140507e1a02aa8313}{pdev}}) != 0)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00259}00259                         \textcolor{keywordflow}{return} (-\/EWOULDBLOCK);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00260}00260         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00261}00261 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00262}00262         \textcolor{keywordflow}{return} (0);     \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00263}00263 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00264}00264 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00265}00265 \mbox{\hyperlink{device_8h_a304bfae1ba4b2b82404598b5304e1f1f}{CTASSERT}}(\mbox{\hyperlink{en__hw__tls__rx_8h_a2b5d893ea3cfa3d33fa083e8a67572e2}{MLX5E\_TLS\_RX\_PROGRESS\_BUFFER\_SIZE}} >= \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(tls\_progress\_params));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00266}00266 \mbox{\hyperlink{device_8h_a304bfae1ba4b2b82404598b5304e1f1f}{CTASSERT}}(\mbox{\hyperlink{en__hw__tls__rx_8h_a2b5d893ea3cfa3d33fa083e8a67572e2}{MLX5E\_TLS\_RX\_PROGRESS\_BUFFER\_SIZE}} <= PAGE\_SIZE);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00267}00267 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00268}00268 \textcolor{keyword}{struct }mlx5e\_get\_tls\_progress\_params\_wqe \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00269}00269         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__wqe__ctrl__seg}{mlx5\_wqe\_ctrl\_seg}} \mbox{\hyperlink{mlx5__en__tx_8c_a6c754dd718160143b485c2386deb76ba}{ctrl}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00270}00270         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__seg__get__psv}{mlx5\_seg\_get\_psv}}  psv;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00271}00271 \};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00272}00272 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00273}00273 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00274}00274 mlx5e\_tls\_rx\_receive\_progress\_parameters\_cb(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00275}00275 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00276}00276         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00277}00277         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__iq}{mlx5e\_iq}} *\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00278}00278         uint32\_t tcp\_curr\_sn\_he;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00279}00279         uint32\_t tcp\_next\_sn\_he;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00280}00280         uint64\_t tls\_rcd\_num;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00281}00281         \textcolor{keywordtype}{void} *buffer;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00282}00282 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00283}00283         ptag = (\textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *)arg;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00284}00284         buffer = \mbox{\hyperlink{en__hw__tls__rx_8h_ad6eeb175143a9eaaf30aae30ef198161}{mlx5e\_tls\_rx\_get\_progress\_buffer}}(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00285}00285 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00286}00286         \mbox{\hyperlink{en__hw__tls__rx_8h_a14fedd9a17cf2d5864eafee3c74b070a}{MLX5E\_TLS\_RX\_TAG\_LOCK}}(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00287}00287 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00288}00288         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_acd99ab13cf35ee79947b9fe142c9aec4}{tcp\_resync\_pending}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00289}00289 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00290}00290         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(tls\_progress\_params, buffer, record\_tracker\_state)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00291}00291         \textcolor{keywordflow}{case} \mbox{\hyperlink{en__hw__tls__rx_8h_a9b29769343da78881f442e657eb62b6eabe8fa5ddadb4d89e4c1bb54d7dd8d71a}{MLX5E\_TLS\_RX\_PROGRESS\_PARAMS\_RECORD\_TRACKER\_STATE\_TRACKING}}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00292}00292                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00293}00293         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00294}00294                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00295}00295         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00296}00296 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00297}00297         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(tls\_progress\_params, buffer, auth\_state)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00298}00298         \textcolor{keywordflow}{case} \mbox{\hyperlink{en__hw__tls__rx_8h_a97f905ac94bfebd46e50e32c7389e6eba355f95739694a0fb3bfe6d4457113aa9}{MLX5E\_TLS\_RX\_PROGRESS\_PARAMS\_AUTH\_STATE\_NO\_OFFLOAD}}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00299}00299                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00300}00300         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00301}00301                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00302}00302         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00303}00303 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00304}00304         tcp\_curr\_sn\_he = \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(tls\_progress\_params, buffer, hw\_resync\_tcp\_sn);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00305}00305 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00306}00306         \textcolor{keywordflow}{if} (mlx5e\_tls\_rx\_snd\_tag\_find\_tcp\_sn\_and\_tls\_rcd(ptag, tcp\_curr\_sn\_he,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00307}00307             \&tcp\_next\_sn\_he, \&tls\_rcd\_num)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00308}00308 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00309}00309                 \mbox{\hyperlink{device_8h_a6e7776ca1e3178584753950058580eb6}{MLX5\_SET64}}(sw\_tls\_rx\_cntx, ptag-\/>crypto\_params,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00310}00310                     param.initial\_record\_number, tls\_rcd\_num);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00311}00311                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_rx\_cntx, ptag-\/>crypto\_params,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00312}00312                     param.resync\_tcp\_sn, tcp\_curr\_sn\_he);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00313}00313 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00314}00314                 \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}} = mlx5e\_tls\_rx\_get\_iq(}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00315}00315                     container\_of(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ab007063a281a036815860459e91d0d38}{tls\_rx}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}}, \mbox{\hyperlink{en__hw__tls__rx_8h_a6184c705bc7acb23e1b00303facbaaf0}{tls\_rx}}),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00316}00316                     ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a253c54869fccbe69a49e3f8b5f624fe0}{flowid}}, ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a16914cc6db3840fb7059818ab1ee68f2}{flowtype}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00317}00317 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00318}00318                 \textcolor{keywordflow}{if} (mlx5e\_tls\_rx\_send\_static\_parameters(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}, ptag) != 0)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00319}00319                         \mbox{\hyperlink{en__hw__tls__rx_8h_af6a850dbcc0a67c576b58dfd22b1b23f}{MLX5E\_TLS\_RX\_STAT\_INC}}(ptag, rx\_error, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00320}00320         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00321}00321 done:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00322}00322         \mbox{\hyperlink{en__hw__tls__rx_8h_a8f16ec60277129dee3201acf68152999}{MLX5E\_TLS\_RX\_TAG\_UNLOCK}}(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00323}00323 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00324}00324         m\_snd\_tag\_rele(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a5a2716bb5da384d10bf612bc0114affd}{tag}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00325}00325 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00326}00326 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00327}00327 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00328}00328 \textcolor{comment}{ * This function queries the hardware for the current state of the TIR}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00329}00329 \textcolor{comment}{ * in question. It is typically called when encrypted data is received}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00330}00330 \textcolor{comment}{ * to re-\/establish hardware decryption of received TLS data.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00331}00331 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00332}00332 \textcolor{comment}{ * Zero is returned upon success, else some error happened.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00333}00333 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00334}00334 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00335}00335 mlx5e\_tls\_rx\_receive\_progress\_parameters(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__iq}{mlx5e\_iq}} *\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *ptag)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00336}00336 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00337}00337         \textcolor{keyword}{struct }mlx5e\_get\_tls\_progress\_params\_wqe *wqe;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00338}00338         \textcolor{keyword}{const} u32 ds\_cnt = DIV\_ROUND\_UP(\textcolor{keyword}{sizeof}(*wqe), \mbox{\hyperlink{qp_8h_ae4c20810de6abebbd0c6b246bba0d8c9}{MLX5\_SEND\_WQE\_DS}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00339}00339         u64 dma\_address;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00340}00340         \textcolor{keywordtype}{int} pi;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00341}00341 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00342}00342         mtx\_lock(\&\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_ae4a2e99bdd4c30b2a45133670848e121}{lock}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00343}00343         pi = \mbox{\hyperlink{en_8h_a45a8a983178b3c93336abfb01ff63176}{mlx5e\_iq\_get\_producer\_index}}(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00344}00344         \textcolor{keywordflow}{if} (pi < 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00345}00345                 mtx\_unlock(\&\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_ae4a2e99bdd4c30b2a45133670848e121}{lock}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00346}00346                 \textcolor{keywordflow}{return} (-\/ENOMEM);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00347}00347         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00348}00348 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00349}00349         \mbox{\hyperlink{en_8h_aa1aaca6299e807430d85922bd3609cdb}{mlx5e\_iq\_load\_memory\_single}}(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}, pi,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00350}00350             \mbox{\hyperlink{en__hw__tls__rx_8h_ad6eeb175143a9eaaf30aae30ef198161}{mlx5e\_tls\_rx\_get\_progress\_buffer}}(ptag),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00351}00351             \mbox{\hyperlink{en__hw__tls__rx_8h_a2b5d893ea3cfa3d33fa083e8a67572e2}{MLX5E\_TLS\_RX\_PROGRESS\_BUFFER\_SIZE}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00352}00352             \&dma\_address, BUS\_DMASYNC\_PREREAD);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00353}00353 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00354}00354         wqe = \mbox{\hyperlink{wq_8h_ac44dbf6d3f68034d259613bc6910f436}{mlx5\_wq\_cyc\_get\_wqe}}(\&\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_a62a8ef1aa264214d48d2113033abad5c}{wq}}, pi);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00355}00355 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00356}00356         memset(wqe, 0, \textcolor{keyword}{sizeof}(*wqe));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00357}00357 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00358}00358         wqe-\/>ctrl.opmod\_idx\_opcode = cpu\_to\_be32((\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>pc << 8) |}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00359}00359             \mbox{\hyperlink{device_8h_a4caf8d8f829279fba122163d961608a4abcd351d69a4816a9593a231a66abc3f4}{MLX5\_OPCODE\_GET\_PSV}} | (\mbox{\hyperlink{device_8h_ab48899087cc647f0f791ed0c459adc53ac328842cab591ed8b631ab80244769fa}{MLX5\_OPCODE\_MOD\_PSV\_TLS\_TIR\_PROGRESS\_PARAMS}} << 24));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00360}00360         wqe-\/>ctrl.qpn\_ds = cpu\_to\_be32((\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_aa7be6322162103ed23a8c332e57442b5}{sqn}} << 8) | ds\_cnt);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00361}00361         wqe-\/>ctrl.fm\_ce\_se = \mbox{\hyperlink{qp_8h_aded9ca14dda7907d5a7b2bf085928aafa3565d308348b6941261cd92da38e5d87}{MLX5\_WQE\_CTRL\_CQ\_UPDATE}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00362}00362         wqe-\/>psv.num\_psv = 1 << 4;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00363}00363         wqe-\/>psv.l\_key = \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_a85f55f9890176a844ab217db5b62c14d}{mkey\_be}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00364}00364         wqe-\/>psv.psv\_index[0] = cpu\_to\_be32(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a955100fd032337ee9690108753a4083f}{tirn}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00365}00365         wqe-\/>psv.va = cpu\_to\_be64(dma\_address);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00366}00366 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00367}00367         \textcolor{comment}{/* copy data for doorbell */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00368}00368         memcpy(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_a7f89e0a4ab6f8f63a1064e677ed2d8e2}{doorbell}}.\mbox{\hyperlink{structmlx5e__iq_a823024472f14f8f947cc1352e461e714}{d32}}, \&wqe-\/>ctrl, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_a7f89e0a4ab6f8f63a1064e677ed2d8e2}{doorbell}}.\mbox{\hyperlink{structmlx5e__iq_a823024472f14f8f947cc1352e461e714}{d32}}));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00369}00369 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00370}00370         \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_aa3c34174288d253de9ebb5e3b49bdcc5}{data}}[pi].\mbox{\hyperlink{structmlx5e__iq__data_acfde053f4f28c96c5c9c7c35cfd35640}{num\_wqebbs}} = DIV\_ROUND\_UP(ds\_cnt, \mbox{\hyperlink{qp_8h_a88b69dacf4ab72cdfa5e7c9f855647cd}{MLX5\_SEND\_WQEBB\_NUM\_DS}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00371}00371         \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_aa3c34174288d253de9ebb5e3b49bdcc5}{data}}[pi].\mbox{\hyperlink{structmlx5e__iq__data_a08eb367e9ca467ada1cad90d52d4341b}{callback}} = \&mlx5e\_tls\_rx\_receive\_progress\_parameters\_cb;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00372}00372         \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_aa3c34174288d253de9ebb5e3b49bdcc5}{data}}[pi].\mbox{\hyperlink{structmlx5e__iq__data_a625beacb75c98a904039e33a49446319}{arg}} = ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00373}00373 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00374}00374         m\_snd\_tag\_ref(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a5a2716bb5da384d10bf612bc0114affd}{tag}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00375}00375 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00376}00376         \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>pc += \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_aa3c34174288d253de9ebb5e3b49bdcc5}{data}}[pi].\mbox{\hyperlink{structmlx5e__iq__data_acfde053f4f28c96c5c9c7c35cfd35640}{num\_wqebbs}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00377}00377 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00378}00378         \mbox{\hyperlink{en_8h_a2b7166bf8392480e8718cdbdf21c2315}{mlx5e\_iq\_notify\_hw}}(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00379}00379 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00380}00380         mtx\_unlock(\&\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}-\/>\mbox{\hyperlink{structmlx5e__iq_ae4a2e99bdd4c30b2a45133670848e121}{lock}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00381}00381 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00382}00382         \textcolor{keywordflow}{return} (0);     \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00383}00383 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00384}00384 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00385}00385 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00386}00386 \textcolor{comment}{ * This is the import function for TLS RX tags.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00387}00387 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00388}00388 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00389}00389 mlx5e\_tls\_rx\_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__rx_8c_source_l00390}00390 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00391}00391         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00392}00392         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00393}00393 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00394}00394         \textcolor{keywordflow}{for} (i = 0; i != cnt; i++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00395}00395                 ptag = malloc\_domainset(\textcolor{keyword}{sizeof}(*ptag), M\_MLX5E\_TLS\_RX,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00396}00396                     \mbox{\hyperlink{driver_8h_aaafcfeb207aa2c90303af921f2c3ade8}{mlx5\_dev\_domainset}}(arg), flags | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00397}00397                 mtx\_init(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_aa8645c742216788de2bb1eb5e9ac8f7c}{mtx}}, \textcolor{stringliteral}{"{}mlx5-\/tls-\/rx-\/tag-\/mtx"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00398}00398                 INIT\_WORK(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_abe5a879af8486a3f86334840697e9fbe}{work}}, mlx5e\_tls\_rx\_work);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00399}00399                 store[i] = ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00400}00400         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00401}00401         \textcolor{keywordflow}{return} (i);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00402}00402 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00403}00403 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00404}00404 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00405}00405 \textcolor{comment}{ * This is the release function for TLS RX tags.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00406}00406 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00407}00407 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00408}00408 mlx5e\_tls\_rx\_tag\_release(\textcolor{keywordtype}{void} *arg, \textcolor{keywordtype}{void} **store, \textcolor{keywordtype}{int} cnt)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00409}00409 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00410}00410         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00411}00411         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00412}00412 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00413}00413         \textcolor{keywordflow}{for} (i = 0; i != cnt; i++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00414}00414                 ptag = store[i];}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00415}00415 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00416}00416                 flush\_work(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_abe5a879af8486a3f86334840697e9fbe}{work}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00417}00417                 mtx\_destroy(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_aa8645c742216788de2bb1eb5e9ac8f7c}{mtx}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00418}00418                 free(ptag, M\_MLX5E\_TLS\_RX);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00419}00419         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00420}00420 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00421}00421 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00422}00422 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00423}00423 \textcolor{comment}{ * This is a convenience function to free TLS RX tags. It resets some}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00424}00424 \textcolor{comment}{ * selected fields, updates the number of resources and returns the}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00425}00425 \textcolor{comment}{ * TLS RX tag to the UMA pool of free tags.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00426}00426 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00427}00427 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00428}00428 mlx5e\_tls\_rx\_tag\_zfree(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *ptag)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00429}00429 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00430}00430         \textcolor{comment}{/* make sure any unhandled taskqueue events are ignored */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00431}00431         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ad645c3ce98a6c5d75c46b891d3d8a408}{state}} = \mbox{\hyperlink{en__hw__tls__rx_8h_acfb1a8a7b33f880b18c0818f4370a5e1}{MLX5E\_TLS\_RX\_ST\_FREED}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00432}00432 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00433}00433         \textcolor{comment}{/* reset some variables */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00434}00434         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a53b2bd6a1580aad304b179498d38d049}{dek\_index}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00435}00435         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a4f1325b784ef681f10db15a801a188e9}{dek\_index\_ok}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00436}00436         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a955100fd032337ee9690108753a4083f}{tirn}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00437}00437         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a6c338cc839a395a7b552da185be3e3a9}{flow\_rule}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00438}00438         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a9abaa808c99daf3b0e1c7c44a58c8142}{tcp\_resync\_active}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00439}00439         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_acd99ab13cf35ee79947b9fe142c9aec4}{tcp\_resync\_pending}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00440}00440 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00441}00441         \textcolor{comment}{/* avoid leaking keys */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00442}00442         memset(ptag-\/>crypto\_params, 0, \textcolor{keyword}{sizeof}(ptag-\/>crypto\_params));}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00443}00443 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00444}00444         \textcolor{comment}{/* update number of resources in use */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00445}00445         atomic\_add\_32(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ab007063a281a036815860459e91d0d38}{tls\_rx}}-\/>\mbox{\hyperlink{structmlx5e__tls__rx_a61fc6998938939bad0c1cc4cee2c2840}{num\_resources}}, -\/1U);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00446}00446 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00447}00447         \textcolor{comment}{/* return tag to UMA */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00448}00448         uma\_zfree(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ab007063a281a036815860459e91d0d38}{tls\_rx}}-\/>\mbox{\hyperlink{structmlx5e__tls__rx_a7578ac3f37b0abf5695387870a54828a}{zone}}, ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00449}00449 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00450}00450 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00451}00451 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00452}00452 \textcolor{comment}{ * This function enables TLS RX support for the given NIC, if all}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00453}00453 \textcolor{comment}{ * needed firmware capabilites are present.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00454}00454 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00455}00455 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00456}00456 \mbox{\hyperlink{mlx5__en__hw__tls__rx_8c_adebfc80092897562fa1bc99e1c5e42fd}{mlx5e\_tls\_rx\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00457}00457 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00458}00458         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__rx}{mlx5e\_tls\_rx}} *ptls = \&\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a65f7bebe867f631ee138e69149cc3899}{tls\_rx}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00459}00459         \textcolor{keyword}{struct }sysctl\_oid *node;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00460}00460         uint32\_t x;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00461}00461 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00462}00462         \textcolor{keywordflow}{if} (\mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, \mbox{\hyperlink{en__hw__tls__rx_8h_a6184c705bc7acb23e1b00303facbaaf0}{tls\_rx}}) == 0 ||}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00463}00463             \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__rx_8c_source_l00464}00464             \mbox{\hyperlink{device_8h_a9002f51a74140020df43a31dceed330b}{MLX5\_CAP\_FLOWTABLE\_NIC\_RX}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, ft\_field\_support.outer\_ip\_version) == 0)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00465}00465                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00466}00466 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00467}00467         ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_a5f7b4febb064f574c71db6aeef0c5330}{wq}} = create\_singlethread\_workqueue(\textcolor{stringliteral}{"{}mlx5-\/tls-\/rx-\/wq"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00468}00468         \textcolor{keywordflow}{if} (ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_a5f7b4febb064f574c71db6aeef0c5330}{wq}} == NULL)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00469}00469                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00470}00470 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00471}00471         sysctl\_ctx\_init(\&ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_ab7aa583cc344c3e59df310984ba70768}{ctx}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00472}00472 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00473}00473         snprintf(ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_aa105b6042f165c473e3c7b0709a8953c}{zname}}, \textcolor{keyword}{sizeof}(ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_aa105b6042f165c473e3c7b0709a8953c}{zname}}),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00474}00474             \textcolor{stringliteral}{"{}mlx5\_\%u\_tls\_rx"{}}, 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__rx_8c_source_l00475}00475 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00476}00476         ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_a7578ac3f37b0abf5695387870a54828a}{zone}} = uma\_zcache\_create(ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_aa105b6042f165c473e3c7b0709a8953c}{zname}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00477}00477             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}}), NULL, NULL, NULL, NULL,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00478}00478             mlx5e\_tls\_rx\_tag\_import, mlx5e\_tls\_rx\_tag\_release, \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00479}00479             UMA\_ZONE\_UNMANAGED);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00480}00480 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00481}00481         \textcolor{comment}{/* shared between RX and TX TLS */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00482}00482         ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_a5aec5cac4f0b5d249c1d7cb11079c883}{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__rx_8c_source_l00483}00483 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00484}00484         \textcolor{keywordflow}{for} (x = 0; x != \mbox{\hyperlink{en__hw__tls__rx_8h_af298a09d20dbaf24da41ecd2504097a6}{MLX5E\_TLS\_RX\_STATS\_NUM}}; x++)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00485}00485                 ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_ac99ce97c072f2810bac40050d1da08d3}{stats}}.\mbox{\hyperlink{structmlx5e__tls__rx__stats_a4e0f51b9fe32005469b514af4b618bcd}{arg}}[x] = counter\_u64\_alloc(M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00486}00486 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00487}00487         ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_ae4336971a3fbc2777a6d108b9ca3355b}{init}} = 1;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00488}00488 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00489}00489         node = SYSCTL\_ADD\_NODE(\&\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_ab8f466ca91f232b49ea361c662c6b0d2}{sysctl\_ctx}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00490}00490             SYSCTL\_CHILDREN(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_ae61717d6358ea9565ea0dcc3ef683d67}{sysctl\_ifnet}}), OID\_AUTO,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00491}00491             \textcolor{stringliteral}{"{}tls\_rx"{}}, CTLFLAG\_RW | CTLFLAG\_MPSAFE, NULL, \textcolor{stringliteral}{"{}Hardware TLS receive offload"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00492}00492         \textcolor{keywordflow}{if} (node == NULL)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00493}00493                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00494}00494 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00495}00495         \mbox{\hyperlink{en_8h_aa2ad7d69980d8530a8d52f4a155bccf9}{mlx5e\_create\_counter\_stats}}(\&ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_ab7aa583cc344c3e59df310984ba70768}{ctx}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00496}00496             SYSCTL\_CHILDREN(node), \textcolor{stringliteral}{"{}stats"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00497}00497             mlx5e\_tls\_rx\_stats\_desc, \mbox{\hyperlink{en__hw__tls__rx_8h_af298a09d20dbaf24da41ecd2504097a6}{MLX5E\_TLS\_RX\_STATS\_NUM}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00498}00498             ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_ac99ce97c072f2810bac40050d1da08d3}{stats}}.\mbox{\hyperlink{structmlx5e__tls__rx__stats_a4e0f51b9fe32005469b514af4b618bcd}{arg}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00499}00499 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00500}00500         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00501}00501 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00502}00502 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00503}00503 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00504}00504 \textcolor{comment}{ * This function disables TLS RX support for the given NIC.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00505}00505 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00506}00506 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00507}00507 \mbox{\hyperlink{mlx5__en__hw__tls__rx_8c_a5050c2b7b7b6b11e506f2c3cd11b2fbd}{mlx5e\_tls\_rx\_cleanup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00508}00508 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00509}00509         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__rx}{mlx5e\_tls\_rx}} *ptls = \&\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a65f7bebe867f631ee138e69149cc3899}{tls\_rx}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00510}00510         uint32\_t x;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00511}00511 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00512}00512         \textcolor{keywordflow}{if} (ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_ae4336971a3fbc2777a6d108b9ca3355b}{init}} == 0)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00513}00513                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00514}00514 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00515}00515         ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_ae4336971a3fbc2777a6d108b9ca3355b}{init}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00516}00516         flush\_workqueue(ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_a5f7b4febb064f574c71db6aeef0c5330}{wq}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00517}00517         sysctl\_ctx\_free(\&ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_ab7aa583cc344c3e59df310984ba70768}{ctx}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00518}00518         uma\_zdestroy(ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_a7578ac3f37b0abf5695387870a54828a}{zone}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00519}00519         destroy\_workqueue(ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_a5f7b4febb064f574c71db6aeef0c5330}{wq}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00520}00520 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00521}00521         \textcolor{comment}{/* check if all resources are freed */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00522}00522         MPASS(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a65f7bebe867f631ee138e69149cc3899}{tls\_rx}}.\mbox{\hyperlink{structmlx5e__tls__rx_a61fc6998938939bad0c1cc4cee2c2840}{num\_resources}} == 0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00523}00523 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00524}00524         \textcolor{keywordflow}{for} (x = 0; x != \mbox{\hyperlink{en__hw__tls__rx_8h_af298a09d20dbaf24da41ecd2504097a6}{MLX5E\_TLS\_RX\_STATS\_NUM}}; x++)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00525}00525                 counter\_u64\_free(ptls-\/>\mbox{\hyperlink{structmlx5e__tls__rx_ac99ce97c072f2810bac40050d1da08d3}{stats}}.\mbox{\hyperlink{structmlx5e__tls__rx__stats_a4e0f51b9fe32005469b514af4b618bcd}{arg}}[x]);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00526}00526 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00527}00527 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00528}00528 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00529}00529 \textcolor{comment}{ * This function is used to serialize sleeping firmware operations}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00530}00530 \textcolor{comment}{ * needed in order to establish and destroy a TLS RX tag.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00531}00531 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00532}00532 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00533}00533 mlx5e\_tls\_rx\_work(\textcolor{keyword}{struct} work\_struct *\mbox{\hyperlink{en__hw__tls_8h_a623997e11b94d7c467ce26627cc488a2}{work}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00534}00534 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00535}00535         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00536}00536         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00537}00537         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00538}00538 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00539}00539         ptag = container\_of(\mbox{\hyperlink{en__hw__tls_8h_a623997e11b94d7c467ce26627cc488a2}{work}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}}, \mbox{\hyperlink{en__hw__tls_8h_a623997e11b94d7c467ce26627cc488a2}{work}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00540}00540         \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}} = container\_of(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ab007063a281a036815860459e91d0d38}{tls\_rx}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}}, \mbox{\hyperlink{en__hw__tls__rx_8h_a6184c705bc7acb23e1b00303facbaaf0}{tls\_rx}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00541}00541 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00542}00542         \textcolor{keywordflow}{switch} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ad645c3ce98a6c5d75c46b891d3d8a408}{state}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00543}00543         \textcolor{keywordflow}{case} \mbox{\hyperlink{en__hw__tls__rx_8h_a6cbc325b0435dd7d32fdf18005da68e0}{MLX5E\_TLS\_RX\_ST\_INIT}}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00544}00544                 \textcolor{comment}{/* try to allocate new TIR context */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00545}00545                 err = \mbox{\hyperlink{mlx5__tls_8c_adeaad2fdb6996fab9304d2840626c5c0}{mlx5\_tls\_open\_tir}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a8b1627033e2f64d0e3720f368a615014}{tdn}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00546}00546                     \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a9f8b97cbaf574081e1c05b8a0001c92b}{channel}}[mlx5e\_tls\_rx\_get\_ch(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a253c54869fccbe69a49e3f8b5f624fe0}{flowid}}, ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a16914cc6db3840fb7059818ab1ee68f2}{flowtype}})].\mbox{\hyperlink{structmlx5e__channel_a49d02023d9ee43ae2d4fc8e27946e4ec}{rqtn}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00547}00547                     \&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a955100fd032337ee9690108753a4083f}{tirn}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00548}00548                 \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00549}00549                         \mbox{\hyperlink{en__hw__tls__rx_8h_af6a850dbcc0a67c576b58dfd22b1b23f}{MLX5E\_TLS\_RX\_STAT\_INC}}(ptag, rx\_error, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00550}00550                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00551}00551                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00552}00552                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_rx\_cntx, ptag-\/>crypto\_params, progress.pd, ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a955100fd032337ee9690108753a4083f}{tirn}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00553}00553 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00554}00554                 \textcolor{comment}{/* try to allocate a DEK context ID */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00555}00555                 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__rx_8c_source_l00556}00556                     \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(sw\_tls\_rx\_cntx, ptag-\/>crypto\_params, key.key\_data),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00557}00557                     \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(sw\_tls\_rx\_cntx, ptag-\/>crypto\_params, key.key\_len),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00558}00558                     \&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a53b2bd6a1580aad304b179498d38d049}{dek\_index}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00559}00559                 \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00560}00560                         \mbox{\hyperlink{en__hw__tls__rx_8h_af6a850dbcc0a67c576b58dfd22b1b23f}{MLX5E\_TLS\_RX\_STAT\_INC}}(ptag, rx\_error, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00561}00561                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00562}00562                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00563}00563 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00564}00564                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_rx\_cntx, ptag-\/>crypto\_params, param.\mbox{\hyperlink{structmlx5e__tls__rx__tag_a53b2bd6a1580aad304b179498d38d049}{dek\_index}}, ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a53b2bd6a1580aad304b179498d38d049}{dek\_index}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00565}00565 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00566}00566                 ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a4f1325b784ef681f10db15a801a188e9}{dek\_index\_ok}} = 1;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00567}00567 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00568}00568                 \mbox{\hyperlink{en__hw__tls__rx_8h_a14fedd9a17cf2d5864eafee3c74b070a}{MLX5E\_TLS\_RX\_TAG\_LOCK}}(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00569}00569                 \textcolor{keywordflow}{if} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ad645c3ce98a6c5d75c46b891d3d8a408}{state}} == \mbox{\hyperlink{en__hw__tls__rx_8h_a6cbc325b0435dd7d32fdf18005da68e0}{MLX5E\_TLS\_RX\_ST\_INIT}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00570}00570                         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ad645c3ce98a6c5d75c46b891d3d8a408}{state}} = \mbox{\hyperlink{en__hw__tls__rx_8h_a30c28b26d6f9f54d0a8f9b9b81d9522f}{MLX5E\_TLS\_RX\_ST\_SETUP}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00571}00571                 \mbox{\hyperlink{en__hw__tls__rx_8h_a8f16ec60277129dee3201acf68152999}{MLX5E\_TLS\_RX\_TAG\_UNLOCK}}(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00572}00572                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00573}00573 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00574}00574         \textcolor{keywordflow}{case} \mbox{\hyperlink{en__hw__tls__rx_8h_adb4d3e7531a10b62037e057f88f48fd8}{MLX5E\_TLS\_RX\_ST\_RELEASE}}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00575}00575                 \textcolor{comment}{/* remove flow rule for incoming traffic, if any */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00576}00576                 \textcolor{keywordflow}{if} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a6c338cc839a395a7b552da185be3e3a9}{flow\_rule}} != NULL)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00577}00577                         \mbox{\hyperlink{fs__tcp_8h_a23b39ffb7ee1b42fbc58686d86f08ba1}{mlx5e\_accel\_fs\_del\_inpcb}}(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a6c338cc839a395a7b552da185be3e3a9}{flow\_rule}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00578}00578 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00579}00579                 \textcolor{comment}{/* try to destroy DEK context by ID */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00580}00580                 \textcolor{keywordflow}{if} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a4f1325b784ef681f10db15a801a188e9}{dek\_index\_ok}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00581}00581                         \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__rx__tag_a53b2bd6a1580aad304b179498d38d049}{dek\_index}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00582}00582 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00583}00583                 \textcolor{comment}{/* try to destroy TIR context by ID */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00584}00584                 \textcolor{keywordflow}{if} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a955100fd032337ee9690108753a4083f}{tirn}} != 0)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00585}00585                         \mbox{\hyperlink{mlx5__tls_8c_af92381f137a851572518e9d4e5129304}{mlx5\_tls\_close\_tir}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a955100fd032337ee9690108753a4083f}{tirn}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00586}00586 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00587}00587                 \textcolor{comment}{/* free tag */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00588}00588                 mlx5e\_tls\_rx\_tag\_zfree(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00589}00589                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00590}00590 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00591}00591         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00592}00592                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00593}00593         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00594}00594 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00595}00595 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00596}00596 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00597}00597 \textcolor{comment}{ * This function translates the crypto parameters into the format used}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00598}00598 \textcolor{comment}{ * by the firmware and hardware. Currently only AES-\/128 and AES-\/256 is}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00599}00599 \textcolor{comment}{ * supported for TLS v1.2 and TLS v1.3.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00600}00600 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00601}00601 \textcolor{comment}{ * Returns zero on success, else an error happened.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00602}00602 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00603}00603 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00604}00604 mlx5e\_tls\_rx\_set\_params(\textcolor{keywordtype}{void} *\mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, \textcolor{keyword}{struct} inpcb *inp, \textcolor{keyword}{const} \textcolor{keyword}{struct} tls\_session\_params *en)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00605}00605 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00606}00606         uint32\_t tcp\_sn\_he;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00607}00607         uint64\_t tls\_sn\_he;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00608}00608 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00609}00609         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_rx\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, param.const\_2, 2);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00610}00610         \textcolor{keywordflow}{if} (en-\/>tls\_vminor == TLS\_MINOR\_VER\_TWO)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00611}00611                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_rx\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, param.tls\_version, 2); \textcolor{comment}{/* v1.2 */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00612}00612         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00613}00613                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_rx\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, param.tls\_version, 3); \textcolor{comment}{/* v1.3 */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00614}00614         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_rx\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, param.const\_1, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00615}00615         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_rx\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, param.encryption\_standard, 1); \textcolor{comment}{/* TLS */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00616}00616 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00617}00617         \textcolor{comment}{/* copy the initial vector in place */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00618}00618         \textcolor{keywordflow}{switch} (en-\/>iv\_len) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00619}00619         \textcolor{keywordflow}{case} \mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_rx\_cntx, param.gcm\_iv):}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00620}00620         case \mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_rx\_cntx, param.gcm\_iv) +}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00621}00621              \mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_rx\_cntx, param.implicit\_iv):}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00622}00622                 memcpy(\mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(sw\_tls\_rx\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, param.gcm\_iv),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00623}00623                     en-\/>iv, en-\/>iv\_len);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00624}00624                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00625}00625         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00626}00626                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00627}00627         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00628}00628 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00629}00629         \textcolor{keywordflow}{if} (en-\/>cipher\_key\_len <= \mbox{\hyperlink{device_8h_aaf5b7017c184daa12a71900facaf9b93}{MLX5\_FLD\_SZ\_BYTES}}(sw\_tls\_rx\_cntx, key.key\_data)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00630}00630                 memcpy(\mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(sw\_tls\_rx\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, key.key\_data),}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00631}00631                     en-\/>cipher\_key, en-\/>cipher\_key\_len);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00632}00632                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_rx\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, key.key\_len, en-\/>cipher\_key\_len);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00633}00633         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00634}00634                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00635}00635         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00636}00636 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00637}00637         \textcolor{keywordflow}{if} (\_\_predict\_false(inp == NULL ||}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00638}00638             ktls\_get\_rx\_sequence(inp, \&tcp\_sn\_he, \&tls\_sn\_he) != 0))}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00639}00639                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00640}00640 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00641}00641         \mbox{\hyperlink{device_8h_a6e7776ca1e3178584753950058580eb6}{MLX5\_SET64}}(sw\_tls\_rx\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, param.initial\_record\_number, tls\_sn\_he);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00642}00642         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_rx\_cntx, \mbox{\hyperlink{device_8h_a8d4d31e2784e411744d2776ed7a2fa32}{ctx}}, param.resync\_tcp\_sn, tcp\_sn\_he);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00643}00643 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00644}00644         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00645}00645 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00646}00646 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00647}00647 \textcolor{comment}{/* Verify zero default */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00648}00648 \mbox{\hyperlink{device_8h_a304bfae1ba4b2b82404598b5304e1f1f}{CTASSERT}}(\mbox{\hyperlink{en__hw__tls__rx_8h_a6cbc325b0435dd7d32fdf18005da68e0}{MLX5E\_TLS\_RX\_ST\_INIT}} == 0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00649}00649 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00650}00650 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00651}00651 \textcolor{comment}{ * This functino is responsible for allocating a TLS RX tag. It is a}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00652}00652 \textcolor{comment}{ * callback function invoked by the network stack.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00653}00653 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00654}00654 \textcolor{comment}{ * Returns zero on success else an error happened.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00655}00655 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00656}00656 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00657}00657 \mbox{\hyperlink{en__hw__tls__rx_8h_adc386a4f5f99c29396d1d380d2e9be2c}{mlx5e\_tls\_rx\_snd\_tag\_alloc}}(\textcolor{keyword}{struct} ifnet *\mbox{\hyperlink{en_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00658}00658     \textcolor{keyword}{union} if\_snd\_tag\_alloc\_params *\mbox{\hyperlink{structmlx5e__priv_a082db7e920f50827afe0cf93857b5043}{params}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00659}00659     \textcolor{keyword}{struct} m\_snd\_tag **ppmt)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00660}00660 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00661}00661         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__iq}{mlx5e\_iq}} *\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00662}00662         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00663}00663         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00664}00664         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__rule}{mlx5\_flow\_rule}} *\mbox{\hyperlink{en__hw__tls__rx_8h_a9a19d8b9625bd87515041f254cd5ce7e}{flow\_rule}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00665}00665         \textcolor{keyword}{const} \textcolor{keyword}{struct }tls\_session\_params *en;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00666}00666         uint32\_t value;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00667}00667         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00668}00668 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00669}00669         \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}} = \mbox{\hyperlink{en_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00670}00670 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00671}00671         \textcolor{keywordflow}{if} (unlikely(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a4795b5a0fa2d0a63a36e40c448f9f50b}{gone}} != 0 || \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a65f7bebe867f631ee138e69149cc3899}{tls\_rx}}.\mbox{\hyperlink{structmlx5e__tls__rx_ae4336971a3fbc2777a6d108b9ca3355b}{init}} == 0 ||}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00672}00672             params-\/>hdr.flowtype == M\_HASHTYPE\_NONE))}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00673}00673                 \textcolor{keywordflow}{return} (EOPNOTSUPP);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00674}00674 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00675}00675         \textcolor{comment}{/* allocate new tag from zone, if any */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00676}00676         ptag = uma\_zalloc(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a65f7bebe867f631ee138e69149cc3899}{tls\_rx}}.\mbox{\hyperlink{structmlx5e__tls__rx_a7578ac3f37b0abf5695387870a54828a}{zone}}, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00677}00677         \textcolor{keywordflow}{if} (ptag == NULL)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00678}00678                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00679}00679 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00680}00680         \textcolor{comment}{/* sanity check default values */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00681}00681         MPASS(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a53b2bd6a1580aad304b179498d38d049}{dek\_index}} == 0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00682}00682         MPASS(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a4f1325b784ef681f10db15a801a188e9}{dek\_index\_ok}} == 0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00683}00683 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00684}00684         \textcolor{comment}{/* setup TLS RX tag */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00685}00685         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ab007063a281a036815860459e91d0d38}{tls\_rx}} = \&\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a65f7bebe867f631ee138e69149cc3899}{tls\_rx}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00686}00686         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a16914cc6db3840fb7059818ab1ee68f2}{flowtype}} = params-\/>hdr.flowtype;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00687}00687         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a253c54869fccbe69a49e3f8b5f624fe0}{flowid}} = params-\/>hdr.flowid;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00688}00688 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00689}00689         value = atomic\_fetchadd\_32(\&\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a65f7bebe867f631ee138e69149cc3899}{tls\_rx}}.\mbox{\hyperlink{structmlx5e__tls__rx_a61fc6998938939bad0c1cc4cee2c2840}{num\_resources}}, 1U);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00690}00690 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00691}00691         \textcolor{comment}{/* check resource limits */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00692}00692         \textcolor{keywordflow}{if} (value >= \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a65f7bebe867f631ee138e69149cc3899}{tls\_rx}}.\mbox{\hyperlink{structmlx5e__tls__rx_a5aec5cac4f0b5d249c1d7cb11079c883}{max\_resources}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00693}00693                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00694}00694                 \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00695}00695         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00696}00696 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00697}00697         en = \&params-\/>tls\_rx.tls-\/>params;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00698}00698 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00699}00699         \textcolor{comment}{/* only TLS v1.2 and v1.3 is currently supported */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00700}00700         \textcolor{keywordflow}{if} (en-\/>tls\_vmajor != TLS\_MAJOR\_VER\_ONE ||}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00701}00701             (en-\/>tls\_vminor != TLS\_MINOR\_VER\_TWO}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00702}00702 \#ifdef TLS\_MINOR\_VER\_THREE}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00703}00703              \&\& en-\/>tls\_vminor != TLS\_MINOR\_VER\_THREE}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00704}00704 \#endif}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00705}00705              )) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00706}00706                 error = EPROTONOSUPPORT;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00707}00707                 \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00708}00708         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00709}00709 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00710}00710         \textcolor{keywordflow}{switch} (en-\/>cipher\_algorithm) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00711}00711         \textcolor{keywordflow}{case} CRYPTO\_AES\_NIST\_GCM\_16:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00712}00712                 \textcolor{keywordflow}{switch} (en-\/>cipher\_key\_len) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00713}00713                 \textcolor{keywordflow}{case} 128 / 8:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00714}00714                         \textcolor{keywordflow}{if} (en-\/>tls\_vminor == TLS\_MINOR\_VER\_TWO) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00715}00715                                 \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__rx_8c_source_l00716}00716                                         error = EPROTONOSUPPORT;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00717}00717                                         \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00718}00718                                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00719}00719                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00720}00720                                 \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__rx_8c_source_l00721}00721                                         error = EPROTONOSUPPORT;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00722}00722                                         \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00723}00723                                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00724}00724                         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00725}00725                         error = mlx5e\_tls\_rx\_set\_params(}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00726}00726                             ptag-\/>crypto\_params, params-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ab007063a281a036815860459e91d0d38}{tls\_rx}}.inp, en);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00727}00727                         \textcolor{keywordflow}{if} (error)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00728}00728                                 \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00729}00729                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00730}00730 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00731}00731                 \textcolor{keywordflow}{case} 256 / 8:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00732}00732                         \textcolor{keywordflow}{if} (en-\/>tls\_vminor == TLS\_MINOR\_VER\_TWO) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00733}00733                                 \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__rx_8c_source_l00734}00734                                         error = EPROTONOSUPPORT;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00735}00735                                         \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00736}00736                                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00737}00737                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00738}00738                                 \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__rx_8c_source_l00739}00739                                         error = EPROTONOSUPPORT;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00740}00740                                         \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00741}00741                                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00742}00742                         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00743}00743                         error = mlx5e\_tls\_rx\_set\_params(}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00744}00744                             ptag-\/>crypto\_params, params-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ab007063a281a036815860459e91d0d38}{tls\_rx}}.inp, en);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00745}00745                         \textcolor{keywordflow}{if} (error)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00746}00746                                 \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00747}00747                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00748}00748 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00749}00749                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00750}00750                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00751}00751                         \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00752}00752                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00753}00753                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00754}00754         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00755}00755                 error = EPROTONOSUPPORT;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00756}00756                 \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00757}00757         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00758}00758 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00759}00759         \textcolor{comment}{/* store pointer to mbuf tag */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00760}00760         MPASS(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a5a2716bb5da384d10bf612bc0114affd}{tag}}.refcount == 0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00761}00761         m\_snd\_tag\_init(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a5a2716bb5da384d10bf612bc0114affd}{tag}}, \mbox{\hyperlink{en_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}, \&mlx5e\_tls\_rx\_snd\_tag\_sw);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00762}00762         *ppmt = \&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a5a2716bb5da384d10bf612bc0114affd}{tag}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00763}00763 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00764}00764         \textcolor{comment}{/* reset state */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00765}00765         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ad645c3ce98a6c5d75c46b891d3d8a408}{state}} = \mbox{\hyperlink{en__hw__tls__rx_8h_a6cbc325b0435dd7d32fdf18005da68e0}{MLX5E\_TLS\_RX\_ST\_INIT}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00766}00766 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00767}00767         queue\_work(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a65f7bebe867f631ee138e69149cc3899}{tls\_rx}}.\mbox{\hyperlink{structmlx5e__tls__rx_a5f7b4febb064f574c71db6aeef0c5330}{wq}}, \&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_abe5a879af8486a3f86334840697e9fbe}{work}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00768}00768         flush\_work(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_abe5a879af8486a3f86334840697e9fbe}{work}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00769}00769 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00770}00770         \textcolor{comment}{/* check that worker task completed successfully */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00771}00771         \mbox{\hyperlink{en__hw__tls__rx_8h_a14fedd9a17cf2d5864eafee3c74b070a}{MLX5E\_TLS\_RX\_TAG\_LOCK}}(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00772}00772         \textcolor{keywordflow}{if} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ad645c3ce98a6c5d75c46b891d3d8a408}{state}} == \mbox{\hyperlink{en__hw__tls__rx_8h_a30c28b26d6f9f54d0a8f9b9b81d9522f}{MLX5E\_TLS\_RX\_ST\_SETUP}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00773}00773                 ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ad645c3ce98a6c5d75c46b891d3d8a408}{state}} = \mbox{\hyperlink{en__hw__tls__rx_8h_a75dc940ba69c32f350a4f65483ca3b87}{MLX5E\_TLS\_RX\_ST\_READY}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00774}00774                 error = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00775}00775         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00776}00776                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00777}00777         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00778}00778         \mbox{\hyperlink{en__hw__tls__rx_8h_a8f16ec60277129dee3201acf68152999}{MLX5E\_TLS\_RX\_TAG\_UNLOCK}}(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00779}00779 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00780}00780         \textcolor{keywordflow}{if} (unlikely(error))}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00781}00781                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{mlx5__main_8c_a05892a023f8cebf7a30dfd319be2a6d0}{cleanup}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00782}00782 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00783}00783         \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}} = mlx5e\_tls\_rx\_get\_iq(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a253c54869fccbe69a49e3f8b5f624fe0}{flowid}}, ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a16914cc6db3840fb7059818ab1ee68f2}{flowtype}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00784}00784 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00785}00785         \textcolor{comment}{/* establish connection between DEK and TIR */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00786}00786         \textcolor{keywordflow}{if} (mlx5e\_tls\_rx\_send\_static\_parameters(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}, ptag) != 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00787}00787                 \mbox{\hyperlink{en__hw__tls__rx_8h_af6a850dbcc0a67c576b58dfd22b1b23f}{MLX5E\_TLS\_RX\_STAT\_INC}}(ptag, rx\_error, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00788}00788                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00789}00789                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{mlx5__main_8c_a05892a023f8cebf7a30dfd319be2a6d0}{cleanup}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00790}00790         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00791}00791 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00792}00792         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_rx\_cntx, ptag-\/>crypto\_params, progress.auth\_state,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00793}00793             \mbox{\hyperlink{en__hw__tls__rx_8h_a97f905ac94bfebd46e50e32c7389e6eba355f95739694a0fb3bfe6d4457113aa9}{MLX5E\_TLS\_RX\_PROGRESS\_PARAMS\_AUTH\_STATE\_NO\_OFFLOAD}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00794}00794         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(sw\_tls\_rx\_cntx, ptag-\/>crypto\_params, progress.record\_tracker\_state,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00795}00795             \mbox{\hyperlink{en__hw__tls__rx_8h_a9b29769343da78881f442e657eb62b6eacd4bc10db05114adf22036057486bd3e}{MLX5E\_TLS\_RX\_PROGRESS\_PARAMS\_RECORD\_TRACKER\_STATE\_START}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00796}00796 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00797}00797         \textcolor{comment}{/* reset state to all zeros */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00798}00798         \textcolor{keywordflow}{if} (mlx5e\_tls\_rx\_send\_progress\_parameters\_sync(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}, ptag) != 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00799}00799                 \mbox{\hyperlink{en__hw__tls__rx_8h_af6a850dbcc0a67c576b58dfd22b1b23f}{MLX5E\_TLS\_RX\_STAT\_INC}}(ptag, rx\_error, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00800}00800                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00801}00801                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{mlx5__main_8c_a05892a023f8cebf7a30dfd319be2a6d0}{cleanup}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00802}00802         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00803}00803 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00804}00804         \textcolor{keywordflow}{if} (\mbox{\hyperlink{en_8h_a55ba31cf9df263813f4c49c32e4de4f2}{ifp}}-\/>if\_pcp != IFNET\_PCP\_NONE || params-\/>tls\_rx.vlan\_id != 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00805}00805                 \textcolor{comment}{/* create flow rule for TLS RX traffic (tagged) */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00806}00806                 \mbox{\hyperlink{en__hw__tls__rx_8h_a9a19d8b9625bd87515041f254cd5ce7e}{flow\_rule}} = \mbox{\hyperlink{fs__tcp_8h_a57bb2f01cf404b16423476c0a8a79b82}{mlx5e\_accel\_fs\_add\_inpcb}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, params-\/>\mbox{\hyperlink{structmlx5e__priv_a65f7bebe867f631ee138e69149cc3899}{tls\_rx}}.inp,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00807}00807                     ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a955100fd032337ee9690108753a4083f}{tirn}}, \mbox{\hyperlink{fs_8h_ac34c4c978f4130a92a5068f9e21ea9fcaff7a391f92221dc191e9f36077c36988}{MLX5\_FS\_DEFAULT\_FLOW\_TAG}}, params-\/>tls\_rx.vlan\_id);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00808}00808         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00809}00809                 \textcolor{comment}{/* create flow rule for TLS RX traffic (untagged) */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00810}00810                 \mbox{\hyperlink{en__hw__tls__rx_8h_a9a19d8b9625bd87515041f254cd5ce7e}{flow\_rule}} = \mbox{\hyperlink{fs__tcp_8h_a57bb2f01cf404b16423476c0a8a79b82}{mlx5e\_accel\_fs\_add\_inpcb}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, params-\/>\mbox{\hyperlink{structmlx5e__priv_a65f7bebe867f631ee138e69149cc3899}{tls\_rx}}.inp,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00811}00811                     ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a955100fd032337ee9690108753a4083f}{tirn}}, \mbox{\hyperlink{fs_8h_ac34c4c978f4130a92a5068f9e21ea9fcaff7a391f92221dc191e9f36077c36988}{MLX5\_FS\_DEFAULT\_FLOW\_TAG}}, \mbox{\hyperlink{fs__tcp_8h_ab92a802ea23a0a0bbe8adfb399aa80d0}{MLX5E\_ACCEL\_FS\_ADD\_INPCB\_NO\_VLAN}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00812}00812         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00813}00813 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00814}00814         \textcolor{keywordflow}{if} (IS\_ERR\_OR\_NULL(\mbox{\hyperlink{en__hw__tls__rx_8h_a9a19d8b9625bd87515041f254cd5ce7e}{flow\_rule}})) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00815}00815                 \mbox{\hyperlink{en__hw__tls__rx_8h_af6a850dbcc0a67c576b58dfd22b1b23f}{MLX5E\_TLS\_RX\_STAT\_INC}}(ptag, rx\_error, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00816}00816                 error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00817}00817                 \textcolor{keywordflow}{goto} \mbox{\hyperlink{mlx5__main_8c_a05892a023f8cebf7a30dfd319be2a6d0}{cleanup}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00818}00818         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00819}00819 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00820}00820         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a6c338cc839a395a7b552da185be3e3a9}{flow\_rule}} = \mbox{\hyperlink{en__hw__tls__rx_8h_a9a19d8b9625bd87515041f254cd5ce7e}{flow\_rule}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00821}00821 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00822}00822         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00823}00823 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00824}00824 \mbox{\hyperlink{mlx5__main_8c_a05892a023f8cebf7a30dfd319be2a6d0}{cleanup}}:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00825}00825         m\_snd\_tag\_rele(\&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a5a2716bb5da384d10bf612bc0114affd}{tag}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00826}00826         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00827}00827 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00828}00828 failure:}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00829}00829         mlx5e\_tls\_rx\_tag\_zfree(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00830}00830         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00831}00831 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00832}00832 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00833}00833 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00834}00834 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00835}00835 \textcolor{comment}{ * This function adds the TCP sequence number and TLS record number in}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00836}00836 \textcolor{comment}{ * host endian format to a small database. When TLS records have the}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00837}00837 \textcolor{comment}{ * same length, they are simply accumulated by counting instead of}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00838}00838 \textcolor{comment}{ * separated entries in the TLS database. The dimension of the}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00839}00839 \textcolor{comment}{ * database is such that it cannot store more than 1GByte of}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00840}00840 \textcolor{comment}{ * continuous TCP data to avoid issues with TCP sequence number wrap}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00841}00841 \textcolor{comment}{ * around. A record length of zero bytes has special meaning and means}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00842}00842 \textcolor{comment}{ * that resync completed and all data in the database can be}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00843}00843 \textcolor{comment}{ * discarded. This function is called after the TCP stack has}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00844}00844 \textcolor{comment}{ * re-\/assembled all TCP fragments due to out of order packet reception}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00845}00845 \textcolor{comment}{ * and all TCP sequence numbers should be sequential.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00846}00846 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00847}00847 \textcolor{comment}{ * This function returns true if a so-\/called TLS RX resync operation}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00848}00848 \textcolor{comment}{ * is in progress. Else no such operation is in progress.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00849}00849 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00850}00850 \textcolor{keyword}{static} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00851}00851 mlx5e\_tls\_rx\_snd\_tag\_add\_tcp\_sequence(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *ptag,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00852}00852     uint32\_t tcp\_sn\_he, uint32\_t len, uint64\_t tls\_rcd)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00853}00853 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00854}00854         uint16\_t i, j, n;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00855}00855 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00856}00856         \textcolor{keywordflow}{if} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a9abaa808c99daf3b0e1c7c44a58c8142}{tcp\_resync\_active}} == 0 ||}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00857}00857             ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_aa6e2c2e7fdaf049f0bb76eee32b0f7d4}{tcp\_resync\_next}} != tcp\_sn\_he ||}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00858}00858             len == 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00859}00859                 \textcolor{comment}{/* start over again or terminate */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00860}00860                 ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a9abaa808c99daf3b0e1c7c44a58c8142}{tcp\_resync\_active}} = (len != 0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00861}00861                 ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a49045b7bc0bb6057511396b0d7023f50}{tcp\_resync\_len}}[0] = len;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00862}00862                 ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a22bb125001820d7f651653b0d165df3b}{tcp\_resync\_num}}[0] = 1;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00863}00863                 ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ae1c257a15cb16abb5cb7d06ed05e2ef5}{tcp\_resync\_pc}} = (len != 0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00864}00864                 ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_aa9b16bb9798ee240cd8c056c56b8b1b4}{tcp\_resync\_cc}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00865}00865                 ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a05809a6577393e856982d963570c34d2}{tcp\_resync\_start}} = tcp\_sn\_he;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00866}00866                 ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a87521a292c71553d46492036e0a13b2e}{rcd\_resync\_start}} = tls\_rcd;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00867}00867         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00868}00868                 i = (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ae1c257a15cb16abb5cb7d06ed05e2ef5}{tcp\_resync\_pc}} -\/ 1) \& (\mbox{\hyperlink{en__hw__tls__rx_8h_a2a1227a50a1432959ebc0c4d71279a7f}{MLX5E\_TLS\_RX\_RESYNC\_MAX}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00869}00869                 n = ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ae1c257a15cb16abb5cb7d06ed05e2ef5}{tcp\_resync\_pc}} -\/ ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_aa9b16bb9798ee240cd8c056c56b8b1b4}{tcp\_resync\_cc}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00870}00870 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00871}00871                 \textcolor{comment}{/* check if same length like last time */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00872}00872                 \textcolor{keywordflow}{if} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a49045b7bc0bb6057511396b0d7023f50}{tcp\_resync\_len}}[i] == len \&\&}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00873}00873                     ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a22bb125001820d7f651653b0d165df3b}{tcp\_resync\_num}}[i] != \mbox{\hyperlink{en__hw__tls__rx_8h_ac19dfc6d603a38482064a8fd1e9c7e97}{MLX5E\_TLS\_RX\_NUM\_MAX}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00874}00874                         \textcolor{comment}{/* use existing entry */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00875}00875                         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a22bb125001820d7f651653b0d165df3b}{tcp\_resync\_num}}[i]++;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00876}00876                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (n == \mbox{\hyperlink{en__hw__tls__rx_8h_a2a1227a50a1432959ebc0c4d71279a7f}{MLX5E\_TLS\_RX\_RESYNC\_MAX}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00877}00877                         j = ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_aa9b16bb9798ee240cd8c056c56b8b1b4}{tcp\_resync\_cc}}++ \& (\mbox{\hyperlink{en__hw__tls__rx_8h_a2a1227a50a1432959ebc0c4d71279a7f}{MLX5E\_TLS\_RX\_RESYNC\_MAX}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00878}00878                         \textcolor{comment}{/* adjust starting TCP sequence number */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00879}00879                         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a87521a292c71553d46492036e0a13b2e}{rcd\_resync\_start}} += ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a22bb125001820d7f651653b0d165df3b}{tcp\_resync\_num}}[j];}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00880}00880                         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a05809a6577393e856982d963570c34d2}{tcp\_resync\_start}} += ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a49045b7bc0bb6057511396b0d7023f50}{tcp\_resync\_len}}[j] * ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a22bb125001820d7f651653b0d165df3b}{tcp\_resync\_num}}[j];}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00881}00881                         i = ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ae1c257a15cb16abb5cb7d06ed05e2ef5}{tcp\_resync\_pc}}++ \& (\mbox{\hyperlink{en__hw__tls__rx_8h_a2a1227a50a1432959ebc0c4d71279a7f}{MLX5E\_TLS\_RX\_RESYNC\_MAX}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00882}00882                         \textcolor{comment}{/* store new entry */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00883}00883                         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a49045b7bc0bb6057511396b0d7023f50}{tcp\_resync\_len}}[i] = len;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00884}00884                         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a22bb125001820d7f651653b0d165df3b}{tcp\_resync\_num}}[i] = 1;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00885}00885                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00886}00886                         i = ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ae1c257a15cb16abb5cb7d06ed05e2ef5}{tcp\_resync\_pc}}++ \& (\mbox{\hyperlink{en__hw__tls__rx_8h_a2a1227a50a1432959ebc0c4d71279a7f}{MLX5E\_TLS\_RX\_RESYNC\_MAX}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00887}00887                         \textcolor{comment}{/* add new entry */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00888}00888                         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a49045b7bc0bb6057511396b0d7023f50}{tcp\_resync\_len}}[i] = len;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00889}00889                         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a22bb125001820d7f651653b0d165df3b}{tcp\_resync\_num}}[i] = 1;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00890}00890                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00891}00891         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00892}00892 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00893}00893         \textcolor{comment}{/* store next TCP SN in host endian format */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00894}00894         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_aa6e2c2e7fdaf049f0bb76eee32b0f7d4}{tcp\_resync\_next}} = tcp\_sn\_he + len;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00895}00895 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00896}00896         \textcolor{keywordflow}{return} (ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a9abaa808c99daf3b0e1c7c44a58c8142}{tcp\_resync\_active}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00897}00897 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00898}00898 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00899}00899 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00900}00900 \textcolor{comment}{ * This function checks if the given TCP sequence number points to the}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00901}00901 \textcolor{comment}{ * beginning of a valid TLS header.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00902}00902 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00903}00903 \textcolor{comment}{ * Returns true if a match is found. Else false.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00904}00904 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00905}00905 \textcolor{keyword}{static} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00906}00906 mlx5e\_tls\_rx\_snd\_tag\_find\_tcp\_sn\_and\_tls\_rcd(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *ptag,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00907}00907     uint32\_t tcp\_sn\_he, uint32\_t *p\_next\_tcp\_sn\_he, uint64\_t *p\_tls\_rcd)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00908}00908 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00909}00909         uint16\_t i, j;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00910}00910         uint32\_t off = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00911}00911         uint32\_t rcd = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00912}00912         uint32\_t delta;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00913}00913         uint32\_t leap;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00914}00914 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00915}00915         \textcolor{keywordflow}{for} (i = ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_aa9b16bb9798ee240cd8c056c56b8b1b4}{tcp\_resync\_cc}}; i != ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ae1c257a15cb16abb5cb7d06ed05e2ef5}{tcp\_resync\_pc}}; i++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00916}00916                 delta = tcp\_sn\_he -\/ off -\/ ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a05809a6577393e856982d963570c34d2}{tcp\_resync\_start}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00917}00917 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00918}00918                 \textcolor{comment}{/* check if subtraction went negative */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00919}00919                 \textcolor{keywordflow}{if} ((int32\_t)delta < 0)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00920}00920                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00921}00921 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00922}00922                 j = i \& (\mbox{\hyperlink{en__hw__tls__rx_8h_a2a1227a50a1432959ebc0c4d71279a7f}{MLX5E\_TLS\_RX\_RESYNC\_MAX}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00923}00923                 leap = ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a49045b7bc0bb6057511396b0d7023f50}{tcp\_resync\_len}}[j] * ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a22bb125001820d7f651653b0d165df3b}{tcp\_resync\_num}}[j];}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00924}00924                 \textcolor{keywordflow}{if} (delta < leap) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00925}00925                         \textcolor{keywordflow}{if} ((delta \% ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a49045b7bc0bb6057511396b0d7023f50}{tcp\_resync\_len}}[j]) == 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00926}00926                                 *p\_next\_tcp\_sn\_he = tcp\_sn\_he +}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00927}00927                                     ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a49045b7bc0bb6057511396b0d7023f50}{tcp\_resync\_len}}[j];}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00928}00928                                 *p\_tls\_rcd = ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a87521a292c71553d46492036e0a13b2e}{rcd\_resync\_start}} +}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00929}00929                                     (uint64\_t)rcd +}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00930}00930                                     (uint64\_t)(delta / ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a49045b7bc0bb6057511396b0d7023f50}{tcp\_resync\_len}}[j]);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00931}00931                                 \textcolor{keywordflow}{return} (\textcolor{keyword}{true});          \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00932}00932                         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00933}00933                         \textcolor{keywordflow}{break};  \textcolor{comment}{/* invalid offset */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00934}00934                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00935}00935                 rcd += ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a22bb125001820d7f651653b0d165df3b}{tcp\_resync\_num}}[j];}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00936}00936                 off += leap;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00937}00937         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00938}00938         \textcolor{keywordflow}{return} (\textcolor{keyword}{false}); \textcolor{comment}{/* not found */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00939}00939 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00940}00940 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00941}00941 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00942}00942 \textcolor{comment}{ * This is a callback function from the network stack to keep track of}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00943}00943 \textcolor{comment}{ * TLS RX TCP sequence numbers.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00944}00944 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00945}00945 \textcolor{comment}{ * Returns zero on success else an error happened.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00946}00946 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00947}00947 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00948}00948 mlx5e\_tls\_rx\_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__rx_8c_source_l00949}00949 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00950}00950         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *ptag;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00951}00951         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00952}00952         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__iq}{mlx5e\_iq}} *\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00953}00953         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00954}00954 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00955}00955         ptag = container\_of(pmt, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}}, \mbox{\hyperlink{en_8h_afc9f03e6e54bbc07f5b9e002750fe675}{tag}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00956}00956         \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}} = container\_of(ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ab007063a281a036815860459e91d0d38}{tls\_rx}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}}, \mbox{\hyperlink{en__hw__tls__rx_8h_a6184c705bc7acb23e1b00303facbaaf0}{tls\_rx}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00957}00957 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00958}00958         \textcolor{keywordflow}{if} (unlikely(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a4795b5a0fa2d0a63a36e40c448f9f50b}{gone}} != 0))}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00959}00959                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00960}00960 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00961}00961         \mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}} = mlx5e\_tls\_rx\_get\_iq(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a253c54869fccbe69a49e3f8b5f624fe0}{flowid}}, ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a16914cc6db3840fb7059818ab1ee68f2}{flowtype}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00962}00962 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00963}00963         \mbox{\hyperlink{en__hw__tls__rx_8h_a14fedd9a17cf2d5864eafee3c74b070a}{MLX5E\_TLS\_RX\_TAG\_LOCK}}(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00964}00964 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00965}00965         \textcolor{keywordflow}{if} (mlx5e\_tls\_rx\_snd\_tag\_add\_tcp\_sequence(ptag,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00966}00966             params-\/>tls\_rx.tls\_hdr\_tcp\_sn,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00967}00967             params-\/>tls\_rx.tls\_rec\_length,}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00968}00968             params-\/>tls\_rx.tls\_seq\_number) \&\&}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00969}00969             ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_acd99ab13cf35ee79947b9fe142c9aec4}{tcp\_resync\_pending}} == 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00970}00970                 err = mlx5e\_tls\_rx\_receive\_progress\_parameters(\mbox{\hyperlink{en_8h_a6de1c81631b5c5c20c21156afdad153c}{iq}}, ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00971}00971                 \textcolor{keywordflow}{if} (err != 0) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00972}00972                         \mbox{\hyperlink{en__hw__tls__rx_8h_af6a850dbcc0a67c576b58dfd22b1b23f}{MLX5E\_TLS\_RX\_STAT\_INC}}(ptag, rx\_resync\_err, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00973}00973                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00974}00974                         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_acd99ab13cf35ee79947b9fe142c9aec4}{tcp\_resync\_pending}} = 1;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00975}00975                         \mbox{\hyperlink{en__hw__tls__rx_8h_af6a850dbcc0a67c576b58dfd22b1b23f}{MLX5E\_TLS\_RX\_STAT\_INC}}(ptag, rx\_resync\_ok, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00976}00976                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00977}00977         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00978}00978                 err = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00979}00979         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00980}00980         \mbox{\hyperlink{en__hw__tls__rx_8h_a8f16ec60277129dee3201acf68152999}{MLX5E\_TLS\_RX\_TAG\_UNLOCK}}(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00981}00981 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00982}00982         \textcolor{keywordflow}{return} (-\/err);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00983}00983 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00984}00984 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00985}00985 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00986}00986 \textcolor{comment}{ * This function frees a TLS RX tag in a non-\/blocking way.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00987}00987 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00988}00988 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00989}00989 mlx5e\_tls\_rx\_snd\_tag\_free(\textcolor{keyword}{struct} m\_snd\_tag *pmt)}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00990}00990 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00991}00991         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}} *ptag =}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00992}00992             container\_of(pmt, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__tls__rx__tag}{mlx5e\_tls\_rx\_tag}}, \mbox{\hyperlink{en_8h_afc9f03e6e54bbc07f5b9e002750fe675}{tag}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00993}00993         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00994}00994 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00995}00995         \mbox{\hyperlink{en__hw__tls__rx_8h_a14fedd9a17cf2d5864eafee3c74b070a}{MLX5E\_TLS\_RX\_TAG\_LOCK}}(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00996}00996         ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_ad645c3ce98a6c5d75c46b891d3d8a408}{state}} = \mbox{\hyperlink{en__hw__tls__rx_8h_adb4d3e7531a10b62037e057f88f48fd8}{MLX5E\_TLS\_RX\_ST\_RELEASE}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00997}00997         \mbox{\hyperlink{en__hw__tls__rx_8h_a8f16ec60277129dee3201acf68152999}{MLX5E\_TLS\_RX\_TAG\_UNLOCK}}(ptag);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00998}00998 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l00999}00999         \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}} = ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_a5a2716bb5da384d10bf612bc0114affd}{tag}}.ifp-\/>if\_softc;}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01000}01000         queue\_work(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a65f7bebe867f631ee138e69149cc3899}{tls\_rx}}.\mbox{\hyperlink{structmlx5e__tls__rx_a5f7b4febb064f574c71db6aeef0c5330}{wq}}, \&ptag-\/>\mbox{\hyperlink{structmlx5e__tls__rx__tag_abe5a879af8486a3f86334840697e9fbe}{work}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01001}01001 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01002}01002 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01003}01003 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01004}01004 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01005}01005 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01006}\mbox{\hyperlink{en__hw__tls__rx_8h_adcbb1b2e9b17e5dce112b8b09fcb2830}{01006}} \mbox{\hyperlink{mlx5__en__hw__tls__rx_8c_adebfc80092897562fa1bc99e1c5e42fd}{mlx5e\_tls\_rx\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01007}01007 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01008}01008 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01009}01009         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01010}01010 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01011}01011 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01012}01012 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01013}\mbox{\hyperlink{en__hw__tls__rx_8h_a10db71af0a0f820b15f239466ecc22c6}{01013}} \mbox{\hyperlink{mlx5__en__hw__tls__rx_8c_a5050c2b7b7b6b11e506f2c3cd11b2fbd}{mlx5e\_tls\_rx\_cleanup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01014}01014 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01015}01015         \textcolor{comment}{/* NOP */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01016}01016 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01017}01017 }
\DoxyCodeLine{\Hypertarget{mlx5__en__hw__tls__rx_8c_source_l01018}01018 \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
