Skip to content

Diagnostics for developers - #735

Open
MortenBroerup wants to merge 2 commits into
DPDK:mainfrom
MortenBroerup:diagnos
Open

MortenBroerup wants to merge 2 commits into
DPDK:mainfrom
MortenBroerup:diagnos

Conversation

@MortenBroerup

Copy link
Copy Markdown
Contributor

This series comprises of two patches:

1. Update the Client API to make the response payload size available to the client
The response payload size is already present in the response header, but the response header is not exposed to the client.
Without this Client API update, it would be necessary for variable size responses to include a length field in the response payload. Such a redundant length field can now be avoided, which makes the Grout code for both the api and the cli much cleaner for responses of this kind.

2. Add API and CLI for developer diagnostics
Initially, add message/command to dump various DPDK objects.
More messages/commands can be added later.

It is a resubmission of #725, with the CLI command changed from "diagnos" to "diagnostics".

Update the Client API receive functions to return the response payload
size on success, instead of returning 0.
Functions affected:
- gr_api_client_recv()
- gr_api_client_send_recv()

Update the Client API streaming macro accordingly: Use the "ret" variable
to provide the response payload size to the iterating function.
Macro affected:
- gr_api_client_stream_foreach()

The Client API event receive function returns the event header along
with the event payload to the client via the "event" output parameter.
Update this function to return the total size of the event (incl. the
event header) on success, instead of 0.
Also update this function to return the event (via the "event" output
parameter) when the payload length is zero, instead of returning NULL.
Note: Events without payload are currently not allowed in Grout, so the
latter change makes no practical difference. But it makes the code
cleaner, and prepares it for allowing empty events in Grout in the
future.
Function affected:
- gr_api_client_event_recv()

Update the gr_api_client_event_recv() caller in the cli accordingly, to
check for the updated success return value, instead of checking for 0.

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
Comment thread modules/infra/cli/diagnos.c Outdated
Add API and CLI for developer diagnostics.

Add message/command to dump various DPDK objects.
More messages/commands can be added later.

Note: Intended for developers only, so the available object types
and names are not enumerated for the CLI.

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
@MortenBroerup

Copy link
Copy Markdown
Contributor Author

@rjarry
The first patch in this series changes the return values of the Client API functions.
Inside the project, only one consumer of the Client API was affected by this change: modules/infra/cli/events.c

How are external consumers of the Client API notified about such an API change when the next version of Grout is released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant