-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a tool to inspect dpservice tables
- Loading branch information
Showing
43 changed files
with
1,379 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Dataplane Service Internal Inspection Tool | ||
`dpservice-inspect` is a tool to see internal state of dp-service. Currently, only hash-tables are accessible. | ||
|
||
## Command-line Options | ||
All options are described in `dpservice-inspect --help`, see [the markdown version of it](help_dpservice-inspect.md) | ||
|
||
## Disclaimer | ||
As this tool attaches to a live packet-processing dp-service, use it with caution. It should not cause performance degradation in packet-processing since the tool only reads shared-memory in a separate process. | ||
|
||
## Examples | ||
`dpservice-inspect` prints all supported hash-tables that can be viewed. | ||
|
||
`dpservice-inspect -t <table>` prints the number of entries in a given table | ||
|
||
`dpservice-inspect -t <table> --dump` prints the contents of the table | ||
|
||
You can choose the output format using `-o`. | ||
|
||
> By default, this tool uses `-1` as the NUMA socket. In practice dp-service will be utilizing NUMA and you need to specify it via `-s`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Command-line Options | ||
|
||
| Option | Argument | Description | Choices | | ||
|--------|----------|-------------|---------| | ||
| -h, --help | None | display this help and exit | | | ||
| -v, --version | None | display version and exit | | | ||
| -o, --output-format | FORMAT | format of the output | 'human' (default), 'table', 'csv' or 'json' | | ||
| -t, --table | NAME | hash table to choose | 'list' (default), 'conntrack', 'dnat', 'iface', 'lb', 'lb_id', 'portmap', 'portoverload', 'snat', 'vnf', 'vnf_rev' or 'vni' | | ||
| -s, --socket | NUMBER | NUMA socket to use | | | ||
| --dump | None | dump table contents | | | ||
|
||
> This file has been generated by dp_conf_generate.py. As such it should fully reflect the output of `--help`. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and IronCore contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include "common_ip.h" | ||
|
||
#include <stdio.h> | ||
#include <arpa/inet.h> | ||
|
||
char str_proto[16]; | ||
|
||
const char *get_str_ipproto(uint8_t proto) | ||
{ | ||
switch (proto) { | ||
case IPPROTO_IP: | ||
return "ip"; | ||
case IPPROTO_ICMP: | ||
return "icmp"; | ||
case IPPROTO_IPIP: | ||
return "ipip"; | ||
case IPPROTO_TCP: | ||
return "tcp"; | ||
case IPPROTO_UDP: | ||
return "udp"; | ||
case IPPROTO_IPV6: | ||
return "ipv6"; | ||
default: | ||
snprintf(str_proto, sizeof(str_proto), "%u", proto); | ||
return str_proto; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and IronCore contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#ifndef __COMMON_IP_H__ | ||
#define __COMMON_IP_H__ | ||
|
||
#include <stdint.h> | ||
|
||
const char *get_str_ipproto(uint8_t proto); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and IronCore contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include "common_vnf.h" | ||
|
||
const char *get_str_vnftype(enum dp_vnf_type type) | ||
{ | ||
switch (type) { | ||
case DP_VNF_TYPE_UNDEFINED: | ||
return "none"; | ||
case DP_VNF_TYPE_LB_ALIAS_PFX: | ||
return "lb_pfx"; | ||
case DP_VNF_TYPE_ALIAS_PFX: | ||
return "pfx"; | ||
case DP_VNF_TYPE_LB: | ||
return "lb"; | ||
case DP_VNF_TYPE_VIP: | ||
return "vip"; | ||
case DP_VNF_TYPE_NAT: | ||
return "nat"; | ||
case DP_VNF_TYPE_INTERFACE_IP: | ||
return "iface"; | ||
} | ||
return "?"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and IronCore contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#ifndef __COMMON_VNF_H__ | ||
#define __COMMON_VNF_H__ | ||
|
||
#include "dp_vnf.h" | ||
|
||
const char *get_str_vnftype(enum dp_vnf_type type); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"header": "opts.h", | ||
"source": "opts.c", | ||
"markdown": "../../docs/deployment/help_dpservice-inspect.md", | ||
"options": [ | ||
{ | ||
"shopt": "o", | ||
"lgopt": "output-format", | ||
"arg": "FORMAT", | ||
"help": "format of the output", | ||
"var": "output_format", | ||
"type": "enum", | ||
"choices": [ "human", "table", "csv", "json" ], | ||
"default": "human" | ||
}, | ||
{ | ||
"shopt": "t", | ||
"lgopt": "table", | ||
"arg": "NAME", | ||
"help": "hash table to choose", | ||
"var": "table", | ||
"type": "enum", | ||
"choices": [ "list", "conntrack", "dnat", "iface", "lb", "lb_id", "portmap", "portoverload", "snat", "vnf", "vnf_rev", "vni" ], | ||
"default": "list" | ||
}, | ||
{ | ||
"shopt": "s", | ||
"lgopt": "socket", | ||
"arg": "NUMBER", | ||
"help": "NUMA socket to use", | ||
"var": "numa_socket", | ||
"type": "int", | ||
"default": -1 | ||
}, | ||
{ | ||
"lgopt": "dump", | ||
"help": "dump table contents", | ||
"var": "dump", | ||
"type": "bool", | ||
"default": "false" | ||
} | ||
] | ||
} |
Oops, something went wrong.