\hypertarget{eswitch_8h_source}{}\doxysection{eswitch.\+h}
\label{eswitch_8h_source}\index{dev/mlx5/mlx5\_core/eswitch.h@{dev/mlx5/mlx5\_core/eswitch.h}}
\mbox{\hyperlink{eswitch_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2013-\/2017, Mellanox Technologies, Ltd.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00004}00004 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00005}00005 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00006}00006 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00007}00007 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00008}00008 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00009}00009 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00010}00010 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00011}00011 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00013}00013 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00014}00014 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00015}00015 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00016}00016 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00017}00017 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00018}00018 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00019}00019 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00020}00020 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00021}00021 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00022}00022 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00023}00023 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00024}00024 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00025}00025 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00026}00026 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00027}00027 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00028}00028 \textcolor{preprocessor}{\#ifndef \_\_MLX5\_ESWITCH\_H\_\_}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00029}00029 \textcolor{preprocessor}{\#define \_\_MLX5\_ESWITCH\_H\_\_}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00031}00031 \textcolor{preprocessor}{\#include <linux/if\_ether.h>}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00032}00032 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{device_8h}{dev/mlx5/device.h}}>}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00033}00033 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00034}\mbox{\hyperlink{eswitch_8h_a21ccd5f3f13b3bb0982f780080562bc2}{00034}} \textcolor{preprocessor}{\#define MLX5\_MAX\_UC\_PER\_VPORT(dev) \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00035}00035 \textcolor{preprocessor}{        (1 << MLX5\_CAP\_GEN(dev, log\_max\_current\_uc\_list))}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00036}00036 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00037}\mbox{\hyperlink{eswitch_8h_a9f23d2266996b48795fbdc0f1545212f}{00037}} \textcolor{preprocessor}{\#define MLX5\_MAX\_MC\_PER\_VPORT(dev) \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00038}00038 \textcolor{preprocessor}{        (1 << MLX5\_CAP\_GEN(dev, log\_max\_current\_mc\_list))}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00039}00039 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00040}\mbox{\hyperlink{eswitch_8h_a669d4925f0b52290a6bd3fb001315e4a}{00040}} \textcolor{preprocessor}{\#define MLX5\_L2\_ADDR\_HASH\_SIZE (BIT(BITS\_PER\_BYTE))}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00041}\mbox{\hyperlink{eswitch_8h_af70075462ad60201966da3f9cf2c697f}{00041}} \textcolor{preprocessor}{\#define MLX5\_L2\_ADDR\_HASH(addr) (addr[5])}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00042}00042 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00043}00043 \textcolor{comment}{/* L2 -\/mac address based-\/ hash helpers */}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00044}\mbox{\hyperlink{structl2addr__node}{00044}} \textcolor{keyword}{struct }\mbox{\hyperlink{structl2addr__node}{l2addr\_node}} \{}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00045}\mbox{\hyperlink{structl2addr__node_a04e6a853c40464650f8db8ab0907f4b5}{00045}}         \textcolor{keyword}{struct }hlist\_node \mbox{\hyperlink{structl2addr__node_a04e6a853c40464650f8db8ab0907f4b5}{hlist}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00046}\mbox{\hyperlink{structl2addr__node_a83acb789b9096e3200b1c0761a0101b8}{00046}}         u8                \mbox{\hyperlink{structl2addr__node_a83acb789b9096e3200b1c0761a0101b8}{addr}}[ETH\_ALEN];}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00047}00047 \};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00048}00048 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00049}\mbox{\hyperlink{eswitch_8h_aee9a7eba31456cfd476acf7a8aee56cb}{00049}} \textcolor{preprocessor}{\#define for\_each\_l2hash\_node(hn, tmp, hash, i) \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00050}00050 \textcolor{preprocessor}{        for (i = 0; i < MLX5\_L2\_ADDR\_HASH\_SIZE; i++) \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00051}00051 \textcolor{preprocessor}{                hlist\_for\_each\_entry\_safe(hn, tmp, \&hash[i], hlist)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00053}\mbox{\hyperlink{eswitch_8h_aa69a18679dfc6e50f57bb64e4dd69cc6}{00053}} \textcolor{preprocessor}{\#define l2addr\_hash\_find(hash, mac, type) (\{                \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00054}00054 \textcolor{preprocessor}{        int ix = MLX5\_L2\_ADDR\_HASH(mac);                    \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00055}00055 \textcolor{preprocessor}{        bool found = false;                                 \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00056}00056 \textcolor{preprocessor}{        type *ptr = NULL;                                   \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00057}00057 \textcolor{preprocessor}{                                                            \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00058}00058 \textcolor{preprocessor}{        hlist\_for\_each\_entry(ptr, \&hash[ix], node.hlist)    \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00059}00059 \textcolor{preprocessor}{                if (ether\_addr\_equal(ptr-\/>node.addr, mac)) \{\(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00060}00060 \textcolor{preprocessor}{                        found = true;                       \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00061}00061 \textcolor{preprocessor}{                        break;                              \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00062}00062 \textcolor{preprocessor}{                \}                                           \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00063}00063 \textcolor{preprocessor}{        if (!found)                                         \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00064}00064 \textcolor{preprocessor}{                ptr = NULL;                                 \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00065}00065 \textcolor{preprocessor}{        ptr;                                                \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00066}00066 \textcolor{preprocessor}{\})}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00068}\mbox{\hyperlink{eswitch_8h_ac0244363f0f4ea92cbd6f3f703495d85}{00068}} \textcolor{preprocessor}{\#define l2addr\_hash\_add(hash, mac, type, gfp) (\{            \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00069}00069 \textcolor{preprocessor}{        int ix = MLX5\_L2\_ADDR\_HASH(mac);                    \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00070}00070 \textcolor{preprocessor}{        type *ptr = NULL;                                   \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00071}00071 \textcolor{preprocessor}{                                                            \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00072}00072 \textcolor{preprocessor}{        ptr = kzalloc(sizeof(type), gfp);                   \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00073}00073 \textcolor{preprocessor}{        if (ptr) \{                                          \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00074}00074 \textcolor{preprocessor}{                ether\_addr\_copy(ptr-\/>node.addr, mac);       \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00075}00075 \textcolor{preprocessor}{                hlist\_add\_head(\&ptr-\/>node.hlist, \&hash[ix]);\(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00076}00076 \textcolor{preprocessor}{        \}                                                   \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00077}00077 \textcolor{preprocessor}{        ptr;                                                \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00078}00078 \textcolor{preprocessor}{\})}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00079}00079 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00080}\mbox{\hyperlink{eswitch_8h_a071b84f005c1ed71b8f8fb5ef436bf24}{00080}} \textcolor{preprocessor}{\#define l2addr\_hash\_del(ptr) (\{                             \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00081}00081 \textcolor{preprocessor}{        hlist\_del(\&ptr-\/>node.hlist);                        \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00082}00082 \textcolor{preprocessor}{        kfree(ptr);                                         \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00083}00083 \textcolor{preprocessor}{\})}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00084}00084 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00085}\mbox{\hyperlink{structvport__ingress}{00085}} \textcolor{keyword}{struct }\mbox{\hyperlink{structvport__ingress}{vport\_ingress}} \{}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00086}\mbox{\hyperlink{structvport__ingress_a665c3d8d13ae0c97ee12f5a751fbe1df}{00086}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__table}{mlx5\_flow\_table}} *\mbox{\hyperlink{structvport__ingress_a665c3d8d13ae0c97ee12f5a751fbe1df}{acl}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00087}\mbox{\hyperlink{structvport__ingress_aa457e75d659a2b8092496769ea605cb7}{00087}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__group}{mlx5\_flow\_group}} *\mbox{\hyperlink{structvport__ingress_aa457e75d659a2b8092496769ea605cb7}{drop\_grp}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00088}\mbox{\hyperlink{structvport__ingress_a3846f3d40d2214fbb7ba1bab2dc3b8fe}{00088}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__rule}{mlx5\_flow\_rule}}  *\mbox{\hyperlink{structvport__ingress_a3846f3d40d2214fbb7ba1bab2dc3b8fe}{drop\_rule}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00089}00089 \};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00091}\mbox{\hyperlink{structvport__egress}{00091}} \textcolor{keyword}{struct }\mbox{\hyperlink{structvport__egress}{vport\_egress}} \{}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00092}\mbox{\hyperlink{structvport__egress_a23836ee534845e842d0e9c85b5b87c15}{00092}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__table}{mlx5\_flow\_table}} *\mbox{\hyperlink{structvport__egress_a23836ee534845e842d0e9c85b5b87c15}{acl}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00093}\mbox{\hyperlink{structvport__egress_a04c83e62a7a51bf2a480ce58f6f35771}{00093}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__group}{mlx5\_flow\_group}} *\mbox{\hyperlink{structvport__egress_a04c83e62a7a51bf2a480ce58f6f35771}{allowed\_vlans\_grp}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00094}\mbox{\hyperlink{structvport__egress_a47a3e2a91023f3576cb5e23cf615e278}{00094}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__group}{mlx5\_flow\_group}} *\mbox{\hyperlink{structvport__egress_a47a3e2a91023f3576cb5e23cf615e278}{drop\_grp}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00095}\mbox{\hyperlink{structvport__egress_a5d455ef4d582582808a513d9ebe5e61b}{00095}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__rule}{mlx5\_flow\_rule}}  *\mbox{\hyperlink{structvport__egress_a5d455ef4d582582808a513d9ebe5e61b}{allowed\_vlan}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00096}\mbox{\hyperlink{structvport__egress_a16d5de626478f72c152d2f6fc672d300}{00096}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__rule}{mlx5\_flow\_rule}}  *\mbox{\hyperlink{structvport__egress_a16d5de626478f72c152d2f6fc672d300}{drop\_rule}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00097}00097 \};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00099}\mbox{\hyperlink{structmlx5__vport}{00099}} \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}} \{}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00100}\mbox{\hyperlink{structmlx5__vport_ac5a5dda75671c6403a5825d213a66878}{00100}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}}    *\mbox{\hyperlink{structmlx5__vport_ac5a5dda75671c6403a5825d213a66878}{dev}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00101}\mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{00101}}         \textcolor{keywordtype}{int}                     \mbox{\hyperlink{structmlx5__vport_a5b2b18b1f230f950b25edcebe18ffee7}{vport}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00102}\mbox{\hyperlink{structmlx5__vport_aa41215bf4ca4d3734d41626bc06fea7f}{00102}}         \textcolor{keyword}{struct }hlist\_head       \mbox{\hyperlink{structmlx5__vport_aa41215bf4ca4d3734d41626bc06fea7f}{uc\_list}}[\mbox{\hyperlink{eswitch_8h_a669d4925f0b52290a6bd3fb001315e4a}{MLX5\_L2\_ADDR\_HASH\_SIZE}}];}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00103}\mbox{\hyperlink{structmlx5__vport_a7e0f973583874bf1027e5c0a2f535f2b}{00103}}         \textcolor{keyword}{struct }hlist\_head       \mbox{\hyperlink{structmlx5__vport_a7e0f973583874bf1027e5c0a2f535f2b}{mc\_list}}[\mbox{\hyperlink{eswitch_8h_a669d4925f0b52290a6bd3fb001315e4a}{MLX5\_L2\_ADDR\_HASH\_SIZE}}];}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00104}\mbox{\hyperlink{structmlx5__vport_a6f447c3dab781b7b5e7b354cee5c9c16}{00104}}         \textcolor{keyword}{struct }work\_struct      \mbox{\hyperlink{structmlx5__vport_a6f447c3dab781b7b5e7b354cee5c9c16}{vport\_change\_handler}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00105}00105 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00106}\mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{00106}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structvport__ingress}{vport\_ingress}}    \mbox{\hyperlink{structmlx5__vport_affd00d4bfc4b5245a711a59f7917b69e}{ingress}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00107}\mbox{\hyperlink{structmlx5__vport_a7f74ec472dcdfc2251fd5bef7438fd07}{00107}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structvport__egress}{vport\_egress}}     \mbox{\hyperlink{structmlx5__vport_a7f74ec472dcdfc2251fd5bef7438fd07}{egress}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00109}\mbox{\hyperlink{structmlx5__vport_afb1f84fbfd5df5334e3347700e7b1725}{00109}}         u16                     \mbox{\hyperlink{structmlx5__vport_afb1f84fbfd5df5334e3347700e7b1725}{vlan}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00110}\mbox{\hyperlink{structmlx5__vport_abe3537f1f1aeafe43c4d25aea57d6836}{00110}}         u8                      \mbox{\hyperlink{structmlx5__vport_abe3537f1f1aeafe43c4d25aea57d6836}{qos}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00111}\mbox{\hyperlink{structmlx5__vport_a39159bace2fec6f8a7d0a14211eed363}{00111}}         \textcolor{keyword}{struct }mutex    \mbox{\hyperlink{structmlx5__vport_a39159bace2fec6f8a7d0a14211eed363}{state\_lock}}; \textcolor{comment}{/* protect dynamic state changes */}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00112}00112         \textcolor{comment}{/* This spinlock protects access to vport data, between}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00113}00113 \textcolor{comment}{         * "{}esw\_vport\_disable"{} and ongoing interrupt "{}mlx5\_eswitch\_vport\_event"{}}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00114}00114 \textcolor{comment}{         * once vport marked as disabled new interrupts are discarded.}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00115}00115 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00116}\mbox{\hyperlink{structmlx5__vport_a569b873f24a1575d26bf5e917ed60dda}{00116}}         spinlock\_t              \mbox{\hyperlink{structmlx5__vport_a569b873f24a1575d26bf5e917ed60dda}{lock}}; \textcolor{comment}{/* vport events sync */}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00117}\mbox{\hyperlink{structmlx5__vport_ae5d345507258e839dbcc381e618f4265}{00117}}         \textcolor{keywordtype}{bool}                    \mbox{\hyperlink{structmlx5__vport_ae5d345507258e839dbcc381e618f4265}{enabled}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00118}\mbox{\hyperlink{structmlx5__vport_a061cb2a83293ea89a796d9eb179e1f13}{00118}}         u16                     \mbox{\hyperlink{structmlx5__vport_a061cb2a83293ea89a796d9eb179e1f13}{enabled\_events}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00119}00119 \};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00121}\mbox{\hyperlink{structmlx5__l2__table}{00121}} \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__l2__table}{mlx5\_l2\_table}} \{}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00122}\mbox{\hyperlink{structmlx5__l2__table_a60f77de540b5c05d99b286837338f3c3}{00122}}         \textcolor{keyword}{struct }hlist\_head \mbox{\hyperlink{structmlx5__l2__table_a60f77de540b5c05d99b286837338f3c3}{l2\_hash}}[\mbox{\hyperlink{eswitch_8h_a669d4925f0b52290a6bd3fb001315e4a}{MLX5\_L2\_ADDR\_HASH\_SIZE}}];}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00123}\mbox{\hyperlink{structmlx5__l2__table_a78555dfaf229a668b85b8322febb244c}{00123}}         u32                  \mbox{\hyperlink{structmlx5__l2__table_a78555dfaf229a668b85b8322febb244c}{size}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00124}\mbox{\hyperlink{structmlx5__l2__table_a6de5fc3a3e2b98c26fbe4b69385057d3}{00124}}         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long}        *\mbox{\hyperlink{structmlx5__l2__table_a6de5fc3a3e2b98c26fbe4b69385057d3}{bitmap}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00125}00125 \};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00126}00126 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00127}\mbox{\hyperlink{structmlx5__eswitch__fdb}{00127}} \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__eswitch__fdb}{mlx5\_eswitch\_fdb}} \{}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00128}\mbox{\hyperlink{structmlx5__eswitch__fdb_a5099c32c36b18a85adac846239e0961c}{00128}}         \textcolor{keywordtype}{void} *\mbox{\hyperlink{structmlx5__eswitch__fdb_a5099c32c36b18a85adac846239e0961c}{fdb}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00129}\mbox{\hyperlink{structmlx5__eswitch__fdb_a00bed119383c528291fcb186bf825699}{00129}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__flow__group}{mlx5\_flow\_group}} *\mbox{\hyperlink{structmlx5__eswitch__fdb_a00bed119383c528291fcb186bf825699}{addr\_grp}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00130}00130 \};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00132}\mbox{\hyperlink{structmlx5__eswitch}{00132}} \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} \{}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00133}\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{00133}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}}    *\mbox{\hyperlink{structmlx5__eswitch_a067793840a9d896c7b7e3c276cbe545c}{dev}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00134}\mbox{\hyperlink{structmlx5__eswitch_a2c9205394bea57a97448c80a6ecc0fdb}{00134}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__l2__table}{mlx5\_l2\_table}}    \mbox{\hyperlink{structmlx5__eswitch_a2c9205394bea57a97448c80a6ecc0fdb}{l2\_table}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00135}\mbox{\hyperlink{structmlx5__eswitch_a9e94a4bd212cd67f80343bfe635ac813}{00135}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__eswitch__fdb}{mlx5\_eswitch\_fdb}} \mbox{\hyperlink{structmlx5__eswitch_a9e94a4bd212cd67f80343bfe635ac813}{fdb\_table}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00136}\mbox{\hyperlink{structmlx5__eswitch_a0298f7db04718898f304d3b1c486ec07}{00136}}         \textcolor{keyword}{struct }hlist\_head       \mbox{\hyperlink{structmlx5__eswitch_a0298f7db04718898f304d3b1c486ec07}{mc\_table}}[\mbox{\hyperlink{eswitch_8h_a669d4925f0b52290a6bd3fb001315e4a}{MLX5\_L2\_ADDR\_HASH\_SIZE}}];}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00137}\mbox{\hyperlink{structmlx5__eswitch_ac3a13399dcda24290f6da1ef46a40e1f}{00137}}         \textcolor{keyword}{struct }workqueue\_struct *\mbox{\hyperlink{structmlx5__eswitch_ac3a13399dcda24290f6da1ef46a40e1f}{work\_queue}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00138}\mbox{\hyperlink{structmlx5__eswitch_af4a141b9b40d78d4190290f1f3296b33}{00138}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__vport}{mlx5\_vport}}       *\mbox{\hyperlink{structmlx5__eswitch_af4a141b9b40d78d4190290f1f3296b33}{vports}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00139}\mbox{\hyperlink{structmlx5__eswitch_ab59a5c4f4bda1c723d07209fc972d71b}{00139}}         \textcolor{keywordtype}{int}                     \mbox{\hyperlink{structmlx5__eswitch_ab59a5c4f4bda1c723d07209fc972d71b}{total\_vports}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00140}\mbox{\hyperlink{structmlx5__eswitch_a474ccc3613e368863ef976a86cb3d1c9}{00140}}         \textcolor{keywordtype}{int}                     \mbox{\hyperlink{structmlx5__eswitch_a474ccc3613e368863ef976a86cb3d1c9}{enabled\_vports}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00141}00141 \};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00142}00142 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00143}\mbox{\hyperlink{structmlx5__esw__vport__info}{00143}} \textcolor{keyword}{struct }\mbox{\hyperlink{structmlx5__esw__vport__info}{mlx5\_esw\_vport\_info}} \{}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00144}\mbox{\hyperlink{structmlx5__esw__vport__info_a38029661f3f11c23e13e83e016c74b1e}{00144}}         \_\_u32 \mbox{\hyperlink{structmlx5__esw__vport__info_a38029661f3f11c23e13e83e016c74b1e}{vf}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00145}\mbox{\hyperlink{structmlx5__esw__vport__info_a2f410e0d00341daab97d03923fa5d665}{00145}}         \_\_u8 \mbox{\hyperlink{structmlx5__esw__vport__info_a2f410e0d00341daab97d03923fa5d665}{mac}}[32];}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00146}\mbox{\hyperlink{structmlx5__esw__vport__info_ad0dd4e04f844d897025c78b78415ccb4}{00146}}         \_\_u32 \mbox{\hyperlink{structmlx5__esw__vport__info_ad0dd4e04f844d897025c78b78415ccb4}{vlan}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00147}\mbox{\hyperlink{structmlx5__esw__vport__info_a5f8002f7e515c2f0b99a0af80f9caaeb}{00147}}         \_\_u32 \mbox{\hyperlink{structmlx5__esw__vport__info_a5f8002f7e515c2f0b99a0af80f9caaeb}{qos}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00148}\mbox{\hyperlink{structmlx5__esw__vport__info_aa10ccc0404ab33682012f9a7cdcd0fba}{00148}}         \_\_u32 \mbox{\hyperlink{structmlx5__esw__vport__info_aa10ccc0404ab33682012f9a7cdcd0fba}{spoofchk}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00149}\mbox{\hyperlink{structmlx5__esw__vport__info_aedef1ff12e44638e5597c60315509cad}{00149}}         \_\_u32 \mbox{\hyperlink{structmlx5__esw__vport__info_aedef1ff12e44638e5597c60315509cad}{linkstate}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00150}\mbox{\hyperlink{structmlx5__esw__vport__info_a7c0b5ff728c7297642d182597cb96e79}{00150}}         \_\_u32 \mbox{\hyperlink{structmlx5__esw__vport__info_a7c0b5ff728c7297642d182597cb96e79}{min\_tx\_rate}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00151}\mbox{\hyperlink{structmlx5__esw__vport__info_a98d49835f41cb9002fbe4c15045ef94f}{00151}}         \_\_u32 \mbox{\hyperlink{structmlx5__esw__vport__info_a98d49835f41cb9002fbe4c15045ef94f}{max\_tx\_rate}};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00152}00152 \};}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00154}00154 \textcolor{comment}{/* E-\/Switch API */}}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00155}00155 \textcolor{keywordtype}{int} \mbox{\hyperlink{eswitch_8h_a26f9ac558284dfa0c878db41e813acc3}{mlx5\_eswitch\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__core__dev}{mlx5\_core\_dev}} *dev, \textcolor{keywordtype}{int} total\_vports);}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00156}00156 \textcolor{keywordtype}{void} \mbox{\hyperlink{eswitch_8h_af4ee0523a44216f602955f10ceda8f23}{mlx5\_eswitch\_cleanup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw);}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00157}00157 \textcolor{keywordtype}{void} \mbox{\hyperlink{eswitch_8h_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{eswitch_8h_source_l00158}00158 \textcolor{keywordtype}{int} \mbox{\hyperlink{eswitch_8h_adae5b7b4f78a67ff26d2a4eac47d92a5}{mlx5\_eswitch\_enable\_sriov}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw, \textcolor{keywordtype}{int} nvfs);}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00159}00159 \textcolor{keywordtype}{void} \mbox{\hyperlink{eswitch_8h_a3f620248bb6a102997a1566b0d34f3b0}{mlx5\_eswitch\_disable\_sriov}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw);}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00160}00160 \textcolor{keywordtype}{int} \mbox{\hyperlink{eswitch_8h_a92494f11529c02721cf65de31291a0bb}{mlx5\_eswitch\_set\_vport\_mac}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00161}00161                                \textcolor{keywordtype}{int} vport, u8 mac[ETH\_ALEN]);}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00162}00162 \textcolor{keywordtype}{int} \mbox{\hyperlink{eswitch_8h_ad3ce4a6f6736fa9f1dfbd4c2c494972e}{mlx5\_eswitch\_set\_vport\_state}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00163}00163                                  \textcolor{keywordtype}{int} vport, \textcolor{keywordtype}{int} link\_state);}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00164}00164 \textcolor{keywordtype}{int} \mbox{\hyperlink{eswitch_8h_a46e8ec40871eda1abfe6dfb7ff9536d8}{mlx5\_eswitch\_set\_vport\_vlan}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00165}00165                                 \textcolor{keywordtype}{int} vport, u16 vlan, u8 qos);}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00166}00166 \textcolor{keywordtype}{int} \mbox{\hyperlink{eswitch_8h_a338d26a3b2a50b61126799b15d2473f9}{mlx5\_eswitch\_get\_vport\_config}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__eswitch}{mlx5\_eswitch}} *esw,}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00167}00167                                   \textcolor{keywordtype}{int} vport, \textcolor{keyword}{struct} \mbox{\hyperlink{structmlx5__esw__vport__info}{mlx5\_esw\_vport\_info}} *evi);}
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00168}00168 }
\DoxyCodeLine{\Hypertarget{eswitch_8h_source_l00169}00169 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* \_\_MLX5\_ESWITCH\_H\_\_ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
