Lines Matching +full:sparx5 +full:- +full:switch

1 // SPDX-License-Identifier: GPL-2.0+
2 /* Microchip Sparx5 Switch driver VCAP debugFS implementation
18 switch (value) { in sparx5_vcap_is0_etype_str()
42 switch (value) { in sparx5_vcap_is0_mpls_str()
66 switch (value) { in sparx5_vcap_is0_mlbs_str()
76 static void sparx5_vcap_is0_port_keys(struct sparx5 *sparx5, in sparx5_vcap_is0_port_keys() argument
84 out->prf(out->dst, " port[%02d] (%s): ", port->portno, in sparx5_vcap_is0_port_keys()
85 netdev_name(port->ndev)); in sparx5_vcap_is0_port_keys()
86 for (lookup = 0; lookup < admin->lookups; ++lookup) { in sparx5_vcap_is0_port_keys()
87 out->prf(out->dst, "\n Lookup %d: ", lookup); in sparx5_vcap_is0_port_keys()
90 value = spx5_rd(sparx5, in sparx5_vcap_is0_port_keys()
91 ANA_CL_ADV_CL_CFG(port->portno, lookup)); in sparx5_vcap_is0_port_keys()
92 out->prf(out->dst, "\n state: "); in sparx5_vcap_is0_port_keys()
94 out->prf(out->dst, "on"); in sparx5_vcap_is0_port_keys()
96 out->prf(out->dst, "off"); in sparx5_vcap_is0_port_keys()
98 out->prf(out->dst, "\n etype: %s", in sparx5_vcap_is0_port_keys()
101 out->prf(out->dst, "\n ipv4: %s", in sparx5_vcap_is0_port_keys()
104 out->prf(out->dst, "\n ipv6: %s", in sparx5_vcap_is0_port_keys()
107 out->prf(out->dst, "\n mpls_uc: %s", in sparx5_vcap_is0_port_keys()
110 out->prf(out->dst, "\n mpls_mc: %s", in sparx5_vcap_is0_port_keys()
113 out->prf(out->dst, "\n mlbs: %s", in sparx5_vcap_is0_port_keys()
116 out->prf(out->dst, "\n"); in sparx5_vcap_is0_port_keys()
119 static void sparx5_vcap_is2_port_keys(struct sparx5 *sparx5, in sparx5_vcap_is2_port_keys() argument
127 out->prf(out->dst, " port[%02d] (%s): ", port->portno, in sparx5_vcap_is2_port_keys()
128 netdev_name(port->ndev)); in sparx5_vcap_is2_port_keys()
129 for (lookup = 0; lookup < admin->lookups; ++lookup) { in sparx5_vcap_is2_port_keys()
130 out->prf(out->dst, "\n Lookup %d: ", lookup); in sparx5_vcap_is2_port_keys()
133 value = spx5_rd(sparx5, ANA_ACL_VCAP_S2_CFG(port->portno)); in sparx5_vcap_is2_port_keys()
134 out->prf(out->dst, "\n state: "); in sparx5_vcap_is2_port_keys()
136 out->prf(out->dst, "on"); in sparx5_vcap_is2_port_keys()
138 out->prf(out->dst, "off"); in sparx5_vcap_is2_port_keys()
141 value = spx5_rd(sparx5, in sparx5_vcap_is2_port_keys()
142 ANA_ACL_VCAP_S2_KEY_SEL(port->portno, lookup)); in sparx5_vcap_is2_port_keys()
144 out->prf(out->dst, "\n noneth: "); in sparx5_vcap_is2_port_keys()
145 switch (ANA_ACL_VCAP_S2_KEY_SEL_NON_ETH_KEY_SEL_GET(value)) { in sparx5_vcap_is2_port_keys()
147 out->prf(out->dst, "mac_etype"); in sparx5_vcap_is2_port_keys()
150 out->prf(out->dst, "custom1"); in sparx5_vcap_is2_port_keys()
153 out->prf(out->dst, "custom2"); in sparx5_vcap_is2_port_keys()
156 out->prf(out->dst, "none"); in sparx5_vcap_is2_port_keys()
159 out->prf(out->dst, "\n ipv4_mc: "); in sparx5_vcap_is2_port_keys()
160 switch (ANA_ACL_VCAP_S2_KEY_SEL_IP4_MC_KEY_SEL_GET(value)) { in sparx5_vcap_is2_port_keys()
162 out->prf(out->dst, "mac_etype"); in sparx5_vcap_is2_port_keys()
165 out->prf(out->dst, "ip4_tcp_udp ip4_other"); in sparx5_vcap_is2_port_keys()
168 out->prf(out->dst, "ip_7tuple"); in sparx5_vcap_is2_port_keys()
171 out->prf(out->dst, "ip4_vid"); in sparx5_vcap_is2_port_keys()
174 out->prf(out->dst, "\n ipv4_uc: "); in sparx5_vcap_is2_port_keys()
175 switch (ANA_ACL_VCAP_S2_KEY_SEL_IP4_UC_KEY_SEL_GET(value)) { in sparx5_vcap_is2_port_keys()
177 out->prf(out->dst, "mac_etype"); in sparx5_vcap_is2_port_keys()
180 out->prf(out->dst, "ip4_tcp_udp ip4_other"); in sparx5_vcap_is2_port_keys()
183 out->prf(out->dst, "ip_7tuple"); in sparx5_vcap_is2_port_keys()
186 out->prf(out->dst, "\n ipv6_mc: "); in sparx5_vcap_is2_port_keys()
187 switch (ANA_ACL_VCAP_S2_KEY_SEL_IP6_MC_KEY_SEL_GET(value)) { in sparx5_vcap_is2_port_keys()
189 out->prf(out->dst, "mac_etype"); in sparx5_vcap_is2_port_keys()
192 out->prf(out->dst, "ip_7tuple"); in sparx5_vcap_is2_port_keys()
195 out->prf(out->dst, "ip6_vid"); in sparx5_vcap_is2_port_keys()
198 out->prf(out->dst, "ip6_std"); in sparx5_vcap_is2_port_keys()
201 out->prf(out->dst, "ip4_tcp_udp ip4_other"); in sparx5_vcap_is2_port_keys()
204 out->prf(out->dst, "\n ipv6_uc: "); in sparx5_vcap_is2_port_keys()
205 switch (ANA_ACL_VCAP_S2_KEY_SEL_IP6_UC_KEY_SEL_GET(value)) { in sparx5_vcap_is2_port_keys()
207 out->prf(out->dst, "mac_etype"); in sparx5_vcap_is2_port_keys()
210 out->prf(out->dst, "ip_7tuple"); in sparx5_vcap_is2_port_keys()
213 out->prf(out->dst, "ip6_std"); in sparx5_vcap_is2_port_keys()
216 out->prf(out->dst, "ip4_tcp_udp ip4_other"); in sparx5_vcap_is2_port_keys()
219 out->prf(out->dst, "\n arp: "); in sparx5_vcap_is2_port_keys()
220 switch (ANA_ACL_VCAP_S2_KEY_SEL_ARP_KEY_SEL_GET(value)) { in sparx5_vcap_is2_port_keys()
222 out->prf(out->dst, "mac_etype"); in sparx5_vcap_is2_port_keys()
225 out->prf(out->dst, "arp"); in sparx5_vcap_is2_port_keys()
229 out->prf(out->dst, "\n"); in sparx5_vcap_is2_port_keys()
232 static void sparx5_vcap_is2_port_stickies(struct sparx5 *sparx5, in sparx5_vcap_is2_port_stickies() argument
239 out->prf(out->dst, " Sticky bits: "); in sparx5_vcap_is2_port_stickies()
240 for (lookup = 0; lookup < admin->lookups; ++lookup) { in sparx5_vcap_is2_port_stickies()
241 out->prf(out->dst, "\n Lookup %d: ", lookup); in sparx5_vcap_is2_port_stickies()
243 value = spx5_rd(sparx5, ANA_ACL_SEC_LOOKUP_STICKY(lookup)); in sparx5_vcap_is2_port_stickies()
246 out->prf(out->dst, " sel_clm"); in sparx5_vcap_is2_port_stickies()
248 out->prf(out->dst, " sel_irleg"); in sparx5_vcap_is2_port_stickies()
250 out->prf(out->dst, " sel_erleg"); in sparx5_vcap_is2_port_stickies()
252 out->prf(out->dst, " sel_port"); in sparx5_vcap_is2_port_stickies()
254 out->prf(out->dst, " custom2"); in sparx5_vcap_is2_port_stickies()
256 out->prf(out->dst, " custom1"); in sparx5_vcap_is2_port_stickies()
258 out->prf(out->dst, " oam"); in sparx5_vcap_is2_port_stickies()
260 out->prf(out->dst, " ip6_vid"); in sparx5_vcap_is2_port_stickies()
262 out->prf(out->dst, " ip6_std"); in sparx5_vcap_is2_port_stickies()
264 out->prf(out->dst, " ip6_tcpudp"); in sparx5_vcap_is2_port_stickies()
266 out->prf(out->dst, " ip_7tuple"); in sparx5_vcap_is2_port_stickies()
268 out->prf(out->dst, " ip4_vid"); in sparx5_vcap_is2_port_stickies()
270 out->prf(out->dst, " ip4_tcpudp"); in sparx5_vcap_is2_port_stickies()
272 out->prf(out->dst, " ip4_other"); in sparx5_vcap_is2_port_stickies()
274 out->prf(out->dst, " arp"); in sparx5_vcap_is2_port_stickies()
276 out->prf(out->dst, " mac_snap"); in sparx5_vcap_is2_port_stickies()
278 out->prf(out->dst, " mac_llc"); in sparx5_vcap_is2_port_stickies()
280 out->prf(out->dst, " mac_etype"); in sparx5_vcap_is2_port_stickies()
282 spx5_wr(value, sparx5, ANA_ACL_SEC_LOOKUP_STICKY(lookup)); in sparx5_vcap_is2_port_stickies()
284 out->prf(out->dst, "\n"); in sparx5_vcap_is2_port_stickies()
287 static void sparx5_vcap_es0_port_keys(struct sparx5 *sparx5, in sparx5_vcap_es0_port_keys() argument
294 out->prf(out->dst, " port[%02d] (%s): ", port->portno, in sparx5_vcap_es0_port_keys()
295 netdev_name(port->ndev)); in sparx5_vcap_es0_port_keys()
296 out->prf(out->dst, "\n Lookup 0: "); in sparx5_vcap_es0_port_keys()
299 value = spx5_rd(sparx5, REW_ES0_CTRL); in sparx5_vcap_es0_port_keys()
300 out->prf(out->dst, "\n state: "); in sparx5_vcap_es0_port_keys()
302 out->prf(out->dst, "on"); in sparx5_vcap_es0_port_keys()
304 out->prf(out->dst, "off"); in sparx5_vcap_es0_port_keys()
306 out->prf(out->dst, "\n keyset: "); in sparx5_vcap_es0_port_keys()
307 value = spx5_rd(sparx5, REW_RTAG_ETAG_CTRL(port->portno)); in sparx5_vcap_es0_port_keys()
308 switch (REW_RTAG_ETAG_CTRL_ES0_ISDX_KEY_ENA_GET(value)) { in sparx5_vcap_es0_port_keys()
310 out->prf(out->dst, "normal"); in sparx5_vcap_es0_port_keys()
313 out->prf(out->dst, "isdx"); in sparx5_vcap_es0_port_keys()
316 out->prf(out->dst, "vid"); in sparx5_vcap_es0_port_keys()
319 out->prf(out->dst, "reserved"); in sparx5_vcap_es0_port_keys()
322 out->prf(out->dst, "\n"); in sparx5_vcap_es0_port_keys()
325 static void sparx5_vcap_es2_port_keys(struct sparx5 *sparx5, in sparx5_vcap_es2_port_keys() argument
333 out->prf(out->dst, " port[%02d] (%s): ", port->portno, in sparx5_vcap_es2_port_keys()
334 netdev_name(port->ndev)); in sparx5_vcap_es2_port_keys()
335 for (lookup = 0; lookup < admin->lookups; ++lookup) { in sparx5_vcap_es2_port_keys()
336 out->prf(out->dst, "\n Lookup %d: ", lookup); in sparx5_vcap_es2_port_keys()
339 value = spx5_rd(sparx5, EACL_VCAP_ES2_KEY_SEL(port->portno, in sparx5_vcap_es2_port_keys()
341 out->prf(out->dst, "\n state: "); in sparx5_vcap_es2_port_keys()
343 out->prf(out->dst, "on"); in sparx5_vcap_es2_port_keys()
345 out->prf(out->dst, "off"); in sparx5_vcap_es2_port_keys()
347 out->prf(out->dst, "\n arp: "); in sparx5_vcap_es2_port_keys()
348 switch (EACL_VCAP_ES2_KEY_SEL_ARP_KEY_SEL_GET(value)) { in sparx5_vcap_es2_port_keys()
350 out->prf(out->dst, "mac_etype"); in sparx5_vcap_es2_port_keys()
353 out->prf(out->dst, "arp"); in sparx5_vcap_es2_port_keys()
356 out->prf(out->dst, "\n ipv4: "); in sparx5_vcap_es2_port_keys()
357 switch (EACL_VCAP_ES2_KEY_SEL_IP4_KEY_SEL_GET(value)) { in sparx5_vcap_es2_port_keys()
359 out->prf(out->dst, "mac_etype"); in sparx5_vcap_es2_port_keys()
362 out->prf(out->dst, "ip_7tuple"); in sparx5_vcap_es2_port_keys()
365 out->prf(out->dst, "ip4_tcp_udp ip4_vid"); in sparx5_vcap_es2_port_keys()
368 out->prf(out->dst, "ip4_tcp_udp ip4_other"); in sparx5_vcap_es2_port_keys()
371 out->prf(out->dst, "ip4_vid"); in sparx5_vcap_es2_port_keys()
374 out->prf(out->dst, "ip4_other"); in sparx5_vcap_es2_port_keys()
377 out->prf(out->dst, "\n ipv6: "); in sparx5_vcap_es2_port_keys()
378 switch (EACL_VCAP_ES2_KEY_SEL_IP6_KEY_SEL_GET(value)) { in sparx5_vcap_es2_port_keys()
380 out->prf(out->dst, "mac_etype"); in sparx5_vcap_es2_port_keys()
383 out->prf(out->dst, "ip_7tuple"); in sparx5_vcap_es2_port_keys()
386 out->prf(out->dst, "ip_7tuple ip6_vid"); in sparx5_vcap_es2_port_keys()
389 out->prf(out->dst, "ip_7tuple ip6_std"); in sparx5_vcap_es2_port_keys()
392 out->prf(out->dst, "ip6_vid"); in sparx5_vcap_es2_port_keys()
395 out->prf(out->dst, "ip6_std"); in sparx5_vcap_es2_port_keys()
398 out->prf(out->dst, "ip4_downgrade"); in sparx5_vcap_es2_port_keys()
402 out->prf(out->dst, "\n"); in sparx5_vcap_es2_port_keys()
405 static void sparx5_vcap_es2_port_stickies(struct sparx5 *sparx5, in sparx5_vcap_es2_port_stickies() argument
412 out->prf(out->dst, " Sticky bits: "); in sparx5_vcap_es2_port_stickies()
413 for (lookup = 0; lookup < admin->lookups; ++lookup) { in sparx5_vcap_es2_port_stickies()
414 value = spx5_rd(sparx5, EACL_SEC_LOOKUP_STICKY(lookup)); in sparx5_vcap_es2_port_stickies()
415 out->prf(out->dst, "\n Lookup %d: ", lookup); in sparx5_vcap_es2_port_stickies()
417 out->prf(out->dst, " ip_7tuple"); in sparx5_vcap_es2_port_stickies()
419 out->prf(out->dst, " ip6_vid"); in sparx5_vcap_es2_port_stickies()
421 out->prf(out->dst, " ip6_std"); in sparx5_vcap_es2_port_stickies()
423 out->prf(out->dst, " ip4_tcp_udp"); in sparx5_vcap_es2_port_stickies()
425 out->prf(out->dst, " ip4_vid"); in sparx5_vcap_es2_port_stickies()
427 out->prf(out->dst, " ip4_other"); in sparx5_vcap_es2_port_stickies()
429 out->prf(out->dst, " arp"); in sparx5_vcap_es2_port_stickies()
431 out->prf(out->dst, " mac_etype"); in sparx5_vcap_es2_port_stickies()
433 spx5_wr(value, sparx5, EACL_SEC_LOOKUP_STICKY(lookup)); in sparx5_vcap_es2_port_stickies()
435 out->prf(out->dst, "\n"); in sparx5_vcap_es2_port_stickies()
444 struct sparx5 *sparx5 = port->sparx5; in sparx5_port_info() local
448 vctrl = sparx5->vcap_ctrl; in sparx5_port_info()
449 vcap = &vctrl->vcaps[admin->vtype]; in sparx5_port_info()
450 out->prf(out->dst, "%s:\n", vcap->name); in sparx5_port_info()
451 switch (admin->vtype) { in sparx5_port_info()
453 sparx5_vcap_is0_port_keys(sparx5, admin, port, out); in sparx5_port_info()
456 sparx5_vcap_is2_port_keys(sparx5, admin, port, out); in sparx5_port_info()
457 sparx5_vcap_is2_port_stickies(sparx5, admin, out); in sparx5_port_info()
460 sparx5_vcap_es0_port_keys(sparx5, admin, port, out); in sparx5_port_info()
463 sparx5_vcap_es2_port_keys(sparx5, admin, port, out); in sparx5_port_info()
464 sparx5_vcap_es2_port_stickies(sparx5, admin, out); in sparx5_port_info()
467 out->prf(out->dst, " no info\n"); in sparx5_port_info()