Lines Matching +full:out +full:-

1 // SPDX-License-Identifier: GPL-2.0+
23 struct vcap_output_print *out, in vcap_debugfs_show_rule_keyfield() argument
32 out->prf(out->dst, " %s: W%d: ", vcap_keyfield_name(vctrl, key), in vcap_debugfs_show_rule_keyfield()
37 out->prf(out->dst, "%d/%d", data->u1.value, data->u1.mask); in vcap_debugfs_show_rule_keyfield()
40 value = (u8 *)(&data->u32.value); in vcap_debugfs_show_rule_keyfield()
41 mask = (u8 *)(&data->u32.mask); in vcap_debugfs_show_rule_keyfield()
44 out->prf(out->dst, "%pI4h/%pI4h", &data->u32.value, in vcap_debugfs_show_rule_keyfield()
45 &data->u32.mask); in vcap_debugfs_show_rule_keyfield()
51 u32 fmsk = (1 << keyfield[key].width) - 1; in vcap_debugfs_show_rule_keyfield()
55 out->prf(out->dst, "%u/%u", data->u32.value & fmsk, in vcap_debugfs_show_rule_keyfield()
56 data->u32.mask & fmsk); in vcap_debugfs_show_rule_keyfield()
60 value = data->u48.value; in vcap_debugfs_show_rule_keyfield()
61 mask = data->u48.mask; in vcap_debugfs_show_rule_keyfield()
63 out->prf(out->dst, "%pMR/%pMR", data->u48.value, in vcap_debugfs_show_rule_keyfield()
64 data->u48.mask); in vcap_debugfs_show_rule_keyfield()
69 value = data->u56.value; in vcap_debugfs_show_rule_keyfield()
70 mask = data->u56.mask; in vcap_debugfs_show_rule_keyfield()
74 value = data->u64.value; in vcap_debugfs_show_rule_keyfield()
75 mask = data->u64.mask; in vcap_debugfs_show_rule_keyfield()
79 value = data->u72.value; in vcap_debugfs_show_rule_keyfield()
80 mask = data->u72.mask; in vcap_debugfs_show_rule_keyfield()
84 value = data->u112.value; in vcap_debugfs_show_rule_keyfield()
85 mask = data->u112.mask; in vcap_debugfs_show_rule_keyfield()
89 value = data->u128.value; in vcap_debugfs_show_rule_keyfield()
90 mask = data->u128.mask; in vcap_debugfs_show_rule_keyfield()
94 vcap_netbytes_copy(nvalue, data->u128.value, in vcap_debugfs_show_rule_keyfield()
96 vcap_netbytes_copy(nmask, data->u128.mask, in vcap_debugfs_show_rule_keyfield()
98 out->prf(out->dst, "%pI6/%pI6", nvalue, nmask); in vcap_debugfs_show_rule_keyfield()
106 out->prf(out->dst, "0x"); in vcap_debugfs_show_rule_keyfield()
108 out->prf(out->dst, "%02x", value[bytes - idx - 1]); in vcap_debugfs_show_rule_keyfield()
109 out->prf(out->dst, "/0x"); in vcap_debugfs_show_rule_keyfield()
111 out->prf(out->dst, "%02x", mask[bytes - idx - 1]); in vcap_debugfs_show_rule_keyfield()
113 out->prf(out->dst, "\n"); in vcap_debugfs_show_rule_keyfield()
118 struct vcap_output_print *out, in vcap_debugfs_show_rule_actionfield() argument
127 out->prf(out->dst, " %s: W%d: ", in vcap_debugfs_show_rule_actionfield()
133 out->prf(out->dst, "%d", value[0]); in vcap_debugfs_show_rule_actionfield()
136 fmsk = (1 << actionfield[action].width) - 1; in vcap_debugfs_show_rule_actionfield()
138 out->prf(out->dst, "%u", val & fmsk); in vcap_debugfs_show_rule_actionfield()
151 out->prf(out->dst, "0x"); in vcap_debugfs_show_rule_actionfield()
153 out->prf(out->dst, "%02x", value[bytes - idx - 1]); in vcap_debugfs_show_rule_actionfield()
155 out->prf(out->dst, "\n"); in vcap_debugfs_show_rule_actionfield()
159 struct vcap_output_print *out) in vcap_debugfs_show_keysets() argument
161 struct vcap_admin *admin = ri->admin; in vcap_debugfs_show_keysets()
170 if (ri->state == VCAP_RS_DISABLED) in vcap_debugfs_show_keysets()
173 err = vcap_find_keystream_keysets(ri->vctrl, admin->vtype, in vcap_debugfs_show_keysets()
174 admin->cache.keystream, in vcap_debugfs_show_keysets()
175 admin->cache.maskstream, in vcap_debugfs_show_keysets()
183 out->prf(out->dst, " keysets:"); in vcap_debugfs_show_keysets()
185 out->prf(out->dst, " %s", in vcap_debugfs_show_keysets()
186 vcap_keyset_name(ri->vctrl, matches.keysets[idx])); in vcap_debugfs_show_keysets()
187 out->prf(out->dst, "\n"); in vcap_debugfs_show_keysets()
192 struct vcap_output_print *out) in vcap_debugfs_show_rule_keyset() argument
194 struct vcap_control *vctrl = ri->vctrl; in vcap_debugfs_show_rule_keyset()
195 struct vcap_admin *admin = ri->admin; in vcap_debugfs_show_rule_keyset()
199 vcap_debugfs_show_keysets(ri, out); in vcap_debugfs_show_rule_keyset()
200 out->prf(out->dst, " keyset_sw: %d\n", ri->keyset_sw); in vcap_debugfs_show_rule_keyset()
201 out->prf(out->dst, " keyset_sw_regs: %d\n", ri->keyset_sw_regs); in vcap_debugfs_show_rule_keyset()
203 list_for_each_entry(ckf, &ri->data.keyfields, ctrl.list) { in vcap_debugfs_show_rule_keyset()
204 keyfield = vcap_keyfields(vctrl, admin->vtype, ri->data.keyset); in vcap_debugfs_show_rule_keyset()
205 vcap_debugfs_show_rule_keyfield(vctrl, out, ckf->ctrl.key, in vcap_debugfs_show_rule_keyset()
206 keyfield, &ckf->data); in vcap_debugfs_show_rule_keyset()
213 struct vcap_output_print *out) in vcap_debugfs_show_rule_actionset() argument
215 struct vcap_control *vctrl = ri->vctrl; in vcap_debugfs_show_rule_actionset()
216 struct vcap_admin *admin = ri->admin; in vcap_debugfs_show_rule_actionset()
220 out->prf(out->dst, " actionset: %s\n", in vcap_debugfs_show_rule_actionset()
221 vcap_actionset_name(vctrl, ri->data.actionset)); in vcap_debugfs_show_rule_actionset()
222 out->prf(out->dst, " actionset_sw: %d\n", ri->actionset_sw); in vcap_debugfs_show_rule_actionset()
223 out->prf(out->dst, " actionset_sw_regs: %d\n", ri->actionset_sw_regs); in vcap_debugfs_show_rule_actionset()
225 list_for_each_entry(caf, &ri->data.actionfields, ctrl.list) { in vcap_debugfs_show_rule_actionset()
226 actionfield = vcap_actionfields(vctrl, admin->vtype, in vcap_debugfs_show_rule_actionset()
227 ri->data.actionset); in vcap_debugfs_show_rule_actionset()
228 vcap_debugfs_show_rule_actionfield(vctrl, out, caf->ctrl.action, in vcap_debugfs_show_rule_actionset()
230 &caf->data.u1.value); in vcap_debugfs_show_rule_actionset()
238 struct vcap_output_print *out, in vcap_show_admin_rule() argument
241 ri->counter.value = admin->cache.counter; in vcap_show_admin_rule()
242 ri->counter.sticky = admin->cache.sticky; in vcap_show_admin_rule()
243 out->prf(out->dst, in vcap_show_admin_rule()
245 ri->data.id, ri->addr, ri->addr + ri->size - 1, ri->size, in vcap_show_admin_rule()
246 ri->counter_id, ri->counter.value, ri->counter.sticky); in vcap_show_admin_rule()
247 out->prf(out->dst, " chain_id: %d\n", ri->data.vcap_chain_id); in vcap_show_admin_rule()
248 out->prf(out->dst, " user: %d\n", ri->data.user); in vcap_show_admin_rule()
249 out->prf(out->dst, " priority: %d\n", ri->data.priority); in vcap_show_admin_rule()
250 out->prf(out->dst, " state: "); in vcap_show_admin_rule()
251 switch (ri->state) { in vcap_show_admin_rule()
253 out->prf(out->dst, "permanent\n"); in vcap_show_admin_rule()
256 out->prf(out->dst, "disabled\n"); in vcap_show_admin_rule()
259 out->prf(out->dst, "enabled\n"); in vcap_show_admin_rule()
262 vcap_debugfs_show_rule_keyset(ri, out); in vcap_show_admin_rule()
263 vcap_debugfs_show_rule_actionset(ri, out); in vcap_show_admin_rule()
268 struct vcap_output_print *out) in vcap_show_admin_info() argument
270 const struct vcap_info *vcap = &vctrl->vcaps[admin->vtype]; in vcap_show_admin_info()
272 out->prf(out->dst, "name: %s\n", vcap->name); in vcap_show_admin_info()
273 out->prf(out->dst, "rows: %d\n", vcap->rows); in vcap_show_admin_info()
274 out->prf(out->dst, "sw_count: %d\n", vcap->sw_count); in vcap_show_admin_info()
275 out->prf(out->dst, "sw_width: %d\n", vcap->sw_width); in vcap_show_admin_info()
276 out->prf(out->dst, "sticky_width: %d\n", vcap->sticky_width); in vcap_show_admin_info()
277 out->prf(out->dst, "act_width: %d\n", vcap->act_width); in vcap_show_admin_info()
278 out->prf(out->dst, "default_cnt: %d\n", vcap->default_cnt); in vcap_show_admin_info()
279 out->prf(out->dst, "require_cnt_dis: %d\n", vcap->require_cnt_dis); in vcap_show_admin_info()
280 out->prf(out->dst, "version: %d\n", vcap->version); in vcap_show_admin_info()
281 out->prf(out->dst, "vtype: %d\n", admin->vtype); in vcap_show_admin_info()
282 out->prf(out->dst, "vinst: %d\n", admin->vinst); in vcap_show_admin_info()
283 out->prf(out->dst, "ingress: %d\n", admin->ingress); in vcap_show_admin_info()
284 out->prf(out->dst, "first_cid: %d\n", admin->first_cid); in vcap_show_admin_info()
285 out->prf(out->dst, "last_cid: %d\n", admin->last_cid); in vcap_show_admin_info()
286 out->prf(out->dst, "lookups: %d\n", admin->lookups); in vcap_show_admin_info()
287 out->prf(out->dst, "first_valid_addr: %d\n", admin->first_valid_addr); in vcap_show_admin_info()
288 out->prf(out->dst, "last_valid_addr: %d\n", admin->last_valid_addr); in vcap_show_admin_info()
289 out->prf(out->dst, "last_used_addr: %d\n", admin->last_used_addr); in vcap_show_admin_info()
294 struct vcap_output_print *out) in vcap_show_admin() argument
300 vcap_show_admin_info(vctrl, admin, out); in vcap_show_admin()
301 list_for_each_entry(elem, &admin->rules, list) { in vcap_show_admin()
308 out->prf(out->dst, "\n"); in vcap_show_admin()
309 vcap_show_admin_rule(vctrl, admin, out, to_intrule(vrule)); in vcap_show_admin()
317 struct vcap_output_print *out) in vcap_show_admin_raw() argument
320 enum vcap_type vt = admin->vtype; in vcap_show_admin_raw()
327 if (list_empty(&admin->rules)) in vcap_show_admin_raw()
334 ri = list_first_entry(&admin->rules, struct vcap_rule_internal, list); in vcap_show_admin_raw()
339 for (addr = admin->last_valid_addr; addr >= admin->first_valid_addr; in vcap_show_admin_raw()
340 --addr) { in vcap_show_admin_raw()
342 ret = vcap_addr_keysets(vctrl, ri->ndev, admin, addr, &kslist); in vcap_show_admin_raw()
348 if (addr % info->sw_per_item) { in vcap_show_admin_raw()
351 info->sw_per_item, in vcap_show_admin_raw()
354 out->prf(out->dst, " addr: %d, X%d rule, keysets:", in vcap_show_admin_raw()
356 info->sw_per_item); in vcap_show_admin_raw()
358 out->prf(out->dst, " %s", in vcap_show_admin_raw()
361 out->prf(out->dst, "\n"); in vcap_show_admin_raw()
370 struct vcap_port_debugfs_info *info = m->private; in vcap_port_debugfs_show()
372 struct vcap_output_print out = { in vcap_port_debugfs_show() local
377 list_for_each_entry(admin, &info->vctrl->list, list) { in vcap_port_debugfs_show()
378 if (admin->vinst) in vcap_port_debugfs_show()
380 info->vctrl->ops->port_info(info->ndev, admin, &out); in vcap_port_debugfs_show()
396 info->vctrl = vctrl; in vcap_port_debugfs()
397 info->ndev = ndev; in vcap_port_debugfs()
406 struct vcap_admin_debugfs_info *info = m->private; in vcap_debugfs_show()
407 struct vcap_output_print out = { in vcap_debugfs_show() local
413 mutex_lock(&info->admin->lock); in vcap_debugfs_show()
414 ret = vcap_show_admin(info->vctrl, info->admin, &out); in vcap_debugfs_show()
415 mutex_unlock(&info->admin->lock); in vcap_debugfs_show()
423 struct vcap_admin_debugfs_info *info = m->private; in vcap_raw_debugfs_show()
424 struct vcap_output_print out = { in vcap_raw_debugfs_show() local
430 mutex_lock(&info->admin->lock); in vcap_raw_debugfs_show()
431 ret = vcap_show_admin_raw(info->vctrl, info->admin, &out); in vcap_raw_debugfs_show()
432 mutex_unlock(&info->admin->lock); in vcap_raw_debugfs_show()
448 list_for_each_entry(admin, &vctrl->list, list) { in vcap_debugfs()
449 sprintf(name, "raw_%s_%d", vctrl->vcaps[admin->vtype].name, in vcap_debugfs()
450 admin->vinst); in vcap_debugfs()
454 info->vctrl = vctrl; in vcap_debugfs()
455 info->admin = admin; in vcap_debugfs()
458 sprintf(name, "%s_%d", vctrl->vcaps[admin->vtype].name, in vcap_debugfs()
459 admin->vinst); in vcap_debugfs()