Skip to content

Commit 35c6fa2

Browse files
authored
Update README.md (#139)
* Update README.md Signed-off-by: Ondrej Fabry <[email protected]> * Update README.md Signed-off-by: Ondrej Fabry <[email protected]> * Update TROUBLESHOOTING.md Signed-off-by: Ondrej Fabry <[email protected]> --------- Signed-off-by: Ondrej Fabry <[email protected]>
1 parent 20eb4ef commit 35c6fa2

File tree

2 files changed

+99
-111
lines changed

2 files changed

+99
-111
lines changed

README.md

+26-18
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,25 @@
1111

1212
The GoVPP repository contains Go client libraries, code bindings generator and other toolings for VPP.
1313

14-
Here is a brief summary of features provided by GoVPP:
14+
---
1515

16-
* Generator of Go bindings for VPP API
17-
* Go client library for VPP binary API & Stats API
18-
* Extendable code generator supporting custom plugins
19-
* Pure Go implementation of VPP binary API protocol
20-
* Efficient reader of VPP Stats data from shared memory
21-
* Simple client API that does not rely on VPP API semantics
22-
* Generated RPC client code that handles all boilerplate
23-
* ..and much more!
16+
## Features
2417

25-
---
18+
* 🆕 CLI app for interacting with VPP instance and development of VPP API (see [GoVPP CLI](https://github.com/FDio/govpp/blob/master/docs/GOVPP_CLI.md))
19+
* 🆕 Extendable code generator supporting custom plugins (see [Enhanced Generator](https://github.com/FDio/govpp/discussions/94))
20+
* 🆕 Generated RPC client code that handles all boilerplate (see [RPC Services](https://github.com/FDio/govpp/discussions/58))
21+
* Simple VPP client API that is not dependent on any VPP API semantics (see [Stream API](https://github.com/FDio/govpp/discussions/43))
22+
* Generator of Go bindings for VPP API schema (see [Binapi Generator](https://github.com/FDio/govpp/blob/master/docs/USER_GUIDE.md#binary-api-generator))
23+
* Go client library for VPP binary API & Stats API (see [VPP API calls](https://github.com/FDio/govpp/blob/master/docs/USER_GUIDE.md#vpp-api-calls))
24+
* Pure Go implementation of VPP binary API protocol (see [socketclient](https://github.com/FDio/govpp/blob/master/adapter/socketclient/socketclient.go))
25+
* Efficient reader of VPP Stats data from shared memory (see [stats client example](https://github.com/FDio/govpp/tree/master/examples/stats-client))
2626

2727
## Quick Start
2828

29-
Here is a code sample of an effortless way for calling the VPP API by using a generated RPC client.
29+
Here is a code sample of an effortless way for calling the VPP API services by using a generated RPC client.
30+
31+
> **Note**
32+
> For extensive info about using generated RPC client , see [RPC Services](https://github.com/FDio/govpp/discussions/58)
3033
3134
```go
3235
// Connect to VPP API socket
@@ -47,23 +50,28 @@ if err != nil {
4750
log.Print("Version: ", reply.Version)
4851
```
4952

50-
See complete example in [examples/rpc-service](examples/rpc-service).
53+
See complete code for the example above: [examples/rpc-service](examples/rpc-service).
5154

5255
### Examples
5356

54-
For all code examples demonstrating GoVPP features, please refer to the [examples](examples) directory.
57+
For complete code examples demonstrating vrious GoVPP features, please refer to the [examples](examples) directory.
5558

5659
## Documentation
5760

58-
Refer to [User Guide](docs/USER_GUIDE.md) document for all the basics. If you run into issues or just need help debugging read our [Troubleshooting](docs/TROUBLESHOOTING.md) document.
61+
Refer to [User Guide](docs/USER_GUIDE.md) document for info about how to use GoVPP.
62+
If you run into any issues or need some help with debugging GoVPP, read our [Troubleshooting](docs/TROUBLESHOOTING.md) document.
5963

60-
Go reference is available at https://pkg.go.dev/go.fd.io/govpp. More documentation can be found under [docs](docs) directory.
64+
Go reference docs are available at [pkg.go.dev](https://pkg.go.dev/go.fd.io/govpp).
65+
66+
For other documentation refer to [docs](docs) directory.
6167

6268
## How to contribute?
6369

64-
- Contribute code by submitting a [Pull Request](https://github.com/FDio/govpp/pulls).
65-
- Report bugs by opening an [Issue](https://github.com/FDio/govpp/issues).
66-
- Ask questions & open discussions by starting a [Discussion](https://github.com/FDio/govpp/discussions).
70+
Anyone insterested in GoVPP development is welcome to join our bi-weekly [📣 GoVPP Community Meeting](https://github.com/FDio/govpp/discussions/46), where we accept inputs from projects using GoVPP and have technical discussions about actual development.
71+
72+
- **Contribute code**: submit a [Pull Request](https://github.com/FDio/govpp/pulls)
73+
- **Report bugs**: open an [Issue](https://github.com/FDio/govpp/issues)
74+
- **Ask questions**: start a [Discussion](https://github.com/FDio/govpp/discussions)
6775

6876
## Repository Structure
6977

docs/TROUBLESHOOTING.md

+73-93
Original file line numberDiff line numberDiff line change
@@ -1,155 +1,135 @@
1-
# Troubleshooting guide
2-
3-
## Table of contents
4-
5-
* [Enable debug logs](#enable-debug-logs)
6-
+ [core](#core)
7-
+ [msgid](#msgid)
8-
+ [socketclient](#socketclient)
9-
+ [msgtable](#msgtable)
10-
+ [statsclient](#statsclient)
11-
+ [proxy](#proxy)
12-
+ [Binapi generator debug logs](#binapi-generator-debug-logs)
13-
* [Connection problems](#connection-problems)
1+
# Troubleshooting Guide
2+
3+
This document provides guidance for troubleshooting issues or any debugging for GoVPP.
4+
5+
---
6+
7+
**Table of contents**
8+
9+
* [Debug Logging](#debug-logging)
10+
+ [Enable Debug](#enable-debug)
11+
+ [Debug Components](#debug-components)
12+
- [Debug Message IDs](#debug-message-ids)
13+
- [Debug Socket Client](#debug-socket-client)
14+
- [Debug Binapi Generator](#debug-binapi-generator)
15+
- [Debug Stats Client](#debug-stats-client)
16+
- [Debug Proxy](#debug-proxy)
17+
* [Connection Problems](#connection-problems)
1418
+ [Socket file does not exist](#socket-file-does-not-exist)
1519
+ [Connection refused](#connection-refused)
1620
+ [Permission denied](#permission-denied)
1721
+ [The socket is not ready](#the-socket-is-not-ready)
1822
* [Problems with sending/receiving messages](#problems-with-sendingreceiving-messages)
1923
+ [Unknown message error](#unknown-message-error)
2024
+ [VPP not replying to some messages](#vpp-not-replying-to-some-messages)
21-
* [Message versioning, deprecated and in-progesss messages](#message-versioning-deprecated-and-in-progesss-messages)
22-
+ [Message versioning](#message-versioning)
25+
* [Message versioning](#message-versioning)
2326
+ [Deprecated messages](#deprecated-messages)
2427
+ [In-progress messages](#in-progress-messages)
2528

2629
---
2730

28-
## Enable debug logs
31+
## Debug Logging
2932

30-
This section describes how to increase log verbosity to enable debug logs of various GoVPP components.
33+
This section describes ways to enable debug logs for GoVPP and its components.
34+
Most of the debug logs is controlled via the environment variable `DEBUG_GOVPP`.
3135

32-
### core
36+
### Enable Debug
3337

34-
Set the environment variable `DEBUG_GOVPP` to any non-empty value.
38+
To enable debug logs for GoVPP core, set the environment variable `DEBUG_GOVPP` to a **non-empty value**.
3539

36-
Example:
37-
```
38-
DEBUG_GOVPP=y ./bin/rpc-service
40+
```sh
41+
DEBUG_GOVPP=y ./app
3942
```
4043

41-
To verify that it works, check for the following line in the console output:
44+
The following line will be printed to _stderr_ output during program initialization:
45+
4246
```
4347
DEBU[0000] govpp: debug level enabled
4448
```
4549

46-
### msgid
50+
### Debug Components
4751

48-
Assign value `msgid` to the variable `DEBUG_GOVPP`.
52+
The environment variable `DEBUG_GOVPP` can be used also to enable debug logs for other GoVPP components separately.
4953

50-
NOTE: To make msgid debugging work, you must also enable core debugging (in this case, it is enabled automatically, because `msgid` is a non-emtpy value).
54+
> **Note**
55+
> Multiple components can be enabled silmutaneously, by separating values with comma, e.g. `DEBUG_GOVPP=socketclient,msgtable`
5156
52-
Example:
53-
```
54-
DEBUG_GOVPP=msgid ./bin/rpc-service
55-
```
57+
#### Debug Message IDs
5658

57-
It should output lines similar to this:
59+
To enable debugging of message IDs, set `DEBUG_GOVPP=msgid`.
60+
61+
*log output sample:*
5862
```
5963
DEBU[0000] message "show_version" (show_version_51077d14) has ID: 1380
6064
```
6165

62-
### socketclient
66+
#### Debug Socket Client
6367

64-
Assign value `socketclient` to the variable `DEBUG_GOVPP`.
68+
To debug `socketclient` package, set `DEBUG_GOVPP=socketclient`.
6569

66-
Example:
70+
*log output sample:*
6771
```
68-
DEBUG_GOVPP=socketclient ./bin/rpc-service
72+
DEBU[0000] govpp: debug level enabled for socketclient
6973
```
7074

71-
To verify that it works, check for the following line in the console output:
75+
Additionally, to debug the message table retrieved upon connecting to socket, set `DEBUG_GOVPP=socketclient,msgtable`.
76+
77+
*log output sample:*
7278
```
73-
DEBU[0000] govpp: debug level enabled for socketclient
79+
DEBU[0000] - 1380: "show_version_51077d14" logger=govpp/socketclient
7480
```
7581

76-
### msgtable
82+
#### Debug Binapi Generator
7783

78-
Assign value `msgtable` to the variable `DEBUG_GOVPP`.
84+
To enable the basic debug logs in the binapi generator, pass the flag `-debug` to the program.
7985

80-
NOTE: To make msgtable debugging work, you must also enable socketclient debugging.
86+
Additionaly, to enable debug logs for the _parser_, assign value `DEBUG_GOVPP=parser` and
87+
to enable debug logs for the _generator_, set `DEBUG_GOVPP=binapigen`.
8188

82-
NOTE: To assign multiple values to a variable, you can separate the values with a colon.
89+
Examples:
90+
```bash
91+
# Enable debug logs
92+
./bin/binapi-generator -debug
8393

84-
Example:
85-
```
86-
DEBUG_GOVPP=socketclient:msgtable ./bin/rpc-service
94+
# Maximum verbosity
95+
DEBUG_GOVPP=parser,binapigen ./binapi-generator
8796
```
8897

89-
It should output lines similar to this:
90-
```
91-
DEBU[0000] - 1380: "show_version_51077d14" logger=govpp/socketclient
92-
```
93-
94-
### statsclient
95-
96-
Set the environment variable `DEBUG_GOVPP_STATS` to any non-empty value.
98+
#### Debug Stats Client
9799

98-
NOTE: statsclient debugging only works if package `go.fd.io/govpp/adapter/statsclient` is imported.
100+
To enable debug logs for `statsclient` package, set `DEBUG_GOVPP_STATS` to a non-empty value.
99101

100-
Example:
101-
```
102-
DEBUG_GOVPP_STATS=y ./bin/vpp-proxy server
102+
```sh
103+
DEBUG_GOVPP_STATS=y ./stats-client
103104
```
104105

105106
To verify that it works, check for the following line in the console output:
106107
```
107108
DEBU[0000] govpp/statsclient: enabled debug mode
108109
```
109110

110-
### proxy
111-
112-
Set the environment variable `DEBUG_GOVPP_PROXY` to any non-empty value.
111+
#### Debug Proxy
113112

114-
NOTE: proxy debugging only works if package `go.fd.io/govpp/proxy` is imported.
113+
To enable debug logs for `proxy` package, set `DEBUG_GOVPP_PROXY` to a non-empty value.
115114

116-
Example:
117-
```
118-
DEBUG_GOVPP_PROXY=y ./bin/vpp-proxy server
115+
```sh
116+
DEBUG_GOVPP_PROXY=y ./vpp-proxy server
119117
```
120118

121119
To verify that it works, check for the following line in the console output:
120+
122121
```
123122
DEBU[0000] govpp/proxy: debug mode enabled
124123
```
125124

126-
### Binapi generator debug logs
127-
128-
You can enable logs separately for vppapi parser and for binapi generator. The binapi generator has two verbosity levels.
129-
130-
To enable parser logs, assign value `parser` to the variable `DEBUG_GOVPP`.
131-
132-
To enable the first verbosity level for generator, pass the flag `-debug` when invoking the generator binary.
133-
134-
To enable the second verbosity level for generator, assign value `binapigen` to the variable `DEBUG_GOVPP`.
135-
136-
Examples:
137-
```bash
138-
# first verbosity level for generator
139-
./bin/binapi-generator -debug
140-
# maximum logs for all components
141-
DEBUG_GOVPP=parser:binapigen ./bin/binapi-generator
142-
```
143-
144-
145-
146-
## Connection problems
125+
## Connection Problems
147126

148127
This section describes various problems when GoVPP tries to connect to VPP.
149128

150129
### Socket file does not exist
151130

152131
**Symptoms**: You see the following error:
132+
153133
```
154134
ERROR: connecting to VPP failed: VPP API socket file /run/vpp/api.sock does not exist
155135
```
@@ -189,6 +169,7 @@ ERROR: connecting to VPP failed: VPP API socket file /run/vpp/api.sock does not
189169
### Connection refused
190170

191171
**Symptoms**: You see the following error:
172+
192173
```
193174
ERROR: connecting to VPP failed: dial unix /run/vpp/api.sock: connect: connection refused
194175
```
@@ -200,6 +181,7 @@ ERROR: connecting to VPP failed: dial unix /run/vpp/api.sock: connect: connectio
200181
### Permission denied
201182

202183
**Symptoms**: You see the following error:
184+
203185
```
204186
ERROR: connecting to VPP failed: dial unix /run/vpp/api.sock: connect: permission denied
205187
```
@@ -217,7 +199,6 @@ ERROR: connecting to VPP failed: dial unix /run/vpp/api.sock: connect: permissio
217199
(replace the `<ID>` with actual group ID; you can see the ID with `id -g`).
218200

219201
- If you are running VPP inside Docker container, run the container as current user's group (but keep the user as root), for example `docker run -it -v /run/vpp:/run/vpp -u 0:$(id -g) ligato/vpp-base:22.10`. In this case, do NOT use the `unix { gid ... }` in `startup.conf`.
220-
221202
- Run GoVPP with `sudo`.
222203

223204
- Manually change permissions or ownership of the socket file.
@@ -231,9 +212,8 @@ ERROR: connecting to VPP failed: dial unix /run/vpp/api.sock: connect: permissio
231212
- Increase the interval between reconnects (the third argument, `interval`, of the `govpp.AsyncConnect` function).
232213
- Increase the timeout for waiting for the socket existence (variable `MaxWaitReady` in the file `adapter/socketclient/socketclient.go`).
233214

234-
**NOTE**: The solutions apply only if you use the function `govpp.AsyncConnect`. If you instead use the function `govpp.Connect`, then GoVPP tries to connect immediately and only once, and if the socket does not exist, it immediately throws error. In this case, you have to ensure that the socket is ready before starting GoVPP.
235-
236-
215+
> **Note**
216+
> The solutions apply only if you use the function `govpp.AsyncConnect`. If you instead use the function `govpp.Connect`, then GoVPP tries to connect immediately and only once, and if the socket does not exist, it immediately throws error. In this case, you have to ensure that the socket is ready before starting GoVPP.
237217
238218
## Problems with sending/receiving messages
239219

@@ -257,11 +237,7 @@ To solve it, you can try the following:
257237
- Check if the VPP is frozen or crashed.
258238
- Try sending the message with different values.
259239

260-
261-
262-
## Message versioning, deprecated and in-progesss messages
263-
264-
### Message versioning
240+
## Message versioning
265241

266242
When a GoVPP's message is updated, the message itself is not changed. Instead, a new version of the message is added that has a `v2` (or `v3`, `v4`, ...) suffix to its name. The old version of the message is then marked as deprecated.
267243

@@ -270,6 +246,7 @@ When a GoVPP's message is updated, the message itself is not changed. Instead, a
270246
If a message is marked as deprecated, it should no longer be used. The message works fine for now, but it may be removed in the future. When a message is deprecated, there is likely available a new version of the message or an another message with a similar behaviour which should be used instead. Also, if some message is not deprecated, but there already exists a new version of the message, the new version should be used, as the older version may soon become deprecated.
271247

272248
For example, here is an excerpt from the file `binapi/vhost_user/vhost_user.ba.go` (as of 31-Oct-2022):
249+
273250
```go
274251
// CreateVhostUserIf defines message 'create_vhost_user_if'.
275252
// Deprecated: the message will be removed in the future versions
@@ -299,13 +276,15 @@ type CreateVhostUserIfV2Reply struct {
299276
// ...
300277
}
301278
```
279+
302280
The messages `CreateVhostUserIf` and `CreateVhostUserIfReply` are deprecated and should not be used. Instead, there are new versions of the messages: `CreateVhostUserIfV2` and `CreateVhostUserIfV2Reply`, which should be used.
303281

304282
### In-progress messages
305283

306284
When a new message is added, usually it is initially experimental and is marked as in-progress. In this case, an older message should be preferrably used. Later, when the message will be considered stable, the in-progress label will be removed, the message will become recommended to use and the old message may become deprecated.
307285

308286
For example, here is an excerpt from the file `binapi/ip/ip.ba.go` (as of 31-Oct-2022):
287+
309288
```go
310289
// IPRouteAddDel defines message 'ip_route_add_del'.
311290
type IPRouteAddDel struct {
@@ -335,4 +314,5 @@ type IPRouteAddDelV2Reply struct {
335314
// ...
336315
}
337316
```
317+
338318
In this case, the messages `IPRouteAddDel` and `IPRouteAddDelReply` should be used; the messages `IPRouteAddDelV2` and `IPRouteAddDelV2Reply` are in-progress.

0 commit comments

Comments
 (0)