\hypertarget{mlx5__pd_8c_source}{}\doxysection{mlx5\+\_\+pd.\+c}
\label{mlx5__pd_8c_source}\index{dev/mlx5/mlx5\_core/mlx5\_pd.c@{dev/mlx5/mlx5\_core/mlx5\_pd.c}}
\mbox{\hyperlink{mlx5__pd_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2013-\/2020, Mellanox Technologies, Ltd.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00004}00004 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00005}00005 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00006}00006 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00007}00007 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00008}00008 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00009}00009 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00010}00010 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00011}00011 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00013}00013 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00014}00014 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00015}00015 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00016}00016 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00017}00017 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00018}00018 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00019}00019 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00020}00020 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00021}00021 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00022}00022 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00023}00023 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00024}00024 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00025}00025 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00026}00026 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00027}00027 }
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00028}00028 \textcolor{preprocessor}{\#include "{}opt\_rss.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00029}00029 \textcolor{preprocessor}{\#include "{}opt\_ratelimit.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <linux/kernel.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <linux/module.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{driver_8h}{dev/mlx5/driver.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mlx5__core_8h}{dev/mlx5/mlx5\_core/mlx5\_core.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00036}\mbox{\hyperlink{driver_8h_a4781845194ba9f0f72b8e627acbc78b8}{00036}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__pd_8c_a4781845194ba9f0f72b8e627acbc78b8}{mlx5\_core\_alloc\_pd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, u32 *pdn, u16 uid)}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00037}00037 \{}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00038}00038         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(alloc\_pd\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00039}00039         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(alloc\_pd\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00040}00040         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00041}00041 }
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00042}00042         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(alloc\_pd\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a8a022f8bb3717c70f276d91ec5035ebd}{MLX5\_CMD\_OP\_ALLOC\_PD}});}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00043}00043         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(alloc\_pd\_in, in, uid, uid);}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00045}00045         err = \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in, \textcolor{keyword}{sizeof}(in), out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00046}00046         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00047}00047                 \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00048}00048 }
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00049}00049         *pdn = \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(alloc\_pd\_out, out, pd);}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00050}00050         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00051}00051 \}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00052}\mbox{\hyperlink{mlx5__pd_8c_aaae845c7ba73e6c78d2ae1a8247b1975}{00052}} \mbox{\hyperlink{mlx5__pd_8c_aaae845c7ba73e6c78d2ae1a8247b1975}{EXPORT\_SYMBOL}}(\mbox{\hyperlink{mlx5__pd_8c_a4781845194ba9f0f72b8e627acbc78b8}{mlx5\_core\_alloc\_pd}});}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00053}00053 }
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00054}\mbox{\hyperlink{driver_8h_acbbf49b48251096e122a963f59c87055}{00054}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__pd_8c_acbbf49b48251096e122a963f59c87055}{mlx5\_core\_dealloc\_pd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, u32 pdn, u16 uid)}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00055}00055 \{}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00056}00056         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(dealloc\_pd\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00057}00057         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(dealloc\_pd\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00058}00058 }
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00059}00059         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(dealloc\_pd\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39ac0e70c86d9db73fcd520f15803e148cb}{MLX5\_CMD\_OP\_DEALLOC\_PD}});}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00060}00060         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(dealloc\_pd\_in, in, uid, uid);}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00061}00061         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(dealloc\_pd\_in, in, pd, pdn);}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00062}00062 }
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00063}00063         \textcolor{keywordflow}{return} \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in,  \textcolor{keyword}{sizeof}(in), out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00064}00064 \}}
\DoxyCodeLine{\Hypertarget{mlx5__pd_8c_source_l00065}\mbox{\hyperlink{mlx5__pd_8c_a92d47d48467b6a694ce00118fe87bf41}{00065}} \mbox{\hyperlink{mlx5__pd_8c_aaae845c7ba73e6c78d2ae1a8247b1975}{EXPORT\_SYMBOL}}(\mbox{\hyperlink{mlx5__pd_8c_acbbf49b48251096e122a963f59c87055}{mlx5\_core\_dealloc\_pd}});}

\end{DoxyCode}
