\hypertarget{mlx5__mcg_8c_source}{}\doxysection{mlx5\+\_\+mcg.\+c}
\label{mlx5__mcg_8c_source}\index{dev/mlx5/mlx5\_core/mlx5\_mcg.c@{dev/mlx5/mlx5\_core/mlx5\_mcg.c}}
\mbox{\hyperlink{mlx5__mcg_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2013-\/2017, Mellanox Technologies, Ltd.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00004}00004 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00005}00005 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00006}00006 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00007}00007 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00008}00008 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00009}00009 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00010}00010 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00011}00011 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00013}00013 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00014}00014 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00015}00015 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00016}00016 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00017}00017 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00018}00018 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00019}00019 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00020}00020 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00021}00021 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00022}00022 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00023}00023 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00024}00024 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00025}00025 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00026}00026 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00027}00027 }
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00028}00028 \textcolor{preprocessor}{\#include "{}opt\_rss.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00029}00029 \textcolor{preprocessor}{\#include "{}opt\_ratelimit.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <linux/kernel.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <linux/module.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{driver_8h}{dev/mlx5/driver.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <rdma/ib\_verbs.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mlx5__core_8h}{dev/mlx5/mlx5\_core/mlx5\_core.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00036}00036 }
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00037}\mbox{\hyperlink{driver_8h_affaf1b7dbbf8d9c67b6f9679a8a5dec4}{00037}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__mcg_8c_affaf1b7dbbf8d9c67b6f9679a8a5dec4}{mlx5\_core\_attach\_mcg}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, \textcolor{keyword}{union} ib\_gid *mgid, u32 qpn)}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00038}00038 \{}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00039}00039         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(attach\_to\_mcg\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00040}00040         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(attach\_to\_mcg\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00041}00041 }
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00042}00042         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(attach\_to\_mcg\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39aae00c73948446b62900fff1f66d0e434}{MLX5\_CMD\_OP\_ATTACH\_TO\_MCG}});}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00043}00043         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(attach\_to\_mcg\_in, in, qpn, qpn);}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00044}00044         memcpy(\mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(attach\_to\_mcg\_in, in, multicast\_gid), mgid,}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00045}00045                \textcolor{keyword}{sizeof}(*mgid));}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00047}00047         \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__mcg_8c_source_l00048}00048 \}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00049}\mbox{\hyperlink{mlx5__mcg_8c_a066d2faec6d635d330f0ca3c34eee922}{00049}} \mbox{\hyperlink{mlx5__mcg_8c_a066d2faec6d635d330f0ca3c34eee922}{EXPORT\_SYMBOL}}(\mbox{\hyperlink{mlx5__mcg_8c_affaf1b7dbbf8d9c67b6f9679a8a5dec4}{mlx5\_core\_attach\_mcg}});}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00051}\mbox{\hyperlink{driver_8h_a23151306d4c8e26df288f2af7a6a9d39}{00051}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__mcg_8c_a23151306d4c8e26df288f2af7a6a9d39}{mlx5\_core\_detach\_mcg}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, \textcolor{keyword}{union} ib\_gid *mgid, u32 qpn)}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00052}00052 \{}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00053}00053         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(detach\_from\_mcg\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00054}00054         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(detach\_from\_mcg\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00055}00055 }
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00056}00056         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(detach\_from\_mcg\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39acb428c091c28180a8256c8f26e6f35f6}{MLX5\_CMD\_OP\_DETACH\_FROM\_MCG}});}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00057}00057         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(detach\_from\_mcg\_in, in, qpn, qpn);}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00058}00058         memcpy(\mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(detach\_from\_mcg\_in, in, multicast\_gid), mgid,}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00059}00059                \textcolor{keyword}{sizeof}(*mgid));}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00060}00060 }
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00061}00061         \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__mcg_8c_source_l00062}00062 \}}
\DoxyCodeLine{\Hypertarget{mlx5__mcg_8c_source_l00063}\mbox{\hyperlink{mlx5__mcg_8c_a1d9cc31016682578f4545b0cfa31aad2}{00063}} \mbox{\hyperlink{mlx5__mcg_8c_a066d2faec6d635d330f0ca3c34eee922}{EXPORT\_SYMBOL}}(\mbox{\hyperlink{mlx5__mcg_8c_a23151306d4c8e26df288f2af7a6a9d39}{mlx5\_core\_detach\_mcg}});}

\end{DoxyCode}
