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

sriov: Add WithRdmaMode method #790

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ajaggapa
Copy link
Contributor

No description provided.

Copy link
Collaborator

@klaskosk klaskosk left a comment

Choose a reason for hiding this comment

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

looks good just a couple minor comments

}

if mode == "" {
builder.errorMsg = "RdmaMode cannot be empty"
Copy link
Collaborator

Choose a reason for hiding this comment

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

could you please add a glog statement to both of the mode check if statements? something like

glog.V(100).Info("PoolConfig RdmaMode cannot be empty")

}

if mode != "shared" && mode != "exclusive" {
builder.errorMsg = "Invalid value for rdmaMode. It should be 'shared' or 'exclusive'"
Copy link
Collaborator

Choose a reason for hiding this comment

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

and for both of the error messages could you please change them to start with a lowercase letter?

Suggested change
builder.errorMsg = "Invalid value for rdmaMode. It should be 'shared' or 'exclusive'"
builder.errorMsg = "invalid value for rdmaMode. It should be 'shared' or 'exclusive'"

@ajaggapa ajaggapa force-pushed the rdmamode branch 3 times, most recently from 3bd4056 to fb25e1b Compare November 20, 2024 17:56
klaskosk
klaskosk previously approved these changes Nov 20, 2024
Copy link
Collaborator

@klaskosk klaskosk left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

@evgenLevin evgenLevin left a comment

Choose a reason for hiding this comment

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

/lgtm

@@ -255,6 +255,33 @@ func (builder *PoolConfigBuilder) WithMaxUnavailable(maxUnavailable intstrutil.I
return builder
}

// WithRdmaMode method sets rdmaMode to shared/exclusive.
func (builder *PoolConfigBuilder) WithRdmaMode(mode string) *PoolConfigBuilder {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: RDMA is acronym so worth using capital letters

Suggested change
func (builder *PoolConfigBuilder) WithRdmaMode(mode string) *PoolConfigBuilder {
func (builder *PoolConfigBuilder) WithRDMAMode(mode string) *PoolConfigBuilder {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done. PTAL

klaskosk
klaskosk previously approved these changes Nov 21, 2024
@@ -240,6 +240,40 @@ func TestWithMaxUnavailable(t *testing.T) {
}
}

func TestWithRdmaMode(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

another nit, but this could be updated to match the capitalization of the function

Suggested change
func TestWithRdmaMode(t *testing.T) {
func TestWithRDMAMode(t *testing.T) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done. ptal

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.

4 participants