Skip to content
This repository was archived by the owner on Jan 20, 2022. It is now read-only.

qemu/qmp: support hotplug a nic whose qdisc is mq#41

Merged
devimc merged 1 commit intokata-containers:masterfrom
caoruidong:support-mq
Aug 23, 2018
Merged

qemu/qmp: support hotplug a nic whose qdisc is mq#41
devimc merged 1 commit intokata-containers:masterfrom
caoruidong:support-mq

Conversation

@caoruidong
Copy link
Copy Markdown
Member

If we hotplug a nic with args mq=on, its qdisc will be mq by default.
This aligns with cold plug nics.

Signed-off-by: Ruidong Cao caoruidong@huawei.com

@caoruidong
Copy link
Copy Markdown
Member Author

From test results, mq can provide better performance than pfifo_fast. So this may be necessary.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.2%) to 79.745% when pulling c336316 on caoruidong:support-mq into 6aa35d3 on intel:master.

@coveralls
Copy link
Copy Markdown

coveralls commented Aug 23, 2018

Coverage Status

Coverage increased (+0.1%) to 80.042% when pulling 0286ff9 on caoruidong:support-mq into 6aa35d3 on intel:master.

qemu/qmp.go Outdated
// using the device_add command. devID is the id of the device to add.
// Must be valid QMP identifier. netdevID is the id of nic added by previous netdev_add.
func (q *QMP) ExecuteNetPCIDeviceAdd(ctx context.Context, netdevID, devID, macAddr, addr, bus string) error {
func (q *QMP) ExecuteNetPCIDeviceAdd(ctx context.Context, netdevID, devID, macAddr, addr, bus string, fdNum int) error {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

looks good, but could you add a comment explaining what is fdNum

qemu/qmp.go Outdated

if fdNum > 0 {
args["mq"] = "on"
args["vectors"] = 2*fdNum + 2
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

please add some comments explaining this. why 2 and not 3 or 4 ?

Copy link
Copy Markdown
Member Author

@caoruidong caoruidong Aug 23, 2018

Choose a reason for hiding this comment

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

If we hotplug a nic with args mq=on, its qdisc will be mq by default.
This aligns with cold plug nics.

Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
Copy link
Copy Markdown

@devimc devimc left a comment

Choose a reason for hiding this comment

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

thanks @caoruidong
lgtm

@devimc devimc merged commit cb112db into kata-containers:master Aug 23, 2018
Copy link
Copy Markdown
Contributor

@mcastelino mcastelino left a comment

Choose a reason for hiding this comment

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

LGTM.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants