\hypertarget{mlx5__fs__cmd_8c_source}{}\doxysection{mlx5\+\_\+fs\+\_\+cmd.\+c}
\label{mlx5__fs__cmd_8c_source}\index{dev/mlx5/mlx5\_core/mlx5\_fs\_cmd.c@{dev/mlx5/mlx5\_core/mlx5\_fs\_cmd.c}}
\mbox{\hyperlink{mlx5__fs__cmd_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2013-\/2017, Mellanox Technologies, Ltd.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00004}00004 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00005}00005 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00006}00006 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00007}00007 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00008}00008 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00009}00009 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00010}00010 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00011}00011 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00013}00013 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00014}00014 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00015}00015 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00016}00016 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00017}00017 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00018}00018 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00019}00019 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00020}00020 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00021}00021 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00022}00022 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00023}00023 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00024}00024 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00025}00025 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00026}00026 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00027}00027 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00028}00028 \textcolor{preprocessor}{\#include "{}opt\_rss.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00029}00029 \textcolor{preprocessor}{\#include "{}opt\_ratelimit.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <linux/types.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <linux/module.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mlx5__ifc_8h}{dev/mlx5/mlx5\_ifc.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{device_8h}{dev/mlx5/device.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{fs_8h}{dev/mlx5/fs.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00036}00036 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{fs__core_8h}{dev/mlx5/mlx5\_core/fs\_core.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mlx5__core_8h}{dev/mlx5/mlx5\_core/mlx5\_core.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00039}00039 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00040}\mbox{\hyperlink{fs__core_8h_afb653cea3fae9bee05c6b2086fcb923f}{00040}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__fs__cmd_8c_afb653cea3fae9bee05c6b2086fcb923f}{mlx5\_cmd\_update\_root\_ft}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00041}00041                             \textcolor{keyword}{enum} \mbox{\hyperlink{fs__core_8h_a60afdc524264b5423bbed384431739fc}{fs\_ft\_type}} type,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00042}00042                             \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} \textcolor{keywordtype}{id})}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00043}00043 \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00044}00044         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(set\_flow\_table\_root\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00045}00045         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(set\_flow\_table\_root\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00047}00047         \textcolor{keywordflow}{if} (!dev)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00048}00048                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00050}00050         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(set\_flow\_table\_root\_in, in, opcode,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00051}00051                  \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39af32604e625e714705537d9cac6af4cfc}{MLX5\_CMD\_OP\_SET\_FLOW\_TABLE\_ROOT}});}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00052}00052         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(set\_flow\_table\_root\_in, in, table\_type, type);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00053}00053         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(set\_flow\_table\_root\_in, in, table\_id, \textcolor{keywordtype}{id});}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00055}00055         \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__fs__cmd_8c_source_l00056}00056 \}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00057}00057 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00058}\mbox{\hyperlink{fs__core_8h_aac5371e30b7f7c38baf3e0b4d686560c}{00058}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__fs__cmd_8c_aac5371e30b7f7c38baf3e0b4d686560c}{mlx5\_cmd\_fs\_create\_ft}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00059}00059                           u16 vport,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00060}00060                           \textcolor{keyword}{enum} \mbox{\hyperlink{fs__core_8h_a60afdc524264b5423bbed384431739fc}{fs\_ft\_type}} type, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} level,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00061}00061                           \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} log\_size, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} *table\_id)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00062}00062 \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00063}00063         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(create\_flow\_table\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00064}00064         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(create\_flow\_table\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00065}00065         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00066}00066 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00067}00067         \textcolor{keywordflow}{if} (!dev)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00068}00068                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00069}00069 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00070}00070         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_table\_in, in, opcode,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00071}00071                  \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39ae4807c37c389b2f8e034a16cad5e967e}{MLX5\_CMD\_OP\_CREATE\_FLOW\_TABLE}});}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00072}00072 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00073}00073         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_table\_in, in, table\_type, type);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00074}00074         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_table\_in, in, flow\_table\_context.level, level);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00075}00075         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_table\_in, in, flow\_table\_context.log\_size,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00076}00076                  log\_size);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00077}00077         \textcolor{keywordflow}{if} (vport) \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00078}00078                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_table\_in, in, vport\_number, vport);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00079}00079                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_table\_in, in, other\_vport, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00080}00080         \}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00082}00082         err = \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in, \textcolor{keyword}{sizeof}(in), out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00083}00083         \textcolor{keywordflow}{if} (!err)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00084}00084                 *table\_id = \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(create\_flow\_table\_out, out, table\_id);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00085}00085 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00086}00086         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00087}00087 \}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00088}00088 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00089}\mbox{\hyperlink{fs__core_8h_a07a53259db51c44d1b6401776920aff6}{00089}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__fs__cmd_8c_a07a53259db51c44d1b6401776920aff6}{mlx5\_cmd\_fs\_destroy\_ft}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00090}00090                            u16 vport,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00091}00091                            \textcolor{keyword}{enum} \mbox{\hyperlink{fs__core_8h_a60afdc524264b5423bbed384431739fc}{fs\_ft\_type}} type, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} table\_id)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00092}00092 \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00093}00093         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(destroy\_flow\_table\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00094}00094         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(destroy\_flow\_table\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00095}00095 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00096}00096         \textcolor{keywordflow}{if} (!dev)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00097}00097                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00099}00099         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_flow\_table\_in, in, opcode,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00100}00100                  \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a3d72512e2644965de1d79509226208d4}{MLX5\_CMD\_OP\_DESTROY\_FLOW\_TABLE}});}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00101}00101         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_flow\_table\_in, in, table\_type, type);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00102}00102         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_flow\_table\_in, in, table\_id, table\_id);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00103}00103         \textcolor{keywordflow}{if} (vport) \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00104}00104                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_flow\_table\_in, in, vport\_number, vport);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00105}00105                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_flow\_table\_in, in, other\_vport, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00106}00106         \}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00107}00107 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00108}00108         \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__fs__cmd_8c_source_l00109}00109 \}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00110}00110 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00111}\mbox{\hyperlink{fs__core_8h_a71421976d9d354157d1877911d6952db}{00111}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__fs__cmd_8c_a71421976d9d354157d1877911d6952db}{mlx5\_cmd\_fs\_create\_fg}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00112}00112                           u32 *in,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00113}00113                           u16 vport,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00114}00114                           \textcolor{keyword}{enum} \mbox{\hyperlink{fs__core_8h_a60afdc524264b5423bbed384431739fc}{fs\_ft\_type}} type, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} table\_id,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00115}00115                           \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} *group\_id)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00116}00116 \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00117}00117         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(create\_flow\_group\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00118}00118         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00119}00119         \textcolor{keywordtype}{int} inlen = \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(create\_flow\_group\_in);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00120}00120         \textcolor{keywordflow}{if} (!dev)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00121}00121                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00122}00122 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00123}00123         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_group\_in, in, opcode,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00124}00124                  \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a8b8bd8e3d455fd5758e27633014ff871}{MLX5\_CMD\_OP\_CREATE\_FLOW\_GROUP}});}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00125}00125         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_group\_in, in, table\_type, type);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00126}00126         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_group\_in, in, table\_id, table\_id);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00127}00127         \textcolor{keywordflow}{if} (vport) \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00128}00128                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_group\_in, in, vport\_number, vport);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00129}00129                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_group\_in, in, other\_vport, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00130}00130         \}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00132}00132         err = \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in, inlen, out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00133}00133         \textcolor{keywordflow}{if} (!err)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00134}00134                 *group\_id = \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(create\_flow\_group\_out, out, group\_id);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00135}00135 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00136}00136         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00137}00137 \}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00138}00138 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00139}\mbox{\hyperlink{fs__core_8h_a0e9c8c37be194f3819d52f093430aa97}{00139}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__fs__cmd_8c_a0e9c8c37be194f3819d52f093430aa97}{mlx5\_cmd\_fs\_destroy\_fg}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00140}00140                            u16 vport,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00141}00141                            \textcolor{keyword}{enum} \mbox{\hyperlink{fs__core_8h_a60afdc524264b5423bbed384431739fc}{fs\_ft\_type}} type, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} table\_id,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00142}00142                            \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} group\_id)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00143}00143 \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00144}00144         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(destroy\_flow\_group\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00145}00145         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(destroy\_flow\_group\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00146}00146 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00147}00147         \textcolor{keywordflow}{if} (!dev)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00148}00148                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00149}00149 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00150}00150         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_flow\_group\_in, in, opcode,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00151}00151                  \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a04e77f499f72efbf53d97eacff567b83}{MLX5\_CMD\_OP\_DESTROY\_FLOW\_GROUP}});}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00152}00152         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_flow\_group\_in, in, table\_type, type);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00153}00153         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_flow\_group\_in, in, table\_id,   table\_id);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00154}00154         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_flow\_group\_in, in, group\_id, group\_id);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00155}00155         \textcolor{keywordflow}{if} (vport) \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00156}00156                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_flow\_group\_in, in, vport\_number, vport);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00157}00157                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(destroy\_flow\_group\_in, in, other\_vport, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00158}00158         \}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00159}00159 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00160}00160         \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__fs__cmd_8c_source_l00161}00161 \}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00162}00162 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00163}\mbox{\hyperlink{fs__core_8h_ab00e062ad881f9ce92e861a0510e7244}{00163}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__fs__cmd_8c_ab00e062ad881f9ce92e861a0510e7244}{mlx5\_cmd\_fs\_set\_fte}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00164}00164                         u16 vport,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00165}00165                         \textcolor{keyword}{enum} \mbox{\hyperlink{fs__core_8h_a0562411e5250f4dcce31cb2b2dd9f48f}{fs\_fte\_status}} *fte\_status,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00166}00166                         u32 *match\_val,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00167}00167                         \textcolor{keyword}{enum} \mbox{\hyperlink{fs__core_8h_a60afdc524264b5423bbed384431739fc}{fs\_ft\_type}} type, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} table\_id,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00168}00168                         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} index, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} group\_id,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00169}00169                         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} flow\_tag,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00170}00170                         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{short} action, \textcolor{keywordtype}{int} dest\_size,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00171}00171                         \textcolor{keyword}{struct} list\_head *dests)  \textcolor{comment}{/* mlx5\_flow\_desination */}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00172}00172 \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00173}00173         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(set\_fte\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00174}00174         u32 *in;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00175}00175         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} inlen;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00176}00176         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__rule}{mlx5\_flow\_rule}} *dst;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00177}00177         \textcolor{keywordtype}{void} *in\_flow\_context;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00178}00178         \textcolor{keywordtype}{void} *in\_match\_value;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00179}00179         \textcolor{keywordtype}{void} *in\_dests;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00180}00180         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00181}00181         \textcolor{keywordtype}{int} opmod = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00182}00182         \textcolor{keywordtype}{int} modify\_mask = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00183}00183         \textcolor{keywordtype}{int} atomic\_mod\_cap;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00184}00184 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00185}00185         \textcolor{keywordflow}{if} (action != \mbox{\hyperlink{mlx5__ifc_8h_aa7477aaaec7caec07471eb609c556f5fa9be53190c8f3cd032a93d7feac08af87}{MLX5\_FLOW\_CONTEXT\_ACTION\_FWD\_DEST}})}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00186}00186                 dest\_size = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00187}00187 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00188}00188         inlen = \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(set\_fte\_in) +}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00189}00189                 dest\_size * \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(dest\_format\_struct);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00190}00190 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00191}00191         \textcolor{keywordflow}{if} (!dev)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00192}00192                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00193}00193 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00194}00194         \textcolor{keywordflow}{if} (*fte\_status \& \mbox{\hyperlink{fs__core_8h_a0562411e5250f4dcce31cb2b2dd9f48fa98e3b42610a5bcde2b4f205d9e0fd5c4}{FS\_FTE\_STATUS\_EXISTING}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00195}00195                 atomic\_mod\_cap = \mbox{\hyperlink{device_8h_a3e485d4dba864073c036df50a41b19bf}{MLX5\_CAP\_FLOWTABLE}}(dev,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00196}00196                                                     flow\_table\_properties\_nic\_receive.}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00197}00197                                                     flow\_modify\_en);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00198}00198                 \textcolor{keywordflow}{if} (!atomic\_mod\_cap)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00199}00199                         \textcolor{keywordflow}{return} -\/ENOTSUPP;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00200}00200                 opmod = 1;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00201}00201                 modify\_mask = 1 <<}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00202}00202                         \mbox{\hyperlink{mlx5__ifc_8h_a35b7fa7665fe812ec8d7cf77bbcdbc26a80913c0c6774c41a247646555860f31a}{MLX5\_SET\_FTE\_MODIFY\_ENABLE\_MASK\_DESTINATION\_LIST}};}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00203}00203         \}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00204}00204 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00205}00205         in = \mbox{\hyperlink{driver_8h_af928b1985830513c1c81b095b31ad8a7}{mlx5\_vzalloc}}(inlen);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00206}00206         \textcolor{keywordflow}{if} (!in) \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00207}00207                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(dev, \textcolor{stringliteral}{"{}failed to allocate inbox\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00208}00208                 \textcolor{keywordflow}{return} -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00209}00209         \}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00211}00211         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(set\_fte\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a1dc38f067ec9bb908df3a3591d8e6bc1}{MLX5\_CMD\_OP\_SET\_FLOW\_TABLE\_ENTRY}});}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00212}00212         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(set\_fte\_in, in, op\_mod, opmod);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00213}00213         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(set\_fte\_in, in, modify\_enable\_mask, modify\_mask);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00214}00214         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(set\_fte\_in, in, table\_type, type);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00215}00215         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(set\_fte\_in, in, table\_id,   table\_id);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00216}00216         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(set\_fte\_in, in, flow\_index, index);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00217}00217         \textcolor{keywordflow}{if} (vport) \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00218}00218                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(set\_fte\_in, in, vport\_number, vport);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00219}00219                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(set\_fte\_in, in, other\_vport, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00220}00220         \}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00221}00221 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00222}00222         in\_flow\_context = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(set\_fte\_in, in, flow\_context);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00223}00223         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(flow\_context, in\_flow\_context, group\_id, group\_id);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00224}00224         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(flow\_context, in\_flow\_context, flow\_tag, flow\_tag);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00225}00225         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(flow\_context, in\_flow\_context, action, action);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00226}00226         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(flow\_context, in\_flow\_context, destination\_list\_size,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00227}00227                  dest\_size);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00228}00228         in\_match\_value = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(flow\_context, in\_flow\_context,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00229}00229                                       match\_value);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00230}00230         memcpy(in\_match\_value, match\_val, \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(fte\_match\_param));}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00231}00231         \textcolor{keywordflow}{if} (dest\_size) \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00232}00232                 in\_dests = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(flow\_context, in\_flow\_context, destination);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00233}00233                 list\_for\_each\_entry(dst, dests, \mbox{\hyperlink{structmlx5__flow__rule_aae7b5d548ea41edb5e0945e42beeb3ca}{base}}.\mbox{\hyperlink{structfs__base_a27b9163ad41bb22c82cf131ceb334e9b}{list}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00234}00234                         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} id;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00235}00235 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00236}00236                         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(dest\_format\_struct, in\_dests, destination\_type,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00237}00237                                  dst-\/>\mbox{\hyperlink{structmlx5__flow__rule_a9f8c10eab6fe6d2a544aa1c8e250060f}{dest\_attr}}.\mbox{\hyperlink{structmlx5__flow__destination_a4421d4147c8e909299b6e406a09e3805}{type}});}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00238}00238                         \textcolor{keywordflow}{if} (dst-\/>\mbox{\hyperlink{structmlx5__flow__rule_a9f8c10eab6fe6d2a544aa1c8e250060f}{dest\_attr}}.\mbox{\hyperlink{structmlx5__flow__destination_a4421d4147c8e909299b6e406a09e3805}{type}} ==}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00239}00239                                 \mbox{\hyperlink{mlx5__ifc_8h_a16db4876b192da08f3ad0cb41afe516fab78291bb7089c5fcc858088d92211ef3}{MLX5\_FLOW\_CONTEXT\_DEST\_TYPE\_FLOW\_TABLE}})}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00240}00240                                 \textcolor{keywordtype}{id} = dst-\/>\mbox{\hyperlink{structmlx5__flow__rule_a9f8c10eab6fe6d2a544aa1c8e250060f}{dest\_attr}}.\mbox{\hyperlink{structmlx5__flow__destination_a4fb7fd1e9aa286baa77564008f883dd4}{ft}}-\/>\mbox{\hyperlink{structmlx5__flow__table_addc5a6602c2b345ea0d6a0389bd8e742}{id}};}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00241}00241                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00242}00242                                 \textcolor{keywordtype}{id} = dst-\/>\mbox{\hyperlink{structmlx5__flow__rule_a9f8c10eab6fe6d2a544aa1c8e250060f}{dest\_attr}}.\mbox{\hyperlink{structmlx5__flow__destination_a1f81ea0bce32fb9e420b167eaada9230}{tir\_num}};}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00243}00243                         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(dest\_format\_struct, in\_dests, destination\_id, \textcolor{keywordtype}{id});}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00244}00244                         in\_dests += \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(dest\_format\_struct);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00245}00245                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00246}00246         \}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00247}00247 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00248}00248         err = \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in, inlen, out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00249}00249         \textcolor{keywordflow}{if} (!err)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00250}00250                 *fte\_status |= \mbox{\hyperlink{fs__core_8h_a0562411e5250f4dcce31cb2b2dd9f48fa98e3b42610a5bcde2b4f205d9e0fd5c4}{FS\_FTE\_STATUS\_EXISTING}};}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00252}00252         kvfree(in);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00253}00253 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00254}00254         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00255}00255 \}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00256}00256 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00257}\mbox{\hyperlink{fs__core_8h_aa5d45c1050811dee34a47c498d0fa1fb}{00257}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__fs__cmd_8c_aa5d45c1050811dee34a47c498d0fa1fb}{mlx5\_cmd\_fs\_delete\_fte}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00258}00258                            u16 vport,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00259}00259                            \textcolor{keyword}{enum} \mbox{\hyperlink{fs__core_8h_a0562411e5250f4dcce31cb2b2dd9f48f}{fs\_fte\_status}} *fte\_status,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00260}00260                            \textcolor{keyword}{enum} \mbox{\hyperlink{fs__core_8h_a60afdc524264b5423bbed384431739fc}{fs\_ft\_type}} type, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} table\_id,}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00261}00261                            \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} index)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00262}00262 \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00263}00263         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(delete\_fte\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00264}00264         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(delete\_fte\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00265}00265         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00266}00266 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00267}00267         \textcolor{keywordflow}{if} (!(*fte\_status \& \mbox{\hyperlink{fs__core_8h_a0562411e5250f4dcce31cb2b2dd9f48fa98e3b42610a5bcde2b4f205d9e0fd5c4}{FS\_FTE\_STATUS\_EXISTING}}))}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00268}00268                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00269}00269 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00270}00270         \textcolor{keywordflow}{if} (!dev)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00271}00271                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00272}00272 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00273}00273         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(delete\_fte\_in, in, opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39ad6462b14b74ba00f95efadd77dbf4e21}{MLX5\_CMD\_OP\_DELETE\_FLOW\_TABLE\_ENTRY}});}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00274}00274         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(delete\_fte\_in, in, table\_type, type);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00275}00275         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(delete\_fte\_in, in, table\_id, table\_id);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00276}00276         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(delete\_fte\_in, in, flow\_index, index);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00277}00277         \textcolor{keywordflow}{if} (vport) \{}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00278}00278                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(delete\_fte\_in, in, vport\_number,  vport);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00279}00279                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(delete\_fte\_in, in, other\_vport, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00280}00280         \}}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00281}00281 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00282}00282         err =  \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in, \textcolor{keyword}{sizeof}(in), out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00283}00283         \textcolor{keywordflow}{if} (!err)}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00284}00284                 *fte\_status = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00285}00285 }
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00286}00286         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__fs__cmd_8c_source_l00287}00287 \}}

\end{DoxyCode}
