\hypertarget{mlx5__eswitch_8c_source}{}\doxysection{mlx5\+\_\+eswitch.\+c}
\label{mlx5__eswitch_8c_source}\index{dev/mlx5/mlx5\_core/mlx5\_eswitch.c@{dev/mlx5/mlx5\_core/mlx5\_eswitch.c}}
\mbox{\hyperlink{mlx5__eswitch_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2013-\/2017, Mellanox Technologies, Ltd.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00004}00004 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00005}00005 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00006}00006 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00007}00007 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00008}00008 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00009}00009 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00010}00010 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00011}00011 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00013}00013 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00014}00014 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00015}00015 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00016}00016 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00017}00017 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00018}00018 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00019}00019 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00020}00020 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00021}00021 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00022}00022 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00023}00023 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00024}00024 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00025}00025 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00026}00026 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00027}00027 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00028}00028 \textcolor{preprocessor}{\#include "{}opt\_rss.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00029}00029 \textcolor{preprocessor}{\#include "{}opt\_ratelimit.h"{}}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <linux/etherdevice.h>}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{driver_8h}{dev/mlx5/driver.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mlx5__ifc_8h}{dev/mlx5/mlx5\_ifc.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{vport_8h}{dev/mlx5/vport.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{fs_8h}{dev/mlx5/fs.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mpfs_8h}{dev/mlx5/mpfs.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{mlx5__core_8h}{dev/mlx5/mlx5\_core/mlx5\_core.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{eswitch_8h}{dev/mlx5/mlx5\_core/eswitch.h}}>}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00039}00039 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00040}\mbox{\hyperlink{mlx5__eswitch_8c_ae7da705f31a521f4f1da3666896222e4}{00040}} \textcolor{preprocessor}{\#define UPLINK\_VPORT 0xFFFF}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00041}00041 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00042}\mbox{\hyperlink{mlx5__eswitch_8c_ada1d4b39f584fec13e98324f86974b33}{00042}} \textcolor{preprocessor}{\#define MLX5\_DEBUG\_ESWITCH\_MASK BIT(3)}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00044}\mbox{\hyperlink{mlx5__eswitch_8c_ac1a10c6a7056526fb00a023782298744}{00044}} \textcolor{preprocessor}{\#define esw\_info(dev, format, ...)                              \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00045}00045 \textcolor{preprocessor}{        printf("{}mlx5\_core: INFO: "{}}"{}(\%s): E-\/Switch: "{} format, (dev)-\/>priv.name, \#\#\_\_VA\_ARGS\_\_)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00047}\mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{00047}} \textcolor{preprocessor}{\#define esw\_warn(dev, format, ...)                              \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00048}00048 \textcolor{preprocessor}{        printf("{}mlx5\_core: WARN: "{}}"{}(\%s): E-\/Switch: "{} format, (dev)-\/>priv.name, \#\#\_\_VA\_ARGS\_\_)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00050}\mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{00050}} \textcolor{preprocessor}{\#define esw\_debug(dev, format, ...)                             \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00051}00051 \textcolor{preprocessor}{        mlx5\_core\_dbg\_mask(dev, MLX5\_DEBUG\_ESWITCH\_MASK, format, \#\#\_\_VA\_ARGS\_\_)}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00053}00053 \textcolor{keyword}{enum} \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00054}\mbox{\hyperlink{mlx5__eswitch_8c_a0ac0b7994a7d738aa77d2c1cfe8d6d13a0b511e461da6547f1719c077eee71de6}{00054}}         \mbox{\hyperlink{mlx5__eswitch_8c_a0ac0b7994a7d738aa77d2c1cfe8d6d13a0b511e461da6547f1719c077eee71de6}{MLX5\_ACTION\_NONE}} = 0,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00055}\mbox{\hyperlink{mlx5__eswitch_8c_a0ac0b7994a7d738aa77d2c1cfe8d6d13aacc261c009394fb62c458a6da27209e1}{00055}}         \mbox{\hyperlink{mlx5__eswitch_8c_a0ac0b7994a7d738aa77d2c1cfe8d6d13aacc261c009394fb62c458a6da27209e1}{MLX5\_ACTION\_ADD}}  = 1,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00056}\mbox{\hyperlink{mlx5__eswitch_8c_a0ac0b7994a7d738aa77d2c1cfe8d6d13a1e7cebc427f4d4396cd195ddef3fa7e5}{00056}}         \mbox{\hyperlink{mlx5__eswitch_8c_a0ac0b7994a7d738aa77d2c1cfe8d6d13a1e7cebc427f4d4396cd195ddef3fa7e5}{MLX5\_ACTION\_DEL}}  = 2,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00057}00057 \};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00058}00058 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00059}00059 \textcolor{comment}{/* E-\/Switch UC L2 table hash node */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00060}\mbox{\hyperlink{structesw__uc__addr}{00060}} \textcolor{keyword}{struct }\mbox{\hyperlink{structesw__uc__addr}{esw\_uc\_addr}} \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00061}\mbox{\hyperlink{structesw__uc__addr_a659a136e4f2ce138f3288b667ea334c8}{00061}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structl2addr__node}{l2addr\_node}} \mbox{\hyperlink{structesw__uc__addr_a659a136e4f2ce138f3288b667ea334c8}{node}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00062}\mbox{\hyperlink{structesw__uc__addr_a9ee1f1e005db2e5797fa73745810fd9f}{00062}}         u32                \mbox{\hyperlink{structesw__uc__addr_a9ee1f1e005db2e5797fa73745810fd9f}{table\_index}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00063}\mbox{\hyperlink{structesw__uc__addr_ac484a3a81823649e0dc1b3d9028a92b2}{00063}}         u32                \mbox{\hyperlink{structesw__uc__addr_ac484a3a81823649e0dc1b3d9028a92b2}{vport}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00064}00064 \};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00065}00065 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00066}00066 \textcolor{comment}{/* E-\/Switch MC FDB table hash node */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00067}\mbox{\hyperlink{structesw__mc__addr}{00067}} \textcolor{keyword}{struct }\mbox{\hyperlink{structesw__mc__addr}{esw\_mc\_addr}} \{ \textcolor{comment}{/* SRIOV only */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00068}\mbox{\hyperlink{structesw__mc__addr_add950c81002c874a0dacabdeec682f9c}{00068}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structl2addr__node}{l2addr\_node}}     \mbox{\hyperlink{structesw__mc__addr_add950c81002c874a0dacabdeec682f9c}{node}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00069}\mbox{\hyperlink{structesw__mc__addr_a1f83afa61bed80fd7bd49e91d55aa3e9}{00069}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__rule}{mlx5\_flow\_rule}} *\mbox{\hyperlink{structesw__mc__addr_a1f83afa61bed80fd7bd49e91d55aa3e9}{uplink\_rule}}; \textcolor{comment}{/* Forward to uplink rule */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00070}\mbox{\hyperlink{structesw__mc__addr_ad406fa062655b5ee5907076d6cc5a3d7}{00070}}         u32                    \mbox{\hyperlink{structesw__mc__addr_ad406fa062655b5ee5907076d6cc5a3d7}{refcnt}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00071}00071 \};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00072}00072 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00073}00073 \textcolor{comment}{/* Vport UC/MC hash node */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00074}\mbox{\hyperlink{structvport__addr}{00074}} \textcolor{keyword}{struct }\mbox{\hyperlink{structvport__addr}{vport\_addr}} \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00075}\mbox{\hyperlink{structvport__addr_a4bdb49c3536918023c499250d56eaec7}{00075}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structl2addr__node}{l2addr\_node}}     \mbox{\hyperlink{structvport__addr_a4bdb49c3536918023c499250d56eaec7}{node}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00076}\mbox{\hyperlink{structvport__addr_a30ed10cbc3e6fc254fc575c1d2c95984}{00076}}         u8                     \mbox{\hyperlink{structvport__addr_a30ed10cbc3e6fc254fc575c1d2c95984}{action}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00077}\mbox{\hyperlink{structvport__addr_a68102b191a50c8ba8bcae0ecbd36dda0}{00077}}         u32                    \mbox{\hyperlink{structvport__addr_a68102b191a50c8ba8bcae0ecbd36dda0}{vport}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00078}\mbox{\hyperlink{structvport__addr_a033e16d3a185fe113c66518ad32c5b74}{00078}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__rule}{mlx5\_flow\_rule}} *\mbox{\hyperlink{structvport__addr_a033e16d3a185fe113c66518ad32c5b74}{flow\_rule}}; \textcolor{comment}{/* SRIOV only */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00079}00079 \};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00080}00080 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00081}00081 \textcolor{keyword}{enum} \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00082}\mbox{\hyperlink{mlx5__eswitch_8c_a5bea799269f02f5b3395d6b2c068b618a9612352a68fc92e5d6333b8cf603abbe}{00082}}         \mbox{\hyperlink{mlx5__eswitch_8c_a5bea799269f02f5b3395d6b2c068b618a9612352a68fc92e5d6333b8cf603abbe}{UC\_ADDR\_CHANGE}} = BIT(0),}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00083}\mbox{\hyperlink{mlx5__eswitch_8c_a5bea799269f02f5b3395d6b2c068b618a9c5d45a06d3e01334dd0d7b27f96c621}{00083}}         \mbox{\hyperlink{mlx5__eswitch_8c_a5bea799269f02f5b3395d6b2c068b618a9c5d45a06d3e01334dd0d7b27f96c621}{MC\_ADDR\_CHANGE}} = BIT(1),}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00084}00084 \};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00085}00085 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00086}00086 \textcolor{comment}{/* Vport context events */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00087}\mbox{\hyperlink{mlx5__eswitch_8c_a89baea4a43b34e7207ed44dc13cdd9af}{00087}} \textcolor{preprocessor}{\#define SRIOV\_VPORT\_EVENTS (UC\_ADDR\_CHANGE | \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00088}00088 \textcolor{preprocessor}{                            MC\_ADDR\_CHANGE)}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00090}\mbox{\hyperlink{mlx5__eswitch_8c_a51585bd30922f59cdd625d5f02a93a2c}{00090}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_a51585bd30922f59cdd625d5f02a93a2c}{arm\_vport\_context\_events\_cmd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, u16 vport,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00091}00091                                         u32 events\_mask)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00092}00092 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00093}00093         \textcolor{keywordtype}{int} in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(modify\_nic\_vport\_context\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00094}00094         \textcolor{keywordtype}{int} out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(modify\_nic\_vport\_context\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00095}00095         \textcolor{keywordtype}{void} *nic\_vport\_ctx;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00096}00096 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00097}00097         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_nic\_vport\_context\_in, in,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00098}00098                  opcode, \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39afed264e15620f391048e69b2c4533c7b}{MLX5\_CMD\_OP\_MODIFY\_NIC\_VPORT\_CONTEXT}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00099}00099         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_nic\_vport\_context\_in, in, field\_select.change\_event, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00100}00100         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_nic\_vport\_context\_in, in, vport\_number, vport);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00101}00101         \textcolor{keywordflow}{if} (vport)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00102}00102                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_nic\_vport\_context\_in, in, other\_vport, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00103}00103         nic\_vport\_ctx = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(modify\_nic\_vport\_context\_in,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00104}00104                                      in, nic\_vport\_context);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00105}00105 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00106}00106         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(nic\_vport\_context, nic\_vport\_ctx, arm\_change\_event, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00107}00107 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00108}00108         \textcolor{keywordflow}{if} (events\_mask \& \mbox{\hyperlink{mlx5__eswitch_8c_a5bea799269f02f5b3395d6b2c068b618a9612352a68fc92e5d6333b8cf603abbe}{UC\_ADDR\_CHANGE}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00109}00109                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(nic\_vport\_context, nic\_vport\_ctx,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00110}00110                          event\_on\_uc\_address\_change, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00111}00111         \textcolor{keywordflow}{if} (events\_mask \& \mbox{\hyperlink{mlx5__eswitch_8c_a5bea799269f02f5b3395d6b2c068b618a9c5d45a06d3e01334dd0d7b27f96c621}{MC\_ADDR\_CHANGE}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00112}00112                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(nic\_vport\_context, nic\_vport\_ctx,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00113}00113                          event\_on\_mc\_address\_change, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00114}00114 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00115}00115         \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__eswitch_8c_source_l00116}00116 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00117}00117 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00118}00118 \textcolor{comment}{/* E-\/Switch vport context HW commands */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00119}\mbox{\hyperlink{mlx5__eswitch_8c_a7f32a6e99165c2d8eae6c10ac9340be8}{00119}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_a7f32a6e99165c2d8eae6c10ac9340be8}{query\_esw\_vport\_context\_cmd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *mdev, u32 vport,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00120}00120                                        u32 *out, \textcolor{keywordtype}{int} outlen)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00121}00121 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00122}00122         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(query\_esw\_vport\_context\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00123}00123 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00124}00124         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(query\_nic\_vport\_context\_in, in, opcode,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00125}00125                  \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a5ad0f2ba234ff43d3c5313dba6429a17}{MLX5\_CMD\_OP\_QUERY\_ESW\_VPORT\_CONTEXT}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00126}00126 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00127}00127         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(query\_esw\_vport\_context\_in, in, vport\_number, vport);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00128}00128         \textcolor{keywordflow}{if} (vport)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00129}00129                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(query\_esw\_vport\_context\_in, in, other\_vport, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00130}00130 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00131}00131         \textcolor{keywordflow}{return} \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(mdev, in, \textcolor{keyword}{sizeof}(in), out, outlen);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00132}00132 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00133}00133 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00134}\mbox{\hyperlink{mlx5__eswitch_8c_afd876b6f57db6f9fcdb406893f44ddd3}{00134}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_afd876b6f57db6f9fcdb406893f44ddd3}{query\_esw\_vport\_cvlan}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, u32 vport,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00135}00135                                  u16 *vlan, u8 *qos)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00136}00136 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00137}00137         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(query\_esw\_vport\_context\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00138}00138         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00139}00139         \textcolor{keywordtype}{bool} cvlan\_strip;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00140}00140         \textcolor{keywordtype}{bool} cvlan\_insert;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00141}00141 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00142}00142         *vlan = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00143}00143         *qos = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00144}00144 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00145}00145         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{device_8h_ab3c8f9b02df69752ad2bf8655e1274f2}{MLX5\_CAP\_ESW}}(dev, vport\_cvlan\_strip) ||}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00146}00146             !\mbox{\hyperlink{device_8h_ab3c8f9b02df69752ad2bf8655e1274f2}{MLX5\_CAP\_ESW}}(dev, vport\_cvlan\_insert\_if\_not\_exist))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00147}00147                 \textcolor{keywordflow}{return} -\/ENOTSUPP;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00148}00148 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00149}00149         err = \mbox{\hyperlink{mlx5__eswitch_8c_a7f32a6e99165c2d8eae6c10ac9340be8}{query\_esw\_vport\_context\_cmd}}(dev, vport, out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00150}00150         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00151}00151                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00152}00152 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00153}00153         cvlan\_strip = \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(query\_esw\_vport\_context\_out, out,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00154}00154                                esw\_vport\_context.vport\_cvlan\_strip);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00155}00155 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00156}00156         cvlan\_insert = \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(query\_esw\_vport\_context\_out, out,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00157}00157                                 esw\_vport\_context.vport\_cvlan\_insert);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00158}00158 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00159}00159         \textcolor{keywordflow}{if} (cvlan\_strip || cvlan\_insert) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00160}00160                 *vlan = \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(query\_esw\_vport\_context\_out, out,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00161}00161                                  esw\_vport\_context.cvlan\_id);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00162}00162                 *qos = \mbox{\hyperlink{device_8h_a12a03f8a456490fce8c791c7f2922f97}{MLX5\_GET}}(query\_esw\_vport\_context\_out, out,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00163}00163                                 esw\_vport\_context.cvlan\_pcp);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00164}00164         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00165}00165 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00166}00166         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(dev, \textcolor{stringliteral}{"{}Query Vport[\%d] cvlan: VLAN \%d qos=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00167}00167                   vport, *vlan, *qos);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00168}00168 out:}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00169}00169         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00170}00170 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00171}00171 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00172}\mbox{\hyperlink{mlx5__eswitch_8c_a82b6080ebc2f015e5c1633660ef922ce}{00172}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_a82b6080ebc2f015e5c1633660ef922ce}{modify\_esw\_vport\_context\_cmd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, u16 vport,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00173}00173                                         \textcolor{keywordtype}{void} *in, \textcolor{keywordtype}{int} inlen)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00174}00174 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00175}00175         u32 out[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(modify\_esw\_vport\_context\_out)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00176}00176 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00177}00177         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_esw\_vport\_context\_in, in, vport\_number, vport);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00178}00178         \textcolor{keywordflow}{if} (vport)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00179}00179                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_esw\_vport\_context\_in, in, other\_vport, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00180}00180 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00181}00181         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_esw\_vport\_context\_in, in, opcode,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00182}00182                  \mbox{\hyperlink{mlx5__ifc_8h_a871a83db4e53fc6c6872b5ac7cc94f39a05b2cf5a3de3b50fe11a6575113c9416}{MLX5\_CMD\_OP\_MODIFY\_ESW\_VPORT\_CONTEXT}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00183}00183 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00184}00184         \textcolor{keywordflow}{return} \mbox{\hyperlink{driver_8h_ad7393e74938540251a0c894eb1eae135}{mlx5\_cmd\_exec}}(dev, in, inlen, out, \textcolor{keyword}{sizeof}(out));}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00185}00185 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00186}00186 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00187}\mbox{\hyperlink{mlx5__eswitch_8c_a3679a4487a0187941b75f91c995170f1}{00187}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_a3679a4487a0187941b75f91c995170f1}{modify\_esw\_vport\_cvlan}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, u32 vport,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00188}00188                                   u16 vlan, u8 qos, \textcolor{keywordtype}{bool} set)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00189}00189 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00190}00190         u32 in[\mbox{\hyperlink{device_8h_a2bdfa104f3d7c0635b984382d1562741}{MLX5\_ST\_SZ\_DW}}(modify\_esw\_vport\_context\_in)] = \{0\};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00191}00191 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00192}00192         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{device_8h_ab3c8f9b02df69752ad2bf8655e1274f2}{MLX5\_CAP\_ESW}}(dev, vport\_cvlan\_strip) ||}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00193}00193             !\mbox{\hyperlink{device_8h_ab3c8f9b02df69752ad2bf8655e1274f2}{MLX5\_CAP\_ESW}}(dev, vport\_cvlan\_insert\_if\_not\_exist))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00194}00194                 \textcolor{keywordflow}{return} -\/ENOTSUPP;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00195}00195 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00196}00196         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(dev, \textcolor{stringliteral}{"{}Set Vport[\%d] VLAN \%d qos \%d set=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00197}00197                   vport, vlan, qos, set);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00198}00198 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00199}00199         \textcolor{keywordflow}{if} (set) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00200}00200                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_esw\_vport\_context\_in, in,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00201}00201                          esw\_vport\_context.vport\_cvlan\_strip, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00202}00202                 \textcolor{comment}{/* insert only if no vlan in packet */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00203}00203                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_esw\_vport\_context\_in, in,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00204}00204                          esw\_vport\_context.vport\_cvlan\_insert, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00205}00205                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_esw\_vport\_context\_in, in,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00206}00206                          esw\_vport\_context.cvlan\_pcp, qos);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00207}00207                 \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_esw\_vport\_context\_in, in,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00208}00208                          esw\_vport\_context.cvlan\_id, vlan);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00209}00209         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00211}00211         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_esw\_vport\_context\_in, in,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00212}00212                  field\_select.vport\_cvlan\_strip, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00213}00213         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(modify\_esw\_vport\_context\_in, in,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00214}00214                  field\_select.vport\_cvlan\_insert, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00215}00215 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00216}00216         \textcolor{keywordflow}{return} \mbox{\hyperlink{mlx5__eswitch_8c_a82b6080ebc2f015e5c1633660ef922ce}{modify\_esw\_vport\_context\_cmd}}(dev, vport, in, \textcolor{keyword}{sizeof}(in));}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00217}00217 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00218}00218 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00219}00219 \textcolor{comment}{/* E-\/Switch FDB */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00220}00220 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__rule}{mlx5\_flow\_rule}} *}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00221}\mbox{\hyperlink{mlx5__eswitch_8c_a37ca7000e783b8b8c7352f47027fa33c}{00221}} \mbox{\hyperlink{mlx5__eswitch_8c_a37ca7000e783b8b8c7352f47027fa33c}{esw\_fdb\_set\_vport\_rule}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw, u8 mac[ETH\_ALEN], u32 vport)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00222}00222 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00223}00223         \textcolor{keywordtype}{int} match\_header = \mbox{\hyperlink{device_8h_a900dca9b26de42491763226e12dcd47bae7403af68298370ee07f0907fba731f4}{MLX5\_MATCH\_OUTER\_HEADERS}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00224}00224         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__destination}{mlx5\_flow\_destination}} dest;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00225}00225         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__rule}{mlx5\_flow\_rule}} *\mbox{\hyperlink{en__hw__tls__rx_8h_a9a19d8b9625bd87515041f254cd5ce7e}{flow\_rule}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00226}00226         u32 *match\_v;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00227}00227         u32 *match\_c;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00228}00228         u8 *dmac\_v;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00229}00229         u8 *dmac\_c;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00230}00230 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00231}00231         match\_v = kzalloc(\mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(fte\_match\_param), GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00232}00232         match\_c = kzalloc(\mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(fte\_match\_param), GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00233}00233         \textcolor{keywordflow}{if} (!match\_v || !match\_c) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00234}00234                 printf(\textcolor{stringliteral}{"{}mlx5\_core: WARN: "{}}\textcolor{stringliteral}{"{}FDB: Failed to alloc match parameters\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00235}00235                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00236}00236         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00237}00237         dmac\_v = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(fte\_match\_param, match\_v,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00238}00238                               outer\_headers.dmac\_47\_16);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00239}00239         dmac\_c = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(fte\_match\_param, match\_c,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00240}00240                               outer\_headers.dmac\_47\_16);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00241}00241 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00242}00242         ether\_addr\_copy(dmac\_v, mac);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00243}00243         \textcolor{comment}{/* Match criteria mask */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00244}00244         memset(dmac\_c, 0xff, 6);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00245}00245 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00246}00246         dest.\mbox{\hyperlink{structmlx5__flow__destination_a4421d4147c8e909299b6e406a09e3805}{type}} = \mbox{\hyperlink{mlx5__ifc_8h_a16db4876b192da08f3ad0cb41afe516fa21c87a01c892682b0e1e0287221daa7b}{MLX5\_FLOW\_CONTEXT\_DEST\_TYPE\_VPORT}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00247}00247         dest.\mbox{\hyperlink{structmlx5__flow__destination_ac20ef7f18d4d4ee93ff71cff4cc05f98}{vport\_num}} = vport;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00248}00248 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00249}00249         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00250}00250                   \textcolor{stringliteral}{"{}\(\backslash\)tFDB add rule dmac\_v(\%pM) dmac\_c(\%pM) -\/> vport(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00251}00251                   dmac\_v, dmac\_c, vport);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00252}00252         \mbox{\hyperlink{en__hw__tls__rx_8h_a9a19d8b9625bd87515041f254cd5ce7e}{flow\_rule}} =}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00253}00253                 \mbox{\hyperlink{fs_8h_a307738b93480306a8165f97ff64ce458}{mlx5\_add\_flow\_rule}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a9e94a4bd212cd67f80343bfe635ac813}{fdb\_table}}.\mbox{\hyperlink{structmlx5__eswitch__fdb_a5099c32c36b18a85adac846239e0961c}{fdb}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00254}00254                                    match\_header,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00255}00255                                    match\_c,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00256}00256                                    match\_v,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00257}00257                                    \mbox{\hyperlink{mlx5__ifc_8h_aa7477aaaec7caec07471eb609c556f5fa9be53190c8f3cd032a93d7feac08af87}{MLX5\_FLOW\_CONTEXT\_ACTION\_FWD\_DEST}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00258}00258                                    0, \&dest);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00259}00259         \textcolor{keywordflow}{if} (IS\_ERR\_OR\_NULL(\mbox{\hyperlink{en__hw__tls__rx_8h_a9a19d8b9625bd87515041f254cd5ce7e}{flow\_rule}})) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00260}00260                 printf(\textcolor{stringliteral}{"{}mlx5\_core: WARN: "{}}\textcolor{stringliteral}{"{}FDB: Failed to add flow rule: dmac\_v(\%pM) dmac\_c(\%pM) -\/> vport(\%d), err(\%ld)\(\backslash\)n"{}}, dmac\_v, dmac\_c, vport, PTR\_ERR(\mbox{\hyperlink{en__hw__tls__rx_8h_a9a19d8b9625bd87515041f254cd5ce7e}{flow\_rule}}));}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00261}00261                 \mbox{\hyperlink{en__hw__tls__rx_8h_a9a19d8b9625bd87515041f254cd5ce7e}{flow\_rule}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00262}00262         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00263}00263 out:}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00264}00264         kfree(match\_v);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00265}00265         kfree(match\_c);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00266}00266         \textcolor{keywordflow}{return} \mbox{\hyperlink{en__hw__tls__rx_8h_a9a19d8b9625bd87515041f254cd5ce7e}{flow\_rule}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00267}00267 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00268}00268 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00269}\mbox{\hyperlink{mlx5__eswitch_8c_ad7b0e375092505f3d83d8e3f88026abc}{00269}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_ad7b0e375092505f3d83d8e3f88026abc}{esw\_create\_fdb\_table}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00270}00270 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00271}00271         \textcolor{keywordtype}{int} inlen = \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(create\_flow\_group\_in);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00272}00272         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev = esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00273}00273         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__namespace}{mlx5\_flow\_namespace}} *root\_ns;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00274}00274         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__table}{mlx5\_flow\_table}} *fdb;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00275}00275         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__group}{mlx5\_flow\_group}} *g;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00276}00276         \textcolor{keywordtype}{void} *match\_criteria;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00277}00277         \textcolor{keywordtype}{int} table\_size;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00278}00278         u32 *flow\_group\_in;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00279}00279         u8 *dmac;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00280}00280         \textcolor{keywordtype}{int} err = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00281}00281 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00282}00282         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(dev, \textcolor{stringliteral}{"{}Create FDB log\_max\_size(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00283}00283                   \mbox{\hyperlink{device_8h_a6e37da781ceec3566e91da917759e3f4}{MLX5\_CAP\_ESW\_FLOWTABLE\_FDB}}(dev, log\_max\_ft\_size));}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00284}00284 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00285}00285         root\_ns = \mbox{\hyperlink{fs_8h_a30d2c82fd713ed1d26a9ad835f1ed21f}{mlx5\_get\_flow\_namespace}}(dev, \mbox{\hyperlink{fs_8h_ab4cc9ec86ed186a2bb03cf5bc1600e1ea50881a4e3efe4a405caedbaa588124e3}{MLX5\_FLOW\_NAMESPACE\_FDB}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00286}00286         \textcolor{keywordflow}{if} (!root\_ns) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00287}00287                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(dev, \textcolor{stringliteral}{"{}Failed to get FDB flow namespace\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00288}00288                 \textcolor{keywordflow}{return} -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00289}00289         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00290}00290 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00291}00291         flow\_group\_in = \mbox{\hyperlink{driver_8h_af928b1985830513c1c81b095b31ad8a7}{mlx5\_vzalloc}}(inlen);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00292}00292         \textcolor{keywordflow}{if} (!flow\_group\_in)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00293}00293                 \textcolor{keywordflow}{return} -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00294}00294         memset(flow\_group\_in, 0, inlen);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00295}00295 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00296}00296         \textcolor{comment}{/* (-\/2) Since MaorG said so .. */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00297}00297         table\_size = BIT(\mbox{\hyperlink{device_8h_a6e37da781ceec3566e91da917759e3f4}{MLX5\_CAP\_ESW\_FLOWTABLE\_FDB}}(dev, log\_max\_ft\_size)) -\/ 2;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00298}00298 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00299}00299         fdb = \mbox{\hyperlink{fs_8h_a8432b1e5fac9fe0982d51395545c55e3}{mlx5\_create\_flow\_table}}(root\_ns, 0, \textcolor{stringliteral}{"{}FDB"{}}, table\_size);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00300}00300         \textcolor{keywordflow}{if} (IS\_ERR\_OR\_NULL(fdb)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00301}00301                 err = PTR\_ERR(fdb);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00302}00302                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(dev, \textcolor{stringliteral}{"{}Failed to create FDB Table err \%d\(\backslash\)n"{}}, err);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00303}00303                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00304}00304         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00305}00305 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00306}00306         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_group\_in, flow\_group\_in, match\_criteria\_enable,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00307}00307                  \mbox{\hyperlink{device_8h_a900dca9b26de42491763226e12dcd47bae7403af68298370ee07f0907fba731f4}{MLX5\_MATCH\_OUTER\_HEADERS}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00308}00308         match\_criteria = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(create\_flow\_group\_in, flow\_group\_in, match\_criteria);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00309}00309         dmac = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(fte\_match\_param, match\_criteria, outer\_headers.dmac\_47\_16);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00310}00310         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_group\_in, flow\_group\_in, start\_flow\_index, 0);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00311}00311         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_group\_in, flow\_group\_in, end\_flow\_index, table\_size -\/ 1);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00312}00312         eth\_broadcast\_addr(dmac);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00313}00313 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00314}00314         g = \mbox{\hyperlink{fs_8h_ae1bd708c33f57ee6dba4fb0bb546a1dd}{mlx5\_create\_flow\_group}}(fdb, flow\_group\_in);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00315}00315         \textcolor{keywordflow}{if} (IS\_ERR\_OR\_NULL(g)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00316}00316                 err = PTR\_ERR(g);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00317}00317                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(dev, \textcolor{stringliteral}{"{}Failed to create flow group err(\%d)\(\backslash\)n"{}}, err);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00318}00318                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00319}00319         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00320}00320 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00321}00321         esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a9e94a4bd212cd67f80343bfe635ac813}{fdb\_table}}.\mbox{\hyperlink{structmlx5__eswitch__fdb_a00bed119383c528291fcb186bf825699}{addr\_grp}} = g;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00322}00322         esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a9e94a4bd212cd67f80343bfe635ac813}{fdb\_table}}.\mbox{\hyperlink{structmlx5__eswitch__fdb_a5099c32c36b18a85adac846239e0961c}{fdb}} = fdb;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00323}00323 out:}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00324}00324         kfree(flow\_group\_in);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00325}00325         \textcolor{keywordflow}{if} (err \&\& !IS\_ERR\_OR\_NULL(fdb))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00326}00326                 \mbox{\hyperlink{fs_8h_ae0fca9adb99d0de56dd209f5d80ac76f}{mlx5\_destroy\_flow\_table}}(fdb);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00327}00327         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00328}00328 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00329}00329 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00330}\mbox{\hyperlink{mlx5__eswitch_8c_a70be96b6189836518f1437a94597e0f5}{00330}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_a70be96b6189836518f1437a94597e0f5}{esw\_destroy\_fdb\_table}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00331}00331 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00332}00332         \textcolor{keywordflow}{if} (!esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a9e94a4bd212cd67f80343bfe635ac813}{fdb\_table}}.\mbox{\hyperlink{structmlx5__eswitch__fdb_a5099c32c36b18a85adac846239e0961c}{fdb}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00333}00333                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00334}00334 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00335}00335         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}Destroy FDB Table\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00336}00336         \mbox{\hyperlink{fs_8h_a35d5489c13664e3325dd2f3bcd21a88a}{mlx5\_destroy\_flow\_group}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a9e94a4bd212cd67f80343bfe635ac813}{fdb\_table}}.\mbox{\hyperlink{structmlx5__eswitch__fdb_a00bed119383c528291fcb186bf825699}{addr\_grp}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00337}00337         \mbox{\hyperlink{fs_8h_ae0fca9adb99d0de56dd209f5d80ac76f}{mlx5\_destroy\_flow\_table}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a9e94a4bd212cd67f80343bfe635ac813}{fdb\_table}}.\mbox{\hyperlink{structmlx5__eswitch__fdb_a5099c32c36b18a85adac846239e0961c}{fdb}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00338}00338         esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a9e94a4bd212cd67f80343bfe635ac813}{fdb\_table}}.\mbox{\hyperlink{structmlx5__eswitch__fdb_a5099c32c36b18a85adac846239e0961c}{fdb}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00339}00339         esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a9e94a4bd212cd67f80343bfe635ac813}{fdb\_table}}.\mbox{\hyperlink{structmlx5__eswitch__fdb_a00bed119383c528291fcb186bf825699}{addr\_grp}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00340}00340 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00341}00341 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00342}00342 \textcolor{comment}{/* E-\/Switch vport UC/MC lists management */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00343}\mbox{\hyperlink{mlx5__eswitch_8c_ab40ce32c8ee7cee00ad12765959dae45}{00343}} \textcolor{keyword}{typedef} int (*\mbox{\hyperlink{mlx5__eswitch_8c_ab40ce32c8ee7cee00ad12765959dae45}{vport\_addr\_action}})(\textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00344}00344                                  \textcolor{keyword}{struct }\mbox{\hyperlink{structvport__addr}{vport\_addr}} *vaddr);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00345}00345 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00346}\mbox{\hyperlink{mlx5__eswitch_8c_aee2781c4c9535ef4a110614cc74e4a12}{00346}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_aee2781c4c9535ef4a110614cc74e4a12}{esw\_add\_uc\_addr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw, \textcolor{keyword}{struct} \mbox{\hyperlink{structvport__addr}{vport\_addr}} *vaddr)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00347}00347 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00348}00348         \textcolor{keyword}{struct }hlist\_head *hash = esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a2c9205394bea57a97448c80a6ecc0fdb}{l2\_table}}.\mbox{\hyperlink{structmlx5__l2__table_a60f77de540b5c05d99b286837338f3c3}{l2\_hash}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00349}00349         \textcolor{keyword}{struct }\mbox{\hyperlink{structesw__uc__addr}{esw\_uc\_addr}} *esw\_uc;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00350}00350         u8 *mac = vaddr-\/>\mbox{\hyperlink{structvport__addr_a4bdb49c3536918023c499250d56eaec7}{node}}.\mbox{\hyperlink{structl2addr__node_a83acb789b9096e3200b1c0761a0101b8}{addr}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00351}00351         u32 \mbox{\hyperlink{structesw__uc__addr_ac484a3a81823649e0dc1b3d9028a92b2}{vport}} = vaddr-\/>\mbox{\hyperlink{structvport__addr_a68102b191a50c8ba8bcae0ecbd36dda0}{vport}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00352}00352         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00353}00353 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00354}00354         esw\_uc = \mbox{\hyperlink{eswitch_8h_aa69a18679dfc6e50f57bb64e4dd69cc6}{l2addr\_hash\_find}}(hash, mac, \textcolor{keyword}{struct} \mbox{\hyperlink{structesw__uc__addr}{esw\_uc\_addr}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00355}00355         \textcolor{keywordflow}{if} (esw\_uc) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00356}00356                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00357}00357                          \textcolor{stringliteral}{"{}Failed to set L2 mac(\%pM) for vport(\%d), mac is already in use by vport(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00358}00358                          mac, \mbox{\hyperlink{structesw__uc__addr_ac484a3a81823649e0dc1b3d9028a92b2}{vport}}, esw\_uc-\/>\mbox{\hyperlink{structesw__uc__addr_ac484a3a81823649e0dc1b3d9028a92b2}{vport}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00359}00359                 \textcolor{keywordflow}{return} -\/EEXIST;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00360}00360         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00361}00361 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00362}00362         esw\_uc = \mbox{\hyperlink{eswitch_8h_ac0244363f0f4ea92cbd6f3f703495d85}{l2addr\_hash\_add}}(hash, mac, \textcolor{keyword}{struct} \mbox{\hyperlink{structesw__uc__addr}{esw\_uc\_addr}}, GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00363}00363         \textcolor{keywordflow}{if} (!esw\_uc)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00364}00364                 \textcolor{keywordflow}{return} -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00365}00365         esw\_uc-\/>\mbox{\hyperlink{structesw__uc__addr_ac484a3a81823649e0dc1b3d9028a92b2}{vport}} = \mbox{\hyperlink{structesw__uc__addr_ac484a3a81823649e0dc1b3d9028a92b2}{vport}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00366}00366 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00367}00367         err = \mbox{\hyperlink{mlx5__mpfs_8c_a64fa41c9a5c6bef0bbada4550bd4ba9c}{mlx5\_mpfs\_add\_mac}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \&esw\_uc-\/>\mbox{\hyperlink{structesw__uc__addr_a9ee1f1e005db2e5797fa73745810fd9f}{table\_index}}, mac, 0, 0);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00368}00368         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00369}00369                 \textcolor{keywordflow}{goto} abort;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00370}00370 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00371}00371         \textcolor{keywordflow}{if} (esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a9e94a4bd212cd67f80343bfe635ac813}{fdb\_table}}.\mbox{\hyperlink{structmlx5__eswitch__fdb_a5099c32c36b18a85adac846239e0961c}{fdb}}) \textcolor{comment}{/* SRIOV is enabled: Forward UC MAC to vport */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00372}00372                 vaddr-\/>\mbox{\hyperlink{structvport__addr_a033e16d3a185fe113c66518ad32c5b74}{flow\_rule}} = \mbox{\hyperlink{mlx5__eswitch_8c_a37ca7000e783b8b8c7352f47027fa33c}{esw\_fdb\_set\_vport\_rule}}(esw, mac, \mbox{\hyperlink{structesw__uc__addr_ac484a3a81823649e0dc1b3d9028a92b2}{vport}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00373}00373 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00374}00374         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}\(\backslash\)tADDED UC MAC: vport[\%d] \%pM index:\%d fr(\%p)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00375}00375                   \mbox{\hyperlink{structesw__uc__addr_ac484a3a81823649e0dc1b3d9028a92b2}{vport}}, mac, esw\_uc-\/>\mbox{\hyperlink{structesw__uc__addr_a9ee1f1e005db2e5797fa73745810fd9f}{table\_index}}, vaddr-\/>\mbox{\hyperlink{structvport__addr_a033e16d3a185fe113c66518ad32c5b74}{flow\_rule}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00376}00376         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00377}00377 abort:}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00378}00378         \mbox{\hyperlink{eswitch_8h_a071b84f005c1ed71b8f8fb5ef436bf24}{l2addr\_hash\_del}}(esw\_uc);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00379}00379         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00380}00380 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00381}00381 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00382}\mbox{\hyperlink{mlx5__eswitch_8c_a5be43c030e19798f9d8be401f850cbc5}{00382}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_a5be43c030e19798f9d8be401f850cbc5}{esw\_del\_uc\_addr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw, \textcolor{keyword}{struct} \mbox{\hyperlink{structvport__addr}{vport\_addr}} *vaddr)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00383}00383 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00384}00384         \textcolor{keyword}{struct }hlist\_head *hash = esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a2c9205394bea57a97448c80a6ecc0fdb}{l2\_table}}.\mbox{\hyperlink{structmlx5__l2__table_a60f77de540b5c05d99b286837338f3c3}{l2\_hash}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00385}00385         \textcolor{keyword}{struct }\mbox{\hyperlink{structesw__uc__addr}{esw\_uc\_addr}} *esw\_uc;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00386}00386         u8 *mac = vaddr-\/>\mbox{\hyperlink{structvport__addr_a4bdb49c3536918023c499250d56eaec7}{node}}.\mbox{\hyperlink{structl2addr__node_a83acb789b9096e3200b1c0761a0101b8}{addr}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00387}00387         u32 \mbox{\hyperlink{structesw__uc__addr_ac484a3a81823649e0dc1b3d9028a92b2}{vport}} = vaddr-\/>\mbox{\hyperlink{structvport__addr_a68102b191a50c8ba8bcae0ecbd36dda0}{vport}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00388}00388 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00389}00389         esw\_uc = \mbox{\hyperlink{eswitch_8h_aa69a18679dfc6e50f57bb64e4dd69cc6}{l2addr\_hash\_find}}(hash, mac, \textcolor{keyword}{struct} \mbox{\hyperlink{structesw__uc__addr}{esw\_uc\_addr}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00390}00390         \textcolor{keywordflow}{if} (!esw\_uc || esw\_uc-\/>\mbox{\hyperlink{structesw__uc__addr_ac484a3a81823649e0dc1b3d9028a92b2}{vport}} != \mbox{\hyperlink{structesw__uc__addr_ac484a3a81823649e0dc1b3d9028a92b2}{vport}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00391}00391                 \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00392}00392                           \textcolor{stringliteral}{"{}MAC(\%pM) doesn't belong to vport (\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00393}00393                           mac, \mbox{\hyperlink{structesw__uc__addr_ac484a3a81823649e0dc1b3d9028a92b2}{vport}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00394}00394                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00395}00395         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00396}00396         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}\(\backslash\)tDELETE UC MAC: vport[\%d] \%pM index:\%d fr(\%p)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00397}00397                   \mbox{\hyperlink{structesw__uc__addr_ac484a3a81823649e0dc1b3d9028a92b2}{vport}}, mac, esw\_uc-\/>\mbox{\hyperlink{structesw__uc__addr_a9ee1f1e005db2e5797fa73745810fd9f}{table\_index}}, vaddr-\/>\mbox{\hyperlink{structvport__addr_a033e16d3a185fe113c66518ad32c5b74}{flow\_rule}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00398}00398 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00399}00399         \mbox{\hyperlink{mlx5__mpfs_8c_ad8c179552af531145d7d7ac54b79d4d1}{mlx5\_mpfs\_del\_mac}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, esw\_uc-\/>\mbox{\hyperlink{structesw__uc__addr_a9ee1f1e005db2e5797fa73745810fd9f}{table\_index}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00400}00400 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00401}00401         \textcolor{keywordflow}{if} (vaddr-\/>\mbox{\hyperlink{structvport__addr_a033e16d3a185fe113c66518ad32c5b74}{flow\_rule}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00402}00402                 \mbox{\hyperlink{fs_8h_a4edebcab04b40addc3bf6e8d9ab83075}{mlx5\_del\_flow\_rule}}(vaddr-\/>\mbox{\hyperlink{structvport__addr_a033e16d3a185fe113c66518ad32c5b74}{flow\_rule}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00403}00403         vaddr-\/>\mbox{\hyperlink{structvport__addr_a033e16d3a185fe113c66518ad32c5b74}{flow\_rule}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00404}00404 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00405}00405         \mbox{\hyperlink{eswitch_8h_a071b84f005c1ed71b8f8fb5ef436bf24}{l2addr\_hash\_del}}(esw\_uc);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00406}00406         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00407}00407 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00408}00408 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00409}\mbox{\hyperlink{mlx5__eswitch_8c_a6c9789ead537beb61731d63a6fd42c11}{00409}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_a6c9789ead537beb61731d63a6fd42c11}{esw\_add\_mc\_addr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw, \textcolor{keyword}{struct} \mbox{\hyperlink{structvport__addr}{vport\_addr}} *vaddr)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00410}00410 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00411}00411         \textcolor{keyword}{struct }hlist\_head *hash = esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a0298f7db04718898f304d3b1c486ec07}{mc\_table}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00412}00412         \textcolor{keyword}{struct }\mbox{\hyperlink{structesw__mc__addr}{esw\_mc\_addr}} *esw\_mc;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00413}00413         u8 *mac = vaddr-\/>\mbox{\hyperlink{structvport__addr_a4bdb49c3536918023c499250d56eaec7}{node}}.\mbox{\hyperlink{structl2addr__node_a83acb789b9096e3200b1c0761a0101b8}{addr}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00414}00414         u32 vport = vaddr-\/>\mbox{\hyperlink{structvport__addr_a68102b191a50c8ba8bcae0ecbd36dda0}{vport}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00415}00415 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00416}00416         \textcolor{keywordflow}{if} (!esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a9e94a4bd212cd67f80343bfe635ac813}{fdb\_table}}.\mbox{\hyperlink{structmlx5__eswitch__fdb_a5099c32c36b18a85adac846239e0961c}{fdb}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00417}00417                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00418}00418 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00419}00419         esw\_mc = \mbox{\hyperlink{eswitch_8h_aa69a18679dfc6e50f57bb64e4dd69cc6}{l2addr\_hash\_find}}(hash, mac, \textcolor{keyword}{struct} \mbox{\hyperlink{structesw__mc__addr}{esw\_mc\_addr}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00420}00420         \textcolor{keywordflow}{if} (esw\_mc)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00421}00421                 \textcolor{keywordflow}{goto} add;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00422}00422 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00423}00423         esw\_mc = \mbox{\hyperlink{eswitch_8h_ac0244363f0f4ea92cbd6f3f703495d85}{l2addr\_hash\_add}}(hash, mac, \textcolor{keyword}{struct} \mbox{\hyperlink{structesw__mc__addr}{esw\_mc\_addr}}, GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00424}00424         \textcolor{keywordflow}{if} (!esw\_mc)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00425}00425                 \textcolor{keywordflow}{return} -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00426}00426 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00427}00427         esw\_mc-\/>\mbox{\hyperlink{structesw__mc__addr_a1f83afa61bed80fd7bd49e91d55aa3e9}{uplink\_rule}} = \textcolor{comment}{/* Forward MC MAC to Uplink */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00428}00428                 \mbox{\hyperlink{mlx5__eswitch_8c_a37ca7000e783b8b8c7352f47027fa33c}{esw\_fdb\_set\_vport\_rule}}(esw, mac, \mbox{\hyperlink{mlx5__eswitch_8c_ae7da705f31a521f4f1da3666896222e4}{UPLINK\_VPORT}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00429}00429 add:}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00430}00430         esw\_mc-\/>\mbox{\hyperlink{structesw__mc__addr_ad406fa062655b5ee5907076d6cc5a3d7}{refcnt}}++;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00431}00431         \textcolor{comment}{/* Forward MC MAC to vport */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00432}00432         vaddr-\/>\mbox{\hyperlink{structvport__addr_a033e16d3a185fe113c66518ad32c5b74}{flow\_rule}} = \mbox{\hyperlink{mlx5__eswitch_8c_a37ca7000e783b8b8c7352f47027fa33c}{esw\_fdb\_set\_vport\_rule}}(esw, mac, vport);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00433}00433         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00434}00434                   \textcolor{stringliteral}{"{}\(\backslash\)tADDED MC MAC: vport[\%d] \%pM fr(\%p) refcnt(\%d) uplinkfr(\%p)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00435}00435                   vport, mac, vaddr-\/>\mbox{\hyperlink{structvport__addr_a033e16d3a185fe113c66518ad32c5b74}{flow\_rule}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00436}00436                   esw\_mc-\/>\mbox{\hyperlink{structesw__mc__addr_ad406fa062655b5ee5907076d6cc5a3d7}{refcnt}}, esw\_mc-\/>\mbox{\hyperlink{structesw__mc__addr_a1f83afa61bed80fd7bd49e91d55aa3e9}{uplink\_rule}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00437}00437         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00438}00438 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00439}00439 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00440}\mbox{\hyperlink{mlx5__eswitch_8c_a90374899b0230d646e0464c528b838a6}{00440}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_a90374899b0230d646e0464c528b838a6}{esw\_del\_mc\_addr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw, \textcolor{keyword}{struct} \mbox{\hyperlink{structvport__addr}{vport\_addr}} *vaddr)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00441}00441 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00442}00442         \textcolor{keyword}{struct }hlist\_head *hash = esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a0298f7db04718898f304d3b1c486ec07}{mc\_table}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00443}00443         \textcolor{keyword}{struct }\mbox{\hyperlink{structesw__mc__addr}{esw\_mc\_addr}} *esw\_mc;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00444}00444         u8 *mac = vaddr-\/>\mbox{\hyperlink{structvport__addr_a4bdb49c3536918023c499250d56eaec7}{node}}.\mbox{\hyperlink{structl2addr__node_a83acb789b9096e3200b1c0761a0101b8}{addr}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00445}00445         u32 vport = vaddr-\/>\mbox{\hyperlink{structvport__addr_a68102b191a50c8ba8bcae0ecbd36dda0}{vport}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00446}00446 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00447}00447         \textcolor{keywordflow}{if} (!esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a9e94a4bd212cd67f80343bfe635ac813}{fdb\_table}}.\mbox{\hyperlink{structmlx5__eswitch__fdb_a5099c32c36b18a85adac846239e0961c}{fdb}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00448}00448                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00449}00449 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00450}00450         esw\_mc = \mbox{\hyperlink{eswitch_8h_aa69a18679dfc6e50f57bb64e4dd69cc6}{l2addr\_hash\_find}}(hash, mac, \textcolor{keyword}{struct} \mbox{\hyperlink{structesw__mc__addr}{esw\_mc\_addr}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00451}00451         \textcolor{keywordflow}{if} (!esw\_mc) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00452}00452                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00453}00453                          \textcolor{stringliteral}{"{}Failed to find eswitch MC addr for MAC(\%pM) vport(\%d)"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00454}00454                          mac, vport);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00455}00455                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00456}00456         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00457}00457         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00458}00458                   \textcolor{stringliteral}{"{}\(\backslash\)tDELETE MC MAC: vport[\%d] \%pM fr(\%p) refcnt(\%d) uplinkfr(\%p)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00459}00459                   vport, mac, vaddr-\/>\mbox{\hyperlink{structvport__addr_a033e16d3a185fe113c66518ad32c5b74}{flow\_rule}}, esw\_mc-\/>\mbox{\hyperlink{structesw__mc__addr_ad406fa062655b5ee5907076d6cc5a3d7}{refcnt}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00460}00460                   esw\_mc-\/>\mbox{\hyperlink{structesw__mc__addr_a1f83afa61bed80fd7bd49e91d55aa3e9}{uplink\_rule}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00461}00461 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00462}00462         \textcolor{keywordflow}{if} (vaddr-\/>\mbox{\hyperlink{structvport__addr_a033e16d3a185fe113c66518ad32c5b74}{flow\_rule}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00463}00463                 \mbox{\hyperlink{fs_8h_a4edebcab04b40addc3bf6e8d9ab83075}{mlx5\_del\_flow\_rule}}(vaddr-\/>\mbox{\hyperlink{structvport__addr_a033e16d3a185fe113c66518ad32c5b74}{flow\_rule}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00464}00464         vaddr-\/>\mbox{\hyperlink{structvport__addr_a033e16d3a185fe113c66518ad32c5b74}{flow\_rule}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00465}00465 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00466}00466         \textcolor{keywordflow}{if} (-\/-\/esw\_mc-\/>\mbox{\hyperlink{structesw__mc__addr_ad406fa062655b5ee5907076d6cc5a3d7}{refcnt}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00467}00467                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00468}00468 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00469}00469         \textcolor{keywordflow}{if} (esw\_mc-\/>\mbox{\hyperlink{structesw__mc__addr_a1f83afa61bed80fd7bd49e91d55aa3e9}{uplink\_rule}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00470}00470                 \mbox{\hyperlink{fs_8h_a4edebcab04b40addc3bf6e8d9ab83075}{mlx5\_del\_flow\_rule}}(esw\_mc-\/>\mbox{\hyperlink{structesw__mc__addr_a1f83afa61bed80fd7bd49e91d55aa3e9}{uplink\_rule}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00471}00471 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00472}00472         \mbox{\hyperlink{eswitch_8h_a071b84f005c1ed71b8f8fb5ef436bf24}{l2addr\_hash\_del}}(esw\_mc);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00473}00473         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00474}00474 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00475}00475 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00476}00476 \textcolor{comment}{/* Apply vport UC/MC list to HW l2 table and FDB table */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00477}\mbox{\hyperlink{mlx5__eswitch_8c_a83af036abe5e54621d4b797e6f97e6cf}{00477}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_a83af036abe5e54621d4b797e6f97e6cf}{esw\_apply\_vport\_addr\_list}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00478}00478                                       u32 vport\_num, \textcolor{keywordtype}{int} list\_type)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00479}00479 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00480}00480         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}} = \&esw-\/>\mbox{\hyperlink{structmlx5__eswitch_af4a141b9b40d78d4190290f1f3296b33}{vports}}[vport\_num];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00481}00481         \textcolor{keywordtype}{bool} is\_uc = list\_type == \mbox{\hyperlink{device_8h_aaeffb3e9673a6ec1ceffbec7699c0ce1a36a014e5d252225bb9259b1fdce6e820}{MLX5\_NIC\_VPORT\_LIST\_TYPE\_UC}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00482}00482         \mbox{\hyperlink{mlx5__eswitch_8c_ab40ce32c8ee7cee00ad12765959dae45}{vport\_addr\_action}} vport\_addr\_add;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00483}00483         \mbox{\hyperlink{mlx5__eswitch_8c_ab40ce32c8ee7cee00ad12765959dae45}{vport\_addr\_action}} vport\_addr\_del;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00484}00484         \textcolor{keyword}{struct }\mbox{\hyperlink{structvport__addr}{vport\_addr}} *addr;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00485}00485         \textcolor{keyword}{struct }\mbox{\hyperlink{structl2addr__node}{l2addr\_node}} *node;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00486}00486         \textcolor{keyword}{struct }hlist\_head *hash;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00487}00487         \textcolor{keyword}{struct }hlist\_node *tmp;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00488}00488         \textcolor{keywordtype}{int} hi;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00489}00489 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00490}00490         vport\_addr\_add = is\_uc ? \mbox{\hyperlink{mlx5__eswitch_8c_aee2781c4c9535ef4a110614cc74e4a12}{esw\_add\_uc\_addr}} :}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00491}00491                                  \mbox{\hyperlink{mlx5__eswitch_8c_a6c9789ead537beb61731d63a6fd42c11}{esw\_add\_mc\_addr}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00492}00492         vport\_addr\_del = is\_uc ? \mbox{\hyperlink{mlx5__eswitch_8c_a5be43c030e19798f9d8be401f850cbc5}{esw\_del\_uc\_addr}} :}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00493}00493                                  \mbox{\hyperlink{mlx5__eswitch_8c_a90374899b0230d646e0464c528b838a6}{esw\_del\_mc\_addr}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00494}00494 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00495}00495         hash = is\_uc ? vport-\/>\mbox{\hyperlink{structmlx5__vport_aa41215bf4ca4d3734d41626bc06fea7f}{uc\_list}} : vport-\/>\mbox{\hyperlink{structmlx5__vport_a7e0f973583874bf1027e5c0a2f535f2b}{mc\_list}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00496}00496         \mbox{\hyperlink{eswitch_8h_aee9a7eba31456cfd476acf7a8aee56cb}{for\_each\_l2hash\_node}}(node, tmp, hash, hi) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00497}00497                 addr = container\_of(node, \textcolor{keyword}{struct} \mbox{\hyperlink{structvport__addr}{vport\_addr}}, node);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00498}00498                 \textcolor{keywordflow}{switch} (addr-\/>\mbox{\hyperlink{structvport__addr_a30ed10cbc3e6fc254fc575c1d2c95984}{action}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00499}00499                 \textcolor{keywordflow}{case} \mbox{\hyperlink{mlx5__eswitch_8c_a0ac0b7994a7d738aa77d2c1cfe8d6d13aacc261c009394fb62c458a6da27209e1}{MLX5\_ACTION\_ADD}}:}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00500}00500                         vport\_addr\_add(esw, addr);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00501}00501                         addr-\/>\mbox{\hyperlink{structvport__addr_a30ed10cbc3e6fc254fc575c1d2c95984}{action}} = \mbox{\hyperlink{mlx5__eswitch_8c_a0ac0b7994a7d738aa77d2c1cfe8d6d13a0b511e461da6547f1719c077eee71de6}{MLX5\_ACTION\_NONE}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00502}00502                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00503}00503                 \textcolor{keywordflow}{case} \mbox{\hyperlink{mlx5__eswitch_8c_a0ac0b7994a7d738aa77d2c1cfe8d6d13a1e7cebc427f4d4396cd195ddef3fa7e5}{MLX5\_ACTION\_DEL}}:}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00504}00504                         vport\_addr\_del(esw, addr);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00505}00505                         \mbox{\hyperlink{eswitch_8h_a071b84f005c1ed71b8f8fb5ef436bf24}{l2addr\_hash\_del}}(addr);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00506}00506                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00507}00507                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00508}00508         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00509}00509 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00510}00510 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00511}00511 \textcolor{comment}{/* Sync vport UC/MC list from vport context */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00512}\mbox{\hyperlink{mlx5__eswitch_8c_a6df64cc5193999809c7343e58e639d8f}{00512}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_a6df64cc5193999809c7343e58e639d8f}{esw\_update\_vport\_addr\_list}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00513}00513                                        u32 vport\_num, \textcolor{keywordtype}{int} list\_type)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00514}00514 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00515}00515         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}} = \&esw-\/>\mbox{\hyperlink{structmlx5__eswitch_af4a141b9b40d78d4190290f1f3296b33}{vports}}[vport\_num];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00516}00516         \textcolor{keywordtype}{bool} is\_uc = list\_type == \mbox{\hyperlink{device_8h_aaeffb3e9673a6ec1ceffbec7699c0ce1a36a014e5d252225bb9259b1fdce6e820}{MLX5\_NIC\_VPORT\_LIST\_TYPE\_UC}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00517}00517         u8 (*mac\_list)[ETH\_ALEN];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00518}00518         \textcolor{keyword}{struct }\mbox{\hyperlink{structl2addr__node}{l2addr\_node}} *node;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00519}00519         \textcolor{keyword}{struct }\mbox{\hyperlink{structvport__addr}{vport\_addr}} *addr;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00520}00520         \textcolor{keyword}{struct }hlist\_head *hash;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00521}00521         \textcolor{keyword}{struct }hlist\_node *tmp;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00522}00522         \textcolor{keywordtype}{int} size;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00523}00523         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00524}00524         \textcolor{keywordtype}{int} hi;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00525}00525         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00526}00526 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00527}00527         size = is\_uc ? \mbox{\hyperlink{eswitch_8h_a21ccd5f3f13b3bb0982f780080562bc2}{MLX5\_MAX\_UC\_PER\_VPORT}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}) :}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00528}00528                        \mbox{\hyperlink{eswitch_8h_a9f23d2266996b48795fbdc0f1545212f}{MLX5\_MAX\_MC\_PER\_VPORT}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00529}00529 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00530}00530         mac\_list = kcalloc(size, ETH\_ALEN, GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00531}00531         \textcolor{keywordflow}{if} (!mac\_list)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00532}00532                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00533}00533 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00534}00534         hash = is\_uc ? vport-\/>\mbox{\hyperlink{structmlx5__vport_aa41215bf4ca4d3734d41626bc06fea7f}{uc\_list}} : vport-\/>\mbox{\hyperlink{structmlx5__vport_a7e0f973583874bf1027e5c0a2f535f2b}{mc\_list}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00535}00535 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00536}00536         \mbox{\hyperlink{eswitch_8h_aee9a7eba31456cfd476acf7a8aee56cb}{for\_each\_l2hash\_node}}(node, tmp, hash, hi) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00537}00537                 addr = container\_of(node, \textcolor{keyword}{struct} \mbox{\hyperlink{structvport__addr}{vport\_addr}}, node);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00538}00538                 addr-\/>\mbox{\hyperlink{structvport__addr_a30ed10cbc3e6fc254fc575c1d2c95984}{action}} = \mbox{\hyperlink{mlx5__eswitch_8c_a0ac0b7994a7d738aa77d2c1cfe8d6d13a1e7cebc427f4d4396cd195ddef3fa7e5}{MLX5\_ACTION\_DEL}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00539}00539         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00540}00540 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00541}00541         err = \mbox{\hyperlink{mlx5__vport_8c_a7e4b02089ade0c23348970417c955a23}{mlx5\_query\_nic\_vport\_mac\_list}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, vport\_num, list\_type,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00542}00542                                             mac\_list, \&size);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00543}00543         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00544}00544                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00545}00545         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}vport[\%d] context update \%s list size (\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00546}00546                   vport\_num, is\_uc ? \textcolor{stringliteral}{"{}UC"{}} : \textcolor{stringliteral}{"{}MC"{}}, size);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00547}00547 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00548}00548         \textcolor{keywordflow}{for} (i = 0; i < size; i++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00549}00549                 \textcolor{keywordflow}{if} (is\_uc \&\& !is\_valid\_ether\_addr(mac\_list[i]))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00550}00550                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00551}00551 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00552}00552                 \textcolor{keywordflow}{if} (!is\_uc \&\& !is\_multicast\_ether\_addr(mac\_list[i]))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00553}00553                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00554}00554 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00555}00555                 addr = \mbox{\hyperlink{eswitch_8h_aa69a18679dfc6e50f57bb64e4dd69cc6}{l2addr\_hash\_find}}(hash, mac\_list[i], \textcolor{keyword}{struct} \mbox{\hyperlink{structvport__addr}{vport\_addr}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00556}00556                 \textcolor{keywordflow}{if} (addr) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00557}00557                         addr-\/>\mbox{\hyperlink{structvport__addr_a30ed10cbc3e6fc254fc575c1d2c95984}{action}} = \mbox{\hyperlink{mlx5__eswitch_8c_a0ac0b7994a7d738aa77d2c1cfe8d6d13a0b511e461da6547f1719c077eee71de6}{MLX5\_ACTION\_NONE}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00558}00558                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00559}00559                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00560}00560 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00561}00561                 addr = \mbox{\hyperlink{eswitch_8h_ac0244363f0f4ea92cbd6f3f703495d85}{l2addr\_hash\_add}}(hash, mac\_list[i], \textcolor{keyword}{struct} \mbox{\hyperlink{structvport__addr}{vport\_addr}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00562}00562                                        GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00563}00563                 \textcolor{keywordflow}{if} (!addr) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00564}00564                         \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00565}00565                                  \textcolor{stringliteral}{"{}Failed to add MAC(\%pM) to vport[\%d] DB\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00566}00566                                  mac\_list[i], vport\_num);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00567}00567                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00568}00568                 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00569}00569                 addr-\/>\mbox{\hyperlink{structvport__addr_a68102b191a50c8ba8bcae0ecbd36dda0}{vport}} = vport\_num;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00570}00570                 addr-\/>\mbox{\hyperlink{structvport__addr_a30ed10cbc3e6fc254fc575c1d2c95984}{action}} = \mbox{\hyperlink{mlx5__eswitch_8c_a0ac0b7994a7d738aa77d2c1cfe8d6d13aacc261c009394fb62c458a6da27209e1}{MLX5\_ACTION\_ADD}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00571}00571         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00572}00572         kfree(mac\_list);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00573}00573 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00574}00574 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00575}\mbox{\hyperlink{mlx5__eswitch_8c_aaf7df8a88dccd946f5cba17e80854274}{00575}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_aaf7df8a88dccd946f5cba17e80854274}{esw\_vport\_change\_handler}}(\textcolor{keyword}{struct} work\_struct *\mbox{\hyperlink{en__hw__tls_8h_a623997e11b94d7c467ce26627cc488a2}{work}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00576}00576 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00577}00577         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}} =}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00578}00578                 container\_of(\mbox{\hyperlink{en__hw__tls_8h_a623997e11b94d7c467ce26627cc488a2}{work}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}}, \mbox{\hyperlink{structmlx5__vport_a6f447c3dab781b7b5e7b354cee5c9c16}{vport\_change\_handler}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00579}00579         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev = vport-\/>\mbox{\hyperlink{structmlx5__vport_ac5a5dda75671c6403a5825d213a66878}{dev}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00580}00580         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw = \mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_af51b3ecf53b287041c15644d42c9f405}{eswitch}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00581}00581         u8 mac[ETH\_ALEN];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00582}00582 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00583}00583         \mbox{\hyperlink{mlx5__vport_8c_ad67a4267d8c0e7b052f317c01819063a}{mlx5\_query\_nic\_vport\_mac\_address}}(\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, mac);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00584}00584         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}vport[\%d] Context Changed: perm mac: \%pM\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00585}00585                   vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, mac);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00586}00586 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00587}00587         \textcolor{keywordflow}{if} (vport-\/>\mbox{\hyperlink{structmlx5__vport_a061cb2a83293ea89a796d9eb179e1f13}{enabled\_events}} \& \mbox{\hyperlink{mlx5__eswitch_8c_a5bea799269f02f5b3395d6b2c068b618a9612352a68fc92e5d6333b8cf603abbe}{UC\_ADDR\_CHANGE}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00588}00588                 \mbox{\hyperlink{mlx5__eswitch_8c_a6df64cc5193999809c7343e58e639d8f}{esw\_update\_vport\_addr\_list}}(esw, vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00589}00589                                            \mbox{\hyperlink{device_8h_aaeffb3e9673a6ec1ceffbec7699c0ce1a36a014e5d252225bb9259b1fdce6e820}{MLX5\_NIC\_VPORT\_LIST\_TYPE\_UC}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00590}00590                 \mbox{\hyperlink{mlx5__eswitch_8c_a83af036abe5e54621d4b797e6f97e6cf}{esw\_apply\_vport\_addr\_list}}(esw, vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00591}00591                                           \mbox{\hyperlink{device_8h_aaeffb3e9673a6ec1ceffbec7699c0ce1a36a014e5d252225bb9259b1fdce6e820}{MLX5\_NIC\_VPORT\_LIST\_TYPE\_UC}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00592}00592         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00593}00593 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00594}00594         \textcolor{keywordflow}{if} (vport-\/>\mbox{\hyperlink{structmlx5__vport_a061cb2a83293ea89a796d9eb179e1f13}{enabled\_events}} \& \mbox{\hyperlink{mlx5__eswitch_8c_a5bea799269f02f5b3395d6b2c068b618a9c5d45a06d3e01334dd0d7b27f96c621}{MC\_ADDR\_CHANGE}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00595}00595                 \mbox{\hyperlink{mlx5__eswitch_8c_a6df64cc5193999809c7343e58e639d8f}{esw\_update\_vport\_addr\_list}}(esw, vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00596}00596                                            \mbox{\hyperlink{device_8h_aaeffb3e9673a6ec1ceffbec7699c0ce1ab9ba0bd9acf21b6ca979fcb37363319a}{MLX5\_NIC\_VPORT\_LIST\_TYPE\_MC}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00597}00597                 \mbox{\hyperlink{mlx5__eswitch_8c_a83af036abe5e54621d4b797e6f97e6cf}{esw\_apply\_vport\_addr\_list}}(esw, vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00598}00598                                           \mbox{\hyperlink{device_8h_aaeffb3e9673a6ec1ceffbec7699c0ce1ab9ba0bd9acf21b6ca979fcb37363319a}{MLX5\_NIC\_VPORT\_LIST\_TYPE\_MC}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00599}00599         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00600}00600 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00601}00601         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}vport[\%d] Context Changed: Done\(\backslash\)n"{}}, vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00602}00602         \textcolor{keywordflow}{if} (vport-\/>\mbox{\hyperlink{structmlx5__vport_ae5d345507258e839dbcc381e618f4265}{enabled}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00603}00603                 \mbox{\hyperlink{mlx5__eswitch_8c_a51585bd30922f59cdd625d5f02a93a2c}{arm\_vport\_context\_events\_cmd}}(\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00604}00604                                              vport-\/>\mbox{\hyperlink{structmlx5__vport_a061cb2a83293ea89a796d9eb179e1f13}{enabled\_events}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00605}00605 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00606}00606 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00607}\mbox{\hyperlink{mlx5__eswitch_8c_a6c85f6f020f5f3d857c899779613255c}{00607}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_a6c85f6f020f5f3d857c899779613255c}{esw\_vport\_enable\_egress\_acl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00608}00608                                         \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *vport)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00609}00609 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00610}00610         \textcolor{keywordtype}{int} inlen = \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(create\_flow\_group\_in);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00611}00611         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__group}{mlx5\_flow\_group}} *vlan\_grp = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00612}00612         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__group}{mlx5\_flow\_group}} *drop\_grp = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00613}00613         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev = esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00614}00614         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__namespace}{mlx5\_flow\_namespace}} *root\_ns;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00615}00615         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__table}{mlx5\_flow\_table}} *acl;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00616}00616         \textcolor{keywordtype}{void} *match\_criteria;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00617}00617         \textcolor{keywordtype}{char} table\_name[32];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00618}00618         u32 *flow\_group\_in;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00619}00619         \textcolor{keywordtype}{int} table\_size = 2;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00620}00620         \textcolor{keywordtype}{int} err = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00621}00621 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00622}00622         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{device_8h_acd6de5e1bc1ca6583a13b7bbc12bec64}{MLX5\_CAP\_ESW\_EGRESS\_ACL}}(dev, ft\_support))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00623}00623                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00624}00624 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00625}00625         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(dev, \textcolor{stringliteral}{"{}Create vport[\%d] egress ACL log\_max\_size(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00626}00626                   \mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>vport, \mbox{\hyperlink{device_8h_acd6de5e1bc1ca6583a13b7bbc12bec64}{MLX5\_CAP\_ESW\_EGRESS\_ACL}}(dev, log\_max\_ft\_size));}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00627}00627 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00628}00628         root\_ns = \mbox{\hyperlink{fs_8h_a30d2c82fd713ed1d26a9ad835f1ed21f}{mlx5\_get\_flow\_namespace}}(dev, \mbox{\hyperlink{fs_8h_ab4cc9ec86ed186a2bb03cf5bc1600e1ea453bd0c117da7b2f88e4904f35097819}{MLX5\_FLOW\_NAMESPACE\_ESW\_EGRESS}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00629}00629         \textcolor{keywordflow}{if} (!root\_ns) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00630}00630                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(dev, \textcolor{stringliteral}{"{}Failed to get E-\/Switch egress flow namespace\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00631}00631                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00632}00632         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00633}00633 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00634}00634         flow\_group\_in = \mbox{\hyperlink{driver_8h_af928b1985830513c1c81b095b31ad8a7}{mlx5\_vzalloc}}(inlen);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00635}00635         \textcolor{keywordflow}{if} (!flow\_group\_in)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00636}00636                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00637}00637 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00638}00638         snprintf(table\_name, 32, \textcolor{stringliteral}{"{}egress\_\%d"{}}, \mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>vport);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00639}00639         acl = \mbox{\hyperlink{fs_8h_af90b9ad565435525b3f699b9a0a189fc}{mlx5\_create\_vport\_flow\_table}}(root\_ns, \mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>vport, 0, table\_name, table\_size);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00640}00640         \textcolor{keywordflow}{if} (IS\_ERR\_OR\_NULL(acl)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00641}00641                 err = PTR\_ERR(acl);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00642}00642                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(dev, \textcolor{stringliteral}{"{}Failed to create E-\/Switch vport[\%d] egress flow Table, err(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00643}00643                          \mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>vport, err);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00644}00644                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00645}00645         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00646}00646 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00647}00647         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_group\_in, flow\_group\_in, match\_criteria\_enable, \mbox{\hyperlink{device_8h_a900dca9b26de42491763226e12dcd47bae7403af68298370ee07f0907fba731f4}{MLX5\_MATCH\_OUTER\_HEADERS}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00648}00648         match\_criteria = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(create\_flow\_group\_in, flow\_group\_in, match\_criteria);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00649}00649         \mbox{\hyperlink{device_8h_a5771abbaf67aa376010ef29922b9a0d2}{MLX5\_SET\_TO\_ONES}}(fte\_match\_param, match\_criteria, outer\_headers.cvlan\_tag);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00650}00650         \mbox{\hyperlink{device_8h_a5771abbaf67aa376010ef29922b9a0d2}{MLX5\_SET\_TO\_ONES}}(fte\_match\_param, match\_criteria, outer\_headers.first\_vid);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00651}00651         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_group\_in, flow\_group\_in, start\_flow\_index, 0);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00652}00652         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_group\_in, flow\_group\_in, end\_flow\_index, 0);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00653}00653 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00654}00654         vlan\_grp = \mbox{\hyperlink{fs_8h_ae1bd708c33f57ee6dba4fb0bb546a1dd}{mlx5\_create\_flow\_group}}(acl, flow\_group\_in);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00655}00655         \textcolor{keywordflow}{if} (IS\_ERR\_OR\_NULL(vlan\_grp)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00656}00656                 err = PTR\_ERR(vlan\_grp);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00657}00657                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(dev, \textcolor{stringliteral}{"{}Failed to create E-\/Switch vport[\%d] egress allowed vlans flow group, err(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00658}00658                          \mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>vport, err);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00659}00659                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00660}00660         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00661}00661 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00662}00662         memset(flow\_group\_in, 0, inlen);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00663}00663         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_group\_in, flow\_group\_in, start\_flow\_index, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00664}00664         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_group\_in, flow\_group\_in, end\_flow\_index, 1);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00665}00665         drop\_grp = \mbox{\hyperlink{fs_8h_ae1bd708c33f57ee6dba4fb0bb546a1dd}{mlx5\_create\_flow\_group}}(acl, flow\_group\_in);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00666}00666         \textcolor{keywordflow}{if} (IS\_ERR\_OR\_NULL(drop\_grp)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00667}00667                 err = PTR\_ERR(drop\_grp);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00668}00668                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(dev, \textcolor{stringliteral}{"{}Failed to create E-\/Switch vport[\%d] egress drop flow group, err(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00669}00669                          \mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>vport, err);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00670}00670                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00671}00671         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00672}00672 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00673}00673         \mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>egress.acl = acl;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00674}00674         \mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>egress.drop\_grp = drop\_grp;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00675}00675         \mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>egress.allowed\_vlans\_grp = vlan\_grp;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00676}00676 out:}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00677}00677         kfree(flow\_group\_in);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00678}00678         \textcolor{keywordflow}{if} (err \&\& !IS\_ERR\_OR\_NULL(vlan\_grp))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00679}00679                 \mbox{\hyperlink{fs_8h_a35d5489c13664e3325dd2f3bcd21a88a}{mlx5\_destroy\_flow\_group}}(vlan\_grp);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00680}00680         \textcolor{keywordflow}{if} (err \&\& !IS\_ERR\_OR\_NULL(acl))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00681}00681                 \mbox{\hyperlink{fs_8h_ae0fca9adb99d0de56dd209f5d80ac76f}{mlx5\_destroy\_flow\_table}}(acl);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00682}00682 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00683}00683 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00684}\mbox{\hyperlink{mlx5__eswitch_8c_a5077bbc170ca9a3943c268557c0b30c9}{00684}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_a5077bbc170ca9a3943c268557c0b30c9}{esw\_vport\_cleanup\_egress\_rules}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00685}00685                                            \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *\mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00686}00686 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00687}00687         \textcolor{keywordflow}{if} (!IS\_ERR\_OR\_NULL(\mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>egress.allowed\_vlan))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00688}00688                 \mbox{\hyperlink{fs_8h_a4edebcab04b40addc3bf6e8d9ab83075}{mlx5\_del\_flow\_rule}}(\mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>egress.allowed\_vlan);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00689}00689 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00690}00690         \textcolor{keywordflow}{if} (!IS\_ERR\_OR\_NULL(\mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>egress.drop\_rule))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00691}00691                 \mbox{\hyperlink{fs_8h_a4edebcab04b40addc3bf6e8d9ab83075}{mlx5\_del\_flow\_rule}}(\mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>egress.drop\_rule);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00692}00692 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00693}00693         \mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>egress.allowed\_vlan = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00694}00694         \mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>egress.drop\_rule = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00695}00695 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00696}00696 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00697}\mbox{\hyperlink{mlx5__eswitch_8c_a6e0dbfd8a262baad9a1060a3ec436db0}{00697}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_a6e0dbfd8a262baad9a1060a3ec436db0}{esw\_vport\_disable\_egress\_acl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00698}00698                                          \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *\mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00699}00699 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00700}00700         \textcolor{keywordflow}{if} (IS\_ERR\_OR\_NULL(\mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>egress.acl))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00701}00701                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00702}00702 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00703}00703         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}Destroy vport[\%d] E-\/Switch egress ACL\(\backslash\)n"{}}, \mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>vport);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00704}00704 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00705}00705         \mbox{\hyperlink{mlx5__eswitch_8c_a5077bbc170ca9a3943c268557c0b30c9}{esw\_vport\_cleanup\_egress\_rules}}(esw, \mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00706}00706         \mbox{\hyperlink{fs_8h_a35d5489c13664e3325dd2f3bcd21a88a}{mlx5\_destroy\_flow\_group}}(\mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>egress.allowed\_vlans\_grp);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00707}00707         \mbox{\hyperlink{fs_8h_a35d5489c13664e3325dd2f3bcd21a88a}{mlx5\_destroy\_flow\_group}}(\mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>egress.drop\_grp);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00708}00708         \mbox{\hyperlink{fs_8h_ae0fca9adb99d0de56dd209f5d80ac76f}{mlx5\_destroy\_flow\_table}}(\mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>egress.acl);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00709}00709         \mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>egress.allowed\_vlans\_grp = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00710}00710         \mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>egress.drop\_grp = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00711}00711         \mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}}-\/>egress.acl = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00712}00712 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00713}00713 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00714}\mbox{\hyperlink{mlx5__eswitch_8c_adf679704b0cbcbefdffba93f4b47389c}{00714}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_adf679704b0cbcbefdffba93f4b47389c}{esw\_vport\_enable\_ingress\_acl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00715}00715                                          \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *\mbox{\hyperlink{structmlx5__flow__table_a85f919f1e2d55c0299818bc0e86ba041}{vport}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00716}00716 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00717}00717         \textcolor{keywordtype}{int} inlen = \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(create\_flow\_group\_in);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00718}00718         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev = esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00719}00719         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__namespace}{mlx5\_flow\_namespace}} *root\_ns;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00720}00720         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__table}{mlx5\_flow\_table}} *acl;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00721}00721         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__group}{mlx5\_flow\_group}} *g;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00722}00722         \textcolor{keywordtype}{void} *match\_criteria;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00723}00723         \textcolor{keywordtype}{char} table\_name[32];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00724}00724         u32 *flow\_group\_in;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00725}00725         \textcolor{keywordtype}{int} table\_size = 1;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00726}00726         \textcolor{keywordtype}{int} err = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00727}00727 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00728}00728         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{device_8h_aa4f0fb814aaa37f7a2759d50dc649674}{MLX5\_CAP\_ESW\_INGRESS\_ACL}}(dev, ft\_support))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00729}00729                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00730}00730 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00731}00731         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(dev, \textcolor{stringliteral}{"{}Create vport[\%d] ingress ACL log\_max\_size(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00732}00732                   vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, \mbox{\hyperlink{device_8h_aa4f0fb814aaa37f7a2759d50dc649674}{MLX5\_CAP\_ESW\_INGRESS\_ACL}}(dev, log\_max\_ft\_size));}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00733}00733 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00734}00734         root\_ns = \mbox{\hyperlink{fs_8h_a30d2c82fd713ed1d26a9ad835f1ed21f}{mlx5\_get\_flow\_namespace}}(dev, \mbox{\hyperlink{fs_8h_ab4cc9ec86ed186a2bb03cf5bc1600e1ea7361fb24a847aba50aa84967f507220c}{MLX5\_FLOW\_NAMESPACE\_ESW\_INGRESS}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00735}00735         \textcolor{keywordflow}{if} (!root\_ns) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00736}00736                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(dev, \textcolor{stringliteral}{"{}Failed to get E-\/Switch ingress flow namespace\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00737}00737                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00738}00738         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00739}00739 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00740}00740         flow\_group\_in = \mbox{\hyperlink{driver_8h_af928b1985830513c1c81b095b31ad8a7}{mlx5\_vzalloc}}(inlen);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00741}00741         \textcolor{keywordflow}{if} (!flow\_group\_in)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00742}00742                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00743}00743 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00744}00744         snprintf(table\_name, 32, \textcolor{stringliteral}{"{}ingress\_\%d"{}}, vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00745}00745         acl = \mbox{\hyperlink{fs_8h_af90b9ad565435525b3f699b9a0a189fc}{mlx5\_create\_vport\_flow\_table}}(root\_ns, vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, 0, table\_name, table\_size);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00746}00746         \textcolor{keywordflow}{if} (IS\_ERR\_OR\_NULL(acl)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00747}00747                 err = PTR\_ERR(acl);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00748}00748                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(dev, \textcolor{stringliteral}{"{}Failed to create E-\/Switch vport[\%d] ingress flow Table, err(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00749}00749                          vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, err);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00750}00750                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00751}00751         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00752}00752 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00753}00753         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_group\_in, flow\_group\_in, match\_criteria\_enable, \mbox{\hyperlink{device_8h_a900dca9b26de42491763226e12dcd47bae7403af68298370ee07f0907fba731f4}{MLX5\_MATCH\_OUTER\_HEADERS}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00754}00754         match\_criteria = \mbox{\hyperlink{device_8h_ad5cad9c2e464873013bfb7b9761d25a1}{MLX5\_ADDR\_OF}}(create\_flow\_group\_in, flow\_group\_in, match\_criteria);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00755}00755         \mbox{\hyperlink{device_8h_a5771abbaf67aa376010ef29922b9a0d2}{MLX5\_SET\_TO\_ONES}}(fte\_match\_param, match\_criteria, outer\_headers.cvlan\_tag);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00756}00756         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_group\_in, flow\_group\_in, start\_flow\_index, 0);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00757}00757         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(create\_flow\_group\_in, flow\_group\_in, end\_flow\_index, 0);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00758}00758 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00759}00759         g = \mbox{\hyperlink{fs_8h_ae1bd708c33f57ee6dba4fb0bb546a1dd}{mlx5\_create\_flow\_group}}(acl, flow\_group\_in);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00760}00760         \textcolor{keywordflow}{if} (IS\_ERR\_OR\_NULL(g)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00761}00761                 err = PTR\_ERR(g);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00762}00762                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(dev, \textcolor{stringliteral}{"{}Failed to create E-\/Switch vport[\%d] ingress flow group, err(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00763}00763                          vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, err);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00764}00764                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00765}00765         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00766}00766 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00767}00767         vport-\/>\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}}.\mbox{\hyperlink{structvport__ingress_a665c3d8d13ae0c97ee12f5a751fbe1df}{acl}} = acl;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00768}00768         vport-\/>\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}}.\mbox{\hyperlink{structvport__ingress_aa457e75d659a2b8092496769ea605cb7}{drop\_grp}} = g;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00769}00769 out:}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00770}00770         kfree(flow\_group\_in);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00771}00771         \textcolor{keywordflow}{if} (err \&\& !IS\_ERR\_OR\_NULL(acl))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00772}00772                 \mbox{\hyperlink{fs_8h_ae0fca9adb99d0de56dd209f5d80ac76f}{mlx5\_destroy\_flow\_table}}(acl);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00773}00773 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00774}00774 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00775}\mbox{\hyperlink{mlx5__eswitch_8c_a028581c1e18808df7720b2d6ce42a385}{00775}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_a028581c1e18808df7720b2d6ce42a385}{esw\_vport\_cleanup\_ingress\_rules}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00776}00776                                             \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *vport)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00777}00777 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00778}00778         \textcolor{keywordflow}{if} (!IS\_ERR\_OR\_NULL(vport-\/>\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}}.\mbox{\hyperlink{structvport__ingress_a3846f3d40d2214fbb7ba1bab2dc3b8fe}{drop\_rule}}))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00779}00779                 \mbox{\hyperlink{fs_8h_a4edebcab04b40addc3bf6e8d9ab83075}{mlx5\_del\_flow\_rule}}(vport-\/>\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}}.\mbox{\hyperlink{structvport__ingress_a3846f3d40d2214fbb7ba1bab2dc3b8fe}{drop\_rule}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00780}00780         vport-\/>\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}}.\mbox{\hyperlink{structvport__ingress_a3846f3d40d2214fbb7ba1bab2dc3b8fe}{drop\_rule}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00781}00781 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00782}00782 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00783}\mbox{\hyperlink{mlx5__eswitch_8c_a365b3335adc049045fab6332003d0f0c}{00783}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_a365b3335adc049045fab6332003d0f0c}{esw\_vport\_disable\_ingress\_acl}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00784}00784                                           \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *vport)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00785}00785 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00786}00786         \textcolor{keywordflow}{if} (IS\_ERR\_OR\_NULL(vport-\/>\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}}.\mbox{\hyperlink{structvport__ingress_a665c3d8d13ae0c97ee12f5a751fbe1df}{acl}}))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00787}00787                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00788}00788 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00789}00789         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}Destroy vport[\%d] E-\/Switch ingress ACL\(\backslash\)n"{}}, vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00790}00790 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00791}00791         \mbox{\hyperlink{mlx5__eswitch_8c_a028581c1e18808df7720b2d6ce42a385}{esw\_vport\_cleanup\_ingress\_rules}}(esw, vport);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00792}00792         \mbox{\hyperlink{fs_8h_a35d5489c13664e3325dd2f3bcd21a88a}{mlx5\_destroy\_flow\_group}}(vport-\/>\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}}.\mbox{\hyperlink{structvport__ingress_aa457e75d659a2b8092496769ea605cb7}{drop\_grp}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00793}00793         \mbox{\hyperlink{fs_8h_ae0fca9adb99d0de56dd209f5d80ac76f}{mlx5\_destroy\_flow\_table}}(vport-\/>\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}}.\mbox{\hyperlink{structvport__ingress_a665c3d8d13ae0c97ee12f5a751fbe1df}{acl}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00794}00794         vport-\/>\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}}.\mbox{\hyperlink{structvport__ingress_a665c3d8d13ae0c97ee12f5a751fbe1df}{acl}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00795}00795         vport-\/>\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}}.\mbox{\hyperlink{structvport__ingress_aa457e75d659a2b8092496769ea605cb7}{drop\_grp}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00796}00796 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00797}00797 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00798}\mbox{\hyperlink{mlx5__eswitch_8c_ab2f015800849c93e4bd6dba14dd3853e}{00798}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_ab2f015800849c93e4bd6dba14dd3853e}{esw\_vport\_ingress\_config}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00799}00799                                     \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *vport)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00800}00800 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00801}00801         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__destination}{mlx5\_flow\_destination}} dest;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00802}00802         u32 *match\_v;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00803}00803         u32 *match\_c;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00804}00804         \textcolor{keywordtype}{int} err = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00805}00805 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00806}00806         \textcolor{keywordflow}{if} (IS\_ERR\_OR\_NULL(vport-\/>\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}}.\mbox{\hyperlink{structvport__ingress_a665c3d8d13ae0c97ee12f5a751fbe1df}{acl}})) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00807}00807                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00808}00808                          \textcolor{stringliteral}{"{}vport[\%d] configure ingress rules failed, ingress acl is not initialized!\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00809}00809                          vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00810}00810                 \textcolor{keywordflow}{return} -\/EPERM;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00811}00811         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00812}00812 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00813}00813         \mbox{\hyperlink{mlx5__eswitch_8c_a028581c1e18808df7720b2d6ce42a385}{esw\_vport\_cleanup\_ingress\_rules}}(esw, vport);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00814}00814 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00815}00815         \textcolor{keywordflow}{if} (!vport-\/>\mbox{\hyperlink{structmlx5__vport_afb1f84fbfd5df5334e3347700e7b1725}{vlan}} \&\& !vport-\/>\mbox{\hyperlink{structmlx5__vport_abe3537f1f1aeafe43c4d25aea57d6836}{qos}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00816}00816                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00817}00817 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00818}00818         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00819}00819                   \textcolor{stringliteral}{"{}vport[\%d] configure ingress rules, vlan(\%d) qos(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00820}00820                   vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, vport-\/>\mbox{\hyperlink{structmlx5__vport_afb1f84fbfd5df5334e3347700e7b1725}{vlan}}, vport-\/>\mbox{\hyperlink{structmlx5__vport_abe3537f1f1aeafe43c4d25aea57d6836}{qos}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00821}00821 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00822}00822         match\_v = kzalloc(\mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(fte\_match\_param), GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00823}00823         match\_c = kzalloc(\mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(fte\_match\_param), GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00824}00824         \textcolor{keywordflow}{if} (!match\_v || !match\_c) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00825}00825                 err = -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00826}00826                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}vport[\%d] configure ingress rules failed, err(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00827}00827                          vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, err);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00828}00828                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00829}00829         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00830}00830         \mbox{\hyperlink{device_8h_a5771abbaf67aa376010ef29922b9a0d2}{MLX5\_SET\_TO\_ONES}}(fte\_match\_param, match\_c, outer\_headers.cvlan\_tag);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00831}00831         \mbox{\hyperlink{device_8h_a5771abbaf67aa376010ef29922b9a0d2}{MLX5\_SET\_TO\_ONES}}(fte\_match\_param, match\_v, outer\_headers.cvlan\_tag);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00832}00832 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00833}00833         dest.\mbox{\hyperlink{structmlx5__flow__destination_a4421d4147c8e909299b6e406a09e3805}{type}} = \mbox{\hyperlink{mlx5__ifc_8h_a16db4876b192da08f3ad0cb41afe516fa21c87a01c892682b0e1e0287221daa7b}{MLX5\_FLOW\_CONTEXT\_DEST\_TYPE\_VPORT}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00834}00834         dest.\mbox{\hyperlink{structmlx5__flow__destination_ac20ef7f18d4d4ee93ff71cff4cc05f98}{vport\_num}} = vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00835}00835 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00836}00836         vport-\/>\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}}.\mbox{\hyperlink{structvport__ingress_a3846f3d40d2214fbb7ba1bab2dc3b8fe}{drop\_rule}} =}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00837}00837                 \mbox{\hyperlink{fs_8h_a307738b93480306a8165f97ff64ce458}{mlx5\_add\_flow\_rule}}(vport-\/>\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}}.\mbox{\hyperlink{structvport__ingress_a665c3d8d13ae0c97ee12f5a751fbe1df}{acl}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00838}00838                                    \mbox{\hyperlink{device_8h_a900dca9b26de42491763226e12dcd47bae7403af68298370ee07f0907fba731f4}{MLX5\_MATCH\_OUTER\_HEADERS}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00839}00839                                    match\_c,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00840}00840                                    match\_v,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00841}00841                                    \mbox{\hyperlink{mlx5__ifc_8h_aa7477aaaec7caec07471eb609c556f5fae819d5ab6d0cd0421b4e411d96e72dde}{MLX5\_FLOW\_CONTEXT\_ACTION\_DROP}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00842}00842                                    0, \&dest);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00843}00843         \textcolor{keywordflow}{if} (IS\_ERR\_OR\_NULL(vport-\/>\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}}.\mbox{\hyperlink{structvport__ingress_a3846f3d40d2214fbb7ba1bab2dc3b8fe}{drop\_rule}})) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00844}00844                 err = PTR\_ERR(vport-\/>\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}}.\mbox{\hyperlink{structvport__ingress_a3846f3d40d2214fbb7ba1bab2dc3b8fe}{drop\_rule}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00845}00845                 printf(\textcolor{stringliteral}{"{}mlx5\_core: WARN: "{}}\textcolor{stringliteral}{"{}vport[\%d] configure ingress rules, err(\%d)\(\backslash\)n"{}}, vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, err);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00846}00846                 vport-\/>\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}}.\mbox{\hyperlink{structvport__ingress_a3846f3d40d2214fbb7ba1bab2dc3b8fe}{drop\_rule}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00847}00847         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00848}00848 out:}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00849}00849         kfree(match\_v);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00850}00850         kfree(match\_c);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00851}00851         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00852}00852 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00853}00853 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00854}\mbox{\hyperlink{mlx5__eswitch_8c_a4874362513a57189fe44a63d45a8a2c9}{00854}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_a4874362513a57189fe44a63d45a8a2c9}{esw\_vport\_egress\_config}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00855}00855                                    \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *vport)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00856}00856 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00857}00857         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__destination}{mlx5\_flow\_destination}} dest;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00858}00858         u32 *match\_v;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00859}00859         u32 *match\_c;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00860}00860         \textcolor{keywordtype}{int} err = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00861}00861 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00862}00862         \textcolor{keywordflow}{if} (IS\_ERR\_OR\_NULL(vport-\/>\mbox{\hyperlink{structmlx5__vport_a7f74ec472dcdfc2251fd5bef7438fd07}{egress}}.\mbox{\hyperlink{structvport__egress_a23836ee534845e842d0e9c85b5b87c15}{acl}})) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00863}00863                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}vport[\%d] configure rgress rules failed, egress acl is not initialized!\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00864}00864                          vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00865}00865                 \textcolor{keywordflow}{return} -\/EPERM;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00866}00866         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00867}00867 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00868}00868         \mbox{\hyperlink{mlx5__eswitch_8c_a5077bbc170ca9a3943c268557c0b30c9}{esw\_vport\_cleanup\_egress\_rules}}(esw, vport);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00869}00869 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00870}00870         \textcolor{keywordflow}{if} (!vport-\/>\mbox{\hyperlink{structmlx5__vport_afb1f84fbfd5df5334e3347700e7b1725}{vlan}} \&\& !vport-\/>\mbox{\hyperlink{structmlx5__vport_abe3537f1f1aeafe43c4d25aea57d6836}{qos}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00871}00871                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00872}00872 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00873}00873         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00874}00874                   \textcolor{stringliteral}{"{}vport[\%d] configure egress rules, vlan(\%d) qos(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00875}00875                   vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, vport-\/>\mbox{\hyperlink{structmlx5__vport_afb1f84fbfd5df5334e3347700e7b1725}{vlan}}, vport-\/>\mbox{\hyperlink{structmlx5__vport_abe3537f1f1aeafe43c4d25aea57d6836}{qos}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00876}00876 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00877}00877         match\_v = kzalloc(\mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(fte\_match\_param), GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00878}00878         match\_c = kzalloc(\mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(fte\_match\_param), GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00879}00879         \textcolor{keywordflow}{if} (!match\_v || !match\_c) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00880}00880                 err = -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00881}00881                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}vport[\%d] configure egress rules failed, err(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00882}00882                          vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, err);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00883}00883                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00884}00884         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00885}00885 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00886}00886         \textcolor{comment}{/* Allowed vlan rule */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00887}00887         \mbox{\hyperlink{device_8h_a5771abbaf67aa376010ef29922b9a0d2}{MLX5\_SET\_TO\_ONES}}(fte\_match\_param, match\_c, outer\_headers.cvlan\_tag);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00888}00888         \mbox{\hyperlink{device_8h_a5771abbaf67aa376010ef29922b9a0d2}{MLX5\_SET\_TO\_ONES}}(fte\_match\_param, match\_v, outer\_headers.cvlan\_tag);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00889}00889         \mbox{\hyperlink{device_8h_a5771abbaf67aa376010ef29922b9a0d2}{MLX5\_SET\_TO\_ONES}}(fte\_match\_param, match\_c, outer\_headers.first\_vid);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00890}00890         \mbox{\hyperlink{device_8h_a78623a3e69c7911bd715d06c32daa626}{MLX5\_SET}}(fte\_match\_param, match\_v, outer\_headers.first\_vid, vport-\/>\mbox{\hyperlink{structmlx5__vport_afb1f84fbfd5df5334e3347700e7b1725}{vlan}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00891}00891 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00892}00892         dest.\mbox{\hyperlink{structmlx5__flow__destination_a4421d4147c8e909299b6e406a09e3805}{type}} = \mbox{\hyperlink{mlx5__ifc_8h_a16db4876b192da08f3ad0cb41afe516fa21c87a01c892682b0e1e0287221daa7b}{MLX5\_FLOW\_CONTEXT\_DEST\_TYPE\_VPORT}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00893}00893         dest.\mbox{\hyperlink{structmlx5__flow__destination_ac20ef7f18d4d4ee93ff71cff4cc05f98}{vport\_num}} = vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00894}00894 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00895}00895         vport-\/>\mbox{\hyperlink{structmlx5__vport_a7f74ec472dcdfc2251fd5bef7438fd07}{egress}}.\mbox{\hyperlink{structvport__egress_a5d455ef4d582582808a513d9ebe5e61b}{allowed\_vlan}} =}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00896}00896                 \mbox{\hyperlink{fs_8h_a307738b93480306a8165f97ff64ce458}{mlx5\_add\_flow\_rule}}(vport-\/>\mbox{\hyperlink{structmlx5__vport_a7f74ec472dcdfc2251fd5bef7438fd07}{egress}}.\mbox{\hyperlink{structvport__egress_a23836ee534845e842d0e9c85b5b87c15}{acl}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00897}00897                                    \mbox{\hyperlink{device_8h_a900dca9b26de42491763226e12dcd47bae7403af68298370ee07f0907fba731f4}{MLX5\_MATCH\_OUTER\_HEADERS}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00898}00898                                    match\_c,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00899}00899                                    match\_v,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00900}00900                                    \mbox{\hyperlink{mlx5__ifc_8h_aa7477aaaec7caec07471eb609c556f5fa59655f808b7a9e3dd57273a102e065fb}{MLX5\_FLOW\_CONTEXT\_ACTION\_ALLOW}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00901}00901                                    0, \&dest);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00902}00902         \textcolor{keywordflow}{if} (IS\_ERR\_OR\_NULL(vport-\/>\mbox{\hyperlink{structmlx5__vport_a7f74ec472dcdfc2251fd5bef7438fd07}{egress}}.\mbox{\hyperlink{structvport__egress_a5d455ef4d582582808a513d9ebe5e61b}{allowed\_vlan}})) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00903}00903                 err = PTR\_ERR(vport-\/>\mbox{\hyperlink{structmlx5__vport_a7f74ec472dcdfc2251fd5bef7438fd07}{egress}}.\mbox{\hyperlink{structvport__egress_a5d455ef4d582582808a513d9ebe5e61b}{allowed\_vlan}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00904}00904                 printf(\textcolor{stringliteral}{"{}mlx5\_core: WARN: "{}}\textcolor{stringliteral}{"{}vport[\%d] configure egress allowed vlan rule failed, err(\%d)\(\backslash\)n"{}}, vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, err);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00905}00905                 vport-\/>\mbox{\hyperlink{structmlx5__vport_a7f74ec472dcdfc2251fd5bef7438fd07}{egress}}.\mbox{\hyperlink{structvport__egress_a5d455ef4d582582808a513d9ebe5e61b}{allowed\_vlan}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00906}00906                 \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00907}00907         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00908}00908 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00909}00909         \textcolor{comment}{/* Drop others rule (star rule) */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00910}00910         memset(match\_c, 0, \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(fte\_match\_param));}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00911}00911         memset(match\_v, 0, \mbox{\hyperlink{device_8h_a459f4e51a5d10dfb6fed7cafff215cb4}{MLX5\_ST\_SZ\_BYTES}}(fte\_match\_param));}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00912}00912         vport-\/>\mbox{\hyperlink{structmlx5__vport_a7f74ec472dcdfc2251fd5bef7438fd07}{egress}}.\mbox{\hyperlink{structvport__egress_a16d5de626478f72c152d2f6fc672d300}{drop\_rule}} =}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00913}00913                 \mbox{\hyperlink{fs_8h_a307738b93480306a8165f97ff64ce458}{mlx5\_add\_flow\_rule}}(vport-\/>\mbox{\hyperlink{structmlx5__vport_a7f74ec472dcdfc2251fd5bef7438fd07}{egress}}.\mbox{\hyperlink{structvport__egress_a23836ee534845e842d0e9c85b5b87c15}{acl}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00914}00914                                    0,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00915}00915                                    match\_c,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00916}00916                                    match\_v,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00917}00917                                    \mbox{\hyperlink{mlx5__ifc_8h_aa7477aaaec7caec07471eb609c556f5fae819d5ab6d0cd0421b4e411d96e72dde}{MLX5\_FLOW\_CONTEXT\_ACTION\_DROP}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00918}00918                                    0, \&dest);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00919}00919         \textcolor{keywordflow}{if} (IS\_ERR\_OR\_NULL(vport-\/>\mbox{\hyperlink{structmlx5__vport_a7f74ec472dcdfc2251fd5bef7438fd07}{egress}}.\mbox{\hyperlink{structvport__egress_a16d5de626478f72c152d2f6fc672d300}{drop\_rule}})) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00920}00920                 err = PTR\_ERR(vport-\/>\mbox{\hyperlink{structmlx5__vport_a7f74ec472dcdfc2251fd5bef7438fd07}{egress}}.\mbox{\hyperlink{structvport__egress_a16d5de626478f72c152d2f6fc672d300}{drop\_rule}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00921}00921                 printf(\textcolor{stringliteral}{"{}mlx5\_core: WARN: "{}}\textcolor{stringliteral}{"{}vport[\%d] configure egress drop rule failed, err(\%d)\(\backslash\)n"{}}, vport-\/>\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, err);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00922}00922                 vport-\/>\mbox{\hyperlink{structmlx5__vport_a7f74ec472dcdfc2251fd5bef7438fd07}{egress}}.\mbox{\hyperlink{structvport__egress_a16d5de626478f72c152d2f6fc672d300}{drop\_rule}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00923}00923         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00924}00924 out:}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00925}00925         kfree(match\_v);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00926}00926         kfree(match\_c);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00927}00927         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00928}00928 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00929}00929 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00930}\mbox{\hyperlink{mlx5__eswitch_8c_ad80010e3db9717c7eb74630b41bf014c}{00930}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_ad80010e3db9717c7eb74630b41bf014c}{esw\_enable\_vport}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw, \textcolor{keywordtype}{int} \mbox{\hyperlink{structmlx5__flow__destination_ac20ef7f18d4d4ee93ff71cff4cc05f98}{vport\_num}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00931}00931                              \textcolor{keywordtype}{int} enable\_events)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00932}00932 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00933}00933         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}} = \&esw-\/>\mbox{\hyperlink{structmlx5__eswitch_af4a141b9b40d78d4190290f1f3296b33}{vports}}[vport\_num];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00934}00934         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} flags;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00935}00935 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00936}00936         mutex\_lock(\&\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>state\_lock);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00937}00937         WARN\_ON(\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>enabled);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00938}00938 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00939}00939         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}Enabling VPORT(\%d)\(\backslash\)n"{}}, vport\_num);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00940}00940 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00941}00941         \textcolor{keywordflow}{if} (vport\_num) \{ \textcolor{comment}{/* Only VFs need ACLs for VST and spoofchk filtering */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00942}00942                 \mbox{\hyperlink{mlx5__eswitch_8c_adf679704b0cbcbefdffba93f4b47389c}{esw\_vport\_enable\_ingress\_acl}}(esw, \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00943}00943                 \mbox{\hyperlink{mlx5__eswitch_8c_a6c85f6f020f5f3d857c899779613255c}{esw\_vport\_enable\_egress\_acl}}(esw, \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00944}00944                 \mbox{\hyperlink{mlx5__eswitch_8c_ab2f015800849c93e4bd6dba14dd3853e}{esw\_vport\_ingress\_config}}(esw, \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00945}00945                 \mbox{\hyperlink{mlx5__eswitch_8c_a4874362513a57189fe44a63d45a8a2c9}{esw\_vport\_egress\_config}}(esw, \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00946}00946         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00947}00947 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00948}00948         \mbox{\hyperlink{mlx5__vport_8c_ae0e1f1cc2cf2a741f596d1c5c215a924}{mlx5\_modify\_vport\_admin\_state}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00949}00949                                       \mbox{\hyperlink{mlx5__ifc_8h_a18efc29f05f292310db38a8c7e81dcdaa39d4f955e3de4598cd70fc7a779f19e6}{MLX5\_QUERY\_VPORT\_STATE\_IN\_OP\_MOD\_ESW\_VPORT}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00950}00950                                       vport\_num,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00951}00951                                       \mbox{\hyperlink{device_8h_a56a0f36da7f9eaaf54bd05cc2bf49173ace576a5754ef6a8e52f712fefd96f91b}{MLX5\_ESW\_VPORT\_ADMIN\_STATE\_AUTO}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00952}00952 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00953}00953         \textcolor{comment}{/* Sync with current vport context */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00954}00954         \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>enabled\_events = enable\_events;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00955}00955         \mbox{\hyperlink{mlx5__eswitch_8c_aaf7df8a88dccd946f5cba17e80854274}{esw\_vport\_change\_handler}}(\&\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>vport\_change\_handler);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00956}00956 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00957}00957         spin\_lock\_irqsave(\&\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00958}00958         \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>enabled = \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00959}00959         spin\_unlock\_irqrestore(\&\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00960}00960 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00961}00961         \mbox{\hyperlink{mlx5__eswitch_8c_a51585bd30922f59cdd625d5f02a93a2c}{arm\_vport\_context\_events\_cmd}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, vport\_num, enable\_events);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00962}00962 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00963}00963         esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a474ccc3613e368863ef976a86cb3d1c9}{enabled\_vports}}++;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00964}00964         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}Enabled VPORT(\%d)\(\backslash\)n"{}}, vport\_num);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00965}00965         mutex\_unlock(\&\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>state\_lock);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00966}00966 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00967}00967 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00968}\mbox{\hyperlink{mlx5__eswitch_8c_af9e3f12364c6bc233b5b2c2727464770}{00968}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_af9e3f12364c6bc233b5b2c2727464770}{esw\_cleanup\_vport}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw, u16 vport\_num)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00969}00969 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00970}00970         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}} = \&esw-\/>\mbox{\hyperlink{structmlx5__eswitch_af4a141b9b40d78d4190290f1f3296b33}{vports}}[vport\_num];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00971}00971         \textcolor{keyword}{struct }\mbox{\hyperlink{structl2addr__node}{l2addr\_node}} *node;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00972}00972         \textcolor{keyword}{struct }\mbox{\hyperlink{structvport__addr}{vport\_addr}} *addr;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00973}00973         \textcolor{keyword}{struct }hlist\_node *tmp;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00974}00974         \textcolor{keywordtype}{int} hi;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00975}00975 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00976}00976         \mbox{\hyperlink{eswitch_8h_aee9a7eba31456cfd476acf7a8aee56cb}{for\_each\_l2hash\_node}}(node, tmp, vport-\/>\mbox{\hyperlink{structmlx5__vport_aa41215bf4ca4d3734d41626bc06fea7f}{uc\_list}}, hi) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00977}00977                 addr = container\_of(node, \textcolor{keyword}{struct} \mbox{\hyperlink{structvport__addr}{vport\_addr}}, node);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00978}00978                 addr-\/>\mbox{\hyperlink{structvport__addr_a30ed10cbc3e6fc254fc575c1d2c95984}{action}} = \mbox{\hyperlink{mlx5__eswitch_8c_a0ac0b7994a7d738aa77d2c1cfe8d6d13a1e7cebc427f4d4396cd195ddef3fa7e5}{MLX5\_ACTION\_DEL}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00979}00979         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00980}00980         \mbox{\hyperlink{mlx5__eswitch_8c_a83af036abe5e54621d4b797e6f97e6cf}{esw\_apply\_vport\_addr\_list}}(esw, vport\_num, \mbox{\hyperlink{device_8h_aaeffb3e9673a6ec1ceffbec7699c0ce1a36a014e5d252225bb9259b1fdce6e820}{MLX5\_NIC\_VPORT\_LIST\_TYPE\_UC}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00981}00981 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00982}00982         \mbox{\hyperlink{eswitch_8h_aee9a7eba31456cfd476acf7a8aee56cb}{for\_each\_l2hash\_node}}(node, tmp, vport-\/>\mbox{\hyperlink{structmlx5__vport_a7e0f973583874bf1027e5c0a2f535f2b}{mc\_list}}, hi) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00983}00983                 addr = container\_of(node, \textcolor{keyword}{struct} \mbox{\hyperlink{structvport__addr}{vport\_addr}}, node);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00984}00984                 addr-\/>\mbox{\hyperlink{structvport__addr_a30ed10cbc3e6fc254fc575c1d2c95984}{action}} = \mbox{\hyperlink{mlx5__eswitch_8c_a0ac0b7994a7d738aa77d2c1cfe8d6d13a1e7cebc427f4d4396cd195ddef3fa7e5}{MLX5\_ACTION\_DEL}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00985}00985         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00986}00986         \mbox{\hyperlink{mlx5__eswitch_8c_a83af036abe5e54621d4b797e6f97e6cf}{esw\_apply\_vport\_addr\_list}}(esw, vport\_num, \mbox{\hyperlink{device_8h_aaeffb3e9673a6ec1ceffbec7699c0ce1ab9ba0bd9acf21b6ca979fcb37363319a}{MLX5\_NIC\_VPORT\_LIST\_TYPE\_MC}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00987}00987 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00988}00988 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00989}\mbox{\hyperlink{mlx5__eswitch_8c_a76fb5605cb8096bb2ddc6a8c810240a7}{00989}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_a76fb5605cb8096bb2ddc6a8c810240a7}{esw\_disable\_vport}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw, \textcolor{keywordtype}{int} vport\_num)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00990}00990 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00991}00991         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}} = \&esw-\/>\mbox{\hyperlink{structmlx5__eswitch_af4a141b9b40d78d4190290f1f3296b33}{vports}}[vport\_num];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00992}00992         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} flags;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00993}00993 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00994}00994         mutex\_lock(\&\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>state\_lock);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00995}00995         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>enabled) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00996}00996                 mutex\_unlock(\&\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>state\_lock);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00997}00997                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00998}00998         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l00999}00999 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01000}01000         \mbox{\hyperlink{mlx5__eswitch_8c_a78af9ca408e12050718d0c0bc2380dd9}{esw\_debug}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}Disabling vport(\%d)\(\backslash\)n"{}}, vport\_num);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01001}01001         \textcolor{comment}{/* Mark this vport as disabled to discard new events */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01002}01002         spin\_lock\_irqsave(\&\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01003}01003         \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>enabled = \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01004}01004         \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>enabled\_events = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01005}01005         spin\_unlock\_irqrestore(\&\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>lock, flags);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01006}01006 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01007}01007         \mbox{\hyperlink{mlx5__vport_8c_ae0e1f1cc2cf2a741f596d1c5c215a924}{mlx5\_modify\_vport\_admin\_state}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01008}01008                                       \mbox{\hyperlink{mlx5__ifc_8h_a18efc29f05f292310db38a8c7e81dcdaa39d4f955e3de4598cd70fc7a779f19e6}{MLX5\_QUERY\_VPORT\_STATE\_IN\_OP\_MOD\_ESW\_VPORT}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01009}01009                                       vport\_num,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01010}01010                                       \mbox{\hyperlink{device_8h_a56a0f36da7f9eaaf54bd05cc2bf49173a349621079cceeffed8c0fa215622ba70}{MLX5\_ESW\_VPORT\_ADMIN\_STATE\_DOWN}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01011}01011         \textcolor{comment}{/* Wait for current already scheduled events to complete */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01012}01012         flush\_workqueue(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_ac3a13399dcda24290f6da1ef46a40e1f}{work\_queue}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01013}01013         \textcolor{comment}{/* Disable events from this vport */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01014}01014         \mbox{\hyperlink{mlx5__eswitch_8c_a51585bd30922f59cdd625d5f02a93a2c}{arm\_vport\_context\_events\_cmd}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>vport, 0);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01015}01015         \textcolor{comment}{/* We don't assume VFs will cleanup after themselves */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01016}01016         \mbox{\hyperlink{mlx5__eswitch_8c_af9e3f12364c6bc233b5b2c2727464770}{esw\_cleanup\_vport}}(esw, vport\_num);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01017}01017         \textcolor{keywordflow}{if} (vport\_num) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01018}01018                 \mbox{\hyperlink{mlx5__eswitch_8c_a6e0dbfd8a262baad9a1060a3ec436db0}{esw\_vport\_disable\_egress\_acl}}(esw, \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01019}01019                 \mbox{\hyperlink{mlx5__eswitch_8c_a365b3335adc049045fab6332003d0f0c}{esw\_vport\_disable\_ingress\_acl}}(esw, \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01020}01020         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01021}01021         esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a474ccc3613e368863ef976a86cb3d1c9}{enabled\_vports}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01022}01022         mutex\_unlock(\&\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>state\_lock);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01023}01023 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01024}01024 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01025}01025 \textcolor{comment}{/* Public E-\/Switch API */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01026}\mbox{\hyperlink{eswitch_8h_adae5b7b4f78a67ff26d2a4eac47d92a5}{01026}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_adae5b7b4f78a67ff26d2a4eac47d92a5}{mlx5\_eswitch\_enable\_sriov}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw, \textcolor{keywordtype}{int} nvfs)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01027}01027 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01028}01028         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01029}01029         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01030}01030 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01031}01031         \textcolor{keywordflow}{if} (!esw || !\mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, vport\_group\_manager) ||}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01032}01032             \mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, port\_type) != \mbox{\hyperlink{device_8h_a531c35e38ede3ea4e5ba5afb24b29493a6ace91bc7da0325275aa0cfa2ba31674}{MLX5\_CAP\_PORT\_TYPE\_ETH}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01033}01033                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01034}01034 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01035}01035         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, eswitch\_flow\_table) ||}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01036}01036             !\mbox{\hyperlink{device_8h_a6e37da781ceec3566e91da917759e3f4}{MLX5\_CAP\_ESW\_FLOWTABLE\_FDB}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, ft\_support)) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01037}01037                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}E-\/Switch FDB is not supported, aborting ...\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01038}01038                 \textcolor{keywordflow}{return} -\/ENOTSUPP;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01039}01039         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01040}01040 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01041}01041         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{device_8h_aa4f0fb814aaa37f7a2759d50dc649674}{MLX5\_CAP\_ESW\_INGRESS\_ACL}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, ft\_support))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01042}01042                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}E-\/Switch ingress ACL is not supported by FW\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01043}01043 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01044}01044         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{device_8h_acd6de5e1bc1ca6583a13b7bbc12bec64}{MLX5\_CAP\_ESW\_EGRESS\_ACL}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, ft\_support))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01045}01045                 \mbox{\hyperlink{mlx5__eswitch_8c_acc834b936857dfba1309acd69e18de46}{esw\_warn}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}E-\/Switch engress ACL is not supported by FW\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01046}01046 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01047}01047         \mbox{\hyperlink{mlx5__eswitch_8c_ac1a10c6a7056526fb00a023782298744}{esw\_info}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}E-\/Switch enable SRIOV: nvfs(\%d)\(\backslash\)n"{}}, nvfs);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01048}01048 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01049}01049         \mbox{\hyperlink{mlx5__eswitch_8c_a76fb5605cb8096bb2ddc6a8c810240a7}{esw\_disable\_vport}}(esw, 0);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01050}01050 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01051}01051         err = \mbox{\hyperlink{mlx5__eswitch_8c_ad7b0e375092505f3d83d8e3f88026abc}{esw\_create\_fdb\_table}}(esw);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01052}01052         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01053}01053                 \textcolor{keywordflow}{goto} abort;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01054}01054 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01055}01055         \textcolor{keywordflow}{for} (i = 0; i <= nvfs; i++)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01056}01056                 \mbox{\hyperlink{mlx5__eswitch_8c_ad80010e3db9717c7eb74630b41bf014c}{esw\_enable\_vport}}(esw, i, \mbox{\hyperlink{mlx5__eswitch_8c_a89baea4a43b34e7207ed44dc13cdd9af}{SRIOV\_VPORT\_EVENTS}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01057}01057 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01058}01058         \mbox{\hyperlink{mlx5__eswitch_8c_ac1a10c6a7056526fb00a023782298744}{esw\_info}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}SRIOV enabled: active vports(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01059}01059                  esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a474ccc3613e368863ef976a86cb3d1c9}{enabled\_vports}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01060}01060         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01061}01061 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01062}01062 abort:}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01063}01063         \mbox{\hyperlink{mlx5__eswitch_8c_ad80010e3db9717c7eb74630b41bf014c}{esw\_enable\_vport}}(esw, 0, \mbox{\hyperlink{mlx5__eswitch_8c_a5bea799269f02f5b3395d6b2c068b618a9612352a68fc92e5d6333b8cf603abbe}{UC\_ADDR\_CHANGE}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01064}01064         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01065}01065 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01066}01066 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01067}\mbox{\hyperlink{eswitch_8h_a3f620248bb6a102997a1566b0d34f3b0}{01067}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_a3f620248bb6a102997a1566b0d34f3b0}{mlx5\_eswitch\_disable\_sriov}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01068}01068 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01069}01069         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01070}01070 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01071}01071         \textcolor{keywordflow}{if} (!esw || !\mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, vport\_group\_manager) ||}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01072}01072             \mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, port\_type) != \mbox{\hyperlink{device_8h_a531c35e38ede3ea4e5ba5afb24b29493a6ace91bc7da0325275aa0cfa2ba31674}{MLX5\_CAP\_PORT\_TYPE\_ETH}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01073}01073                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01074}01074 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01075}01075         \mbox{\hyperlink{mlx5__eswitch_8c_ac1a10c6a7056526fb00a023782298744}{esw\_info}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}disable SRIOV: active vports(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01076}01076                  esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a474ccc3613e368863ef976a86cb3d1c9}{enabled\_vports}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01077}01077 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01078}01078         \textcolor{keywordflow}{for} (i = 0; i < esw-\/>\mbox{\hyperlink{structmlx5__eswitch_ab59a5c4f4bda1c723d07209fc972d71b}{total\_vports}}; i++)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01079}01079                 \mbox{\hyperlink{mlx5__eswitch_8c_a76fb5605cb8096bb2ddc6a8c810240a7}{esw\_disable\_vport}}(esw, i);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01080}01080 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01081}01081         \mbox{\hyperlink{mlx5__eswitch_8c_a70be96b6189836518f1437a94597e0f5}{esw\_destroy\_fdb\_table}}(esw);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01082}01082 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01083}01083         \textcolor{comment}{/* VPORT 0 (PF) must be enabled back with non-\/sriov configuration */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01084}01084         \mbox{\hyperlink{mlx5__eswitch_8c_ad80010e3db9717c7eb74630b41bf014c}{esw\_enable\_vport}}(esw, 0, \mbox{\hyperlink{mlx5__eswitch_8c_a5bea799269f02f5b3395d6b2c068b618a9612352a68fc92e5d6333b8cf603abbe}{UC\_ADDR\_CHANGE}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01085}01085 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01086}01086 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01087}\mbox{\hyperlink{eswitch_8h_a26f9ac558284dfa0c878db41e813acc3}{01087}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_a26f9ac558284dfa0c878db41e813acc3}{mlx5\_eswitch\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *\mbox{\hyperlink{structmlx5__vport_ac5a5dda75671c6403a5825d213a66878}{dev}}, \textcolor{keywordtype}{int} total\_vports)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01088}01088 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01089}01089         \textcolor{keywordtype}{int} l2\_table\_size = 1 << \mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(\mbox{\hyperlink{structmlx5__vport_ac5a5dda75671c6403a5825d213a66878}{dev}}, log\_max\_l2\_table);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01090}01090         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01091}01091         \textcolor{keywordtype}{int} vport\_num;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01092}01092         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01093}01093 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01094}01094         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, vport\_group\_manager) ||}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01095}01095             \mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, port\_type) != \mbox{\hyperlink{device_8h_a531c35e38ede3ea4e5ba5afb24b29493a6ace91bc7da0325275aa0cfa2ba31674}{MLX5\_CAP\_PORT\_TYPE\_ETH}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01096}01096                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01097}01097 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01098}01098         \mbox{\hyperlink{mlx5__eswitch_8c_ac1a10c6a7056526fb00a023782298744}{esw\_info}}(\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01099}01099                  \textcolor{stringliteral}{"{}Total vports \%d, l2 table size(\%d), per vport: max uc(\%d) max mc(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01100}01100                  \mbox{\hyperlink{structmlx5__eswitch_ab59a5c4f4bda1c723d07209fc972d71b}{total\_vports}}, l2\_table\_size,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01101}01101                  \mbox{\hyperlink{eswitch_8h_a21ccd5f3f13b3bb0982f780080562bc2}{MLX5\_MAX\_UC\_PER\_VPORT}}(\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}),}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01102}01102                  \mbox{\hyperlink{eswitch_8h_a9f23d2266996b48795fbdc0f1545212f}{MLX5\_MAX\_MC\_PER\_VPORT}}(\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}));}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01103}01103 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01104}01104         esw = kzalloc(\textcolor{keyword}{sizeof}(*esw), GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01105}01105         \textcolor{keywordflow}{if} (!esw)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01106}01106                 \textcolor{keywordflow}{return} -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01107}01107 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01108}01108         esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}} = \mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01109}01109 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01110}01110         esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a2c9205394bea57a97448c80a6ecc0fdb}{l2\_table}}.\mbox{\hyperlink{structmlx5__l2__table_a6de5fc3a3e2b98c26fbe4b69385057d3}{bitmap}} = kcalloc(BITS\_TO\_LONGS(l2\_table\_size),}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01111}01111                                    \textcolor{keyword}{sizeof}(uintptr\_t), GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01112}01112         \textcolor{keywordflow}{if} (!esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a2c9205394bea57a97448c80a6ecc0fdb}{l2\_table}}.\mbox{\hyperlink{structmlx5__l2__table_a6de5fc3a3e2b98c26fbe4b69385057d3}{bitmap}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01113}01113                 err = -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01114}01114                 \textcolor{keywordflow}{goto} abort;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01115}01115         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01116}01116         esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a2c9205394bea57a97448c80a6ecc0fdb}{l2\_table}}.\mbox{\hyperlink{structmlx5__l2__table_a78555dfaf229a668b85b8322febb244c}{size}} = l2\_table\_size;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01117}01117 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01118}01118         esw-\/>\mbox{\hyperlink{structmlx5__eswitch_ac3a13399dcda24290f6da1ef46a40e1f}{work\_queue}} = create\_singlethread\_workqueue(\textcolor{stringliteral}{"{}mlx5\_esw\_wq"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01119}01119         \textcolor{keywordflow}{if} (!esw-\/>\mbox{\hyperlink{structmlx5__eswitch_ac3a13399dcda24290f6da1ef46a40e1f}{work\_queue}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01120}01120                 err = -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01121}01121                 \textcolor{keywordflow}{goto} abort;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01122}01122         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01123}01123 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01124}01124         esw-\/>\mbox{\hyperlink{structmlx5__eswitch_af4a141b9b40d78d4190290f1f3296b33}{vports}} = kcalloc(\mbox{\hyperlink{structmlx5__eswitch_ab59a5c4f4bda1c723d07209fc972d71b}{total\_vports}}, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}}),}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01125}01125                               GFP\_KERNEL);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01126}01126         \textcolor{keywordflow}{if} (!esw-\/>\mbox{\hyperlink{structmlx5__eswitch_af4a141b9b40d78d4190290f1f3296b33}{vports}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01127}01127                 err = -\/ENOMEM;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01128}01128                 \textcolor{keywordflow}{goto} abort;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01129}01129         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01130}01130 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01131}01131         \textcolor{keywordflow}{for} (vport\_num = 0; vport\_num < \mbox{\hyperlink{structmlx5__eswitch_ab59a5c4f4bda1c723d07209fc972d71b}{total\_vports}}; vport\_num++) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01132}01132                 \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}} = \&esw-\/>\mbox{\hyperlink{structmlx5__eswitch_af4a141b9b40d78d4190290f1f3296b33}{vports}}[vport\_num];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01133}01133 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01134}01134                 \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>vport = vport\_num;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01135}01135                 \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>dev = \mbox{\hyperlink{structmlx5__vport_ac5a5dda75671c6403a5825d213a66878}{dev}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01136}01136                 INIT\_WORK(\&\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>vport\_change\_handler,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01137}01137                           \mbox{\hyperlink{mlx5__eswitch_8c_aaf7df8a88dccd946f5cba17e80854274}{esw\_vport\_change\_handler}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01138}01138                 spin\_lock\_init(\&\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>lock);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01139}01139                 mutex\_init(\&\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>state\_lock);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01140}01140         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01141}01141 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01142}01142         esw-\/>\mbox{\hyperlink{structmlx5__eswitch_ab59a5c4f4bda1c723d07209fc972d71b}{total\_vports}} = total\_vports;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01143}01143         esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a474ccc3613e368863ef976a86cb3d1c9}{enabled\_vports}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01144}01144 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01145}01145         \mbox{\hyperlink{structmlx5__vport_ac5a5dda75671c6403a5825d213a66878}{dev}}-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_af51b3ecf53b287041c15644d42c9f405}{eswitch}} = esw;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01146}01146         \mbox{\hyperlink{mlx5__eswitch_8c_ad80010e3db9717c7eb74630b41bf014c}{esw\_enable\_vport}}(esw, 0, \mbox{\hyperlink{mlx5__eswitch_8c_a5bea799269f02f5b3395d6b2c068b618a9612352a68fc92e5d6333b8cf603abbe}{UC\_ADDR\_CHANGE}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01147}01147         \textcolor{comment}{/* VF Vports will be enabled when SRIOV is enabled */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01148}01148         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01149}01149 abort:}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01150}01150         \textcolor{keywordflow}{if} (esw-\/>\mbox{\hyperlink{structmlx5__eswitch_ac3a13399dcda24290f6da1ef46a40e1f}{work\_queue}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01151}01151                 destroy\_workqueue(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_ac3a13399dcda24290f6da1ef46a40e1f}{work\_queue}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01152}01152         kfree(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a2c9205394bea57a97448c80a6ecc0fdb}{l2\_table}}.\mbox{\hyperlink{structmlx5__l2__table_a6de5fc3a3e2b98c26fbe4b69385057d3}{bitmap}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01153}01153         kfree(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_af4a141b9b40d78d4190290f1f3296b33}{vports}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01154}01154         kfree(esw);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01155}01155         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01156}01156 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01157}01157 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01158}\mbox{\hyperlink{eswitch_8h_af4ee0523a44216f602955f10ceda8f23}{01158}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_af4ee0523a44216f602955f10ceda8f23}{mlx5\_eswitch\_cleanup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01159}01159 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01160}01160         \textcolor{keywordflow}{if} (!esw || !\mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, vport\_group\_manager) ||}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01161}01161             \mbox{\hyperlink{device_8h_ab4698570d3992612e8c6ccf9fde798c3}{MLX5\_CAP\_GEN}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, port\_type) != \mbox{\hyperlink{device_8h_a531c35e38ede3ea4e5ba5afb24b29493a6ace91bc7da0325275aa0cfa2ba31674}{MLX5\_CAP\_PORT\_TYPE\_ETH}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01162}01162                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01163}01163 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01164}01164         \mbox{\hyperlink{mlx5__eswitch_8c_ac1a10c6a7056526fb00a023782298744}{esw\_info}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \textcolor{stringliteral}{"{}cleanup\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01165}01165         \mbox{\hyperlink{mlx5__eswitch_8c_a76fb5605cb8096bb2ddc6a8c810240a7}{esw\_disable\_vport}}(esw, 0);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01166}01166 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01167}01167         esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}-\/>\mbox{\hyperlink{structmlx5__core__dev_a2642b287846069d077eec2d44e137703}{priv}}.\mbox{\hyperlink{structmlx5__priv_af51b3ecf53b287041c15644d42c9f405}{eswitch}} = NULL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01168}01168         destroy\_workqueue(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_ac3a13399dcda24290f6da1ef46a40e1f}{work\_queue}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01169}01169         kfree(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a2c9205394bea57a97448c80a6ecc0fdb}{l2\_table}}.\mbox{\hyperlink{structmlx5__l2__table_a6de5fc3a3e2b98c26fbe4b69385057d3}{bitmap}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01170}01170         kfree(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_af4a141b9b40d78d4190290f1f3296b33}{vports}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01171}01171         kfree(esw);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01172}01172 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01173}01173 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01174}\mbox{\hyperlink{eswitch_8h_aa8bf34fe99da7cf334618ab1bbc12917}{01174}} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_aa8bf34fe99da7cf334618ab1bbc12917}{mlx5\_eswitch\_vport\_event}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eqe}{mlx5\_eqe}} *eqe)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01175}01175 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01176}01176         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__eqe__vport__change}{mlx5\_eqe\_vport\_change}} *vc\_eqe = \&eqe-\/>\mbox{\hyperlink{structmlx5__eqe_a23d790d7732ba01f68202e2f410f9248}{data}}.\mbox{\hyperlink{unionev__data_ab624e78403d795527fd304e9733e632b}{vport\_change}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01177}01177         u16 \mbox{\hyperlink{structmlx5__eqe__vport__change_a34b8892d5c91494ea7c405409541a803}{vport\_num}} = be16\_to\_cpu(vc\_eqe-\/>\mbox{\hyperlink{structmlx5__eqe__vport__change_a34b8892d5c91494ea7c405409541a803}{vport\_num}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01178}01178         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01179}01179 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01180}01180         \textcolor{keywordflow}{if} (!esw) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01181}01181                 printf(\textcolor{stringliteral}{"{}mlx5\_core: WARN: "{}}\textcolor{stringliteral}{"{}MLX5 E-\/Switch: vport \%d got an event while eswitch is not initialized\(\backslash\)n"{}}, vport\_num);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01182}01182                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01183}01183         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01184}01184 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01185}01185         \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}} = \&esw-\/>\mbox{\hyperlink{structmlx5__eswitch_af4a141b9b40d78d4190290f1f3296b33}{vports}}[vport\_num];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01186}01186         spin\_lock(\&\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>lock);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01187}01187         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>enabled)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01188}01188                 queue\_work(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_ac3a13399dcda24290f6da1ef46a40e1f}{work\_queue}}, \&\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>vport\_change\_handler);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01189}01189         spin\_unlock(\&\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}-\/>lock);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01190}01190 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01191}01191 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01192}01192 \textcolor{comment}{/* Vport Administration */}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01193}\mbox{\hyperlink{mlx5__eswitch_8c_aec0969c5f5afd8a87efcad395150f191}{01193}} \textcolor{preprocessor}{\#define ESW\_ALLOWED(esw) \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01194}01194 \textcolor{preprocessor}{        (esw \&\& MLX5\_CAP\_GEN(esw-\/>dev, vport\_group\_manager) \&\& mlx5\_core\_is\_pf(esw-\/>dev))}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01195}\mbox{\hyperlink{mlx5__eswitch_8c_a523e72c1c8ab783efb89913c43970d16}{01195}} \textcolor{preprocessor}{\#define LEGAL\_VPORT(esw, vport) (vport >= 0 \&\& vport < esw-\/>total\_vports)}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01196}01196 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01197}\mbox{\hyperlink{mlx5__eswitch_8c_afae4c0cef2720917ed5b492d4beb55a3}{01197}} \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{mlx5__eswitch_8c_afae4c0cef2720917ed5b492d4beb55a3}{node\_guid\_gen\_from\_mac}}(u64 *node\_guid, u8 mac[ETH\_ALEN])}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01198}01198 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01199}01199         ((u8 *)node\_guid)[7] = mac[0];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01200}01200         ((u8 *)node\_guid)[6] = mac[1];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01201}01201         ((u8 *)node\_guid)[5] = mac[2];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01202}01202         ((u8 *)node\_guid)[4] = 0xff;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01203}01203         ((u8 *)node\_guid)[3] = 0xfe;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01204}01204         ((u8 *)node\_guid)[2] = mac[3];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01205}01205         ((u8 *)node\_guid)[1] = mac[4];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01206}01206         ((u8 *)node\_guid)[0] = mac[5];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01207}01207 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01208}01208 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01209}\mbox{\hyperlink{eswitch_8h_a92494f11529c02721cf65de31291a0bb}{01209}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_a92494f11529c02721cf65de31291a0bb}{mlx5\_eswitch\_set\_vport\_mac}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01210}01210                                \textcolor{keywordtype}{int} \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, u8 mac[ETH\_ALEN])}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01211}01211 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01212}01212         \textcolor{keywordtype}{int} err = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01213}01213         u64 node\_guid;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01214}01214 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01215}01215         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{mlx5__eswitch_8c_aec0969c5f5afd8a87efcad395150f191}{ESW\_ALLOWED}}(esw))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01216}01216                 \textcolor{keywordflow}{return} -\/EPERM;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01217}01217         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{mlx5__eswitch_8c_a523e72c1c8ab783efb89913c43970d16}{LEGAL\_VPORT}}(esw, \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01218}01218                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01219}01219 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01220}01220         err = \mbox{\hyperlink{mlx5__vport_8c_a08902bd2634f8d445b6bb210a4e0a53e}{mlx5\_modify\_nic\_vport\_mac\_address}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, mac);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01221}01221         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01222}01222                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01223}01223                                \textcolor{stringliteral}{"{}Failed to mlx5\_modify\_nic\_vport\_mac vport(\%d) err=(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01224}01224                                \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, err);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01225}01225                 \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01226}01226         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01227}01227 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01228}01228         \mbox{\hyperlink{mlx5__eswitch_8c_afae4c0cef2720917ed5b492d4beb55a3}{node\_guid\_gen\_from\_mac}}(\&node\_guid, mac);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01229}01229         err = \mbox{\hyperlink{mlx5__vport_8c_aa7fab2db8d1228e4a2748d9bcab465d2}{mlx5\_modify\_nic\_vport\_node\_guid}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, node\_guid);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01230}01230         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01231}01231                 \mbox{\hyperlink{mlx5__core_8h_ac024f7b881a7d4965ecc662bc4be81ca}{mlx5\_core\_warn}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01232}01232                                \textcolor{stringliteral}{"{}Failed to mlx5\_modify\_nic\_vport\_node\_guid vport(\%d) err=(\%d)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01233}01233                                \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, err);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01234}01234                 \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01235}01235         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01236}01236 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01237}01237         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01238}01238 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01239}01239 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01240}\mbox{\hyperlink{eswitch_8h_ad3ce4a6f6736fa9f1dfbd4c2c494972e}{01240}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_ad3ce4a6f6736fa9f1dfbd4c2c494972e}{mlx5\_eswitch\_set\_vport\_state}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01241}01241                                  \textcolor{keywordtype}{int} \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, \textcolor{keywordtype}{int} link\_state)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01242}01242 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01243}01243         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{mlx5__eswitch_8c_aec0969c5f5afd8a87efcad395150f191}{ESW\_ALLOWED}}(esw))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01244}01244                 \textcolor{keywordflow}{return} -\/EPERM;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01245}01245         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{mlx5__eswitch_8c_a523e72c1c8ab783efb89913c43970d16}{LEGAL\_VPORT}}(esw, \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01246}01246                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01247}01247 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01248}01248         \textcolor{keywordflow}{return} \mbox{\hyperlink{mlx5__vport_8c_ae0e1f1cc2cf2a741f596d1c5c215a924}{mlx5\_modify\_vport\_admin\_state}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01249}01249                                              \mbox{\hyperlink{mlx5__ifc_8h_a18efc29f05f292310db38a8c7e81dcdaa39d4f955e3de4598cd70fc7a779f19e6}{MLX5\_QUERY\_VPORT\_STATE\_IN\_OP\_MOD\_ESW\_VPORT}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01250}01250                                              \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, link\_state);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01251}01251 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01252}01252 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01253}\mbox{\hyperlink{eswitch_8h_a338d26a3b2a50b61126799b15d2473f9}{01253}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_a000fb3e2465009702019e2b20472e015}{mlx5\_eswitch\_get\_vport\_config}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01254}01254                                   \textcolor{keywordtype}{int} \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__esw__vport__info}{mlx5\_esw\_vport\_info}} *ivi)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01255}01255 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01256}01256         u16 \mbox{\hyperlink{structmlx5__vport_afb1f84fbfd5df5334e3347700e7b1725}{vlan}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01257}01257         u8 \mbox{\hyperlink{structmlx5__vport_abe3537f1f1aeafe43c4d25aea57d6836}{qos}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01258}01258 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01259}01259         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{mlx5__eswitch_8c_aec0969c5f5afd8a87efcad395150f191}{ESW\_ALLOWED}}(esw))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01260}01260                 \textcolor{keywordflow}{return} -\/EPERM;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01261}01261         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{mlx5__eswitch_8c_a523e72c1c8ab783efb89913c43970d16}{LEGAL\_VPORT}}(esw, \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01262}01262                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01263}01263 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01264}01264         memset(ivi, 0, \textcolor{keyword}{sizeof}(*ivi));}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01265}01265         ivi-\/>\mbox{\hyperlink{structmlx5__esw__vport__info_a38029661f3f11c23e13e83e016c74b1e}{vf}} = \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}} -\/ 1;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01266}01266 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01267}01267         \mbox{\hyperlink{mlx5__vport_8c_ad67a4267d8c0e7b052f317c01819063a}{mlx5\_query\_nic\_vport\_mac\_address}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, ivi-\/>\mbox{\hyperlink{structmlx5__esw__vport__info_a2f410e0d00341daab97d03923fa5d665}{mac}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01268}01268         ivi-\/>\mbox{\hyperlink{structmlx5__esw__vport__info_aedef1ff12e44638e5597c60315509cad}{linkstate}} = \mbox{\hyperlink{mlx5__vport_8c_a7eb8f7e36690591668e15e25ba661a14}{mlx5\_query\_vport\_admin\_state}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01269}01269                                                       \mbox{\hyperlink{mlx5__ifc_8h_a18efc29f05f292310db38a8c7e81dcdaa39d4f955e3de4598cd70fc7a779f19e6}{MLX5\_QUERY\_VPORT\_STATE\_IN\_OP\_MOD\_ESW\_VPORT}},}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01270}01270                                                       \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01271}01271         \mbox{\hyperlink{mlx5__eswitch_8c_afd876b6f57db6f9fcdb406893f44ddd3}{query\_esw\_vport\_cvlan}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, \&\mbox{\hyperlink{structmlx5__vport_afb1f84fbfd5df5334e3347700e7b1725}{vlan}}, \&\mbox{\hyperlink{structmlx5__vport_abe3537f1f1aeafe43c4d25aea57d6836}{qos}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01272}01272         ivi-\/>\mbox{\hyperlink{structmlx5__esw__vport__info_ad0dd4e04f844d897025c78b78415ccb4}{vlan}} = \mbox{\hyperlink{structmlx5__vport_afb1f84fbfd5df5334e3347700e7b1725}{vlan}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01273}01273         ivi-\/>\mbox{\hyperlink{structmlx5__esw__vport__info_a5f8002f7e515c2f0b99a0af80f9caaeb}{qos}} = \mbox{\hyperlink{structmlx5__vport_abe3537f1f1aeafe43c4d25aea57d6836}{qos}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01274}01274         ivi-\/>\mbox{\hyperlink{structmlx5__esw__vport__info_aa10ccc0404ab33682012f9a7cdcd0fba}{spoofchk}} = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01275}01275 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01276}01276         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01277}01277 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01278}01278 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01279}\mbox{\hyperlink{eswitch_8h_a46e8ec40871eda1abfe6dfb7ff9536d8}{01279}} \textcolor{keywordtype}{int} \mbox{\hyperlink{mlx5__eswitch_8c_a46e8ec40871eda1abfe6dfb7ff9536d8}{mlx5\_eswitch\_set\_vport\_vlan}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01280}01280                                 \textcolor{keywordtype}{int} \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, u16 \mbox{\hyperlink{structmlx5__vport_afb1f84fbfd5df5334e3347700e7b1725}{vlan}}, u8 \mbox{\hyperlink{structmlx5__vport_abe3537f1f1aeafe43c4d25aea57d6836}{qos}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01281}01281 \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01282}01282         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} *evport;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01283}01283         \textcolor{keywordtype}{int} err = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01284}01284         \textcolor{keywordtype}{int} set = 0;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01285}01285 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01286}01286         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{mlx5__eswitch_8c_aec0969c5f5afd8a87efcad395150f191}{ESW\_ALLOWED}}(esw))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01287}01287                 \textcolor{keywordflow}{return} -\/EPERM;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01288}01288         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{mlx5__eswitch_8c_a523e72c1c8ab783efb89913c43970d16}{LEGAL\_VPORT}}(esw, \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}) || (\mbox{\hyperlink{structmlx5__vport_afb1f84fbfd5df5334e3347700e7b1725}{vlan}} > 4095) || (\mbox{\hyperlink{structmlx5__vport_abe3537f1f1aeafe43c4d25aea57d6836}{qos}} > 7))}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01289}01289                 \textcolor{keywordflow}{return} -\/EINVAL;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01290}01290 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01291}01291         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structmlx5__vport_afb1f84fbfd5df5334e3347700e7b1725}{vlan}} || \mbox{\hyperlink{structmlx5__vport_abe3537f1f1aeafe43c4d25aea57d6836}{qos}})}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01292}01292                 set = 1;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01293}01293 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01294}01294         evport = \&esw-\/>\mbox{\hyperlink{structmlx5__eswitch_af4a141b9b40d78d4190290f1f3296b33}{vports}}[\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}];}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01295}01295 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01296}01296         err = \mbox{\hyperlink{mlx5__eswitch_8c_a3679a4487a0187941b75f91c995170f1}{modify\_esw\_vport\_cvlan}}(esw-\/>\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}}, \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}}, \mbox{\hyperlink{structmlx5__vport_afb1f84fbfd5df5334e3347700e7b1725}{vlan}}, \mbox{\hyperlink{structmlx5__vport_abe3537f1f1aeafe43c4d25aea57d6836}{qos}}, set);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01297}01297         \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01298}01298                 \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01299}01299 }
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01300}01300         mutex\_lock(\&evport-\/>\mbox{\hyperlink{structmlx5__vport_a39159bace2fec6f8a7d0a14211eed363}{state\_lock}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01301}01301         evport-\/>\mbox{\hyperlink{structmlx5__vport_afb1f84fbfd5df5334e3347700e7b1725}{vlan}} = \mbox{\hyperlink{structmlx5__vport_afb1f84fbfd5df5334e3347700e7b1725}{vlan}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01302}01302         evport-\/>\mbox{\hyperlink{structmlx5__vport_abe3537f1f1aeafe43c4d25aea57d6836}{qos}} = \mbox{\hyperlink{structmlx5__vport_abe3537f1f1aeafe43c4d25aea57d6836}{qos}};}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01303}01303         \textcolor{keywordflow}{if} (evport-\/>\mbox{\hyperlink{structmlx5__vport_ae5d345507258e839dbcc381e618f4265}{enabled}}) \{}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01304}01304                 \mbox{\hyperlink{mlx5__eswitch_8c_ab2f015800849c93e4bd6dba14dd3853e}{esw\_vport\_ingress\_config}}(esw, evport);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01305}01305                 \mbox{\hyperlink{mlx5__eswitch_8c_a4874362513a57189fe44a63d45a8a2c9}{esw\_vport\_egress\_config}}(esw, evport);}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01306}01306         \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01307}01307         mutex\_unlock(\&evport-\/>\mbox{\hyperlink{structmlx5__vport_a39159bace2fec6f8a7d0a14211eed363}{state\_lock}});}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01308}01308         \textcolor{keywordflow}{return} err;}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01309}01309 \}}
\DoxyCodeLine{\Hypertarget{mlx5__eswitch_8c_source_l01310}01310 }

\end{DoxyCode}
