Skip to content
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

prov/tcp: implement FI_FIREWALL_ADDR for AV inserts #10724

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ooststep
Copy link
Contributor

@ooststep ooststep commented Jan 24, 2025

This PR introduces a new fi_av_insert flag, FI_FIREWALL_ADDR, which indicates that an av insert should fail if there is not already an established connection to the peer and the provider has no means to circumvent the firewall. The PR also implements the functionality for the TCP provider (and RXM provider, though this is not the primary goal).

I do still need to add a fabtest for the feature but wanted to push this up for initial review in the meantime.

resolves #10637
replaces #10534

include/rdma/fabric.h Outdated Show resolved Hide resolved
prov/util/src/rxm_av.c Outdated Show resolved Hide resolved
man/fi_av.3.md Outdated Show resolved Hide resolved
prov/util/src/rxm_av.c Show resolved Hide resolved
FI_FIREWALL_ADDR indicates to the provider that the inserted addresses
may be restricted by a firewall

Signed-off-by: Stephen Oost <[email protected]>
@ooststep ooststep changed the title prov/tcp: implement FI_NO_CONNECT for AV inserts prov/tcp: implement FI_FIREWALL_ADDR for AV inserts Feb 5, 2025
peer = node->data;
peer->refcnt++;
*peer = node->data;
(*peer)->refcnt++;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set ret = FI_SUCCESS here to avoid an extra branch on return.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something is off in the flag settings. A peer might be inserted in response to a connection request (xnet_process_connreq). In that case, peer->av_flags = 0. When an address is inserted with FI_FIREWALL_ADDR, the peer will be found, but peer->av_flags won't be adjusted.

I think you need (*peer)->av_flags |= flags; here.

*peer = rxm_alloc_peer(av, addr);
if (!*peer)
ret = -FI_ENOMEM;
(*peer)->av_flags = flags;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be part of an else, or this results in a crash.

struct util_peer_addr *
util_get_peer(struct rxm_av *av, const void *addr)

int util_get_peer(struct rxm_av *av, const void *addr, struct util_peer_addr **peer,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: check line length

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

Successfully merging this pull request may close these issues.

Handling TCP traffic restricted by a firewall
2 participants