Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

rpma: adopt usage_to_access to support iWARP specificity #1044

Conversation

ldorau
Copy link
Member

@ldorau ldorau commented May 5, 2021

This change is Reviewable

@codecov
Copy link

codecov bot commented May 5, 2021

Codecov Report

Merging #1044 (e442b98) into master (100789d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head e442b98 differs from pull request most recent head c8c0323. Consider uploading reports for the commit c8c0323 to get more accurate results

@@           Coverage Diff           @@
##           master    #1044   +/-   ##
=======================================
  Coverage   99.83%   99.84%           
=======================================
  Files          15       15           
  Lines        1247     1251    +4     
=======================================
+ Hits         1245     1249    +4     
  Misses          2        2           

@ldorau ldorau force-pushed the rpma-adopt-usage_to_access-to-support-iWARP-specificity branch from 4881eb8 to ad6a127 Compare May 5, 2021 11:02
Copy link

@janekmi janekmi left a comment

Choose a reason for hiding this comment

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

Reviewed 10 of 10 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @ldorau)


src/peer.c, line 32 at r1 (raw file):

};

/* helper functions */

This is not a helper any more. It is an internal API now.


src/peer.c, line 54 at r1 (raw file):

		access |= IBV_ACCESS_LOCAL_WRITE;

		/* XXX */

Just a reminder.


tests/unit/peer/peer-common.h, line 28 at r1 (raw file):

 * RPMA_MR_USAGE_* values.
 */
#define MOCK_USAGE		(unsigned)255

Can we just make it a combination instead of using a hardcoded value?


tests/unit/peer/peer-mr_reg.c, line 40 at r1 (raw file):

	struct ibv_mr *mr = NULL;
	int ret = rpma_peer_mr_reg(peer, &mr, MOCK_ADDR,
				MOCK_LEN, MOCK_USAGE);

Since the usage -> access calculation is now a part of the peer module I think also the testing of it should go here.
Moreover, we will need two protection domains: one iWARP and one non-iWARP to test both implementations.

@ldorau ldorau force-pushed the rpma-adopt-usage_to_access-to-support-iWARP-specificity branch 2 times, most recently from 1cca380 to bfe7459 Compare May 5, 2021 11:45
Copy link
Member Author

@ldorau ldorau left a comment

Choose a reason for hiding this comment

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

Reviewable status: 8 of 10 files reviewed, 4 unresolved discussions (waiting on @janekmi)


src/peer.c, line 32 at r1 (raw file):

Previously, janekmi (Jan Michalski) wrote…

This is not a helper any more. It is an internal API now.

Done.


src/peer.c, line 54 at r1 (raw file):

Previously, janekmi (Jan Michalski) wrote…

Just a reminder.

Done.


tests/unit/peer/peer-common.h, line 28 at r1 (raw file):

Previously, janekmi (Jan Michalski) wrote…

Can we just make it a combination instead of using a hardcoded value?

Done.


tests/unit/peer/peer-mr_reg.c, line 40 at r1 (raw file):

Previously, janekmi (Jan Michalski) wrote…

Since the usage -> access calculation is now a part of the peer module I think also the testing of it should go here.
Moreover, we will need two protection domains: one iWARP and one non-iWARP to test both implementations.

Can it be done as a separate pull request?

Copy link

@janekmi janekmi left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r2.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ldorau)


src/peer.c, line 33 at r2 (raw file):

/*
 * usage_to_access -- convert usage to access

Name.


src/peer.c, line 80 at r2 (raw file):

}

/* internal librpma API */

Bring it one function up. ;-)


tests/unit/peer/peer-mr_reg.c, line 40 at r1 (raw file):

Previously, ldorau (Lukasz Dorau) wrote…

Can it be done as a separate pull request?

I can agree to it if you will leave a big XXX somewhere. xD

@ldorau ldorau force-pushed the rpma-adopt-usage_to_access-to-support-iWARP-specificity branch from bfe7459 to 7c1e8de Compare May 5, 2021 12:00
Copy link
Member Author

@ldorau ldorau left a comment

Choose a reason for hiding this comment

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

Reviewable status: 9 of 10 files reviewed, 3 unresolved discussions (waiting on @janekmi and @ldorau)


src/peer.c, line 33 at r2 (raw file):

Previously, janekmi (Jan Michalski) wrote…

Name.

Done.


src/peer.c, line 80 at r2 (raw file):

Previously, janekmi (Jan Michalski) wrote…

Bring it one function up. ;-)

Done.

@ldorau ldorau force-pushed the rpma-adopt-usage_to_access-to-support-iWARP-specificity branch from 7c1e8de to e1703a3 Compare May 5, 2021 12:51
Copy link
Member Author

@ldorau ldorau left a comment

Choose a reason for hiding this comment

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

Reviewable status: 7 of 10 files reviewed, 3 unresolved discussions (waiting on @janekmi)


tests/unit/peer/peer-mr_reg.c, line 40 at r1 (raw file):

Previously, janekmi (Jan Michalski) wrote…

I can agree to it if you will leave a big XXX somewhere. xD

Done.

@ldorau ldorau force-pushed the rpma-adopt-usage_to_access-to-support-iWARP-specificity branch 2 times, most recently from cf5c2cb to 5fbfa08 Compare May 5, 2021 12:53
Copy link

@janekmi janekmi left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r3.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ldorau)


tests/unit/peer/peer-mr_reg.c, line 166 at r3 (raw file):

	struct ibv_pd *mock_ibv_pd = MOCK_IBV_PD;

	int n_iters = sizeof(usage2access) / sizeof(struct usage2access_s);

These should come as prestates.


tests/unit/peer/peer-mr_reg.c, line 166 at r3 (raw file):

	struct ibv_pd *mock_ibv_pd = MOCK_IBV_PD;

	int n_iters = sizeof(usage2access) / sizeof(struct usage2access_s);

Having these, tests for rpma_mr_reg() are too extensive: https://github.com/pmem/rpma/blob/master/tests/unit/mr/mr-reg.c#L23

@ldorau ldorau force-pushed the rpma-adopt-usage_to_access-to-support-iWARP-specificity branch 2 times, most recently from 4886bc5 to c861cad Compare May 6, 2021 10:36
Copy link
Member Author

@ldorau ldorau left a comment

Choose a reason for hiding this comment

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

Reviewable status: 8 of 11 files reviewed, 2 unresolved discussions (waiting on @janekmi and @ldorau)


tests/unit/peer/peer-mr_reg.c, line 166 at r3 (raw file):

Previously, janekmi (Jan Michalski) wrote…

These should come as prestates.

Done.

@ldorau ldorau force-pushed the rpma-adopt-usage_to_access-to-support-iWARP-specificity branch 2 times, most recently from 191031f to 4d31802 Compare May 6, 2021 10:49
Copy link
Member Author

@ldorau ldorau left a comment

Choose a reason for hiding this comment

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

Reviewable status: 8 of 12 files reviewed, 2 unresolved discussions (waiting on @janekmi)


tests/unit/peer/peer-mr_reg.c, line 166 at r3 (raw file):

Previously, janekmi (Jan Michalski) wrote…

Having these, tests for rpma_mr_reg() are too extensive: https://github.com/pmem/rpma/blob/master/tests/unit/mr/mr-reg.c#L23

Done.

Copy link

@janekmi janekmi left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r4.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @ldorau)


tests/unit/peer/peer-common.h, line 47 at r4 (raw file):

	int is_odp_capable;
	struct rpma_peer *peer;
};

Please put this structure just before setup__peer_prestates().


tests/unit/peer/peer-common.h, line 55 at r4 (raw file):

int teardown__peer(void **peer_ptr);

int setup__peer_prestates(void **in_out);

pprestate


tests/unit/peer/peer-common.h, line 56 at r4 (raw file):

int setup__peer_prestates(void **in_out);
int teardown__peer_prestates(void **peer_ptr);

.


tests/unit/peer/peer-common.c, line 81 at r4 (raw file):

 * Note:
 * - in - int is_odp_capable
 * - out - struct rpma_peer *

Copy-pasted inadequately.

@ldorau ldorau force-pushed the rpma-adopt-usage_to_access-to-support-iWARP-specificity branch from 4d31802 to e442b98 Compare May 6, 2021 11:50
Copy link
Member Author

@ldorau ldorau left a comment

Choose a reason for hiding this comment

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

Reviewable status: 10 of 12 files reviewed, 4 unresolved discussions (waiting on @janekmi)


tests/unit/peer/peer-common.h, line 47 at r4 (raw file):

Previously, janekmi (Jan Michalski) wrote…

Please put this structure just before setup__peer_prestates().

Done.


tests/unit/peer/peer-common.h, line 55 at r4 (raw file):

Previously, janekmi (Jan Michalski) wrote…

pprestate

Done.


tests/unit/peer/peer-common.h, line 56 at r4 (raw file):

Previously, janekmi (Jan Michalski) wrote…

.

Done.


tests/unit/peer/peer-common.c, line 81 at r4 (raw file):

Previously, janekmi (Jan Michalski) wrote…

Copy-pasted inadequately.

It is not the same as in setup__peer() - I have changed it, but perhaps it will be better to remove it at all.

@ldorau ldorau force-pushed the rpma-adopt-usage_to_access-to-support-iWARP-specificity branch from e442b98 to c8c0323 Compare May 6, 2021 12:03
Copy link

@janekmi janekmi left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r5.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ldorau)

Copy link
Contributor

@osalyk osalyk left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ldorau)

@janekmi janekmi merged commit 20cd3d0 into pmem:master May 6, 2021
@ldorau ldorau deleted the rpma-adopt-usage_to_access-to-support-iWARP-specificity branch May 7, 2021 08:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants