summaryrefslogtreecommitdiff
path: root/misc/pres_dsa_en.tex
blob: 8e51e98b519f1e3077c6b3d639353cf41c506a7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
\input{configpres}

\section{Distributed Switch Architecture}

\title{Distributed Switch Architecture}
\maketitle

\begin{frame}{Agenda}
  \tableofcontents
\end{frame}

\section{DSA}
\label{sec:dsa}

\begin{frame}{What is DSA?}
  \begin{block}{Distributed Switch Architecture \cite{dsa_doc}}
    \begin{itemize}
    \item Framework in Linux Kernel to support switches
    \item Enables and supports cascaded switch setups
    \end{itemize}
  \end{block}
  \begin{block}{Design Goals \cite{dsa_doc}}
    \begin{itemize}
    \item Model switch ports as regular network interfaces
    \item Allows configuration with standard Linux utilities
    \end{itemize}
  \end{block}
\end{frame}

\begin{frame}{Supported Switches}
  \begin{block}{Supported Switches}
    \begin{itemize}
    \item Marvell MV88E6xxx
    \item Broadcom B53 and Starfighter 2
    \item Realtek RTL8366
    \item Mediatek MT7530
    \item Microchip LAN9303, KSZ 9477
    \item Vitesse VSC73xx
    \end{itemize}
  \end{block}
\end{frame}

\begin{frame}{History}
  \begin{block}{Chronic \cite{dsa_slides}}
    \begin{itemize}
    \item 2008: Introduced first for Marvell switches
    \item 2014: Added support for Broadcom SF2
    \item 2015: Added functionality for device tree, VLANs, hardware bridging, ...
    \item 2016: Added additional switches
    \item 2017: Added additional switches and port mirroring
    \item 2018: Added \textbf{PTP} support for Marvell Topaz switches
    \end{itemize}
  \end{block}
\end{frame}

\begin{frame}{DSA Structure}
  \begin{figure}[htbp]
    \centering
    \includegraphics[scale=0.45]{images/dsa.png}
    \caption{DSA Structure \cite{dsa_paper}}
    \label{fig:dsastructure}
  \end{figure}
\end{frame}

\begin{frame}[fragile]{Linux Interface Example}
\begin{Verbatim}[fontsize=\tiny]
# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT \
    group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT \
    group default qlen 1024
    link/ether 52:52:08:6c:37:bb brd ff:ff:ff:ff:ff:ff
3: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
4: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br0 \
    state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
    link/ether 52:52:08:6c:37:bb brd ff:ff:ff:ff:ff:ff
5: lan1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 \
    state UP mode DEFAULT group default qlen 1000
    link/ether 52:52:08:6c:37:bb brd ff:ff:ff:ff:ff:ff
6: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br0 \
    state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
    link/ether 52:52:08:6c:37:bb brd ff:ff:ff:ff:ff:ff
7: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT \
    group default qlen 1000
    link/ether 52:52:08:6c:37:bb brd ff:ff:ff:ff:ff:ff
\end{Verbatim}
\end{frame}

\begin{frame}[fragile]{Linux Device Tree Example I}
\begin{Verbatim}[fontsize=\scriptsize]
&mdio {
    switch0: switch0@1 {
        compatible = "marvell,mv88e6085";
        reg = <1>;
        dsa,member = <0 0>;
        ports {
            port@0 {
                reg = <0>;
                label = "cpu";
                ethernet = <&eth0>;
            };
            port@1 {
                reg = <1>;
                label = "lan0";
                phy-handle = <&switch0phy0>;
            };
        };
    };
};
\end{Verbatim}
\end{frame}

\begin{frame}[fragile]{Linux Device Tree Example II}
\begin{Verbatim}[fontsize=\scriptsize]
&eth0 {
    phy-mode = "rgmii-id";
    status = "okay";

    fixed-link {
        speed = <1000>;
        full-duplex;
    };
};
\end{Verbatim}
\end{frame}

\begin{frame}{DSA Driver Implementation}
  \begin{block}{Driver}
    \begin{itemize}
    \item Driver has to implement \texttt{dsa\_switch\_ops}
    \item Afterwards call \texttt{dsa\_register\_switch()}
    \end{itemize}
  \end{block}
  \begin{block}{DSA Switch Operations}
    \begin{itemize}
    \item Enabling/Disabling ports
    \item VLAN and bridging support
    \item PHY and Linkstates
    \item Ethtool integration
    \end{itemize}
  \end{block}
\end{frame}

\begin{frame}{Switch Tagging}
  \begin{block}{Tagging}
    \begin{itemize}
    \item Ethernet frames between CPU, DSA and master ports have additional data
    \item Used for meta data and port control
    \end{itemize}
  \end{block}
  \begin{block}{Current Supported Protocols}
    \begin{itemize}
    \item DSA, EDSA
    \item Broadcom tags
    \item KSZ Tail tagging
    \item LAN9303 tags, ...
    \end{itemize}
  \end{block}
\end{frame}

\begin{frame}{Tagging Example}
  \begin{figure}[htbp]
    \centering
    \includegraphics[scale=0.45]{images/tagging.png}
    \caption{Example Switch Tags \cite{dsa_paper}}
    \label{fig:dsatags}
  \end{figure}
\end{frame}

\begin{frame}{Frame Processing}
  \begin{block}{Receive Path}
    \begin{itemize}
    \item Master interface calls \texttt{netif\_receive\_skb()}
    \item Parse switch tags and select corresponding slave interface
    \item Slave interface calls \texttt{netif\_receive\_skb()}
    \end{itemize}
  \end{block}
  \begin{block}{Transmit Path}
    \begin{itemize}
    \item Slave interface sends frame
    \item Tagger adds the corresponding switch tags
    \item Frame is passed to master interface and sent to the switch
    \end{itemize}
  \end{block}
\end{frame}

\begin{frame}{Distributed Architecture}
  \begin{figure}[htbp]
    \centering
    \includegraphics[scale=0.4]{images/distributed.png}
    \caption{Distributed Example \cite{dsa_paper}}
    \label{fig:distributed}
  \end{figure}
\end{frame}

\section{Switchdev}
\label{sec:switchdev}

\begin{frame}{Agenda}
  \tableofcontents[currentsection]
\end{frame}

\begin{frame}{What is switchdev?}
  \begin{block}{Switchdev \cite{switchdev_doc}}
    \begin{itemize}
    \item Switchdev is a framework for configuring switches
    \item It is not a device driver model
    \end{itemize}
  \end{block}
  \begin{block}{Design Goals \cite{switchdev_doc}}
    \begin{itemize}
    \item Model switch ports as regular network interfaces
    \item Offload switch constructs to hardware
    \end{itemize}
  \end{block}
\end{frame}

\begin{frame}{Switchdev vs. DSA}
  \begin{block}{Switchdev vs. DSA}
    \begin{itemize}
    \item DSA uses Switchdev for hardware offloading
    \item DSA exposes a well defined device driver model for Ethernet switches
    \item DSA supports switch tagging
    \item DSA supports cascading multiple switches
    \end{itemize}
  \end{block}
\end{frame}

\section{PTP}
\label{sec:ptp}

\begin{frame}{Agenda}
  \tableofcontents[currentsection]
\end{frame}

\begin{frame}{DSA and PTP}
  \begin{block}{PTP Support}
    \begin{itemize}
    \item PTP support for DSA was merged in 2018
    \item PTP is implemented for Marvell 88e6xxx driver
    \item Timestamping possible for DSA slave devices
    \item ptp4l may run on the individual slave devices
    \end{itemize}
  \end{block}
\end{frame}

\begin{frame}[fragile]{DSA/PTP Patch Series}
\begin{Verbatim}[fontsize=\scriptsize]
 LINK: https://patchwork.ozlabs.org/cover/873211/
 drivers/net/dsa/mv88e6xxx/Kconfig           |  10 +
 drivers/net/dsa/mv88e6xxx/Makefile          |   4 +
 drivers/net/dsa/mv88e6xxx/chip.c            |  67 ++++
 drivers/net/dsa/mv88e6xxx/chip.h            | 103 +++++
 drivers/net/dsa/mv88e6xxx/global2.c         |   9 +-
 drivers/net/dsa/mv88e6xxx/global2.h         |  85 +++-
 drivers/net/dsa/mv88e6xxx/global2_avb.c     | 193 +++++++++
 drivers/net/dsa/mv88e6xxx/global2_scratch.c | 240 ++++++++++++
 drivers/net/dsa/mv88e6xxx/hwtstamp.c        | 584 ++++++++++++++++++++++++++++
 drivers/net/dsa/mv88e6xxx/hwtstamp.h        | 172 ++++++++
 drivers/net/dsa/mv88e6xxx/ptp.c             | 381 ++++++++++++++++++
 drivers/net/dsa/mv88e6xxx/ptp.h             | 108 +++++
 include/linux/ptp_classify.h                |   4 +
 include/net/dsa.h                           |  20 +
 net/dsa/dsa.c                               |  36 ++
 net/dsa/slave.c                             |  59 +++
 16 files changed, 2070 insertions(+), 5 deletions(-)
\end{Verbatim}
\end{frame}

\begin{frame}[fragile]{DSA/PTP Callbacks}
PTP Callbacks for DSA ops
\begin{Verbatim}[fontsize=\scriptsize]
  struct dsa_switch_ops {
  [...]
    /*
     * PTP functionality
     */
    int  (*port_hwtstamp_get)(struct dsa_switch *ds, int port,
                              struct ifreq *ifr);
    int  (*port_hwtstamp_set)(struct dsa_switch *ds, int port,
                              struct ifreq *ifr);
    bool  (*port_txtstamp)(struct dsa_switch *ds, int port,
           struct sk_buff *clone, unsigned int type);
    bool  (*port_rxtstamp)(struct dsa_switch *ds, int port,
           struct sk_buff *skb, unsigned int type);
  };
\end{Verbatim}
\end{frame}

% \section{Belden TSN Switch IP}
% \label{sec:belden-tsn-switch}

% \begin{frame}{Agenda}
%   \tableofcontents[currentsection]
% \end{frame}

% \begin{frame}{Switch IP Integration}
%   \begin{block}{Belden TSN Switch IP Architecture}
%     \begin{itemize}
%     \item Switch IP has three ports
%     \item One CPU port and two switch ports
%     \item CPU port is connected to a regular Ethernet controller
%     \end{itemize}
%   \end{block}
%   \begin{block}{What's needed?}
%     \begin{enumerate}
%     \item DSA driver
%     \item Support for Belden's switch tagging protocol
%     \item Support for PTP
%     \end{enumerate}
%   \end{block}
% \end{frame}

\section{References}
\label{sec:references}

\begin{frame}{Agenda}
  \tableofcontents[currentsection]
\end{frame}

\begin{frame}[allowframebreaks]{References}
  \bibliographystyle{IEEEtranM}
  \bibliography{ref_dsa_en}
\end{frame}

\input{tailpres}