]>
Commit | Line | Data |
---|---|---|
acddc0ed | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
36c3b296 AK |
2 | /* |
3 | * Zebra dataplane plugin for DPDK based hw offload | |
4 | * | |
5 | * Copyright (C) 2021 Nvidia | |
6 | * Donald Sharp | |
36c3b296 AK |
7 | */ |
8 | #include <zebra.h> | |
9 | ||
10 | #include "lib/json.h" | |
11 | #include "zebra/dpdk/zebra_dplane_dpdk.h" | |
12 | ||
36c3b296 | 13 | #include "zebra/dpdk/zebra_dplane_dpdk_vty_clippy.c" |
36c3b296 AK |
14 | |
15 | #define ZD_STR "Zebra dataplane information\n" | |
16 | #define ZD_DPDK_STR "DPDK offload information\n" | |
17 | ||
18 | DEFPY(zd_dpdk_show_counters, zd_dpdk_show_counters_cmd, | |
19 | "show dplane dpdk counters", | |
20 | SHOW_STR ZD_STR ZD_DPDK_STR "show counters\n") | |
21 | { | |
22 | zd_dpdk_stat_show(vty); | |
23 | ||
24 | return CMD_SUCCESS; | |
25 | } | |
26 | ||
a66d6246 AK |
27 | |
28 | DEFPY (zd_dpdk_show_ports, | |
29 | zd_dpdk_show_ports_cmd, | |
30 | "show dplane dpdk port [(1-32)$port_id] [detail$detail] [json$json]", | |
31 | SHOW_STR | |
32 | ZD_STR | |
33 | ZD_DPDK_STR | |
34 | "show port info\n" | |
35 | "DPDK port identifier\n" | |
36 | "Detailed information\n" | |
37 | JSON_STR) | |
38 | { | |
39 | bool uj = !!json; | |
40 | bool ud = !!detail; | |
41 | ||
42 | if (!port_id) | |
43 | port_id = ZD_DPDK_INVALID_PORT; | |
44 | zd_dpdk_port_show(vty, port_id, uj, ud); | |
45 | ||
46 | return CMD_SUCCESS; | |
47 | } | |
48 | ||
49 | ||
7f0416b3 AK |
50 | DEFPY (zd_dpdk_show_pbr_flows, |
51 | zd_dpdk_show_pbr_flows_cmd, | |
52 | "show dplane dpdk pbr flows", | |
53 | SHOW_STR | |
54 | ZD_STR | |
55 | ZD_DPDK_STR | |
56 | "show pbr info\n" | |
57 | "DPDK flows\n") | |
58 | { | |
59 | zd_dpdk_pbr_flows_show(vty); | |
60 | ||
61 | return CMD_SUCCESS; | |
62 | } | |
63 | ||
64 | ||
36c3b296 AK |
65 | void zd_dpdk_vty_init(void) |
66 | { | |
67 | install_element(VIEW_NODE, &zd_dpdk_show_counters_cmd); | |
a66d6246 | 68 | install_element(VIEW_NODE, &zd_dpdk_show_ports_cmd); |
7f0416b3 | 69 | install_element(VIEW_NODE, &zd_dpdk_show_pbr_flows_cmd); |
36c3b296 | 70 | } |