-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
base: main
Are you sure you want to change the base?
Conversation
…us channels to pre-existing queues
drivers/net/netvsc/hn_ethdev.c
Outdated
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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]); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
drivers/net/netvsc/hn_ethdev.c
Outdated
/* In case of error, attempt to restore original MTU */ | ||
if (hn_attach(hv, orig_mtu)) | ||
PMD_DRV_LOG(ERR, "Restoring original MTU failed"); | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
0ddff06
to
a3d2c69
Compare
eb5cf3d
to
39fbd37
Compare
No description provided.