Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the code covers the init procedure of the card up to QUERY_HCA_CAP which fails with "bad block number".
The init procedure so far allocates the command queue and initializes it, and there's some handy methods to send commands with input and output data. The commands are sent synchronously, one at a time (so only the first position of the queue is ever populated) and polled for completion. Later in the init procedure (this is not done!) we'll initialize an event queue and we'll be able to send commands asynchronously and use events to check for completion.
The selftest function does some testing on the bit utilities and tries to initialize the card(s) based on
SNABB_PCI_CONNECTX4[0|1]
env var(s).The development was done entirely on lugano-4 on 100G cards.
Below is a handy script that will pull the code, reset the cards and run the selftest function. Use it to achieve a fast dev-run cycle if you prefer to edit the code on your home machine (you'll have to make your editor do a commit+push on save).