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

Add set mtu device operation to netvsc #68

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

Conversation

samuelandrew
Copy link
Contributor

No description provided.

rte_rwlock_read_lock(&hv->vf_lock);
vf_dev = hn_get_vf_dev(hv);
if (hv->vf_ctx.vf_vsc_switched && vf_dev) {
ret = vf_dev->dev_ops->mtu_set(vf_dev, mtu);
Copy link
Contributor

Choose a reason for hiding this comment

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

A VF device can be hot added or removed. Look at hn_vf_add() on setting the mtu if VF is hot added

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added code to set the VF MTU on a hot add.


/* Close vmbus channels */
for (i = 0; i < hv->num_queues; i++)
rte_vmbus_chan_close(hv->channels[i]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to deal separately with the primary channel, as rte_vmbus_chan_close() doesn't delete it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function is currently used in 3 other places: in 2 of those 3, it is directly passed the primary channel. That makes it a no-op in those cases as well as the 0 index case here, as you point out. I could either (1) just call rte_free for the primary channel here, or (2) modify rte_vmbus_chan_close to handle closing the primary channel as well. Which do you prefer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ended up just calling rte_free for the primary channel here.

/* In case of error, attempt to restore original MTU */
if (hn_attach(hv, orig_mtu))
PMD_DRV_LOG(ERR, "Restoring original MTU failed");

Copy link
Contributor

Choose a reason for hiding this comment

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

In case of error, need to restore all subchannels on original mtu

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've refactored this so all subchannels would be restored if we are attempting to rollback to the original MTU.

…parate function. Move VF MTU change into separate function. Ensure that subchannels are reconnected if rolling back to original MTU.
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.

2 participants