2 * drivers/net/ethernet/mellanox/mlxsw/spectrum.h
3 * Copyright (c) 2015-2017 Mellanox Technologies. All rights reserved.
4 * Copyright (c) 2015-2017 Jiri Pirko <jiri@mellanox.com>
5 * Copyright (c) 2015 Ido Schimmel <idosch@mellanox.com>
6 * Copyright (c) 2015 Elad Raz <eladr@mellanox.com>
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the names of the copyright holders nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
20 * Alternatively, this software may be distributed under the terms of the
21 * GNU General Public License ("GPL") version 2 as published by the Free
22 * Software Foundation.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
37 #ifndef _MLXSW_SPECTRUM_H
38 #define _MLXSW_SPECTRUM_H
40 #include <linux/types.h>
41 #include <linux/netdevice.h>
42 #include <linux/rhashtable.h>
43 #include <linux/bitops.h>
44 #include <linux/if_vlan.h>
45 #include <linux/list.h>
46 #include <linux/dcbnl.h>
47 #include <linux/in6.h>
48 #include <linux/notifier.h>
49 #include <net/psample.h>
50 #include <net/pkt_cls.h>
54 #include "core_acl_flex_keys.h"
55 #include "core_acl_flex_actions.h"
57 #define MLXSW_SP_FID_8021D_MAX 1024
59 #define MLXSW_SP_MID_MAX 7000
61 #define MLXSW_SP_PORTS_PER_CLUSTER_MAX 4
63 #define MLXSW_SP_PORT_BASE_SPEED 25000 /* Mb/s */
65 #define MLXSW_SP_KVD_LINEAR_SIZE 65536 /* entries */
66 #define MLXSW_SP_KVD_GRANULARITY 128
71 struct mlxsw_sp_upper {
72 struct net_device *dev;
73 unsigned int ref_count;
76 enum mlxsw_sp_rif_type {
77 MLXSW_SP_RIF_TYPE_SUBPORT,
78 MLXSW_SP_RIF_TYPE_VLAN,
79 MLXSW_SP_RIF_TYPE_FID,
80 MLXSW_SP_RIF_TYPE_IPIP_LB, /* IP-in-IP loopback. */
81 MLXSW_SP_RIF_TYPE_MAX,
84 enum mlxsw_sp_fid_type {
85 MLXSW_SP_FID_TYPE_8021Q,
86 MLXSW_SP_FID_TYPE_8021D,
87 MLXSW_SP_FID_TYPE_RFID,
88 MLXSW_SP_FID_TYPE_DUMMY,
89 MLXSW_SP_FID_TYPE_MAX,
93 struct list_head list;
94 unsigned char addr[ETH_ALEN];
98 unsigned long *ports_in_mid; /* bits array */
101 enum mlxsw_sp_span_type {
102 MLXSW_SP_SPAN_EGRESS,
103 MLXSW_SP_SPAN_INGRESS
106 struct mlxsw_sp_span_inspected_port {
107 struct list_head list;
108 enum mlxsw_sp_span_type type;
112 struct mlxsw_sp_span_entry {
115 struct list_head bound_ports_list;
120 enum mlxsw_sp_port_mall_action_type {
121 MLXSW_SP_PORT_MALL_MIRROR,
122 MLXSW_SP_PORT_MALL_SAMPLE,
125 struct mlxsw_sp_port_mall_mirror_tc_entry {
130 struct mlxsw_sp_port_mall_tc_entry {
131 struct list_head list;
132 unsigned long cookie;
133 enum mlxsw_sp_port_mall_action_type type;
135 struct mlxsw_sp_port_mall_mirror_tc_entry mirror;
140 struct mlxsw_sp_bridge;
141 struct mlxsw_sp_router;
144 struct mlxsw_sp_counter_pool;
145 struct mlxsw_sp_fid_core;
148 struct mlxsw_sp_port **ports;
149 struct mlxsw_core *core;
150 const struct mlxsw_bus_info *bus_info;
151 unsigned char base_mac[ETH_ALEN];
152 struct mlxsw_sp_upper *lags;
154 struct mlxsw_sp_sb *sb;
155 struct mlxsw_sp_bridge *bridge;
156 struct mlxsw_sp_router *router;
157 struct mlxsw_sp_mr *mr;
158 struct mlxsw_afa *afa;
159 struct mlxsw_sp_acl *acl;
160 struct mlxsw_sp_fid_core *fid_core;
162 DECLARE_BITMAP(usage, MLXSW_SP_KVD_LINEAR_SIZE);
164 struct notifier_block netdevice_nb;
166 struct mlxsw_sp_counter_pool *counter_pool;
168 struct mlxsw_sp_span_entry *entries;
173 static inline struct mlxsw_sp_upper *
174 mlxsw_sp_lag_get(struct mlxsw_sp *mlxsw_sp, u16 lag_id)
176 return &mlxsw_sp->lags[lag_id];
179 struct mlxsw_sp_port_pcpu_stats {
184 struct u64_stats_sync syncp;
188 struct mlxsw_sp_port_sample {
189 struct psample_group __rcu *psample_group;
195 struct mlxsw_sp_bridge_port;
198 struct mlxsw_sp_port_vlan {
199 struct list_head list;
200 struct mlxsw_sp_port *mlxsw_sp_port;
201 struct mlxsw_sp_fid *fid;
203 struct mlxsw_sp_bridge_port *bridge_port;
204 struct list_head bridge_vlan_node;
207 struct mlxsw_sp_port {
208 struct net_device *dev;
209 struct mlxsw_sp_port_pcpu_stats __percpu *pcpu_stats;
210 struct mlxsw_sp *mlxsw_sp;
222 struct ieee_ets *ets;
223 struct ieee_maxrate *maxrate;
224 struct ieee_pfc *pfc;
232 struct list_head mall_tc_list;
234 #define MLXSW_HW_STATS_UPDATE_TIME HZ
235 struct rtnl_link_stats64 *cache;
236 struct delayed_work update_dw;
238 struct mlxsw_sp_port_sample *sample;
239 struct list_head vlans_list;
243 mlxsw_sp_port_is_pause_en(const struct mlxsw_sp_port *mlxsw_sp_port)
245 return mlxsw_sp_port->link.tx_pause || mlxsw_sp_port->link.rx_pause;
248 static inline struct mlxsw_sp_port *
249 mlxsw_sp_port_lagged_get(struct mlxsw_sp *mlxsw_sp, u16 lag_id, u8 port_index)
251 struct mlxsw_sp_port *mlxsw_sp_port;
254 local_port = mlxsw_core_lag_mapping_get(mlxsw_sp->core,
256 mlxsw_sp_port = mlxsw_sp->ports[local_port];
257 return mlxsw_sp_port && mlxsw_sp_port->lagged ? mlxsw_sp_port : NULL;
260 static inline struct mlxsw_sp_port_vlan *
261 mlxsw_sp_port_vlan_find_by_vid(const struct mlxsw_sp_port *mlxsw_sp_port,
264 struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan;
266 list_for_each_entry(mlxsw_sp_port_vlan, &mlxsw_sp_port->vlans_list,
268 if (mlxsw_sp_port_vlan->vid == vid)
269 return mlxsw_sp_port_vlan;
275 enum mlxsw_sp_flood_type {
276 MLXSW_SP_FLOOD_TYPE_UC,
277 MLXSW_SP_FLOOD_TYPE_BC,
278 MLXSW_SP_FLOOD_TYPE_MC,
281 /* spectrum_buffers.c */
282 int mlxsw_sp_buffers_init(struct mlxsw_sp *mlxsw_sp);
283 void mlxsw_sp_buffers_fini(struct mlxsw_sp *mlxsw_sp);
284 int mlxsw_sp_port_buffers_init(struct mlxsw_sp_port *mlxsw_sp_port);
285 int mlxsw_sp_sb_pool_get(struct mlxsw_core *mlxsw_core,
286 unsigned int sb_index, u16 pool_index,
287 struct devlink_sb_pool_info *pool_info);
288 int mlxsw_sp_sb_pool_set(struct mlxsw_core *mlxsw_core,
289 unsigned int sb_index, u16 pool_index, u32 size,
290 enum devlink_sb_threshold_type threshold_type);
291 int mlxsw_sp_sb_port_pool_get(struct mlxsw_core_port *mlxsw_core_port,
292 unsigned int sb_index, u16 pool_index,
294 int mlxsw_sp_sb_port_pool_set(struct mlxsw_core_port *mlxsw_core_port,
295 unsigned int sb_index, u16 pool_index,
297 int mlxsw_sp_sb_tc_pool_bind_get(struct mlxsw_core_port *mlxsw_core_port,
298 unsigned int sb_index, u16 tc_index,
299 enum devlink_sb_pool_type pool_type,
300 u16 *p_pool_index, u32 *p_threshold);
301 int mlxsw_sp_sb_tc_pool_bind_set(struct mlxsw_core_port *mlxsw_core_port,
302 unsigned int sb_index, u16 tc_index,
303 enum devlink_sb_pool_type pool_type,
304 u16 pool_index, u32 threshold);
305 int mlxsw_sp_sb_occ_snapshot(struct mlxsw_core *mlxsw_core,
306 unsigned int sb_index);
307 int mlxsw_sp_sb_occ_max_clear(struct mlxsw_core *mlxsw_core,
308 unsigned int sb_index);
309 int mlxsw_sp_sb_occ_port_pool_get(struct mlxsw_core_port *mlxsw_core_port,
310 unsigned int sb_index, u16 pool_index,
311 u32 *p_cur, u32 *p_max);
312 int mlxsw_sp_sb_occ_tc_port_bind_get(struct mlxsw_core_port *mlxsw_core_port,
313 unsigned int sb_index, u16 tc_index,
314 enum devlink_sb_pool_type pool_type,
315 u32 *p_cur, u32 *p_max);
316 u32 mlxsw_sp_cells_bytes(const struct mlxsw_sp *mlxsw_sp, u32 cells);
317 u32 mlxsw_sp_bytes_cells(const struct mlxsw_sp *mlxsw_sp, u32 bytes);
319 /* spectrum_switchdev.c */
320 int mlxsw_sp_switchdev_init(struct mlxsw_sp *mlxsw_sp);
321 void mlxsw_sp_switchdev_fini(struct mlxsw_sp *mlxsw_sp);
322 void mlxsw_sp_port_switchdev_init(struct mlxsw_sp_port *mlxsw_sp_port);
323 void mlxsw_sp_port_switchdev_fini(struct mlxsw_sp_port *mlxsw_sp_port);
324 int mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid,
327 mlxsw_sp_port_vlan_bridge_leave(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan);
328 int mlxsw_sp_port_bridge_join(struct mlxsw_sp_port *mlxsw_sp_port,
329 struct net_device *brport_dev,
330 struct net_device *br_dev,
331 struct netlink_ext_ack *extack);
332 void mlxsw_sp_port_bridge_leave(struct mlxsw_sp_port *mlxsw_sp_port,
333 struct net_device *brport_dev,
334 struct net_device *br_dev);
337 int mlxsw_sp_port_ets_set(struct mlxsw_sp_port *mlxsw_sp_port,
338 enum mlxsw_reg_qeec_hr hr, u8 index, u8 next_index,
339 bool dwrr, u8 dwrr_weight);
340 int mlxsw_sp_port_prio_tc_set(struct mlxsw_sp_port *mlxsw_sp_port,
341 u8 switch_prio, u8 tclass);
342 int __mlxsw_sp_port_headroom_set(struct mlxsw_sp_port *mlxsw_sp_port, int mtu,
343 u8 *prio_tc, bool pause_en,
344 struct ieee_pfc *my_pfc);
345 int mlxsw_sp_port_ets_maxrate_set(struct mlxsw_sp_port *mlxsw_sp_port,
346 enum mlxsw_reg_qeec_hr hr, u8 index,
347 u8 next_index, u32 maxrate);
348 int mlxsw_sp_port_vid_stp_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid,
350 int mlxsw_sp_port_vp_mode_set(struct mlxsw_sp_port *mlxsw_sp_port, bool enable);
351 int mlxsw_sp_port_vid_learning_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid,
353 int mlxsw_sp_port_pvid_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid);
354 struct mlxsw_sp_port_vlan *
355 mlxsw_sp_port_vlan_get(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid);
356 void mlxsw_sp_port_vlan_put(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan);
357 int mlxsw_sp_port_vlan_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid_begin,
358 u16 vid_end, bool is_member, bool untagged);
359 int mlxsw_sp_flow_counter_get(struct mlxsw_sp *mlxsw_sp,
360 unsigned int counter_index, u64 *packets,
362 int mlxsw_sp_flow_counter_alloc(struct mlxsw_sp *mlxsw_sp,
363 unsigned int *p_counter_index);
364 void mlxsw_sp_flow_counter_free(struct mlxsw_sp *mlxsw_sp,
365 unsigned int counter_index);
366 bool mlxsw_sp_port_dev_check(const struct net_device *dev);
367 struct mlxsw_sp *mlxsw_sp_lower_get(struct net_device *dev);
368 struct mlxsw_sp_port *mlxsw_sp_port_dev_lower_find(struct net_device *dev);
369 struct mlxsw_sp_port *mlxsw_sp_port_lower_dev_hold(struct net_device *dev);
370 void mlxsw_sp_port_dev_put(struct mlxsw_sp_port *mlxsw_sp_port);
371 struct mlxsw_sp_port *mlxsw_sp_port_dev_lower_find_rcu(struct net_device *dev);
374 #ifdef CONFIG_MLXSW_SPECTRUM_DCB
375 int mlxsw_sp_port_dcb_init(struct mlxsw_sp_port *mlxsw_sp_port);
376 void mlxsw_sp_port_dcb_fini(struct mlxsw_sp_port *mlxsw_sp_port);
378 static inline int mlxsw_sp_port_dcb_init(struct mlxsw_sp_port *mlxsw_sp_port)
382 static inline void mlxsw_sp_port_dcb_fini(struct mlxsw_sp_port *mlxsw_sp_port)
386 /* spectrum_router.c */
387 int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp);
388 void mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp);
389 int mlxsw_sp_router_netevent_event(struct notifier_block *unused,
390 unsigned long event, void *ptr);
391 int mlxsw_sp_netdevice_router_port_event(struct net_device *dev);
392 int mlxsw_sp_inetaddr_event(struct notifier_block *unused,
393 unsigned long event, void *ptr);
394 int mlxsw_sp_inet6addr_event(struct notifier_block *unused,
395 unsigned long event, void *ptr);
396 int mlxsw_sp_netdevice_vrf_event(struct net_device *l3_dev, unsigned long event,
397 struct netdev_notifier_changeupper_info *info);
398 bool mlxsw_sp_netdev_is_ipip(const struct mlxsw_sp *mlxsw_sp,
399 const struct net_device *dev);
401 mlxsw_sp_netdevice_ipip_event(struct mlxsw_sp *mlxsw_sp,
402 struct net_device *l3_dev,
403 unsigned long event);
405 mlxsw_sp_port_vlan_router_leave(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan);
406 void mlxsw_sp_rif_destroy(struct mlxsw_sp_rif *rif);
408 /* spectrum_kvdl.c */
409 int mlxsw_sp_kvdl_alloc(struct mlxsw_sp *mlxsw_sp, unsigned int entry_count,
411 void mlxsw_sp_kvdl_free(struct mlxsw_sp *mlxsw_sp, int entry_index);
413 struct mlxsw_sp_acl_rule_info {
414 unsigned int priority;
415 struct mlxsw_afk_element_values values;
416 struct mlxsw_afa_block *act_block;
417 unsigned int counter_index;
421 enum mlxsw_sp_acl_profile {
422 MLXSW_SP_ACL_PROFILE_FLOWER,
425 struct mlxsw_sp_acl_profile_ops {
426 size_t ruleset_priv_size;
427 int (*ruleset_add)(struct mlxsw_sp *mlxsw_sp,
428 void *priv, void *ruleset_priv);
429 void (*ruleset_del)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv);
430 int (*ruleset_bind)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv,
431 struct net_device *dev, bool ingress);
432 void (*ruleset_unbind)(struct mlxsw_sp *mlxsw_sp, void *ruleset_priv);
433 u16 (*ruleset_group_id)(void *ruleset_priv);
434 size_t rule_priv_size;
435 int (*rule_add)(struct mlxsw_sp *mlxsw_sp,
436 void *ruleset_priv, void *rule_priv,
437 struct mlxsw_sp_acl_rule_info *rulei);
438 void (*rule_del)(struct mlxsw_sp *mlxsw_sp, void *rule_priv);
439 int (*rule_activity_get)(struct mlxsw_sp *mlxsw_sp, void *rule_priv,
443 struct mlxsw_sp_acl_ops {
445 int (*init)(struct mlxsw_sp *mlxsw_sp, void *priv);
446 void (*fini)(struct mlxsw_sp *mlxsw_sp, void *priv);
447 const struct mlxsw_sp_acl_profile_ops *
448 (*profile_ops)(struct mlxsw_sp *mlxsw_sp,
449 enum mlxsw_sp_acl_profile profile);
452 struct mlxsw_sp_acl_ruleset;
455 struct mlxsw_afk *mlxsw_sp_acl_afk(struct mlxsw_sp_acl *acl);
456 struct mlxsw_sp_acl_ruleset *
457 mlxsw_sp_acl_ruleset_lookup(struct mlxsw_sp *mlxsw_sp, struct net_device *dev,
458 bool ingress, u32 chain_index,
459 enum mlxsw_sp_acl_profile profile);
460 struct mlxsw_sp_acl_ruleset *
461 mlxsw_sp_acl_ruleset_get(struct mlxsw_sp *mlxsw_sp, struct net_device *dev,
462 bool ingress, u32 chain_index,
463 enum mlxsw_sp_acl_profile profile);
464 void mlxsw_sp_acl_ruleset_put(struct mlxsw_sp *mlxsw_sp,
465 struct mlxsw_sp_acl_ruleset *ruleset);
466 u16 mlxsw_sp_acl_ruleset_group_id(struct mlxsw_sp_acl_ruleset *ruleset);
468 struct mlxsw_sp_acl_rule_info *
469 mlxsw_sp_acl_rulei_create(struct mlxsw_sp_acl *acl);
470 void mlxsw_sp_acl_rulei_destroy(struct mlxsw_sp_acl_rule_info *rulei);
471 int mlxsw_sp_acl_rulei_commit(struct mlxsw_sp_acl_rule_info *rulei);
472 void mlxsw_sp_acl_rulei_priority(struct mlxsw_sp_acl_rule_info *rulei,
473 unsigned int priority);
474 void mlxsw_sp_acl_rulei_keymask_u32(struct mlxsw_sp_acl_rule_info *rulei,
475 enum mlxsw_afk_element element,
476 u32 key_value, u32 mask_value);
477 void mlxsw_sp_acl_rulei_keymask_buf(struct mlxsw_sp_acl_rule_info *rulei,
478 enum mlxsw_afk_element element,
479 const char *key_value,
480 const char *mask_value, unsigned int len);
481 int mlxsw_sp_acl_rulei_act_continue(struct mlxsw_sp_acl_rule_info *rulei);
482 int mlxsw_sp_acl_rulei_act_jump(struct mlxsw_sp_acl_rule_info *rulei,
484 int mlxsw_sp_acl_rulei_act_drop(struct mlxsw_sp_acl_rule_info *rulei);
485 int mlxsw_sp_acl_rulei_act_trap(struct mlxsw_sp_acl_rule_info *rulei);
486 int mlxsw_sp_acl_rulei_act_fwd(struct mlxsw_sp *mlxsw_sp,
487 struct mlxsw_sp_acl_rule_info *rulei,
488 struct net_device *out_dev);
489 int mlxsw_sp_acl_rulei_act_vlan(struct mlxsw_sp *mlxsw_sp,
490 struct mlxsw_sp_acl_rule_info *rulei,
491 u32 action, u16 vid, u16 proto, u8 prio);
492 int mlxsw_sp_acl_rulei_act_count(struct mlxsw_sp *mlxsw_sp,
493 struct mlxsw_sp_acl_rule_info *rulei);
494 int mlxsw_sp_acl_rulei_act_fid_set(struct mlxsw_sp *mlxsw_sp,
495 struct mlxsw_sp_acl_rule_info *rulei,
498 struct mlxsw_sp_acl_rule;
500 struct mlxsw_sp_acl_rule *
501 mlxsw_sp_acl_rule_create(struct mlxsw_sp *mlxsw_sp,
502 struct mlxsw_sp_acl_ruleset *ruleset,
503 unsigned long cookie);
504 void mlxsw_sp_acl_rule_destroy(struct mlxsw_sp *mlxsw_sp,
505 struct mlxsw_sp_acl_rule *rule);
506 int mlxsw_sp_acl_rule_add(struct mlxsw_sp *mlxsw_sp,
507 struct mlxsw_sp_acl_rule *rule);
508 void mlxsw_sp_acl_rule_del(struct mlxsw_sp *mlxsw_sp,
509 struct mlxsw_sp_acl_rule *rule);
510 struct mlxsw_sp_acl_rule *
511 mlxsw_sp_acl_rule_lookup(struct mlxsw_sp *mlxsw_sp,
512 struct mlxsw_sp_acl_ruleset *ruleset,
513 unsigned long cookie);
514 struct mlxsw_sp_acl_rule_info *
515 mlxsw_sp_acl_rule_rulei(struct mlxsw_sp_acl_rule *rule);
516 int mlxsw_sp_acl_rule_get_stats(struct mlxsw_sp *mlxsw_sp,
517 struct mlxsw_sp_acl_rule *rule,
518 u64 *packets, u64 *bytes, u64 *last_use);
520 struct mlxsw_sp_fid *mlxsw_sp_acl_dummy_fid(struct mlxsw_sp *mlxsw_sp);
522 int mlxsw_sp_acl_init(struct mlxsw_sp *mlxsw_sp);
523 void mlxsw_sp_acl_fini(struct mlxsw_sp *mlxsw_sp);
525 /* spectrum_acl_tcam.c */
526 extern const struct mlxsw_sp_acl_ops mlxsw_sp_acl_tcam_ops;
528 /* spectrum_flower.c */
529 int mlxsw_sp_flower_replace(struct mlxsw_sp_port *mlxsw_sp_port, bool ingress,
530 struct tc_cls_flower_offload *f);
531 void mlxsw_sp_flower_destroy(struct mlxsw_sp_port *mlxsw_sp_port, bool ingress,
532 struct tc_cls_flower_offload *f);
533 int mlxsw_sp_flower_stats(struct mlxsw_sp_port *mlxsw_sp_port, bool ingress,
534 struct tc_cls_flower_offload *f);
537 int mlxsw_sp_fid_flood_set(struct mlxsw_sp_fid *fid,
538 enum mlxsw_sp_flood_type packet_type, u8 local_port,
540 int mlxsw_sp_fid_port_vid_map(struct mlxsw_sp_fid *fid,
541 struct mlxsw_sp_port *mlxsw_sp_port, u16 vid);
542 void mlxsw_sp_fid_port_vid_unmap(struct mlxsw_sp_fid *fid,
543 struct mlxsw_sp_port *mlxsw_sp_port, u16 vid);
544 enum mlxsw_sp_rif_type mlxsw_sp_fid_rif_type(const struct mlxsw_sp_fid *fid);
545 u16 mlxsw_sp_fid_index(const struct mlxsw_sp_fid *fid);
546 enum mlxsw_sp_fid_type mlxsw_sp_fid_type(const struct mlxsw_sp_fid *fid);
547 void mlxsw_sp_fid_rif_set(struct mlxsw_sp_fid *fid, struct mlxsw_sp_rif *rif);
548 enum mlxsw_sp_rif_type
549 mlxsw_sp_fid_type_rif_type(const struct mlxsw_sp *mlxsw_sp,
550 enum mlxsw_sp_fid_type type);
551 u16 mlxsw_sp_fid_8021q_vid(const struct mlxsw_sp_fid *fid);
552 struct mlxsw_sp_fid *mlxsw_sp_fid_8021q_get(struct mlxsw_sp *mlxsw_sp, u16 vid);
553 struct mlxsw_sp_fid *mlxsw_sp_fid_8021d_get(struct mlxsw_sp *mlxsw_sp,
555 struct mlxsw_sp_fid *mlxsw_sp_fid_rfid_get(struct mlxsw_sp *mlxsw_sp,
557 struct mlxsw_sp_fid *mlxsw_sp_fid_dummy_get(struct mlxsw_sp *mlxsw_sp);
558 void mlxsw_sp_fid_put(struct mlxsw_sp_fid *fid);
559 int mlxsw_sp_port_fids_init(struct mlxsw_sp_port *mlxsw_sp_port);
560 void mlxsw_sp_port_fids_fini(struct mlxsw_sp_port *mlxsw_sp_port);
561 int mlxsw_sp_fids_init(struct mlxsw_sp *mlxsw_sp);
562 void mlxsw_sp_fids_fini(struct mlxsw_sp *mlxsw_sp);