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

1 // SPDX-License-Identifier: GPL-2.0+
20 if (entry->cookie == cookie) in sparx5_tc_matchall_entry_find()
33 entry->port = port; in sparx5_tc_matchall_parse_action()
34 entry->type = action->id; in sparx5_tc_matchall_parse_action()
35 entry->ingress = ingress; in sparx5_tc_matchall_parse_action()
36 entry->cookie = cookie; in sparx5_tc_matchall_parse_action()
43 entry->mirror.port = netdev_priv(action->dev); in sparx5_tc_matchall_parse_mirror_action()
53 struct sparx5 *sparx5; in sparx5_tc_matchall_replace() local
56 if (!flow_offload_has_one_action(&tmo->rule->action)) { in sparx5_tc_matchall_replace()
57 NL_SET_ERR_MSG_MOD(tmo->common.extack, in sparx5_tc_matchall_replace()
59 return -EOPNOTSUPP; in sparx5_tc_matchall_replace()
61 action = &tmo->rule->action.entries[0]; in sparx5_tc_matchall_replace()
65 return -ENOMEM; in sparx5_tc_matchall_replace()
71 tmo->cookie); in sparx5_tc_matchall_replace()
73 sparx5 = port->sparx5; in sparx5_tc_matchall_replace()
74 switch (action->id) { in sparx5_tc_matchall_replace()
79 switch (err) { in sparx5_tc_matchall_replace()
80 case -EEXIST: in sparx5_tc_matchall_replace()
81 NL_SET_ERR_MSG_MOD(tmo->common.extack, in sparx5_tc_matchall_replace()
84 case -EINVAL: in sparx5_tc_matchall_replace()
85 NL_SET_ERR_MSG_MOD(tmo->common.extack, in sparx5_tc_matchall_replace()
88 case -ENOENT: in sparx5_tc_matchall_replace()
89 NL_SET_ERR_MSG_MOD(tmo->common.extack, in sparx5_tc_matchall_replace()
93 NL_SET_ERR_MSG_MOD(tmo->common.extack, in sparx5_tc_matchall_replace()
100 sparx5_mirror_stats(mall_entry, &tmo->stats); in sparx5_tc_matchall_replace()
103 err = vcap_enable_lookups(sparx5->vcap_ctrl, ndev, in sparx5_tc_matchall_replace()
104 tmo->common.chain_index, in sparx5_tc_matchall_replace()
105 action->chain_index, tmo->cookie, in sparx5_tc_matchall_replace()
107 if (err == -EFAULT) { in sparx5_tc_matchall_replace()
108 NL_SET_ERR_MSG_MOD(tmo->common.extack, in sparx5_tc_matchall_replace()
110 return -EOPNOTSUPP; in sparx5_tc_matchall_replace()
112 if (err == -EADDRINUSE) { in sparx5_tc_matchall_replace()
113 NL_SET_ERR_MSG_MOD(tmo->common.extack, in sparx5_tc_matchall_replace()
115 return -EOPNOTSUPP; in sparx5_tc_matchall_replace()
117 if (err == -EADDRNOTAVAIL) { in sparx5_tc_matchall_replace()
118 NL_SET_ERR_MSG_MOD(tmo->common.extack, in sparx5_tc_matchall_replace()
120 return -EOPNOTSUPP; in sparx5_tc_matchall_replace()
123 NL_SET_ERR_MSG_MOD(tmo->common.extack, in sparx5_tc_matchall_replace()
129 NL_SET_ERR_MSG_MOD(tmo->common.extack, "Unsupported action"); in sparx5_tc_matchall_replace()
130 return -EOPNOTSUPP; in sparx5_tc_matchall_replace()
133 list_add_tail(&mall_entry->list, &sparx5->mall_entries); in sparx5_tc_matchall_replace()
143 struct sparx5 *sparx5 = port->sparx5; in sparx5_tc_matchall_destroy() local
147 entry = sparx5_tc_matchall_entry_find(&sparx5->mall_entries, in sparx5_tc_matchall_destroy()
148 tmo->cookie); in sparx5_tc_matchall_destroy()
150 return -ENOENT; in sparx5_tc_matchall_destroy()
152 if (entry->type == FLOW_ACTION_MIRRED) { in sparx5_tc_matchall_destroy()
154 } else if (entry->type == FLOW_ACTION_GOTO) { in sparx5_tc_matchall_destroy()
155 err = vcap_enable_lookups(sparx5->vcap_ctrl, ndev, in sparx5_tc_matchall_destroy()
156 0, 0, tmo->cookie, false); in sparx5_tc_matchall_destroy()
158 NL_SET_ERR_MSG_MOD(tmo->common.extack, "Unsupported action"); in sparx5_tc_matchall_destroy()
159 err = -EOPNOTSUPP; in sparx5_tc_matchall_destroy()
162 list_del(&entry->list); in sparx5_tc_matchall_destroy()
172 struct sparx5 *sparx5 = port->sparx5; in sparx5_tc_matchall_stats() local
175 entry = sparx5_tc_matchall_entry_find(&sparx5->mall_entries, in sparx5_tc_matchall_stats()
176 tmo->cookie); in sparx5_tc_matchall_stats()
178 return -ENOENT; in sparx5_tc_matchall_stats()
180 if (entry->type == FLOW_ACTION_MIRRED) { in sparx5_tc_matchall_stats()
181 sparx5_mirror_stats(entry, &tmo->stats); in sparx5_tc_matchall_stats()
183 NL_SET_ERR_MSG_MOD(tmo->common.extack, "Unsupported action"); in sparx5_tc_matchall_stats()
184 return -EOPNOTSUPP; in sparx5_tc_matchall_stats()
194 switch (tmo->command) { in sparx5_tc_matchall()
202 return -EOPNOTSUPP; in sparx5_tc_matchall()