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/xnet: Return an error if invalid sequence number received #9424

Merged
merged 1 commit into from
Oct 11, 2023

Conversation

sydidelot
Copy link
Member

If compiled with --enable-debug, the provider would fail an assertion if the sequence number received in the header doesn't match the one expected.

Crashing on an assertion failure is fine for programming errors, but the assertion failure described above relies on external events: it may for example trigger because of a buffers corrupted by the TCP stack or the physical layer.

Instead of an assertion failure, the function returns an error code, which will cause the EP to be disabled as a consequence.

If compiled with --enable-debug, the provider would fail an
assertion if the sequence number received in the header doesn't
match the one expected.

Crashing on an assertion failure is fine for programming errors,
but the assertion failure described above relies on external events:
it may for example trigger because of a buffers corrupted by the
TCP stack or the physical layer.

Instead of an assertion failure, the function returns an error
code, which will cause the EP to be disabled as a consequence.

Signed-off-by: Sylvain Didelot <sdidelot@ddn.com>
"Received invalid hdr sequence number\n");
return -FI_EIO;
}
#endif
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to make the id an always on check?

Copy link
Member Author

Choose a reason for hiding this comment

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

The problem with making the id an always on check is that it would change the wire protocol: sender is required to set the id, which never happens if debug is disabled.

Copy link
Member

Choose a reason for hiding this comment

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

That's a good point. It's not worth breaking the protocol for this. I think the provider may be able to negotiate this during connection setup. That may be worthwhile, even if the field is kept as debug only. That might also address Bernard's comment on #7844.

For now, I'm good with this change.

@bsbernd
Copy link

bsbernd commented Oct 11, 2023

Btw, relates to #7844

@shefty shefty merged commit de68933 into ofiwg:main Oct 11, 2023
10 of 12 checks passed
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.

3 participants