-
Notifications
You must be signed in to change notification settings - Fork 20
ON-15146: Enable ZF_ATTR shrub_controller_id for enabling tcpdirect stacks to work with a given shrub_controller #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
return -EINVAL; | ||
} | ||
|
||
rc = setenv("EF_SHRUB_CONTROLLER", shrub_controller_char , 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you prefer I adjust the ef_alloc_vi_from_pd to functions to take the shrub_controller parameter here? This just seems like an easier solution with fewer wider changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too sure how I feel about setenv
here. It does indeed feel like it's probably the easiest way to get this done, but equally some kind of ef_vi_set_shrub_controller
function might feel more pragmatic. I'm not too familiar with the structure of shrub though, so if such an approach is too cumbersome it might be a good idea to stick with setenv
for now.
4b1d4c5
to
7df8931
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable, mainly just a few notes on avoiding magic numbers.
@@ -346,6 +346,13 @@ ZF_ATTR(int, phys_address_mode, stable, 0, NULL, | |||
"\n" | |||
"0 - Don't enable physical addressing mode. User space sees virtual addresses \n" | |||
" which are translated by hardware or in the kernel.") | |||
|
|||
ZF_ATTR(int, shrub_controller_id, stable, -1, NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if appropriate to add here, but I think it would be nice to have a macro (or otherwise) for the "no shrub" value, e.g.:
#define ZF_SHRUB_CONTROLLER_ID_NO_SHRUB -1
return -EINVAL; | ||
} | ||
|
||
rc = setenv("EF_SHRUB_CONTROLLER", shrub_controller_char , 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too sure how I feel about setenv
here. It does indeed feel like it's probably the easiest way to get this done, but equally some kind of ef_vi_set_shrub_controller
function might feel more pragmatic. I'm not too familiar with the structure of shrub though, so if such an approach is too cumbersome it might be a good idea to stick with setenv
for now.
…tacks to work with a given shrub_controller
7df8931
to
e719a1a
Compare
TESTING DONE:
On machine 1)
sudo shrub_controller -c 37 -d
In a new terminal
ZF_ATTR="interface=enp1s0f0;shrub_controller_id=37" ./build/gnu_x86_64/bin/zf_apps/static/zfsink 224.0.2.23:8080
With the above, i see the interfaces negotiate with the shrub_controller
ci Info: shrub_controller created a new server on interface with ifindex 3 buffer_count 4 hwport 5
zf_stackdump dump also shows shrub_controller_id
If a user attempts to set the shrub_controller as -2, or 100000
[krishd@dellr230t tcpdirect]$ ZF_ATTR="interface=enp1s0f0;shrub_controller_id=10000" ./build/bin/zf_apps/static/zfsink 224.0.2.23:808
0
1000 | Bad shrub_controller_id; value must be -1 or in range 0 to 9999
ERROR: main: ZF_TRY(zf_stack_alloc(attr, &stack)) failed
ERROR: at src/tests/zf_apps//zfsink.c:265
ERROR: rc=-22 (Invalid argument) errno=0
If a user attempts to connect to a controller that is not running.
[krishd@dellr230t tcpdirect]$ ZF_ATTR="interface=enp1s0f0;shrub_controller_id=38" ./build/bin/zf_apps/static/zfsink 224.0.2.23:8080
1000 | Failed to allocate VI (rc = -2)
ERROR: main: ZF_TRY(zf_stack_alloc(attr, &stack)) failed
ERROR: at src/tests/zf_apps//zfsink.c:265
ERROR: rc=-2 (No such file or directory) errno=2
Aborted (core dumped)