\hypertarget{mlx5__en__port__buffer_8c_source}{}\doxysection{mlx5\+\_\+en\+\_\+port\+\_\+buffer.\+c}
\label{mlx5__en__port__buffer_8c_source}\index{dev/mlx5/mlx5\_en/mlx5\_en\_port\_buffer.c@{dev/mlx5/mlx5\_en/mlx5\_en\_port\_buffer.c}}
\mbox{\hyperlink{mlx5__en__port__buffer_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2018-\/2019 Mellanox Technologies. All rights reserved.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00004}00004 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00005}00005 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00006}00006 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00007}00007 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00008}00008 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00009}00009 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00010}00010 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00011}00011 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00013}00013 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00014}00014 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00015}00015 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00016}00016 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00017}00017 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00018}00018 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00019}00019 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00020}00020 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00021}00021 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00022}00022 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00023}00023 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00024}00024 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00025}00025 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00026}00026 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00027}00027 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00028}00028 \textcolor{preprocessor}{\#include "{}opt\_rss.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00029}00029 \textcolor{preprocessor}{\#include "{}opt\_ratelimit.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{port__buffer_8h}{dev/mlx5/mlx5\_en/port\_buffer.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00032}00032 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00033}\mbox{\hyperlink{mlx5__en__port__buffer_8c_a6e4b4bfdf46637a2349e89660bb11ebf}{00033}} \textcolor{preprocessor}{\#define MLX5E\_MAX\_PORT\_MTU  9216}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00035}\mbox{\hyperlink{mlx5__en__port__buffer_8c_a1281dfc1f0829aa9ca4f7fd6ca79fc5c}{00035}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__en__port__buffer_8c_a1281dfc1f0829aa9ca4f7fd6ca79fc5c}{mlx5e\_port\_query\_buffer}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00036}00036                             \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__port__buffer}{mlx5e\_port\_buffer}} *port\_buffer)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00037}00037 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00038}00038         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev = \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00039}00039         \textcolor{keywordtype}{int} sz = \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(pbmc\_reg);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00040}00040         u32 total\_used = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00041}00041         \textcolor{keywordtype}{void} *buffer;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00042}00042         \textcolor{keywordtype}{void} *out;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00043}00043         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00044}00044         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00045}00045 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00046}00046         out = kzalloc(sz, GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00047}00047         \textcolor{keywordflow}{if} (!out)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00048}00048                 \textcolor{keywordflow}{return} -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00050}00050         err = \mbox{\hyperlink{mlx5__port_8c_ad84aea8b1a6c4167ae5dbc0ce01b203e}{mlx5e\_port\_query\_pbmc}}(mdev, out);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00051}00051         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00052}00052                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00053}00053 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00054}00054         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{port__buffer_8h_ad37bc7d5900a4786ae13ec02d013f7c5}{MLX5E\_MAX\_BUFFER}}; i++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00055}00055                 buffer = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(pbmc\_reg, out, buffer[i]);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00056}00056                 port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_aa6d1c7590e2db7bef19e7370eaa27df5}{lossy}} =}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00057}00057                         \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(bufferx\_reg, buffer, lossy);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00058}00058                 port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_a635c580091c8fb29ea17a81e99faf6d9}{epsb}} =}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00059}00059                         \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(bufferx\_reg, buffer, epsb);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00060}00060                 port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_a1fa9658fd6edaf696b4bc8e8046f497b}{size}} =}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00061}00061                         \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(bufferx\_reg, buffer, size) << \mbox{\hyperlink{port__buffer_8h_a3ee349b40cdf39c1ef26395975bbf8d0}{MLX5E\_BUFFER\_CELL\_SHIFT}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00062}00062                 port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_a72431bf3a4ac278cf14cc945e5aa20c9}{xon}} =}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00063}00063                         \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(bufferx\_reg, buffer, xon\_threshold) << \mbox{\hyperlink{port__buffer_8h_a3ee349b40cdf39c1ef26395975bbf8d0}{MLX5E\_BUFFER\_CELL\_SHIFT}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00064}00064                 port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_aa128235d6cad69498574b72b2d60a535}{xoff}} =}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00065}00065                         \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(bufferx\_reg, buffer, xoff\_threshold) << \mbox{\hyperlink{port__buffer_8h_a3ee349b40cdf39c1ef26395975bbf8d0}{MLX5E\_BUFFER\_CELL\_SHIFT}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00066}00066                 total\_used += port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_a1fa9658fd6edaf696b4bc8e8046f497b}{size}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00068}00068                 \mbox{\hyperlink{en_8h_ac5e09d6a6e0f5787e97c14b1b9fa6ffe}{mlx5e\_dbg}}(HW, \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, \textcolor{stringliteral}{"{}buffer \%d: size=\%d, xon=\%d, xoff=\%d, epsb=\%d, lossy=\%d\(\backslash\)n"{}}, i,}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00069}00069                           port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_a1fa9658fd6edaf696b4bc8e8046f497b}{size}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00070}00070                           port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_a72431bf3a4ac278cf14cc945e5aa20c9}{xon}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00071}00071                           port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_aa128235d6cad69498574b72b2d60a535}{xoff}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00072}00072                           port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_a635c580091c8fb29ea17a81e99faf6d9}{epsb}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00073}00073                           port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_aa6d1c7590e2db7bef19e7370eaa27df5}{lossy}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00074}00074         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00076}00076         port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a7b18ba5e6772fe5989cb95ec036f4341}{port\_buffer\_size}} =}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00077}00077                 \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(pbmc\_reg, out, port\_buffer\_size) << \mbox{\hyperlink{port__buffer_8h_a3ee349b40cdf39c1ef26395975bbf8d0}{MLX5E\_BUFFER\_CELL\_SHIFT}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00078}00078         port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a0db466a9d492701c2d4529c08c1c7e27}{spare\_buffer\_size}} =}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00079}00079                 port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a7b18ba5e6772fe5989cb95ec036f4341}{port\_buffer\_size}} -\/ total\_used;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00080}00080 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00081}00081         \mbox{\hyperlink{en_8h_ac5e09d6a6e0f5787e97c14b1b9fa6ffe}{mlx5e\_dbg}}(HW, \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, \textcolor{stringliteral}{"{}total buffer size=\%d, spare buffer size=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00082}00082                   port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a7b18ba5e6772fe5989cb95ec036f4341}{port\_buffer\_size}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00083}00083                   port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a0db466a9d492701c2d4529c08c1c7e27}{spare\_buffer\_size}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00084}00084 out:}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00085}00085         kfree(out);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00086}00086         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00087}00087 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00088}00088 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00089}\mbox{\hyperlink{mlx5__en__port__buffer_8c_a9a0bd9e33a1fc30d90689c6aebd19d85}{00089}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__en__port__buffer_8c_a9a0bd9e33a1fc30d90689c6aebd19d85}{port\_set\_buffer}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00090}00090                            \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__port__buffer}{mlx5e\_port\_buffer}} *port\_buffer)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00091}00091 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00092}00092         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev = \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00093}00093         \textcolor{keywordtype}{int} sz = \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(pbmc\_reg);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00094}00094         \textcolor{keywordtype}{void} *buffer;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00095}00095         \textcolor{keywordtype}{void} *in;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00096}00096         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00097}00097         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00099}00099         in = kzalloc(sz, GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00100}00100         \textcolor{keywordflow}{if} (!in)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00101}00101                 \textcolor{keywordflow}{return} -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00103}00103         err = \mbox{\hyperlink{mlx5__port_8c_ad84aea8b1a6c4167ae5dbc0ce01b203e}{mlx5e\_port\_query\_pbmc}}(mdev, in);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00104}00104         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00105}00105                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00106}00106 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00107}00107         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{port__buffer_8h_ad37bc7d5900a4786ae13ec02d013f7c5}{MLX5E\_MAX\_BUFFER}}; i++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00108}00108                 buffer = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(pbmc\_reg, in, buffer[i]);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00109}00109 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00110}00110                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(bufferx\_reg, buffer, size,}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00111}00111                          port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_a1fa9658fd6edaf696b4bc8e8046f497b}{size}} >> \mbox{\hyperlink{port__buffer_8h_a3ee349b40cdf39c1ef26395975bbf8d0}{MLX5E\_BUFFER\_CELL\_SHIFT}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00112}00112                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(bufferx\_reg, buffer, lossy,}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00113}00113                          port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_aa6d1c7590e2db7bef19e7370eaa27df5}{lossy}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00114}00114                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(bufferx\_reg, buffer, xoff\_threshold,}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00115}00115                          port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_aa128235d6cad69498574b72b2d60a535}{xoff}} >> \mbox{\hyperlink{port__buffer_8h_a3ee349b40cdf39c1ef26395975bbf8d0}{MLX5E\_BUFFER\_CELL\_SHIFT}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00116}00116                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(bufferx\_reg, buffer, xon\_threshold,}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00117}00117                          port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_a72431bf3a4ac278cf14cc945e5aa20c9}{xon}} >> \mbox{\hyperlink{port__buffer_8h_a3ee349b40cdf39c1ef26395975bbf8d0}{MLX5E\_BUFFER\_CELL\_SHIFT}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00118}00118         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00119}00119 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00120}00120         err = \mbox{\hyperlink{mlx5__port_8c_ae185a737aa1d8a65c1bc231c7a379d71}{mlx5e\_port\_set\_pbmc}}(mdev, in);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00121}00121 out:}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00122}00122         kfree(in);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00123}00123         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00124}00124 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00125}00125 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00126}00126 \textcolor{comment}{/* xoff = ((301+2.16 * len [m]) * speed [Gbps] + 2.72 MTU [B]) */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00127}\mbox{\hyperlink{mlx5__en__port__buffer_8c_a19ce167a5bc87b278c54900a3135f323}{00127}} \textcolor{keyword}{static} u32 \mbox{\hyperlink{mlx5__en__port__buffer_8c_a19ce167a5bc87b278c54900a3135f323}{calculate\_xoff}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} mtu)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00128}00128 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00129}00129         u32 speed;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00130}00130         u32 xoff;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00131}00131         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00132}00132 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00133}00133         err = \mbox{\hyperlink{mlx5__port_8c_aa748929af17fa9534b61812f2878a6f8}{mlx5e\_port\_linkspeed}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, \&speed);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00134}00134         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00135}00135                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, \textcolor{stringliteral}{"{}cannot get port speed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00136}00136                 speed = \mbox{\hyperlink{port_8h_a3e32bef5619db32289542cdb7860a500}{SPEED\_40000}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00137}00137         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00138}00138         speed = max\_t(u32, speed, \mbox{\hyperlink{port_8h_a3e32bef5619db32289542cdb7860a500}{SPEED\_40000}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00139}00139         xoff = (301 + 216 * \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_aabc59462469abef8ff29a709a350dbe8}{dcbx}}.\mbox{\hyperlink{structmlx5e__dcbx_acde304f3a526e2e3cb2954b2a5f8d136}{cable\_len}} / 100) * speed / 1000 + 272 * mtu / 100;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00140}00140 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00141}00141         \mbox{\hyperlink{en_8h_ac5e09d6a6e0f5787e97c14b1b9fa6ffe}{mlx5e\_dbg}}(HW, \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, \textcolor{stringliteral}{"{}\%s: xoff=\%d\(\backslash\)n"{}}, \_\_func\_\_, xoff);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00142}00142         \textcolor{keywordflow}{return} xoff;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00143}00143 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00144}00144 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00145}\mbox{\hyperlink{mlx5__en__port__buffer_8c_a0a183f8c4e6363662778202e1a9d89ef}{00145}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__en__port__buffer_8c_a0a183f8c4e6363662778202e1a9d89ef}{update\_xoff\_threshold}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00146}00146     \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__port__buffer}{mlx5e\_port\_buffer}} *port\_buffer, u32 xoff)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00147}00147 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00148}00148         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00149}00149 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00150}00150         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{port__buffer_8h_ad37bc7d5900a4786ae13ec02d013f7c5}{MLX5E\_MAX\_BUFFER}}; i++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00151}00151                 \textcolor{keywordflow}{if} (port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_aa6d1c7590e2db7bef19e7370eaa27df5}{lossy}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00152}00152                         port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_aa128235d6cad69498574b72b2d60a535}{xoff}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00153}00153                         port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_a72431bf3a4ac278cf14cc945e5aa20c9}{xon}}  = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00154}00154                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00155}00155                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00156}00156 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00157}00157                 \textcolor{keywordflow}{if} (port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_a1fa9658fd6edaf696b4bc8e8046f497b}{size}} <}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00158}00158                     (xoff + \mbox{\hyperlink{mlx5__en__port__buffer_8c_a6e4b4bfdf46637a2349e89660bb11ebf}{MLX5E\_MAX\_PORT\_MTU}} + (1 << \mbox{\hyperlink{port__buffer_8h_a3ee349b40cdf39c1ef26395975bbf8d0}{MLX5E\_BUFFER\_CELL\_SHIFT}}))) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00159}00159                         \mbox{\hyperlink{en_8h_a48762808435b04073ff4eb46a4ed088e}{mlx5\_en\_info}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_afe944afbe198db0e1a84a20df94af781}{ifp}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00160}00160         \textcolor{stringliteral}{"{}non-\/lossy buffer \%d size \%d less than xoff threshold \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00161}00161                             i, port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_a1fa9658fd6edaf696b4bc8e8046f497b}{size}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00162}00162                             xoff + \mbox{\hyperlink{mlx5__en__port__buffer_8c_a6e4b4bfdf46637a2349e89660bb11ebf}{MLX5E\_MAX\_PORT\_MTU}} +}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00163}00163                             (1 << \mbox{\hyperlink{port__buffer_8h_a3ee349b40cdf39c1ef26395975bbf8d0}{MLX5E\_BUFFER\_CELL\_SHIFT}}));}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00164}00164                         \textcolor{keywordflow}{return} -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00165}00165                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00166}00166 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00167}00167                 port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_aa128235d6cad69498574b72b2d60a535}{xoff}} = port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_a1fa9658fd6edaf696b4bc8e8046f497b}{size}} -\/ xoff;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00168}00168                 port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_a72431bf3a4ac278cf14cc945e5aa20c9}{xon}}  = }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00169}00169                         port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_aa128235d6cad69498574b72b2d60a535}{xoff}} -\/ \mbox{\hyperlink{mlx5__en__port__buffer_8c_a6e4b4bfdf46637a2349e89660bb11ebf}{MLX5E\_MAX\_PORT\_MTU}};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00170}00170         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00171}00171 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00172}00172         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00173}00173 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00174}00174 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00194}\mbox{\hyperlink{mlx5__en__port__buffer_8c_a60bc723b10bd41651822157140a1413e}{00194}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__en__port__buffer_8c_a60bc723b10bd41651822157140a1413e}{update\_buffer\_lossy}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} mtu,}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00195}00195                                u8 pfc\_en, u8 *buffer, u32 xoff,}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00196}00196                                \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__port__buffer}{mlx5e\_port\_buffer}} *port\_buffer,}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00197}00197                                \textcolor{keywordtype}{bool} *change)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00198}00198 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00199}00199         \textcolor{keywordtype}{bool} changed = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00200}00200         u8 lossy\_count;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00201}00201         u8 prio\_count;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00202}00202         u8 lossy;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00203}00203         \textcolor{keywordtype}{int} prio;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00204}00204         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00205}00205         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00206}00206 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00207}00207         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{port__buffer_8h_ad37bc7d5900a4786ae13ec02d013f7c5}{MLX5E\_MAX\_BUFFER}}; i++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00208}00208                 prio\_count = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00209}00209                 lossy\_count = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00211}00211                 \textcolor{keywordflow}{for} (prio = 0; prio < \mbox{\hyperlink{en_8h_a86a6351aa591c0a7fa058d6de7728dea}{MLX5E\_MAX\_PRIORITY}}; prio++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00212}00212                         \textcolor{keywordflow}{if} (buffer[prio] != i)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00213}00213                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00214}00214 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00215}00215                         prio\_count++;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00216}00216                         lossy\_count += !(pfc\_en \& (1 << prio));}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00217}00217                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00218}00218 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00219}00219                 \textcolor{keywordflow}{if} (lossy\_count == prio\_count)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00220}00220                         lossy = 1;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00221}00221                 \textcolor{keywordflow}{else} \textcolor{comment}{/* lossy\_count < prio\_count */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00222}00222                         lossy = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00223}00223 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00224}00224                 \textcolor{keywordflow}{if} (lossy != port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_aa6d1c7590e2db7bef19e7370eaa27df5}{lossy}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00225}00225                         port\_buffer-\/>\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_aa6d1c7590e2db7bef19e7370eaa27df5}{lossy}} = lossy;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00226}00226                         changed = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00227}00227                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00228}00228         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00229}00229 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00230}00230         \textcolor{keywordflow}{if} (changed) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00231}00231                 err = \mbox{\hyperlink{mlx5__en__port__buffer_8c_a0a183f8c4e6363662778202e1a9d89ef}{update\_xoff\_threshold}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, port\_buffer, xoff);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00232}00232                 \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00233}00233                         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00234}00234 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00235}00235                 *change = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00236}00236         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00237}00237 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00238}00238         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00239}00239 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00241}\mbox{\hyperlink{mlx5__en__port__buffer_8c_a75561486cd5e67b1a07ea559224ffd52}{00241}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__en__port__buffer_8c_a75561486cd5e67b1a07ea559224ffd52}{mlx5e\_port\_manual\_buffer\_config}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5e__priv}{mlx5e\_priv}} *\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00242}00242                                     u32 change, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} mtu,}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00243}00243                                     \textcolor{keyword}{struct} \mbox{\hyperlink{structieee__pfc}{ieee\_pfc}} *pfc,}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00244}00244                                     u32 *buffer\_size,}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00245}00245                                     u8 *prio2buffer)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00246}00246 \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00247}00247         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5e__port__buffer}{mlx5e\_port\_buffer}} port\_buffer;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00248}00248         u32 xoff = \mbox{\hyperlink{mlx5__en__port__buffer_8c_a19ce167a5bc87b278c54900a3135f323}{calculate\_xoff}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, mtu);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00249}00249         \textcolor{keywordtype}{bool} update\_prio2buffer = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00250}00250         u8 \mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[\mbox{\hyperlink{en_8h_a86a6351aa591c0a7fa058d6de7728dea}{MLX5E\_MAX\_PRIORITY}}];}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00251}00251         \textcolor{keywordtype}{bool} update\_buffer = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00252}00252         u32 total\_used = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00253}00253         u8 curr\_pfc\_en;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00254}00254         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00255}00255         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00256}00256 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00257}00257         \mbox{\hyperlink{en_8h_ac5e09d6a6e0f5787e97c14b1b9fa6ffe}{mlx5e\_dbg}}(HW, \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, \textcolor{stringliteral}{"{}\%s: change=\%x\(\backslash\)n"{}}, \_\_func\_\_, change);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00258}00258 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00259}00259         err = \mbox{\hyperlink{mlx5__en__port__buffer_8c_a1281dfc1f0829aa9ca4f7fd6ca79fc5c}{mlx5e\_port\_query\_buffer}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, \&port\_buffer);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00260}00260         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00261}00261                 \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00262}00262 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00263}00263         \textcolor{keywordflow}{if} (change \& \mbox{\hyperlink{port__buffer_8h_a1e06e534e565b0e44afdf96c77951725a64940309ee5afc0d5d77ef719d5d6a1a}{MLX5E\_PORT\_BUFFER\_CABLE\_LEN}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00264}00264                 update\_buffer = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00265}00265                 err = \mbox{\hyperlink{mlx5__en__port__buffer_8c_a0a183f8c4e6363662778202e1a9d89ef}{update\_xoff\_threshold}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, \&port\_buffer, xoff);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00266}00266                 \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00267}00267                         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00268}00268         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00269}00269 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00270}00270         \textcolor{keywordflow}{if} (change \& \mbox{\hyperlink{port__buffer_8h_a1e06e534e565b0e44afdf96c77951725a8f3ed43d92e14ead43fdfac429a0601e}{MLX5E\_PORT\_BUFFER\_PFC}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00271}00271                 err = \mbox{\hyperlink{mlx5__port_8c_a3deead3af97d84e34bffc1065fa4263f}{mlx5e\_port\_query\_priority2buffer}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, \mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}});}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00272}00272                 \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00273}00273                         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00274}00274 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00275}00275                 \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a40c79109d4c379a43e830b3924d38188}{sw\_is\_port\_buf\_owner}} = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00276}00276                 err = \mbox{\hyperlink{mlx5__en__port__buffer_8c_a60bc723b10bd41651822157140a1413e}{update\_buffer\_lossy}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, mtu, pfc-\/>\mbox{\hyperlink{structieee__pfc_aab707175d4a1009369b33ed73165d5aa}{pfc\_en}}, \mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}, xoff,}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00277}00277                                           \&port\_buffer, \&update\_buffer);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00278}00278                 \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00279}00279                         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00280}00280         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00281}00281 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00282}00282         \textcolor{keywordflow}{if} (change \& \mbox{\hyperlink{port__buffer_8h_a1e06e534e565b0e44afdf96c77951725aaa6fa009707c495c479a56aaf55fad64}{MLX5E\_PORT\_BUFFER\_PRIO2BUFFER}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00283}00283                 update\_prio2buffer = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00284}00284                 err = \mbox{\hyperlink{mlx5__port_8c_afda73217c985de0c61c6c3e32b1b3b06}{mlx5\_query\_port\_pfc}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, \&curr\_pfc\_en, NULL);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00285}00285                 \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00286}00286                         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00287}00287 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00288}00288                 err = \mbox{\hyperlink{mlx5__en__port__buffer_8c_a60bc723b10bd41651822157140a1413e}{update\_buffer\_lossy}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, mtu, curr\_pfc\_en, prio2buffer, xoff,}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00289}00289                                           \&port\_buffer, \&update\_buffer);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00290}00290                 \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00291}00291                         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00292}00292         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00293}00293 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00294}00294         \textcolor{keywordflow}{if} (change \& \mbox{\hyperlink{port__buffer_8h_a1e06e534e565b0e44afdf96c77951725a430006fb480493c80a1ca8cc7349e39d}{MLX5E\_PORT\_BUFFER\_SIZE}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00295}00295                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{port__buffer_8h_ad37bc7d5900a4786ae13ec02d013f7c5}{MLX5E\_MAX\_BUFFER}}; i++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00296}00296                         \mbox{\hyperlink{en_8h_ac5e09d6a6e0f5787e97c14b1b9fa6ffe}{mlx5e\_dbg}}(HW, \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, \textcolor{stringliteral}{"{}\%s: buffer[\%d]=\%d\(\backslash\)n"{}}, \_\_func\_\_, i, buffer\_size[i]);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00297}00297                         \textcolor{keywordflow}{if} (!port\_buffer.\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_aa6d1c7590e2db7bef19e7370eaa27df5}{lossy}} \&\& !buffer\_size[i]) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00298}00298                                 \mbox{\hyperlink{en_8h_ac5e09d6a6e0f5787e97c14b1b9fa6ffe}{mlx5e\_dbg}}(HW, \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, \textcolor{stringliteral}{"{}\%s: lossless buffer[\%d] size cannot be zero\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00299}00299                                           \_\_func\_\_, i);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00300}00300                                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00301}00301                         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00302}00302 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00303}00303                         port\_buffer.\mbox{\hyperlink{structmlx5e__port__buffer_a126fc00edefacc8c49d326f52f8c26ea}{buffer}}[i].\mbox{\hyperlink{structmlx5e__bufferx__reg_a1fa9658fd6edaf696b4bc8e8046f497b}{size}} = buffer\_size[i];}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00304}00304                         total\_used += buffer\_size[i];}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00305}00305                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00306}00306 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00307}00307                 \mbox{\hyperlink{en_8h_ac5e09d6a6e0f5787e97c14b1b9fa6ffe}{mlx5e\_dbg}}(HW, \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, \textcolor{stringliteral}{"{}\%s: total buffer requested=\%d\(\backslash\)n"{}}, \_\_func\_\_, total\_used);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00308}00308 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00309}00309                 \textcolor{keywordflow}{if} (total\_used > port\_buffer.\mbox{\hyperlink{structmlx5e__port__buffer_a7b18ba5e6772fe5989cb95ec036f4341}{port\_buffer\_size}})}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00310}00310                         \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00311}00311 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00312}00312                 update\_buffer = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00313}00313                 err = \mbox{\hyperlink{mlx5__en__port__buffer_8c_a0a183f8c4e6363662778202e1a9d89ef}{update\_xoff\_threshold}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, \&port\_buffer, xoff);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00314}00314                 \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00315}00315                         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00316}00316         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00317}00317 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00318}00318         \textcolor{comment}{/* Need to update buffer configuration if xoff value is changed */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00319}00319         \textcolor{keywordflow}{if} (!update\_buffer \&\& xoff != \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_aabc59462469abef8ff29a709a350dbe8}{dcbx}}.\mbox{\hyperlink{structmlx5e__dcbx_a087db62c0348695ebc3073170d90d109}{xoff}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00320}00320                 update\_buffer = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00321}00321                 err = \mbox{\hyperlink{mlx5__en__port__buffer_8c_a0a183f8c4e6363662778202e1a9d89ef}{update\_xoff\_threshold}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, \&port\_buffer, xoff);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00322}00322                 \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00323}00323                         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00324}00324         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00325}00325         \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_aabc59462469abef8ff29a709a350dbe8}{dcbx}}.\mbox{\hyperlink{structmlx5e__dcbx_a087db62c0348695ebc3073170d90d109}{xoff}} = xoff;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00326}00326 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00327}00327         \textcolor{comment}{/* Apply the settings */}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00328}00328         \textcolor{keywordflow}{if} (update\_buffer) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00329}00329                 \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a40c79109d4c379a43e830b3924d38188}{sw\_is\_port\_buf\_owner}} = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00330}00330                 err = \mbox{\hyperlink{mlx5__en__port__buffer_8c_a9a0bd9e33a1fc30d90689c6aebd19d85}{port\_set\_buffer}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}, \&port\_buffer);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00331}00331                 \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00332}00332                         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00333}00333         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00334}00334 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00335}00335         \textcolor{keywordflow}{if} (update\_prio2buffer) \{}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00336}00336                 \mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a40c79109d4c379a43e830b3924d38188}{sw\_is\_port\_buf\_owner}} = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00337}00337                 err = \mbox{\hyperlink{mlx5__port_8c_a24b3d47fcb69f1d6ba0237a1891e0657}{mlx5e\_port\_set\_priority2buffer}}(\mbox{\hyperlink{en_8h_a5fb0e4bc38f8b60aad81d13acf50020f}{priv}}-\/>\mbox{\hyperlink{structmlx5e__priv_a2223d57c4964aa044a50089734600ab8}{mdev}}, prio2buffer);}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00338}00338         \}}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00339}00339 }
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00340}00340         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__en__port__buffer_8c_source_l00341}00341 \}}

\end{DoxyCode}
