Add set mtu device operation to netvsc#68
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.
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.
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.
Need to deal separately with the primary channel, as rte_vmbus_chan_close() doesn't delete it
There was a problem hiding this comment.
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.
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.
In case of error, need to restore all subchannels on original mtu
There was a problem hiding this comment.
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
f5e074d to
c164c58
Compare
00c144a to
660bde6
Compare
51bddcb to
9727c1b
Compare
No description provided.